xmcp 1.12.0 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/client.js +1 -1
- package/dist/cloudflare.js +1 -1
- package/dist/config.js +1 -1
- package/dist/index.js +15 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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 n=o.prototype.equal,s=a.prototype.equal;i.restore=function(){o.prototype.equal=n,a.prototype.equal=s}},6507(e,t,r){"use strict";let o=r(5317),a=r(8388),i=r(442);function n(e,t,r){let n=a(e,t,r),s=o.spawn(n.command,n.args,n.options);return i.hookChildProcess(s,n),s}e.exports=n,e.exports.spawn=n,e.exports.sync=function(e,t,r){let n=a(e,t,r),s=o.spawnSync(n.command,n.args,n.options);return s.error=s.error||i.verifyENOENTSync(s.status,n),s},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),n=r(1880),s="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(!s)return e;let r=(e.file=a(e),(t=e.file&&n(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 n(e,t){let r,n=e.options.env||process.env,s=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:n[i({env:n})],pathExt:t?o.delimiter:void 0})}catch(e){}finally{c&&process.chdir(s)}return r&&(r=o.resolve(l?e.options.cwd:"",r)),r}e.exports=function(e){return n(e)||n(e,!0)}},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 n(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),n=r+1,s=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++]),s-l<c)throw Error('"seq" specified length of "'+c+'", only "'+(s-l)+'" remaining');if(2!==e[l++])throw Error('Could not find expected "int" for "r"');var u=e[l++];if(s-l-2<u)throw Error('"r" specified length of "'+u+'", only "'+(s-l-2)+'" available');if(n<u)throw Error('"r" specified length of "'+u+'", max of "'+n+'" 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(s-l!==p)throw Error('"s" specified length of "'+p+'", expected "'+(s-l)+'"');if(n<p)throw Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var f=l;if((l+=p)!==s)throw Error('Expected to consume entire buffer, but "'+(s-l)+'" bytes remain');var h=r-u,m=r-p,y=o.allocUnsafe(h+u+m+p);for(l=0;l<h;++l)y[l]=0;e.copy(y,l,d+Math.max(-h,0),d+u),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=a(t),s=e.length;if(s!==2*r)throw TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+s+'"');var l=n(e,0,r),c=n(e,r,e.length),u=r-l,d=r-c,p=2+u+1+1+d,f=p<128,h=o.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++]=u,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,c<0?(h[m++]=0,e.copy(h,m,r)):e.copy(h,m,r+c),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+'"')}},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,n,s,l,c,u;return e.isFile()&&(r=e,o=t,a=r.mode,i=r.uid,n=r.gid,s=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&&n===l||a&c&&i===s||a&(c|u)&&0===s)}},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(2781).satisfies(process.version,">=15.7.0")},953(e,t,r){e.exports=r(2781).satisfies(process.version,"^6.12.0 || >=8.0.0")},455(e,t,r){e.exports=r(2781).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"]},n={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let s=i[r];if(!s)throw Error(`Unknown key type "${r}".`);if(!s.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${s.join(", ")}.`);if(o)switch(r){case"ec":let l=t.asymmetricKeyDetails.namedCurve,c=n[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),n=r(3263),s=r(5357),l=r(6782),c=r(5250),u=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"];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:s.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: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 b(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 s,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 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(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{s=e,b(_,!0,s,"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(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&&f(a),n.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=n.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),n=r(2548),s=r(4559),l=r(723),c=r(953),u=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"];c&&(h.splice(h.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{_=n(e,{complete:!0})}catch(e){return v(e)}if(!_)return v(new o("invalid token"));let w=_.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"));b=t}else b=function(e,r){return r(null,t)};return b(w,function(t,n){let c;if(t)return v(new o("error in secret or public key callback: "+t.message));let b=""!==$[2].trim();if(!b&&n)return v(new o("jwt signature is required"));if(b&&!n)return v(new o("secret or public key must be provided"));if(!b&&!r.algorithms)return v(new o('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 o("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 o("invalid algorithm"));if(w.alg.startsWith("HS")&&"secret"!==n.type)return v(new o(`secretOrPublicKey must be a symmetric key when using ${w.alg}`));if(/^(?:RS|PS|ES)/.test(w.alg)&&"public"!==n.type)return v(new o(`secretOrPublicKey must be an asymmetric key when using ${w.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{l(w.alg,n)}catch(e){return v(e)}try{c=u.verify(e,_.header.alg,n)}catch(e){return v(e)}if(!c)return v(new o("invalid signature"));let E=_.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=s(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:_.signature}):v(null,E)})}},2357(e,t,r){var o,a=r(6608).Buffer,i=r(6982),n=r(9053),s=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 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(s.format.bind(s,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 f((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 _(e){return function(t,r,o){var i=g(e)(t,o);return v(a.from(r),a.from(i))}}function b(e){return function(t,r){p(r),t=y(t);var o=i.createSign("RSA-SHA"+e);return f((o.update(t),o.sign(r,"base64")))}}function S(e){return function(t,r,o){d(o),t=y(t),r=h(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 f((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=h(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=b(e);return function(){var r=t.apply(null,arguments);return n.derToJose(r,"ES"+e)}}function R(e){var t=S(e);return function(r,o,a){return t(r,o=n.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:b,ps:$,es:E,none:P})[r](o),verify:({hs:_,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),n=r(2203),s=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,n=e.payload,u=e.secret||e.privateKey,d=e.encoding,p=i(a.alg),f=(t=(t=d)||"utf8",r=c(s(a),"binary"),o=c(s(n),t),l.format("%s.%s",r,o)),h=p.sign(f,u);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 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,n),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),n=r(2203),s=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 f(e,t,r){if(!t){var o=Error("Missing algorithm parameter for jws.verify");throw o.code="MISSING_ALGORITHM",o}var a=d(e=s(e)),n=e.split(".",2).join(".");return i(t).verify(n,a,r)}function h(e,t){if(t=t||{},!p(e=s(e)))return null;var r,a,i=u(e);if(!i)return null;var n=(r=r||"utf8",a=e.split(".")[1],o.from(a,"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 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,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,o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,n=/^0o[0-7]+$/i,s=/^(?:0|[1-9]\d*)$/,l=parseInt;function c(e){return e!=e}var u=Object.prototype,d=u.hasOwnProperty,p=u.toString,f=u.propertyIsEnumerable,h=(t=Object.keys,r=Object,function(e){return t(r(e))}),m=Math.max,y=Array.isArray;function g(e){var t,r,o;return null!=e&&"number"==typeof(t=e.length)&&t>-1&&t%1==0&&t<=0x1fffffffffffff&&"[object Function]"!=(o=v(r=e)?p.call(r):"")&&"[object GeneratorFunction]"!=o}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function _(e){return!!e&&"object"==typeof e}e.exports=function(e,t,r,b){e=g(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}(g(e)?function(e){var t,r,o,a,i=y(e)||_(r=t=e)&&g(r)&&d.call(t,"callee")&&(!f.call(t,"callee")||"[object Arguments]"==p.call(t))?function(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o}(e.length,String):[],n=i.length,l=!!n;for(var c in e){d.call(e,c)&&!(l&&("length"==c||(o=c,(a=null==(a=n)?0x1fffffffffffff:a)&&("number"==typeof o||s.test(o))&&o>-1&&o%1==0&&o<a)))&&i.push(c)}return i}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||u))return h(e);var t,r,o=[];for(var a in Object(e))d.call(e,a)&&"constructor"!=a&&o.push(a);return o}(e),function(t){return e[t]}):[]}(e),r=r&&!b?(w=($=(S=r)?1/0===(S=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||_(t)&&"[object Symbol]"==p.call(t))return 0/0;if(v(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=v(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var s=i.test(e);return s||n.test(e)?l(e.slice(2),s?2:8):a.test(e)?0/0:+e}(S))||-1/0===S?(S<0?-1:1)*17976931348623157e292:S==S?S:0:0===S?S:0)%1,$==$?w?$-w:$:0):0;var S,$,w,E,R=e.length;return r<0&&(r=m(R+r,0)),"string"==typeof(E=e)||!y(E)&&_(E)&&"[object String]"==p.call(E)?r<=R&&e.indexOf(t,r)>-1:!!R&&function(e,t,r){if(t!=t){for(var o=e.length,a=r+-1;++a<o;)if(c(e[a]))return a;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=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,i=parseInt,n=Object.prototype.toString;function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var l,c,u;return"number"==typeof e&&e==(u=(c=(l=e)?1/0===(l=function(e){if("number"==typeof e)return e;if("symbol"==typeof(l=e)||l&&"object"==typeof l&&"[object Symbol]"==n.call(l))return 0/0;if(s(e)){var l,c="function"==typeof e.valueOf?e.valueOf():e;e=s(c)?c+"":c}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var u=o.test(e);return u||a.test(e)?i(e.slice(2),u?2:8):r.test(e)?0/0:+e}(l))||-1/0===l?(l<0?-1:1)*17976931348623157e292:l==l?l:0:0===l?l:0)%1,c==c?u?c-u:c: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,n=a.call(Object),s=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]"!=s.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)==n}},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=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,i=parseInt,n=Object.prototype.toString;function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var l,c,u,d,p=2,f=e;if("function"!=typeof f)throw TypeError("Expected a function");return u=(c=(l=p)?1/0===(l=function(e){if("number"==typeof e)return e;if("symbol"==typeof(l=e)||l&&"object"==typeof l&&"[object Symbol]"==n.call(l))return 0/0;if(s(e)){var l,c="function"==typeof e.valueOf?e.valueOf():e;e=s(c)?c+"":c}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var u=o.test(e);return u||a.test(e)?i(e.slice(2),u?2:8):r.test(e)?0/0:+e}(l))||-1/0===l?(l<0?-1:1)*17976931348623157e292:l==l?l:0:0===l?l:0)%1,p=c==c?u?c-u:c:0,function(){return--p>0&&(d=f.apply(this,arguments)),p<=1&&(f=void 0),d}}},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,n,s=typeof e;if("string"===s&&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"===s&&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":(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 o=r(181),a=o.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function n(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=o:(i(o,t),t.Buffer=n),n.prototype=Object.create(a.prototype),i(a,n),n.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return a(e,t,r)},n.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},n.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return a(e)},n.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return o.SlowBuffer(e)}},1096(e,t,r){"use strict";let o=Symbol("SemVer ANY");e.exports=class e{static get ANY(){return o}constructor(t,r){if(r=a(r),t instanceof e)if(t.loose===!!r.loose)return t;else t=t.value;l("comparator",t=t.trim().split(/\s+/).join(" "),r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===o?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(e){let t=this.options.loose?i[n.COMPARATORLOOSE]:i[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 c(r[2],this.options.loose):this.semver=o}toString(){return this.value}test(e){if(l("Comparator.test",e,this.options.loose),this.semver===o||e===o)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return s(e,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new u(t.value,r).test(this.value):""===t.operator?""===t.value||new u(this.value,r).test(t.semver):!((r=a(r)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===t.value)||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||s(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||s(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">"))}};let a=r(5203),{safeRe:i,t:n}=r(3486),s=r(4407),l=r(6064),c=r(2732),u=r(5007)},5007(e,t,r){"use strict";let o=/\s+/g;e.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;else return new e(t.raw,r);if(t instanceof n)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.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){let e=this.set[0];if(this.set=this.set.filter(e=>!v(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(1===e.length&&_(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){e=e.replace(g,"");let t=((this.options.includePrerelease&&m)|(this.options.loose&&y))+":"+e,r=a.get(t);if(r)return r;let o=this.options.loose,i=o?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];s("hyphen replace",e=e.replace(i,j(this.options.includePrerelease))),s("comparator trim",e=c(e)),s("tilde trim",e=e.replace(u[p.TILDETRIM],f)),s("caret trim",e=e.replace(u[p.CARETTRIM],h));let l=e.split(" ").map(e=>S(e,this.options)).join(" ").split(/\s+/).map(e=>T(e,this.options));o&&(l=l.filter(e=>(s("loose invalid filter",e,this.options),!!e.match(u[p.COMPARATORLOOSE])))),s("range list",l);let d=new Map;for(let e of l.map(e=>new n(e,this.options))){if(v(e))return[e];d.set(e.value,e)}d.size>1&&d.has("")&&d.delete("");let _=[...d.values()];return a.set(t,_),_}intersects(t,r){if(!(t instanceof e))throw TypeError("a Range is required");return this.set.some(e=>b(e,r)&&t.set.some(t=>b(t,r)&&e.every(e=>t.every(t=>e.intersects(t,r)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(C(this.set[t],e,this.options))return!0;return!1}};let a=new(r(7762)),i=r(5203),n=r(1096),s=r(6064),l=r(2732),c=r(764),{safeRe:u,src:d,t:p,tildeTrimReplace:f,caretTrimReplace:h}=r(3486),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:y}=r(82),g=RegExp(d[p.BUILD],"g"),v=e=>"<0.0.0-0"===e.value,_=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},S=(e,t)=>(s("comp",e=e.replace(u[p.BUILD],""),t),s("caret",e=R(e,t)),s("tildes",e=w(e,t)),s("xrange",e=k(e,t)),s("stars",e=x(e,t)),e),$=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{let r=t.loose?u[p.TILDELOOSE]:u[p.TILDE],o=t.includePrerelease?"-0":"";return e.replace(r,(t,r,a,i,n)=>{let l;return s("tilde",e,t,r,a,i,n),$(r)?l="":$(a)?l=`>=${r}.0.0${o} <${+r+1}.0.0-0`:$(i)?l=`>=${r}.${a}.0${o} <${r}.${+a+1}.0-0`:n?(s("replaceTilde pr",n),l=`>=${r}.${a}.${i}-${n} <${r}.${+a+1}.0-0`):l=`>=${r}.${a}.${i} <${r}.${+a+1}.0-0`,s("tilde return",l),l})},R=(e,t)=>e.trim().split(/\s+/).map(e=>P(e,t)).join(" "),P=(e,t)=>{s("caret",e,t);let r=t.loose?u[p.CARETLOOSE]:u[p.CARET],o=t.includePrerelease?"-0":"";return e.replace(r,(t,r,a,i,n)=>{let l;return s("caret",e,t,r,a,i,n),$(r)?l="":$(a)?l=`>=${r}.0.0${o} <${+r+1}.0.0-0`:$(i)?l="0"===r?`>=${r}.${a}.0${o} <${r}.${+a+1}.0-0`:`>=${r}.${a}.0${o} <${+r+1}.0.0-0`:n?(s("replaceCaret pr",n),l="0"===r?"0"===a?`>=${r}.${a}.${i}-${n} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i}-${n} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i}-${n} <${+r+1}.0.0-0`):(s("no pr"),l="0"===r?"0"===a?`>=${r}.${a}.${i} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i} <${+r+1}.0.0-0`),s("caret return",l),l})},k=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>O(e,t)).join(" ")),O=(e,t)=>{e=e.trim();let r=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(r,(r,o,a,i,n,l)=>{let c,u,d;if(s("xRange",e,r,o,a,i,n,l),c=a,u=i,d=n,$(c)&&!$(u)||$(u)&&d&&!$(d))return e;let p=$(a),f=p||$(i),h=f||$(n);return"="===o&&h&&(o=""),l=t.includePrerelease?"-0":"",p?r=">"===o||"<"===o?"<0.0.0-0":"*":o&&h?(f&&(i=0),n=0,">"===o?(o=">=",f?(a=+a+1,i=0):i=+i+1,n=0):"<="===o&&(o="<",f?a=+a+1:i=+i+1),"<"===o&&(l="-0"),r=`${o+a}.${i}.${n}${l}`):f?r=`>=${a}.0.0${l} <${+a+1}.0.0-0`:h&&(r=`>=${a}.${i}.0${l} <${a}.${+i+1}.0-0`),s("xRange return",r),r})},x=(e,t)=>(s("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),T=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),j=e=>(t,r,o,a,i,n,s,l,c,u,d,p)=>(r=$(o)?"":$(a)?`>=${o}.0.0${e?"-0":""}`:$(i)?`>=${o}.${a}.0${e?"-0":""}`:n?`>=${r}`:`>=${r}${e?"-0":""}`,l=$(c)?"":$(u)?`<${+c+1}.0.0-0`:$(d)?`<${c}.${+u+1}.0-0`:p?`<=${c}.${u}.${d}-${p}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`,`${r} ${l}`.trim()),C=(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(s(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}},2732(e,t,r){"use strict";let o=r(6064),{MAX_LENGTH:a,MAX_SAFE_INTEGER:i}=r(82),{safeRe:n,t:s}=r(3486),l=r(5203),{compareIdentifiers:c}=r(3867);e.exports=class e{constructor(t,r){if(r=l(r),t instanceof e)if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;else t=t.version;else if("string"!=typeof t)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>a)throw TypeError(`version is longer than ${a} characters`);o("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let c=t.trim().match(r.loose?n[s.LOOSE]:n[s.FULL]);if(!c)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+c[1],this.minor=+c[2],this.patch=+c[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");c[4]?this.prerelease=c[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=c[5]?c[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(t){if(o("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return(t instanceof e||(t=new e(t,this.options)),this.major<t.major)?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return -1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],a=t.prerelease[r];if(o("prerelease compare",r,e,a),void 0===e&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===e)return -1;else if(e===a)continue;else return c(e,a)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],a=t.build[r];if(o("build compare",r,e,a),void 0===e&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===e)return -1;else if(e===a)continue;else return c(e,a)}while(++r)}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[s.PRERELEASELOOSE]:n[s.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]),((e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let t=0;t<r.length;t++)if(0!==c(e[t],r[t]))return!1;return!0})(this.prerelease,t)?isNaN(this.prerelease[t.split(".").length])&&(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}}},206(e,t,r){"use strict";let o=r(264);e.exports=(e,t)=>{let r=o(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},4407(e,t,r){"use strict";let o=r(2729),a=r(7751),i=r(6452),n=r(8993),s=r(5131),l=r(5720);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 n(e,r,c);case"<":return s(e,r,c);case"<=":return l(e,r,c);default:throw TypeError(`Invalid operator: ${t}`)}}},4210(e,t,r){"use strict";let o=r(2732),a=r(264),{safeRe:i,t:n}=r(3486);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[n.COERCERTLFULL]:i[n.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[n.COERCEFULL]:i[n.COERCE]);if(null===r)return null;let s=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(`${s}.${l}.${c}${u}${d}`,t)}},1029(e,t,r){"use strict";let o=r(2732);e.exports=(e,t,r)=>{let a=new o(e,r),i=new o(t,r);return a.compare(i)||a.compareBuild(i)}},5723(e,t,r){"use strict";let o=r(2072);e.exports=(e,t)=>o(e,t,!0)},2072(e,t,r){"use strict";let o=r(2732);e.exports=(e,t,r)=>new o(e,r).compare(new o(t,r))},3744(e,t,r){"use strict";let o=r(264);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 n=i>0,s=n?r:a,l=n?a:r,c=!!s.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(s))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"}},2729(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>0===o(e,t,r)},6452(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>o(e,t,r)>0},8993(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>o(e,t,r)>=0},4119(e,t,r){"use strict";let o=r(2732);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}}},5131(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>0>o(e,t,r)},5720(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>0>=o(e,t,r)},4226(e,t,r){"use strict";let o=r(2732);e.exports=(e,t)=>new o(e,t).major},118(e,t,r){"use strict";let o=r(2732);e.exports=(e,t)=>new o(e,t).minor},7751(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>0!==o(e,t,r)},264(e,t,r){"use strict";let o=r(2732);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}}},6949(e,t,r){"use strict";let o=r(2732);e.exports=(e,t)=>new o(e,t).patch},3081(e,t,r){"use strict";let o=r(264);e.exports=(e,t)=>{let r=o(e,t);return r&&r.prerelease.length?r.prerelease:null}},2538(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>o(t,e,r)},5981(e,t,r){"use strict";let o=r(1029);e.exports=(e,t)=>e.sort((e,r)=>o(r,e,t))},2798(e,t,r){"use strict";let o=r(5007);e.exports=(e,t,r)=>{try{t=new o(t,r)}catch(e){return!1}return t.test(e)}},9583(e,t,r){"use strict";let o=r(1029);e.exports=(e,t)=>e.sort((e,r)=>o(e,r,t))},233(e,t,r){"use strict";let o=r(264),a=r(82),i=r(2732),n=e=>e.startsWith("pre");e.exports=(e,t,r)=>{let s,l;if(!a.RELEASE_TYPES.includes(t))return null;let c=(s=e,l=r,o(s instanceof i?s.version:s,l));return c&&((e,t)=>{if(n(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0}return e.format()})(c,t)}},3937(e,t,r){"use strict";let o=r(264);e.exports=(e,t)=>{let r=o(e,t);return r?r.version:null}},2781(e,t,r){"use strict";let o=r(3486),a=r(82),i=r(2732),n=r(3867),s=r(264),l=r(3937),c=r(206),u=r(4119),d=r(3744),p=r(4226),f=r(118),h=r(6949),m=r(3081),y=r(2072),g=r(2538),v=r(5723),_=r(1029),b=r(9583),S=r(5981),$=r(6452),w=r(5131),E=r(2729),R=r(7751),P=r(8993),k=r(5720),O=r(4407),x=r(4210),T=r(233),j=r(1096),C=r(5007),I=r(2798),N=r(775),A=r(9700),M=r(7782),q=r(21),z=r(9354),L=r(3019),D=r(1179),U=r(8422),V=r(1412);e.exports={parse:s,valid:l,clean:c,inc:u,diff:d,major:p,minor:f,patch:h,prerelease:m,compare:y,rcompare:g,compareLoose:v,compareBuild:_,sort:b,rsort:S,gt:$,lt:w,eq:E,neq:R,gte:P,lte:k,cmp:O,coerce:x,truncate:T,Comparator:j,Range:C,satisfies:I,toComparators:N,maxSatisfying:A,minSatisfying:M,minVersion:q,validRange:z,outside:L,gtr:D,ltr:U,intersects:V,simplifyRange:r(7077),subset:r(3152),SemVer:i,re:o.re,src:o.src,tokens:o.t,SEMVER_SPEC_VERSION:a.SEMVER_SPEC_VERSION,RELEASE_TYPES:a.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers}},82(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,WHITESPACE_CHARACTERS:[" ","\n","\v","\f","\r"," ","\xa0"," "," "," "," "," "," "," "," "," "," "," "," ","\u2028","\u2029"," "," "," ","\uFEFF"],RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},6064(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):()=>{}},3867(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)}},7762(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}}},5203(e){"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},3486(e,t,r){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:i}=r(82),n=r(6064),s=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],d=t.t={},p=0,f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,a]],m=(e,t,r)=>{let o=(e=>{for(let[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),a=p++;n(e,a,t),d[e]=a,c[a]=t,u[a]=o,s[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-]${f}*`),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",`${f}+`),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*$")},764(e,t,r){"use strict";let{MAX_LENGTH:o,MAX_SAFE_BUILD_LENGTH:a,WHITESPACE_CHARACTERS:i}=r(82),n=new Uint8Array(65536);for(let e of i)n[e.charCodeAt(0)]=1;let s=e=>void 0!==e&&1===n[e.charCodeAt(0)],l=e=>"v"===e||"="===e||s(e),c=e=>void 0!==e&&e>="0"&&e<="9",u=e=>void 0!==e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"),d=e=>c(e)||u(e)||"-"===e,p=e=>c(e)||"x"===e||"X"===e||"*"===e,f=(e,t,r,o)=>{if(!c(e[t]))return t;if(t>=o.start&&t<o.end)return Math.min(t+r,o.end);if(t>=o.previousStart&&t<o.previousEnd)return Math.min(t+r,o.previousEnd);let a=t+1;for(;c(e[a]);)a++;return o.previousStart=o.start,o.previousEnd=o.end,o.start=t,o.end=a,Math.min(t+r,a)},h=(e,t,r,a)=>r||"0"!==e[t]?f(e,t,r?o:o+1,a):t+1,m=(e,t,r,i)=>{let n=f(e,t,o,i);if(u(e[n])||"-"===e[n]){let t=n+1,r=t+a;for(;t<r&&d(e[t]);)t++;return t}return h(e,t,r,i)},y=(e,t,r,o)=>{let a="-"===e[t];if(!r&&!a)return t;let i=t+ +!!a,n=m(e,i,r,o);if(n===i){if(!r||!a)return t;n=m(e,t,r,o)}for(;"."===e[n];){let t=m(e,n+1,r,o);if(t===n+1)break;n=t}return n},g=(e,t)=>{let r=t;for(;r-t<a&&d(e[r]);)r++;return r},v=(e,t)=>{if("+"!==e[t])return t;let r=g(e,t+1);if(r===t+1)return t;for(;"."===e[r];){let t=g(e,r+1);if(t===r+1)break;r=t}return r},_=(e,t,r)=>c(e[t])?h(e,t,!1,r):p(e[t])?t+1:t,b=(e,t,r)=>{let o=((e,t,r)=>{let o=t;for(let a=0;a<3;a++){let i=h(e,o,!0,r);if(i===o)return t;if(o=i,a<2){if("."!==e[o])return t;o++}}let a=y(e,o,!0,r);return v(e,a)})(e,t,r);return o!==t?o:((e,t,r)=>{let o=_(e,t,r);for(let t=0;t<2;t++){if("."!==e[o])return o;let t=_(e,o+1,r);if(t===o+1)return o;o=t}let a=y(e,o,!1,r);return v(e,a)})(e,t,r)},S=(e,t)=>{let r=t;return s(e[r])&&r++,("<"===e[r]||">"===e[r])&&r++,"="===e[r]&&r++,s(e[r])?r:-1};e.exports=e=>{let t="",r=0,o=0,a={start:-1,end:-1,previousStart:-1,previousEnd:-1};for(;o<e.length;){let i=o;if("<"===e[o]||">"===e[o])o++;else if(!l(e[o])&&!p(e[o])){o++;continue}for(;o<e.length&&l(e[o]);)o++;if(!p(e[o]))continue;let n=S(e,i);-1!==n&&(t+=e.slice(r,n),r=n+1),o=b(e,o,a)}return t+e.slice(r)}},1179(e,t,r){"use strict";let o=r(3019);e.exports=(e,t,r)=>o(e,t,">",r)},1412(e,t,r){"use strict";let o=r(5007);e.exports=(e,t,r)=>(e=new o(e,r),t=new o(t,r),e.intersects(t,r))},8422(e,t,r){"use strict";let o=r(3019);e.exports=(e,t,r)=>o(e,t,"<",r)},9700(e,t,r){"use strict";let o=r(2732),a=r(5007);e.exports=(e,t,r)=>{let i=null,n=null,s=null;try{s=new a(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(!i||-1===n.compare(e))&&(n=new o(i=e,r))}),i}},7782(e,t,r){"use strict";let o=r(2732),a=r(5007);e.exports=(e,t,r)=>{let i=null,n=null,s=null;try{s=new a(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(!i||1===n.compare(e))&&(n=new o(i=e,r))}),i}},21(e,t,r){"use strict";let o=r(2732),a=r(5007),i=r(6452);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],n=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">=":(!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}},3019(e,t,r){"use strict";let o=r(2732),a=r(1096),{ANY:i}=a,n=r(5007),s=r(2798),l=r(6452),c=r(5131),u=r(5720),d=r(8993);e.exports=(e,t,r,p)=>{let f,h,m,y,g;switch(e=new o(e,p),t=new n(t,p),r){case">":f=l,h=u,m=c,y=">",g=">=";break;case"<":f=c,h=d,m=l,y="<",g="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,p))return!1;for(let r=0;r<t.set.length;++r){let o=t.set[r],n=null,s=null;if(o.forEach(e=>{e.semver===i&&(e=new a(">=0.0.0")),n=n||e,s=s||e,f(e.semver,n.semver,p)?n=e:m(e.semver,s.semver,p)&&(s=e)}),n.operator===y||n.operator===g||(!s.operator||s.operator===y)&&h(e,s.semver)||s.operator===g&&m(e,s.semver))return!1}return!0}},7077(e,t,r){"use strict";let o=r(2798),a=r(2072);e.exports=(e,t,r)=>{let i=[],n=null,s=null,l=e.sort((e,t)=>a(e,t,r));for(let e of l)o(e,t,r)?(s=e,n||(n=e)):(s&&i.push([n,s]),s=null,n=null);n&&i.push([n,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}},3152(e,t,r){"use strict";let o=r(5007),a=r(1096),{ANY:i}=a,n=r(2798),s=r(2072),l=[new a(">=0.0.0-0")],c=[new a(">=0.0.0")],u=(e,t,r)=>{let o,a,u,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: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=s(o.semver,a.semver,r))>0||0===u&&(">="!==o.operator||"<="!==a.operator)))return null;for(let e of g){if(o&&!n(e,String(o),r)||a&&!n(e,String(a),r))return null;for(let o of t)if(!n(e,String(o),r))return!1;return!0}let v=!!a&&!r.includePrerelease&&!!a.semver.prerelease.length&&a.semver,_=!!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(_&&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(o,e,r))===e&&f!==o)return!1}else if(">="===o.operator&&!e.test(o.semver))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((h=p(a,e,r))===e&&h!==a)return!1}else if("<="===a.operator&&!e.test(a.semver))return!1}if(!e.operator&&(a||o)&&0!==u)return!1}return(!o||!m||!!a||0===u)&&(!a||!y||!!o||0===u)&&!_&&!v&&!0},d=(e,t,r)=>{if(!e)return t;let o=s(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=s(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}},775(e,t,r){"use strict";let o=r(5007);e.exports=(e,t)=>new o(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},9354(e,t,r){"use strict";let o=r(5007);e.exports=(e,t)=>{try{return new o(e,t).range||"*"}catch(e){return null}}},600(e,t,r){"use strict";let o=r(7257);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}},7257(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?";":":",n=r(9344),s=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)],n=o?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=o?n.split(r):[""];return o&&-1!==e.indexOf(".")&&""!==s[0]&&s.unshift(""),{pathEnv:a,pathExt:s,pathExtExe:n}},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,n)=>{if(r===o.length)return t.all&&u.length?i(u):n(s(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,s)=>{if(o===i.length)return a(d(r+1));let l=i[o];n(e+l,{pathExt:c},(i,n)=>{if(!i&&n)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 s=0;s<r.length;s++){let l=r[s],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(n.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 s(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")},7016(e){"use strict";e.exports=require("url")},9023(e){"use strict";e.exports=require("util")},4953(t){"use strict";t.exports=e},8717(e,t,r){var o=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(e){throw t=0,e}},a=o((e,t)=>{function r(e){return"string"==typeof e?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}t.exports={parseBoolean:r,optionsFromEnv:function(e=process.env){let t={};for(let o of["ENCODING","PATH","QUIET","DEBUG","OVERRIDE","FAST"]){let a=null!=e[`DOTENV_${o}`]?e[`DOTENV_${o}`]:e[`DOTENV_CONFIG_${o}`];null!=a&&(t[o.toLowerCase()]="ENCODING"===o||"PATH"===o?a:r(a))}return t}}}),i=o((e,t)=>{var o=r(9896),i=r(6928),n=r(857),{URL:s,fileURLToPath:l}=r(7016),{parseBoolean:c,optionsFromEnv:u}=a(),d=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg,p=new Uint8Array(256);for(let e=48;e<=57;e++)p[e]=1;for(let e=65;e<=90;e++)p[e]=1;for(let e=97;e<=122;e++)p[e]=1;function f(e){return e<=32?32===e||e>=9&&e<=13:e>=160&&(160===e||5760===e||e>=8192&&e<=8202||8232===e||8233===e||8239===e||8287===e||12288===e||65279===e)}function h(e){return 10===e||8232===e||8233===e}function m(e){console.log(`┆ ${e}`)}function y(e){return"~"===e[0]?i.join(n.homedir(),e.slice(1)):e}p[45]=1,p[46]=1,p[95]=1;var g={configDotenv:function(e){e=function(e={}){let t={...e};for(let e of Object.keys(t))void 0===t[e]&&delete t[e];return{...u(),...t}}(e);let t=i.resolve(process.cwd(),".env"),r="utf8",a=process.env;e&&null!=e.processEnv&&(a=e.processEnv);let n=c(e&&e.debug);e&&e.encoding?r=e.encoding:n&&m("no encoding is specified (UTF-8 is used by default)");let d=[t];if(e&&e.path)if(Array.isArray(e.path))for(let t of(d=[],e.path))d.push(y(t));else d=[y(e.path)];let p,f={},h={fast:e.fast};for(let t of d)try{let a=g.parse(o.readFileSync(t,{encoding:r}),h);g.populate(f,a,e)}catch(e){n&&m(`failed to load ${t} ${e.message}`),p=e}let v=g.populate(a,f,e),_=c(Object.prototype.hasOwnProperty.call(e,"quiet")?e.quiet:u(a).quiet);if(n||!_){var b;let e=Object.keys(v).length,t=[];for(let e of d)try{let r=i.relative(process.cwd(),e instanceof s?l(e):e);t.push(r)}catch(t){n&&m(`failed to load ${e} ${t.message}`),p=t}b=`injected env (${e}) from ${t.join(",")}`,console.error(`◇ ${b}`)}return p?{parsed:f,error:p}:{parsed:f}},config:function(e){return g.configDotenv(e)},parse:function(e,t){return t&&c(t.fast)?function(e){let t={},r="string"==typeof e?e:e.toString();-1!==r.indexOf("\r")&&(r=r.replace(/\r\n?/g,`
|
|
1
|
+
(()=>{var e,t,r={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 n=o.prototype.equal,s=a.prototype.equal;i.restore=function(){o.prototype.equal=n,a.prototype.equal=s}},6507(e,t,r){"use strict";let o=r(5317),a=r(8388),i=r(442);function n(e,t,r){let n=a(e,t,r),s=o.spawn(n.command,n.args,n.options);return i.hookChildProcess(s,n),s}e.exports=n,e.exports.spawn=n,e.exports.sync=function(e,t,r){let n=a(e,t,r),s=o.spawnSync(n.command,n.args,n.options);return s.error=s.error||i.verifyENOENTSync(s.status,n),s},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),n=r(1880),s="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(!s)return e;let r=(e.file=a(e),(t=e.file&&n(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 n(e,t){let r,n=e.options.env||process.env,s=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:n[i({env:n})],pathExt:t?o.delimiter:void 0})}catch(e){}finally{c&&process.chdir(s)}return r&&(r=o.resolve(l?e.options.cwd:"",r)),r}e.exports=function(e){return n(e)||n(e,!0)}},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 n(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),n=r+1,s=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++]),s-l<c)throw Error('"seq" specified length of "'+c+'", only "'+(s-l)+'" remaining');if(2!==e[l++])throw Error('Could not find expected "int" for "r"');var u=e[l++];if(s-l-2<u)throw Error('"r" specified length of "'+u+'", only "'+(s-l-2)+'" available');if(n<u)throw Error('"r" specified length of "'+u+'", max of "'+n+'" 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(s-l!==p)throw Error('"s" specified length of "'+p+'", expected "'+(s-l)+'"');if(n<p)throw Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var f=l;if((l+=p)!==s)throw Error('Expected to consume entire buffer, but "'+(s-l)+'" bytes remain');var h=r-u,m=r-p,y=o.allocUnsafe(h+u+m+p);for(l=0;l<h;++l)y[l]=0;e.copy(y,l,d+Math.max(-h,0),d+u),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=a(t),s=e.length;if(s!==2*r)throw TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+s+'"');var l=n(e,0,r),c=n(e,r,e.length),u=r-l,d=r-c,p=2+u+1+1+d,f=p<128,h=o.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++]=u,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,c<0?(h[m++]=0,e.copy(h,m,r)):e.copy(h,m,r+c),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+'"')}},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,n,s,l,c,u;return e.isFile()&&(r=e,o=t,a=r.mode,i=r.uid,n=r.gid,s=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&&n===l||a&c&&i===s||a&(c|u)&&0===s)}},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(2781).satisfies(process.version,">=15.7.0")},953(e,t,r){e.exports=r(2781).satisfies(process.version,"^6.12.0 || >=8.0.0")},455(e,t,r){e.exports=r(2781).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"]},n={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let s=i[r];if(!s)throw Error(`Unknown key type "${r}".`);if(!s.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${s.join(", ")}.`);if(o)switch(r){case"ec":let l=t.asymmetricKeyDetails.namedCurve,c=n[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),n=r(3263),s=r(5357),l=r(6782),c=r(5250),u=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"];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:s.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: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 b(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 s,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 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(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{s=e,b(_,!0,s,"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(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&&f(a),n.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=n.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),n=r(2548),s=r(4559),l=r(723),c=r(953),u=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"];c&&(h.splice(h.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{_=n(e,{complete:!0})}catch(e){return v(e)}if(!_)return v(new o("invalid token"));let w=_.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"));b=t}else b=function(e,r){return r(null,t)};return b(w,function(t,n){let c;if(t)return v(new o("error in secret or public key callback: "+t.message));let b=""!==$[2].trim();if(!b&&n)return v(new o("jwt signature is required"));if(b&&!n)return v(new o("secret or public key must be provided"));if(!b&&!r.algorithms)return v(new o('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 o("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 o("invalid algorithm"));if(w.alg.startsWith("HS")&&"secret"!==n.type)return v(new o(`secretOrPublicKey must be a symmetric key when using ${w.alg}`));if(/^(?:RS|PS|ES)/.test(w.alg)&&"public"!==n.type)return v(new o(`secretOrPublicKey must be an asymmetric key when using ${w.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{l(w.alg,n)}catch(e){return v(e)}try{c=u.verify(e,_.header.alg,n)}catch(e){return v(e)}if(!c)return v(new o("invalid signature"));let E=_.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=s(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:_.signature}):v(null,E)})}},2357(e,t,r){var o,a=r(6608).Buffer,i=r(6982),n=r(9053),s=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 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(s.format.bind(s,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 f((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 _(e){return function(t,r,o){var i=g(e)(t,o);return v(a.from(r),a.from(i))}}function b(e){return function(t,r){p(r),t=y(t);var o=i.createSign("RSA-SHA"+e);return f((o.update(t),o.sign(r,"base64")))}}function S(e){return function(t,r,o){d(o),t=y(t),r=h(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 f((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=h(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=b(e);return function(){var r=t.apply(null,arguments);return n.derToJose(r,"ES"+e)}}function R(e){var t=S(e);return function(r,o,a){return t(r,o=n.joseToDer(o,"ES"+e).toString("base64"),a)}}function P(){return function(){return""}}function O(){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:b,ps:$,es:E,none:P})[r](o),verify:({hs:_,rs:S,ps:w,es:R,none:O})[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),n=r(2203),s=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,n=e.payload,u=e.secret||e.privateKey,d=e.encoding,p=i(a.alg),f=(t=(t=d)||"utf8",r=c(s(a),"binary"),o=c(s(n),t),l.format("%s.%s",r,o)),h=p.sign(f,u);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 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,n),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),n=r(2203),s=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 f(e,t,r){if(!t){var o=Error("Missing algorithm parameter for jws.verify");throw o.code="MISSING_ALGORITHM",o}var a=d(e=s(e)),n=e.split(".",2).join(".");return i(t).verify(n,a,r)}function h(e,t){if(t=t||{},!p(e=s(e)))return null;var r,a,i=u(e);if(!i)return null;var n=(r=r||"utf8",a=e.split(".")[1],o.from(a,"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 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,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,o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,n=/^0o[0-7]+$/i,s=/^(?:0|[1-9]\d*)$/,l=parseInt;function c(e){return e!=e}var u=Object.prototype,d=u.hasOwnProperty,p=u.toString,f=u.propertyIsEnumerable,h=(t=Object.keys,r=Object,function(e){return t(r(e))}),m=Math.max,y=Array.isArray;function g(e){var t,r,o;return null!=e&&"number"==typeof(t=e.length)&&t>-1&&t%1==0&&t<=0x1fffffffffffff&&"[object Function]"!=(o=v(r=e)?p.call(r):"")&&"[object GeneratorFunction]"!=o}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function _(e){return!!e&&"object"==typeof e}e.exports=function(e,t,r,b){e=g(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}(g(e)?function(e){var t,r,o,a,i=y(e)||_(r=t=e)&&g(r)&&d.call(t,"callee")&&(!f.call(t,"callee")||"[object Arguments]"==p.call(t))?function(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o}(e.length,String):[],n=i.length,l=!!n;for(var c in e){d.call(e,c)&&!(l&&("length"==c||(o=c,(a=null==(a=n)?0x1fffffffffffff:a)&&("number"==typeof o||s.test(o))&&o>-1&&o%1==0&&o<a)))&&i.push(c)}return i}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||u))return h(e);var t,r,o=[];for(var a in Object(e))d.call(e,a)&&"constructor"!=a&&o.push(a);return o}(e),function(t){return e[t]}):[]}(e),r=r&&!b?(w=($=(S=r)?1/0===(S=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||_(t)&&"[object Symbol]"==p.call(t))return 0/0;if(v(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=v(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var s=i.test(e);return s||n.test(e)?l(e.slice(2),s?2:8):a.test(e)?0/0:+e}(S))||-1/0===S?(S<0?-1:1)*17976931348623157e292:S==S?S:0:0===S?S:0)%1,$==$?w?$-w:$:0):0;var S,$,w,E,R=e.length;return r<0&&(r=m(R+r,0)),"string"==typeof(E=e)||!y(E)&&_(E)&&"[object String]"==p.call(E)?r<=R&&e.indexOf(t,r)>-1:!!R&&function(e,t,r){if(t!=t){for(var o=e.length,a=r+-1;++a<o;)if(c(e[a]))return a;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=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,i=parseInt,n=Object.prototype.toString;function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var l,c,u;return"number"==typeof e&&e==(u=(c=(l=e)?1/0===(l=function(e){if("number"==typeof e)return e;if("symbol"==typeof(l=e)||l&&"object"==typeof l&&"[object Symbol]"==n.call(l))return 0/0;if(s(e)){var l,c="function"==typeof e.valueOf?e.valueOf():e;e=s(c)?c+"":c}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var u=o.test(e);return u||a.test(e)?i(e.slice(2),u?2:8):r.test(e)?0/0:+e}(l))||-1/0===l?(l<0?-1:1)*17976931348623157e292:l==l?l:0:0===l?l:0)%1,c==c?u?c-u:c: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,n=a.call(Object),s=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]"!=s.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)==n}},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=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,i=parseInt,n=Object.prototype.toString;function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var l,c,u,d,p=2,f=e;if("function"!=typeof f)throw TypeError("Expected a function");return u=(c=(l=p)?1/0===(l=function(e){if("number"==typeof e)return e;if("symbol"==typeof(l=e)||l&&"object"==typeof l&&"[object Symbol]"==n.call(l))return 0/0;if(s(e)){var l,c="function"==typeof e.valueOf?e.valueOf():e;e=s(c)?c+"":c}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var u=o.test(e);return u||a.test(e)?i(e.slice(2),u?2:8):r.test(e)?0/0:+e}(l))||-1/0===l?(l<0?-1:1)*17976931348623157e292:l==l?l:0:0===l?l:0)%1,p=c==c?u?c-u:c:0,function(){return--p>0&&(d=f.apply(this,arguments)),p<=1&&(f=void 0),d}}},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,n,s=typeof e;if("string"===s&&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"===s&&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":(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 o=r(181),a=o.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function n(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=o:(i(o,t),t.Buffer=n),n.prototype=Object.create(a.prototype),i(a,n),n.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return a(e,t,r)},n.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},n.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return a(e)},n.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return o.SlowBuffer(e)}},1096(e,t,r){"use strict";let o=Symbol("SemVer ANY");e.exports=class e{static get ANY(){return o}constructor(t,r){if(r=a(r),t instanceof e)if(t.loose===!!r.loose)return t;else t=t.value;l("comparator",t=t.trim().split(/\s+/).join(" "),r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===o?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(e){let t=this.options.loose?i[n.COMPARATORLOOSE]:i[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 c(r[2],this.options.loose):this.semver=o}toString(){return this.value}test(e){if(l("Comparator.test",e,this.options.loose),this.semver===o||e===o)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return s(e,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new u(t.value,r).test(this.value):""===t.operator?""===t.value||new u(this.value,r).test(t.semver):!((r=a(r)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===t.value)||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||s(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||s(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">"))}};let a=r(5203),{safeRe:i,t:n}=r(3486),s=r(4407),l=r(6064),c=r(2732),u=r(5007)},5007(e,t,r){"use strict";let o=/\s+/g;e.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;else return new e(t.raw,r);if(t instanceof n)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.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){let e=this.set[0];if(this.set=this.set.filter(e=>!v(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(1===e.length&&_(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){e=e.replace(g,"");let t=((this.options.includePrerelease&&m)|(this.options.loose&&y))+":"+e,r=a.get(t);if(r)return r;let o=this.options.loose,i=o?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];s("hyphen replace",e=e.replace(i,C(this.options.includePrerelease))),s("comparator trim",e=c(e)),s("tilde trim",e=e.replace(u[p.TILDETRIM],f)),s("caret trim",e=e.replace(u[p.CARETTRIM],h));let l=e.split(" ").map(e=>S(e,this.options)).join(" ").split(/\s+/).map(e=>T(e,this.options));o&&(l=l.filter(e=>(s("loose invalid filter",e,this.options),!!e.match(u[p.COMPARATORLOOSE])))),s("range list",l);let d=new Map;for(let e of l.map(e=>new n(e,this.options))){if(v(e))return[e];d.set(e.value,e)}d.size>1&&d.has("")&&d.delete("");let _=[...d.values()];return a.set(t,_),_}intersects(t,r){if(!(t instanceof e))throw TypeError("a Range is required");return this.set.some(e=>b(e,r)&&t.set.some(t=>b(t,r)&&e.every(e=>t.every(t=>e.intersects(t,r)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(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}};let a=new(r(7762)),i=r(5203),n=r(1096),s=r(6064),l=r(2732),c=r(764),{safeRe:u,src:d,t:p,tildeTrimReplace:f,caretTrimReplace:h}=r(3486),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:y}=r(82),g=RegExp(d[p.BUILD],"g"),v=e=>"<0.0.0-0"===e.value,_=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},S=(e,t)=>(s("comp",e=e.replace(u[p.BUILD],""),t),s("caret",e=R(e,t)),s("tildes",e=w(e,t)),s("xrange",e=O(e,t)),s("stars",e=x(e,t)),e),$=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{let r=t.loose?u[p.TILDELOOSE]:u[p.TILDE],o=t.includePrerelease?"-0":"";return e.replace(r,(t,r,a,i,n)=>{let l;return s("tilde",e,t,r,a,i,n),$(r)?l="":$(a)?l=`>=${r}.0.0${o} <${+r+1}.0.0-0`:$(i)?l=`>=${r}.${a}.0${o} <${r}.${+a+1}.0-0`:n?(s("replaceTilde pr",n),l=`>=${r}.${a}.${i}-${n} <${r}.${+a+1}.0-0`):l=`>=${r}.${a}.${i} <${r}.${+a+1}.0-0`,s("tilde return",l),l})},R=(e,t)=>e.trim().split(/\s+/).map(e=>P(e,t)).join(" "),P=(e,t)=>{s("caret",e,t);let r=t.loose?u[p.CARETLOOSE]:u[p.CARET],o=t.includePrerelease?"-0":"";return e.replace(r,(t,r,a,i,n)=>{let l;return s("caret",e,t,r,a,i,n),$(r)?l="":$(a)?l=`>=${r}.0.0${o} <${+r+1}.0.0-0`:$(i)?l="0"===r?`>=${r}.${a}.0${o} <${r}.${+a+1}.0-0`:`>=${r}.${a}.0${o} <${+r+1}.0.0-0`:n?(s("replaceCaret pr",n),l="0"===r?"0"===a?`>=${r}.${a}.${i}-${n} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i}-${n} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i}-${n} <${+r+1}.0.0-0`):(s("no pr"),l="0"===r?"0"===a?`>=${r}.${a}.${i} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i} <${+r+1}.0.0-0`),s("caret return",l),l})},O=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>k(e,t)).join(" ")),k=(e,t)=>{e=e.trim();let r=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(r,(r,o,a,i,n,l)=>{let c,u,d;if(s("xRange",e,r,o,a,i,n,l),c=a,u=i,d=n,$(c)&&!$(u)||$(u)&&d&&!$(d))return e;let p=$(a),f=p||$(i),h=f||$(n);return"="===o&&h&&(o=""),l=t.includePrerelease?"-0":"",p?r=">"===o||"<"===o?"<0.0.0-0":"*":o&&h?(f&&(i=0),n=0,">"===o?(o=">=",f?(a=+a+1,i=0):i=+i+1,n=0):"<="===o&&(o="<",f?a=+a+1:i=+i+1),"<"===o&&(l="-0"),r=`${o+a}.${i}.${n}${l}`):f?r=`>=${a}.0.0${l} <${+a+1}.0.0-0`:h&&(r=`>=${a}.${i}.0${l} <${a}.${+i+1}.0-0`),s("xRange return",r),r})},x=(e,t)=>(s("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),T=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),C=e=>(t,r,o,a,i,n,s,l,c,u,d,p)=>(r=$(o)?"":$(a)?`>=${o}.0.0${e?"-0":""}`:$(i)?`>=${o}.${a}.0${e?"-0":""}`:n?`>=${r}`:`>=${r}${e?"-0":""}`,l=$(c)?"":$(u)?`<${+c+1}.0.0-0`:$(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(s(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}},2732(e,t,r){"use strict";let o=r(6064),{MAX_LENGTH:a,MAX_SAFE_INTEGER:i}=r(82),{safeRe:n,t:s}=r(3486),l=r(5203),{compareIdentifiers:c}=r(3867);e.exports=class e{constructor(t,r){if(r=l(r),t instanceof e)if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;else t=t.version;else if("string"!=typeof t)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>a)throw TypeError(`version is longer than ${a} characters`);o("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let c=t.trim().match(r.loose?n[s.LOOSE]:n[s.FULL]);if(!c)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+c[1],this.minor=+c[2],this.patch=+c[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");c[4]?this.prerelease=c[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=c[5]?c[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(t){if(o("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return(t instanceof e||(t=new e(t,this.options)),this.major<t.major)?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return -1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],a=t.prerelease[r];if(o("prerelease compare",r,e,a),void 0===e&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===e)return -1;else if(e===a)continue;else return c(e,a)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],a=t.build[r];if(o("build compare",r,e,a),void 0===e&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===e)return -1;else if(e===a)continue;else return c(e,a)}while(++r)}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[s.PRERELEASELOOSE]:n[s.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]),((e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let t=0;t<r.length;t++)if(0!==c(e[t],r[t]))return!1;return!0})(this.prerelease,t)?isNaN(this.prerelease[t.split(".").length])&&(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}}},206(e,t,r){"use strict";let o=r(264);e.exports=(e,t)=>{let r=o(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},4407(e,t,r){"use strict";let o=r(2729),a=r(7751),i=r(6452),n=r(8993),s=r(5131),l=r(5720);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 n(e,r,c);case"<":return s(e,r,c);case"<=":return l(e,r,c);default:throw TypeError(`Invalid operator: ${t}`)}}},4210(e,t,r){"use strict";let o=r(2732),a=r(264),{safeRe:i,t:n}=r(3486);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[n.COERCERTLFULL]:i[n.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[n.COERCEFULL]:i[n.COERCE]);if(null===r)return null;let s=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(`${s}.${l}.${c}${u}${d}`,t)}},1029(e,t,r){"use strict";let o=r(2732);e.exports=(e,t,r)=>{let a=new o(e,r),i=new o(t,r);return a.compare(i)||a.compareBuild(i)}},5723(e,t,r){"use strict";let o=r(2072);e.exports=(e,t)=>o(e,t,!0)},2072(e,t,r){"use strict";let o=r(2732);e.exports=(e,t,r)=>new o(e,r).compare(new o(t,r))},3744(e,t,r){"use strict";let o=r(264);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 n=i>0,s=n?r:a,l=n?a:r,c=!!s.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(s))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"}},2729(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>0===o(e,t,r)},6452(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>o(e,t,r)>0},8993(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>o(e,t,r)>=0},4119(e,t,r){"use strict";let o=r(2732);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}}},5131(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>0>o(e,t,r)},5720(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>0>=o(e,t,r)},4226(e,t,r){"use strict";let o=r(2732);e.exports=(e,t)=>new o(e,t).major},118(e,t,r){"use strict";let o=r(2732);e.exports=(e,t)=>new o(e,t).minor},7751(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>0!==o(e,t,r)},264(e,t,r){"use strict";let o=r(2732);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}}},6949(e,t,r){"use strict";let o=r(2732);e.exports=(e,t)=>new o(e,t).patch},3081(e,t,r){"use strict";let o=r(264);e.exports=(e,t)=>{let r=o(e,t);return r&&r.prerelease.length?r.prerelease:null}},2538(e,t,r){"use strict";let o=r(2072);e.exports=(e,t,r)=>o(t,e,r)},5981(e,t,r){"use strict";let o=r(1029);e.exports=(e,t)=>e.sort((e,r)=>o(r,e,t))},2798(e,t,r){"use strict";let o=r(5007);e.exports=(e,t,r)=>{try{t=new o(t,r)}catch(e){return!1}return t.test(e)}},9583(e,t,r){"use strict";let o=r(1029);e.exports=(e,t)=>e.sort((e,r)=>o(e,r,t))},233(e,t,r){"use strict";let o=r(264),a=r(82),i=r(2732),n=e=>e.startsWith("pre");e.exports=(e,t,r)=>{let s,l;if(!a.RELEASE_TYPES.includes(t))return null;let c=(s=e,l=r,o(s instanceof i?s.version:s,l));return c&&((e,t)=>{if(n(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0}return e.format()})(c,t)}},3937(e,t,r){"use strict";let o=r(264);e.exports=(e,t)=>{let r=o(e,t);return r?r.version:null}},2781(e,t,r){"use strict";let o=r(3486),a=r(82),i=r(2732),n=r(3867),s=r(264),l=r(3937),c=r(206),u=r(4119),d=r(3744),p=r(4226),f=r(118),h=r(6949),m=r(3081),y=r(2072),g=r(2538),v=r(5723),_=r(1029),b=r(9583),S=r(5981),$=r(6452),w=r(5131),E=r(2729),R=r(7751),P=r(8993),O=r(5720),k=r(4407),x=r(4210),T=r(233),C=r(1096),j=r(5007),I=r(2798),N=r(775),A=r(9700),M=r(7782),q=r(21),z=r(9354),L=r(3019),D=r(1179),U=r(8422),V=r(1412);e.exports={parse:s,valid:l,clean:c,inc:u,diff:d,major:p,minor:f,patch:h,prerelease:m,compare:y,rcompare:g,compareLoose:v,compareBuild:_,sort:b,rsort:S,gt:$,lt:w,eq:E,neq:R,gte:P,lte:O,cmp:k,coerce:x,truncate:T,Comparator:C,Range:j,satisfies:I,toComparators:N,maxSatisfying:A,minSatisfying:M,minVersion:q,validRange:z,outside:L,gtr:D,ltr:U,intersects:V,simplifyRange:r(7077),subset:r(3152),SemVer:i,re:o.re,src:o.src,tokens:o.t,SEMVER_SPEC_VERSION:a.SEMVER_SPEC_VERSION,RELEASE_TYPES:a.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers}},82(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,WHITESPACE_CHARACTERS:[" ","\n","\v","\f","\r"," ","\xa0"," "," "," "," "," "," "," "," "," "," "," "," ","\u2028","\u2029"," "," "," ","\uFEFF"],RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},6064(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):()=>{}},3867(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)}},7762(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}}},5203(e){"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},3486(e,t,r){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:i}=r(82),n=r(6064),s=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],d=t.t={},p=0,f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,a]],m=(e,t,r)=>{let o=(e=>{for(let[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),a=p++;n(e,a,t),d[e]=a,c[a]=t,u[a]=o,s[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-]${f}*`),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",`${f}+`),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*$")},764(e,t,r){"use strict";let{MAX_LENGTH:o,MAX_SAFE_BUILD_LENGTH:a,WHITESPACE_CHARACTERS:i}=r(82),n=new Uint8Array(65536);for(let e of i)n[e.charCodeAt(0)]=1;let s=e=>void 0!==e&&1===n[e.charCodeAt(0)],l=e=>"v"===e||"="===e||s(e),c=e=>void 0!==e&&e>="0"&&e<="9",u=e=>void 0!==e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"),d=e=>c(e)||u(e)||"-"===e,p=e=>c(e)||"x"===e||"X"===e||"*"===e,f=(e,t,r,o)=>{if(!c(e[t]))return t;if(t>=o.start&&t<o.end)return Math.min(t+r,o.end);if(t>=o.previousStart&&t<o.previousEnd)return Math.min(t+r,o.previousEnd);let a=t+1;for(;c(e[a]);)a++;return o.previousStart=o.start,o.previousEnd=o.end,o.start=t,o.end=a,Math.min(t+r,a)},h=(e,t,r,a)=>r||"0"!==e[t]?f(e,t,r?o:o+1,a):t+1,m=(e,t,r,i)=>{let n=f(e,t,o,i);if(u(e[n])||"-"===e[n]){let t=n+1,r=t+a;for(;t<r&&d(e[t]);)t++;return t}return h(e,t,r,i)},y=(e,t,r,o)=>{let a="-"===e[t];if(!r&&!a)return t;let i=t+ +!!a,n=m(e,i,r,o);if(n===i){if(!r||!a)return t;n=m(e,t,r,o)}for(;"."===e[n];){let t=m(e,n+1,r,o);if(t===n+1)break;n=t}return n},g=(e,t)=>{let r=t;for(;r-t<a&&d(e[r]);)r++;return r},v=(e,t)=>{if("+"!==e[t])return t;let r=g(e,t+1);if(r===t+1)return t;for(;"."===e[r];){let t=g(e,r+1);if(t===r+1)break;r=t}return r},_=(e,t,r)=>c(e[t])?h(e,t,!1,r):p(e[t])?t+1:t,b=(e,t,r)=>{let o=((e,t,r)=>{let o=t;for(let a=0;a<3;a++){let i=h(e,o,!0,r);if(i===o)return t;if(o=i,a<2){if("."!==e[o])return t;o++}}let a=y(e,o,!0,r);return v(e,a)})(e,t,r);return o!==t?o:((e,t,r)=>{let o=_(e,t,r);for(let t=0;t<2;t++){if("."!==e[o])return o;let t=_(e,o+1,r);if(t===o+1)return o;o=t}let a=y(e,o,!1,r);return v(e,a)})(e,t,r)},S=(e,t)=>{let r=t;return s(e[r])&&r++,("<"===e[r]||">"===e[r])&&r++,"="===e[r]&&r++,s(e[r])?r:-1};e.exports=e=>{let t="",r=0,o=0,a={start:-1,end:-1,previousStart:-1,previousEnd:-1};for(;o<e.length;){let i=o;if("<"===e[o]||">"===e[o])o++;else if(!l(e[o])&&!p(e[o])){o++;continue}for(;o<e.length&&l(e[o]);)o++;if(!p(e[o]))continue;let n=S(e,i);-1!==n&&(t+=e.slice(r,n),r=n+1),o=b(e,o,a)}return t+e.slice(r)}},1179(e,t,r){"use strict";let o=r(3019);e.exports=(e,t,r)=>o(e,t,">",r)},1412(e,t,r){"use strict";let o=r(5007);e.exports=(e,t,r)=>(e=new o(e,r),t=new o(t,r),e.intersects(t,r))},8422(e,t,r){"use strict";let o=r(3019);e.exports=(e,t,r)=>o(e,t,"<",r)},9700(e,t,r){"use strict";let o=r(2732),a=r(5007);e.exports=(e,t,r)=>{let i=null,n=null,s=null;try{s=new a(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(!i||-1===n.compare(e))&&(n=new o(i=e,r))}),i}},7782(e,t,r){"use strict";let o=r(2732),a=r(5007);e.exports=(e,t,r)=>{let i=null,n=null,s=null;try{s=new a(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(!i||1===n.compare(e))&&(n=new o(i=e,r))}),i}},21(e,t,r){"use strict";let o=r(2732),a=r(5007),i=r(6452);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],n=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">=":(!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}},3019(e,t,r){"use strict";let o=r(2732),a=r(1096),{ANY:i}=a,n=r(5007),s=r(2798),l=r(6452),c=r(5131),u=r(5720),d=r(8993);e.exports=(e,t,r,p)=>{let f,h,m,y,g;switch(e=new o(e,p),t=new n(t,p),r){case">":f=l,h=u,m=c,y=">",g=">=";break;case"<":f=c,h=d,m=l,y="<",g="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,p))return!1;for(let r=0;r<t.set.length;++r){let o=t.set[r],n=null,s=null;if(o.forEach(e=>{e.semver===i&&(e=new a(">=0.0.0")),n=n||e,s=s||e,f(e.semver,n.semver,p)?n=e:m(e.semver,s.semver,p)&&(s=e)}),n.operator===y||n.operator===g||(!s.operator||s.operator===y)&&h(e,s.semver)||s.operator===g&&m(e,s.semver))return!1}return!0}},7077(e,t,r){"use strict";let o=r(2798),a=r(2072);e.exports=(e,t,r)=>{let i=[],n=null,s=null,l=e.sort((e,t)=>a(e,t,r));for(let e of l)o(e,t,r)?(s=e,n||(n=e)):(s&&i.push([n,s]),s=null,n=null);n&&i.push([n,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}},3152(e,t,r){"use strict";let o=r(5007),a=r(1096),{ANY:i}=a,n=r(2798),s=r(2072),l=[new a(">=0.0.0-0")],c=[new a(">=0.0.0")],u=(e,t,r)=>{let o,a,u,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: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=s(o.semver,a.semver,r))>0||0===u&&(">="!==o.operator||"<="!==a.operator)))return null;for(let e of g){if(o&&!n(e,String(o),r)||a&&!n(e,String(a),r))return null;for(let o of t)if(!n(e,String(o),r))return!1;return!0}let v=!!a&&!r.includePrerelease&&!!a.semver.prerelease.length&&a.semver,_=!!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(_&&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(o,e,r))===e&&f!==o)return!1}else if(">="===o.operator&&!e.test(o.semver))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((h=p(a,e,r))===e&&h!==a)return!1}else if("<="===a.operator&&!e.test(a.semver))return!1}if(!e.operator&&(a||o)&&0!==u)return!1}return(!o||!m||!!a||0===u)&&(!a||!y||!!o||0===u)&&!_&&!v&&!0},d=(e,t,r)=>{if(!e)return t;let o=s(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=s(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}},775(e,t,r){"use strict";let o=r(5007);e.exports=(e,t)=>new o(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},9354(e,t,r){"use strict";let o=r(5007);e.exports=(e,t)=>{try{return new o(e,t).range||"*"}catch(e){return null}}},600(e,t,r){"use strict";let o=r(7257);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}},7257(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?";":":",n=r(9344),s=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)],n=o?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=o?n.split(r):[""];return o&&-1!==e.indexOf(".")&&""!==s[0]&&s.unshift(""),{pathEnv:a,pathExt:s,pathExtExe:n}},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,n)=>{if(r===o.length)return t.all&&u.length?i(u):n(s(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,s)=>{if(o===i.length)return a(d(r+1));let l=i[o];n(e+l,{pathExt:c},(i,n)=>{if(!i&&n)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 s=0;s<r.length;s++){let l=r[s],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(n.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 s(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")},7016(e){"use strict";e.exports=require("url")},9023(e){"use strict";e.exports=require("util")},8717(e,t,r){var o=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(e){throw t=0,e}},a=o((e,t)=>{function r(e){return"string"==typeof e?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}t.exports={parseBoolean:r,optionsFromEnv:function(e=process.env){let t={};for(let o of["ENCODING","PATH","QUIET","DEBUG","OVERRIDE","FAST"]){let a=null!=e[`DOTENV_${o}`]?e[`DOTENV_${o}`]:e[`DOTENV_CONFIG_${o}`];null!=a&&(t[o.toLowerCase()]="ENCODING"===o||"PATH"===o?a:r(a))}return t}}}),i=o((e,t)=>{var o=r(9896),i=r(6928),n=r(857),{URL:s,fileURLToPath:l}=r(7016),{parseBoolean:c,optionsFromEnv:u}=a(),d=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg,p=new Uint8Array(256);for(let e=48;e<=57;e++)p[e]=1;for(let e=65;e<=90;e++)p[e]=1;for(let e=97;e<=122;e++)p[e]=1;function f(e){return e<=32?32===e||e>=9&&e<=13:e>=160&&(160===e||5760===e||e>=8192&&e<=8202||8232===e||8233===e||8239===e||8287===e||12288===e||65279===e)}function h(e){return 10===e||8232===e||8233===e}function m(e){console.log(`┆ ${e}`)}function y(e){return"~"===e[0]?i.join(n.homedir(),e.slice(1)):e}p[45]=1,p[46]=1,p[95]=1;var g={configDotenv:function(e){e=function(e={}){let t={...e};for(let e of Object.keys(t))void 0===t[e]&&delete t[e];return{...u(),...t}}(e);let t=i.resolve(process.cwd(),".env"),r="utf8",a=process.env;e&&null!=e.processEnv&&(a=e.processEnv);let n=c(e&&e.debug);e&&e.encoding?r=e.encoding:n&&m("no encoding is specified (UTF-8 is used by default)");let d=[t];if(e&&e.path)if(Array.isArray(e.path))for(let t of(d=[],e.path))d.push(y(t));else d=[y(e.path)];let p,f={},h={fast:e.fast};for(let t of d)try{let a=g.parse(o.readFileSync(t,{encoding:r}),h);g.populate(f,a,e)}catch(e){n&&m(`failed to load ${t} ${e.message}`),p=e}let v=g.populate(a,f,e),_=c(Object.prototype.hasOwnProperty.call(e,"quiet")?e.quiet:u(a).quiet);if(n||!_){var b;let e=Object.keys(v).length,t=[];for(let e of d)try{let r=i.relative(process.cwd(),e instanceof s?l(e):e);t.push(r)}catch(t){n&&m(`failed to load ${e} ${t.message}`),p=t}b=`injected env (${e}) from ${t.join(",")}`,console.error(`◇ ${b}`)}return p?{parsed:f,error:p}:{parsed:f}},config:function(e){return g.configDotenv(e)},parse:function(e,t){return t&&c(t.fast)?function(e){let t={},r="string"==typeof e?e:e.toString();-1!==r.indexOf("\r")&&(r=r.replace(/\r\n?/g,`
|
|
2
2
|
`));let o=r.length,a=0;for(;a<o;){let e=r.charCodeAt(a);for(;a<o&&f(e);)a++,e=r.charCodeAt(a);if(a>=o)break;if(35===e){for(;a<o&&!h(r.charCodeAt(a));)a++;continue}let i=-1;if(101===e&&a+6<o&&120===r.charCodeAt(a+1)&&112===r.charCodeAt(a+2)&&111===r.charCodeAt(a+3)&&114===r.charCodeAt(a+4)&&116===r.charCodeAt(a+5))if(f(r.charCodeAt(a+6))){let e=a+7;for(;e<o&&f(r.charCodeAt(e));)e++;p[r.charCodeAt(e)]&&(i=a+6,a=e)}else e=r.charCodeAt(a);let n=a,s=0;for(;a<o&&p[s=r.charCodeAt(a)];)a++;if(a===n){for(;a<o&&!h(r.charCodeAt(a));)a++;continue}let l=r.slice(n,a),c=a;if(a>=o&&(s=0),f(s))do s=++a<o?r.charCodeAt(a):0;while(f(s));if(61===s)a++;else if(58===s&&a===c&&a+1<o&&f(r.charCodeAt(a+1)))a+=2;else{for(a=-1===i?c:i;a<o&&!h(r.charCodeAt(a));)a++;continue}let u=a,d=a;for(;d<o&&f(r.charCodeAt(d));)d++;let m=r.charCodeAt(d),y,g=!1;if(39===m||34===m||96===m){let e=r[d],t=r.indexOf(e,d+1),i=-1,n=-1;for(;-1!==t;){let a=92===r.charCodeAt(t-1),s=t+1;for(;s<o&&!h(r.charCodeAt(s))&&f(r.charCodeAt(s));)s++;if((s===o||h(r.charCodeAt(s))||35===r.charCodeAt(s))&&(i=t,n=s),!a)break;t=r.indexOf(e,t+1)}if(-1!==i){if(y=r.slice(d+1,i),a=n,35===r.charCodeAt(a))for(;a<o&&!h(r.charCodeAt(a));)a++;g=!0}}if(!g){let e,t=r.indexOf(`
|
|
3
3
|
`,u);if(-1===t&&(t=o),o<4096)(-1===(e=r.indexOf("#",u))||e>t)&&(e=t);else for(e=u;e<t&&35!==r.charCodeAt(e);)e++;let i=u,n=e;for(;i<n&&f(r.charCodeAt(i));)i++;for(;n>i&&f(r.charCodeAt(n-1));)n--;let s=r.charCodeAt(i);if((y=r.slice(i,n)).includes("\u2028")||y.includes("\u2029")?y=y.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"):n-i>=2&&(39===s||34===s||96===s)&&r.charCodeAt(n-1)===s&&(y=r.slice(i+1,n-1)),a=e,e<t)for(;a<o&&!h(r.charCodeAt(a));)a++}34===m&&(g||d<a)&&-1!==y.indexOf("\\")&&(y=y.replace(/\\n/g,`
|
|
4
4
|
`).replace(/\\r/g,"\r")),t[l]=y}return t}(e):function(e){let t,r={},o=e.toString();for(o=o.replace(/\r\n?/mg,`
|
|
5
5
|
`);null!=(t=d.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,`
|
|
6
|
-
`)).replace(/\\r/g,"\r")),r[e]=o}return r}(e)},populate:function(e,t,r={}){let o=c(r&&r.debug),a=c(r&&r.override),i={};if(null===e||"object"!=typeof e||null===t||"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],i[r]=t[r]),o&&m(!0===a?`"${r}" is already defined and WAS overwritten`:`"${r}" is already defined and was NOT overwritten`)):(e[r]=t[r],i[r]=t[r]);return i}};t.exports.configDotenv=g.configDotenv,t.exports.config=g.config,t.exports.parse=g.parse,t.exports.populate=g.populate,t.exports=g})();e.exports=i,e.exports.config=i.config,e.exports.configDotenv=i.configDotenv,e.exports.parse=i.parse,e.exports.populate=i.populate},8330(e){"use strict";e.exports=JSON.parse('{"name":"xmcp","version":"1.12.0"}')}},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 n={};t=t||[null,r({}),r([]),r(r)];for(var s=2&o&&e;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=r(s))Object.getOwnPropertyNames(s).forEach(t=>{n[t]=()=>e[t]});return n.default=()=>e,i.d(a,n),a},i.d=(e,t,r)=>{var o=(t,r)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,[r]:t[o]})};o(t,"get"),o(r,"value")},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"u">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,r,o,a,s,l,c,u,d,p,f,h,m,y,g,v,_,b;i.r(n),i.d(n,{HOST_CONTEXT_CHANGED_METHOD:()=>m6,INITIALIZED_METHOD:()=>m0,INITIALIZE_METHOD:()=>mQ,LOG_MESSAGE_METHOD:()=>m5,MCP_APPS_PROTOCOL_VERSION:()=>mY,OPEN_LINK_METHOD:()=>m2,REQUEST_DISPLAY_MODE_METHOD:()=>m1,RESOURCES_READ_METHOD:()=>m4,SIZE_CHANGED_METHOD:()=>m8,UI_MESSAGE_METHOD:()=>m3,UPDATE_MODEL_CONTEXT_METHOD:()=>m9,UrlElicitationRequiredError:()=>l1,acceptedContent:()=>cd,apiKeyAuthMiddleware:()=>M,audio:()=>G,callSTDIOClientTool:()=>mZ,completable:()=>u4,createContext:()=>F,createHTTPClient:()=>mG,createMcpHostBridge:()=>yt,createRequestStateCodec:()=>u7,createSTDIOClient:()=>mB,disconnectSTDIOClient:()=>mW,embeddedResource:()=>B,extractToolNamesFromRequest:()=>mX,getRequestContext:()=>W,headersToRecord:()=>mV,image:()=>K,inputRequired:()=>cu,inputResponse:()=>cp,isEnvHeader:()=>mU,isInputRequiredResult:()=>l6,jwtAuthMiddleware:()=>L,listSTDIOClientTools:()=>mJ});var S,$,w,E,R,P,k,O,x,T,j=i(8717),C=i.n(j),I=i(4953);let N=I.z.object({apiKey:I.z.string().optional(),headerName:I.z.string().optional(),validateApiKey:I.z.function().args(I.z.string()).returns(I.z.promise(I.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"}),A="Unauthorized: Missing or invalid API key";function M(e){let t=N.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,n)=>{let s=t.header(r);!s||"apiKey"in e&&s!==o||a&&!await a(s)?i.status(401).json({error:A}):n()}}var q=i(8400),z=i.n(q);function L(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=z().verify(i,r,a),o()}catch(e){r.status(401).json({error:"Unauthorized: Invalid or expired token"})}}}let D=require("async_hooks"),U=(e,t)=>{globalThis[e]=t},V=e=>globalThis[e];function F({name:e,fallback:t=!0}){let r=Symbol.for(`xmcp-context-${e}`),o=Symbol.for(`xmcp-context-${e}-fallback-store`);if(V(r))return V(r);let a=new D.AsyncLocalStorage,i=globalThis[o]??{current:null};U(o,i);let n={provider:(e,r)=>(t&&(i.current=e),a.run(e,r)),getContext:()=>{let r=a.getStore();if(r)return r;if(t&&i.current)return i.current;throw Error(`getContext() can only be used within the ${e} context.`)},setContext:r=>{let o=a.getStore()??(t?i.current:null);if(!o)throw Error(`setContext() can only be used within the ${e} context.`);Object.assign(o,r)}};return U(r,n),n}function H(e){let t;if(e instanceof Uint8Array)t=e;else if(e instanceof ArrayBuffer)t=new Uint8Array(e);else throw TypeError("Expected bytes as a Uint8Array or ArrayBuffer");let r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(r)}function K(e,t){return{type:"image",data:H(e),mimeType:t}}function G(e,t){return{type:"audio",data:H(e),mimeType:t}}function B(e,t,r){return{type:"resource",resource:{uri:e,...void 0===r?{}:{mimeType:r},..."string"==typeof t?{text:t}:{blob:H(t)}}}}let J=F({name:"http-request-context"});J.setContext,J.getContext,J.provider;let Z=F({name:"request-context",fallback:!1});function W(){try{return Z.getContext().value}catch{throw Error("getRequestContext() can only be used while handling an MCP request.")}}var X=Object.create,Y=Object.defineProperty,Q=Object.getOwnPropertyDescriptor,ee=Object.getOwnPropertyNames,et=Object.getPrototypeOf,er=Object.prototype.hasOwnProperty,eo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);function ea(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 ei(e,t="|"){return e.map(e=>ek(e)).join(t)}function en(e,t){return"bigint"==typeof t?t.toString():t}class es{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function el(e){return new es(e)}function ec(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}let eu=Symbol("evaluating");function ed(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ep(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function ef(e){return ep(e._zod.def)??e._zod.def.shape}function eh(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return ed(this,t,e),e},enumerable:!0,configurable:!0})}function em(e,t,r){t in e?ed(e,t,r):e[t]=r}function ey(e,t,r,o){let a=ef(t);for(let i of r){let r=Object.getOwnPropertyDescriptor(a,i);r.enumerable&&(r.get?eh(e,i,()=>{let e=t._zod.def.shape[i];return o?o(e,i):e}):em(e,i,o?o(r.value,i):r.value))}}function eg(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}let ev="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function e_(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eb=el(()=>{if(e0.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eS(e){if(!1===e_(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==e_(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function e$(e){return eS(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let ew=new Set(["string","number","symbol"]);function eE(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eR(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function eP(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}function ek(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let eO={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]},ex={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function eT(e,t){let r=ef(e),o=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&o.push(e)}return o}function ej(e,t){let r={};ey(r,e,Reflect.ownKeys(ef(e)));for(let e of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,e);o.enumerable&&(o.get?eh(r,e,()=>t[e]):em(r,e,o.value))}return r}function eC(e,t,r,o="partial"){let a=t._zod.def.checks;if(a&&a.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let i=r?new Set(eT(t,r)):void 0,n={};return ey(n,t,Reflect.ownKeys(ef(t)),e&&((t,r)=>i&&!i.has(r)?t:new e({type:"optional",innerType:t}))),eR(t,eg(t._zod.def,{shape:n,checks:[]}))}function eI(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 eN(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eA(e){return"string"==typeof e?e:e?.message}function eM(e){let t=[];for(let r of e??[]){let e=r._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let o=e.maximum??e.length??e.size;o>=0&&t.push([o,r])}return t}function eq(e,t,r){var o;for(let a=t;a<e.length;a++)(o=e[a]).schema??(o.schema=r)}function ez(e,t,r){let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let a=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:eA(e.inst?._zod.def?.error?.(e))??eA(a?.(e))??eA(t?.error?.(e))??eA(r.customError?.(e))??eA(r.localeError?.(e))??"Invalid input",n={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(n[t]=e[t]);return n.path??(n.path=[]),n.message=i,t?.reportInput&&(n.input=e.input),n}let eL=/[\uD800-\uDBFF]/;function eD(e){let t=e.length;if(!eL.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(64512&e.charCodeAt(o))==55296&&(64512&e.charCodeAt(o+1))==56320&&(r--,o++);return r}function eU(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eV(...e){let[t,r,o]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:o}:{...t}}function eF(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function eH(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return eF(this,r,o(this))},set(e){eF(this,r,e)}})}return t}let eK=!1,eG={configurable:!0,get(){eK=!0}};function eB(t,r,o){let a=Object.getPrototypeOf(t._zod);if(r in a&&e!==t._zod){e=void 0;return}e=t._zod,Object.defineProperty(a,r,{configurable:!0,get(){Object.defineProperty(this,r,eG);let e=eK;eK=!1;try{let t=o(this);return eK?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),eK=eK||e,t}catch(t){throw delete this[r],eK=eK||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}let eJ=Object.freeze({status:"aborted"}),eZ={value:void 0,enumerable:!1},eW="captureStackTrace"in Error?Error:null;function eX(e,t,r,o){function a(e){this.def=e,this.constr=c,this.traits=new Set}a.prototype={};let i=r&&new WeakSet;function n(o,n){if(o._zod){if(o._zod.traits.has(e))return}else{eZ.value=new a(n);try{Object.defineProperty(o,"_zod",eZ)}finally{eZ.value=void 0}}if(o._zod.traits.add(e),t(o,n),i){let e=Object.getPrototypeOf(o),t=o._zod.constr.prototype,a=e;for(;a&&a!==t;)a=Object.getPrototypeOf(a);let n=a??e;if(!i.has(n)){i.add(n);for(let e in r){let t=Object.getOwnPropertyDescriptor(r,e);t.get?Object.defineProperty(n,e,{...t,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:eF(this,t,r.bind(this))},set(e){eF(this,t,e)}})}(n,e,t.value)}}}let s=c.prototype;for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(e in o||(o[e]=s[e].bind(o)))}let s=o?.Parent??Object;class l extends s{}function c(e){let t=o?.Parent?function(e){let t=eW;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return eW=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(l):this;n(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let a=globalThis.__zod_globalConfig?.postProcessor;return a&&a(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:t=>!!o?.Parent&&t instanceof o.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class eY extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eQ extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(O=globalThis).__zod_globalConfig??(O.__zod_globalConfig={});let e0=globalThis.__zod_globalConfig;function e1(e){return e&&Object.assign(e0,e),e0}class e2 extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let e9="~memo",e3=[];function e5(e){return null!==e&&"object"==typeof e}function e4(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let e6=new WeakMap,e8=[],e7={alloc(e,r,o){let a=t;if(!a)return o;t=void 0;let i={value:o,issues:null};return a.set(r.value,i),e8.push(i),o},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var o,a;let i;if("backward"!==r.direction&&(o=r,a=e.value,void 0!==(i=o[e9]?.backEdges)&&e5(a)&&i.has(a)))throw new e2;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var r;let o,a,i,n=!1;(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,s=(l,c)=>{let u;if(void 0===o){let t=function e(t,r,o){var a,i;let n=e6.get(t);if(void 0!==n)return 2*!!n;if(r.has(t))return 2;r.add(t);let s=0,l=t=>{if(2!==s&&t?._zod){let a=e(t,r,o);a>s&&(s=a)}},c=e=>{e>s&&(s=e)},u=t._zod.def;switch(u.type){case"object":{let t=ep(u);c(t?((t,a)=>{let i=0;for(let n of Reflect.ownKeys(t)){let s=Object.getOwnPropertyDescriptor(t,n);if(a&&!s.enumerable)continue;let l=s.get?1:s.value?._zod?e(s.value,r,o):0;l>i&&(i=l)}return i})(t,!0):1),l(u.catchall);break}case"array":l(u.element);break;case"tuple":for(let e of u.items)l(e);l(u.rest);break;case"record":case"map":l(u.keyType),l(u.valueType);break;case"set":l(u.valueType);break;case"union":for(let e of u.options)l(e);break;case"intersection":l(u.left),l(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(u.innerType);break;case"pipe":l(u.in),l(u.out);break;case"function":l(u.input),l(u.output);break;case"lazy":{let a=u._cachedInner??(o?t._zod.innerType:void 0);c(a?e(a,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in u){let t=Object.getOwnPropertyDescriptor(u,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),a=t,1!==(i=s)&&e6.set(a,2===i),i}(e,new Set,!1);if(0===t)return e._zod.parse=r,e._zod.run===s&&(e._zod.run=r),r(l,c);2===t||n?o=!0:n=!0}let d=l.value;if(!e5(d))return r(l,c);let p=c[e9];if(p||(p={buckets:new WeakMap,backEdges:void 0},c[e9]=p),a===c)u=i;else{var f;let t;(t=(f=p).buckets.get(e))||(t=new WeakMap,f.buckets.set(e,t)),u=t,a=c,i=u}let h=u.get(d);if(h)return l.value=h.value,h.issues?h.issues.length&&l.issues.push(...e4(h.issues)):(l.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(h.value)),l;t=u;let m=e8.length,y=r(l,c);t=void 0;let g=e8.length>m?e8.pop():void 0;return y instanceof Promise?y.then(e=>(g&&(g.issues=e.issues.length?e4(e.issues):e3),e)):(g&&(g.issues=y.issues.length?e4(y.issues):e3),y)};e._zod.parse=s,e._zod.run===r&&(e._zod.run=s)})}},te=/^[cC][0-9a-z]{6,}$/,tt=/^[0-9a-z]+$/,tr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,to=/^[0-9a-vA-V]{20}$/,ta=/^[A-Za-z0-9]{27}$/,ti=/^[a-zA-Z0-9_-]{21}$/,tn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ts=/^([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})$/,tl=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)$/,tc=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tu=/^(?:(?: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])$/,td=/^(([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}|:))$/,tp=/^((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])$/,tf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,th=/^https?$/,tm=/^\+[1-9]\d{6,14}$/,ty="(?:(?:\\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])))",tg=RegExp(`^${ty}$`);function tv(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let t_=/^[\s\S]{0,}$/,tb=/^-?\d+$/,tS=/^-?\d+(?:\.\d+)?$/,t$=/^(?:true|false)$/i,tw=/^null$/i,tE=/^[^A-Z]*$/,tR=/^[^a-z]*$/,tP=eX("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tk=e=>{let t=e.value;return null!=t&&void 0!==t.length},tO={number:"number",bigint:"bigint",object:"date"},tx=eX("$ZodCheckLessThan",(e,t)=>{tP.init(e,t);let r=tO[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:tO[typeof o.value]??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})}}),tT=eX("$ZodCheckGreaterThan",(e,t)=>{tP.init(e,t);let r=tO[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:tO[typeof o.value]??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})}}),tj=eX("$ZodCheckMultipleOf",(e,t)=>{tP.init(e,t),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?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0==(a=Math.round(o=r.value/t.value),i=4*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})}}),tC=eX("$ZodCheckNumberFormat",(e,t)=>{tP.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[a,i]=eO[t.format];e._zod.check=n=>{let s=n.value;if(r){if(!Number.isInteger(s))return void n.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?n.issues.push({input:s,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}):n.issues.push({input:s,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}))}s<a&&n.issues.push({origin:"number",input:s,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),s>i&&n.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),tI=eX("$ZodCheckMaxLength",(e,t)=>{var r;tP.init(e,t),(r=e._zod.def).when??(r.when=tk),e._zod.check=r=>{let o=r.value,a=o.length;if(("string"==typeof o&&a>t.maximum?eD(o):a)<=t.maximum)return;let i=eU(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tN=eX("$ZodCheckMinLength",(e,t)=>{var r;tP.init(e,t),(r=e._zod.def).when??(r.when=tk),e._zod.check=r=>{let o=r.value,a=o.length;if(("string"==typeof o&&a>=t.minimum&&a<2*t.minimum?eD(o):a)>=t.minimum)return;let i=eU(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tA=eX("$ZodCheckLengthEquals",(e,t)=>{var r;tP.init(e,t),(r=e._zod.def).when??(r.when=tk),e._zod.check=r=>{let o=r.value,a=o.length,i="string"==typeof o&&a>=t.length&&a<=2*t.length?eD(o):a;if(i===t.length)return;let n=eU(o),s=i>t.length;r.issues.push({origin:n,...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})}}),tM=eX("$ZodCheckStringFormat",(e,t)=>{var r,o;tP.init(e,t),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=()=>{})}),tq=eX("$ZodCheckRegex",(e,t)=>{tM.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})}}),tz=eX("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tE),tM.init(e,t)}),tL=eX("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tR),tM.init(e,t)}),tD=eX("$ZodCheckIncludes",(e,t)=>{tP.init(e,t);let r=eE(t.includes),o=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=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})}}),tU=eX("$ZodCheckStartsWith",(e,t)=>{tP.init(e,t);let r=RegExp(`^${eE(t.prefix)}.*`);t.pattern??(t.pattern=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})}}),tV=eX("$ZodCheckEndsWith",(e,t)=>{tP.init(e,t);let r=RegExp(`.*${eE(t.suffix)}$`);t.pattern??(t.pattern=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})}}),tF=eX("$ZodCheckOverwrite",(e,t)=>{tP.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class tH{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{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(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
6
|
+
`)).replace(/\\r/g,"\r")),r[e]=o}return r}(e)},populate:function(e,t,r={}){let o=c(r&&r.debug),a=c(r&&r.override),i={};if(null===e||"object"!=typeof e||null===t||"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],i[r]=t[r]),o&&m(!0===a?`"${r}" is already defined and WAS overwritten`:`"${r}" is already defined and was NOT overwritten`)):(e[r]=t[r],i[r]=t[r]);return i}};t.exports.configDotenv=g.configDotenv,t.exports.config=g.config,t.exports.parse=g.parse,t.exports.populate=g.populate,t.exports=g})();e.exports=i,e.exports.config=i.config,e.exports.configDotenv=i.configDotenv,e.exports.parse=i.parse,e.exports.populate=i.populate},8330(e){"use strict";e.exports=JSON.parse('{"name":"xmcp","version":"1.12.1"}')}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={exports:{}};return r[e](i,i.exports,a),i.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(r,o){if(1&o&&(r=this(r)),8&o||"object"==typeof r&&r&&(4&o&&r.__esModule||16&o&&"function"==typeof r.then))return r;var i=Object.create(null);a.r(i);var n={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&r;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>{n[e]=()=>r[e]});return n.default=()=>r,a.d(i,n),i},a.d=(e,t,r)=>{var o=(t,r)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,[r]:t[o]})};o(t,"get"),o(r,"value")},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};for(var n in(()=>{"use strict";let e,t,r,o,n,s,l,c,u,d,p,f,h,m,y,g,v,_,b,S,$,w,E,R;a.r(i),a.d(i,{HOST_CONTEXT_CHANGED_METHOD:()=>yi,INITIALIZED_METHOD:()=>m8,INITIALIZE_METHOD:()=>m6,LOG_MESSAGE_METHOD:()=>yo,MCP_APPS_PROTOCOL_VERSION:()=>m4,OPEN_LINK_METHOD:()=>ye,REQUEST_DISPLAY_MODE_METHOD:()=>m7,RESOURCES_READ_METHOD:()=>ya,SIZE_CHANGED_METHOD:()=>yn,UI_MESSAGE_METHOD:()=>yr,UPDATE_MODEL_CONTEXT_METHOD:()=>yt,UrlElicitationRequiredError:()=>l7,acceptedContent:()=>c_,apiKeyAuthMiddleware:()=>V,audio:()=>Y,callSTDIOClientTool:()=>m9,completable:()=>di,createContext:()=>Z,createHTTPClient:()=>m0,createMcpHostBridge:()=>yc,createRequestStateCodec:()=>dl,createSTDIOClient:()=>m1,disconnectSTDIOClient:()=>m3,embeddedResource:()=>Q,extractToolNamesFromRequest:()=>m5,getRequestContext:()=>er,headersToRecord:()=>mW,image:()=>X,inputRequired:()=>cv,inputResponse:()=>cb,isEnvHeader:()=>mZ,isInputRequiredResult:()=>ci,jwtAuthMiddleware:()=>K,listSTDIOClientTools:()=>m2});var P,O,k,x,T,C,j,I,N,A,M,q=a(8717),z=a.n(q);let L=require("zod/v3"),D=L.z.object({apiKey:L.z.string().optional(),headerName:L.z.string().optional(),validateApiKey:L.z.function().args(L.z.string()).returns(L.z.promise(L.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"}),U="Unauthorized: Missing or invalid API key";function V(e){let t=D.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,n)=>{let s=t.header(r);!s||"apiKey"in e&&s!==o||a&&!await a(s)?i.status(401).json({error:U}):n()}}var F=a(8400),H=a.n(F);function K(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=H().verify(i,r,a),o()}catch(e){r.status(401).json({error:"Unauthorized: Invalid or expired token"})}}}let G=require("async_hooks"),B=(e,t)=>{globalThis[e]=t},J=e=>globalThis[e];function Z({name:e,fallback:t=!0}){let r=Symbol.for(`xmcp-context-${e}`),o=Symbol.for(`xmcp-context-${e}-fallback-store`);if(J(r))return J(r);let a=new G.AsyncLocalStorage,i=globalThis[o]??{current:null};B(o,i);let n={provider:(e,r)=>(t&&(i.current=e),a.run(e,r)),getContext:()=>{let r=a.getStore();if(r)return r;if(t&&i.current)return i.current;throw Error(`getContext() can only be used within the ${e} context.`)},setContext:r=>{let o=a.getStore()??(t?i.current:null);if(!o)throw Error(`setContext() can only be used within the ${e} context.`);Object.assign(o,r)}};return B(r,n),n}function W(e){let t;if(e instanceof Uint8Array)t=e;else if(e instanceof ArrayBuffer)t=new Uint8Array(e);else throw TypeError("Expected bytes as a Uint8Array or ArrayBuffer");let r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(r)}function X(e,t){return{type:"image",data:W(e),mimeType:t}}function Y(e,t){return{type:"audio",data:W(e),mimeType:t}}function Q(e,t,r){return{type:"resource",resource:{uri:e,...void 0===r?{}:{mimeType:r},..."string"==typeof t?{text:t}:{blob:W(t)}}}}let ee=Z({name:"http-request-context"});ee.setContext,ee.getContext,ee.provider;let et=Z({name:"request-context",fallback:!1});function er(){try{return et.getContext().value}catch{throw Error("getRequestContext() can only be used while handling an MCP request.")}}var eo=Object.create,ea=Object.defineProperty,ei=Object.getOwnPropertyDescriptor,en=Object.getOwnPropertyNames,es=Object.getPrototypeOf,el=Object.prototype.hasOwnProperty,ec=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);function eu(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 ed(e,t="|"){return e.map(e=>eI(e)).join(t)}function ep(e,t){return"bigint"==typeof t?t.toString():t}class ef{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function eh(e){return new ef(e)}function em(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}let ey=Symbol("evaluating");function eg(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ev(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function e_(e){return ev(e._zod.def)??e._zod.def.shape}function eb(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return eg(this,t,e),e},enumerable:!0,configurable:!0})}function eS(e,t,r){t in e?eg(e,t,r):e[t]=r}function e$(e,t,r,o){let a=e_(t);for(let i of r){let r=Object.getOwnPropertyDescriptor(a,i);r.enumerable&&(r.get?eb(e,i,()=>{let e=t._zod.def.shape[i];return o?o(e,i):e}):eS(e,i,o?o(r.value,i):r.value))}}function ew(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}let eE="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eR(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eP=eh(()=>{if(e4.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eO(e){if(!1===eR(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eR(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function ek(e){return eO(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let ex=new Set(["string","number","symbol"]);function eT(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eC(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function ej(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}function eI(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let eN={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]},eA={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function eM(e,t){let r=e_(e),o=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&o.push(e)}return o}function eq(e,t){let r={};e$(r,e,Reflect.ownKeys(e_(e)));var o=r,a=t;for(let e of Reflect.ownKeys(a)){let t=Object.getOwnPropertyDescriptor(a,e);t.enumerable&&(t.get?eb(o,e,()=>a[e]):eS(o,e,t.value))}return r}function ez(e,t,r,o="partial"){let a=t._zod.def.checks;if(a&&a.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let i=r?new Set(eM(t,r)):void 0,n={};return e$(n,t,Reflect.ownKeys(e_(t)),e&&((t,r)=>i&&!i.has(r)?t:new e({type:"optional",innerType:t}))),eC(t,ew(t._zod.def,{shape:n,checks:[]}))}function eL(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 eD(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eU(e){return"string"==typeof e?e:e?.message}function eV(e){let t=[];for(let r of e??[]){let e=r._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let o=e.maximum??e.length??e.size;o>=0&&t.push([o,r])}return t}function eF(e,t,r){var o;for(let a=t;a<e.length;a++)(o=e[a]).schema??(o.schema=r)}function eH(e,t,r){let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let a=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:eU(e.inst?._zod.def?.error?.(e))??eU(a?.(e))??eU(t?.error?.(e))??eU(r.customError?.(e))??eU(r.localeError?.(e))??"Invalid input",n={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(n[t]=e[t]);return n.path??(n.path=[]),n.message=i,t?.reportInput&&(n.input=e.input),n}let eK=/[\uD800-\uDBFF]/;function eG(e){let t=e.length;if(!eK.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(64512&e.charCodeAt(o))==55296&&(64512&e.charCodeAt(o+1))==56320&&(r--,o++);return r}function eB(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eJ(...e){let[t,r,o]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:o}:{...t}}function eZ(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function eW(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return eZ(this,r,o(this))},set(e){eZ(this,r,e)}})}return t}let eX=!1,eY={configurable:!0,get(){eX=!0}};function eQ(t,r,o){let a=Object.getPrototypeOf(t._zod);if(r in a&&e!==t._zod){e=void 0;return}e=t._zod,Object.defineProperty(a,r,{configurable:!0,get(){Object.defineProperty(this,r,eY);let e=eX;eX=!1;try{let t=o(this);return eX?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),eX=eX||e,t}catch(t){throw delete this[r],eX=eX||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}let e0=Object.freeze({status:"aborted"}),e1={value:void 0,enumerable:!1},e2="captureStackTrace"in Error?Error:null;function e9(e,t,r,o){function a(e){this.def=e,this.constr=c,this.traits=new Set}a.prototype={};let i=r&&new WeakSet;function n(o,n){if(o._zod){if(o._zod.traits.has(e))return}else{e1.value=new a(n);try{Object.defineProperty(o,"_zod",e1)}finally{e1.value=void 0}}if(o._zod.traits.add(e),t(o,n),i){let e=Object.getPrototypeOf(o),t=o._zod.constr.prototype,a=e;for(;a&&a!==t;)a=Object.getPrototypeOf(a);let n=a??e;if(!i.has(n)){i.add(n);var s=n,l=r;for(let e in l){let t=Object.getOwnPropertyDescriptor(l,e);t.get?Object.defineProperty(s,e,{...t,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:eZ(this,t,r.bind(this))},set(e){eZ(this,t,e)}})}(s,e,t.value)}}}let u=c.prototype;for(let e in u)Object.prototype.hasOwnProperty.call(u,e)&&(e in o||(o[e]=u[e].bind(o)))}let s=o?.Parent??Object;class l extends s{}function c(e){let t=o?.Parent?function(e){let t=e2;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return e2=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(l):this;n(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let a=globalThis.__zod_globalConfig?.postProcessor;return a&&a(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:t=>!!o?.Parent&&t instanceof o.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class e3 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class e5 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(N=globalThis).__zod_globalConfig??(N.__zod_globalConfig={});let e4=globalThis.__zod_globalConfig;function e6(e){return e&&Object.assign(e4,e),e4}class e8 extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let e7="~memo",te=[];function tt(e){return null!==e&&"object"==typeof e}function tr(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let to=new WeakMap,ta=[],ti={alloc(e,r,o){let a=t;if(!a)return o;t=void 0;let i={value:o,issues:null};return a.set(r.value,i),ta.push(i),o},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var o,a;let i;if("backward"!==r.direction&&(o=r,a=e.value,void 0!==(i=o[e7]?.backEdges)&&tt(a)&&i.has(a)))throw new e8;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var r;let o,a,i,n=!1;(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,s=(l,c)=>{let u;if(void 0===o){let t=function e(t,r,o){var a,i;let n=to.get(t);if(void 0!==n)return 2*!!n;if(r.has(t))return 2;r.add(t);let s=0,l=t=>{if(2!==s&&t?._zod){let a=e(t,r,o);a>s&&(s=a)}},c=e=>{e>s&&(s=e)},u=t._zod.def;switch(u.type){case"object":{let t=ev(u);c(t?((t,a)=>{let i=0;for(let n of Reflect.ownKeys(t)){let s=Object.getOwnPropertyDescriptor(t,n);if(a&&!s.enumerable)continue;let l=s.get?1:s.value?._zod?e(s.value,r,o):0;l>i&&(i=l)}return i})(t,!0):1),l(u.catchall);break}case"array":l(u.element);break;case"tuple":for(let e of u.items)l(e);l(u.rest);break;case"record":case"map":l(u.keyType),l(u.valueType);break;case"set":l(u.valueType);break;case"union":for(let e of u.options)l(e);break;case"intersection":l(u.left),l(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(u.innerType);break;case"pipe":l(u.in),l(u.out);break;case"function":l(u.input),l(u.output);break;case"lazy":{let a=u._cachedInner??(o?t._zod.innerType:void 0);c(a?e(a,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in u){let t=Object.getOwnPropertyDescriptor(u,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),a=t,1!==(i=s)&&to.set(a,2===i),i}(e,new Set,!1);if(0===t)return e._zod.parse=r,e._zod.run===s&&(e._zod.run=r),r(l,c);2===t||n?o=!0:n=!0}let d=l.value;if(!tt(d))return r(l,c);let p=c[e7];if(p||(p={buckets:new WeakMap,backEdges:void 0},c[e7]=p),a===c)u=i;else{var f,h;let t;f=p,h=e,(t=f.buckets.get(h))||(t=new WeakMap,f.buckets.set(h,t)),u=t,a=c,i=u}let m=u.get(d);if(m)return l.value=m.value,m.issues?m.issues.length&&l.issues.push(...tr(m.issues)):(l.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(m.value)),l;t=u;let y=ta.length,g=r(l,c);t=void 0;let v=ta.length>y?ta.pop():void 0;return g instanceof Promise?g.then(e=>(v&&(v.issues=e.issues.length?tr(e.issues):te),e)):(v&&(v.issues=g.issues.length?tr(g.issues):te),g)};e._zod.parse=s,e._zod.run===r&&(e._zod.run=s)})}},tn=/^[cC][0-9a-z]{6,}$/,ts=/^[0-9a-z]+$/,tl=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,tc=/^[0-9a-vA-V]{20}$/,tu=/^[A-Za-z0-9]{27}$/,td=/^[a-zA-Z0-9_-]{21}$/,tp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tf=/^([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})$/,th=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)$/,tm=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ty=/^(?:(?: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])$/,tg=/^(([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}|:))$/,tv=/^((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])$/,t_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tb=/^https?$/,tS=/^\+[1-9]\d{6,14}$/,t$="(?:(?:\\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])))",tw=(P=t$,RegExp(`^${P}$`));function tE(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let tR=/^[\s\S]{0,}$/,tP=/^-?\d+$/,tO=/^-?\d+(?:\.\d+)?$/,tk=/^(?:true|false)$/i,tx=/^null$/i,tT=/^[^A-Z]*$/,tC=/^[^a-z]*$/,tj=e9("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tI=e=>{let t=e.value;return null!=t&&void 0!==t.length},tN={number:"number",bigint:"bigint",object:"date"},tA=e9("$ZodCheckLessThan",(e,t)=>{tj.init(e,t);let r=tN[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:tN[typeof o.value]??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})}}),tM=e9("$ZodCheckGreaterThan",(e,t)=>{tj.init(e,t);let r=tN[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:tN[typeof o.value]??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})}}),tq=e9("$ZodCheckMultipleOf",(e,t)=>{tj.init(e,t),e._zod.check=r=>{var o;let a,i,n;if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0==(i=Math.round(a=(o=r.value)/t.value),n=4*Number.EPSILON*Math.max(Math.abs(a),1),Math.abs(a-i)<n?0:a-i))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),tz=e9("$ZodCheckNumberFormat",(e,t)=>{tj.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[a,i]=eN[t.format];e._zod.check=n=>{let s=n.value;if(r){if(!Number.isInteger(s))return void n.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?n.issues.push({input:s,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}):n.issues.push({input:s,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}))}s<a&&n.issues.push({origin:"number",input:s,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),s>i&&n.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),tL=e9("$ZodCheckMaxLength",(e,t)=>{var r;tj.init(e,t),(r=e._zod.def).when??(r.when=tI),e._zod.check=r=>{let o=r.value,a=o.length;if(("string"==typeof o&&a>t.maximum?eG(o):a)<=t.maximum)return;let i=eB(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tD=e9("$ZodCheckMinLength",(e,t)=>{var r;tj.init(e,t),(r=e._zod.def).when??(r.when=tI),e._zod.check=r=>{let o=r.value,a=o.length;if(("string"==typeof o&&a>=t.minimum&&a<2*t.minimum?eG(o):a)>=t.minimum)return;let i=eB(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tU=e9("$ZodCheckLengthEquals",(e,t)=>{var r;tj.init(e,t),(r=e._zod.def).when??(r.when=tI),e._zod.check=r=>{let o=r.value,a=o.length,i="string"==typeof o&&a>=t.length&&a<=2*t.length?eG(o):a;if(i===t.length)return;let n=eB(o),s=i>t.length;r.issues.push({origin:n,...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})}}),tV=e9("$ZodCheckStringFormat",(e,t)=>{var r,o;tj.init(e,t),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=()=>{})}),tF=e9("$ZodCheckRegex",(e,t)=>{tV.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})}}),tH=e9("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tT),tV.init(e,t)}),tK=e9("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tC),tV.init(e,t)}),tG=e9("$ZodCheckIncludes",(e,t)=>{tj.init(e,t);let r=eT(t.includes),o=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=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})}}),tB=e9("$ZodCheckStartsWith",(e,t)=>{tj.init(e,t);let r=RegExp(`^${eT(t.prefix)}.*`);t.pattern??(t.pattern=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})}}),tJ=e9("$ZodCheckEndsWith",(e,t)=>{tj.init(e,t);let r=RegExp(`.*${eT(t.suffix)}$`);t.pattern??(t.pattern=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})}}),tZ=e9("$ZodCheckOverwrite",(e,t)=>{tj.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class tW{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{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(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
7
7
|
${t.join("\n")}
|
|
8
|
-
};`)(...Object.values(this.closed))}}let tK={major:4,minor:6,patch:7},tG=eX("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tK;let o=e._zod.def.checks,a=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let t of a)for(let r of t._zod.onattach)r(e);if(0===a.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,r,o)=>{let a;if(t.memo)return t;let i=eI(t);for(let n of r){if(n._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}(t)||!n._zod.def.when(t))continue}else if(i)continue;let r=t.issues.length,s=n._zod.check(t);if(s instanceof Promise&&o?.async===!1)throw new eY;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==r&&(eq(t.issues,r,e),i||(i=eI(t,r)))});else{if(t.issues.length===r)continue;eq(t.issues,r,e),i||(i=eI(t,r))}}return a?a.then(()=>t):t},r=(r,o,i)=>{if(eI(r))return r.aborted=!0,r;let n=t(o,a,i);if(n instanceof Promise){if(!1===i.async)throw new eY;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 eY;return n.then(e=>t(e,a,i))}return t(n,a,i)}}},{get"~standard"(){return eF(this,"~standard",tJ(this),!1)},set"~standard"(e){eF(this,"~standard",e)}}),tB=(e,t)=>e.issues.length?{issues:e.issues.map(e=>ez(e,t,e1()))}:{value:e.value};function tJ(e){return{validate:t=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return tB(o,r)}catch(e){}return async function(e,t){let r={async:!0};return tB(await e._zod.run({value:t,issues:[]},r),r)}(e,t)},vendor:"zod",version:1}}let tZ=eX("$ZodString",(e,t)=>{tG.init(e,t),e._zod.pattern=t.pattern??t_,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}}),tW=eX("$ZodStringFormat",(e,t)=>{tM.init(e,t),tZ.init(e,t)}),tX=eX("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ts),tW.init(e,t)}),tY=eX("$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=tl(e))}else t.pattern??(t.pattern=tl());tW.init(e,t)}),tQ=eX("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tc),tW.init(e,t)});function t0(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let t1=/[\t\n\r]/g;function t2(e){return e.replace(t1,"")}let t9=eX("$ZodURL",(e,t)=>{tW.init(e,t),e._zod.check=r=>{try{var o,a;let i=r.value.trim(),n="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===th.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(i,t):t0(i)||2;if(1===n)return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});if(2===n)return void r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});if(!0===n){r.value=t2(i);return}t.hostname&&((o=t.hostname).lastIndex=0,!o.test(n.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&&((a=t.protocol).lastIndex=0,!a.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?n.href:t2(i);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),t3=eX("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),tW.init(e,t)}),t5=eX("$ZodNanoID",(e,t)=>{var r;if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?ti:(r=t.length,RegExp(`^[a-zA-Z0-9_-]{${r}}$`))),tW.init(e,t)}),t4=eX("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=te),tW.init(e,t)}),t6=eX("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tt),tW.init(e,t)}),t8=eX("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tr),tW.init(e,t)}),t7=eX("$ZodXID",(e,t)=>{t.pattern??(t.pattern=to),tW.init(e,t)}),re=eX("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ta),tW.init(e,t)}),rt=eX("$ZodISODateTime",(e,t)=>{let r,o,a;t.pattern??(r=["Z"],t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),o=`${tv({precision:t.precision,seconds:!0})}(?:${r.join("|")})`,a=t.local?`${o}|${tv({precision:t.precision})}`:o,t.pattern=RegExp(`^${ty}T(?:${a})$`)),tW.init(e,t)}),rr=eX("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tg),tW.init(e,t)}),ro=eX("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${tv(t)}$`)),tW.init(e,t)}),ra=eX("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=tn),tW.init(e,t)}),ri=eX("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tu),tW.init(e,t)}),rn=/^[0-9a-fA-F:.]+$/;function rs(e){return!!rn.test(e)&&t0(`http://[${e}]`)}let rl=eX("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=td),tW.init(e,t),e._zod.check=r=>{rs(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),rc=eX("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=tp),tW.init(e,t)}),ru=eX("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=tf),tW.init(e,t),e._zod.check=r=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[r,o]=t;if(!o)return!1;let a=Number(o);return`${a}`===o&&!(a<0)&&!(a>128)&&rs(r)}(r.value)&&r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function rd(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let rp=/^[0-9a-zA-Z+/]*={0,2}$/,rf=eX("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=rp),tW.init(e,t),e._zod.check=r=>{rd(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),rh=/^[A-Za-z0-9_-]*$/,rm=eX("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=rh),tW.init(e,t),e._zod.check=r=>{!function(e){if(!rh.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return rd(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})}}),ry=eX("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tm),tW.init(e,t)}),rg=eX("$ZodJWT",(e,t)=>{tW.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})}}),rv=eX("$ZodNumber",(e,t)=>{tG.init(e,t),e._zod.pattern=tS,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:String(a):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...i?{received:i}:{}}),r}}),r_=eX("$ZodNumberFormat",(e,t)=>{tC.init(e,t),rv.init(e,t)}),rb=eX("$ZodBoolean",(e,t)=>{tG.init(e,t),e._zod.pattern=t$,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}}),rS=eX("$ZodNull",(e,t)=>{tG.init(e,t),e._zod.pattern=tw,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}}),r$=eX("$ZodAny",(e,t)=>{tG.init(e,t),e._zod.parse=e=>e}),rw=eX("$ZodUnknown",(e,t)=>{tG.init(e,t),e._zod.parse=e=>e}),rE=eX("$ZodNever",(e,t)=>{tG.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),rR=e=>Array.isArray(e)?e.length:-1;function rP(e,t,r){e.issues.length&&t.issues.push(...eN(r,e.issues)),t.value[r]=e.value}let rk=eX("$ZodArray",(e,t)=>{tG.init(e,t);let r=e0.memoizer;r?.attach(e),e._zod.parse=(o,a)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),o;o.value=r?r.alloc(e,o,Array(i.length),a):Array(i.length);let n=[],s=a?.abortEarly;for(let e=0;e<i.length;e++){let r=i[e],l=t.element._zod.run({value:r,issues:[]},a);if(l instanceof Promise)n.push(l.then(t=>rP(t,o,e)));else if(rP(l,o,e),s&&0!==l.issues.length&&eI(l))break}return n.length?Promise.all(n).then(()=>o):o},function(e,t){let r=eM(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map(e=>e[0])),a=e._zod.parse;e._zod.parse=(r,i)=>{let n=t(r.value);if(n>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[t,o]of eM(e._zod.def.checks))if(n>t&&o._zod.def.when(r)){let t=r.issues.length;return o._zod.check(r),r.issues[t].continue=!1,eq(r.issues,t,e),r}}return a(r,i)}}(e,rR)});function rO(e,t,r,o,a,i){let n=r in o,s="optional"===i;if(n||!s||"optional"!==a){if(e.issues.length){if(void 0!==a&&s&&!n)return;t.issues.push(...eN(r,e.issues))}if(!n&&void 0===a){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?(n||"defaulted"===a&&!s)&&(t.value[r]=void 0):t.value[r]=e.value}}let rx=[];function rT(e){var t;let r=Object.keys(e.shape),o=Object.getOwnPropertySymbols(e.shape),a=o.length?o:rx,i=a.length?[...r,...a]:r;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let n=Object.keys(t=e.shape).filter(e=>void 0!==t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,allKeys:i,symbolKeys:a,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(n)}}function rj(e,t,r,o,a,i,n){let s=[],l=a.keySet,c=a.catchall._zod,u=c.def.type,d=c.optin,p=c.optout,f=0;for(let a in t){if(n&&r.issues.length!==f){if(eI(r,f))break;f=r.issues.length}if(l.has(a))continue;if("__proto__"===a){"never"===u&&s.push(a);continue}if("never"===u){s.push(a);continue}let i=c.run({value:t[a],issues:[]},o);i instanceof Promise?e.push(i.then(e=>rO(e,r,a,t,d,p))):rO(i,r,a,t,d,p)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i,continue:!0}),e.length)?Promise.all(e).then(()=>r):r}let rC=eX("$ZodObject",(e,t)=>{let r;tG.init(e,t);let o=Object.getOwnPropertyDescriptor(t,"shape"),a=o?.get?o.get.raw:t.shape??{};if(a){let e=()=>{let r={...a};return Object.defineProperty(t,"shape",{value:r}),e.raw=r,r};e.raw=a,Object.defineProperty(t,"shape",{get:e})}let i=el(()=>rT(t));eB(e,"propValues",e=>{let t=e.def.shape,r={};for(let e in t){let o=t[e]._zod;if(o.values){for(let t of(Object.prototype.hasOwnProperty.call(r,e)||ed(r,e,new Set),o.values))r[e].add(t);void 0!==o.optin&&r[e].add(void 0)}}return r});let n=t.catchall,s=e0.memoizer;s?.attach(e),e._zod.parse=(t,o)=>{r??(r=i.value);let a=t.value;if(!e_(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value=s?s.alloc(e,t,{},o):{};let l=[],c=r.shape,u=o?.abortEarly,d=t.issues.length;for(let e of r.allKeys){if(u&&t.issues.length!==d){if(eI(t,d))break;d=t.issues.length}if("__proto__"===e)continue;let r=c[e],i=r._zod.optin,n=r._zod.optout,s=r._zod.run({value:a[e],issues:[]},o);s instanceof Promise?l.push(s.then(r=>rO(r,t,e,a,i,n))):rO(s,t,e,a,i,n)}return n?rj(l,a,t,o,i.value,e,!0===u):l.length?Promise.all(l).then(()=>t):t}}),rI=eX("$ZodObjectJIT",(e,t)=>{let r,o;rC.init(e,t);let a=e._zod.parse,i=el(()=>rT(t)),n=e0.memoizer,s=!e0.jitless,l=s&&eb.value,c=t.catchall;e._zod.parse=(u,d)=>{o??(o=i.value);let p=u.value;return e_(p)?s&&l&&d?.async===!1&&!0!==d.jitless?(r||(r=(t=>{let r=i.value,o=r.symbolKeys,a=new tH(["payload","ctx"],{shape:t,inst:e,memo:n,syms:o}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
|
|
8
|
+
};`)(...Object.values(this.closed))}}let tX={major:4,minor:6,patch:7},tY=e9("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tX;let o=e._zod.def.checks,a=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let t of a)for(let r of t._zod.onattach)r(e);if(0===a.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,r,o)=>{let a;if(t.memo)return t;let i=eL(t);for(let n of r){if(n._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}(t)||!n._zod.def.when(t))continue}else if(i)continue;let r=t.issues.length,s=n._zod.check(t);if(s instanceof Promise&&o?.async===!1)throw new e3;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==r&&(eF(t.issues,r,e),i||(i=eL(t,r)))});else{if(t.issues.length===r)continue;eF(t.issues,r,e),i||(i=eL(t,r))}}return a?a.then(()=>t):t},r=(r,o,i)=>{if(eL(r))return r.aborted=!0,r;let n=t(o,a,i);if(n instanceof Promise){if(!1===i.async)throw new e3;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 e3;return n.then(e=>t(e,a,i))}return t(n,a,i)}}},{get"~standard"(){var e;return e=this,eZ(e,"~standard",t0(this),!1)},set"~standard"(e){eZ(this,"~standard",e)}}),tQ=(e,t)=>e.issues.length?{issues:e.issues.map(e=>eH(e,t,e6()))}:{value:e.value};function t0(e){return{validate:t=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return tQ(o,r)}catch(e){}return async function(e,t){let r={async:!0};return tQ(await e._zod.run({value:t,issues:[]},r),r)}(e,t)},vendor:"zod",version:1}}let t1=e9("$ZodString",(e,t)=>{tY.init(e,t),e._zod.pattern=t.pattern??tR,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}}),t2=e9("$ZodStringFormat",(e,t)=>{tV.init(e,t),t1.init(e,t)}),t9=e9("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=tf),t2.init(e,t)}),t3=e9("$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=th(e))}else t.pattern??(t.pattern=th());t2.init(e,t)}),t5=e9("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tm),t2.init(e,t)});function t4(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let t6=/[\t\n\r]/g;function t8(e){return e.replace(t6,"")}let t7=e9("$ZodURL",(e,t)=>{t2.init(e,t),e._zod.check=r=>{try{var o,a,i,n,s,l;let c=r.value.trim(),u=(o=c,a=t,"normalize"in a||"hostname"in a||"protocol"in a?function(e,t){if(!t.normalize&&t.protocol?.source===tb.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(o,a):t4(o)||2);if(1===u)return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});if(2===u)return void r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});if(!0===u){r.value=t8(c);return}t.hostname&&(i=u,(n=t.hostname).lastIndex=0,!n.test(i.hostname))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&(s=u,(l=t.protocol).lastIndex=0,!l.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?u.href:t8(c);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),re=e9("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),t2.init(e,t)}),rt=e9("$ZodNanoID",(e,t)=>{var r;if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?td:(r=t.length,RegExp(`^[a-zA-Z0-9_-]{${r}}$`))),t2.init(e,t)}),rr=e9("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=tn),t2.init(e,t)}),ro=e9("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ts),t2.init(e,t)}),ra=e9("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tl),t2.init(e,t)}),ri=e9("$ZodXID",(e,t)=>{t.pattern??(t.pattern=tc),t2.init(e,t)}),rn=e9("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=tu),t2.init(e,t)}),rs=e9("$ZodISODateTime",(e,t)=>{var r;let o,a,i;t.pattern??(o=["Z"],(r=t).offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),a=`${tE({precision:r.precision,seconds:!0})}(?:${o.join("|")})`,i=r.local?`${a}|${tE({precision:r.precision})}`:a,t.pattern=RegExp(`^${t$}T(?:${i})$`)),t2.init(e,t)}),rl=e9("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tw),t2.init(e,t)}),rc=e9("$ZodISOTime",(e,t)=>{var r;t.pattern??(r=t,t.pattern=RegExp(`^${tE(r)}$`)),t2.init(e,t)}),ru=e9("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=tp),t2.init(e,t)}),rd=e9("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ty),t2.init(e,t)}),rp=/^[0-9a-fA-F:.]+$/;function rf(e){return!!rp.test(e)&&t4(`http://[${e}]`)}let rh=e9("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=tg),t2.init(e,t),e._zod.check=r=>{rf(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),rm=e9("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=tv),t2.init(e,t)}),ry=e9("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=t_),t2.init(e,t),e._zod.check=r=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[r,o]=t;if(!o)return!1;let a=Number(o);return`${a}`===o&&!(a<0)&&!(a>128)&&rf(r)}(r.value)&&r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function rg(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let rv=/^[0-9a-zA-Z+/]*={0,2}$/,r_=e9("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=rv),t2.init(e,t),e._zod.check=r=>{rg(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),rb=/^[A-Za-z0-9_-]*$/,rS=e9("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=rb),t2.init(e,t),e._zod.check=r=>{!function(e){if(!rb.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return rg(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})}}),r$=e9("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tS),t2.init(e,t)}),rw=e9("$ZodJWT",(e,t)=>{t2.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})}}),rE=e9("$ZodNumber",(e,t)=>{tY.init(e,t),e._zod.pattern=tO,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:String(a):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...i?{received:i}:{}}),r}}),rR=e9("$ZodNumberFormat",(e,t)=>{tz.init(e,t),rE.init(e,t)}),rP=e9("$ZodBoolean",(e,t)=>{tY.init(e,t),e._zod.pattern=tk,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}}),rO=e9("$ZodNull",(e,t)=>{tY.init(e,t),e._zod.pattern=tx,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}}),rk=e9("$ZodAny",(e,t)=>{tY.init(e,t),e._zod.parse=e=>e}),rx=e9("$ZodUnknown",(e,t)=>{tY.init(e,t),e._zod.parse=e=>e}),rT=e9("$ZodNever",(e,t)=>{tY.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),rC=e=>Array.isArray(e)?e.length:-1;function rj(e,t,r){e.issues.length&&t.issues.push(...eD(r,e.issues)),t.value[r]=e.value}let rI=e9("$ZodArray",(e,t)=>{tY.init(e,t);let r=e4.memoizer;r?.attach(e),e._zod.parse=(o,a)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),o;o.value=r?r.alloc(e,o,Array(i.length),a):Array(i.length);let n=[],s=a?.abortEarly;for(let e=0;e<i.length;e++){let r=i[e],l=t.element._zod.run({value:r,issues:[]},a);if(l instanceof Promise)n.push(l.then(t=>rj(t,o,e)));else if(rj(l,o,e),s&&0!==l.issues.length&&eL(l))break}return n.length?Promise.all(n).then(()=>o):o},function(e,t){let r=eV(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map(e=>e[0])),a=e._zod.parse;e._zod.parse=(r,i)=>{let n=t(r.value);if(n>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[t,o]of eV(e._zod.def.checks))if(n>t&&o._zod.def.when(r)){let t=r.issues.length;return o._zod.check(r),r.issues[t].continue=!1,eF(r.issues,t,e),r}}return a(r,i)}}(e,rC)});function rN(e,t,r,o,a,i){let n=r in o,s="optional"===i;if(n||!s||"optional"!==a){if(e.issues.length){if(void 0!==a&&s&&!n)return;t.issues.push(...eD(r,e.issues))}if(!n&&void 0===a){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?(n||"defaulted"===a&&!s)&&(t.value[r]=void 0):t.value[r]=e.value}}let rA=[];function rM(e){var t;let r=Object.keys(e.shape),o=Object.getOwnPropertySymbols(e.shape),a=o.length?o:rA,i=a.length?[...r,...a]:r;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let n=Object.keys(t=e.shape).filter(e=>void 0!==t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,allKeys:i,symbolKeys:a,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(n)}}function rq(e,t,r,o,a,i,n){let s=[],l=a.keySet,c=a.catchall._zod,u=c.def.type,d=c.optin,p=c.optout,f=0;for(let a in t){if(n&&r.issues.length!==f){if(eL(r,f))break;f=r.issues.length}if(l.has(a))continue;if("__proto__"===a){"never"===u&&s.push(a);continue}if("never"===u){s.push(a);continue}let i=c.run({value:t[a],issues:[]},o);i instanceof Promise?e.push(i.then(e=>rN(e,r,a,t,d,p))):rN(i,r,a,t,d,p)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i,continue:!0}),e.length)?Promise.all(e).then(()=>r):r}let rz=e9("$ZodObject",(e,t)=>{let r;tY.init(e,t);let o=Object.getOwnPropertyDescriptor(t,"shape"),a=o?.get?o.get.raw:t.shape??{};if(a){let e=()=>{let r={...a};return Object.defineProperty(t,"shape",{value:r}),e.raw=r,r};e.raw=a,Object.defineProperty(t,"shape",{get:e})}let i=eh(()=>rM(t));eQ(e,"propValues",e=>{let t=e.def.shape,r={};for(let e in t){let o=t[e]._zod;if(o.values){for(let t of(Object.prototype.hasOwnProperty.call(r,e)||eg(r,e,new Set),o.values))r[e].add(t);void 0!==o.optin&&r[e].add(void 0)}}return r});let n=t.catchall,s=e4.memoizer;s?.attach(e),e._zod.parse=(t,o)=>{r??(r=i.value);let a=t.value;if(!eR(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value=s?s.alloc(e,t,{},o):{};let l=[],c=r.shape,u=o?.abortEarly,d=t.issues.length;for(let e of r.allKeys){if(u&&t.issues.length!==d){if(eL(t,d))break;d=t.issues.length}if("__proto__"===e)continue;let r=c[e],i=r._zod.optin,n=r._zod.optout,s=r._zod.run({value:a[e],issues:[]},o);s instanceof Promise?l.push(s.then(r=>rN(r,t,e,a,i,n))):rN(s,t,e,a,i,n)}return n?rq(l,a,t,o,i.value,e,!0===u):l.length?Promise.all(l).then(()=>t):t}}),rL=e9("$ZodObjectJIT",(e,t)=>{let r,o;rz.init(e,t);let a=e._zod.parse,i=eh(()=>rM(t)),n=e4.memoizer,s=!e4.jitless,l=s&&eP.value,c=t.catchall;e._zod.parse=(u,d)=>{o??(o=i.value);let p=u.value;return eR(p)?s&&l&&d?.async===!1&&!0!==d.jitless?(r||(r=(t=>{let r=i.value,o=r.symbolKeys,a=new tW(["payload","ctx"],{shape:t,inst:e,memo:n,syms:o}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
|
|
9
9
|
let ${e}_ab = false;
|
|
10
10
|
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
11
11
|
const iss = ${e}.issues[i];
|
|
@@ -55,27 +55,27 @@ ${t.join("\n")}
|
|
|
55
55
|
newResult[${i}] = ${r}.value;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
`)}return a.write("payload.value = newResult;"),a.write("return payload;"),a.compile()})(t.shape)),u=r(u,d),c)?rj([],p,u,d,o,e,d?.abortEarly===!0):u:a(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u)}});function rN(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=>!eI(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=>ez(e,o,e1())))}),t)}let rA=eX("$ZodUnion",(e,t)=>{tG.init(e,t),eB(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),eB(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eB(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),eB(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>ec(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,n=[];for(let e of t.options){let t=e._zod.run({value:o.value,issues:[]},a);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=>rN(t,o,e,a)):rN(n,o,e,a)}}),rM=eX("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,rA.init(e,t);let r=e._zod.parse;eB(e,"propValues",e=>{let t={},r=0;for(let o of e.def.options){let a=o._zod.propValues;if(!a||0===Object.keys(a).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(o)}"`);for(let[o,i]of(a[e.def.discriminator]?.has(void 0)&&r++,Object.entries(a)))for(let e of(Object.prototype.hasOwnProperty.call(t,o)||ed(t,o,new Set),i))t[o].add(e)}return!e.def.unionFallback&&r>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,r)=>{let o=ep(e._zod.def);if(o&&!Object.prototype.hasOwnProperty.call(o,t.discriminator))throw Error(`Invalid discriminated union option at index "${r}"`)});let o=el(()=>(function(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||0===o.size)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let e of o)if(t.has(e)){if(void 0!==e)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,r)}return t})(t));e._zod.parse=(a,i)=>{let n=a.value;if(!e_(n))return a.issues.push({code:"invalid_type",expected:"object",input:n,inst:e}),a;let s=n?.[t.discriminator],l=o.value.get(s);return l&&(void 0!==s||"backward"!==i.direction)?l._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()).filter(e=>null!==o.value.get(e)),input:n,path:[t.discriminator],inst:e}),a)}}),rq=eX("$ZodIntersection",(e,t)=>{tG.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])=>rz(e,t,r)):rz(e,a,i)}});function rz(e,t,r){let o,a=new Map,i=new Map,n=(e,t)=>{let r;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);i.has(t)||i.set(t,e),r=[t]}else o??(o=e),r=e.keys;for(let e of r)a.has(e)||a.set(e,{}),a.get(e)[t]=!0;return!0};for(let r of t.issues)n(r,"l")||e.issues.push(r);for(let t of r.issues)n(t,"r")||e.issues.push(t);let s=[...a].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=o?s.filter(e=>o.keys.includes(e)):[];for(let r of(t.length&&e.issues.push({...o,keys:t}),s))!t.includes(r)&&i.has(r)&&e.issues.push(i.get(r))}let l=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(eS(t)&&eS(r)){let o=Object.keys(r),a=Object.keys(t).filter(e=>-1!==o.indexOf(e)),i={...t,...r};for(let o of(Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__,a)){if("__proto__"===o)continue;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(!l.valid){if(eI(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}let rL=eX("$ZodRecord",(e,t)=>{tG.init(e,t);let r=e0.memoizer;r?.attach(e),e._zod.parse=(o,a)=>{let i=o.value;if(!eS(i))return o.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),o;let n=[],s=t.keyType._zod.values;if(s&&!t.partial){let l;o.value=r?r.alloc(e,o,{},a):{};let c=new Set;for(let r of s)if("string"==typeof r||"number"==typeof r||"symbol"==typeof r){if(c.add("number"==typeof r?r.toString():r),"__proto__"===r)continue;let s=t.keyType._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>ez(e,a,e1())),input:r,path:[r],inst:e});continue}let l=s.value;if("__proto__"===l)continue;let u=t.valueType._zod.run({value:i[r],issues:[]},a);u instanceof Promise?n.push(u.then(e=>{e.issues.length&&o.issues.push(...eN(r,e.issues)),o.value[l]=e.value})):(u.issues.length&&o.issues.push(...eN(r,u.issues)),o.value[l]=u.value)}for(let e in i)if(!c.has(e))if("loose"===t.mode){if("__proto__"===e)continue;o.value[e]=i[e]}else(l=l??[]).push(e);l&&l.length>0&&o.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}else{let l;for(let c of(o.value=r?r.alloc(e,o,{},a):{},Reflect.ownKeys(i))){if("__proto__"===c||!Object.prototype.propertyIsEnumerable.call(i,c))continue;let r=t.keyType._zod.run({value:c,issues:[]},a);if(r instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof c&&tS.test(c)&&r.issues.length){let e=t.keyType._zod.run({value:Number(c),issues:[]},a);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(r=e)}if(r.issues.length){"loose"===t.mode?o.value[c]=i[c]:s?(l=l??[]).push(c):o.issues.push({code:"invalid_key",origin:"record",issues:r.issues.map(e=>ez(e,a,e1())),input:c,path:[c],inst:e});continue}let u=r.value;if("__proto__"===u)continue;let d=t.valueType._zod.run({value:i[c],issues:[]},a);d instanceof Promise?n.push(d.then(e=>{e.issues.length&&o.issues.push(...eN(c,e.issues)),o.value[u]=e.value})):(d.issues.length&&o.issues.push(...eN(c,d.issues)),o.value[u]=d.value)}l&&l.length>0&&o.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}return n.length?Promise.all(n).then(()=>o):o}}),rD=eX("$ZodEnum",(e,t)=>{tG.init(e,t);let r=ea(t.entries),o=new Set(r);e._zod.values=o,eB(e,"pattern",e=>{let t=ea(e.def.entries).filter(e=>ew.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>eE(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),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}}),rU=eX("$ZodLiteral",(e,t)=>{tG.init(e,t);let r=new Set(t.values);e._zod.values=r,eB(e,"pattern",e=>{let t=e.def.values;return new RegExp(t.length?`^(${t.map(e=>"string"==typeof e?eE(e):e?eE(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$")}),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}}),rV=eX("$ZodTransform",(e,t)=>{tG.init(e,t),e._zod.optin="optional",e0.memoizer?.guard(e),e._zod.parse=(r,o)=>{if("backward"===o.direction)throw new eQ(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));if(a instanceof Promise)throw new eY;return r.value=a,r}});function rF(e,t){return e.value=t.issues.length?void 0:t.value,e}let rH=eX("$ZodOptional",(e,t)=>{tG.init(e,t),eB(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",eB(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),eB(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ec(t.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let o=t.innerType._zod.run({value:e.value,issues:[]},r);return o instanceof Promise?o.then(t=>rF(e,t)):rF(e,o)}return t.innerType._zod.run(e,r)}}),rK=eX("$ZodExactOptional",(e,t)=>{rH.init(e,t),eB(e,"values",e=>e.def.innerType._zod.values),eB(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),rG=eX("$ZodNullable",(e,t)=>{tG.init(e,t),eB(e,"optin",e=>e.def.innerType._zod.optin),eB(e,"optout",e=>e.def.innerType._zod.optout),eB(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ec(t.source)}|null)$`):void 0}),eB(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),rB=eX("$ZodDefault",(e,t)=>{tG.init(e,t),e._zod.optin="defaulted",eB(e,"values",e=>e.def.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=>rJ(e,t)):rJ(o,t)}});function rJ(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let rZ=eX("$ZodPrefault",(e,t)=>{tG.init(e,t),e._zod.optin="defaulted",eB(e,"values",e=>e.def.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))}),rW=eX("$ZodNonOptional",(e,t)=>{tG.init(e,t),eB(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].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=>rX(t,e)):rX(a,e)}});function rX(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function rY(e,t,r,o){return t.issues.length?e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ez(e,o,e1()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}let rQ=eX("$ZodCatch",(e,t)=>{tG.init(e,t),eB(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),eB(e,"optout",e=>e.def.innerType._zod.optout),eB(e,"values",e=>e.def.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({value:e.value,issues:[]},r);return o instanceof Promise?o.then(o=>rY(e,o,t,r)):rY(e,o,t,r)}}),r0=eX("$ZodPipe",(e,t)=>{tG.init(e,t),eB(e,"values",e=>e.def.in._zod.values),eB(e,"optin",e=>e.def.in._zod.optin),eB(e,"optout",e=>e.def.out._zod.optout),eB(e,"propValues",e=>e.def.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=>r1(e,t.in,r)):r1(o,t.in,r)}let o=t.in._zod.run(e,r);return o instanceof Promise?o.then(e=>r1(e,t.out,r)):r1(o,t.out,r)}});function r1(e,t,r){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}let r2=eX("$ZodPreprocess",(e,t)=>{r0.init(e,t)}),r9=eX("$ZodReadonly",(e,t)=>{tG.init(e,t),eB(e,"propValues",e=>e.def.innerType._zod.propValues),eB(e,"values",e=>e.def.innerType._zod.values),eB(e,"optin",e=>e.def.innerType?._zod?.optin),eB(e,"optout",e=>e.def.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(r3):r3(o)}});function r3(e){return e.memo||(e.value=Object.freeze(e.value)),e}let r5=eX("$ZodLazy",(e,t)=>{var r;let o;tG.init(e,t),r=e._zod,Object.defineProperty(r,"innerType",{get(){if(o!==eu)return void 0===o&&(o=eu,o=(()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner))()),o},set(e){Object.defineProperty(r,"innerType",{value:e})},configurable:!0}),eB(e,"pattern",e=>e.innerType?._zod?.pattern),eB(e,"propValues",e=>e.innerType?._zod?.propValues),eB(e,"optin",e=>e.innerType?._zod?.optin??void 0),eB(e,"optout",e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)}),r4=eX("$ZodCustom",(e,t)=>{tP.init(e,t),tG.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=>r6(t,r,o,e));r6(a,r,o,e)}});function r6(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(eV(e))}}(x=globalThis).__zod_globalRegistry??(x.__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 r8=globalThis.__zod_globalRegistry;function r7(e){return e.checks&&(e.checks=[...e.checks]),e}function oe(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...eP(t)})}function ot(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...eP(t)})}function or(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...eP(t)})}function oo(e,t){return new e({type:"string",format:"date",check:"string_format",...eP(t)})}function oa(e,t){return new tx({check:"less_than",...eP(t),value:e,inclusive:!1})}function oi(e,t){return new tx({check:"less_than",...eP(t),value:e,inclusive:!0})}function on(e,t){return new tT({check:"greater_than",...eP(t),value:e,inclusive:!1})}function os(e,t){return new tT({check:"greater_than",...eP(t),value:e,inclusive:!0})}function ol(e,t){return new tj({check:"multiple_of",...eP(t),value:e})}function oc(e,t){return new tI({check:"max_length",...eP(t),maximum:e})}function ou(e,t){return new tN({check:"min_length",...eP(t),minimum:e})}function od(e,t){return new tA({check:"length_equals",...eP(t),length:e})}function op(e){return new tF({check:"overwrite",tx:e})}function of(e,...t){for(let r of t)for(let t of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,t)&&ed(e,t,r[t]);return e}function oh(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??r8,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function om(e,t,r,o,a){let i="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:o.path,message:a}):t.unrepresentable;if("any"===i)return!1;if(void 0===i||"throw"===i)throw Error(a);return Object.assign(r,i),!0}function oy(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 n={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,n),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)n.schema=s;else{let o={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,n.schema,o);else{let r=n.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&&(n.ref||(n.ref=i),oy(i,t,o),t.seen.get(i).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&of(n.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||"catch"===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 n.schema.examples,delete n.schema.default),"input"===t.io&&"_prefault"in n.schema&&((o=n.schema).default??(o.default=n.schema._prefault)),delete n.schema._prefault,t.seen.get(e).schema}function og(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function ov(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;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}/${og(i)}`}}let a=`#/${o}/`;if(t[1]===r&&!t[1].schema.id)return{ref:"#"};let i=t[1].schema.id??`__schema${e.counter++}`;return{defId:i,ref:a+og(i)}})(t);o.def={...o.schema},i&&(o.defId=i);let n=o.schema;for(let e in n)delete n[e];n.$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>
|
|
58
|
+
`)}return a.write("payload.value = newResult;"),a.write("return payload;"),a.compile()})(t.shape)),u=r(u,d),c)?rq([],p,u,d,o,e,d?.abortEarly===!0):u:a(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u)}});function rD(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=>!eL(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=>eH(e,o,e6())))}),t)}let rU=e9("$ZodUnion",(e,t)=>{tY.init(e,t),eQ(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),eQ(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eQ(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),eQ(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>em(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,n=[];for(let e of t.options){let t=e._zod.run({value:o.value,issues:[]},a);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=>rD(t,o,e,a)):rD(n,o,e,a)}}),rV=e9("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,rU.init(e,t);let r=e._zod.parse;eQ(e,"propValues",e=>{let t={},r=0;for(let o of e.def.options){let a=o._zod.propValues;if(!a||0===Object.keys(a).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(o)}"`);for(let[o,i]of(a[e.def.discriminator]?.has(void 0)&&r++,Object.entries(a)))for(let e of(Object.prototype.hasOwnProperty.call(t,o)||eg(t,o,new Set),i))t[o].add(e)}return!e.def.unionFallback&&r>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,r)=>{let o=ev(e._zod.def);if(o&&!Object.prototype.hasOwnProperty.call(o,t.discriminator))throw Error(`Invalid discriminated union option at index "${r}"`)});let o=eh(()=>(function(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||0===o.size)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let e of o)if(t.has(e)){if(void 0!==e)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,r)}return t})(t));e._zod.parse=(a,i)=>{let n=a.value;if(!eR(n))return a.issues.push({code:"invalid_type",expected:"object",input:n,inst:e}),a;let s=n?.[t.discriminator],l=o.value.get(s);return l&&(void 0!==s||"backward"!==i.direction)?l._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()).filter(e=>null!==o.value.get(e)),input:n,path:[t.discriminator],inst:e}),a)}}),rF=e9("$ZodIntersection",(e,t)=>{tY.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])=>rH(e,t,r)):rH(e,a,i)}});function rH(e,t,r){let o,a=new Map,i=new Map,n=(e,t)=>{let r;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);i.has(t)||i.set(t,e),r=[t]}else o??(o=e),r=e.keys;for(let e of r)a.has(e)||a.set(e,{}),a.get(e)[t]=!0;return!0};for(let r of t.issues)n(r,"l")||e.issues.push(r);for(let t of r.issues)n(t,"r")||e.issues.push(t);let s=[...a].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=o?s.filter(e=>o.keys.includes(e)):[];for(let r of(t.length&&e.issues.push({...o,keys:t}),s))!t.includes(r)&&i.has(r)&&e.issues.push(i.get(r))}let l=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(eO(t)&&eO(r)){let o=Object.keys(r),a=Object.keys(t).filter(e=>-1!==o.indexOf(e)),i={...t,...r};for(let o of(Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__,a)){if("__proto__"===o)continue;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=t[a],n=e(i,r[a]);if(!n.valid)return{valid:!1,mergeErrorPath:[a,...n.mergeErrorPath]};o.push(n.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!l.valid){if(eL(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}let rK=e9("$ZodRecord",(e,t)=>{tY.init(e,t);let r=e4.memoizer;r?.attach(e),e._zod.parse=(o,a)=>{let i=o.value;if(!eO(i))return o.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),o;let n=[],s=t.keyType._zod.values;if(s&&!t.partial){let l;o.value=r?r.alloc(e,o,{},a):{};let c=new Set;for(let r of s)if("string"==typeof r||"number"==typeof r||"symbol"==typeof r){if(c.add("number"==typeof r?r.toString():r),"__proto__"===r)continue;let s=t.keyType._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>eH(e,a,e6())),input:r,path:[r],inst:e});continue}let l=s.value;if("__proto__"===l)continue;let u=t.valueType._zod.run({value:i[r],issues:[]},a);u instanceof Promise?n.push(u.then(e=>{e.issues.length&&o.issues.push(...eD(r,e.issues)),o.value[l]=e.value})):(u.issues.length&&o.issues.push(...eD(r,u.issues)),o.value[l]=u.value)}for(let e in i)if(!c.has(e))if("loose"===t.mode){if("__proto__"===e)continue;o.value[e]=i[e]}else(l=l??[]).push(e);l&&l.length>0&&o.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}else{let l;for(let c of(o.value=r?r.alloc(e,o,{},a):{},Reflect.ownKeys(i))){if("__proto__"===c||!Object.prototype.propertyIsEnumerable.call(i,c))continue;let r=t.keyType._zod.run({value:c,issues:[]},a);if(r instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof c&&tO.test(c)&&r.issues.length){let e=t.keyType._zod.run({value:Number(c),issues:[]},a);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(r=e)}if(r.issues.length){"loose"===t.mode?o.value[c]=i[c]:s?(l=l??[]).push(c):o.issues.push({code:"invalid_key",origin:"record",issues:r.issues.map(e=>eH(e,a,e6())),input:c,path:[c],inst:e});continue}let u=r.value;if("__proto__"===u)continue;let d=t.valueType._zod.run({value:i[c],issues:[]},a);d instanceof Promise?n.push(d.then(e=>{e.issues.length&&o.issues.push(...eD(c,e.issues)),o.value[u]=e.value})):(d.issues.length&&o.issues.push(...eD(c,d.issues)),o.value[u]=d.value)}l&&l.length>0&&o.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}return n.length?Promise.all(n).then(()=>o):o}}),rG=e9("$ZodEnum",(e,t)=>{tY.init(e,t);let r=eu(t.entries),o=new Set(r);e._zod.values=o,eQ(e,"pattern",e=>{let t=eu(e.def.entries).filter(e=>ex.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>eT(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),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}}),rB=e9("$ZodLiteral",(e,t)=>{tY.init(e,t);let r=new Set(t.values);e._zod.values=r,eQ(e,"pattern",e=>{let t=e.def.values;return new RegExp(t.length?`^(${t.map(e=>"string"==typeof e?eT(e):e?eT(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$")}),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}}),rJ=e9("$ZodTransform",(e,t)=>{tY.init(e,t),e._zod.optin="optional",e4.memoizer?.guard(e),e._zod.parse=(r,o)=>{if("backward"===o.direction)throw new e5(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));if(a instanceof Promise)throw new e3;return r.value=a,r}});function rZ(e,t){return e.value=t.issues.length?void 0:t.value,e}let rW=e9("$ZodOptional",(e,t)=>{tY.init(e,t),eQ(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",eQ(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),eQ(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${em(t.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let o=t.innerType._zod.run({value:e.value,issues:[]},r);return o instanceof Promise?o.then(t=>rZ(e,t)):rZ(e,o)}return t.innerType._zod.run(e,r)}}),rX=e9("$ZodExactOptional",(e,t)=>{rW.init(e,t),eQ(e,"values",e=>e.def.innerType._zod.values),eQ(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),rY=e9("$ZodNullable",(e,t)=>{tY.init(e,t),eQ(e,"optin",e=>e.def.innerType._zod.optin),eQ(e,"optout",e=>e.def.innerType._zod.optout),eQ(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${em(t.source)}|null)$`):void 0}),eQ(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),rQ=e9("$ZodDefault",(e,t)=>{tY.init(e,t),e._zod.optin="defaulted",eQ(e,"values",e=>e.def.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=>r0(e,t)):r0(o,t)}});function r0(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let r1=e9("$ZodPrefault",(e,t)=>{tY.init(e,t),e._zod.optin="defaulted",eQ(e,"values",e=>e.def.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))}),r2=e9("$ZodNonOptional",(e,t)=>{tY.init(e,t),eQ(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].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=>r9(t,e)):r9(a,e)}});function r9(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function r3(e,t,r,o){return t.issues.length?e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>eH(e,o,e6()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}let r5=e9("$ZodCatch",(e,t)=>{tY.init(e,t),eQ(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),eQ(e,"optout",e=>e.def.innerType._zod.optout),eQ(e,"values",e=>e.def.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({value:e.value,issues:[]},r);return o instanceof Promise?o.then(o=>r3(e,o,t,r)):r3(e,o,t,r)}}),r4=e9("$ZodPipe",(e,t)=>{tY.init(e,t),eQ(e,"values",e=>e.def.in._zod.values),eQ(e,"optin",e=>e.def.in._zod.optin),eQ(e,"optout",e=>e.def.out._zod.optout),eQ(e,"propValues",e=>e.def.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=>r6(e,t.in,r)):r6(o,t.in,r)}let o=t.in._zod.run(e,r);return o instanceof Promise?o.then(e=>r6(e,t.out,r)):r6(o,t.out,r)}});function r6(e,t,r){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}let r8=e9("$ZodPreprocess",(e,t)=>{r4.init(e,t)}),r7=e9("$ZodReadonly",(e,t)=>{tY.init(e,t),eQ(e,"propValues",e=>e.def.innerType._zod.propValues),eQ(e,"values",e=>e.def.innerType._zod.values),eQ(e,"optin",e=>e.def.innerType?._zod?.optin),eQ(e,"optout",e=>e.def.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(oe):oe(o)}});function oe(e){return e.memo||(e.value=Object.freeze(e.value)),e}let ot=e9("$ZodLazy",(e,t)=>{var r,o,a;let i;tY.init(e,t),r=e._zod,o="innerType",a=()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner),Object.defineProperty(r,o,{get(){if(i!==ey)return void 0===i&&(i=ey,i=a()),i},set(e){Object.defineProperty(r,o,{value:e})},configurable:!0}),eQ(e,"pattern",e=>e.innerType?._zod?.pattern),eQ(e,"propValues",e=>e.innerType?._zod?.propValues),eQ(e,"optin",e=>e.innerType?._zod?.optin??void 0),eQ(e,"optout",e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)}),or=e9("$ZodCustom",(e,t)=>{tj.init(e,t),tY.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=>oo(t,r,o,e));oo(a,r,o,e)}});function oo(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(eJ(e))}}class oa{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)}}(A=globalThis).__zod_globalRegistry??(A.__zod_globalRegistry=new oa);let oi=globalThis.__zod_globalRegistry;function on(e){return e.checks&&(e.checks=[...e.checks]),e}function os(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ej(t)})}function ol(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ej(t)})}function oc(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ej(t)})}function ou(e,t){return new e({type:"string",format:"date",check:"string_format",...ej(t)})}function od(e,t){return new tA({check:"less_than",...ej(t),value:e,inclusive:!1})}function op(e,t){return new tA({check:"less_than",...ej(t),value:e,inclusive:!0})}function of(e,t){return new tM({check:"greater_than",...ej(t),value:e,inclusive:!1})}function oh(e,t){return new tM({check:"greater_than",...ej(t),value:e,inclusive:!0})}function om(e,t){return new tq({check:"multiple_of",...ej(t),value:e})}function oy(e,t){return new tL({check:"max_length",...ej(t),maximum:e})}function og(e,t){return new tD({check:"min_length",...ej(t),minimum:e})}function ov(e,t){return new tU({check:"length_equals",...ej(t),length:e})}function o_(e){return new tZ({check:"overwrite",tx:e})}function ob(e,...t){for(let r of t)for(let t of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,t)&&eg(e,t,r[t]);return e}function oS(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??oi,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function o$(e,t,r,o,a){let i="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:o.path,message:a}):t.unrepresentable;if("any"===i)return!1;if(void 0===i||"throw"===i)throw Error(a);return Object.assign(r,i),!0}function ow(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 n={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,n),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)n.schema=s;else{let o={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,n.schema,o);else{let r=n.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&&(n.ref||(n.ref=i),ow(i,t,o),t.seen.get(i).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&ob(n.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||"catch"===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 n.schema.examples,delete n.schema.default),"input"===t.io&&"_prefault"in n.schema&&((o=n.schema).default??(o.default=n.schema._prefault)),delete n.schema._prefault,t.seen.get(e).schema}function oE(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function oR(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;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}/${oE(i)}`}}let a=`#/${o}/`;if(t[1]===r&&!t[1].schema.id)return{ref:"#"};let i=t[1].schema.id??`__schema${e.counter++}`;return{defId:i,ref:a+oE(i)}})(t);o.def={...o.schema},i&&(o.defId=i);let n=o.schema;for(let e in n)delete n[e];n.$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>
|
|
59
59
|
|
|
60
|
-
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){a(r);continue}o.count>1&&"ref"===e.reused&&a(r)}e.external&&(e.sharedDefsExtractedFor=e.external)}let o_=new Set(["type","properties","required","additionalProperties"]),ob=["oneOf","anyOf"];function oS(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function o$(e){let t=[];for(let r of e){if("object"!=typeof r||"object"!==r.type)return null;for(let e in r)if(!o_.has(e))return null;t.push(r)}let r={},o=new Set;for(let e of t){for(let o in e.properties){if(Object.prototype.hasOwnProperty.call(r,o))continue;let e=[];for(let r of t){let t=r.properties?.[o]??oS(r);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}ed(r,o,1===e.length?e[0]:o$(e)??{allOf:e})}for(let t of e.required??[])o.add(t)}let a={type:"object",properties:r};if(o.size&&(a.required=[...o]),t.every(e=>!1===e.additionalProperties))a.additionalProperties=!1;else{let e=[];for(let r of t){let t=oS(r);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?a.additionalProperties=e[0]:e.length>1&&(a.additionalProperties={allOf:e})}return a}function ow(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},n=r.ref;if(r.ref=null,n){o(n);let r=e.seen.get(n),s=r.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(a.allOf=a.allOf??[],a.allOf.push(s)):of(a,s),of(a,i),t._zod.parent===n)for(let e in a)"$ref"!==e&&"allOf"!==e&&(e in i||delete a[e]);if(s.$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 s=t._zod.parent;if(s&&s!==n){o(s);let t=e.seen.get(s);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??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())o(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let r=t.anyOf;if(!Array.isArray(r)||0===r.length||void 0!==t.type)return;let o=[];for(let t of r){if(!t||"object"!=typeof t)return;e(t);let r=Object.keys(t);if(1!==r.length||"type"!==r[0])return;let a=t.type;for(let e of Array.isArray(a)?a:[a]){if("string"!=typeof e)return;o.includes(e)||o.push(e)}}delete t.anyOf,t.type=1===o.length?o[0]:o}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let r of e.seen.values())for(let e of[r.schema,r.def]){let r=e?.allOf;if(!Array.isArray(r))continue;let o=t.get(r);o?o.push(e):t.set(r,[e])}for(let r of e.intersections)for(let e of t.get(r)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of o_)if(t in e)return;let r=t.filter(e=>ob.some(t=>Array.isArray(e[t]))),o=null;if(r.length){let e=r[0],a=ob.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let i=t.filter(t=>t!==e),n=e[a].map(e=>o$([...i,e]));if(n.some(e=>!e))return;o={[a]:n}}else o=o$(t);o&&(delete e.allOf,of(e,o))}(e)}}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)}of(a,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;void 0!==i&&a.id===i&&delete a.id;let n=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,ed(n,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(n).length>0&&("draft-2020-12"===e.target?a.$defs=n:a.definitions=n);try{let r=JSON.parse(JSON.stringify(a));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:oE(t,"input",e.processors),output:oE(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let oE=(e,t,r={})=>o=>{let{libraryOptions:a,target:i}=o??{},n=oh({...a??{},target:i,io:t,processors:r});return oy(e,n),ov(n,e),ow(n,e)},oR=(e,t,r)=>{(void 0===e[t]||r>e[t])&&(e[t]=r)},oP=(e,t,r)=>{(void 0===e[t]||r<e[t])&&(e[t]=r)},ok=(e,t)=>{oR(e,"minimum",t),oP(e,"maximum",t)},oO=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},ox=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},oT=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},oj=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},oC=(e,t)=>oR(e,"minimum",t.minimum),oI=(e,t)=>oP(e,"maximum",t.maximum),oN=e=>(t,r)=>{oj(t,r.format);let[o,a]=e[r.format];oR(t,"minimum",o),oP(t,"maximum",a)},oA={greater_than:(e,t)=>oR(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>oP(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>oO(e,t.value),number_format:oN(eO),bigint_format:oN(ex),min_length:oC,max_length:oI,length_equals:(e,t)=>ok(e,t.length),min_size:oC,max_size:oI,size_equals:(e,t)=>ok(e,t.size),string_format:(e,t)=>{oj(e,t.format),t.pattern&&ox(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>oT(e,t.mime)};function oM(e){let t={},r=e._zod.def;for(let o of e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[])oA[o._zod.def.check]?.(t,o._zod.def);let o=e._zod.bag;for(let e of(void 0!==o.minimum&&oR(t,"minimum",o.minimum),void 0!==o.exclusiveMinimum&&oR(t,"exclusiveMinimum",o.exclusiveMinimum),void 0!==o.maximum&&oP(t,"maximum",o.maximum),void 0!==o.exclusiveMaximum&&oP(t,"exclusiveMaximum",o.exclusiveMaximum),void 0!==o.multipleOf&&oO(t,o.multipleOf),void 0!==o.format&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&oT(t,o.mime),o.patterns??[]))ox(t,e);return t}let oq={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oz=new Map([[rp,/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/],[rh,/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/]]),oL=e=>oz.get(e)??e,oD=(e,t,r,o)=>{r.type="string";let{minimum:a,maximum:i,format:n,patterns:s,contentEncoding:l,laxFormat:c}=oM(e);if("number"==typeof a&&(r.minLength=a),"number"==typeof i&&(r.maxLength=i),n&&(r.format=oq[n]??n,""===r.format&&delete r.format,("time"===n||c)&&delete r.format),l&&(r.contentEncoding=l),s&&s.size>0){let e=[...s].map(oL);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}))])}},oU=(e,t,r,o)=>{let{minimum:a,maximum:i,multipleOf:n,exclusiveMaximum:s,exclusiveMinimum:l,isInt:c}=oM(e);r.type=c?"integer":"number";let u="number"==typeof l&&l>=(a??-1/0),d="number"==typeof s&&s<=(i??1/0),p="draft-04"===t.target||"openapi-3.0"===t.target;if(u?p?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:"number"==typeof a&&(r.minimum=a),d?p?(r.maximum=s,r.exclusiveMaximum=!0):r.exclusiveMaximum=s:"number"==typeof i&&(r.maximum=i),n){let a=new Set;for(let i of n)Number.isFinite(i)&&0!==i?a.add(Math.abs(i)):om(e,t,r,o,`A multipleOf divisor of ${i} cannot be represented in JSON Schema`);let[i,...s]=a;void 0!==i&&(r.multipleOf=i),s.length&&(r.allOf=[...r.allOf??[],...s.map(e=>({multipleOf:e}))])}},oV=(e,t,r,o)=>{r.type="boolean"},oF=(e,t,r,o)=>{"openapi-3.0"===t.target?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},oH=(e,t,r,o)=>{r.not={}},oK=(e,t,r,o)=>{},oG=(e,t,r,o)=>{},oB=(e,t,r,o)=>{let a=ea(e._zod.def.entries);if(0===a.length){r.not={};return}a.every(e=>"number"==typeof e)&&(r.type="number"),a.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=a},oJ=(e,t,r,o)=>{let a=e._zod.def;if(0===a.values.length){r.not={};return}let i=[];for(let n of a.values)if(void 0===n){if(om(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof n){if(om(e,t,r,o,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(n))}else i.push(n);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},oZ=(e,t,r,o)=>{om(e,t,r,o,"Custom types cannot be represented in JSON Schema")},oW=(e,t,r,o)=>{om(e,t,r,o,"Transforms cannot be represented in JSON Schema")},oX=(e,t,r,o)=>{let a=e._zod.def,{minimum:i,maximum:n}=oM(e);"number"==typeof i&&(r.minItems=i),"number"==typeof n&&(r.maxItems=n),r.type="array",r.items=oy(a.element,t,{...o,path:[...o.path,"items"]})};function oY(e){let t=e._zod.def;return"pipe"===t.type&&t.in._zod.traits.has("$ZodTransform")?oY(t.out):"catch"===t.type?oY(t.innerType):e._zod.optin}let oQ=(e,t,r,o)=>{let a=e._zod.def,i=a.shape;if(Object.getOwnPropertySymbols(i).length&&om(e,t,r,o,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in r.type="object",r.properties={},i)ed(r.properties,e,oy(i[e],t,{...o,path:[...o.path,"properties",e]}));let n=[];for(let e of Object.keys(i)){let r=a.shape[e];("input"===t.io?void 0===oY(r):void 0===r._zod.optout)&&n.push(e)}n.length>0&&(r.required=n),a.catchall?._zod.def.type==="never"?r.additionalProperties=!1:a.catchall?a.catchall&&(r.additionalProperties=oy(a.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)},o0=(e,t,r,o)=>{let a=e._zod.def,i=!1===a.inclusive,n=a.options.map((e,r)=>oy(e,t,{...o,path:[...o.path,i?"oneOf":"anyOf",r]}));i?r.oneOf=n:r.anyOf=n},o1=(e,t,r,o)=>{let a=e._zod.def,i=oy(a.left,t,{...o,path:[...o.path,"allOf",0]}),n=oy(a.right,t,{...o,path:[...o.path,"allOf",1]}),s=e=>"allOf"in e&&1===Object.keys(e).length,l=[...s(i)?i.allOf:[i],...s(n)?n.allOf:[n]];r.allOf=l,t.intersections.push(l)},o2=new WeakMap,o9=(e,t,r,o)=>{let a=e._zod.def;r.type="object";let i=a.keyType,n=oM(i).patterns;if("loose"===a.mode&&n&&n.size>0){let e=oy(a.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});for(let t of(r.patternProperties={},n))ed(r.patternProperties,oL(t).source,e)}else{if("draft-07"===t.target||"draft-2020-12"===t.target){r.propertyNames=oy(a.keyType,t,{...o,path:[...o.path,"propertyNames"]});let i=o2.get(t);i||(i=[],o2.set(t,i),t.deferred.push(()=>(function(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let r=new Map;for(let o of o2.get(e)??[]){let a=e.seen.get(o),i=(a?.def??a?.schema)?.propertyNames;if(!i||!0===i||r.has(i))continue;let n=function e(t,r,o){if(r.$ref){if(o.has(r))return r;o.add(r);let a=t.get(r)?.def;if(!a)return r;let i=e(t,a,o);return i===a?r:i}for(let a of["anyOf","oneOf"]){let i=r[a];if(!Array.isArray(i))continue;let n=i.map(r=>e(t,r,o));n.some((e,t)=>e!==i[t])&&(r={...r,[a]:n})}let a=Array.isArray(r.type)?r.type:[r.type],i=!a.includes("string")&&a.some(e=>"number"===e||"integer"===e),n=r.enum??(void 0!==r.const?[r.const]:void 0);if(!i&&!n?.some(e=>"number"==typeof e))return r;let{minimum:s,maximum:l,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:d,format:p,id:f,...h}=r;return h.enum?h.enum=h.enum.map(e=>"number"==typeof e?String(e):e):"number"==typeof h.const&&(h.const=String(h.const)),i&&(h.type="string",n||(h.pattern=(a.includes("number")?tS:tb).source)),h}(t,i,new Set);n!==i&&r.set(i,n)}if(r.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&r.get(e.propertyNames);t&&(e.propertyNames=t)}})(t))),i.push(e)}r.additionalProperties=oy(a.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let s=i._zod.values,l="input"===t.io&&void 0!==oY(a.valueType);if(s&&!a.partial&&!l){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(r.required=e.map(String))}},o3=(e,t,r,o)=>{let a=e._zod.def,i=oy(a.innerType,t,o),n=t.seen.get(e);"openapi-3.0"===t.target?(n.ref=a.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},o5=(e,t,r,o)=>{let a=e._zod.def;oy(a.innerType,t,o),t.seen.get(e).ref=a.innerType},o4=Symbol();function o6(e,t,r,o,a){let i=!1,n=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(i=!0,null));return i?(om(t,r,o,a,"BigInt defaults cannot be represented in JSON Schema"),o4):JSON.parse(n)}let o8=(e,t,r,o)=>{let a=e._zod.def;oy(a.innerType,t,o),t.seen.get(e).ref=a.innerType;let i=o6(a.defaultValue,e,t,r,o);i!==o4&&(r.default=i)},o7=(e,t,r,o)=>{let a=e._zod.def;if(oy(a.innerType,t,o),t.seen.get(e).ref=a.innerType,"input"!==t.io)return;let i=o6(a.defaultValue,e,t,r,o);i!==o4&&(r._prefault=i)},ae=(e,t,r,o)=>{let a,i=e._zod.def;oy(i.innerType,t,o),t.seen.get(e).ref=i.innerType;try{a=i.catchValue(void 0)}catch{om(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=a},at=(e,t,r,o)=>{let a=e._zod.def,i=a.in._zod.traits.has("$ZodTransform"),n="input"===t.io?i?a.out:a.in:a.out;oy(n,t,o),t.seen.get(e).ref=n},ar=(e,t,r,o)=>{let a=e._zod.def;oy(a.innerType,t,o),t.seen.get(e).ref=a.innerType,r.readOnly=!0},ao=(e,t,r,o)=>{let a=e._zod.def;oy(a.innerType,t,o),t.seen.get(e).ref=a.innerType},aa=(e,t,r,o)=>{let a=e._zod.innerType;oy(a,t,o),t.seen.get(e).ref=a},ai={string:oD,number:oU,boolean:oV,bigint:(e,t,r,o)=>{om(e,t,r,o,"BigInt cannot be represented in JSON Schema")},symbol:(e,t,r,o)=>{om(e,t,r,o,"Symbols cannot be represented in JSON Schema")},null:oF,undefined:(e,t,r,o)=>{om(e,t,r,o,"Undefined cannot be represented in JSON Schema")},void:(e,t,r,o)=>{om(e,t,r,o,"Void cannot be represented in JSON Schema")},never:oH,any:oK,unknown:oG,date:(e,t,r,o)=>{om(e,t,r,o,"Date cannot be represented in JSON Schema")},enum:oB,literal:oJ,nan:(e,t,r,o)=>{om(e,t,r,o,"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)=>{r.type="string",r.format="binary",r.contentEncoding="binary";let{minimum:a,maximum:i,mime:n}=oM(e);void 0!==a&&(r.minLength=a),void 0!==i&&(r.maxLength=i),n&&(0===n.length?r.not={}:1===n.length?r.contentMediaType=n[0]:r.anyOf=n.map(e=>({contentMediaType:e})))},success:(e,t,r,o)=>{r.type="boolean"},custom:oZ,function:(e,t,r,o)=>{om(e,t,r,o,"Function types cannot be represented in JSON Schema")},transform:oW,map:(e,t,r,o)=>{om(e,t,r,o,"Map cannot be represented in JSON Schema")},set:(e,t,r,o)=>{om(e,t,r,o,"Set cannot be represented in JSON Schema")},array:oX,object:oQ,union:o0,intersection:o1,tuple:(e,t,r,o)=>{let a=e._zod.def;r.type="array";let i="draft-2020-12"===t.target?"prefixItems":"items",n="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",s=a.items.map((e,r)=>oy(e,t,{...o,path:[...o.path,i,r]})),l=a.rest?oy(a.rest,t,{...o,path:[...o.path,n,..."openapi-3.0"===t.target?[a.items.length]:[]]}):null,c=a.items.length;for(;c>0;){let e=a.items[c-1];if(!("input"===t.io?void 0!==oY(e):"optional"===e._zod.optout))break;c--}let u=a.items.length,d=!a.rest;"draft-2020-12"===t.target?(r.prefixItems=s,d?r.items=!1:l&&(r.items=l)):"openapi-3.0"===t.target?(r.items={anyOf:s},l&&r.items.anyOf.push(l)):(r.items=s,d?r.additionalItems=!1:l&&(r.additionalItems=l)),c>0&&(r.minItems=c),d&&(r.maxItems=u);let{minimum:p,maximum:f}=oM(e);"number"==typeof p&&(r.minItems=p),"number"==typeof f&&(r.maxItems=f)},record:o9,nullable:o3,nonoptional:o5,default:o8,prefault:o7,catch:ae,pipe:at,readonly:ar,promise:(e,t,r,o)=>{let a=e._zod.def;oy(a.innerType,t,o),t.seen.get(e).ref=a.innerType},optional:ao,lazy:aa};function an(e,t){if("_idmap"in e){let r=oh({...t,processors:ai}),o={};for(let t of e._idmap.entries()){let[e,o]=t;oy(o,r)}let a={};for(let i of(r.external={registry:e,uri:t?.uri,defs:o},e._idmap.entries())){let[e,t]=i;ov(r,t),ed(a,e,ow(r,t))}return Object.keys(o).length>0&&(a.__shared={["draft-2020-12"===r.target?"$defs":"definitions"]:o}),{schemas:a}}let r=oh({...t,processors:ai});return oy(e,r),ov(r,e),ow(r,e)}let as={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,en,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},al={value:void 0,enumerable:!1},ac=new WeakSet([Object.prototype,Error.prototype]),au=(e,t)=>{e.name="$ZodError",al.value=t,Object.defineProperty(e,"issues",al),al.value=void 0,Object.defineProperty(e,"message",as);let r=Object.getPrototypeOf(e);ac.has(r)||(ac.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},ad=eX("$ZodError",au);function ap(e,t){return{callee:t?.callee??e,Err:t?.Err}}eX("$ZodError",au,void 0,{Parent:Error});let af=e=>{let t=(r,o,a,i)=>{let n=a?{...a,async:!1}:{async:!1},s=r._zod.run({value:o,issues:[]},n);if(s instanceof Promise)throw new eY;if(s.issues.length){let r=new(i?.Err??e)(s.issues.map(e=>ez(e,n,e1())));throw ev(r,i?.callee??t),r}return s.value};return t},ah=e=>{let t=async(r,o,a,i)=>{let n=a?{...a,async:!0}:{async:!0},s=r._zod.run({value:o,issues:[]},n);if(s instanceof Promise&&(s=await s),s.issues.length){let r=new(i?.Err??e)(s.issues.map(e=>ez(e,n,e1())));throw ev(r,i?.callee??t),r}return s.value};return t},am=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 eY;return i.issues.length?ay(e,i.issues,a):{success:!0,data:i.value}};function ay(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(e=>ez(e,r,e1()))),t=void 0,r=void 0),o},set error(e){o=e,t=void 0,r=void 0}}}let ag=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?ay(e,i.issues,a):{success:!0,data:i.value}},av=Symbol.for("zod.compile.invalid"),a_=Symbol.for("zod.compile.fallback"),ab=new WeakSet([Object.prototype,Error.prototype]);function aS(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=r(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let a$=eX("ZodError",(e,t)=>{ad.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);ab.has(r)||(ab.add(r),aS(r,"format",e=>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],n=a===e.length-1;if("_errors"===r){n&&o._errors.push(t(i)),a++;continue}Object.prototype.hasOwnProperty.call(o,r)||Object.defineProperty(o,r,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=o[r];n&&s._errors.push(t(i)),o=s,a++}}}};return o(e),r})(e,t)),aS(r,"flatten",e=>t=>(function(e,t=e=>e.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0){var a,i;(a=n.path[0],i=()=>[],!Object.prototype.hasOwnProperty.call(r,a)&&("__proto__"===a?Object.defineProperty(r,a,{value:i(),writable:!0,enumerable:!0,configurable:!0}):r[a]=i()),r[a]).push(t(n))}else o.push(t(n));return{formErrors:o,fieldErrors:r}})(e,t)),aS(r,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,en,2)}),aS(r,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,en,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error}),aw=af(a$),aE=ah(a$),aR=am(a$),aP=ag(a$),ak=(p=af(a$),f=(e,t,r,o)=>p(e,t,r?{...r,direction:"backward"}:{direction:"backward"},ap(f,o))),aO=(h=af(a$),m=(e,t,r,o)=>h(e,t,r,ap(m,o))),ax=(y=ah(a$),g=async(e,t,r,o)=>{let a=r?{...r,direction:"backward"}:{direction:"backward"};return await y(e,t,a,ap(g,o))}),aT=(v=ah(a$),_=async(e,t,r,o)=>await v(e,t,r,ap(_,o))),aj=(e,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return am(a$)(e,t,o)},aC=(e,t,r)=>am(a$)(e,t,r),aI=async(e,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return ag(a$)(e,t,o)},aN=async(e,t,r)=>ag(a$)(e,t,r);function aA(){e0.memoizer||e1({memoizer:e7})}let aM=eX("ZodType",(e,t)=>(e0.localeError||e1({localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function o(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?r[e]??e:String(t)}return r=>{switch(r.code){case"invalid_type":{let e=o(r.expected),t=o(function(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}(r.input),r.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===r.values.length)return`Invalid input: expected ${ek(r.values[0])}`;return`Invalid option: expected one of ${ei(r.values,"|")}`;case"too_big":{let t=r.exact?"exactly ":r.inclusive?"<=":"<",o=e[r.origin]??null;if(o)return`Too big: expected ${r.origin??"value"} to have ${t}${r.maximum.toString()} ${o.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${t}${r.maximum.toString()}`}case"too_small":{let t=r.exact?"exactly ":r.inclusive?">=":">",o=e[r.origin]??null;if(o)return`Too small: expected ${r.origin} to have ${t}${r.minimum.toString()} ${o.unit}`;return`Too small: expected ${r.origin} to be ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Invalid string: must start with "${r.prefix}"`;if("ends_with"===r.format)return`Invalid string: must end with "${r.suffix}"`;if("includes"===r.format)return`Invalid string: must include "${r.includes}"`;if("regex"===r.format)return`Invalid string: must match pattern ${r.pattern}`;return`Invalid ${t[r.format]??r.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${ei(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":if(r.options&&Array.isArray(r.options)&&r.options.length>0){let e=r.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===r.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}})()}),tG.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(eg(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 eR(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 iJ({type:"custom",check:"custom",fn:e,...eP(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(eV(e,t.value,o._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=o),e.continue??(e.continue=!o._zod.def.abort),t.issues.push(eV(e)))},e(t.value,t)),(a=new tP({check:"custom",...eP(t)}))._zod.check=r,o=a}(e,t))},overwrite(e){return this.check(op(e))},optional(){return iN(this)},exactOptional(){var e;return e=this,new iA({type:"optional",innerType:e})},nullable(){return iq(this)},nullish(){return iN(iq(this))},nonoptional(e){var t;return t=this,new iD({type:"nonoptional",innerType:t,...eP(e)})},array(){return im(this)},or(e){return ib([this,e])},and(e){return iE(this,e)},transform(e){return iF(this,iC(e))},default(e){var t,r;return t=this,r=e,new iz({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():e$(r)}})},prefault(e){var t,r;return t=this,r=e,new iL({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():e$(r)}})},catch(e){return function(e,t){let r;return new iU({type:"catch",innerType:e,catchValue:"function"==typeof t?t:((r=()=>t)["~constantCatch"]=!0,r)})}(this,e)},pipe(e){return iF(this,e)},readonly(){var e;return e=this,new iK({type:"readonly",innerType:e})},describe(e){let t=this.clone();return r8.add(t,{description:e}),t},meta(...e){if(0===e.length)return r8.get(this);let t=this.clone();return r8.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return eF(this,"~standard",{...tJ(this),jsonSchema:{input:oE(this,"input"),output:oE(this,"output")}},!1)},set"~standard"(e){eF(this,"~standard",e)},parse:function e(t,r){return aw(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await aE(this,t,r,{callee:e})},safeParse(e,t){return aR(this,e,t)},async safeParseAsync(e,t){return aP(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){eF(this,"spa",e)},validate(e,t){let r=this._zod.bag.validator;if(void 0!==r){if(r(e)!==av)return!0;if(!0===r.definite&&void 0===t)return!1}return function(e,t,r){let o,a=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun;if(i?(a[a_]=!0,o=i({value:t,issues:[]},a)):o=e._zod.run({value:t,issues:[]},a),o instanceof Promise)throw new eY;return 0===o.issues.length}(this,e,t)},validateAsync(e,t){return(async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},a=e._zod.run({value:t,issues:[]},o);return a instanceof Promise&&(a=await a),0===a.issues.length})(this,e,t)},encode:function e(t,r){return ak(this,t,r,{callee:e})},decode:function e(t,r){return aO(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ax(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await aT(this,t,r,{callee:e})},safeEncode(e,t){return aj(this,e,t)},safeDecode(e,t){return aC(this,e,t)},async safeEncodeAsync(e,t){return aI(this,e,t)},async safeDecodeAsync(e,t){return aN(this,e,t)},toJSONSchema(e){return((e,t={})=>r=>{let o=oh({...r,processors:t});return oy(e,o),ov(o,e),ow(o,e)})(this,{})(e)},get description(){return r8.get(this)?.description},get _def(){return this._zod.def}}),aq=eX("_ZodString",(e,t)=>{tZ.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oD(e,t,r,o)},eH({format:e=>oM(e).format??null,minLength:e=>oM(e).minimum??null,maxLength:e=>oM(e).maximum??null},{regex(...e){return this.check(function(e,t){return new tq({check:"string_format",format:"regex",...eP(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new tD({check:"string_format",format:"includes",...eP(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new tU({check:"string_format",format:"starts_with",...eP(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new tV({check:"string_format",format:"ends_with",...eP(t),suffix:e})}(...e))},min(...e){return this.check(ou(...e))},max(...e){return this.check(oc(...e))},length(...e){return this.check(od(...e))},nonempty(...e){return this.check(ou(1,...e))},lowercase(e){return this.check(new tz({check:"string_format",format:"lowercase",...eP(e)}))},uppercase(e){return this.check(new tL({check:"string_format",format:"uppercase",...eP(e)}))},trim(){return this.check(op(e=>e.trim()))},normalize(...e){return this.check(function(e){return op(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(op(e=>e.toLowerCase()))},toUpperCase(){return this.check(op(e=>e.toUpperCase()))},slugify(){return this.check(op(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})),az=eX("ZodString",(e,t)=>{tZ.init(e,t),aq.init(e,t)},{email(e){return this.check(oe(aK,e))},url(e){return this.check(ot(aJ,e))},jwt(e){return this.check(new a7({type:"string",format:"jwt",check:"string_format",abort:!1,...eP(e)}))},emoji(e){return this.check(new aZ({type:"string",format:"emoji",check:"string_format",abort:!1,...eP(e)}))},guid(e){return this.check(new aG({type:"string",format:"guid",check:"string_format",abort:!1,...eP(e)}))},uuid(e){return this.check(new aB({type:"string",format:"uuid",check:"string_format",abort:!1,...eP(e)}))},uuidv4(e){return this.check(new aB({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...eP(e)}))},uuidv6(e){return this.check(new aB({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...eP(e)}))},uuidv7(e){return this.check(new aB({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...eP(e)}))},nanoid(e){return this.check(new aW({type:"string",format:"nanoid",check:"string_format",abort:!1,...eP(e)}))},cuid(e){return this.check(new aX({type:"string",format:"cuid",check:"string_format",abort:!1,...eP(e)}))},cuid2(e){return this.check(new aY({type:"string",format:"cuid2",check:"string_format",abort:!1,...eP(e)}))},ulid(e){return this.check(new aQ({type:"string",format:"ulid",check:"string_format",abort:!1,...eP(e)}))},base64(e){return this.check(new a4({type:"string",format:"base64",check:"string_format",abort:!1,...eP(e)}))},base64url(e){return this.check(new a6({type:"string",format:"base64url",check:"string_format",abort:!1,...eP(e)}))},xid(e){return this.check(new a0({type:"string",format:"xid",check:"string_format",abort:!1,...eP(e)}))},ksuid(e){return this.check(new a1({type:"string",format:"ksuid",check:"string_format",abort:!1,...eP(e)}))},ipv4(e){return this.check(new a2({type:"string",format:"ipv4",check:"string_format",abort:!1,...eP(e)}))},ipv6(e){return this.check(new a9({type:"string",format:"ipv6",check:"string_format",abort:!1,...eP(e)}))},cidrv4(e){return this.check(new a3({type:"string",format:"cidrv4",check:"string_format",abort:!1,...eP(e)}))},cidrv6(e){return this.check(new a5({type:"string",format:"cidrv6",check:"string_format",abort:!1,...eP(e)}))},e164(e){return this.check(new a8({type:"string",format:"e164",check:"string_format",abort:!1,...eP(e)}))},datetime(e){return this.check(or(aU,e))},date(e){return this.check(oo(aV,e))},time(e){return this.check(new aF({type:"string",format:"time",check:"string_format",precision:null,...eP(e)}))},duration(e){return this.check(new aH({type:"string",format:"duration",check:"string_format",...eP(e)}))}});function aL(e){return new az(r7({type:"string",...eP(e)}))}let aD=eX("ZodStringFormat",(e,t)=>{tW.init(e,t),aq.init(e,t)}),aU=eX("ZodISODateTime",(e,t)=>{rt.init(e,t),aD.init(e,t)}),aV=eX("ZodISODate",(e,t)=>{rr.init(e,t),aD.init(e,t)}),aF=eX("ZodISOTime",(e,t)=>{ro.init(e,t),aD.init(e,t)}),aH=eX("ZodISODuration",(e,t)=>{ra.init(e,t),aD.init(e,t)}),aK=eX("ZodEmail",(e,t)=>{tQ.init(e,t),aD.init(e,t)}),aG=eX("ZodGUID",(e,t)=>{tX.init(e,t),aD.init(e,t)}),aB=eX("ZodUUID",(e,t)=>{tY.init(e,t),aD.init(e,t)}),aJ=eX("ZodURL",(e,t)=>{t9.init(e,t),aD.init(e,t)}),aZ=eX("ZodEmoji",(e,t)=>{t3.init(e,t),aD.init(e,t)}),aW=eX("ZodNanoID",(e,t)=>{t5.init(e,t),aD.init(e,t)}),aX=eX("ZodCUID",(e,t)=>{t4.init(e,t),aD.init(e,t)}),aY=eX("ZodCUID2",(e,t)=>{t6.init(e,t),aD.init(e,t)}),aQ=eX("ZodULID",(e,t)=>{t8.init(e,t),aD.init(e,t)}),a0=eX("ZodXID",(e,t)=>{t7.init(e,t),aD.init(e,t)}),a1=eX("ZodKSUID",(e,t)=>{re.init(e,t),aD.init(e,t)}),a2=eX("ZodIPv4",(e,t)=>{ri.init(e,t),aD.init(e,t)}),a9=eX("ZodIPv6",(e,t)=>{rl.init(e,t),aD.init(e,t)}),a3=eX("ZodCIDRv4",(e,t)=>{rc.init(e,t),aD.init(e,t)}),a5=eX("ZodCIDRv6",(e,t)=>{ru.init(e,t),aD.init(e,t)}),a4=eX("ZodBase64",(e,t)=>{rf.init(e,t),aD.init(e,t)}),a6=eX("ZodBase64URL",(e,t)=>{rm.init(e,t),aD.init(e,t)}),a8=eX("ZodE164",(e,t)=>{ry.init(e,t),aD.init(e,t)}),a7=eX("ZodJWT",(e,t)=>{rg.init(e,t),aD.init(e,t)}),ie=eX("ZodNumber",(e,t)=>{rv.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oU(e,t,r,o),e.isFinite=!0},eH({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=oM(e);return Math.max(t??-1/0,r??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=oM(e);return Math.min(t??1/0,r??1/0)},isInt:e=>{let{isInt:t,multipleOf:r}=oM(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>oM(e).format??null},{gt(e,t){return this.check(on(e,t))},gte(e,t){return this.check(os(e,t))},min(e,t){return this.check(os(e,t))},lt(e,t){return this.check(oa(e,t))},lte(e,t){return this.check(oi(e,t))},max(e,t){return this.check(oi(e,t))},int(e){return this.check(io(e))},safe(e){return this.check(io(e))},positive(e){return this.check(on(0,e))},nonnegative(e){return this.check(os(0,e))},negative(e){return this.check(oa(0,e))},nonpositive(e){return this.check(oi(0,e))},multipleOf(e,t){return this.check(ol(e,t))},step(e,t){return this.check(ol(e,t))},finite(){return this}}));function it(e){return new ie(r7({type:"number",checks:[],...eP(e)}))}let ir=eX("ZodNumberFormat",(e,t)=>{r_.init(e,t),ie.init(e,t)});function io(e){return new ir({type:"number",check:"number_format",abort:!1,format:"safeint",...eP(e)})}let ia=eX("ZodBoolean",(e,t)=>{rb.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oV(e,t,r,o)});function ii(e){return new ia({type:"boolean",...eP(e)})}let is=eX("ZodNull",(e,t)=>{rS.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oF(e,t,r,o)});function il(e){return new is({type:"null",...eP(e)})}let ic=eX("ZodAny",(e,t)=>{r$.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oK(e,t,r,o)}),iu=eX("ZodUnknown",(e,t)=>{rw.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oG(e,t,r,o)});function id(){return new iu({type:"unknown"})}let ip=eX("ZodNever",(e,t)=>{rE.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oH(e,t,r,o)}),ih=eX("ZodArray",(e,t)=>{aA(),rk.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oX(e,t,r,o),e.element=t.element},{min(e,t){return this.check(ou(e,t))},nonempty(e){return this.check(ou(1,e))},max(e,t){return this.check(oc(e,t))},length(e,t){return this.check(od(e,t))},unwrap(){return this.element}});function im(e,t){return new ih({type:"array",element:e,...eP(t)})}let iy=eX("ZodObject",(e,t)=>{var r;let o,a;aA(),rI.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oQ(e,t,r,o),r="shape",(a=r in(o=Object.getPrototypeOf(e))?void 0:o)&&Object.defineProperty(a,r,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:!1,value:void 0};return Object.defineProperty(this,r,e),e.value=(e=>e._zod.def.shape)(this),Object.defineProperty(this,r,e),e.value},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!1,value:e})}})},{keyof(){return iO(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(eg(this._zod.def,{catchall:e}))},passthrough(){return this.clone(eg(this._zod.def,{catchall:id()}))},loose(){return this.clone(eg(this._zod.def,{catchall:id()}))},strict(){return this.clone(eg(this._zod.def,{catchall:new ip({type:"never",...eP(void 0)})}))},strip(){return this.clone(eg(this._zod.def,{catchall:void 0}))},extend(e){if(!eS(e))throw Error("Invalid input to extend: expected a plain object");let t=this._zod.def.checks;if(t&&t.length>0){let t=ef(this);for(let r of Reflect.ownKeys(e))if(void 0!==Object.getOwnPropertyDescriptor(t,r))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return eR(this,eg(this._zod.def,{shape:ej(this,e)}))},safeExtend(e){if(!eS(e))throw Error("Invalid input to safeExtend: expected a plain object");return eR(this,eg(this._zod.def,{shape:ej(this,e)}))},merge(e){if(!e?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(this._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let t={};return ey(t,this,Reflect.ownKeys(ef(this))),ey(t,e,Reflect.ownKeys(ef(e))),eR(this,eg(this._zod.def,{shape:t,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]}))},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={};return ey(a,e,eT(e,t)),eR(e,eg(r,{shape:a,checks:[]}))}(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=new Set(eT(e,t)),i={};return ey(i,e,Reflect.ownKeys(ef(e)).filter(e=>!a.has(e))),eR(e,eg(r,{shape:i,checks:[]}))}(this,e)},partial(...e){return eC(iI,this,e[0])},exactPartial(...e){return eC(iA,this,e[0],"exactPartial")},required(...e){var t;let r,o;return r=(t=e[0])?new Set(eT(this,t)):void 0,ey(o={},this,Reflect.ownKeys(ef(this)),(e,t)=>r&&!r.has(t)?e:new iD({type:"nonoptional",innerType:e})),eR(this,eg(this._zod.def,{shape:o}))}});function ig(e,t){return new iy({type:"object",shape:e??{},...eP(t)})}function iv(e,t){return new iy({type:"object",shape:e,catchall:id(),...eP(t)})}let i_=eX("ZodUnion",(e,t)=>{rA.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o0(e,t,r,o),e.options=t.options});function ib(e,t){return new i_({type:"union",options:e,...eP(t)})}let iS=eX("ZodDiscriminatedUnion",(e,t)=>{i_.init(e,t),rM.init(e,t)});function i$(e,t,r){return new iS({type:"union",options:t,discriminator:e,...eP(r)})}let iw=eX("ZodIntersection",(e,t)=>{rq.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o1(e,t,r,o)});function iE(e,t){return new iw({type:"intersection",left:e,right:t})}let iR=eX("ZodRecord",(e,t)=>{aA(),rL.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o9(e,t,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function iP(e,t,r){return new iR(t&&t._zod?{type:"record",keyType:e,valueType:t,...eP(r)}:{type:"record",keyType:aL(),valueType:e,...eP(t)})}let ik=eX("ZodEnum",(e,t)=>{rD.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oB(e,t,r,o),e.enum=t.entries,e.options=[...e._zod.values];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 ik({...t,checks:[],...eP(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 ik({...t,checks:[],...eP(o),entries:a})}});function iO(e,t){return new ik({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...eP(t)})}let ix=eX("ZodLiteral",(e,t)=>{rU.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oJ(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 iT(e,t){return new ix({type:"literal",values:Array.isArray(e)?e:[e],...eP(t)})}let ij=eX("ZodTransform",(e,t)=>{aA(),rV.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oW(e,t,r,o),e._zod.parse=(r,o)=>{if("backward"===o.direction)throw new eQ(e.constructor.name);r.addIssue=o=>{"string"==typeof o?r.issues.push(eV(o,r.value,t)):(o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=r.value),o.inst??(o.inst=e),r.issues.push(eV(o)))};let a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});function iC(e){return new ij({type:"transform",transform:e})}let iI=eX("ZodOptional",(e,t)=>{rH.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>ao(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function iN(e){return new iI({type:"optional",innerType:e})}let iA=eX("ZodExactOptional",(e,t)=>{rK.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>ao(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),iM=eX("ZodNullable",(e,t)=>{rG.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o3(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function iq(e){return new iM({type:"nullable",innerType:e})}let iz=eX("ZodDefault",(e,t)=>{rB.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o8(e,t,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),iL=eX("ZodPrefault",(e,t)=>{rZ.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o7(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),iD=eX("ZodNonOptional",(e,t)=>{rW.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o5(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),iU=eX("ZodCatch",(e,t)=>{rQ.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>ae(e,t,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),iV=eX("ZodPipe",(e,t)=>{r0.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>at(e,t,r,o),e.in=t.in,e.out=t.out});function iF(e,t){return new iV({type:"pipe",in:e,out:t})}let iH=eX("ZodPreprocess",(e,t)=>{iV.init(e,t),r2.init(e,t)}),iK=eX("ZodReadonly",(e,t)=>{r9.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>ar(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),iG=eX("ZodLazy",(e,t)=>{r5.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>aa(e,t,r,o),e.unwrap=()=>e._zod.def.getter()});function iB(e){return new iG({type:"lazy",getter:e})}let iJ=eX("ZodCustom",(e,t)=>{r4.init(e,t),aM.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oZ(e,t,r,o)});function iZ(e,t){return new iH({type:"pipe",in:iC(e),out:t})}let iW="2025-11-25",iX=[iW,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],iY="io.modelcontextprotocol/protocolVersion",iQ="io.modelcontextprotocol/clientInfo",i0="io.modelcontextprotocol/serverInfo",i1="io.modelcontextprotocol/clientCapabilities",i2="io.modelcontextprotocol/subscriptionId",i9="io.modelcontextprotocol/logLevel",i3=iB(()=>ib([aL(),it(),ii(),il(),iP(aL(),i3),im(i3)])),i5=iP(aL(),i3),i4=im(i3),i6=ib([aL(),it().int()]),i8=aL(),i7=ig({ttl:it().optional()}),ne=ig({taskId:aL()}),nt=iv({progressToken:i6.optional(),"io.modelcontextprotocol/related-task":ne.optional()}),nr=ig({_meta:nt.optional()}),no=nr.extend({task:i7.optional()}),na=ig({method:aL(),params:nr.loose().optional()}),ni=ig({_meta:nt.optional()}),nn=ig({method:aL(),params:ni.loose().optional()}),ns=iv({get[i0](){return n$.optional().catch(void 0)}}),nl=iv({_meta:ns.optional()}),nc=ib([aL(),it().int()]),nu=ig({jsonrpc:iT("2.0"),id:nc,...na.shape}).strict(),nd=ig({jsonrpc:iT("2.0"),...nn.shape}).strict(),np=ig({jsonrpc:iT("2.0"),id:nc,result:nl}).strict(),nf=ig({jsonrpc:iT("2.0"),id:nc.optional(),error:ig({code:it().int(),message:aL(),data:id().optional()})}).strict(),nh=ib([nu,nd,np,nf]),nm=ib([np,nf]),ny=nl.strict(),ng=ni.extend({requestId:nc.optional(),reason:aL().optional()}),nv=nn.extend({method:iT("notifications/cancelled"),params:ng}),n_=ig({src:aL(),mimeType:aL().optional(),sizes:im(aL()).optional(),theme:iO(["light","dark"]).optional()}),nb=ig({icons:im(n_).optional()}),nS=ig({name:aL(),title:aL().optional()}),n$=nS.extend({...nS.shape,...nb.shape,version:aL(),websiteUrl:aL().optional(),description:aL().optional()}),nw=iE(ig({applyDefaults:ii().optional()}),i5),nE=iZ(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,iE(ig({form:nw.optional(),url:i5.optional()}),i5.optional())),nR=iv({list:i5.optional(),cancel:i5.optional(),requests:iv({sampling:iv({createMessage:i5.optional()}).optional(),elicitation:iv({create:i5.optional()}).optional()}).optional()}),nP=iv({list:i5.optional(),cancel:i5.optional(),requests:iv({tools:iv({call:i5.optional()}).optional()}).optional()}),nk=ig({experimental:iP(aL(),i5).optional(),sampling:ig({context:i5.optional(),tools:i5.optional()}).optional(),elicitation:nE.optional(),roots:ig({listChanged:ii().optional()}).optional(),tasks:nR.optional(),extensions:iP(aL(),i5).optional()}),nO=nr.extend({protocolVersion:aL(),capabilities:nk,clientInfo:n$}),nx=na.extend({method:iT("initialize"),params:nO}),nT=ig({experimental:iP(aL(),i5).optional(),logging:i5.optional(),completions:i5.optional(),prompts:ig({listChanged:ii().optional()}).optional(),resources:ig({subscribe:ii().optional(),listChanged:ii().optional()}).optional(),tools:ig({listChanged:ii().optional()}).optional(),tasks:nP.optional(),extensions:iP(aL(),i5).optional()}),nj=nl.extend({protocolVersion:aL(),capabilities:nT,serverInfo:n$,instructions:aL().optional()}),nC=nn.extend({method:iT("notifications/initialized"),params:ni.optional()}),nI=na.extend({method:iT("server/discover"),params:nr.optional()}),nN=nl.extend({supportedVersions:im(aL()),capabilities:nT,instructions:aL().optional()}),nA=na.extend({method:iT("ping"),params:nr.optional()}),nM=ig({progress:it(),total:iN(it()),message:iN(aL())}),nq=ig({...ni.shape,...nM.shape,progressToken:i6}),nz=nn.extend({method:iT("notifications/progress"),params:nq}),nL=nr.extend({cursor:i8.optional()}),nD=na.extend({params:nL.optional()}),nU=nl.extend({nextCursor:i8.optional()}),nV=ig({uri:aL(),mimeType:iN(aL()),_meta:iP(aL(),id()).optional()}),nF=nV.extend({text:aL()}),nH=aL().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),nK=nV.extend({blob:nH}),nG=iO(["user","assistant"]),nB=ig({audience:im(nG).optional(),priority:it().min(0).max(1).optional(),lastModified:or(aU,{offset:!0}).optional()}),nJ=ig({...nS.shape,...nb.shape,uri:aL(),description:iN(aL()),mimeType:iN(aL()),size:iN(it()),annotations:nB.optional(),_meta:iN(iv({}))}),nZ=ig({...nS.shape,...nb.shape,uriTemplate:aL(),description:iN(aL()),mimeType:iN(aL()),annotations:nB.optional(),_meta:iN(iv({}))}),nW=nD.extend({method:iT("resources/list")}),nX=nU.extend({resources:im(nJ)}),nY=nD.extend({method:iT("resources/templates/list")}),nQ=nU.extend({resourceTemplates:im(nZ)}),n0=nr.extend({uri:aL()}),n1=na.extend({method:iT("resources/read"),params:n0}),n2=nl.extend({contents:im(ib([nF,nK]))}),n9=nn.extend({method:iT("notifications/resources/list_changed"),params:ni.optional()}),n3=na.extend({method:iT("resources/subscribe"),params:n0}),n5=na.extend({method:iT("resources/unsubscribe"),params:n0}),n4=ig({toolsListChanged:ii().optional(),promptsListChanged:ii().optional(),resourcesListChanged:ii().optional(),resourceSubscriptions:im(aL()).optional()}),n6=nr.extend({notifications:n4}),n8=na.extend({method:iT("subscriptions/listen"),params:n6}),n7=ni.extend({notifications:n4}),se=nn.extend({method:iT("notifications/subscriptions/acknowledged"),params:n7}),st=ns.extend({[i2]:nc}),sr=nl.extend({_meta:st}),so=ni.extend({uri:aL()}),sa=nn.extend({method:iT("notifications/resources/updated"),params:so}),si=ig({name:aL(),description:iN(aL()),required:iN(ii())}),sn=ig({...nS.shape,...nb.shape,description:iN(aL()),arguments:iN(im(si)),_meta:iN(iv({}))}),ss=nD.extend({method:iT("prompts/list")}),sl=nU.extend({prompts:im(sn)}),sc=nr.extend({name:aL(),arguments:iP(aL(),aL()).optional()}),su=na.extend({method:iT("prompts/get"),params:sc}),sd=ig({type:iT("text"),text:aL(),annotations:nB.optional(),_meta:iP(aL(),id()).optional()}),sp=ig({type:iT("image"),data:nH,mimeType:aL(),annotations:nB.optional(),_meta:iP(aL(),id()).optional()}),sf=ig({type:iT("audio"),data:nH,mimeType:aL(),annotations:nB.optional(),_meta:iP(aL(),id()).optional()}),sh=ig({type:iT("tool_use"),name:aL(),id:aL(),input:iP(aL(),id()),_meta:iP(aL(),id()).optional()}),sm=ig({type:iT("resource"),resource:ib([nF,nK]),annotations:nB.optional(),_meta:iP(aL(),id()).optional()}),sy=nJ.extend({type:iT("resource_link")}),sg=ib([sd,sp,sf,sy,sm]),sv=ig({role:nG,content:sg}),s_=nl.extend({description:aL().optional(),messages:im(sv)}),sb=nn.extend({method:iT("notifications/prompts/list_changed"),params:ni.optional()}),sS=ig({title:aL().optional(),readOnlyHint:ii().optional(),destructiveHint:ii().optional(),idempotentHint:ii().optional(),openWorldHint:ii().optional()}),s$=ig({taskSupport:iO(["required","optional","forbidden"]).optional()}),sw=ig({...nS.shape,...nb.shape,description:aL().optional(),inputSchema:ig({type:iT("object"),properties:iP(aL(),i3).optional(),required:im(aL()).optional()}).catchall(id()),outputSchema:iv({$schema:aL().optional()}).optional(),annotations:sS.optional(),execution:s$.optional(),_meta:iP(aL(),id()).optional()}),sE=nD.extend({method:iT("tools/list")}),sR=nU.extend({tools:im(sw)}),sP=nl.extend({content:im(sg).default([]),structuredContent:id().optional(),isError:ii().optional()}),sk=sP.or(nl.extend({toolResult:id()})),sO=no.extend({name:aL(),arguments:iP(aL(),id()).optional()}),sx=na.extend({method:iT("tools/call"),params:sO}),sT=nn.extend({method:iT("notifications/tools/list_changed"),params:ni.optional()}),sj=ig({autoRefresh:ii().default(!0),debounceMs:it().int().nonnegative().default(300)}),sC=iO(["debug","info","notice","warning","error","critical","alert","emergency"]),sI=nr.extend({level:sC}),sN=na.extend({method:iT("logging/setLevel"),params:sI}),sA=ni.extend({level:sC,logger:aL().optional(),data:id()}),sM=nn.extend({method:iT("notifications/message"),params:sA}),sq=ig({name:aL().optional()}),sz=ig({hints:im(sq).optional(),costPriority:it().min(0).max(1).optional(),speedPriority:it().min(0).max(1).optional(),intelligencePriority:it().min(0).max(1).optional()}),sL=ig({mode:iO(["auto","required","none"]).optional()}),sD=ig({type:iT("tool_result"),toolUseId:aL().describe("The unique identifier for the corresponding tool call."),content:im(sg),structuredContent:id().optional(),isError:ii().optional(),_meta:iP(aL(),id()).optional()}),sU=i$("type",[sd,sp,sf]),sV=i$("type",[sd,sp,sf,sh,sD]),sF=ig({role:nG,content:ib([sV,im(sV)]),_meta:iP(aL(),id()).optional()}),sH=no.extend({messages:im(sF),modelPreferences:sz.optional(),systemPrompt:aL().optional(),includeContext:iO(["none","thisServer","allServers"]).optional(),temperature:it().optional(),maxTokens:it().int(),stopSequences:im(aL()).optional(),metadata:i5.optional(),tools:im(sw).optional(),toolChoice:sL.optional()}),sK=na.extend({method:iT("sampling/createMessage"),params:sH}),sG=nl.extend({model:aL(),stopReason:iN(iO(["endTurn","stopSequence","maxTokens"]).or(aL())),role:nG,content:sU}),sB=nl.extend({model:aL(),stopReason:iN(iO(["endTurn","stopSequence","maxTokens","toolUse"]).or(aL())),role:nG,content:ib([sV,im(sV)])}),sJ=ig({type:iT("boolean"),title:aL().optional(),description:aL().optional(),default:ii().optional()}),sZ=ig({type:iT("string"),title:aL().optional(),description:aL().optional(),minLength:it().optional(),maxLength:it().optional(),format:iO(["email","uri","date","date-time"]).optional(),default:aL().optional()}),sW=ig({type:iO(["number","integer"]),title:aL().optional(),description:aL().optional(),minimum:it().optional(),maximum:it().optional(),default:it().optional()}),sX=ig({type:iT("string"),title:aL().optional(),description:aL().optional(),enum:im(aL()),default:aL().optional()}),sY=ig({type:iT("string"),title:aL().optional(),description:aL().optional(),oneOf:im(ig({const:aL(),title:aL()})),default:aL().optional()}),sQ=ig({type:iT("string"),title:aL().optional(),description:aL().optional(),enum:im(aL()),enumNames:im(aL()).optional(),default:aL().optional()}),s0=ib([sX,sY]),s1=ig({type:iT("array"),title:aL().optional(),description:aL().optional(),minItems:it().optional(),maxItems:it().optional(),items:ig({type:iT("string"),enum:im(aL())}),default:im(aL()).optional()}),s2=ig({type:iT("array"),title:aL().optional(),description:aL().optional(),minItems:it().optional(),maxItems:it().optional(),items:ig({anyOf:im(ig({const:aL(),title:aL()}))}),default:im(aL()).optional()}),s9=ib([s1,s2]),s3=ib([sQ,s0,s9]),s5=ib([s3,sJ,sZ,sW]),s4=no.extend({mode:iT("form").optional(),message:aL(),requestedSchema:ig({type:iT("object"),properties:iP(aL(),s5),required:im(aL()).optional()}).catchall(id())}),s6=no.extend({mode:iT("url"),message:aL(),elicitationId:aL(),url:aL().url()}),s8=ib([s4,s6]),s7=na.extend({method:iT("elicitation/create"),params:s8}),le=ni.extend({elicitationId:aL()}),lt=nn.extend({method:iT("notifications/elicitation/complete"),params:le}),lr=nl.extend({action:iO(["accept","decline","cancel"]),content:iZ(e=>null===e?void 0:e,iP(aL(),ib([aL(),it(),ii(),im(aL())])).optional())}),lo=ig({type:iT("ref/resource"),uri:aL()}),la=ig({type:iT("ref/prompt"),name:aL()}),li=nr.extend({ref:ib([la,lo]),argument:ig({name:aL(),value:aL()}),context:ig({arguments:iP(aL(),aL()).optional()}).optional()}),ln=na.extend({method:iT("completion/complete"),params:li}),ls=nl.extend({completion:iv({values:im(aL()).max(100),total:iN(it().int()),hasMore:iN(ii())})}),ll=ig({uri:aL().startsWith("file://"),name:aL().optional(),_meta:iP(aL(),id()).optional()}),lc=na.extend({method:iT("roots/list"),params:nr.optional()}),lu=nl.extend({roots:im(ll)}),ld=nn.extend({method:iT("notifications/roots/list_changed"),params:ni.optional()}),lp=iv({ttl:it().optional(),pollInterval:it().optional()}),lf=iO(["working","input_required","completed","failed","cancelled"]),lh=ig({taskId:aL(),status:lf,ttl:ib([it(),il()]),createdAt:aL(),lastUpdatedAt:aL(),pollInterval:iN(it()),statusMessage:iN(aL())}),lm=nl.extend({task:lh}),ly=ni.merge(lh),lg=nn.extend({method:iT("notifications/tasks/status"),params:ly}),lv=na.extend({method:iT("tasks/get"),params:nr.extend({taskId:aL()})}),l_=nl.merge(lh),lb=na.extend({method:iT("tasks/result"),params:nr.extend({taskId:aL()})}),lS=nl.loose(),l$=nD.extend({method:iT("tasks/list")}),lw=nU.extend({tasks:im(lh)}),lE=na.extend({method:iT("tasks/cancel"),params:nr.extend({taskId:aL()})}),lR=nl.merge(lh),lP=ib([nA,nx,nI,ln,sN,su,ss,nW,nY,n1,n3,n5,n8,sx,sE]),lk=ib([nv,nz,nC,ld]),lO=ib([ny,sG,sB,lr,lu]),lx=ib([nA,sK,s7,lc]),lT=ib([nv,nz,sM,sa,n9,sT,sb,se,lt]),lj=ib([ny,nj,nN,ls,s_,sl,nX,nQ,n2,sP,sR,sr]);T||(T={});let lC=ot(aJ,void 0).superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:"custom",message:"URL must be parseable",fatal:!0}),eJ}).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"}),lI=iv({resource:aL().url(),authorization_servers:im(lC).optional(),jwks_uri:aL().url().optional(),scopes_supported:im(aL()).optional(),bearer_methods_supported:im(aL()).optional(),resource_signing_alg_values_supported:im(aL()).optional(),resource_name:aL().optional(),resource_documentation:aL().optional(),resource_policy_uri:aL().url().optional(),resource_tos_uri:aL().url().optional(),tls_client_certificate_bound_access_tokens:ii().optional(),authorization_details_types_supported:im(aL()).optional(),dpop_signing_alg_values_supported:im(aL()).optional(),dpop_bound_access_tokens_required:ii().optional()}),lN=iv({issuer:aL(),authorization_endpoint:lC,token_endpoint:lC,registration_endpoint:lC.optional(),scopes_supported:im(aL()).optional(),response_types_supported:im(aL()),response_modes_supported:im(aL()).optional(),grant_types_supported:im(aL()).optional(),token_endpoint_auth_methods_supported:im(aL()).optional(),token_endpoint_auth_signing_alg_values_supported:im(aL()).optional(),service_documentation:lC.optional(),revocation_endpoint:lC.optional(),revocation_endpoint_auth_methods_supported:im(aL()).optional(),revocation_endpoint_auth_signing_alg_values_supported:im(aL()).optional(),introspection_endpoint:aL().optional(),introspection_endpoint_auth_methods_supported:im(aL()).optional(),introspection_endpoint_auth_signing_alg_values_supported:im(aL()).optional(),code_challenge_methods_supported:im(aL()).optional(),client_id_metadata_document_supported:ii().optional(),authorization_response_iss_parameter_supported:ii().optional().catch(void 0),dpop_signing_alg_values_supported:im(aL()).optional()}),lA=iv({issuer:aL(),authorization_endpoint:lC,token_endpoint:lC,userinfo_endpoint:lC.optional(),jwks_uri:lC,registration_endpoint:lC.optional(),scopes_supported:im(aL()).optional(),response_types_supported:im(aL()),response_modes_supported:im(aL()).optional(),grant_types_supported:im(aL()).optional(),acr_values_supported:im(aL()).optional(),subject_types_supported:im(aL()),id_token_signing_alg_values_supported:im(aL()),id_token_encryption_alg_values_supported:im(aL()).optional(),id_token_encryption_enc_values_supported:im(aL()).optional(),userinfo_signing_alg_values_supported:im(aL()).optional(),userinfo_encryption_alg_values_supported:im(aL()).optional(),userinfo_encryption_enc_values_supported:im(aL()).optional(),request_object_signing_alg_values_supported:im(aL()).optional(),request_object_encryption_alg_values_supported:im(aL()).optional(),request_object_encryption_enc_values_supported:im(aL()).optional(),token_endpoint_auth_methods_supported:im(aL()).optional(),token_endpoint_auth_signing_alg_values_supported:im(aL()).optional(),display_values_supported:im(aL()).optional(),claim_types_supported:im(aL()).optional(),claims_supported:im(aL()).optional(),service_documentation:aL().optional(),claims_locales_supported:im(aL()).optional(),ui_locales_supported:im(aL()).optional(),claims_parameter_supported:ii().optional(),request_parameter_supported:ii().optional(),request_uri_parameter_supported:ii().optional(),require_request_uri_registration:ii().optional(),op_policy_uri:lC.optional(),op_tos_uri:lC.optional(),client_id_metadata_document_supported:ii().optional(),authorization_response_iss_parameter_supported:ii().optional().catch(void 0)}),lM=ig({...lA.shape,...lN.pick({code_challenge_methods_supported:!0}).shape}),lq=ig({access_token:aL(),id_token:aL().optional(),token_type:aL(),expires_in:new ie(r7({type:"number",coerce:!0,checks:[],...eP(void 0)})).optional(),scope:aL().optional(),refresh_token:aL().optional(),issuer:aL().optional().catch(void 0)}).strip(),lz=ig({issued_token_type:iT("urn:ietf:params:oauth:token-type:id-jag"),access_token:aL(),token_type:aL().optional(),expires_in:it().optional(),scope:aL().optional()}).strip(),lL=ig({error:aL(),error_description:aL().optional(),error_uri:aL().optional()}),lD=lC.optional().or(iT("").transform(()=>void 0)),lU=ig({redirect_uris:im(lC),token_endpoint_auth_method:aL().optional(),grant_types:im(aL()).optional(),response_types:im(aL()).optional(),application_type:aL().optional(),client_name:aL().optional(),client_uri:lC.optional(),logo_uri:lD,scope:aL().optional(),contacts:im(aL()).optional(),tos_uri:lD,policy_uri:aL().optional(),jwks_uri:lC.optional(),jwks:new ic({type:"any"}).optional(),software_id:aL().optional(),software_version:aL().optional(),software_statement:aL().optional()}).strip(),lV=ig({client_id:aL(),client_secret:aL().optional(),client_id_issued_at:it().optional(),client_secret_expires_at:it().optional(),issuer:aL().optional().catch(void 0)}).strip(),lF=lU.merge(lV),lH=ig({error:aL(),error_description:aL().optional()}).strip(),lK=ig({token:aL(),token_type_hint:aL().optional()}).strip(),lG=Symbol.for("mcp.sdk.errorBrands");function lB(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,lG,{value:r,enumerable:!1,configurable:!0})}function lJ(e,t){try{if("object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&"string"==typeof e.mcpBrand&&Object.prototype.hasOwnProperty.call(t,lG)){let r=t[lG];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 lJ(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 lJ(this,e)}constructor(e,t,r){super(t),this.code=e,this.errorUri=r,this.name="OAuthError",lB(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)}});(S={}).NotConnected="NOT_CONNECTED",S.AlreadyConnected="ALREADY_CONNECTED",S.NotInitialized="NOT_INITIALIZED",S.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",S.RequestTimeout="REQUEST_TIMEOUT",S.ConnectionClosed="CONNECTION_CLOSED",S.SendFailed="SEND_FAILED",S.InvalidResult="INVALID_RESULT",S.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",S.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",S.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",S.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",S.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",S.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",S.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",S.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",S.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",S.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",S.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION";var lZ=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return lJ(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 lJ(this,e)}constructor(e,t,r,o){super(t,o),this.code=e,this.data=r,this.name="SdkError",lB(this,new.target)}};(class extends lZ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r,o){super(e,t,r,o),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}});let lW={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},lX={"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(lW),Object.keys(lX);Symbol("modelcontextprotocol.resultCacheHintFallback");let lY=(($={})[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.ResourceNotFound=-32002]="ResourceNotFound",$[$.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",$[$.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired",$);var lQ=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](e){return lJ(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 lJ(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="ProtocolError",lB(this,new.target)}static fromError(t,r,o){return t===lY.UrlElicitationRequired&&o&&o.elicitations?new l1(o.elicitations,r):t===lY.UnsupportedProtocolVersion&&o&&Array.isArray(o.supported)&&"string"==typeof o.requested?new l2({supported:o.supported,requested:o.requested},r):(t===lY.InvalidParams||t===lY.ResourceNotFound)&&"string"==typeof o?.uri&&(t===lY.ResourceNotFound||1===Object.keys(o).length)?new l0(o.uri,r):t===lY.MissingRequiredClientCapability&&o&&null!==o.requiredCapabilities&&"object"==typeof o.requiredCapabilities&&!Array.isArray(o.requiredCapabilities)?new l9({requiredCapabilities:o.requiredCapabilities},r):new e(t,r,o)}},l0=class extends lQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(lY.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},l1=class extends lQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(lY.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},l2=class extends lQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(lY.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},l9=class extends lQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(lY.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};let l3={"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},l5={"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(l3),Object.keys(l5);var l4=(e=>{let t={};for(var r in e)Y(t,r,{get:e[r],enumerable:!0});return t})({AnnotationsSchema:()=>nB,AudioContentSchema:()=>sf,BaseMetadataSchema:()=>nS,BaseRequestParamsSchema:()=>nr,BlobResourceContentsSchema:()=>nK,BooleanSchemaSchema:()=>sJ,CallToolRequestParamsSchema:()=>sO,CallToolRequestSchema:()=>sx,CallToolResultSchema:()=>sP,CancelTaskRequestSchema:()=>lE,CancelTaskResultSchema:()=>lR,CancelledNotificationParamsSchema:()=>ng,CancelledNotificationSchema:()=>nv,ClientCapabilitiesSchema:()=>nk,ClientNotificationSchema:()=>lk,ClientRequestSchema:()=>lP,ClientResultSchema:()=>lO,ClientTasksCapabilitySchema:()=>nR,CompatibilityCallToolResultSchema:()=>sk,CompleteRequestParamsSchema:()=>li,CompleteRequestSchema:()=>ln,CompleteResultSchema:()=>ls,ContentBlockSchema:()=>sg,CreateMessageRequestParamsSchema:()=>sH,CreateMessageRequestSchema:()=>sK,CreateMessageResultSchema:()=>sG,CreateMessageResultWithToolsSchema:()=>sB,CreateTaskResultSchema:()=>lm,CursorSchema:()=>i8,DiscoverRequestSchema:()=>nI,DiscoverResultSchema:()=>nN,ElicitRequestFormParamsSchema:()=>s4,ElicitRequestParamsSchema:()=>s8,ElicitRequestSchema:()=>s7,ElicitRequestURLParamsSchema:()=>s6,ElicitResultSchema:()=>lr,ElicitationCompleteNotificationParamsSchema:()=>le,ElicitationCompleteNotificationSchema:()=>lt,EmbeddedResourceSchema:()=>sm,EmptyResultSchema:()=>ny,EnumSchemaSchema:()=>s3,GetPromptRequestParamsSchema:()=>sc,GetPromptRequestSchema:()=>su,GetPromptResultSchema:()=>s_,GetTaskPayloadRequestSchema:()=>lb,GetTaskPayloadResultSchema:()=>lS,GetTaskRequestSchema:()=>lv,GetTaskResultSchema:()=>l_,IconSchema:()=>n_,IconsSchema:()=>nb,ImageContentSchema:()=>sp,ImplementationSchema:()=>n$,InitializeRequestParamsSchema:()=>nO,InitializeRequestSchema:()=>nx,InitializeResultSchema:()=>nj,InitializedNotificationSchema:()=>nC,JSONArraySchema:()=>i4,JSONObjectSchema:()=>i5,JSONRPCErrorResponseSchema:()=>nf,JSONRPCMessageSchema:()=>nh,JSONRPCNotificationSchema:()=>nd,JSONRPCRequestSchema:()=>nu,JSONRPCResponseSchema:()=>nm,JSONRPCResultResponseSchema:()=>np,JSONValueSchema:()=>i3,LegacyTitledEnumSchemaSchema:()=>sQ,ListChangedOptionsBaseSchema:()=>sj,ListPromptsRequestSchema:()=>ss,ListPromptsResultSchema:()=>sl,ListResourceTemplatesRequestSchema:()=>nY,ListResourceTemplatesResultSchema:()=>nQ,ListResourcesRequestSchema:()=>nW,ListResourcesResultSchema:()=>nX,ListRootsRequestSchema:()=>lc,ListRootsResultSchema:()=>lu,ListTasksRequestSchema:()=>l$,ListTasksResultSchema:()=>lw,ListToolsRequestSchema:()=>sE,ListToolsResultSchema:()=>sR,LoggingLevelSchema:()=>sC,LoggingMessageNotificationParamsSchema:()=>sA,LoggingMessageNotificationSchema:()=>sM,ModelHintSchema:()=>sq,ModelPreferencesSchema:()=>sz,MultiSelectEnumSchemaSchema:()=>s9,NotificationSchema:()=>nn,NotificationsParamsSchema:()=>ni,NumberSchemaSchema:()=>sW,PaginatedRequestParamsSchema:()=>nL,PaginatedRequestSchema:()=>nD,PaginatedResultSchema:()=>nU,PingRequestSchema:()=>nA,PrimitiveSchemaDefinitionSchema:()=>s5,ProgressNotificationParamsSchema:()=>nq,ProgressNotificationSchema:()=>nz,ProgressSchema:()=>nM,ProgressTokenSchema:()=>i6,PromptArgumentSchema:()=>si,PromptListChangedNotificationSchema:()=>sb,PromptMessageSchema:()=>sv,PromptReferenceSchema:()=>la,PromptSchema:()=>sn,ReadResourceRequestParamsSchema:()=>n0,ReadResourceRequestSchema:()=>n1,ReadResourceResultSchema:()=>n2,RelatedTaskMetadataSchema:()=>ne,RequestIdSchema:()=>nc,RequestMetaSchema:()=>nt,RequestSchema:()=>na,ResourceContentsSchema:()=>nV,ResourceLinkSchema:()=>sy,ResourceListChangedNotificationSchema:()=>n9,ResourceRequestParamsSchema:()=>n0,ResourceSchema:()=>nJ,ResourceTemplateReferenceSchema:()=>lo,ResourceTemplateSchema:()=>nZ,ResourceUpdatedNotificationParamsSchema:()=>so,ResourceUpdatedNotificationSchema:()=>sa,ResultMetaObjectSchema:()=>ns,ResultSchema:()=>nl,RoleSchema:()=>nG,RootSchema:()=>ll,RootsListChangedNotificationSchema:()=>ld,SamplingContentSchema:()=>sU,SamplingMessageContentBlockSchema:()=>sV,SamplingMessageSchema:()=>sF,ServerCapabilitiesSchema:()=>nT,ServerNotificationSchema:()=>lT,ServerRequestSchema:()=>lx,ServerResultSchema:()=>lj,ServerTasksCapabilitySchema:()=>nP,SetLevelRequestParamsSchema:()=>sI,SetLevelRequestSchema:()=>sN,SingleSelectEnumSchemaSchema:()=>s0,StringSchemaSchema:()=>sZ,SubscribeRequestParamsSchema:()=>n0,SubscribeRequestSchema:()=>n3,SubscriptionFilterSchema:()=>n4,SubscriptionsAcknowledgedNotificationParamsSchema:()=>n7,SubscriptionsAcknowledgedNotificationSchema:()=>se,SubscriptionsListenRequestParamsSchema:()=>n6,SubscriptionsListenRequestSchema:()=>n8,SubscriptionsListenResultMetaSchema:()=>st,SubscriptionsListenResultSchema:()=>sr,TaskAugmentedRequestParamsSchema:()=>no,TaskCreationParamsSchema:()=>lp,TaskMetadataSchema:()=>i7,TaskSchema:()=>lh,TaskStatusNotificationParamsSchema:()=>ly,TaskStatusNotificationSchema:()=>lg,TaskStatusSchema:()=>lf,TextContentSchema:()=>sd,TextResourceContentsSchema:()=>nF,TitledMultiSelectEnumSchemaSchema:()=>s2,TitledSingleSelectEnumSchemaSchema:()=>sY,ToolAnnotationsSchema:()=>sS,ToolChoiceSchema:()=>sL,ToolExecutionSchema:()=>s$,ToolListChangedNotificationSchema:()=>sT,ToolResultContentSchema:()=>sD,ToolSchema:()=>sw,ToolUseContentSchema:()=>sh,UnsubscribeRequestParamsSchema:()=>n0,UnsubscribeRequestSchema:()=>n5,UntitledMultiSelectEnumSchemaSchema:()=>s1,UntitledSingleSelectEnumSchemaSchema:()=>sX});let l6=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&"input_required"===e.resultType;lY.InvalidRequest,lY.UnsupportedProtocolVersion,lY.InvalidParams,lY.MethodNotFound,lY.InvalidParams,lY.MissingRequiredClientCapability;lY.ParseError,lY.InvalidRequest,lY.MethodNotFound,lY.UnsupportedProtocolVersion,lY.MissingRequiredClientCapability;function l8(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function l7(e){if(null==e)return!1;let t=typeof e;return("object"===t||"function"===t)&&"~standard"in e&&"function"==typeof e["~standard"]?.validate}let ce=!1,ct="draft-2020-12",cr=/^#\/(\$defs|definitions)\/([^/~%]+)$/,co=/\\\.\\d\{(\d+)\}/;function ca(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let ci=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function cn(e){return ci.has(e)||e.startsWith("x-")}let cs=new Set(["$schema",...Object.keys(s4.shape.requestedSchema.shape)]),cl={string:l8([sZ,sX,sY,sQ]),number:l8([sW]),integer:l8([sW]),boolean:l8([sJ]),array:l8([s1,s2])},cc=new Set(sZ.shape.format.unwrap().options),cu=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(!l7(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&&ca(i)?r[a]=Object.fromEntries(Object.entries(i).map(([e,r])=>[e,function(e,t,r,o){if(!ca(e))return e;let a="string"==typeof e.type&&Object.hasOwn(cl,e.type)?cl[e.type]:void 0;if(void 0===a)return e;let i={};for(let[s,l]of Object.entries(e))if(a.has(s)||cn(s))i[s]=l;else if("pattern"===s&&"string"===e.type&&"string"==typeof e.format)if(cc.has(e.format)){var n;"string"==typeof l&&(n=e.format,"zod"!==r||(function(e,t){let r;switch(e){case"email":r=[oe(aK,void 0)];break;case"uri":r=[ot(aJ,void 0)];break;case"date":r=[oo(aV,void 0)];break;case"date-time":let o,a;o=co.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=>or(aU,{local:e,offset:t,precision:r}))))}return new Set(r.map(e=>{let t;return t=an(e,{target:ct,io:"input"}),"string"==typeof t.pattern?t.pattern:void 0}).filter(e=>void 0!==e))})(n,l).has(l))||o.push(`${t}.${s}`)}else i[s]=l;else o.push(`${t}.${s}`);return i}(r,`properties.${e}`,t,o)])):cs.has(a)?r[a]=i:cn(a)||o.push(a);if(o.length>0)throw new lQ(lY.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:ct});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().");ce||(ce=!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=an(e,{target:ct,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,r=t){if("properties"in t||"patternProperties"in t||"additionalProperties"in t||"required"in t)return!0;let o="string"==typeof t.$ref&&cr.exec(t.$ref);if(o&&r[o[1]]?.[o[2]]?.type==="object")return!0;for(let o of["oneOf","anyOf","allOf"]){let a=t[o];if(Array.isArray(a)&&a.length>0)return a.every(t=>null!==t&&"object"==typeof t&&("object"===t.type||e(t,"$id"in t?{}:r)))}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 lQ(lY.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${e}`)}}(e.requestedSchema),r),a=(t=s4.shape.requestedSchema,aR(t,o));if(!a.success)throw new lQ(lY.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(e,t){if(!ca(e.properties))return t;let r=Object.entries(e.properties).filter(([,e])=>!aR(s5,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}]`)):ca(t)&&ca(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):cn(t)?[]:[i]}):[]}(o,a.data);if(i.length>0)throw new lQ(lY.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(", ")}`);let n=(a.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(a.data.properties,e));if(n.length>0)throw new lQ(lY.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${n.join(", ")}`);return{...e,mode:"form",requestedSchema:a.data}}(e)}}catch(e){throw e instanceof lQ?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 cd(e,t,r){let o=cp(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 cp(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 cf={},ch={};function cm(e,t){let r=e.slice(0,-6);cf[r]=t,ch[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"])cm(e,l4[e]);for(let[e,t]of Object.entries({IdJagTokenExchangeResponseSchema:lz,OAuthClientInformationFullSchema:lF,OAuthClientInformationSchema:lV,OAuthClientMetadataSchema:lU,OAuthClientRegistrationErrorSchema:lH,OAuthErrorResponseSchema:lL,OAuthMetadataSchema:lN,OAuthProtectedResourceMetadataSchema:lI,OAuthTokenRevocationRequestSchema:lK,OAuthTokensSchema:lq,OpenIdProviderDiscoveryMetadataSchema:lM,OpenIdProviderMetadataSchema:lA}))cm(e,t);Object.freeze(cf),Object.freeze(ch);w=void 0,()=>w;(eo(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,n,s,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;n=t.exec(l);){if(n.index!==c)throw TypeError("invalid parameter format");c+=n[0].length,i=n[1].toLowerCase(),34===(s=n[2]).charCodeAt(0)&&-1!==(s=s.slice(1,-1)).indexOf("\\")&&(s=s.replace(r,"$1")),d.parameters[i]=s}if(c!==l.length)throw TypeError("invalid parameter format")}return d}}))();var cy=eo(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;)s(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 n(e,...t){let a=[l(e[0])],c=0;for(;c<t.length;)a.push(i),s(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 s(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=n,e.addCodeArg=s,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:n`${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())}}),cg=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=cy();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 n=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=n;let s=(0,t._)`\n`;var l=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new n(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,n=this._values[a];if(n){let e=n.get(i);if(e)return e}else n=this._values[a]=new Map;n.set(i,o);let s=this._scope[a]||(this._scope[a]=[]),l=s.length;return s[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,n={},s){let l=t.nil;for(let c in r){let u=r[c];if(!u)continue;let d=n[c]=n[c]||new Map;u.forEach(r=>{if(d.has(r))return;d.set(r,o.Started);let n=i(r);if(n){let o=this.opts.es5?e.varKinds.var:e.varKinds.const;l=(0,t._)`${l}${o} ${r} = ${n};${this.opts._n}`}else if(n=null==s?void 0:s(r))l=(0,t._)`${l}${n}${this.opts._n}`;else throw new a(r);d.set(r,o.Completed)})}return l}};e.ValueScope=l}),cv=eo(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=cy(),r=cg();var o=cy();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=cg();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}},n=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=T(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=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=T(this.rhs,e,r),this}get names(){return x(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},l=class extends s{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=T(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},f=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)=>O(e,t.names),{})}},h=class extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},m=class extends f{},y=class extends h{};y.kind="else";var g=class e extends h{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=T(this.condition,e,t),this}get names(){let e=super.names;return x(e,this.condition),this.else&&O(e,this.else.names),e}};g.kind="if";var v=class extends h{};v.kind="for";var _=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=T(this.iteration,e,t),this}get names(){return O(super.names,this.iteration.names)}},b=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 x(x(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=T(this.iterable,e,t),this}get names(){return O(super.names,this.iterable.names)}},$=class extends h{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 f{render(e){return"return "+super.render(e)}};w.kind="return";var E=class extends h{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&&O(e,this.catch.names),this.finally&&O(e,this.finally.names),e}},R=class extends h{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};R.kind="catch";var P=class extends h{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 n(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 s(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 _(e),t)}forRange(e,t,o,a,i=this.opts.es5?r.varKinds.var:r.varKinds.let){let n=this._scope.toName(e);return this._for(new b(i,n,t,o),()=>a(n))}forOf(e,o,a,i=r.varKinds.const){let n=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(n,(0,t._)`${e}[${r}]`),a(n)})}return this._for(new S("of",i,n,o),()=>a(n))}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 n=this._scope.toName(e);return this._for(new S("in",i,n,o),()=>a(n))}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 O(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function x(e,r){return r instanceof t._CodeOrName?O(e,r.names):e}function T(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=N(e.operators.AND);e.and=function(...e){return e.reduce(C)};let I=N(e.operators.OR);function N(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(I)}}),c_=eo(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=cv(),a=cy();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]||f(e,`unknown keyword: "${r}"`)}function n(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function s(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,n,s,l)=>{let c=void 0===s?n:s instanceof o.Name?(n instanceof o.Name?e(i,n,s):t(i,n,s),s):n instanceof o.Name?(t(i,s,n),n):r(n,s);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),!n(t,e.self.RULES.all))},e.checkUnknownRules=i,e.schemaHasRules=n,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(s(e))},e.escapeJsonPointer=s,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 f(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():"/"+s(e)},e.checkStrictMode=f}),cb=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv();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")}}),cS=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=cv(),r=c_(),o=cb();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,n,l){let{it:c}=r,{gen:u,compositeRule:d,allErrors:p}=c,f=s(r,o,n);(null!=l?l:d||p)?a(u,f):i(c,(0,t._)`[${f}]`)},e.reportExtraError=function(t,r=e.keywordError,n){let{it:l}=t,{gen:c,compositeRule:u,allErrors:d}=l;a(c,s(t,r,n)),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:n,it:s}){if(void 0===n)throw Error("ajv implementation error");let l=e.name("err");e.forRange("i",n,o.default.errors,n=>{e.const(l,(0,t._)`${o.default.vErrors}[${n}]`),e.if((0,t._)`${l}.instancePath === undefined`,()=>e.assign((0,t._)`${l}.instancePath`,(0,t.strConcat)(o.default.instancePath,s.errorPath))),e.assign((0,t._)`${l}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${r}`),s.opts.verbose&&(e.assign((0,t._)`${l}.schema`,a),e.assign((0,t._)`${l}.data`,i))})};let n={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 s(e,a,i){let{createErrors:s}=e.it;return!1===s?(0,t._)`{}`:function(e,a,i={}){let{gen:s,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 s=i?o:(0,t.str)`${o}/${e}`;return a&&(s=(0,t.str)`${s}${(0,r.getErrorPath)(a,r.Type.Str)}`),[n.schemaPath,s]}(e,i)];return function(e,{params:r,message:a},i){let{keyword:s,data:l,schemaValue:c,it:u}=e,{opts:d,propertyName:p,topSchemaRef:f,schemaPath:h}=u;i.push([n.keyword,s],[n.params,"function"==typeof r?r(e):r||(0,t._)`{}`]),d.messages&&i.push([n.message,"function"==typeof a?a(e):a]),d.verbose&&i.push([n.schema,c],[n.parentSchema,(0,t._)`${f}${h}`],[o.default.data,l]),p&&i.push([n.propertyName,p])}(e,a,c),s.object(...c)}(e,a,i)}}),c$=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=cS(),r=cv(),o=cb(),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:n}=e;!1===a?i(e,!1):"object"==typeof a&&!0===a.$async?t.return(o.default.data):(t.assign((0,r._)`${n}.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)}}),cw=eo(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:{}}}}),cE=eo(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}),cR=eo(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=cw(),a=cE(),i=cS(),n=cv(),s=c_();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:s,data:l,opts:u}=e,p=(o=r,(i=u.coerceTypes)?o.filter(e=>c.has(e)||"array"===i&&"array"===e):[]),h=r.length>0&&!(0===p.length&&1===r.length&&(0,a.schemaHasRulesForType)(e,r[0]));if(h){let o=d(r,l,u.strictNumbers,t.Wrong);s.if(o,()=>{p.length?function(e,t,r){let{gen:o,data:a,opts:i}=e,s=o.let("dataType",(0,n._)`typeof ${a}`),l=o.let("coerced",(0,n._)`undefined`);for(let e of("array"===i.coerceTypes&&o.if((0,n._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>o.assign(a,(0,n._)`${a}[0]`).assign(s,(0,n._)`typeof ${a}`).if(d(t,a,i.strictNumbers),()=>o.assign(l,a))),o.if((0,n._)`${l} !== undefined`),r))(c.has(e)||"array"===e&&"array"===i.coerceTypes)&&function(e){switch(e){case"string":o.elseIf((0,n._)`${s} == "number" || ${s} == "boolean"`).assign(l,(0,n._)`"" + ${a}`).elseIf((0,n._)`${a} === null`).assign(l,(0,n._)`""`);return;case"number":o.elseIf((0,n._)`${s} == "boolean" || ${a} === null
|
|
60
|
+
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){a(r);continue}o.count>1&&"ref"===e.reused&&a(r)}e.external&&(e.sharedDefsExtractedFor=e.external)}let oP=new Set(["type","properties","required","additionalProperties"]),oO=["oneOf","anyOf"];function ok(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function ox(e){let t=[];for(let r of e){if("object"!=typeof r||"object"!==r.type)return null;for(let e in r)if(!oP.has(e))return null;t.push(r)}let r={},o=new Set;for(let e of t){for(let o in e.properties){if(Object.prototype.hasOwnProperty.call(r,o))continue;let e=[];for(let r of t){let t=r.properties?.[o]??ok(r);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}eg(r,o,1===e.length?e[0]:ox(e)??{allOf:e})}for(let t of e.required??[])o.add(t)}let a={type:"object",properties:r};if(o.size&&(a.required=[...o]),t.every(e=>!1===e.additionalProperties))a.additionalProperties=!1;else{let e=[];for(let r of t){let t=ok(r);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?a.additionalProperties=e[0]:e.length>1&&(a.additionalProperties={allOf:e})}return a}function oT(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},n=r.ref;if(r.ref=null,n){o(n);let r=e.seen.get(n),s=r.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(a.allOf=a.allOf??[],a.allOf.push(s)):ob(a,s),ob(a,i),t._zod.parent===n)for(let e in a)"$ref"!==e&&"allOf"!==e&&(e in i||delete a[e]);if(s.$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 s=t._zod.parent;if(s&&s!==n){o(s);let t=e.seen.get(s);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??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())o(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let r=t.anyOf;if(!Array.isArray(r)||0===r.length||void 0!==t.type)return;let o=[];for(let t of r){if(!t||"object"!=typeof t)return;e(t);let r=Object.keys(t);if(1!==r.length||"type"!==r[0])return;let a=t.type;for(let e of Array.isArray(a)?a:[a]){if("string"!=typeof e)return;o.includes(e)||o.push(e)}}delete t.anyOf,t.type=1===o.length?o[0]:o}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let r of e.seen.values())for(let e of[r.schema,r.def]){let r=e?.allOf;if(!Array.isArray(r))continue;let o=t.get(r);o?o.push(e):t.set(r,[e])}for(let r of e.intersections)for(let e of t.get(r)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of oP)if(t in e)return;let r=t.filter(e=>oO.some(t=>Array.isArray(e[t]))),o=null;if(r.length){let e=r[0],a=oO.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let i=t.filter(t=>t!==e),n=e[a].map(e=>ox([...i,e]));if(n.some(e=>!e))return;o={[a]:n}}else o=ox(t);o&&(delete e.allOf,ob(e,o))}(e)}}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)}ob(a,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;void 0!==i&&a.id===i&&delete a.id;let n=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,eg(n,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(n).length>0&&("draft-2020-12"===e.target?a.$defs=n:a.definitions=n);try{let r=JSON.parse(JSON.stringify(a));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:oC(t,"input",e.processors),output:oC(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let oC=(e,t,r={})=>o=>{let{libraryOptions:a,target:i}=o??{},n=oS({...a??{},target:i,io:t,processors:r});return ow(e,n),oR(n,e),oT(n,e)},oj=(e,t,r)=>{(void 0===e[t]||r>e[t])&&(e[t]=r)},oI=(e,t,r)=>{(void 0===e[t]||r<e[t])&&(e[t]=r)},oN=(e,t)=>{oj(e,"minimum",t),oI(e,"maximum",t)},oA=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},oM=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},oq=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},oz=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},oL=(e,t)=>oj(e,"minimum",t.minimum),oD=(e,t)=>oI(e,"maximum",t.maximum),oU=e=>(t,r)=>{oz(t,r.format);let[o,a]=e[r.format];oj(t,"minimum",o),oI(t,"maximum",a)},oV={greater_than:(e,t)=>oj(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>oI(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>oA(e,t.value),number_format:oU(eN),bigint_format:oU(eA),min_length:oL,max_length:oD,length_equals:(e,t)=>oN(e,t.length),min_size:oL,max_size:oD,size_equals:(e,t)=>oN(e,t.size),string_format:(e,t)=>{oz(e,t.format),t.pattern&&oM(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>oq(e,t.mime)};function oF(e){let t={},r=e._zod.def;for(let o of e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[])oV[o._zod.def.check]?.(t,o._zod.def);let o=e._zod.bag;for(let e of(void 0!==o.minimum&&oj(t,"minimum",o.minimum),void 0!==o.exclusiveMinimum&&oj(t,"exclusiveMinimum",o.exclusiveMinimum),void 0!==o.maximum&&oI(t,"maximum",o.maximum),void 0!==o.exclusiveMaximum&&oI(t,"exclusiveMaximum",o.exclusiveMaximum),void 0!==o.multipleOf&&oA(t,o.multipleOf),void 0!==o.format&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&oq(t,o.mime),o.patterns??[]))oM(t,e);return t}let oH={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oK=new Map([[rv,/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/],[rb,/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/]]),oG=e=>oK.get(e)??e,oB=(e,t,r,o)=>{r.type="string";let{minimum:a,maximum:i,format:n,patterns:s,contentEncoding:l,laxFormat:c}=oF(e);if("number"==typeof a&&(r.minLength=a),"number"==typeof i&&(r.maxLength=i),n&&(r.format=oH[n]??n,""===r.format&&delete r.format,("time"===n||c)&&delete r.format),l&&(r.contentEncoding=l),s&&s.size>0){let e=[...s].map(oG);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}))])}},oJ=(e,t,r,o)=>{let{minimum:a,maximum:i,multipleOf:n,exclusiveMaximum:s,exclusiveMinimum:l,isInt:c}=oF(e);r.type=c?"integer":"number";let u="number"==typeof l&&l>=(a??-1/0),d="number"==typeof s&&s<=(i??1/0),p="draft-04"===t.target||"openapi-3.0"===t.target;if(u?p?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:"number"==typeof a&&(r.minimum=a),d?p?(r.maximum=s,r.exclusiveMaximum=!0):r.exclusiveMaximum=s:"number"==typeof i&&(r.maximum=i),n){let a=new Set;for(let i of n)Number.isFinite(i)&&0!==i?a.add(Math.abs(i)):o$(e,t,r,o,`A multipleOf divisor of ${i} cannot be represented in JSON Schema`);let[i,...s]=a;void 0!==i&&(r.multipleOf=i),s.length&&(r.allOf=[...r.allOf??[],...s.map(e=>({multipleOf:e}))])}},oZ=(e,t,r,o)=>{r.type="boolean"},oW=(e,t,r,o)=>{"openapi-3.0"===t.target?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},oX=(e,t,r,o)=>{r.not={}},oY=(e,t,r,o)=>{},oQ=(e,t,r,o)=>{},o0=(e,t,r,o)=>{let a=eu(e._zod.def.entries);if(0===a.length){r.not={};return}a.every(e=>"number"==typeof e)&&(r.type="number"),a.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=a},o1=(e,t,r,o)=>{let a=e._zod.def;if(0===a.values.length){r.not={};return}let i=[];for(let n of a.values)if(void 0===n){if(o$(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof n){if(o$(e,t,r,o,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(n))}else i.push(n);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},o2=(e,t,r,o)=>{o$(e,t,r,o,"Custom types cannot be represented in JSON Schema")},o9=(e,t,r,o)=>{o$(e,t,r,o,"Transforms cannot be represented in JSON Schema")},o3=(e,t,r,o)=>{let a=e._zod.def,{minimum:i,maximum:n}=oF(e);"number"==typeof i&&(r.minItems=i),"number"==typeof n&&(r.maxItems=n),r.type="array",r.items=ow(a.element,t,{...o,path:[...o.path,"items"]})};function o5(e){let t=e._zod.def;return"pipe"===t.type&&t.in._zod.traits.has("$ZodTransform")?o5(t.out):"catch"===t.type?o5(t.innerType):e._zod.optin}let o4=(e,t,r,o)=>{let a=e._zod.def,i=a.shape;if(Object.getOwnPropertySymbols(i).length&&o$(e,t,r,o,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in r.type="object",r.properties={},i)eg(r.properties,e,ow(i[e],t,{...o,path:[...o.path,"properties",e]}));let n=[];for(let e of Object.keys(i)){let r=a.shape[e];("input"===t.io?void 0===o5(r):void 0===r._zod.optout)&&n.push(e)}n.length>0&&(r.required=n),a.catchall?._zod.def.type==="never"?r.additionalProperties=!1:a.catchall?a.catchall&&(r.additionalProperties=ow(a.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)},o6=(e,t,r,o)=>{let a=e._zod.def,i=!1===a.inclusive,n=a.options.map((e,r)=>ow(e,t,{...o,path:[...o.path,i?"oneOf":"anyOf",r]}));i?r.oneOf=n:r.anyOf=n},o8=(e,t,r,o)=>{let a=e._zod.def,i=ow(a.left,t,{...o,path:[...o.path,"allOf",0]}),n=ow(a.right,t,{...o,path:[...o.path,"allOf",1]}),s=e=>"allOf"in e&&1===Object.keys(e).length,l=[...s(i)?i.allOf:[i],...s(n)?n.allOf:[n]];r.allOf=l,t.intersections.push(l)},o7=new WeakMap,ae=(e,t,r,o)=>{let a=e._zod.def;r.type="object";let i=a.keyType,n=oF(i).patterns;if("loose"===a.mode&&n&&n.size>0){let e=ow(a.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});for(let t of(r.patternProperties={},n))eg(r.patternProperties,oG(t).source,e)}else{if("draft-07"===t.target||"draft-2020-12"===t.target){r.propertyNames=ow(a.keyType,t,{...o,path:[...o.path,"propertyNames"]});let i=o7.get(t);i||(i=[],o7.set(t,i),t.deferred.push(()=>(function(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let r=new Map;for(let o of o7.get(e)??[]){let a=e.seen.get(o),i=(a?.def??a?.schema)?.propertyNames;if(!i||!0===i||r.has(i))continue;let n=function e(t,r,o){if(r.$ref){if(o.has(r))return r;o.add(r);let a=t.get(r)?.def;if(!a)return r;let i=e(t,a,o);return i===a?r:i}for(let a of["anyOf","oneOf"]){let i=r[a];if(!Array.isArray(i))continue;let n=i.map(r=>e(t,r,o));n.some((e,t)=>e!==i[t])&&(r={...r,[a]:n})}let a=Array.isArray(r.type)?r.type:[r.type],i=!a.includes("string")&&a.some(e=>"number"===e||"integer"===e),n=r.enum??(void 0!==r.const?[r.const]:void 0);if(!i&&!n?.some(e=>"number"==typeof e))return r;let{minimum:s,maximum:l,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:d,format:p,id:f,...h}=r;return h.enum?h.enum=h.enum.map(e=>"number"==typeof e?String(e):e):"number"==typeof h.const&&(h.const=String(h.const)),i&&(h.type="string",n||(h.pattern=(a.includes("number")?tO:tP).source)),h}(t,i,new Set);n!==i&&r.set(i,n)}if(r.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&r.get(e.propertyNames);t&&(e.propertyNames=t)}})(t))),i.push(e)}r.additionalProperties=ow(a.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let s=i._zod.values,l="input"===t.io&&void 0!==o5(a.valueType);if(s&&!a.partial&&!l){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(r.required=e.map(String))}},at=(e,t,r,o)=>{let a=e._zod.def,i=ow(a.innerType,t,o),n=t.seen.get(e);"openapi-3.0"===t.target?(n.ref=a.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},ar=(e,t,r,o)=>{let a=e._zod.def;ow(a.innerType,t,o),t.seen.get(e).ref=a.innerType},ao=Symbol();function aa(e,t,r,o,a){let i=!1,n=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(i=!0,null));return i?(o$(t,r,o,a,"BigInt defaults cannot be represented in JSON Schema"),ao):JSON.parse(n)}let ai=(e,t,r,o)=>{let a=e._zod.def;ow(a.innerType,t,o),t.seen.get(e).ref=a.innerType;let i=aa(a.defaultValue,e,t,r,o);i!==ao&&(r.default=i)},an=(e,t,r,o)=>{let a=e._zod.def;if(ow(a.innerType,t,o),t.seen.get(e).ref=a.innerType,"input"!==t.io)return;let i=aa(a.defaultValue,e,t,r,o);i!==ao&&(r._prefault=i)},as=(e,t,r,o)=>{let a,i=e._zod.def;ow(i.innerType,t,o),t.seen.get(e).ref=i.innerType;try{a=i.catchValue(void 0)}catch{o$(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=a},al=(e,t,r,o)=>{let a=e._zod.def,i=a.in._zod.traits.has("$ZodTransform"),n="input"===t.io?i?a.out:a.in:a.out;ow(n,t,o),t.seen.get(e).ref=n},ac=(e,t,r,o)=>{let a=e._zod.def;ow(a.innerType,t,o),t.seen.get(e).ref=a.innerType,r.readOnly=!0},au=(e,t,r,o)=>{let a=e._zod.def;ow(a.innerType,t,o),t.seen.get(e).ref=a.innerType},ad=(e,t,r,o)=>{let a=e._zod.innerType;ow(a,t,o),t.seen.get(e).ref=a},ap={string:oB,number:oJ,boolean:oZ,bigint:(e,t,r,o)=>{o$(e,t,r,o,"BigInt cannot be represented in JSON Schema")},symbol:(e,t,r,o)=>{o$(e,t,r,o,"Symbols cannot be represented in JSON Schema")},null:oW,undefined:(e,t,r,o)=>{o$(e,t,r,o,"Undefined cannot be represented in JSON Schema")},void:(e,t,r,o)=>{o$(e,t,r,o,"Void cannot be represented in JSON Schema")},never:oX,any:oY,unknown:oQ,date:(e,t,r,o)=>{o$(e,t,r,o,"Date cannot be represented in JSON Schema")},enum:o0,literal:o1,nan:(e,t,r,o)=>{o$(e,t,r,o,"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)=>{r.type="string",r.format="binary",r.contentEncoding="binary";let{minimum:a,maximum:i,mime:n}=oF(e);void 0!==a&&(r.minLength=a),void 0!==i&&(r.maxLength=i),n&&(0===n.length?r.not={}:1===n.length?r.contentMediaType=n[0]:r.anyOf=n.map(e=>({contentMediaType:e})))},success:(e,t,r,o)=>{r.type="boolean"},custom:o2,function:(e,t,r,o)=>{o$(e,t,r,o,"Function types cannot be represented in JSON Schema")},transform:o9,map:(e,t,r,o)=>{o$(e,t,r,o,"Map cannot be represented in JSON Schema")},set:(e,t,r,o)=>{o$(e,t,r,o,"Set cannot be represented in JSON Schema")},array:o3,object:o4,union:o6,intersection:o8,tuple:(e,t,r,o)=>{let a=e._zod.def;r.type="array";let i="draft-2020-12"===t.target?"prefixItems":"items",n="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",s=a.items.map((e,r)=>ow(e,t,{...o,path:[...o.path,i,r]})),l=a.rest?ow(a.rest,t,{...o,path:[...o.path,n,..."openapi-3.0"===t.target?[a.items.length]:[]]}):null,c=a.items.length;for(;c>0;){let e=a.items[c-1];if(!("input"===t.io?void 0!==o5(e):"optional"===e._zod.optout))break;c--}let u=a.items.length,d=!a.rest;"draft-2020-12"===t.target?(r.prefixItems=s,d?r.items=!1:l&&(r.items=l)):"openapi-3.0"===t.target?(r.items={anyOf:s},l&&r.items.anyOf.push(l)):(r.items=s,d?r.additionalItems=!1:l&&(r.additionalItems=l)),c>0&&(r.minItems=c),d&&(r.maxItems=u);let{minimum:p,maximum:f}=oF(e);"number"==typeof p&&(r.minItems=p),"number"==typeof f&&(r.maxItems=f)},record:ae,nullable:at,nonoptional:ar,default:ai,prefault:an,catch:as,pipe:al,readonly:ac,promise:(e,t,r,o)=>{let a=e._zod.def;ow(a.innerType,t,o),t.seen.get(e).ref=a.innerType},optional:au,lazy:ad};function af(e,t){if("_idmap"in e){let r=oS({...t,processors:ap}),o={};for(let t of e._idmap.entries()){let[e,o]=t;ow(o,r)}let a={};for(let i of(r.external={registry:e,uri:t?.uri,defs:o},e._idmap.entries())){let[e,t]=i;oR(r,t),eg(a,e,oT(r,t))}return Object.keys(o).length>0&&(a.__shared={["draft-2020-12"===r.target?"$defs":"definitions"]:o}),{schemas:a}}let r=oS({...t,processors:ap});return ow(e,r),oR(r,e),oT(r,e)}let ah={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ep,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},am={value:void 0,enumerable:!1},ay=new WeakSet([Object.prototype,Error.prototype]),ag=(e,t)=>{e.name="$ZodError",am.value=t,Object.defineProperty(e,"issues",am),am.value=void 0,Object.defineProperty(e,"message",ah);let r=Object.getPrototypeOf(e);ay.has(r)||(ay.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},av=e9("$ZodError",ag);function a_(e,t){return{callee:t?.callee??e,Err:t?.Err}}e9("$ZodError",ag,void 0,{Parent:Error});let ab=e=>{let t=(r,o,a,i)=>{let n=a?{...a,async:!1}:{async:!1},s=r._zod.run({value:o,issues:[]},n);if(s instanceof Promise)throw new e3;if(s.issues.length){let r=new(i?.Err??e)(s.issues.map(e=>eH(e,n,e6())));throw eE(r,i?.callee??t),r}return s.value};return t},aS=e=>{let t=async(r,o,a,i)=>{let n=a?{...a,async:!0}:{async:!0},s=r._zod.run({value:o,issues:[]},n);if(s instanceof Promise&&(s=await s),s.issues.length){let r=new(i?.Err??e)(s.issues.map(e=>eH(e,n,e6())));throw eE(r,i?.callee??t),r}return s.value};return t},a$=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 e3;return i.issues.length?aw(e,i.issues,a):{success:!0,data:i.value}};function aw(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(e=>eH(e,r,e6()))),t=void 0,r=void 0),o},set error(e){o=e,t=void 0,r=void 0}}}let aE=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?aw(e,i.issues,a):{success:!0,data:i.value}},aR=Symbol.for("zod.compile.invalid"),aP=Symbol.for("zod.compile.fallback"),aO=new WeakSet([Object.prototype,Error.prototype]);function ak(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=r(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let ax=e9("ZodError",(e,t)=>{av.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);aO.has(r)||(aO.add(r),ak(r,"format",e=>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],n=a===e.length-1;if("_errors"===r){n&&o._errors.push(t(i)),a++;continue}Object.prototype.hasOwnProperty.call(o,r)||Object.defineProperty(o,r,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=o[r];n&&s._errors.push(t(i)),o=s,a++}}}};return o(e),r})(e,t)),ak(r,"flatten",e=>t=>(function(e,t=e=>e.message){let r={},o=[];for(let s of e.issues)if(s.path.length>0){var a,i,n;(a=r,i=s.path[0],n=()=>[],!Object.prototype.hasOwnProperty.call(a,i)&&("__proto__"===i?Object.defineProperty(a,i,{value:n(),writable:!0,enumerable:!0,configurable:!0}):a[i]=n()),a[i]).push(t(s))}else o.push(t(s));return{formErrors:o,fieldErrors:r}})(e,t)),ak(r,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ep,2)}),ak(r,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ep,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error}),aT=ab(ax),aC=aS(ax),aj=a$(ax),aI=aE(ax),aN=(p=ab(ax),f=(e,t,r,o)=>p(e,t,r?{...r,direction:"backward"}:{direction:"backward"},a_(f,o))),aA=(h=ab(ax),m=(e,t,r,o)=>h(e,t,r,a_(m,o))),aM=(y=aS(ax),g=async(e,t,r,o)=>{let a=r?{...r,direction:"backward"}:{direction:"backward"};return await y(e,t,a,a_(g,o))}),aq=(v=aS(ax),_=async(e,t,r,o)=>await v(e,t,r,a_(_,o))),az=(b=ax,(e,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return a$(b)(e,t,o)}),aL=(S=ax,(e,t,r)=>a$(S)(e,t,r)),aD=($=ax,async(e,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return aE($)(e,t,o)}),aU=(w=ax,async(e,t,r)=>aE(w)(e,t,r));function aV(){e4.memoizer||e6({memoizer:ti})}let aF=e9("ZodType",(e,t)=>(e4.localeError||e6({localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function o(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?r[e]??e:String(t)}return r=>{switch(r.code){case"invalid_type":{let e=o(r.expected),t=o(function(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}(r.input),r.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===r.values.length)return`Invalid input: expected ${eI(r.values[0])}`;return`Invalid option: expected one of ${ed(r.values,"|")}`;case"too_big":{let t=r.exact?"exactly ":r.inclusive?"<=":"<",o=e[r.origin]??null;if(o)return`Too big: expected ${r.origin??"value"} to have ${t}${r.maximum.toString()} ${o.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${t}${r.maximum.toString()}`}case"too_small":{let t=r.exact?"exactly ":r.inclusive?">=":">",o=e[r.origin]??null;if(o)return`Too small: expected ${r.origin} to have ${t}${r.minimum.toString()} ${o.unit}`;return`Too small: expected ${r.origin} to be ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Invalid string: must start with "${r.prefix}"`;if("ends_with"===r.format)return`Invalid string: must end with "${r.suffix}"`;if("includes"===r.format)return`Invalid string: must include "${r.includes}"`;if("regex"===r.format)return`Invalid string: must match pattern ${r.pattern}`;return`Invalid ${t[r.format]??r.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${ed(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":if(r.options&&Array.isArray(r.options)&&r.options.length>0){let e=r.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===r.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}})()}),tY.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ew(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 eC(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 i1({type:"custom",check:"custom",fn:e,...ej(t)})}(e,t))},superRefine(e,t){var r,o,a,i,n;let s,l;return this.check((r=e,o=t,a=r,i=e=>(e.addIssue=t=>{"string"==typeof t?e.issues.push(eJ(t,e.value,s._zod.def)):(t.fatal&&(t.continue=!1),t.code??(t.code="custom"),"input"in t||(t.input=e.value),t.inst??(t.inst=s),t.continue??(t.continue=!s._zod.def.abort),e.issues.push(eJ(t)))},a(e.value,e)),(l=new tj({check:"custom",...ej(n=o)}))._zod.check=i,s=l))},overwrite(e){return this.check(o_(e))},optional(){return iU(this)},exactOptional(){var e;return e=this,new iV({type:"optional",innerType:e})},nullable(){return iH(this)},nullish(){return iU(iH(this))},nonoptional(e){var t,r;return t=this,new iB({type:"nonoptional",innerType:t,...ej(r=e)})},array(){return i$(this)},or(e){return iO([this,e])},and(e){return iC(this,e)},transform(e){return iW(this,iL(e))},default(e){var t,r;return t=this,r=e,new iK({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():ek(r)}})},prefault(e){var t,r;return t=this,r=e,new iG({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():ek(r)}})},catch(e){var t,r,o;let a;return t=this,new iJ({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:(o=r,(a=()=>o)["~constantCatch"]=!0,a)})},pipe(e){return iW(this,e)},readonly(){var e;return e=this,new iY({type:"readonly",innerType:e})},describe(e){let t=this.clone();return oi.add(t,{description:e}),t},meta(...e){if(0===e.length)return oi.get(this);let t=this.clone();return oi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){var e;return e=this,eZ(e,"~standard",{...t0(this),jsonSchema:{input:oC(this,"input"),output:oC(this,"output")}},!1)},set"~standard"(e){eZ(this,"~standard",e)},parse:function e(t,r){return aT(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await aC(this,t,r,{callee:e})},safeParse(e,t){return aj(this,e,t)},async safeParseAsync(e,t){return aI(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){eZ(this,"spa",e)},validate(e,t){var r=this,o=e,a=t;let i=r._zod.bag.validator;if(void 0!==i){if(i(o)!==aR)return!0;if(!0===i.definite&&void 0===a)return!1}var n=r,s=o,l=a;let c,u=l?{...l,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},d=n._zod.bag.fallbackRun;if(d?(u[aP]=!0,c=d({value:s,issues:[]},u)):c=n._zod.run({value:s,issues:[]},u),c instanceof Promise)throw new e3;return 0===c.issues.length},validateAsync(e,t){return(async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},a=e._zod.run({value:t,issues:[]},o);return a instanceof Promise&&(a=await a),0===a.issues.length})(this,e,t)},encode:function e(t,r){return aN(this,t,r,{callee:e})},decode:function e(t,r){return aA(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await aM(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await aq(this,t,r,{callee:e})},safeEncode(e,t){return az(this,e,t)},safeDecode(e,t){return aL(this,e,t)},async safeEncodeAsync(e,t){return aD(this,e,t)},async safeDecodeAsync(e,t){return aU(this,e,t)},toJSONSchema(e){return((e,t={})=>r=>{let o=oS({...r,processors:t});return ow(e,o),oR(o,e),oT(o,e)})(this,{})(e)},get description(){return oi.get(this)?.description},get _def(){return this._zod.def}}),aH=e9("_ZodString",(e,t)=>{t1.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oB(e,t,r,o)},eW({format:e=>oF(e).format??null,minLength:e=>oF(e).minimum??null,maxLength:e=>oF(e).maximum??null},{regex(...e){return this.check(function(e,t){return new tF({check:"string_format",format:"regex",...ej(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new tG({check:"string_format",format:"includes",...ej(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new tB({check:"string_format",format:"starts_with",...ej(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new tJ({check:"string_format",format:"ends_with",...ej(t),suffix:e})}(...e))},min(...e){return this.check(og(...e))},max(...e){return this.check(oy(...e))},length(...e){return this.check(ov(...e))},nonempty(...e){return this.check(og(1,...e))},lowercase(e){return this.check(new tH({check:"string_format",format:"lowercase",...ej(e)}))},uppercase(e){return this.check(new tK({check:"string_format",format:"uppercase",...ej(e)}))},trim(){return this.check(o_(e=>e.trim()))},normalize(...e){return this.check(function(e){return o_(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(o_(e=>e.toLowerCase()))},toUpperCase(){return this.check(o_(e=>e.toUpperCase()))},slugify(){return this.check(o_(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})),aK=e9("ZodString",(e,t)=>{t1.init(e,t),aH.init(e,t)},{email(e){return this.check(os(aY,e))},url(e){return this.check(ol(a1,e))},jwt(e){return this.check(new is({type:"string",format:"jwt",check:"string_format",abort:!1,...ej(e)}))},emoji(e){return this.check(new a2({type:"string",format:"emoji",check:"string_format",abort:!1,...ej(e)}))},guid(e){return this.check(new aQ({type:"string",format:"guid",check:"string_format",abort:!1,...ej(e)}))},uuid(e){return this.check(new a0({type:"string",format:"uuid",check:"string_format",abort:!1,...ej(e)}))},uuidv4(e){return this.check(new a0({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ej(e)}))},uuidv6(e){return this.check(new a0({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ej(e)}))},uuidv7(e){return this.check(new a0({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ej(e)}))},nanoid(e){return this.check(new a9({type:"string",format:"nanoid",check:"string_format",abort:!1,...ej(e)}))},cuid(e){return this.check(new a3({type:"string",format:"cuid",check:"string_format",abort:!1,...ej(e)}))},cuid2(e){return this.check(new a5({type:"string",format:"cuid2",check:"string_format",abort:!1,...ej(e)}))},ulid(e){return this.check(new a4({type:"string",format:"ulid",check:"string_format",abort:!1,...ej(e)}))},base64(e){return this.check(new io({type:"string",format:"base64",check:"string_format",abort:!1,...ej(e)}))},base64url(e){return this.check(new ia({type:"string",format:"base64url",check:"string_format",abort:!1,...ej(e)}))},xid(e){return this.check(new a6({type:"string",format:"xid",check:"string_format",abort:!1,...ej(e)}))},ksuid(e){return this.check(new a8({type:"string",format:"ksuid",check:"string_format",abort:!1,...ej(e)}))},ipv4(e){return this.check(new a7({type:"string",format:"ipv4",check:"string_format",abort:!1,...ej(e)}))},ipv6(e){return this.check(new ie({type:"string",format:"ipv6",check:"string_format",abort:!1,...ej(e)}))},cidrv4(e){return this.check(new it({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ej(e)}))},cidrv6(e){return this.check(new ir({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ej(e)}))},e164(e){return this.check(new ii({type:"string",format:"e164",check:"string_format",abort:!1,...ej(e)}))},datetime(e){return this.check(oc(aJ,e))},date(e){return this.check(ou(aZ,e))},time(e){return this.check(new aW({type:"string",format:"time",check:"string_format",precision:null,...ej(e)}))},duration(e){return this.check(new aX({type:"string",format:"duration",check:"string_format",...ej(e)}))}});function aG(e){return new aK(on({type:"string",...ej(e)}))}let aB=e9("ZodStringFormat",(e,t)=>{t2.init(e,t),aH.init(e,t)}),aJ=e9("ZodISODateTime",(e,t)=>{rs.init(e,t),aB.init(e,t)}),aZ=e9("ZodISODate",(e,t)=>{rl.init(e,t),aB.init(e,t)}),aW=e9("ZodISOTime",(e,t)=>{rc.init(e,t),aB.init(e,t)}),aX=e9("ZodISODuration",(e,t)=>{ru.init(e,t),aB.init(e,t)}),aY=e9("ZodEmail",(e,t)=>{t5.init(e,t),aB.init(e,t)}),aQ=e9("ZodGUID",(e,t)=>{t9.init(e,t),aB.init(e,t)}),a0=e9("ZodUUID",(e,t)=>{t3.init(e,t),aB.init(e,t)}),a1=e9("ZodURL",(e,t)=>{t7.init(e,t),aB.init(e,t)}),a2=e9("ZodEmoji",(e,t)=>{re.init(e,t),aB.init(e,t)}),a9=e9("ZodNanoID",(e,t)=>{rt.init(e,t),aB.init(e,t)}),a3=e9("ZodCUID",(e,t)=>{rr.init(e,t),aB.init(e,t)}),a5=e9("ZodCUID2",(e,t)=>{ro.init(e,t),aB.init(e,t)}),a4=e9("ZodULID",(e,t)=>{ra.init(e,t),aB.init(e,t)}),a6=e9("ZodXID",(e,t)=>{ri.init(e,t),aB.init(e,t)}),a8=e9("ZodKSUID",(e,t)=>{rn.init(e,t),aB.init(e,t)}),a7=e9("ZodIPv4",(e,t)=>{rd.init(e,t),aB.init(e,t)}),ie=e9("ZodIPv6",(e,t)=>{rh.init(e,t),aB.init(e,t)}),it=e9("ZodCIDRv4",(e,t)=>{rm.init(e,t),aB.init(e,t)}),ir=e9("ZodCIDRv6",(e,t)=>{ry.init(e,t),aB.init(e,t)}),io=e9("ZodBase64",(e,t)=>{r_.init(e,t),aB.init(e,t)}),ia=e9("ZodBase64URL",(e,t)=>{rS.init(e,t),aB.init(e,t)}),ii=e9("ZodE164",(e,t)=>{r$.init(e,t),aB.init(e,t)}),is=e9("ZodJWT",(e,t)=>{rw.init(e,t),aB.init(e,t)}),il=e9("ZodNumber",(e,t)=>{rE.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oJ(e,t,r,o),e.isFinite=!0},eW({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=oF(e);return Math.max(t??-1/0,r??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=oF(e);return Math.min(t??1/0,r??1/0)},isInt:e=>{let{isInt:t,multipleOf:r}=oF(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>oF(e).format??null},{gt(e,t){return this.check(of(e,t))},gte(e,t){return this.check(oh(e,t))},min(e,t){return this.check(oh(e,t))},lt(e,t){return this.check(od(e,t))},lte(e,t){return this.check(op(e,t))},max(e,t){return this.check(op(e,t))},int(e){return this.check(id(e))},safe(e){return this.check(id(e))},positive(e){return this.check(of(0,e))},nonnegative(e){return this.check(oh(0,e))},negative(e){return this.check(od(0,e))},nonpositive(e){return this.check(op(0,e))},multipleOf(e,t){return this.check(om(e,t))},step(e,t){return this.check(om(e,t))},finite(){return this}}));function ic(e){return new il(on({type:"number",checks:[],...ej(e)}))}let iu=e9("ZodNumberFormat",(e,t)=>{rR.init(e,t),il.init(e,t)});function id(e){return new iu({type:"number",check:"number_format",abort:!1,format:"safeint",...ej(e)})}let ip=e9("ZodBoolean",(e,t)=>{rP.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oZ(e,t,r,o)});function ih(e){return new ip({type:"boolean",...ej(e)})}let im=e9("ZodNull",(e,t)=>{rO.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oW(e,t,r,o)});function iy(e){return new im({type:"null",...ej(e)})}let ig=e9("ZodAny",(e,t)=>{rk.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oY(e,t,r,o)}),iv=e9("ZodUnknown",(e,t)=>{rx.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oQ(e,t,r,o)});function i_(){return new iv({type:"unknown"})}let ib=e9("ZodNever",(e,t)=>{rT.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oX(e,t,r,o)}),iS=e9("ZodArray",(e,t)=>{aV(),rI.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o3(e,t,r,o),e.element=t.element},{min(e,t){return this.check(og(e,t))},nonempty(e){return this.check(og(1,e))},max(e,t){return this.check(oy(e,t))},length(e,t){return this.check(ov(e,t))},unwrap(){return this.element}});function i$(e,t){return new iS({type:"array",element:e,...ej(t)})}let iw=e9("ZodObject",(e,t)=>{var r,o,a,i,n,s;let l,c;aV(),rL.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o4(e,t,r,o),r=e,o="shape",a=e=>e._zod.def.shape,i=!1,n=r,s=o,l=Object.getPrototypeOf(n),(c=s in l?void 0:l)&&Object.defineProperty(c,o,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,o,e),e.value=a(this),Object.defineProperty(this,o,e),e.value},set(e){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:i,value:e})}})},{keyof(){return iA(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ew(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ew(this._zod.def,{catchall:i_()}))},loose(){return this.clone(ew(this._zod.def,{catchall:i_()}))},strict(){return this.clone(ew(this._zod.def,{catchall:new ib({type:"never",...ej(void 0)})}))},strip(){return this.clone(ew(this._zod.def,{catchall:void 0}))},extend(e){var t=this,r=e;if(!eO(r))throw Error("Invalid input to extend: expected a plain object");let o=t._zod.def.checks;if(o&&o.length>0){let e=e_(t);for(let t of Reflect.ownKeys(r))if(void 0!==Object.getOwnPropertyDescriptor(e,t))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return eC(t,ew(t._zod.def,{shape:eq(t,r)}))},safeExtend(e){var t=this,r=e;if(!eO(r))throw Error("Invalid input to safeExtend: expected a plain object");return eC(t,ew(t._zod.def,{shape:eq(t,r)}))},merge(e){var t=this,r=e;if(!r?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let o={};e$(o,t,Reflect.ownKeys(e_(t))),e$(o,r,Reflect.ownKeys(e_(r)));let a=ew(t._zod.def,{shape:o,get catchall(){return r._zod.def.catchall},checks:r._zod.def.checks??[]});return eC(t,a)},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={};return e$(a,e,eM(e,t)),eC(e,ew(r,{shape:a,checks:[]}))}(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=new Set(eM(e,t)),i={};return e$(i,e,Reflect.ownKeys(e_(e)).filter(e=>!a.has(e))),eC(e,ew(r,{shape:i,checks:[]}))}(this,e)},partial(...e){return ez(iD,this,e[0])},exactPartial(...e){return ez(iV,this,e[0],"exactPartial")},required(...e){var t,r,o;let a,i;return t=iB,r=this,a=(o=e[0])?new Set(eM(r,o)):void 0,e$(i={},r,Reflect.ownKeys(e_(r)),(e,r)=>a&&!a.has(r)?e:new t({type:"nonoptional",innerType:e})),eC(r,ew(r._zod.def,{shape:i}))}});function iE(e,t){return new iw({type:"object",shape:e??{},...ej(t)})}function iR(e,t){return new iw({type:"object",shape:e,catchall:i_(),...ej(t)})}let iP=e9("ZodUnion",(e,t)=>{rU.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o6(e,t,r,o),e.options=t.options});function iO(e,t){return new iP({type:"union",options:e,...ej(t)})}let ik=e9("ZodDiscriminatedUnion",(e,t)=>{iP.init(e,t),rV.init(e,t)});function ix(e,t,r){return new ik({type:"union",options:t,discriminator:e,...ej(r)})}let iT=e9("ZodIntersection",(e,t)=>{rF.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o8(e,t,r,o)});function iC(e,t){return new iT({type:"intersection",left:e,right:t})}let ij=e9("ZodRecord",(e,t)=>{aV(),rK.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>ae(e,t,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function iI(e,t,r){return new ij(t&&t._zod?{type:"record",keyType:e,valueType:t,...ej(r)}:{type:"record",keyType:aG(),valueType:e,...ej(t)})}let iN=e9("ZodEnum",(e,t)=>{rG.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o0(e,t,r,o),e.enum=t.entries,e.options=[...e._zod.values];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 iN({...t,checks:[],...ej(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 iN({...t,checks:[],...ej(o),entries:a})}});function iA(e,t){return new iN({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ej(t)})}let iM=e9("ZodLiteral",(e,t)=>{rB.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o1(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 iq(e,t){return new iM({type:"literal",values:Array.isArray(e)?e:[e],...ej(t)})}let iz=e9("ZodTransform",(e,t)=>{aV(),rJ.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o9(e,t,r,o),e._zod.parse=(r,o)=>{if("backward"===o.direction)throw new e5(e.constructor.name);r.addIssue=o=>{"string"==typeof o?r.issues.push(eJ(o,r.value,t)):(o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=r.value),o.inst??(o.inst=e),r.issues.push(eJ(o)))};let a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});function iL(e){return new iz({type:"transform",transform:e})}let iD=e9("ZodOptional",(e,t)=>{rW.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>au(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function iU(e){return new iD({type:"optional",innerType:e})}let iV=e9("ZodExactOptional",(e,t)=>{rX.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>au(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),iF=e9("ZodNullable",(e,t)=>{rY.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>at(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function iH(e){return new iF({type:"nullable",innerType:e})}let iK=e9("ZodDefault",(e,t)=>{rQ.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>ai(e,t,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),iG=e9("ZodPrefault",(e,t)=>{r1.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>an(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),iB=e9("ZodNonOptional",(e,t)=>{r2.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>ar(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),iJ=e9("ZodCatch",(e,t)=>{r5.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>as(e,t,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),iZ=e9("ZodPipe",(e,t)=>{r4.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>al(e,t,r,o),e.in=t.in,e.out=t.out});function iW(e,t){return new iZ({type:"pipe",in:e,out:t})}let iX=e9("ZodPreprocess",(e,t)=>{iZ.init(e,t),r8.init(e,t)}),iY=e9("ZodReadonly",(e,t)=>{r7.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>ac(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),iQ=e9("ZodLazy",(e,t)=>{ot.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>ad(e,t,r,o),e.unwrap=()=>e._zod.def.getter()});function i0(e){return new iQ({type:"lazy",getter:e})}let i1=e9("ZodCustom",(e,t)=>{or.init(e,t),aF.init(e,t),e._zod.processJSONSchema=(t,r,o)=>o2(e,t,r,o)});function i2(e,t){return new iX({type:"pipe",in:iL(e),out:t})}let i9="2025-11-25",i3=[i9,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],i5="io.modelcontextprotocol/protocolVersion",i4="io.modelcontextprotocol/clientInfo",i6="io.modelcontextprotocol/serverInfo",i8="io.modelcontextprotocol/clientCapabilities",i7="io.modelcontextprotocol/subscriptionId",ne="io.modelcontextprotocol/logLevel",nt=i0(()=>iO([aG(),ic(),ih(),iy(),iI(aG(),nt),i$(nt)])),nr=iI(aG(),nt),no=i$(nt),na=iO([aG(),ic().int()]),ni=aG(),nn=iE({ttl:ic().optional()}),ns=iE({taskId:aG()}),nl=iR({progressToken:na.optional(),"io.modelcontextprotocol/related-task":ns.optional()}),nc=iE({_meta:nl.optional()}),nu=nc.extend({task:nn.optional()}),nd=iE({method:aG(),params:nc.loose().optional()}),np=iE({_meta:nl.optional()}),nf=iE({method:aG(),params:np.loose().optional()}),nh=iR({get[i6](){return nx.optional().catch(void 0)}}),nm=iR({_meta:nh.optional()}),ny=iO([aG(),ic().int()]),ng=iE({jsonrpc:iq("2.0"),id:ny,...nd.shape}).strict(),nv=iE({jsonrpc:iq("2.0"),...nf.shape}).strict(),n_=iE({jsonrpc:iq("2.0"),id:ny,result:nm}).strict(),nb=iE({jsonrpc:iq("2.0"),id:ny.optional(),error:iE({code:ic().int(),message:aG(),data:i_().optional()})}).strict(),nS=iO([ng,nv,n_,nb]),n$=iO([n_,nb]),nw=nm.strict(),nE=np.extend({requestId:ny.optional(),reason:aG().optional()}),nR=nf.extend({method:iq("notifications/cancelled"),params:nE}),nP=iE({src:aG(),mimeType:aG().optional(),sizes:i$(aG()).optional(),theme:iA(["light","dark"]).optional()}),nO=iE({icons:i$(nP).optional()}),nk=iE({name:aG(),title:aG().optional()}),nx=nk.extend({...nk.shape,...nO.shape,version:aG(),websiteUrl:aG().optional(),description:aG().optional()}),nT=iC(iE({applyDefaults:ih().optional()}),nr),nC=i2(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,iC(iE({form:nT.optional(),url:nr.optional()}),nr.optional())),nj=iR({list:nr.optional(),cancel:nr.optional(),requests:iR({sampling:iR({createMessage:nr.optional()}).optional(),elicitation:iR({create:nr.optional()}).optional()}).optional()}),nI=iR({list:nr.optional(),cancel:nr.optional(),requests:iR({tools:iR({call:nr.optional()}).optional()}).optional()}),nN=iE({experimental:iI(aG(),nr).optional(),sampling:iE({context:nr.optional(),tools:nr.optional()}).optional(),elicitation:nC.optional(),roots:iE({listChanged:ih().optional()}).optional(),tasks:nj.optional(),extensions:iI(aG(),nr).optional()}),nA=nc.extend({protocolVersion:aG(),capabilities:nN,clientInfo:nx}),nM=nd.extend({method:iq("initialize"),params:nA}),nq=iE({experimental:iI(aG(),nr).optional(),logging:nr.optional(),completions:nr.optional(),prompts:iE({listChanged:ih().optional()}).optional(),resources:iE({subscribe:ih().optional(),listChanged:ih().optional()}).optional(),tools:iE({listChanged:ih().optional()}).optional(),tasks:nI.optional(),extensions:iI(aG(),nr).optional()}),nz=nm.extend({protocolVersion:aG(),capabilities:nq,serverInfo:nx,instructions:aG().optional()}),nL=nf.extend({method:iq("notifications/initialized"),params:np.optional()}),nD=nd.extend({method:iq("server/discover"),params:nc.optional()}),nU=nm.extend({supportedVersions:i$(aG()),capabilities:nq,instructions:aG().optional()}),nV=nd.extend({method:iq("ping"),params:nc.optional()}),nF=iE({progress:ic(),total:iU(ic()),message:iU(aG())}),nH=iE({...np.shape,...nF.shape,progressToken:na}),nK=nf.extend({method:iq("notifications/progress"),params:nH}),nG=nc.extend({cursor:ni.optional()}),nB=nd.extend({params:nG.optional()}),nJ=nm.extend({nextCursor:ni.optional()}),nZ=iE({uri:aG(),mimeType:iU(aG()),_meta:iI(aG(),i_()).optional()}),nW=nZ.extend({text:aG()}),nX=aG().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),nY=nZ.extend({blob:nX}),nQ=iA(["user","assistant"]),n0=iE({audience:i$(nQ).optional(),priority:ic().min(0).max(1).optional(),lastModified:oc(aJ,{offset:!0}).optional()}),n1=iE({...nk.shape,...nO.shape,uri:aG(),description:iU(aG()),mimeType:iU(aG()),size:iU(ic()),annotations:n0.optional(),_meta:iU(iR({}))}),n2=iE({...nk.shape,...nO.shape,uriTemplate:aG(),description:iU(aG()),mimeType:iU(aG()),annotations:n0.optional(),_meta:iU(iR({}))}),n9=nB.extend({method:iq("resources/list")}),n3=nJ.extend({resources:i$(n1)}),n5=nB.extend({method:iq("resources/templates/list")}),n4=nJ.extend({resourceTemplates:i$(n2)}),n6=nc.extend({uri:aG()}),n8=nd.extend({method:iq("resources/read"),params:n6}),n7=nm.extend({contents:i$(iO([nW,nY]))}),se=nf.extend({method:iq("notifications/resources/list_changed"),params:np.optional()}),st=nd.extend({method:iq("resources/subscribe"),params:n6}),sr=nd.extend({method:iq("resources/unsubscribe"),params:n6}),so=iE({toolsListChanged:ih().optional(),promptsListChanged:ih().optional(),resourcesListChanged:ih().optional(),resourceSubscriptions:i$(aG()).optional()}),sa=nc.extend({notifications:so}),si=nd.extend({method:iq("subscriptions/listen"),params:sa}),sn=np.extend({notifications:so}),ss=nf.extend({method:iq("notifications/subscriptions/acknowledged"),params:sn}),sl=nh.extend({[i7]:ny}),sc=nm.extend({_meta:sl}),su=np.extend({uri:aG()}),sd=nf.extend({method:iq("notifications/resources/updated"),params:su}),sp=iE({name:aG(),description:iU(aG()),required:iU(ih())}),sf=iE({...nk.shape,...nO.shape,description:iU(aG()),arguments:iU(i$(sp)),_meta:iU(iR({}))}),sh=nB.extend({method:iq("prompts/list")}),sm=nJ.extend({prompts:i$(sf)}),sy=nc.extend({name:aG(),arguments:iI(aG(),aG()).optional()}),sg=nd.extend({method:iq("prompts/get"),params:sy}),sv=iE({type:iq("text"),text:aG(),annotations:n0.optional(),_meta:iI(aG(),i_()).optional()}),s_=iE({type:iq("image"),data:nX,mimeType:aG(),annotations:n0.optional(),_meta:iI(aG(),i_()).optional()}),sb=iE({type:iq("audio"),data:nX,mimeType:aG(),annotations:n0.optional(),_meta:iI(aG(),i_()).optional()}),sS=iE({type:iq("tool_use"),name:aG(),id:aG(),input:iI(aG(),i_()),_meta:iI(aG(),i_()).optional()}),s$=iE({type:iq("resource"),resource:iO([nW,nY]),annotations:n0.optional(),_meta:iI(aG(),i_()).optional()}),sw=n1.extend({type:iq("resource_link")}),sE=iO([sv,s_,sb,sw,s$]),sR=iE({role:nQ,content:sE}),sP=nm.extend({description:aG().optional(),messages:i$(sR)}),sO=nf.extend({method:iq("notifications/prompts/list_changed"),params:np.optional()}),sk=iE({title:aG().optional(),readOnlyHint:ih().optional(),destructiveHint:ih().optional(),idempotentHint:ih().optional(),openWorldHint:ih().optional()}),sx=iE({taskSupport:iA(["required","optional","forbidden"]).optional()}),sT=iE({...nk.shape,...nO.shape,description:aG().optional(),inputSchema:iE({type:iq("object"),properties:iI(aG(),nt).optional(),required:i$(aG()).optional()}).catchall(i_()),outputSchema:iR({$schema:aG().optional()}).optional(),annotations:sk.optional(),execution:sx.optional(),_meta:iI(aG(),i_()).optional()}),sC=nB.extend({method:iq("tools/list")}),sj=nJ.extend({tools:i$(sT)}),sI=nm.extend({content:i$(sE).default([]),structuredContent:i_().optional(),isError:ih().optional()}),sN=sI.or(nm.extend({toolResult:i_()})),sA=nu.extend({name:aG(),arguments:iI(aG(),i_()).optional()}),sM=nd.extend({method:iq("tools/call"),params:sA}),sq=nf.extend({method:iq("notifications/tools/list_changed"),params:np.optional()}),sz=iE({autoRefresh:ih().default(!0),debounceMs:ic().int().nonnegative().default(300)}),sL=iA(["debug","info","notice","warning","error","critical","alert","emergency"]),sD=nc.extend({level:sL}),sU=nd.extend({method:iq("logging/setLevel"),params:sD}),sV=np.extend({level:sL,logger:aG().optional(),data:i_()}),sF=nf.extend({method:iq("notifications/message"),params:sV}),sH=iE({name:aG().optional()}),sK=iE({hints:i$(sH).optional(),costPriority:ic().min(0).max(1).optional(),speedPriority:ic().min(0).max(1).optional(),intelligencePriority:ic().min(0).max(1).optional()}),sG=iE({mode:iA(["auto","required","none"]).optional()}),sB=iE({type:iq("tool_result"),toolUseId:aG().describe("The unique identifier for the corresponding tool call."),content:i$(sE),structuredContent:i_().optional(),isError:ih().optional(),_meta:iI(aG(),i_()).optional()}),sJ=ix("type",[sv,s_,sb]),sZ=ix("type",[sv,s_,sb,sS,sB]),sW=iE({role:nQ,content:iO([sZ,i$(sZ)]),_meta:iI(aG(),i_()).optional()}),sX=nu.extend({messages:i$(sW),modelPreferences:sK.optional(),systemPrompt:aG().optional(),includeContext:iA(["none","thisServer","allServers"]).optional(),temperature:ic().optional(),maxTokens:ic().int(),stopSequences:i$(aG()).optional(),metadata:nr.optional(),tools:i$(sT).optional(),toolChoice:sG.optional()}),sY=nd.extend({method:iq("sampling/createMessage"),params:sX}),sQ=nm.extend({model:aG(),stopReason:iU(iA(["endTurn","stopSequence","maxTokens"]).or(aG())),role:nQ,content:sJ}),s0=nm.extend({model:aG(),stopReason:iU(iA(["endTurn","stopSequence","maxTokens","toolUse"]).or(aG())),role:nQ,content:iO([sZ,i$(sZ)])}),s1=iE({type:iq("boolean"),title:aG().optional(),description:aG().optional(),default:ih().optional()}),s2=iE({type:iq("string"),title:aG().optional(),description:aG().optional(),minLength:ic().optional(),maxLength:ic().optional(),format:iA(["email","uri","date","date-time"]).optional(),default:aG().optional()}),s9=iE({type:iA(["number","integer"]),title:aG().optional(),description:aG().optional(),minimum:ic().optional(),maximum:ic().optional(),default:ic().optional()}),s3=iE({type:iq("string"),title:aG().optional(),description:aG().optional(),enum:i$(aG()),default:aG().optional()}),s5=iE({type:iq("string"),title:aG().optional(),description:aG().optional(),oneOf:i$(iE({const:aG(),title:aG()})),default:aG().optional()}),s4=iE({type:iq("string"),title:aG().optional(),description:aG().optional(),enum:i$(aG()),enumNames:i$(aG()).optional(),default:aG().optional()}),s6=iO([s3,s5]),s8=iE({type:iq("array"),title:aG().optional(),description:aG().optional(),minItems:ic().optional(),maxItems:ic().optional(),items:iE({type:iq("string"),enum:i$(aG())}),default:i$(aG()).optional()}),s7=iE({type:iq("array"),title:aG().optional(),description:aG().optional(),minItems:ic().optional(),maxItems:ic().optional(),items:iE({anyOf:i$(iE({const:aG(),title:aG()}))}),default:i$(aG()).optional()}),le=iO([s8,s7]),lt=iO([s4,s6,le]),lr=iO([lt,s1,s2,s9]),lo=nu.extend({mode:iq("form").optional(),message:aG(),requestedSchema:iE({type:iq("object"),properties:iI(aG(),lr),required:i$(aG()).optional()}).catchall(i_())}),la=nu.extend({mode:iq("url"),message:aG(),elicitationId:aG(),url:aG().url()}),li=iO([lo,la]),ln=nd.extend({method:iq("elicitation/create"),params:li}),ls=np.extend({elicitationId:aG()}),ll=nf.extend({method:iq("notifications/elicitation/complete"),params:ls}),lc=nm.extend({action:iA(["accept","decline","cancel"]),content:i2(e=>null===e?void 0:e,iI(aG(),iO([aG(),ic(),ih(),i$(aG())])).optional())}),lu=iE({type:iq("ref/resource"),uri:aG()}),ld=iE({type:iq("ref/prompt"),name:aG()}),lp=nc.extend({ref:iO([ld,lu]),argument:iE({name:aG(),value:aG()}),context:iE({arguments:iI(aG(),aG()).optional()}).optional()}),lf=nd.extend({method:iq("completion/complete"),params:lp}),lh=nm.extend({completion:iR({values:i$(aG()).max(100),total:iU(ic().int()),hasMore:iU(ih())})}),lm=iE({uri:aG().startsWith("file://"),name:aG().optional(),_meta:iI(aG(),i_()).optional()}),ly=nd.extend({method:iq("roots/list"),params:nc.optional()}),lg=nm.extend({roots:i$(lm)}),lv=nf.extend({method:iq("notifications/roots/list_changed"),params:np.optional()}),l_=iR({ttl:ic().optional(),pollInterval:ic().optional()}),lb=iA(["working","input_required","completed","failed","cancelled"]),lS=iE({taskId:aG(),status:lb,ttl:iO([ic(),iy()]),createdAt:aG(),lastUpdatedAt:aG(),pollInterval:iU(ic()),statusMessage:iU(aG())}),l$=nm.extend({task:lS}),lw=np.merge(lS),lE=nf.extend({method:iq("notifications/tasks/status"),params:lw}),lR=nd.extend({method:iq("tasks/get"),params:nc.extend({taskId:aG()})}),lP=nm.merge(lS),lO=nd.extend({method:iq("tasks/result"),params:nc.extend({taskId:aG()})}),lk=nm.loose(),lx=nB.extend({method:iq("tasks/list")}),lT=nJ.extend({tasks:i$(lS)}),lC=nd.extend({method:iq("tasks/cancel"),params:nc.extend({taskId:aG()})}),lj=nm.merge(lS),lI=iO([nV,nM,nD,lf,sU,sg,sh,n9,n5,n8,st,sr,si,sM,sC]),lN=iO([nR,nK,nL,lv]),lA=iO([nw,sQ,s0,lc,lg]),lM=iO([nV,sY,ln,ly]),lq=iO([nR,nK,sF,sd,se,sq,sO,ss,ll]),lz=iO([nw,nz,nU,lh,sP,sm,n3,n4,n7,sI,sj,sc]),lL="custom";M||(M={});let lD=ol(a1,void 0).superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:lL,message:"URL must be parseable",fatal:!0}),e0}).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"}),lU=iR({resource:aG().url(),authorization_servers:i$(lD).optional(),jwks_uri:aG().url().optional(),scopes_supported:i$(aG()).optional(),bearer_methods_supported:i$(aG()).optional(),resource_signing_alg_values_supported:i$(aG()).optional(),resource_name:aG().optional(),resource_documentation:aG().optional(),resource_policy_uri:aG().url().optional(),resource_tos_uri:aG().url().optional(),tls_client_certificate_bound_access_tokens:ih().optional(),authorization_details_types_supported:i$(aG()).optional(),dpop_signing_alg_values_supported:i$(aG()).optional(),dpop_bound_access_tokens_required:ih().optional()}),lV=iR({issuer:aG(),authorization_endpoint:lD,token_endpoint:lD,registration_endpoint:lD.optional(),scopes_supported:i$(aG()).optional(),response_types_supported:i$(aG()),response_modes_supported:i$(aG()).optional(),grant_types_supported:i$(aG()).optional(),token_endpoint_auth_methods_supported:i$(aG()).optional(),token_endpoint_auth_signing_alg_values_supported:i$(aG()).optional(),service_documentation:lD.optional(),revocation_endpoint:lD.optional(),revocation_endpoint_auth_methods_supported:i$(aG()).optional(),revocation_endpoint_auth_signing_alg_values_supported:i$(aG()).optional(),introspection_endpoint:aG().optional(),introspection_endpoint_auth_methods_supported:i$(aG()).optional(),introspection_endpoint_auth_signing_alg_values_supported:i$(aG()).optional(),code_challenge_methods_supported:i$(aG()).optional(),client_id_metadata_document_supported:ih().optional(),authorization_response_iss_parameter_supported:ih().optional().catch(void 0),dpop_signing_alg_values_supported:i$(aG()).optional()}),lF=iR({issuer:aG(),authorization_endpoint:lD,token_endpoint:lD,userinfo_endpoint:lD.optional(),jwks_uri:lD,registration_endpoint:lD.optional(),scopes_supported:i$(aG()).optional(),response_types_supported:i$(aG()),response_modes_supported:i$(aG()).optional(),grant_types_supported:i$(aG()).optional(),acr_values_supported:i$(aG()).optional(),subject_types_supported:i$(aG()),id_token_signing_alg_values_supported:i$(aG()),id_token_encryption_alg_values_supported:i$(aG()).optional(),id_token_encryption_enc_values_supported:i$(aG()).optional(),userinfo_signing_alg_values_supported:i$(aG()).optional(),userinfo_encryption_alg_values_supported:i$(aG()).optional(),userinfo_encryption_enc_values_supported:i$(aG()).optional(),request_object_signing_alg_values_supported:i$(aG()).optional(),request_object_encryption_alg_values_supported:i$(aG()).optional(),request_object_encryption_enc_values_supported:i$(aG()).optional(),token_endpoint_auth_methods_supported:i$(aG()).optional(),token_endpoint_auth_signing_alg_values_supported:i$(aG()).optional(),display_values_supported:i$(aG()).optional(),claim_types_supported:i$(aG()).optional(),claims_supported:i$(aG()).optional(),service_documentation:aG().optional(),claims_locales_supported:i$(aG()).optional(),ui_locales_supported:i$(aG()).optional(),claims_parameter_supported:ih().optional(),request_parameter_supported:ih().optional(),request_uri_parameter_supported:ih().optional(),require_request_uri_registration:ih().optional(),op_policy_uri:lD.optional(),op_tos_uri:lD.optional(),client_id_metadata_document_supported:ih().optional(),authorization_response_iss_parameter_supported:ih().optional().catch(void 0)}),lH=iE({...lF.shape,...lV.pick({code_challenge_methods_supported:!0}).shape}),lK=iE({access_token:aG(),id_token:aG().optional(),token_type:aG(),expires_in:new il(on({type:"number",coerce:!0,checks:[],...ej(void 0)})).optional(),scope:aG().optional(),refresh_token:aG().optional(),issuer:aG().optional().catch(void 0)}).strip(),lG=iE({issued_token_type:iq("urn:ietf:params:oauth:token-type:id-jag"),access_token:aG(),token_type:aG().optional(),expires_in:ic().optional(),scope:aG().optional()}).strip(),lB=iE({error:aG(),error_description:aG().optional(),error_uri:aG().optional()}),lJ=lD.optional().or(iq("").transform(()=>void 0)),lZ=iE({redirect_uris:i$(lD),token_endpoint_auth_method:aG().optional(),grant_types:i$(aG()).optional(),response_types:i$(aG()).optional(),application_type:aG().optional(),client_name:aG().optional(),client_uri:lD.optional(),logo_uri:lJ,scope:aG().optional(),contacts:i$(aG()).optional(),tos_uri:lJ,policy_uri:aG().optional(),jwks_uri:lD.optional(),jwks:new ig({type:"any"}).optional(),software_id:aG().optional(),software_version:aG().optional(),software_statement:aG().optional()}).strip(),lW=iE({client_id:aG(),client_secret:aG().optional(),client_id_issued_at:ic().optional(),client_secret_expires_at:ic().optional(),issuer:aG().optional().catch(void 0)}).strip(),lX=lZ.merge(lW),lY=iE({error:aG(),error_description:aG().optional()}).strip(),lQ=iE({token:aG(),token_type_hint:aG().optional()}).strip(),l0=Symbol.for("mcp.sdk.errorBrands");function l1(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,l0,{value:r,enumerable:!1,configurable:!0})}function l2(e,t){try{if("object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&"string"==typeof e.mcpBrand&&Object.prototype.hasOwnProperty.call(t,l0)){let r=t[l0];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 l2(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 l2(this,e)}constructor(e,t,r){super(t),this.code=e,this.errorUri=r,this.name="OAuthError",l1(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)}});(O={}).NotConnected="NOT_CONNECTED",O.AlreadyConnected="ALREADY_CONNECTED",O.NotInitialized="NOT_INITIALIZED",O.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",O.RequestTimeout="REQUEST_TIMEOUT",O.ConnectionClosed="CONNECTION_CLOSED",O.SendFailed="SEND_FAILED",O.InvalidResult="INVALID_RESULT",O.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",O.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",O.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",O.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",O.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",O.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",O.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",O.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",O.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",O.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",O.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION";var l9=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return l2(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 l2(this,e)}constructor(e,t,r,o){super(t,o),this.code=e,this.data=r,this.name="SdkError",l1(this,new.target)}};(class extends l9{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r,o){super(e,t,r,o),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}});let l3={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},l5={"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(l3),Object.keys(l5);Symbol("modelcontextprotocol.resultCacheHintFallback");let l4=((k={})[k.ParseError=-32700]="ParseError",k[k.InvalidRequest=-32600]="InvalidRequest",k[k.MethodNotFound=-32601]="MethodNotFound",k[k.InvalidParams=-32602]="InvalidParams",k[k.InternalError=-32603]="InternalError",k[k.ResourceNotFound=-32002]="ResourceNotFound",k[k.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",k[k.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",k[k.UrlElicitationRequired=-32042]="UrlElicitationRequired",k);var l6=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](e){return l2(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 l2(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="ProtocolError",l1(this,new.target)}static fromError(t,r,o){return t===l4.UrlElicitationRequired&&o&&o.elicitations?new l7(o.elicitations,r):t===l4.UnsupportedProtocolVersion&&o&&Array.isArray(o.supported)&&"string"==typeof o.requested?new ce({supported:o.supported,requested:o.requested},r):(t===l4.InvalidParams||t===l4.ResourceNotFound)&&"string"==typeof o?.uri&&(t===l4.ResourceNotFound||1===Object.keys(o).length)?new l8(o.uri,r):t===l4.MissingRequiredClientCapability&&o&&null!==o.requiredCapabilities&&"object"==typeof o.requiredCapabilities&&!Array.isArray(o.requiredCapabilities)?new ct({requiredCapabilities:o.requiredCapabilities},r):new e(t,r,o)}},l8=class extends l6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(l4.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},l7=class extends l6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(l4.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},ce=class extends l6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(l4.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},ct=class extends l6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(l4.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};let cr={"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},co={"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(cr),Object.keys(co);var ca=(e=>{let t={};for(var r in e)ea(t,r,{get:e[r],enumerable:!0});return t})({AnnotationsSchema:()=>n0,AudioContentSchema:()=>sb,BaseMetadataSchema:()=>nk,BaseRequestParamsSchema:()=>nc,BlobResourceContentsSchema:()=>nY,BooleanSchemaSchema:()=>s1,CallToolRequestParamsSchema:()=>sA,CallToolRequestSchema:()=>sM,CallToolResultSchema:()=>sI,CancelTaskRequestSchema:()=>lC,CancelTaskResultSchema:()=>lj,CancelledNotificationParamsSchema:()=>nE,CancelledNotificationSchema:()=>nR,ClientCapabilitiesSchema:()=>nN,ClientNotificationSchema:()=>lN,ClientRequestSchema:()=>lI,ClientResultSchema:()=>lA,ClientTasksCapabilitySchema:()=>nj,CompatibilityCallToolResultSchema:()=>sN,CompleteRequestParamsSchema:()=>lp,CompleteRequestSchema:()=>lf,CompleteResultSchema:()=>lh,ContentBlockSchema:()=>sE,CreateMessageRequestParamsSchema:()=>sX,CreateMessageRequestSchema:()=>sY,CreateMessageResultSchema:()=>sQ,CreateMessageResultWithToolsSchema:()=>s0,CreateTaskResultSchema:()=>l$,CursorSchema:()=>ni,DiscoverRequestSchema:()=>nD,DiscoverResultSchema:()=>nU,ElicitRequestFormParamsSchema:()=>lo,ElicitRequestParamsSchema:()=>li,ElicitRequestSchema:()=>ln,ElicitRequestURLParamsSchema:()=>la,ElicitResultSchema:()=>lc,ElicitationCompleteNotificationParamsSchema:()=>ls,ElicitationCompleteNotificationSchema:()=>ll,EmbeddedResourceSchema:()=>s$,EmptyResultSchema:()=>nw,EnumSchemaSchema:()=>lt,GetPromptRequestParamsSchema:()=>sy,GetPromptRequestSchema:()=>sg,GetPromptResultSchema:()=>sP,GetTaskPayloadRequestSchema:()=>lO,GetTaskPayloadResultSchema:()=>lk,GetTaskRequestSchema:()=>lR,GetTaskResultSchema:()=>lP,IconSchema:()=>nP,IconsSchema:()=>nO,ImageContentSchema:()=>s_,ImplementationSchema:()=>nx,InitializeRequestParamsSchema:()=>nA,InitializeRequestSchema:()=>nM,InitializeResultSchema:()=>nz,InitializedNotificationSchema:()=>nL,JSONArraySchema:()=>no,JSONObjectSchema:()=>nr,JSONRPCErrorResponseSchema:()=>nb,JSONRPCMessageSchema:()=>nS,JSONRPCNotificationSchema:()=>nv,JSONRPCRequestSchema:()=>ng,JSONRPCResponseSchema:()=>n$,JSONRPCResultResponseSchema:()=>n_,JSONValueSchema:()=>nt,LegacyTitledEnumSchemaSchema:()=>s4,ListChangedOptionsBaseSchema:()=>sz,ListPromptsRequestSchema:()=>sh,ListPromptsResultSchema:()=>sm,ListResourceTemplatesRequestSchema:()=>n5,ListResourceTemplatesResultSchema:()=>n4,ListResourcesRequestSchema:()=>n9,ListResourcesResultSchema:()=>n3,ListRootsRequestSchema:()=>ly,ListRootsResultSchema:()=>lg,ListTasksRequestSchema:()=>lx,ListTasksResultSchema:()=>lT,ListToolsRequestSchema:()=>sC,ListToolsResultSchema:()=>sj,LoggingLevelSchema:()=>sL,LoggingMessageNotificationParamsSchema:()=>sV,LoggingMessageNotificationSchema:()=>sF,ModelHintSchema:()=>sH,ModelPreferencesSchema:()=>sK,MultiSelectEnumSchemaSchema:()=>le,NotificationSchema:()=>nf,NotificationsParamsSchema:()=>np,NumberSchemaSchema:()=>s9,PaginatedRequestParamsSchema:()=>nG,PaginatedRequestSchema:()=>nB,PaginatedResultSchema:()=>nJ,PingRequestSchema:()=>nV,PrimitiveSchemaDefinitionSchema:()=>lr,ProgressNotificationParamsSchema:()=>nH,ProgressNotificationSchema:()=>nK,ProgressSchema:()=>nF,ProgressTokenSchema:()=>na,PromptArgumentSchema:()=>sp,PromptListChangedNotificationSchema:()=>sO,PromptMessageSchema:()=>sR,PromptReferenceSchema:()=>ld,PromptSchema:()=>sf,ReadResourceRequestParamsSchema:()=>n6,ReadResourceRequestSchema:()=>n8,ReadResourceResultSchema:()=>n7,RelatedTaskMetadataSchema:()=>ns,RequestIdSchema:()=>ny,RequestMetaSchema:()=>nl,RequestSchema:()=>nd,ResourceContentsSchema:()=>nZ,ResourceLinkSchema:()=>sw,ResourceListChangedNotificationSchema:()=>se,ResourceRequestParamsSchema:()=>n6,ResourceSchema:()=>n1,ResourceTemplateReferenceSchema:()=>lu,ResourceTemplateSchema:()=>n2,ResourceUpdatedNotificationParamsSchema:()=>su,ResourceUpdatedNotificationSchema:()=>sd,ResultMetaObjectSchema:()=>nh,ResultSchema:()=>nm,RoleSchema:()=>nQ,RootSchema:()=>lm,RootsListChangedNotificationSchema:()=>lv,SamplingContentSchema:()=>sJ,SamplingMessageContentBlockSchema:()=>sZ,SamplingMessageSchema:()=>sW,ServerCapabilitiesSchema:()=>nq,ServerNotificationSchema:()=>lq,ServerRequestSchema:()=>lM,ServerResultSchema:()=>lz,ServerTasksCapabilitySchema:()=>nI,SetLevelRequestParamsSchema:()=>sD,SetLevelRequestSchema:()=>sU,SingleSelectEnumSchemaSchema:()=>s6,StringSchemaSchema:()=>s2,SubscribeRequestParamsSchema:()=>n6,SubscribeRequestSchema:()=>st,SubscriptionFilterSchema:()=>so,SubscriptionsAcknowledgedNotificationParamsSchema:()=>sn,SubscriptionsAcknowledgedNotificationSchema:()=>ss,SubscriptionsListenRequestParamsSchema:()=>sa,SubscriptionsListenRequestSchema:()=>si,SubscriptionsListenResultMetaSchema:()=>sl,SubscriptionsListenResultSchema:()=>sc,TaskAugmentedRequestParamsSchema:()=>nu,TaskCreationParamsSchema:()=>l_,TaskMetadataSchema:()=>nn,TaskSchema:()=>lS,TaskStatusNotificationParamsSchema:()=>lw,TaskStatusNotificationSchema:()=>lE,TaskStatusSchema:()=>lb,TextContentSchema:()=>sv,TextResourceContentsSchema:()=>nW,TitledMultiSelectEnumSchemaSchema:()=>s7,TitledSingleSelectEnumSchemaSchema:()=>s5,ToolAnnotationsSchema:()=>sk,ToolChoiceSchema:()=>sG,ToolExecutionSchema:()=>sx,ToolListChangedNotificationSchema:()=>sq,ToolResultContentSchema:()=>sB,ToolSchema:()=>sT,ToolUseContentSchema:()=>sS,UnsubscribeRequestParamsSchema:()=>n6,UnsubscribeRequestSchema:()=>sr,UntitledMultiSelectEnumSchemaSchema:()=>s8,UntitledSingleSelectEnumSchemaSchema:()=>s3});let ci=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&"input_required"===e.resultType;l4.InvalidRequest,l4.UnsupportedProtocolVersion,l4.InvalidParams,l4.MethodNotFound,l4.InvalidParams,l4.MissingRequiredClientCapability;l4.ParseError,l4.InvalidRequest,l4.MethodNotFound,l4.UnsupportedProtocolVersion,l4.MissingRequiredClientCapability;function cn(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function cs(e){if(null==e)return!1;let t=typeof e;return("object"===t||"function"===t)&&"~standard"in e&&"function"==typeof e["~standard"]?.validate}let cl=!1,cc="draft-2020-12",cu=/^#\/(\$defs|definitions)\/([^/~%]+)$/,cd=/\\\.\\d\{(\d+)\}/;function cp(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let cf=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function ch(e){return cf.has(e)||e.startsWith("x-")}let cm=new Set(["$schema",...Object.keys(lo.shape.requestedSchema.shape)]),cy={string:cn([s2,s3,s5,s4]),number:cn([s9]),integer:cn([s9]),boolean:cn([s1]),array:cn([s8,s7])},cg=new Set(s2.shape.format.unwrap().options),cv=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(!cs(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&&cp(i)?r[a]=Object.fromEntries(Object.entries(i).map(([e,r])=>[e,function(e,t,r,o){if(!cp(e))return e;let a="string"==typeof e.type&&Object.hasOwn(cy,e.type)?cy[e.type]:void 0;if(void 0===a)return e;let i={};for(let[l,c]of Object.entries(e))if(a.has(l)||ch(l))i[l]=c;else if("pattern"===l&&"string"===e.type&&"string"==typeof e.format)if(cg.has(e.format)){var n,s;"string"==typeof c&&(n=e.format,s=c,"zod"!==r||(function(e,t){let r;switch(e){case"email":r=[os(aY,void 0)];break;case"uri":r=[ol(a1,void 0)];break;case"date":r=[ou(aZ,void 0)];break;case"date-time":var o;let a,i;o=t,a=cd.exec(o),i=[void 0,-1,0],a&&i.push(Number(a[1])),r=[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>i.map(r=>oc(aJ,{local:e,offset:t,precision:r}))))}return new Set(r.map(e=>{let t;return t=af(e,{target:cc,io:"input"}),"string"==typeof t.pattern?t.pattern:void 0}).filter(e=>void 0!==e))})(n,s).has(s))||o.push(`${t}.${l}`)}else i[l]=c;else o.push(`${t}.${l}`);return i}(r,`properties.${e}`,t,o)])):cm.has(a)?r[a]=i:ch(a)||o.push(a);if(o.length>0)throw new l6(l4.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:cc});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().");cl||(cl=!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=af(e,{target:cc,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,r=t){if("properties"in t||"patternProperties"in t||"additionalProperties"in t||"required"in t)return!0;let o="string"==typeof t.$ref&&cu.exec(t.$ref);if(o&&r[o[1]]?.[o[2]]?.type==="object")return!0;for(let o of["oneOf","anyOf","allOf"]){let a=t[o];if(Array.isArray(a)&&a.length>0)return a.every(t=>null!==t&&"object"==typeof t&&("object"===t.type||e(t,"$id"in t?{}:r)))}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 l6(l4.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${e}`)}}(e.requestedSchema),r),a=(t=lo.shape.requestedSchema,aj(t,o));if(!a.success)throw new l6(l4.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(e,t){if(!cp(e.properties))return t;let r=Object.entries(e.properties).filter(([,e])=>!aj(lr,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}]`)):cp(t)&&cp(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):ch(t)?[]:[i]}):[]}(o,a.data);if(i.length>0)throw new l6(l4.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(", ")}`);let n=(a.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(a.data.properties,e));if(n.length>0)throw new l6(l4.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${n.join(", ")}`);return{...e,mode:"form",requestedSchema:a.data}}(e)}}catch(e){throw e instanceof l6?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 c_(e,t,r){let o=cb(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 cb(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 cS={},c$={};function cw(e,t){let r=e.slice(0,-6);cS[r]=t,c$[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"])cw(e,ca[e]);for(let[e,t]of Object.entries({IdJagTokenExchangeResponseSchema:lG,OAuthClientInformationFullSchema:lX,OAuthClientInformationSchema:lW,OAuthClientMetadataSchema:lZ,OAuthClientRegistrationErrorSchema:lY,OAuthErrorResponseSchema:lB,OAuthMetadataSchema:lV,OAuthProtectedResourceMetadataSchema:lU,OAuthTokenRevocationRequestSchema:lQ,OAuthTokensSchema:lK,OpenIdProviderDiscoveryMetadataSchema:lH,OpenIdProviderMetadataSchema:lF}))cw(e,t);Object.freeze(cS),Object.freeze(c$);x=void 0,()=>x;(ec(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,n,s,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;n=t.exec(l);){if(n.index!==c)throw TypeError("invalid parameter format");c+=n[0].length,i=n[1].toLowerCase(),34===(s=n[2]).charCodeAt(0)&&-1!==(s=s.slice(1,-1)).indexOf("\\")&&(s=s.replace(r,"$1")),d.parameters[i]=s}if(c!==l.length)throw TypeError("invalid parameter format")}return d}}))();var cE=ec(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;)s(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 n(e,...t){let a=[l(e[0])],c=0;for(;c<t.length;)a.push(i),s(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 s(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=n,e.addCodeArg=s,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:n`${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())}}),cR=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=cE();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 n=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=n;let s=(0,t._)`\n`;var l=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new n(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,n=this._values[a];if(n){let e=n.get(i);if(e)return e}else n=this._values[a]=new Map;n.set(i,o);let s=this._scope[a]||(this._scope[a]=[]),l=s.length;return s[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,n={},s){let l=t.nil;for(let c in r){let u=r[c];if(!u)continue;let d=n[c]=n[c]||new Map;u.forEach(r=>{if(d.has(r))return;d.set(r,o.Started);let n=i(r);if(n){let o=this.opts.es5?e.varKinds.var:e.varKinds.const;l=(0,t._)`${l}${o} ${r} = ${n};${this.opts._n}`}else if(n=null==s?void 0:s(r))l=(0,t._)`${l}${n}${this.opts._n}`;else throw new a(r);d.set(r,o.Completed)})}return l}};e.ValueScope=l}),cP=ec(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=cE(),r=cR();var o=cE();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=cR();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}},n=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=T(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=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=T(this.rhs,e,r),this}get names(){return x(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},l=class extends s{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=T(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},f=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)=>k(e,t.names),{})}},h=class extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},m=class extends f{},y=class extends h{};y.kind="else";var g=class e extends h{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(C(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=T(this.condition,e,t),this}get names(){let e=super.names;return x(e,this.condition),this.else&&k(e,this.else.names),e}};g.kind="if";var v=class extends h{};v.kind="for";var _=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=T(this.iteration,e,t),this}get names(){return k(super.names,this.iteration.names)}},b=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 x(x(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=T(this.iterable,e,t),this}get names(){return k(super.names,this.iterable.names)}},$=class extends h{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 f{render(e){return"return "+super.render(e)}};w.kind="return";var E=class extends h{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&&k(e,this.catch.names),this.finally&&k(e,this.finally.names),e}},R=class extends h{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};R.kind="catch";var P=class extends h{render(e){return"finally"+super.render(e)}};P.kind="finally";var O=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 n(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 s(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 _(e),t)}forRange(e,t,o,a,i=this.opts.es5?r.varKinds.var:r.varKinds.let){let n=this._scope.toName(e);return this._for(new b(i,n,t,o),()=>a(n))}forOf(e,o,a,i=r.varKinds.const){let n=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(n,(0,t._)`${e}[${r}]`),a(n)})}return this._for(new S("of",i,n,o),()=>a(n))}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 n=this._scope.toName(e);return this._for(new S("in",i,n,o),()=>a(n))}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 k(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function x(e,r){return r instanceof t._CodeOrName?k(e,r.names):e}function T(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 C(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,t._)`!${A(e)}`}e.CodeGen=O,e.not=C;let j=N(e.operators.AND);e.and=function(...e){return e.reduce(j)};let I=N(e.operators.OR);function N(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(I)}}),cO=ec(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=cP(),a=cE();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]||f(e,`unknown keyword: "${r}"`)}function n(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function s(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,n,s,l)=>{let c=void 0===s?n:s instanceof o.Name?(n instanceof o.Name?e(i,n,s):t(i,n,s),s):n instanceof o.Name?(t(i,s,n),n):r(n,s);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),!n(t,e.self.RULES.all))},e.checkUnknownRules=i,e.schemaHasRules=n,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(s(e))},e.escapeJsonPointer=s,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 f(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():"/"+s(e)},e.checkStrictMode=f}),ck=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP();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")}}),cx=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=cP(),r=cO(),o=ck();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,n,l){let{it:c}=r,{gen:u,compositeRule:d,allErrors:p}=c,f=s(r,o,n);(null!=l?l:d||p)?a(u,f):i(c,(0,t._)`[${f}]`)},e.reportExtraError=function(t,r=e.keywordError,n){let{it:l}=t,{gen:c,compositeRule:u,allErrors:d}=l;a(c,s(t,r,n)),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:n,it:s}){if(void 0===n)throw Error("ajv implementation error");let l=e.name("err");e.forRange("i",n,o.default.errors,n=>{e.const(l,(0,t._)`${o.default.vErrors}[${n}]`),e.if((0,t._)`${l}.instancePath === undefined`,()=>e.assign((0,t._)`${l}.instancePath`,(0,t.strConcat)(o.default.instancePath,s.errorPath))),e.assign((0,t._)`${l}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${r}`),s.opts.verbose&&(e.assign((0,t._)`${l}.schema`,a),e.assign((0,t._)`${l}.data`,i))})};let n={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 s(e,a,i){let{createErrors:s}=e.it;return!1===s?(0,t._)`{}`:function(e,a,i={}){let{gen:s,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 s=i?o:(0,t.str)`${o}/${e}`;return a&&(s=(0,t.str)`${s}${(0,r.getErrorPath)(a,r.Type.Str)}`),[n.schemaPath,s]}(e,i)];return function(e,{params:r,message:a},i){let{keyword:s,data:l,schemaValue:c,it:u}=e,{opts:d,propertyName:p,topSchemaRef:f,schemaPath:h}=u;i.push([n.keyword,s],[n.params,"function"==typeof r?r(e):r||(0,t._)`{}`]),d.messages&&i.push([n.message,"function"==typeof a?a(e):a]),d.verbose&&i.push([n.schema,c],[n.parentSchema,(0,t._)`${f}${h}`],[o.default.data,l]),p&&i.push([n.propertyName,p])}(e,a,c),s.object(...c)}(e,a,i)}}),cT=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=cx(),r=cP(),o=ck(),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:n}=e;!1===a?i(e,!1):"object"==typeof a&&!0===a.$async?t.return(o.default.data):(t.assign((0,r._)`${n}.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)}}),cC=ec(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:{}}}}),cj=ec(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}),cI=ec(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=cC(),a=cj(),i=cx(),n=cP(),s=cO();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:s,data:l,opts:u}=e,p=(o=r,(i=u.coerceTypes)?o.filter(e=>c.has(e)||"array"===i&&"array"===e):[]),h=r.length>0&&!(0===p.length&&1===r.length&&(0,a.schemaHasRulesForType)(e,r[0]));if(h){let o=d(r,l,u.strictNumbers,t.Wrong);s.if(o,()=>{p.length?function(e,t,r){let{gen:o,data:a,opts:i}=e,s=o.let("dataType",(0,n._)`typeof ${a}`),l=o.let("coerced",(0,n._)`undefined`);for(let e of("array"===i.coerceTypes&&o.if((0,n._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>o.assign(a,(0,n._)`${a}[0]`).assign(s,(0,n._)`typeof ${a}`).if(d(t,a,i.strictNumbers),()=>o.assign(l,a))),o.if((0,n._)`${l} !== undefined`),r))(c.has(e)||"array"===e&&"array"===i.coerceTypes)&&function(e){switch(e){case"string":o.elseIf((0,n._)`${s} == "number" || ${s} == "boolean"`).assign(l,(0,n._)`"" + ${a}`).elseIf((0,n._)`${a} === null`).assign(l,(0,n._)`""`);return;case"number":o.elseIf((0,n._)`${s} == "boolean" || ${a} === null
|
|
61
61
|
|| (${s} == "string" && ${a} && ${a} == +${a})`).assign(l,(0,n._)`+${a}`);return;case"integer":o.elseIf((0,n._)`${s} === "boolean" || ${a} === null
|
|
62
62
|
|| (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(l,(0,n._)`+${a}`);return;case"boolean":o.elseIf((0,n._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(l,!1).elseIf((0,n._)`${a} === "true" || ${a} === 1`).assign(l,!0);return;case"null":o.elseIf((0,n._)`${a} === "" || ${a} === 0 || ${a} === false`),o.assign(l,null);return;case"array":o.elseIf((0,n._)`${s} === "string" || ${s} === "number"
|
|
63
|
-
|| ${s} === "boolean" || ${a} === null`).assign(l,(0,n._)`[${a}]`)}}(e);o.else(),f(e),o.endIf(),o.if((0,n._)`${l} !== undefined`,()=>{o.assign(a,l),function({gen:e,parentData:t,parentDataProperty:r},o){e.if((0,n._)`${t} !== undefined`,()=>e.assign((0,n._)`${t}[${r}]`,o))}(e,l)})}(e,r,p):f(e)})}return h};let c=new Set(["string","number","integer","boolean","null"]);function u(e,r,o,a=t.Correct){let i,s=a===t.Correct?n.operators.EQ:n.operators.NEQ;switch(e){case"null":return(0,n._)`${r} ${s} null`;case"array":i=(0,n._)`Array.isArray(${r})`;break;case"object":i=(0,n._)`${r} && typeof ${r} == "object" && !Array.isArray(${r})`;break;case"integer":i=l((0,n._)`!(${r} % 1) && !isNaN(${r})`);break;case"number":i=l();break;default:return(0,n._)`typeof ${r} ${s} ${e}`}return a===t.Correct?i:(0,n.not)(i);function l(e=n.nil){return(0,n.and)((0,n._)`typeof ${r} == "number"`,e,o?(0,n._)`isFinite(${r})`:n.nil)}}function d(e,t,r,o){let a;if(1===e.length)return u(e[0],t,r,o);let i=(0,s.toHash)(e);if(i.array&&i.object){let e=(0,n._)`typeof ${t} != "object"`;a=i.null?e:(0,n._)`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else a=n.nil;for(let e in i.number&&delete i.integer,i)a=(0,n.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,n._)`{type: ${e}}`:(0,n._)`{type: ${t}}`};function f(e){let t=function(e){let{gen:t,data:r,schema:o}=e,a=(0,s.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=f}),cP=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=cv(),r=c_();function o(e,o,a){let{gen:i,compositeRule:n,data:s,opts:l}=e;if(void 0===a)return;let c=(0,t._)`${s}${(0,t.getProperty)(o)}`;if(n)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))}}),ck=eo(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=cv(),r=c_(),o=cb(),a=c_();function i(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}function n(e,r,o){return(0,t._)`${i(e)}.call(${r}, ${o})`}function s(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} === undefined`;return a?(0,t.or)(i,(0,t.not)(n(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(s(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)(s(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=n,e.propertyInData=function(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} !== undefined`;return a?(0,t._)`${i} && ${n(e,r,o)}`:i},e.noPropertyInData=s,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:n,errorPath:s},it:l},c,u,d){let p=d?(0,t._)`${e}, ${r}, ${i}${n}`:r,f=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,s)],[o.default.parentData,l.parentData],[o.default.parentDataProperty,l.parentDataProperty],[o.default.rootData,o.default.rootData]];l.opts.dynamicRef&&f.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let h=(0,t._)`${p}, ${a.object(...f)}`;return u!==t.nil?(0,t._)`${c}.call(${u}, ${h})`:(0,t._)`${c}(${h})`};let c=(0,t._)`new RegExp`;e.usePattern=function({gen:e,it:{opts:r}},o){let i=r.unicodeRegExp?"u":"",{regExp:n}=r.code,s=n(o,i);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,t._)`${"new RegExp"===n.code?c:(0,a.useFunc)(e,n)}(${o}, ${i})`})},e.validateArray=function(e){let{gen:o,data:a,keyword:i,it:n}=e,s=o.name("valid");if(n.allErrors){let e=o.let("valid",!0);return l(()=>o.assign(e,!1)),e}return o.var(s,!0),l(()=>o.break()),s;function l(n){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},s),o.if((0,t.not)(s),n)})}},e.validateUnion=function(e){let{gen:o,schema:a,keyword:i,it:n}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(a.some(e=>(0,r.alwaysValidSchema)(n,e))&&!n.opts.unevaluated)return;let s=o.let("valid",!1),l=o.name("_valid");o.block(()=>a.forEach((r,a)=>{let n=e.subschema({keyword:i,schemaProp:a,compositeRule:!0},l);o.assign(s,(0,t._)`${s} || ${l}`),e.mergeValidEvaluated(n,l)||o.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}}),cO=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=cv(),r=cb(),o=ck(),a=cS();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 n(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:s,it:l}=e,c=r.macro.call(l.self,i,s,l),u=n(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,s){var l;let{gen:c,keyword:u,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,s);let m=n(c,u,!f&&s.compile?s.compile.call(h.self,d,p,h):s.validate),y=c.let("valid");function g(a=s.async?(0,t._)`await `:t.nil){let i=h.opts.passContext?r.default.this:r.default.self,n=!("compile"in s&&!f||!1===s.schema);c.assign(y,(0,t._)`${a}${(0,o.callValidateCode)(e,m,i,n)}`,s.modifying)}function v(e){var r;c.if((0,t.not)(null!=(r=s.valid)?r:y),e)}e.block$data(y,function(){if(!1===s.errors)g(),s.modifying&&i(e),v(()=>e.error());else{let o,n,l=s.async?(o=c.let("ruleErrs",null),c.try(()=>g((0,t._)`await `),e=>c.assign(y,!1).if((0,t._)`${e} instanceof ${h.ValidationError}`,()=>c.assign(o,(0,t._)`${e}.errors`),()=>c.throw(e))),o):(n=(0,t._)`${m}.errors`,c.assign(n,null),g(t.nil),n);s.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=s.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 n=a.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(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)}}}),cx=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=cv(),r=c_();e.getSubschema=function(e,{keyword:o,schemaProp:a,schema:i,schemaPath:n,errSchemaPath:s,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===n||void 0===s||void 0===l)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:l,errSchemaPath:s}}throw Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(e,o,{dataProp:a,dataPropType:i,data:n,dataTypes:s,propertyName:l}){if(void 0!==n&&void 0!==a)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=o;if(void 0!==a){let{errorPath:n,dataPathArr:s,opts:l}=o;u(c.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0)),e.errorPath=(0,t.str)`${n}${(0,r.getErrorPath)(a,i,l.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${a}`,e.dataPathArr=[...s,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!==n&&(u(n instanceof t.Name?n:c.let("data",n,!0)),void 0!==l&&(e.propertyName=l)),s&&(e.dataTypes=s)},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}}),cT=eo((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,n=i[a];if(!e(t[n],r[n]))return!1}return!0}return t!=t&&r!=r}}),cj=eo((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,n,s,l,c,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in o(i,n,s,l,c,u,d),i){var f=i[p];if(Array.isArray(f)){if(p in r.arrayKeywords)for(var h=0;h<f.length;h++)e(t,o,a,f[h],n+"/"+p+"/"+h,s,n,p,i,h)}else if(p in r.propsKeywords){if(f&&"object"==typeof f)for(var m in f)e(t,o,a,f[m],n+"/"+p+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),s,n,p,i,m)}else(p in r.keywords||t.allKeys&&!(p in r.skipKeywords))&&e(t,o,a,f,n+"/"+p,s,n,p,i)}a(i,n,s,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}}),cC=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=c_(),r=cT(),o=cj(),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)),1/0===o)))return 1/0;return o}(e)<=r)};let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function n(e,t="",r){return!1!==r&&(t=c(t)),s(e,e.parse(t))}function s(e,t){return e.serialize(t).split("#")[0]+"#"}e.getFullPath=n,e._getFullPath=s;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,s=c(e[a]||t),l={"":s},d=n(i,s,!1),p={},f=new Set;return o(e,{allKeys:!0},(e,t,r,o)=>{if(void 0===o)return;let i=d+t,n=l[o];function s(t){let r=this.opts.uriResolver.resolve;if(t=c(n?r(n,t):t),f.has(t))throw m(t);f.add(t);let o=this.refs[t];return"string"==typeof o&&(o=this.refs[o]),"object"==typeof o?h(e,o.schema,t):t!==c(i)&&("#"===t[0]?(h(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}"`);s.call(this,`#${e}`)}}"string"==typeof e[a]&&(n=s.call(this,e[a])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),l[t]=n}),p;function h(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`)}}}),cI=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=c$(),r=cR(),o=cE(),a=cR(),i=cP(),n=cO(),s=cx(),l=cv(),c=cb(),u=cC(),d=c_(),p=cS();function f({gen:e,validateName:t,schema:r,schemaEnv:o,opts:a},i){var n;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"; ${h(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}, ${(n=a,(0,l._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${n.dynamicRef?(0,l._)`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`)}`,o.$async,()=>e.code(h(r,a)).code(i))}function h(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 b(e,[],!1,t);let o=(0,r.getSchemaTypes)(e.schema);b(e,o,!(0,r.coerceAndCheckDataType)(e,o),t)}function _({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 b(e,t,r,i){var n,s,u,p;let{gen:f,schema:h,data:m,allErrors:y,opts:g,self:v}=e,{RULES:_}=v;if(h.$ref&&(g.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(h,_)))return void f.block(()=>R(e,"$ref",_.all.$ref.definition));function b(n){(0,o.shouldUseGroup)(h,n)&&(n.type?(f.if((0,a.checkDataType)(n.type,m,g.strictNumbers)),S(e,n),1===t.length&&t[0]===n.type&&r&&(f.else(),(0,a.reportTypeError)(e)),f.endIf()):S(e,n),y||f.if((0,l._)`${c.default.errors} === ${i||0}`))}g.jtd||(n=e,s=t,!n.schemaEnv.meta&&n.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)}}(n,s),n.opts.allowUnionTypes||(u=n,(p=s).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}"`)}}}(n,n.dataTypes))),f.block(()=>{for(let e of _.rules)b(e);b(_.post)})}function S(e,t){let{gen:r,schema:a,opts:{useDefaults:n}}=e;n&&(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;f(e,()=>{r.$comment&&t.$comment&&_(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):f(e,()=>(0,t.topBoolOrEmptySchema)(e))};var E=class{constructor(e,t,r){if((0,n.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",O(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,n.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,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(o,this.it,e),(0,s.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:n}=e;n.$comment&&a.$comment&&_(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 s=i.const("_errs",c.default.errors);v(e,s),i.var(t,(0,l._)`${s} === ${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,n.funcKeywordCode)(a,r):"macro"in r?(0,n.macroKeywordCode)(a,r):(r.compile||r.validate)&&(0,n.funcKeywordCode)(a,r)}e.KeywordCxt=E;let P=/^\/(?:[^~]|~0|~1)*$/,k=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function O(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 n=k.exec(e);if(!n)throw Error(`Invalid JSON-pointer: ${e}`);let l=+n[1];if("#"===(a=n[2])){if(l>=t)throw Error(s("property/index",l));return o[t-l]}if(l>t)throw Error(s("data",l));if(i=r[t-l],!a)return i}let n=i;for(let e of a.split("/"))e&&(i=(0,l._)`${i}${(0,l.getProperty)((0,d.unescapeJsonPointer)(e))}`,n=(0,l._)`${n} && ${i}`);return n;function s(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}e.getData=O}),cN=eo(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}}}),cA=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cC();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))}}}),cM=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=cv(),r=cN(),o=cb(),a=cC(),i=c_(),n=cI();var s=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,s,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:f}=this.opts,h=new t.CodeGen(this.scope,{es5:d,lines:p,ownProperties:f});e.$async&&(i=h.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=h.scopeName("validate");e.validateName=m;let y={gen:h,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:h.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,n.validateFunctionCode)(y),h.optimize(this.opts.code.optimize);let r=h.toString();s=`${h.scopeRefs(o.default.scope)}return ${r}`,this.opts.code.process&&(s=this.opts.code.process(s,e));let a=Function(`${o.default.self}`,`${o.default.scope}`,s)(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:h._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,s&&this.logger.error("Error compiling schema, function code:",s),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 h.call(this,r,e);let n=(0,a.normalizeId)(o),c=this.refs[n]||this.schemas[n];if("string"==typeof c){let t=p.call(this,e,c);if("object"!=typeof(null==t?void 0:t.schema))return;return h.call(this,r,t)}if("object"==typeof(null==c?void 0:c.schema)){if(c.validate||l.call(this,c),n===(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 s({schema:t,schemaId:r,root:e,baseId:i})}return h.call(this,r,c)}}e.SchemaEnv=s,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 n=d.call(this,e,r);if(void 0===n){let a=null==(o=e.localRefs)?void 0:o[r],{schemaId:i}=this.opts;a&&(n=new s({schema:a,schemaId:i,root:e,baseId:t}))}if(void 0!==n)return e.refs[r]=c.call(this,n)},e.getCompilingSchema=u,e.resolveSchema=p;let f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,{baseId:t,schema:r,root:o}){var n;let l;if((null==(n=e.fragment)?void 0:n[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 n="object"==typeof(r=e)&&r[this.opts.schemaId];!f.has(o)&&n&&(t=(0,a.resolveUrl)(this.opts.uriResolver,t,n))}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 s({schema:r,schemaId:c,root:o,baseId:t})).schema!==l.root.schema)return l}}),cq=eo((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}}),cz=eo((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),a=RegExp.prototype.test.bind(/^\d*$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),n=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),s=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),l=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),c=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),u=Array(256);{let e="0123456789ABCDEF";for(let t=0;t<256;t++)u[t]="%"+e[t>>4]+e[15&t]}function d(e){return e<2048?u[192|e>>6]+u[128|63&e]:e<65536?u[224|e>>12]+u[128|e>>6&63]+u[128|63&e]:u[240|e>>18]+u[128|e>>12&63]+u[128|e>>6&63]+u[128|63&e]}let p=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),f=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),h=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),m=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function y(e){let t=-1,r=0,o=-1,a=0;for(let i=0;i<e.length;i++)"0"===e[i]?(-1===o&&(o=i),++a>r&&(r=a,t=o)):(o=-1,a=0);return r<2?e.join(":"):e.slice(0,t).join(":")+"::"+e.slice(t+r).join(":")}function g(e){let t="["===e[0]&&"]"===e[e.length-1];if(("["===e[0]||"]"===e[e.length-1])&&!t)return{host:e,isIPV6:!1,error:!0};let r=t?e.slice(1,-1):e;if(t&&f(r))return r=r.toLowerCase(),{host:`[${r}]`,escapedHost:r,isIPV6:!1,isIPVFuture:!0};if(2>function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(r))return{host:e,isIPV6:!1,error:t};let a="",n=r.indexOf("%");if(-1!==n){let t="%25"===r.slice(n,n+3).toLowerCase()?3:1;if(!function(e){if(0===e.length)return!1;for(let t=0;t<e.length;t++)if(!h(e[t])){if("%"===e[t]&&t+2<e.length&&i(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}(a=r.slice(n+t)))return{host:e,isIPV6:!1,error:!0};r=r.slice(0,n)}let s=function(e){let t=e.indexOf("::");if(-1!==t&&-1!==e.indexOf("::",t+1))return;let r=-1===t?e.split(":"):e.slice(0,t).split(":"),a=-1===t?[]:e.slice(t+2).split(":");-1!==t&&(1===r.length&&""===r[0]&&(r.length=0),1===a.length&&""===a[0]&&(a.length=0));let i=r.concat(a),n=0;for(let e=0;e<i.length;e++){let r=i[e];if(""===r)return;if(-1!==r.indexOf(".")){if(e!==i.length-1||-1!==t&&0===a.length||!o(r))return;n+=2;continue}if(!p(r))return;i[e]=parseInt(r,16).toString(16),n++}if(-1===t){if(8!==n)return;return y(i)}if(n>=8)return;let s=i.slice(0,r.length);for(let e=n;e<8;e++)s.push("0");for(let e=r.length;e<i.length;e++)s.push(i[e]);return y(s)}(r);return void 0===s?{host:e,isIPV6:!1,error:!0}:{host:s+(a?"%"+a:""),escapedHost:s+(a?"%25"+a:""),isIPV6:!0}}let v={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},_=/[@/?#:]/g,b=/[@/?#]/g;function S(e,t){let r=t?b:_;return r.lastIndex=0,e.replace(r,e=>v[e])}function $(e,t=!1){if(-1===e.indexOf("%"))return e;let r="";for(let o=0;o<e.length;o++){if("%"===e[o]&&o+2<e.length){let a=e.slice(o+1,o+3);if(i(a)){let e=a.toUpperCase(),i=String.fromCharCode(parseInt(e,16));t&&n(i)?r+=i:r+="%"+e,o+=2;continue}}r+=e[o]}return r}function w(e,t){let r="";for(let o=0;o<e.length;o++){let a=e[o];if("%"===a&&o+2<e.length){let t=e.slice(o+1,o+3);if(i(t)){r+="%"+t.toUpperCase(),o+=2;continue}}if(t(a))r+=a;else{let t=e.charCodeAt(o);if(t<128)r+=u[t];else if(t<55296||t>57343)r+=d(t);else if(t<=56319&&o+1<e.length){let a=e.charCodeAt(o+1);a>=56320&&a<=57343?(r+=d(65536+(t-55296<<10)+(a-56320)),o++):r+=d(65533)}else r+=d(65533)}}return r}function E(e){return w(e,c)}function R(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||42===e||43===e||45===e||46===e||47===e||64===e||95===e}t.exports={nonSimpleDomain:m,recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(E(e.userinfo)),t.push("@")),void 0!==e.host){let r=e.host;if(!o(r)){let e=g(r);!0!==e.isIPV6&&!0!==e.isIPVFuture&&(e=g(r=$(r,!0))),r=!0===e.isIPV6||!0===e.isIPVFuture?`[${e.escapedHost}]`:S(r,!1)}t.push(r)}if("number"==typeof e.port||"string"==typeof e.port){let r=String(e.port);if(!a(r))throw TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0},reescapeHostDelimiters:S,normalizePercentEncoding:$,normalizePathEncoding:function(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];if("%"===o&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),a=String.fromCharCode(parseInt(e,16));"."!==a&&n(a)?t+=a:t+="%"+e,r+=2;continue}}if(s(o))t+=o;else{let a=e.charCodeAt(r);if(a<128)t+=R(a)?o:u[a];else if(a<55296||a>57343)t+=d(a);else if(a<=56319&&r+1<e.length){let o=e.charCodeAt(r+1);o>=56320&&o<=57343?(t+=d(65536+(a-55296<<10)+(o-56320)),r++):t+=d(65533)}else t+=d(65533)}}return t},serializePathEncoding:function(e,t=!1){let r="",o=t&&"/"!==e[0];for(let t=0;t<e.length;t++){let a=e[t];if("%"===a&&t+2<e.length){let o=e.slice(t+1,t+3);if(i(o)){r+="%"+o.toUpperCase(),t+=2;continue}}if("/"===a&&(o=!1),s(a)&&(":"!==a||!o))r+=a;else{let o=e.charCodeAt(t);if(o<128)r+=u[o];else if(o<55296||o>57343)r+=d(o);else if(o<=56319&&t+1<e.length){let a=e.charCodeAt(t+1);a>=56320&&a<=57343?(r+=d(65536+(o-55296<<10)+(a-56320)),t++):r+=d(65533)}else r+=d(65533)}}return r},normalizeQueryFragmentEncoding:function(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];if("%"===o&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),a=String.fromCharCode(parseInt(e,16));n(a)?t+=a:t+="%"+e,r+=2;continue}}if(l(o))t+=o;else{let a=e.charCodeAt(r);if(a<128)t+=R(a)?o:u[a];else if(a<55296||a>57343)t+=d(a);else if(a<=56319&&r+1<e.length){let o=e.charCodeAt(r+1);o>=56320&&o<=57343?(t+=d(65536+(a-55296<<10)+(o-56320)),r++):t+=d(65533)}else t+=d(65533)}}return t},encodeUserinfo:E,encodeQuery:function(e){return w(e,l)},encodeFragment:function(e){return w(e,l)},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(i(o)){t+="%"+o.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t},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:g,stringArrayToHexStripped:function(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}}}),cL=eo((e,t)=>{let{isUUID:r}=cz(),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 n(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function s(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:n,serialize:s},c={scheme:"https",domainHost:l.domainHost,parse:n,serialize:s},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=e.resourceName.indexOf("?"),r=-1===t?e.resourceName:e.resourceName.slice(0,t);e.path=r&&"/"!==r?r:void 0,e.query=-1===t?void 0:e.resourceName.slice(t+1),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&&r[0]===e.path){let o=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let a=f(`${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=f(`${r}:${t.nid||o}`);a&&(e=a.serialize(e,t));let i=e,n=e.nss;return i.path=`${o||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&&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 f(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:f}}),cD=eo((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:a,normalizePercentEncoding:i,normalizePathEncoding:n,serializePathEncoding:s,normalizeQueryFragmentEncoding:l,encodeQuery:c,encodeFragment:u,reescapeHostDelimiters:d,isIPv4:p,nonSimpleDomain:f}=cz(),{SCHEMES:h,getSchemeHandler:m}=cL(),y=/^[A-Za-z][A-Za-z0-9+.-]*$/u,g="URI scheme is malformed.";function v(e){let t=unescape(String(e));if(!y.test(t))throw TypeError(g);return t}function _(e,t,r,a){let i={};return a||(e=O(b(e,r),r),t=O(b(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 b(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),l=[];r.scheme&&(r.scheme=v(r.scheme));let d=m(n.scheme||r.scheme);d&&d.serialize&&d.serialize(r,n);let p=void 0!==r.userinfo||void 0!==r.host||void 0!==r.port,f=!n.skipEscape&&void 0===r.scheme&&!p;void 0!==r.path&&(n.skipEscape?r.path=i(r.path):r.path=s(r.path,f)),"suffix"!==n.reference&&r.scheme&&(r.scheme=v(r.scheme),l.push(r.scheme,":"));let h=a(r);if(void 0!==h&&("suffix"!==n.reference&&l.push("//"),l.push(h),r.path&&"/"!==r.path[0]&&l.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||d&&d.absolutePath||(e=o(e)),f&&(e=s(e,!0)),void 0===h&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),l.push(e)}return void 0!==r.query&&l.push("?",c(r.query)),void 0!==r.fragment&&l.push("#",u(r.fragment)),l.join("")}let S=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,$=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,w=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function E(e){if(void 0===e)return!1;let t=e.indexOf("%");for(;-1!==t;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function R(e){return"["===e[0]&&"]"===e[e.length-1]}function P(e,t,r,o){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!R(e.host)&&(t.domainHost||r&&r.domainHost)&&!1===o&&f(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(t){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+t,!0}return!1}function k(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},s=!1,c=!1,u=!1,f=!1,v=!1,_=!1,b=!1;"suffix"===o.reference&&(e=o.scheme?o.scheme+":"+e:"//"+e);let k=e.match($);null!==k&&-1!==k[1].indexOf("\\")&&(a.error="URI authority must not contain a literal backslash.",s=!0);let O=e.match(w);if(null!==O){let e=O[1],t=e.replace(/[\t\n\r]/g,"");t.length>=2&&("//"!==t.slice(0,2)?(a.error=a.error||"URI authority must not contain a literal backslash.",s=!0):e.length!==t.length&&(a.error=a.error||"URI authority introducer must not contain whitespace.",s=!0))}let x=e.match(S);if(x){let t;if(a.scheme=x[1],a.userinfo=x[3],a.host=x[4],a.port=parseInt(x[5],10),a.path=x[6]||"",a.query=x[7],a.fragment=x[8],void 0!==a.scheme){let e=unescape(a.scheme);y.test(e)?a.scheme=e.toLowerCase():(a.error=a.error||g,_=!0)}t=x[4],(c=E(x[3])||void 0!==t&&!R(t)&&E(t)||E(x[6])||E(x[7])||E(x[8]))&&(a.error=a.error||"URI contains malformed percent-encoding."),isNaN(a.port)&&(a.port=x[5]);let S=void 0!==x[2]&&a.path&&"/"!==a.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof a.port&&(a.port<0||a.port>65535)?"URI port is malformed.":void 0;if(void 0!==S&&(a.error=a.error||S,s=!0),a.host)if(!1===p(a.host)){let e=R(a.host),t=-1!==a.host.indexOf("[")||-1!==a.host.indexOf("]"),o=r(a.host);b=o.isIPV6||!0===o.isIPVFuture,v=t&&(!e||!0===o.error),a.host=b?o.host:o.host.toLowerCase(),v&&(a.error=a.error||"URI host is malformed.",s=!0)}else b=!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 $=m(o.scheme||a.scheme);if(v||(f=P(a,o,$,b)),-1!==e.indexOf("%")&&void 0!==a.host&&!v){let e=b?a.host:i(a.host,!0);b||(e=i(e.toLowerCase())),a.host=d(e,b)}(!$||$&&!$.skipNormalize)&&(a.path&&(a.path=n(a.path)),a.query&&(a.query=l(a.query)),a.fragment&&(a.fragment=l(a.fragment))),$&&$.parse&&($.parse(a,o),$===h.urn&&void 0===a.nid&&(u=!0))}else a.error=a.error||"URI can not be parsed.";return{parsed:a,malformedAuthorityOrPort:s,malformedPercentEncoding:c,malformedSchemeSpecific:u,malformedHost:f,malformedScheme:_}}function O(e,t){return k(e,t).parsed}function x(e,t){let{parsed:r,malformedAuthorityOrPort:o,malformedPercentEncoding:a,malformedSchemeSpecific:i,malformedHost:n,malformedScheme:s}=k(e,t);return{normalized:o||a||i||n||s?e:b(r,t),malformedAuthorityOrPort:o,malformedPercentEncoding:a,malformedSchemeSpecific:i,malformedHost:n,malformedScheme:s}}function T(e,t){let r;if("string"!=typeof e&&"object"!=typeof e)return;try{r="string"==typeof e?e:b(e,t)}catch{return}let{normalized:o,malformedAuthorityOrPort:a,malformedPercentEncoding:i,malformedSchemeSpecific:n,malformedHost:s,malformedScheme:l}=x(r,t);return a||i||n||s||l?void 0:o}let j={SCHEMES:h,normalize:function(e,t){return"string"==typeof e?e=x(e,t).normalized:"object"==typeof e&&(e=O(b(e,t),t)),e},resolve:function(e,t,o){let a=o?Object.assign({scheme:"null"},o):{scheme:"null"},{parsed:i,malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:l,malformedHost:c,malformedScheme:u}=k(e,a),{parsed:d,malformedAuthorityOrPort:f,malformedPercentEncoding:h,malformedSchemeSpecific:y,malformedHost:g,malformedScheme:v}=k(t,a);if(n||f||s||h||l||y||c||g||u||v)throw Error(i.error||d.error||"URI is malformed.");let S=_(i,d,a,!0),$=m(o&&o.scheme||S.scheme),w=S.host;P(S,o||{},$,void 0!==w&&""!==w&&(p(w)||r(w).isIPV6));let E=w&&-1!==w.indexOf("%")&&!/\P{ASCII}/u.test(w);if(S.error&&!E)throw Error(S.error);return a.skipEscape=!0,b(S,a)},resolveComponent:_,equal:function(e,t,r){let o=T(e,r),a=T(t,r);return void 0!==o&&void 0!==a&&o===a},serialize:b,parse:O};t.exports=j,t.exports.default=j,t.exports.fastUri=j}),cU=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cD();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),cV=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=cI();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=cv();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=cN(),a=cA(),i=cw(),n=cM(),s=cv(),l=cC(),c=cR(),u=c_(),d=cq(),p=cU(),f=(e,t)=>new RegExp(e,t);f.code="new RegExp";let h=["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={}){var t,r,o,a,n,l,c,u,d,h,v,b,P,k,O,x,T,j,C,I,N,A,M,q,z,L;let D,U,V,F,H;this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...(D=(t=e).strict,V=!0===(U=null==(r=t.code)?void 0:r.optimize)||void 0===U?1:U||0,F=null!=(a=null==(o=t.code)?void 0:o.regExp)?a:f,H=null!=(n=t.uriResolver)?n:p.default,{strictSchema:null==(c=null!=(l=t.strictSchema)?l:D)||c,strictNumbers:null==(d=null!=(u=t.strictNumbers)?u:D)||d,strictTypes:null!=(v=null!=(h=t.strictTypes)?h:D)?v:"log",strictTuples:null!=(P=null!=(b=t.strictTuples)?b:D)?P:"log",strictRequired:null!=(O=null!=(k=t.strictRequired)?k:D)&&O,code:t.code?{...t.code,optimize:V,regExp:F}:{optimize:V,regExp:F},loopRequired:null!=(x=t.loopRequired)?x:200,loopEnum:null!=(T=t.loopEnum)?T:200,meta:null==(j=t.meta)||j,messages:null==(C=t.messages)||C,inlineRefs:null==(I=t.inlineRefs)||I,schemaId:null!=(N=t.schemaId)?N:"$id",addUsedSchema:null==(A=t.addUsedSchema)||A,validateSchema:null==(M=t.validateSchema)||M,validateFormats:null==(q=t.validateFormats)||q,unicodeRegExp:null==(z=t.unicodeRegExp)||z,int32range:null==(L=t.int32range)||L,uriResolver:H})};let{es5:K,lines:G}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:K,lines:G}),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);let B=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),_.call(this,y,e,"NOT SUPPORTED"),_.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=B}_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||n.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await o.call(this,{$ref:e},!0)}async function n(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await l.call(this,t.missingSchema),n.call(this,e)}}function s({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=b.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,o=new n.SchemaEnv({schema:{},schemaId:r});if(!(t=n.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=b.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=>O.call(this,e)),this;T.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=>O.call(this,e,o):e=>o.type.forEach(t=>O.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:s}=this.opts;if("object"==typeof e)i=e[s];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 n.SchemaEnv({schema:e,schemaId:s,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):n.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{n.compileSchema.call(this,e)}finally{this.opts=t}}};function _(e,t,r,o="error"){for(let a in e)a in t&&this.logger[o](`${r}: option ${a}. ${e[a]}`)}function b(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 h)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 O(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,n=a?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 s={keyword:e,definition:{...t,type:(0,c.getJSONTypes)(t.type),schemaType:(0,c.getJSONTypes)(t.schemaType)}};t.before?x.call(this,n,s,t.before):n.rules.push(s),i.all[e]=s,null==(o=t.implements)||o.forEach(e=>this.addKeyword(e))}function x(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 T(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]}}}),cF=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}}),cH=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=cA(),r=ck(),o=cv(),a=cb(),i=cM(),n=c_();function s(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,s){let{gen:l,it:c}=e,{allErrors:u,schemaEnv:d,opts:p}=c,f=p.passContext?a.default.this:o.nil;function h(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=n.mergeEvaluated.props(l,r.props,c.props));else{let t=l.var("props",(0,o._)`${e}.evaluated.props`);c.props=n.mergeEvaluated.props(l,t,c.props,o.Name)}if(!0!==c.items)if(r&&!r.dynamicItems)void 0!==r.items&&(c.items=n.mergeEvaluated.items(l,r.items,c.items));else{let t=l.var("items",(0,o._)`${e}.evaluated.items`);c.items=n.mergeEvaluated.items(l,t,c.items,o.Name)}}s?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,f)}`),m(t),u||l.assign(a,!0)},e=>{l.if((0,o._)`!(${e} instanceof ${c.ValidationError})`,()=>l.throw(e)),h(e),u||l.assign(a,!1)}),e.ok(a)}():e.result((0,r.callValidateCode)(e,t,f),()=>m(t),()=>h(t))}e.getValidate=s,e.callRef=l,e.default={keyword:"$ref",schemaType:"string",code(e){var r,a;let n,c,u,{gen:d,schema:p,it:f}=e,{baseId:h,schemaEnv:m,validateName:y,opts:g,self:v}=f,{root:_}=m;if(("#"===p||"#/"===p)&&h===_.baseId){if(m===_)return l(e,y,m,m.$async);let t=d.scopeValue("root",{ref:_});return l(e,(0,o._)`${t}.validate`,_,_.$async)}let b=i.resolveRef.call(v,_,h,p);if(void 0===b)throw new t.default(f.opts.uriResolver,h,p);return b instanceof i.SchemaEnv?void l(e,s(e,r=b),r,r.$async):(a=b,n=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:n,errSchemaPath:p},c),void(e.mergeEvaluated(u),e.ok(c)))}}}),cK=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cF(),r=cH();e.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default]}),cG=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),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})`)}}}),cB=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv();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,n=i.opts.multipleOfPrecision,s=r.let("res"),l=n?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${n}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${a} === 0 || (${s} = ${o}/${a}, ${l}))`)}}}),cJ=eo(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'}),cZ=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),r=c_(),o=cJ();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:n,it:s}=e,l="maxLength"===a?t.operators.GT:t.operators.LT,c=!1===s.opts.unicode?(0,t._)`${i}.length`:(0,t._)`${(0,r.useFunc)(e.gen,o.default)}(${i})`;e.fail$data((0,t._)`${c} ${l} ${n}`)}}}),cW=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ck(),r=c_(),o=cv();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:n,schema:s,schemaCode:l,it:c}=e,u=c.opts.unicodeRegExp?"u":"";if(n){let{regExp:t}=c.opts.code,n="new RegExp"===t.code?(0,o._)`new RegExp`:(0,r.useFunc)(a,t),s=a.let("valid");a.try(()=>a.assign(s,(0,o._)`${n}(${l}, ${u}).test(${i})`),()=>a.assign(s,!1)),e.fail$data((0,o._)`!${s}`)}else{let r=(0,t.usePattern)(e,s);e.fail$data((0,o._)`!${r}.test(${i})`)}}}}),cX=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv();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}`)}}}),cY=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ck(),r=cv(),o=c_();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:n,data:s,$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,n,()=>{a.assign(c,(0,t.propertyInData)(a,s,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",n,r=>{e.setParams({missingProperty:r}),a.if((0,t.noPropertyInData)(a,s,r,u.ownProperties),()=>e.error())})}}}}),cQ=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv();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}`)}}}),c0=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cT();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),c1=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cR(),r=cv(),o=c_(),a=c0();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:n,$data:s,schema:l,parentSchema:c,schemaCode:u,it:d}=e;if(!s&&!l)return;let p=i.let("valid"),f=c.items?(0,t.getSchemaTypes)(c.items):[];e.block$data(p,function(){let s=i.let("i",(0,r._)`${n}.length`),l=i.let("j");e.setParams({i:s,j:l}),i.assign(p,!0),i.if((0,r._)`${s} > 1`,()=>(f.length>0&&!f.some(e=>"object"===e||"array"===e)?function(o,a){let s=i.name("item"),l=(0,t.checkDataTypes)(f,s,d.opts.strictNumbers,t.DataType.Wrong),c=i.const("indices",(0,r._)`{}`);i.for((0,r._)`;${o}--;`,()=>{i.let(s,(0,r._)`${n}[${o}]`),i.if(l,(0,r._)`continue`),f.length>1&&i.if((0,r._)`typeof ${s} == "string"`,(0,r._)`${s} += "_"`),i.if((0,r._)`typeof ${c}[${s}] == "number"`,()=>{i.assign(a,(0,r._)`${c}[${s}]`),e.error(),i.assign(p,!1).break()}).code((0,r._)`${c}[${s}] = ${o}`)})}:function(t,s){let l=(0,o.useFunc)(i,a.default),c=i.name("outer");i.label(c).for((0,r._)`;${t}--;`,()=>i.for((0,r._)`${s} = ${t}; ${s}--;`,()=>i.if((0,r._)`${l}(${n}[${t}], ${n}[${s}])`,()=>{e.error(),i.assign(p,!1).break(c)})))})(s,l))},(0,r._)`${u} === false`),e.ok(p)}}}),c2=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),r=c_(),o=c0();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:n,schemaCode:s,schema:l}=e;n||l&&"object"==typeof l?e.fail$data((0,t._)`!${(0,r.useFunc)(a,o.default)}(${i}, ${s})`):e.fail((0,t._)`${l} !== ${i}`)}}}),c9=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),r=c_(),o=c0();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:n,data:s,$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,f=()=>null!=a?a:a=(0,r.useFunc)(n,o.default);if(p||l)i=n.let("valid"),e.block$data(i,function(){n.assign(i,!1),n.forOf("v",u,e=>n.if((0,t._)`${f()}(${s}, ${e})`,()=>n.assign(i,!0).break()))});else{if(!Array.isArray(c))throw Error("ajv implementation error");let e=n.const("vSchema",u);i=(0,t.or)(...c.map((r,o)=>{var a,i;let n;return a=e,"object"==typeof(n=c[i=o])&&null!==n?(0,t._)`${f()}(${s}, ${a}[${i}])`:(0,t._)`${s} === ${n}`}))}e.pass(i)}}}),c3=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cG(),r=cB(),o=cZ(),a=cW(),i=cX(),n=cY(),s=cQ(),l=c1(),c=c2(),u=c9();e.default=[t.default,r.default,o.default,a.default,i.default,n.default,s.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default]}),c5=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=cv(),r=c_();function o(e,o){let{gen:a,schema:i,data:n,keyword:s,it:l}=e;l.items=!0;let c=a.const("len",(0,t._)`${n}.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 n;return n=i,void a.forRange("i",o.length,c,o=>{e.subschema({keyword:s,dataProp:o,dataPropType:r.Type.Num},n),l.allErrors||a.if((0,t.not)(n),()=>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')}}}),c4=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=cv(),r=c_(),o=ck();function a(e,o,i=e.schema){let{gen:n,parentSchema:s,data:l,keyword:c,it:u}=e;(function(e){let{opts:t,errSchemaPath:a}=u,n=i.length,s=n===e.minItems&&(n===e.maxItems||!1===e[o]);if(t.strictTuples&&!s){let e=`"${c}" is ${n}-tuple, but minItems or maxItems/${o} are not specified or different at path "${a}"`;(0,r.checkStrictMode)(u,e,t.strictTuples)}})(s),u.opts.unevaluated&&i.length&&!0!==u.items&&(u.items=r.mergeEvaluated.items(n,i.length,u.items));let d=n.name("valid"),p=n.const("len",(0,t._)`${l}.length`);i.forEach((o,a)=>{(0,r.alwaysValidSchema)(u,o)||(n.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))}}}),c6=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=c4();e.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,t.validateTuple)(e,"items")}}),c8=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),r=c_(),o=ck(),a=c5();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:n}=e,{prefixItems:s}=i;n.items=!0,(0,r.alwaysValidSchema)(n,t)||(s?(0,a.validateAdditionalItems)(e,s):e.ok((0,o.validateArray)(e)))}}}),c7=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),r=c_();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:n,parentSchema:s,data:l,it:c}=e,{minContains:u,maxContains:d}=s;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,n)){let r=(0,t._)`${p} >= ${o}`;void 0!==a&&(r=(0,t._)`${r} && ${p} <= ${a}`),e.pass(r);return}c.items=!0;let f=i.name("valid");function h(){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(f,!0).break()):(i.if((0,t._)`${e} > ${a}`,()=>i.assign(f,!1).break()),1===o?i.assign(f,!0):i.if((0,t._)`${e} >= ${o}`,()=>i.assign(f,!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(f,()=>i.if(f,()=>i.break())):0===o?(i.let(f,!0),void 0!==a&&i.if((0,t._)`${l}.length > 0`,h)):(i.let(f,!1),h()),e.result(f,()=>e.reset())}}}),ue=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=cv(),r=c_(),o=ck();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},
|
|
63
|
+
|| ${s} === "boolean" || ${a} === null`).assign(l,(0,n._)`[${a}]`)}}(e);o.else(),f(e),o.endIf(),o.if((0,n._)`${l} !== undefined`,()=>{o.assign(a,l),function({gen:e,parentData:t,parentDataProperty:r},o){e.if((0,n._)`${t} !== undefined`,()=>e.assign((0,n._)`${t}[${r}]`,o))}(e,l)})}(e,r,p):f(e)})}return h};let c=new Set(["string","number","integer","boolean","null"]);function u(e,r,o,a=t.Correct){let i,s=a===t.Correct?n.operators.EQ:n.operators.NEQ;switch(e){case"null":return(0,n._)`${r} ${s} null`;case"array":i=(0,n._)`Array.isArray(${r})`;break;case"object":i=(0,n._)`${r} && typeof ${r} == "object" && !Array.isArray(${r})`;break;case"integer":i=l((0,n._)`!(${r} % 1) && !isNaN(${r})`);break;case"number":i=l();break;default:return(0,n._)`typeof ${r} ${s} ${e}`}return a===t.Correct?i:(0,n.not)(i);function l(e=n.nil){return(0,n.and)((0,n._)`typeof ${r} == "number"`,e,o?(0,n._)`isFinite(${r})`:n.nil)}}function d(e,t,r,o){let a;if(1===e.length)return u(e[0],t,r,o);let i=(0,s.toHash)(e);if(i.array&&i.object){let e=(0,n._)`typeof ${t} != "object"`;a=i.null?e:(0,n._)`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else a=n.nil;for(let e in i.number&&delete i.integer,i)a=(0,n.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,n._)`{type: ${e}}`:(0,n._)`{type: ${t}}`};function f(e){let t=function(e){let{gen:t,data:r,schema:o}=e,a=(0,s.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=f}),cN=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=cP(),r=cO();function o(e,o,a){let{gen:i,compositeRule:n,data:s,opts:l}=e;if(void 0===a)return;let c=(0,t._)`${s}${(0,t.getProperty)(o)}`;if(n)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))}}),cA=ec(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=cP(),r=cO(),o=ck(),a=cO();function i(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}function n(e,r,o){return(0,t._)`${i(e)}.call(${r}, ${o})`}function s(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} === undefined`;return a?(0,t.or)(i,(0,t.not)(n(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(s(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)(s(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=n,e.propertyInData=function(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} !== undefined`;return a?(0,t._)`${i} && ${n(e,r,o)}`:i},e.noPropertyInData=s,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:n,errorPath:s},it:l},c,u,d){let p=d?(0,t._)`${e}, ${r}, ${i}${n}`:r,f=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,s)],[o.default.parentData,l.parentData],[o.default.parentDataProperty,l.parentDataProperty],[o.default.rootData,o.default.rootData]];l.opts.dynamicRef&&f.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let h=(0,t._)`${p}, ${a.object(...f)}`;return u!==t.nil?(0,t._)`${c}.call(${u}, ${h})`:(0,t._)`${c}(${h})`};let c=(0,t._)`new RegExp`;e.usePattern=function({gen:e,it:{opts:r}},o){let i=r.unicodeRegExp?"u":"",{regExp:n}=r.code,s=n(o,i);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,t._)`${"new RegExp"===n.code?c:(0,a.useFunc)(e,n)}(${o}, ${i})`})},e.validateArray=function(e){let{gen:o,data:a,keyword:i,it:n}=e,s=o.name("valid");if(n.allErrors){let e=o.let("valid",!0);return l(()=>o.assign(e,!1)),e}return o.var(s,!0),l(()=>o.break()),s;function l(n){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},s),o.if((0,t.not)(s),n)})}},e.validateUnion=function(e){let{gen:o,schema:a,keyword:i,it:n}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(a.some(e=>(0,r.alwaysValidSchema)(n,e))&&!n.opts.unevaluated)return;let s=o.let("valid",!1),l=o.name("_valid");o.block(()=>a.forEach((r,a)=>{let n=e.subschema({keyword:i,schemaProp:a,compositeRule:!0},l);o.assign(s,(0,t._)`${s} || ${l}`),e.mergeValidEvaluated(n,l)||o.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}}),cM=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=cP(),r=ck(),o=cA(),a=cx();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 n(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:s,it:l}=e,c=r.macro.call(l.self,i,s,l),u=n(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,s){var l;let{gen:c,keyword:u,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,s);let m=n(c,u,!f&&s.compile?s.compile.call(h.self,d,p,h):s.validate),y=c.let("valid");function g(a=s.async?(0,t._)`await `:t.nil){let i=h.opts.passContext?r.default.this:r.default.self,n=!("compile"in s&&!f||!1===s.schema);c.assign(y,(0,t._)`${a}${(0,o.callValidateCode)(e,m,i,n)}`,s.modifying)}function v(e){var r;c.if((0,t.not)(null!=(r=s.valid)?r:y),e)}e.block$data(y,function(){if(!1===s.errors)g(),s.modifying&&i(e),v(()=>e.error());else{let o,n,l=s.async?(o=c.let("ruleErrs",null),c.try(()=>g((0,t._)`await `),e=>c.assign(y,!1).if((0,t._)`${e} instanceof ${h.ValidationError}`,()=>c.assign(o,(0,t._)`${e}.errors`),()=>c.throw(e))),o):(n=(0,t._)`${m}.errors`,c.assign(n,null),g(t.nil),n);s.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=s.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 n=a.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(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)}}}),cq=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=cP(),r=cO();e.getSubschema=function(e,{keyword:o,schemaProp:a,schema:i,schemaPath:n,errSchemaPath:s,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===n||void 0===s||void 0===l)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:l,errSchemaPath:s}}throw Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(e,o,{dataProp:a,dataPropType:i,data:n,dataTypes:s,propertyName:l}){if(void 0!==n&&void 0!==a)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=o;if(void 0!==a){let{errorPath:n,dataPathArr:s,opts:l}=o;u(c.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0)),e.errorPath=(0,t.str)`${n}${(0,r.getErrorPath)(a,i,l.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${a}`,e.dataPathArr=[...s,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!==n&&(u(n instanceof t.Name?n:c.let("data",n,!0)),void 0!==l&&(e.propertyName=l)),s&&(e.dataTypes=s)},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}}),cz=ec((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,n=i[a];if(!e(t[n],r[n]))return!1}return!0}return t!=t&&r!=r}}),cL=ec((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,n,s,l,c,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in o(i,n,s,l,c,u,d),i){var f,h=i[p];if(Array.isArray(h)){if(p in r.arrayKeywords)for(var m=0;m<h.length;m++)e(t,o,a,h[m],n+"/"+p+"/"+m,s,n,p,i,m)}else if(p in r.propsKeywords){if(h&&"object"==typeof h)for(var y in h){e(t,o,a,h[y],n+"/"+p+"/"+(f=y).replace(/~/g,"~0").replace(/\//g,"~1"),s,n,p,i,y)}}else(p in r.keywords||t.allKeys&&!(p in r.skipKeywords))&&e(t,o,a,h,n+"/"+p,s,n,p,i)}a(i,n,s,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}}),cD=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=cO(),r=cz(),o=cL(),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)),1/0===o)))return 1/0;return o}(e)<=r)};let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function n(e,t="",r){return!1!==r&&(t=c(t)),s(e,e.parse(t))}function s(e,t){return e.serialize(t).split("#")[0]+"#"}e.getFullPath=n,e._getFullPath=s;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,s=c(e[a]||t),l={"":s},d=n(i,s,!1),p={},f=new Set;return o(e,{allKeys:!0},(e,t,r,o)=>{if(void 0===o)return;let i=d+t,n=l[o];function s(t){let r=this.opts.uriResolver.resolve;if(t=c(n?r(n,t):t),f.has(t))throw m(t);f.add(t);let o=this.refs[t];return"string"==typeof o&&(o=this.refs[o]),"object"==typeof o?h(e,o.schema,t):t!==c(i)&&("#"===t[0]?(h(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}"`);s.call(this,`#${e}`)}}"string"==typeof e[a]&&(n=s.call(this,e[a])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),l[t]=n}),p;function h(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`)}}}),cU=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=cT(),r=cI(),o=cj(),a=cI(),i=cN(),n=cM(),s=cq(),l=cP(),c=ck(),u=cD(),d=cO(),p=cx();function f({gen:e,validateName:t,schema:r,schemaEnv:o,opts:a},i){var n;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"; ${h(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}, ${(n=a,(0,l._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${n.dynamicRef?(0,l._)`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`)}`,o.$async,()=>e.code(h(r,a)).code(i))}function h(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 b(e,[],!1,t);let o=(0,r.getSchemaTypes)(e.schema);b(e,o,!(0,r.coerceAndCheckDataType)(e,o),t)}function _({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 b(e,t,r,i){var n,s,u,p;let{gen:f,schema:h,data:m,allErrors:y,opts:g,self:v}=e,{RULES:_}=v;if(h.$ref&&(g.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(h,_)))return void f.block(()=>R(e,"$ref",_.all.$ref.definition));function b(n){(0,o.shouldUseGroup)(h,n)&&(n.type?(f.if((0,a.checkDataType)(n.type,m,g.strictNumbers)),S(e,n),1===t.length&&t[0]===n.type&&r&&(f.else(),(0,a.reportTypeError)(e)),f.endIf()):S(e,n),y||f.if((0,l._)`${c.default.errors} === ${i||0}`))}g.jtd||(n=e,s=t,!n.schemaEnv.meta&&n.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)}}(n,s),n.opts.allowUnionTypes||(u=n,(p=s).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}"`)}}}(n,n.dataTypes))),f.block(()=>{for(let e of _.rules)b(e);b(_.post)})}function S(e,t){let{gen:r,schema:a,opts:{useDefaults:n}}=e;n&&(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;f(e,()=>{r.$comment&&t.$comment&&_(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):f(e,()=>(0,t.topBoolOrEmptySchema)(e))};var E=class{constructor(e,t,r){if((0,n.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",k(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,n.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,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(o,this.it,e),(0,s.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:n}=e;n.$comment&&a.$comment&&_(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 s=i.const("_errs",c.default.errors);v(e,s),i.var(t,(0,l._)`${s} === ${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,n.funcKeywordCode)(a,r):"macro"in r?(0,n.macroKeywordCode)(a,r):(r.compile||r.validate)&&(0,n.funcKeywordCode)(a,r)}e.KeywordCxt=E;let P=/^\/(?:[^~]|~0|~1)*$/,O=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function k(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 n=O.exec(e);if(!n)throw Error(`Invalid JSON-pointer: ${e}`);let l=+n[1];if("#"===(a=n[2])){if(l>=t)throw Error(s("property/index",l));return o[t-l]}if(l>t)throw Error(s("data",l));if(i=r[t-l],!a)return i}let n=i;for(let e of a.split("/"))e&&(i=(0,l._)`${i}${(0,l.getProperty)((0,d.unescapeJsonPointer)(e))}`,n=(0,l._)`${n} && ${i}`);return n;function s(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}e.getData=k}),cV=ec(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}}}),cF=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cD();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))}}}),cH=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=cP(),r=cV(),o=ck(),a=cD(),i=cO(),n=cU();var s=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,s,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:f}=this.opts,h=new t.CodeGen(this.scope,{es5:d,lines:p,ownProperties:f});e.$async&&(i=h.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=h.scopeName("validate");e.validateName=m;let y={gen:h,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:h.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,n.validateFunctionCode)(y),h.optimize(this.opts.code.optimize);let r=h.toString();s=`${h.scopeRefs(o.default.scope)}return ${r}`,this.opts.code.process&&(s=this.opts.code.process(s,e));let a=Function(`${o.default.self}`,`${o.default.scope}`,s)(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:h._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,s&&this.logger.error("Error compiling schema, function code:",s),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 h.call(this,r,e);let n=(0,a.normalizeId)(o),c=this.refs[n]||this.schemas[n];if("string"==typeof c){let t=p.call(this,e,c);if("object"!=typeof(null==t?void 0:t.schema))return;return h.call(this,r,t)}if("object"==typeof(null==c?void 0:c.schema)){if(c.validate||l.call(this,c),n===(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 s({schema:t,schemaId:r,root:e,baseId:i})}return h.call(this,r,c)}}e.SchemaEnv=s,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 n=d.call(this,e,r);if(void 0===n){let a=null==(o=e.localRefs)?void 0:o[r],{schemaId:i}=this.opts;a&&(n=new s({schema:a,schemaId:i,root:e,baseId:t}))}if(void 0!==n)return e.refs[r]=c.call(this,n)},e.getCompilingSchema=u,e.resolveSchema=p;let f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,{baseId:t,schema:r,root:o}){var n;let l;if((null==(n=e.fragment)?void 0:n[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 n="object"==typeof(r=e)&&r[this.opts.schemaId];!f.has(o)&&n&&(t=(0,a.resolveUrl)(this.opts.uriResolver,t,n))}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 s({schema:r,schemaId:c,root:o,baseId:t})).schema!==l.root.schema)return l}}),cK=ec((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}}),cG=ec((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),a=RegExp.prototype.test.bind(/^\d*$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),n=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),s=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),l=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),c=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),u=Array(256);{let e="0123456789ABCDEF";for(let t=0;t<256;t++)u[t]="%"+e[t>>4]+e[15&t]}function d(e){return e<2048?u[192|e>>6]+u[128|63&e]:e<65536?u[224|e>>12]+u[128|e>>6&63]+u[128|63&e]:u[240|e>>18]+u[128|e>>12&63]+u[128|e>>6&63]+u[128|63&e]}let p=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),f=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),h=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),m=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function y(e){let t=-1,r=0,o=-1,a=0;for(let i=0;i<e.length;i++)"0"===e[i]?(-1===o&&(o=i),++a>r&&(r=a,t=o)):(o=-1,a=0);if(r<2)return e.join(":");let i=e.slice(0,t).join(":");return i+"::"+e.slice(t+r).join(":")}function g(e){let t="["===e[0]&&"]"===e[e.length-1];if(("["===e[0]||"]"===e[e.length-1])&&!t)return{host:e,isIPV6:!1,error:!0};let r=t?e.slice(1,-1):e;if(t&&f(r))return r=r.toLowerCase(),{host:`[${r}]`,escapedHost:r,isIPV6:!1,isIPVFuture:!0};if(2>function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(r))return{host:e,isIPV6:!1,error:t};let a="",n=r.indexOf("%");if(-1!==n){let t="%25"===r.slice(n,n+3).toLowerCase()?3:1;if(!function(e){if(0===e.length)return!1;for(let t=0;t<e.length;t++)if(!h(e[t])){if("%"===e[t]&&t+2<e.length&&i(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}(a=r.slice(n+t)))return{host:e,isIPV6:!1,error:!0};r=r.slice(0,n)}let s=function(e){let t=e.indexOf("::");if(-1!==t&&-1!==e.indexOf("::",t+1))return;let r=-1===t?e.split(":"):e.slice(0,t).split(":"),a=-1===t?[]:e.slice(t+2).split(":");-1!==t&&(1===r.length&&""===r[0]&&(r.length=0),1===a.length&&""===a[0]&&(a.length=0));let i=r.concat(a),n=0;for(let e=0;e<i.length;e++){let r=i[e];if(""===r)return;if(-1!==r.indexOf(".")){if(e!==i.length-1||-1!==t&&0===a.length||!o(r))return;n+=2;continue}if(!p(r))return;i[e]=parseInt(r,16).toString(16),n++}if(-1===t){if(8!==n)return;return y(i)}if(n>=8)return;let s=i.slice(0,r.length);for(let e=n;e<8;e++)s.push("0");for(let e=r.length;e<i.length;e++)s.push(i[e]);return y(s)}(r);return void 0===s?{host:e,isIPV6:!1,error:!0}:{host:s+(a?"%"+a:""),escapedHost:s+(a?"%25"+a:""),isIPV6:!0}}let v={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},_=/[@/?#:]/g,b=/[@/?#]/g;function S(e,t){let r=t?b:_;return r.lastIndex=0,e.replace(r,e=>v[e])}function $(e,t=!1){if(-1===e.indexOf("%"))return e;let r="";for(let o=0;o<e.length;o++){if("%"===e[o]&&o+2<e.length){let a=e.slice(o+1,o+3);if(i(a)){let e=a.toUpperCase(),i=String.fromCharCode(parseInt(e,16));t&&n(i)?r+=i:r+="%"+e,o+=2;continue}}r+=e[o]}return r}function w(e,t){let r="";for(let o=0;o<e.length;o++){let a=e[o];if("%"===a&&o+2<e.length){let t=e.slice(o+1,o+3);if(i(t)){r+="%"+t.toUpperCase(),o+=2;continue}}if(t(a))r+=a;else{let t=e.charCodeAt(o);if(t<128)r+=u[t];else if(t<55296||t>57343)r+=d(t);else if(t<=56319&&o+1<e.length){let a=e.charCodeAt(o+1);a>=56320&&a<=57343?(r+=d(65536+(t-55296<<10)+(a-56320)),o++):r+=d(65533)}else r+=d(65533)}}return r}function E(e){return w(e,c)}function R(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||42===e||43===e||45===e||46===e||47===e||64===e||95===e}t.exports={nonSimpleDomain:m,recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(E(e.userinfo)),t.push("@")),void 0!==e.host){let r=e.host;if(!o(r)){let e=g(r);!0!==e.isIPV6&&!0!==e.isIPVFuture&&(e=g(r=$(r,!0))),r=!0===e.isIPV6||!0===e.isIPVFuture?`[${e.escapedHost}]`:S(r,!1)}t.push(r)}if("number"==typeof e.port||"string"==typeof e.port){let r=String(e.port);if(!a(r))throw TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0},reescapeHostDelimiters:S,normalizePercentEncoding:$,normalizePathEncoding:function(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];if("%"===o&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),a=String.fromCharCode(parseInt(e,16));"."!==a&&n(a)?t+=a:t+="%"+e,r+=2;continue}}if(s(o))t+=o;else{let a=e.charCodeAt(r);if(a<128)t+=R(a)?o:u[a];else if(a<55296||a>57343)t+=d(a);else if(a<=56319&&r+1<e.length){let o=e.charCodeAt(r+1);o>=56320&&o<=57343?(t+=d(65536+(a-55296<<10)+(o-56320)),r++):t+=d(65533)}else t+=d(65533)}}return t},serializePathEncoding:function(e,t=!1){let r="",o=t&&"/"!==e[0];for(let t=0;t<e.length;t++){let a=e[t];if("%"===a&&t+2<e.length){let o=e.slice(t+1,t+3);if(i(o)){r+="%"+o.toUpperCase(),t+=2;continue}}if("/"===a&&(o=!1),s(a)&&(":"!==a||!o))r+=a;else{let o=e.charCodeAt(t);if(o<128)r+=u[o];else if(o<55296||o>57343)r+=d(o);else if(o<=56319&&t+1<e.length){let a=e.charCodeAt(t+1);a>=56320&&a<=57343?(r+=d(65536+(o-55296<<10)+(a-56320)),t++):r+=d(65533)}else r+=d(65533)}}return r},normalizeQueryFragmentEncoding:function(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];if("%"===o&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),a=String.fromCharCode(parseInt(e,16));n(a)?t+=a:t+="%"+e,r+=2;continue}}if(l(o))t+=o;else{let a=e.charCodeAt(r);if(a<128)t+=R(a)?o:u[a];else if(a<55296||a>57343)t+=d(a);else if(a<=56319&&r+1<e.length){let o=e.charCodeAt(r+1);o>=56320&&o<=57343?(t+=d(65536+(a-55296<<10)+(o-56320)),r++):t+=d(65533)}else t+=d(65533)}}return t},encodeUserinfo:E,encodeQuery:function(e){return w(e,l)},encodeFragment:function(e){return w(e,l)},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(i(o)){t+="%"+o.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t},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:g,stringArrayToHexStripped:function(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}}}),cB=ec((e,t)=>{let{isUUID:r}=cG(),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 n(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function s(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:n,serialize:s},c={scheme:"https",domainHost:l.domainHost,parse:n,serialize:s},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=e.resourceName.indexOf("?"),r=-1===t?e.resourceName:e.resourceName.slice(0,t);e.path=r&&"/"!==r?r:void 0,e.query=-1===t?void 0:e.resourceName.slice(t+1),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&&r[0]===e.path){let o=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let a=f(`${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=f(`${r}:${t.nid||o}`);a&&(e=a.serialize(e,t));let i=e,n=e.nss;return i.path=`${o||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&&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 f(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:f}}),cJ=ec((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:a,normalizePercentEncoding:i,normalizePathEncoding:n,serializePathEncoding:s,normalizeQueryFragmentEncoding:l,encodeQuery:c,encodeFragment:u,reescapeHostDelimiters:d,isIPv4:p,nonSimpleDomain:f}=cG(),{SCHEMES:h,getSchemeHandler:m}=cB(),y=/^[A-Za-z][A-Za-z0-9+.-]*$/u,g="URI scheme is malformed.";function v(e){let t=unescape(String(e));if(!y.test(t))throw TypeError(g);return t}function _(e,t,r,a){let i={};return a||(e=k(b(e,r),r),t=k(b(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 b(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),l=[];r.scheme&&(r.scheme=v(r.scheme));let d=m(n.scheme||r.scheme);d&&d.serialize&&d.serialize(r,n);let p=void 0!==r.userinfo||void 0!==r.host||void 0!==r.port,f=!n.skipEscape&&void 0===r.scheme&&!p;void 0!==r.path&&(n.skipEscape?r.path=i(r.path):r.path=s(r.path,f)),"suffix"!==n.reference&&r.scheme&&(r.scheme=v(r.scheme),l.push(r.scheme,":"));let h=a(r);if(void 0!==h&&("suffix"!==n.reference&&l.push("//"),l.push(h),r.path&&"/"!==r.path[0]&&l.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||d&&d.absolutePath||(e=o(e)),f&&(e=s(e,!0)),void 0===h&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),l.push(e)}return void 0!==r.query&&l.push("?",c(r.query)),void 0!==r.fragment&&l.push("#",u(r.fragment)),l.join("")}let S=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,$=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,w=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function E(e){if(void 0===e)return!1;let t=e.indexOf("%");for(;-1!==t;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function R(e){return"["===e[0]&&"]"===e[e.length-1]}function P(e,t,r,o){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!R(e.host)&&(t.domainHost||r&&r.domainHost)&&!1===o&&f(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(t){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+t,!0}return!1}function O(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},s=!1,c=!1,u=!1,f=!1,v=!1,_=!1,b=!1;"suffix"===o.reference&&(e=o.scheme?o.scheme+":"+e:"//"+e);let O=e.match($);null!==O&&-1!==O[1].indexOf("\\")&&(a.error="URI authority must not contain a literal backslash.",s=!0);let k=e.match(w);if(null!==k){let e=k[1],t=e.replace(/[\t\n\r]/g,"");t.length>=2&&("//"!==t.slice(0,2)?(a.error=a.error||"URI authority must not contain a literal backslash.",s=!0):e.length!==t.length&&(a.error=a.error||"URI authority introducer must not contain whitespace.",s=!0))}let x=e.match(S);if(x){var T,C;let t;if(a.scheme=x[1],a.userinfo=x[3],a.host=x[4],a.port=parseInt(x[5],10),a.path=x[6]||"",a.query=x[7],a.fragment=x[8],void 0!==a.scheme){let e=unescape(a.scheme);y.test(e)?a.scheme=e.toLowerCase():(a.error=a.error||g,_=!0)}t=(T=x)[4],(c=E(T[3])||void 0!==t&&!R(t)&&E(t)||E(T[6])||E(T[7])||E(T[8]))&&(a.error=a.error||"URI contains malformed percent-encoding."),isNaN(a.port)&&(a.port=x[5]);let S=(C=a,void 0!==x[2]&&C.path&&"/"!==C.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof C.port&&(C.port<0||C.port>65535)?"URI port is malformed.":void 0);if(void 0!==S&&(a.error=a.error||S,s=!0),a.host)if(!1===p(a.host)){let e=R(a.host),t=-1!==a.host.indexOf("[")||-1!==a.host.indexOf("]"),o=r(a.host);b=o.isIPV6||!0===o.isIPVFuture,v=t&&(!e||!0===o.error),a.host=b?o.host:o.host.toLowerCase(),v&&(a.error=a.error||"URI host is malformed.",s=!0)}else b=!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 $=m(o.scheme||a.scheme);if(v||(f=P(a,o,$,b)),-1!==e.indexOf("%")&&void 0!==a.host&&!v){let e=b?a.host:i(a.host,!0);b||(e=i(e.toLowerCase())),a.host=d(e,b)}(!$||$&&!$.skipNormalize)&&(a.path&&(a.path=n(a.path)),a.query&&(a.query=l(a.query)),a.fragment&&(a.fragment=l(a.fragment))),$&&$.parse&&($.parse(a,o),$===h.urn&&void 0===a.nid&&(u=!0))}else a.error=a.error||"URI can not be parsed.";return{parsed:a,malformedAuthorityOrPort:s,malformedPercentEncoding:c,malformedSchemeSpecific:u,malformedHost:f,malformedScheme:_}}function k(e,t){return O(e,t).parsed}function x(e,t){let{parsed:r,malformedAuthorityOrPort:o,malformedPercentEncoding:a,malformedSchemeSpecific:i,malformedHost:n,malformedScheme:s}=O(e,t);return{normalized:o||a||i||n||s?e:b(r,t),malformedAuthorityOrPort:o,malformedPercentEncoding:a,malformedSchemeSpecific:i,malformedHost:n,malformedScheme:s}}function T(e,t){let r;if("string"!=typeof e&&"object"!=typeof e)return;try{r="string"==typeof e?e:b(e,t)}catch{return}let{normalized:o,malformedAuthorityOrPort:a,malformedPercentEncoding:i,malformedSchemeSpecific:n,malformedHost:s,malformedScheme:l}=x(r,t);return a||i||n||s||l?void 0:o}let C={SCHEMES:h,normalize:function(e,t){var r,o;return"string"==typeof e?e=x(r=e,o=t).normalized:"object"==typeof e&&(e=k(b(e,t),t)),e},resolve:function(e,t,o){let a=o?Object.assign({scheme:"null"},o):{scheme:"null"},{parsed:i,malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:l,malformedHost:c,malformedScheme:u}=O(e,a),{parsed:d,malformedAuthorityOrPort:f,malformedPercentEncoding:h,malformedSchemeSpecific:y,malformedHost:g,malformedScheme:v}=O(t,a);if(n||f||s||h||l||y||c||g||u||v)throw Error(i.error||d.error||"URI is malformed.");let S=_(i,d,a,!0),$=m(o&&o.scheme||S.scheme),w=S.host;P(S,o||{},$,void 0!==w&&""!==w&&(p(w)||r(w).isIPV6));let E=w&&-1!==w.indexOf("%")&&!/\P{ASCII}/u.test(w);if(S.error&&!E)throw Error(S.error);return a.skipEscape=!0,b(S,a)},resolveComponent:_,equal:function(e,t,r){let o=T(e,r),a=T(t,r);return void 0!==o&&void 0!==a&&o===a},serialize:b,parse:k};t.exports=C,t.exports.default=C,t.exports.fastUri=C}),cZ=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cJ();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),cW=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=cU();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=cP();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=cV(),a=cF(),i=cC(),n=cH(),s=cP(),l=cD(),c=cI(),u=cO(),d=cK(),p=cZ(),f=(e,t)=>new RegExp(e,t);f.code="new RegExp";let h=["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={}){var t,r,o,a,n,l,c,u,d,h,v,b,P,O,k,x,T,C,j,I,N,A,M,q,z,L;let D,U,V,F,H;this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...(D=(t=e).strict,V=!0===(U=null==(r=t.code)?void 0:r.optimize)||void 0===U?1:U||0,F=null!=(a=null==(o=t.code)?void 0:o.regExp)?a:f,H=null!=(n=t.uriResolver)?n:p.default,{strictSchema:null==(c=null!=(l=t.strictSchema)?l:D)||c,strictNumbers:null==(d=null!=(u=t.strictNumbers)?u:D)||d,strictTypes:null!=(v=null!=(h=t.strictTypes)?h:D)?v:"log",strictTuples:null!=(P=null!=(b=t.strictTuples)?b:D)?P:"log",strictRequired:null!=(k=null!=(O=t.strictRequired)?O:D)&&k,code:t.code?{...t.code,optimize:V,regExp:F}:{optimize:V,regExp:F},loopRequired:null!=(x=t.loopRequired)?x:200,loopEnum:null!=(T=t.loopEnum)?T:200,meta:null==(C=t.meta)||C,messages:null==(j=t.messages)||j,inlineRefs:null==(I=t.inlineRefs)||I,schemaId:null!=(N=t.schemaId)?N:"$id",addUsedSchema:null==(A=t.addUsedSchema)||A,validateSchema:null==(M=t.validateSchema)||M,validateFormats:null==(q=t.validateFormats)||q,unicodeRegExp:null==(z=t.unicodeRegExp)||z,int32range:null==(L=t.int32range)||L,uriResolver:H})};let{es5:K,lines:G}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:K,lines:G}),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);let B=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),_.call(this,y,e,"NOT SUPPORTED"),_.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=B}_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||n.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await o.call(this,{$ref:e},!0)}async function n(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await l.call(this,t.missingSchema),n.call(this,e)}}function s({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=b.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,o=new n.SchemaEnv({schema:{},schemaId:r});if(!(t=n.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=b.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(O.call(this,r,t),!t)return(0,u.eachItem)(r,e=>k.call(this,e)),this;T.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=>k.call(this,e,o):e=>o.type.forEach(t=>k.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]=j(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:s}=this.opts;if("object"==typeof e)i=e[s];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 n.SchemaEnv({schema:e,schemaId:s,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):n.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{n.compileSchema.call(this,e)}finally{this.opts=t}}};function _(e,t,r,o="error"){for(let a in e)a in t&&this.logger[o](`${r}: option ${a}. ${e[a]}`)}function b(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 h)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 O(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 k(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,n=a?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 s={keyword:e,definition:{...t,type:(0,c.getJSONTypes)(t.type),schemaType:(0,c.getJSONTypes)(t.schemaType)}};t.before?x.call(this,n,s,t.before):n.rules.push(s),i.all[e]=s,null==(o=t.implements)||o.forEach(e=>this.addKeyword(e))}function x(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 T(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=j(t)),e.validateSchema=this.compile(t,!0))}let C={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function j(e){return{anyOf:[e,C]}}}),cX=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}}),cY=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=cF(),r=cA(),o=cP(),a=ck(),i=cH(),n=cO();function s(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,s){let{gen:l,it:c}=e,{allErrors:u,schemaEnv:d,opts:p}=c,f=p.passContext?a.default.this:o.nil;function h(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=n.mergeEvaluated.props(l,r.props,c.props));else{let t=l.var("props",(0,o._)`${e}.evaluated.props`);c.props=n.mergeEvaluated.props(l,t,c.props,o.Name)}if(!0!==c.items)if(r&&!r.dynamicItems)void 0!==r.items&&(c.items=n.mergeEvaluated.items(l,r.items,c.items));else{let t=l.var("items",(0,o._)`${e}.evaluated.items`);c.items=n.mergeEvaluated.items(l,t,c.items,o.Name)}}s?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,f)}`),m(t),u||l.assign(a,!0)},e=>{l.if((0,o._)`!(${e} instanceof ${c.ValidationError})`,()=>l.throw(e)),h(e),u||l.assign(a,!1)}),e.ok(a)}():e.result((0,r.callValidateCode)(e,t,f),()=>m(t),()=>h(t))}e.getValidate=s,e.callRef=l,e.default={keyword:"$ref",schemaType:"string",code(e){var r,a;let n,c,u,{gen:d,schema:p,it:f}=e,{baseId:h,schemaEnv:m,validateName:y,opts:g,self:v}=f,{root:_}=m;if(("#"===p||"#/"===p)&&h===_.baseId){if(m===_)return l(e,y,m,m.$async);let t=d.scopeValue("root",{ref:_});return l(e,(0,o._)`${t}.validate`,_,_.$async)}let b=i.resolveRef.call(v,_,h,p);if(void 0===b)throw new t.default(f.opts.uriResolver,h,p);return b instanceof i.SchemaEnv?void l(e,s(e,r=b),r,r.$async):(a=b,n=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:n,errSchemaPath:p},c),void(e.mergeEvaluated(u),e.ok(c)))}}}),cQ=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cX(),r=cY();e.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default]}),c0=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP(),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})`)}}}),c1=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP();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,n=i.opts.multipleOfPrecision,s=r.let("res"),l=n?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${n}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${a} === 0 || (${s} = ${o}/${a}, ${l}))`)}}}),c2=ec(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'}),c9=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP(),r=cO(),o=c2();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:n,it:s}=e,l="maxLength"===a?t.operators.GT:t.operators.LT,c=!1===s.opts.unicode?(0,t._)`${i}.length`:(0,t._)`${(0,r.useFunc)(e.gen,o.default)}(${i})`;e.fail$data((0,t._)`${c} ${l} ${n}`)}}}),c3=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cA(),r=cO(),o=cP();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:n,schema:s,schemaCode:l,it:c}=e,u=c.opts.unicodeRegExp?"u":"";if(n){let{regExp:t}=c.opts.code,n="new RegExp"===t.code?(0,o._)`new RegExp`:(0,r.useFunc)(a,t),s=a.let("valid");a.try(()=>a.assign(s,(0,o._)`${n}(${l}, ${u}).test(${i})`),()=>a.assign(s,!1)),e.fail$data((0,o._)`!${s}`)}else{let r=(0,t.usePattern)(e,s);e.fail$data((0,o._)`!${r}.test(${i})`)}}}}),c5=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP();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}`)}}}),c4=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cA(),r=cP(),o=cO();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:n,data:s,$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,n,()=>{a.assign(c,(0,t.propertyInData)(a,s,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",n,r=>{e.setParams({missingProperty:r}),a.if((0,t.noPropertyInData)(a,s,r,u.ownProperties),()=>e.error())})}}}}),c6=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP();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}`)}}}),c8=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cz();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),c7=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cI(),r=cP(),o=cO(),a=c8();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:n,$data:s,schema:l,parentSchema:c,schemaCode:u,it:d}=e;if(!s&&!l)return;let p=i.let("valid"),f=c.items?(0,t.getSchemaTypes)(c.items):[];e.block$data(p,function(){let s=i.let("i",(0,r._)`${n}.length`),l=i.let("j");e.setParams({i:s,j:l}),i.assign(p,!0),i.if((0,r._)`${s} > 1`,()=>(f.length>0&&!f.some(e=>"object"===e||"array"===e)?function(o,a){let s=i.name("item"),l=(0,t.checkDataTypes)(f,s,d.opts.strictNumbers,t.DataType.Wrong),c=i.const("indices",(0,r._)`{}`);i.for((0,r._)`;${o}--;`,()=>{i.let(s,(0,r._)`${n}[${o}]`),i.if(l,(0,r._)`continue`),f.length>1&&i.if((0,r._)`typeof ${s} == "string"`,(0,r._)`${s} += "_"`),i.if((0,r._)`typeof ${c}[${s}] == "number"`,()=>{i.assign(a,(0,r._)`${c}[${s}]`),e.error(),i.assign(p,!1).break()}).code((0,r._)`${c}[${s}] = ${o}`)})}:function(t,s){let l=(0,o.useFunc)(i,a.default),c=i.name("outer");i.label(c).for((0,r._)`;${t}--;`,()=>i.for((0,r._)`${s} = ${t}; ${s}--;`,()=>i.if((0,r._)`${l}(${n}[${t}], ${n}[${s}])`,()=>{e.error(),i.assign(p,!1).break(c)})))})(s,l))},(0,r._)`${u} === false`),e.ok(p)}}}),ue=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP(),r=cO(),o=c8();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:n,schemaCode:s,schema:l}=e;n||l&&"object"==typeof l?e.fail$data((0,t._)`!${(0,r.useFunc)(a,o.default)}(${i}, ${s})`):e.fail((0,t._)`${l} !== ${i}`)}}}),ut=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP(),r=cO(),o=c8();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:n,data:s,$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,f=()=>null!=a?a:a=(0,r.useFunc)(n,o.default);if(p||l)i=n.let("valid"),e.block$data(i,function(){n.assign(i,!1),n.forOf("v",u,e=>n.if((0,t._)`${f()}(${s}, ${e})`,()=>n.assign(i,!0).break()))});else{if(!Array.isArray(c))throw Error("ajv implementation error");let e=n.const("vSchema",u);i=(0,t.or)(...c.map((r,o)=>{var a,i;let n;return a=e,"object"==typeof(n=c[i=o])&&null!==n?(0,t._)`${f()}(${s}, ${a}[${i}])`:(0,t._)`${s} === ${n}`}))}e.pass(i)}}}),ur=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=c0(),r=c1(),o=c9(),a=c3(),i=c5(),n=c4(),s=c6(),l=c7(),c=ue(),u=ut();e.default=[t.default,r.default,o.default,a.default,i.default,n.default,s.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default]}),uo=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=cP(),r=cO();function o(e,o){let{gen:a,schema:i,data:n,keyword:s,it:l}=e;l.items=!0;let c=a.const("len",(0,t._)`${n}.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 n;return n=i,void a.forRange("i",o.length,c,o=>{e.subschema({keyword:s,dataProp:o,dataPropType:r.Type.Num},n),l.allErrors||a.if((0,t.not)(n),()=>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')}}}),ua=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=cP(),r=cO(),o=cA();function a(e,o,i=e.schema){let{gen:n,parentSchema:s,data:l,keyword:c,it:u}=e;(function(e){let{opts:t,errSchemaPath:a}=u,n=i.length,s=n===e.minItems&&(n===e.maxItems||!1===e[o]);if(t.strictTuples&&!s){let e=`"${c}" is ${n}-tuple, but minItems or maxItems/${o} are not specified or different at path "${a}"`;(0,r.checkStrictMode)(u,e,t.strictTuples)}})(s),u.opts.unevaluated&&i.length&&!0!==u.items&&(u.items=r.mergeEvaluated.items(n,i.length,u.items));let d=n.name("valid"),p=n.const("len",(0,t._)`${l}.length`);i.forEach((o,a)=>{(0,r.alwaysValidSchema)(u,o)||(n.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))}}}),ui=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ua();e.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,t.validateTuple)(e,"items")}}),un=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP(),r=cO(),o=cA(),a=uo();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:n}=e,{prefixItems:s}=i;n.items=!0,(0,r.alwaysValidSchema)(n,t)||(s?(0,a.validateAdditionalItems)(e,s):e.ok((0,o.validateArray)(e)))}}}),us=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP(),r=cO();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:n,parentSchema:s,data:l,it:c}=e,{minContains:u,maxContains:d}=s;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,n)){let r=(0,t._)`${p} >= ${o}`;void 0!==a&&(r=(0,t._)`${r} && ${p} <= ${a}`),e.pass(r);return}c.items=!0;let f=i.name("valid");function h(){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(f,!0).break()):(i.if((0,t._)`${e} > ${a}`,()=>i.assign(f,!1).break()),1===o?i.assign(f,!0):i.if((0,t._)`${e} >= ${o}`,()=>i.assign(f,!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(f,()=>i.if(f,()=>i.break())):0===o?(i.let(f,!0),void 0!==a&&i.if((0,t._)`${l}.length > 0`,h)):(i.let(f,!1),h()),e.result(f,()=>e.reset())}}}),ul=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=cP(),r=cO(),o=cA();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},
|
|
64
64
|
missingProperty: ${a},
|
|
65
65
|
depsCount: ${r},
|
|
66
|
-
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),n(e,r)}};function i(e,r=e.schema){let{gen:a,data:n,it:s}=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,n,i,s.opts.ownProperties);e.setParams({property:i,depsCount:c.length,deps:c.join(", ")}),s.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 n(e,t=e.schema){let{gen:a,data:i,keyword:s,it:l}=e,c=a.name("valid");for(let n in t)(0,r.alwaysValidSchema)(l,t[n])||(a.if((0,o.propertyInData)(a,i,n,l.opts.ownProperties),()=>{let t=e.subschema({keyword:s,schemaProp:n},c);e.mergeValidEvaluated(t,c)},()=>a.var(c,!0)),e.ok(c))}e.validatePropertyDeps=i,e.validateSchemaDeps=n,e.default=a}),ut=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),r=c_();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:n}=e;if((0,r.alwaysValidSchema)(n,a))return;let s=o.name("valid");o.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},s),o.if((0,t.not)(s),()=>{e.error(!0),n.allErrors||o.break()})}),e.ok(s)}}}),ur=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ck(),r=cv(),o=cb(),a=c_();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:n,parentSchema:s,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,n))return;let f=(0,t.allSchemaProperties)(s.properties),h=(0,t.allSchemaProperties)(s.patternProperties);function m(e){i.code((0,r._)`delete ${l}[${e}]`)}function y(t){if("all"===p.removeAdditional||p.removeAdditional&&!1===n)return void m(t);if(!1===n){e.setParams({additionalProperty:t}),e.error(),d||i.break();return}if("object"==typeof n&&!(0,a.alwaysValidSchema)(u,n)){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=>{f.length||h.length?i.if(function(o){let n;if(f.length>8){let e=(0,a.schemaRefOrVal)(u,s.properties,"properties");n=(0,t.isOwnProperty)(i,e,o)}else n=f.length?(0,r.or)(...f.map(e=>(0,r._)`${o} === ${e}`)):r.nil;return h.length&&(n=(0,r.or)(n,...h.map(a=>(0,r._)`${(0,t.usePattern)(e,a)}.test(${o})`))),(0,r.not)(n)}(o),()=>y(o)):y(o)}),e.ok((0,r._)`${c} === ${o.default.errors}`)}}}),uo=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cI(),r=ck(),o=c_(),a=ur();e.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:i,schema:n,parentSchema:s,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===s.additionalProperties&&a.default.code(new t.KeywordCxt(c,a.default,"additionalProperties"));let u=(0,r.allSchemaProperties)(n);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,n[e]));if(0===d.length)return;let p=i.name("valid");for(let t of d){var f;(f=t,c.opts.useDefaults&&!c.compositeRule&&void 0!==n[f].default)?h(t):(i.if((0,r.propertyInData)(i,l,t,c.opts.ownProperties)),h(t),c.allErrors||i.else().var(p,!0),i.endIf()),e.it.definedProperties.add(t),e.ok(p)}function h(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}}}),ua=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ck(),r=cv(),o=c_(),a=c_();e.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:i,schema:n,data:s,parentSchema:l,it:c}=e,{opts:u}=c,d=(0,t.allSchemaProperties)(n),p=d.filter(e=>(0,o.alwaysValidSchema)(c,n[e]));if(0===d.length||p.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;let f=u.strictSchema&&!u.allowMatchingProperties&&l.properties,h=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)f&&function(e){for(let t in f)new RegExp(e).test(t)&&(0,o.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),c.allErrors?y(e):(i.var(h,!0),y(e),i.if(h));function y(o){i.forIn("key",s,n=>{i.if((0,r._)`${(0,t.usePattern)(e,o)}.test(${n})`,()=>{let t=p.includes(o);t||e.subschema({keyword:"patternProperties",schemaProp:o,dataProp:n,dataPropType:a.Type.Str},h),c.opts.unevaluated&&!0!==m?i.assign((0,r._)`${m}[${n}]`,!0):t||c.allErrors||i.if((0,r.not)(h),()=>i.break())})})}}}}),ui=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=c_();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"}}}),un=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ck().validateUnion,error:{message:"must match a schema in anyOf"}}}),us=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),r=c_();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:n}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let s=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)(n,a)?o.var(c,!0):u=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},c),i>0&&o.if((0,t._)`${c} && ${s}`).assign(s,!1).assign(l,(0,t._)`[${l}, ${i}]`).else(),o.if(c,()=>{o.assign(s,!0),o.assign(l,i),u&&e.mergeEvaluated(u,t.Name)})})}),e.result(s,()=>e.reset(),()=>e.error(!0))}}}),ul=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=c_();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 n=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(n)})}}}),uc=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),r=c_();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:n,it:s}=e;void 0===n.then&&void 0===n.else&&(0,r.checkStrictMode)(s,'"if" without "then" and "else" is ignored');let l=o(s,"then"),c=o(s,"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))}}}),uu=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=c_();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`)}}}),ud=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=c5(),r=c6(),o=c4(),a=c8(),i=c7(),n=ue(),s=ut(),l=ur(),c=uo(),u=ua(),d=ui(),p=un(),f=us(),h=ul(),m=uc(),y=uu();e.default=function(e=!1){let g=[d.default,p.default,f.default,h.default,m.default,y.default,s.default,l.default,n.default,c.default,u.default];return e?g.push(r.default,a.default):g.push(t.default,o.default),g.push(i.default),g}}),up=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv();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,n,s,l,{gen:c,data:u,$data:d,schema:p,schemaCode:f,it:h}=e,{opts:m,errSchemaPath:y,schemaEnv:g,self:v}=h;m.validateFormats&&(d?(o=c.scopeValue("formats",{ref:v.formats,code:m.code.formats}),a=c.const("fDef",(0,t._)`${o}[${f}]`),i=c.let("fType"),n=c.let("format"),c.if((0,t._)`typeof ${a} == "object" && !(${a} instanceof RegExp)`,()=>c.assign(i,(0,t._)`${a}.type || "string"`).assign(n,(0,t._)`${a}.validate`),()=>c.assign(i,(0,t._)`"string"`).assign(n,a)),e.fail$data((0,t.or)(!1===m.strictSchema?t.nil:(0,t._)`${f} && !${n}`,(s=g.$async?(0,t._)`(${a}.async ? await ${n}(${u}) : ${n}(${u}))`:(0,t._)`${n}(${u})`,l=(0,t._)`(typeof ${n} == "function" ? ${s} : ${n}.test(${u}))`,(0,t._)`${n} && ${n} !== true && ${i} === ${r} && !${l}`)))):function(){var o;let a,i,n=v.formats[p];if(!n){if(!1===m.strictSchema)return v.logger.warn(s());throw Error(s());function s(){return`unknown format "${p}" ignored in schema at path "${y}"`}}if(!0===n)return;let[l,d,f]=(a=(o=n)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 n&&!(n instanceof RegExp)&&n.async){if(!g.$async)throw Error("async format in sync schema");return(0,t._)`await ${f}(${u})`}return"function"==typeof d?(0,t._)`${f}(${u})`:(0,t._)`${f}.test(${u})`}())}())}}}),uf=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[up().default]}),uh=eo(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"]}),um=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cK(),r=c3(),o=ud(),a=uf(),i=uh();e.default=[t.default,r.default,(0,o.default)(),a.default,i.metadataVocabulary,i.contentVocabulary]}),uy=eo(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(r=t||(e.DiscrError=t={})).Tag="tag",r.Mapping="mapping"}),ug=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),r=uy(),o=cM(),a=cA(),i=c_();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:n,data:s,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 f=n.let("valid",!1),h=n.const("tag",(0,t._)`${s}${(0,t.getProperty)(p)}`);n.if((0,t._)`typeof ${h} == "string"`,()=>(function(){let s=function(){var e;let t={},r=s(c),n=!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 f=null==(e=null==c?void 0:c.properties)?void 0:e[p];if("object"!=typeof f)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);n=n&&(r||s(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"`)}(f,t)}if(!n)throw Error(`discriminator: "${p}" must be required`);return t;function s({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 n.if(!1),s)n.elseIf((0,t._)`${h} === ${r}`),n.assign(f,function(r){let o=n.name("valid"),a=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(a,t.Name),o}(s[r]));n.else(),e.error(!1,{discrError:r.DiscrError.Mapping,tag:h,tagName:p}),n.endIf()})(),()=>e.error(!1,{discrError:r.DiscrError.Tag,tag:h,tagName:p})),e.ok(f)}}}),uv=eo((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}}),u_=eo((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=cV(),o=um(),a=ug(),i=uv(),n=["/properties"],s="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,n):i;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv=l,t.exports=e=l,t.exports.Ajv=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var c=cI();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=cv();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=cN();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=cA();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),ub=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=cv(),r=cb(),o=cM(),a=cH();function i(e,i){let{gen:n,it:s}=e;s.schemaEnv.root.dynamicAnchors[i]=!0;let l=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(i)}`,c="#"===s.errSchemaPath?s.validateName:function(e){let{schemaEnv:t,schema:r,self:i}=e.it,{root:n,baseId:s,localRefs:l,meta:c}=t.root,{schemaId:u}=i.opts,d=new o.SchemaEnv({schema:r,schemaId:u,root:n,baseId:s,localRefs:l,meta:c});return o.compileSchema.call(i,d),(0,a.getValidate)(e,d)}(e);n.if((0,t._)`!${l}`,()=>n.assign(l,c))}e.dynamicAnchor=i,e.default={keyword:"$dynamicAnchor",schemaType:"string",code:e=>i(e,e.schema)}}),uS=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=cv(),r=cb(),o=cH();function a(e,a){let{gen:i,keyword:n,it:s}=e;if("#"!==a[0])throw Error(`"${n}" only supports hash fragment reference`);let l=a.slice(1);if(s.allErrors)c();else{let t=i.let("valid",!1);c(t),e.ok(t)}function c(e){if(s.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(s.validateName,e))}else u(s.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)}}),u$=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ub(),r=c_();e.default={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,t.dynamicAnchor)(e,""):(0,r.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}}}),uw=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uS();e.default={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,t.dynamicRef)(e,e.schema)}}),uE=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ub(),r=uS(),o=u$(),a=uw();e.default=[t.default,r.default,o.default,a.default]}),uR=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue();e.default={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}}),uP=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue();e.default={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,t.validateSchemaDeps)(e)}}),uk=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=c_();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`)}}}),uO=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uR(),r=uP(),o=uk();e.default=[t.default,r.default,o.default]}),ux=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),r=c_(),o=cb();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:n,errsCount:s,it:l}=e;if(!s)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",n,e=>{var r,o;return a.if((r=u,o=e,(0,t._)`!${r} || !${r}[${o}]`),()=>d(e))})):!0!==u&&a.forIn("key",n,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._)`${s} === ${o.default.errors}`)}}}),uT=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),r=c_();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:n}=e,s=n.items||0;if(!0===s)return;let l=o.const("len",(0,t._)`${i}.length`);if(!1===a)e.setParams({len:s}),e.fail((0,t._)`${l} > ${s}`);else if("object"==typeof a&&!(0,r.alwaysValidSchema)(n,a)){let a=o.var("valid",(0,t._)`${l} <= ${s}`);o.if((0,t.not)(a),()=>{var i,c;return i=a,c=s,void o.forRange("i",c,l,a=>{e.subschema({keyword:"unevaluatedItems",dataProp:a,dataPropType:r.Type.Num},i),n.allErrors||o.if((0,t.not)(i),()=>o.break())})}),e.ok(a)}n.items=!0}}}),uj=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ux(),r=uT();e.default=[t.default,r.default]}),uC=eo((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"}]}}}}}),uI=eo((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:"#"}}}}}),uN=eo((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:"#"}}}}),uA=eo((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:{}}}}}),uM=eo((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"}}}}),uq=eo((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}}}}),uz=eo((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:[]}}}}),uL=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uC(),r=uI(),o=uN(),a=uA(),i=uM(),n=uq(),s=uz(),l=["/properties"];e.default=function(e){return[t,r,o,a,c(this,i),n,c(this,s)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function c(t,r){return e?t.$dataMetaSchema(r,l):r}}}),uD=eo((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=cV(),o=um(),a=uE(),i=uO(),n=uj(),s=ug(),l=uL(),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(n.default),this.opts.discriminator&&this.addKeyword(s.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=cI();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var p=cv();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 f=cN();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=cA();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})}),uU=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cK(),r=c3(),o=ud(),a=uE(),i=uO(),n=uj(),s=uf(),l=uh();e.default=[a.default,t.default,r.default,(0,o.default)(!0),s.default,l.metadataVocabulary,l.contentVocabulary,i.default,n.default]}),uV=eo((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}}}}),uF=eo((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"}}}}}),uH=eo((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"}}}}),uK=eo((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"}}}}),uG=eo((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"}}}}),uB=eo((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"}}}}),uJ=eo((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}}}}),uZ=eo((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:[]}}}}),uW=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uV(),r=uF(),o=uH(),a=uK(),i=uG(),n=uB(),s=uJ(),l=uZ(),c=["/properties"];e.default=function(e){return[t,r,o,a,i,u(this,n),s,u(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,r){return e?t.$dataMetaSchema(r,c):r}}}),uX=eo((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=cV(),o=uU(),a=ug(),i=uW(),n="https://json-schema.org/draft/2020-12/schema";var s=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"]=n)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var l=cI();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=cv();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=cN();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=cA();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),uY=eo(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(s(!0),l),"date-time":t(d(!0),p),"iso-time":t(s(),c),"iso-date-time":t(d(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return h.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(b.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:_},double:{type:"number",validate:_},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,f),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],n=+a[2],s=+a[3];return n>=1&&n<=12&&s>=1&&s<=(2===n&&(t=i)%4==0&&(t%100!=0||t%400==0)?29:o[n])}function i(e,t){if(e&&t)return e>t?1:e<t?-1:0}let n=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function s(e){return function(t){let r=n.exec(t);if(!r)return!1;let o=+r[1],a=+r[2],i=+r[3],s=r[4],l="-"===r[5]?-1:1,c=+(r[6]||0),u=+(r[7]||0);if(c>23||u>59||e&&!s)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=n.exec(e),o=n.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=s(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 f(e,t){if(!(e&&t))return;let[r,o]=e.split(u),[a,n]=t.split(u),s=i(r,a);if(void 0!==s)return s||l(o,n)}let h=/\/|:/,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=0x7fffffff;function _(){return!0}let b=/[^\\]\\Z/}),uQ=eo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=u_(),r=cv(),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:n,data:s,schemaCode:l,keyword:c,it:u}=e,{opts:d,self:p}=u;if(!d.validateFormats)return;let f=new t.KeywordCxt(u,p.RULES.all.format.definition,"format");function h(e){return(0,r._)`${e}.compare(${s}, ${l}) ${a[c].fail} 0`}f.$data?(o=n.scopeValue("formats",{ref:p.formats,code:d.code.formats}),i=n.const("fmt",(0,r._)`${o}[${f.schemaCode}]`),e.fail$data((0,r.or)((0,r._)`typeof ${i} != "object"`,(0,r._)`${i} instanceof RegExp`,(0,r._)`typeof ${i}.compare != "function"`,h(i)))):function(){let t=f.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=n.scopeValue("formats",{key:t,ref:o,code:d.code.formats?(0,r._)`${d.code.formats}${(0,r.getProperty)(t)}`:void 0});e.fail$data(h(a))}()},dependencies:["format"]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}),u0=eo((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=uY(),o=uQ(),a=cv(),i=new a.Name("fullFormats"),n=new a.Name("fastFormats"),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return l(e,t,r.fullFormats,i),e;let[a,s]="fast"===t.mode?[r.fastFormats,n]:[r.fullFormats,i];return l(e,t.formats||r.formatNames,a,s),t.keywords&&(0,o.default)(e),e};function l(e,t,r,o){var i;for(let n of(null!=(i=e.opts.code).formats||(i.formats=(0,a._)`require("ajv-formats/dist/formats").${o}`),t))e.addFormat(n,r[n])}s.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=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s}),u1=u_(),u2=uD(),u9=uX();((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var o,a=ee(t),i=0,n=a.length;i<n;i++)o=a[i],er.call(e,o)||void 0===o||Y(e,o,{get:(e=>t[e]).bind(null,o),enumerable:!(r=Q(t,o))||r.enumerable});return e})(Y(null!=(b=u0())?X(et(b)):{},"default",{value:b,enumerable:!0}),b).default;u1.Ajv;let u3=require("node:process"),u5=Symbol.for("mcp.completable");function u4(e,t){return Object.defineProperty(e,u5,{value:{complete:t},enumerable:!1,writable:!1,configurable:!1}),e}function u6(e){let t="";for(let r of e)t+=String.fromCodePoint(r);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function u8(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 u7(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,n=()=>t??=r.importKey("raw",o,{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]),s=new TextEncoder,l=async e=>u6(new Uint8Array(await r.sign("HMAC",await n(),s.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=u6(s.encode(JSON.stringify(o)));return`v1.${c}.${u6(new Uint8Array(await r.sign("HMAC",await n(),s.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=u8(e.slice(c+1))}catch{throw Error("malformed")}if(!await r.verify("HMAC",await n(),o,s.encode("v1."+u)))throw Error("mac");try{a=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(u8(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 de=Object.create,dt=Object.defineProperty,dr=Object.getOwnPropertyDescriptor,da=Object.getOwnPropertyNames,di=Object.getPrototypeOf,dn=Object.prototype.hasOwnProperty,ds=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),dl=(e,t,r)=>(r=null!=e?de(di(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var o,a=da(t),i=0,n=a.length;i<n;i++)o=a[i],dn.call(e,o)||void 0===o||dt(e,o,{get:(e=>t[e]).bind(null,o),enumerable:!(r=dr(t,o))||r.enumerable});return e})(!t&&e&&e.__esModule?r:dt(r,"default",{value:e,enumerable:!0}),e));let dc=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),du=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),dd=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),dp=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),df=Symbol.for("mcp.sdk.errorBrands");function dh(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,df,{value:r,enumerable:!1,configurable:!0})}function dm(e,t){try{if("object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&"string"==typeof e.mcpBrand&&Object.prototype.hasOwnProperty.call(t,df)){let r=t[df];if(r&&"function"==typeof r.has&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}let dy=((E={}).InvalidRequest="invalid_request",E.InvalidClient="invalid_client",E.InvalidGrant="invalid_grant",E.UnauthorizedClient="unauthorized_client",E.UnsupportedGrantType="unsupported_grant_type",E.InvalidScope="invalid_scope",E.AccessDenied="access_denied",E.ServerError="server_error",E.TemporarilyUnavailable="temporarily_unavailable",E.UnsupportedResponseType="unsupported_response_type",E.UnsupportedTokenType="unsupported_token_type",E.InvalidToken="invalid_token",E.MethodNotAllowed="method_not_allowed",E.TooManyRequests="too_many_requests",E.InvalidClientMetadata="invalid_client_metadata",E.InvalidRedirectUri="invalid_redirect_uri",E.InsufficientScope="insufficient_scope",E.InvalidTarget="invalid_target",E.InvalidDpopProof="invalid_dpop_proof",E.UseDpopNonce="use_dpop_nonce",E);var dg=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](e){return dm(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 dm(this,e)}constructor(e,t,r){super(t),this.code=e,this.errorUri=r,this.name="OAuthError",dh(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 dv=((R={}).NotConnected="NOT_CONNECTED",R.AlreadyConnected="ALREADY_CONNECTED",R.NotInitialized="NOT_INITIALIZED",R.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",R.RequestTimeout="REQUEST_TIMEOUT",R.ConnectionClosed="CONNECTION_CLOSED",R.SendFailed="SEND_FAILED",R.InvalidResult="INVALID_RESULT",R.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",R.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",R.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",R.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",R.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",R.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",R.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",R.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",R.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",R.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",R.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",R);var d_=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return dm(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 dm(this,e)}constructor(e,t,r,o){super(t,o),this.code=e,this.data=r,this.name="SdkError",dh(this,new.target)}},db=class extends d_{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r,o){super(e,t,r,o),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function dS(e){if("object"!=typeof e||null===e||Array.isArray(e))return e;let t={...e};return delete t.issuer,t}let d$="2026-07-28",dw=[d$];function dE(e){return e.filter(e=>!(e>=d$))}function dR(e){return e.filter(e=>e>=d$)}function dP(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 dk=["task","inputRequests","requestState"];function dO(e){return null===e||"object"!=typeof e||Array.isArray(e)||void 0!==e.content||dk.some(t=>t in e)?e:{...e,content:[]}}function dx(){let e,t,r,o,i,n,s,l,c,u,d,p,f,h,m,y,g,v,_,b,S,$,w,E,R,P,k,O,x,T,j,C,I,N,A,M,q,z,L,D,U,V,F,H,K,G,B,J,Z,W,X,Y,Q,ee,et,er,eo,ea,ei,en,es,el,ec,eu,ed,ep,ef,eh,em,ey,eg,ev,e_,eb,eS,e$,ew,eE,eR,eP,ek,eO,ex,eT,ej,eC,eI,eN,eA,eM,eq,ez,eL,eD,eU,eV,eF,eH,eK,eG,eB,eJ,eZ,eW,eX,eY,eQ,e0,e1,e2,e9,e3,e5,e4,e6,e8,e7,te,tt,tr,to,ta,ti,tn,ts,tl,tc,tu,td,tp,tf,th,tm,ty,tg,tv,t_,tb,tS,t$;return a??=(e=iB(()=>ib([aL(),it(),ii(),il(),iP(aL(),e),im(e)])),t=iP(aL(),e),r=ib([aL(),it().int()]),o=aL(),i=ig({ttl:it().optional()}),n=ig({taskId:aL()}),c=(l=ig({_meta:(s=iv({progressToken:r.optional(),"io.modelcontextprotocol/related-task":n.optional()})).optional()})).extend({task:i.optional()}),u=ig({method:aL(),params:l.loose().optional()}),d=ig({_meta:s.optional()}),p=ig({method:aL(),params:d.loose().optional()}),f=iv({_meta:s.optional()}),h=ib([aL(),it().int()]),m=f.strict(),y=d.extend({requestId:h.optional(),reason:aL().optional()}),g=p.extend({method:iT("notifications/cancelled"),params:y}),v=ig({src:aL(),mimeType:aL().optional(),sizes:im(aL()).optional(),theme:iO(["light","dark"]).optional()}),_=ig({icons:im(v).optional()}),S=(b=ig({name:aL(),title:aL().optional()})).extend({...b.shape,..._.shape,version:aL(),websiteUrl:aL().optional(),description:aL().optional()}),$=iE(ig({applyDefaults:ii().optional()}),t),w=iZ(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,iE(ig({form:$.optional(),url:t.optional()}),t.optional())),E=iv({list:t.optional(),cancel:t.optional(),requests:iv({sampling:iv({createMessage:t.optional()}).optional(),elicitation:iv({create:t.optional()}).optional()}).optional()}),R=iv({list:t.optional(),cancel:t.optional(),requests:iv({tools:iv({call:t.optional()}).optional()}).optional()}),P=ig({experimental:iP(aL(),t).optional(),sampling:ig({context:t.optional(),tools:t.optional()}).optional(),elicitation:w.optional(),roots:ig({listChanged:ii().optional()}).optional(),tasks:E.optional(),extensions:iP(aL(),t).optional()}),k=l.extend({protocolVersion:aL(),capabilities:P,clientInfo:S}),O=u.extend({method:iT("initialize"),params:k}),x=ig({experimental:iP(aL(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:ig({listChanged:ii().optional()}).optional(),resources:ig({subscribe:ii().optional(),listChanged:ii().optional()}).optional(),tools:ig({listChanged:ii().optional()}).optional(),tasks:R.optional(),extensions:iP(aL(),t).optional()}),T=f.extend({protocolVersion:aL(),capabilities:x,serverInfo:S,instructions:aL().optional()}),j=p.extend({method:iT("notifications/initialized"),params:d.optional()}),C=u.extend({method:iT("ping"),params:l.optional()}),I=ig({progress:it(),total:iN(it()),message:iN(aL())}),N=ig({...d.shape,...I.shape,progressToken:r}),A=p.extend({method:iT("notifications/progress"),params:N}),M=l.extend({cursor:o.optional()}),q=u.extend({params:M.optional()}),z=f.extend({nextCursor:o.optional()}),D=(L=ig({uri:aL(),mimeType:iN(aL()),_meta:iP(aL(),id()).optional()})).extend({text:aL()}),U=aL().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),V=L.extend({blob:U}),H=ig({audience:im(F=iO(["user","assistant"])).optional(),priority:it().min(0).max(1).optional(),lastModified:or(aU,{offset:!0}).optional()}),K=ig({...b.shape,..._.shape,uri:aL(),description:iN(aL()),mimeType:iN(aL()),size:iN(it()),annotations:H.optional(),_meta:iN(iv({}))}),G=ig({...b.shape,..._.shape,uriTemplate:aL(),description:iN(aL()),mimeType:iN(aL()),annotations:H.optional(),_meta:iN(iv({}))}),B=q.extend({method:iT("resources/list")}),J=z.extend({resources:im(K)}),Z=q.extend({method:iT("resources/templates/list")}),W=z.extend({resourceTemplates:im(G)}),X=l.extend({uri:aL()}),Y=u.extend({method:iT("resources/read"),params:X}),Q=f.extend({contents:im(ib([D,V]))}),ee=p.extend({method:iT("notifications/resources/list_changed"),params:d.optional()}),et=u.extend({method:iT("resources/subscribe"),params:X}),er=u.extend({method:iT("resources/unsubscribe"),params:X}),eo=d.extend({uri:aL()}),ea=p.extend({method:iT("notifications/resources/updated"),params:eo}),ei=ig({name:aL(),description:iN(aL()),required:iN(ii())}),en=ig({...b.shape,..._.shape,description:iN(aL()),arguments:iN(im(ei)),_meta:iN(iv({}))}),es=q.extend({method:iT("prompts/list")}),el=z.extend({prompts:im(en)}),ec=l.extend({name:aL(),arguments:iP(aL(),aL()).optional()}),eu=u.extend({method:iT("prompts/get"),params:ec}),ed=ig({type:iT("text"),text:aL(),annotations:H.optional(),_meta:iP(aL(),id()).optional()}),ep=ig({type:iT("image"),data:U,mimeType:aL(),annotations:H.optional(),_meta:iP(aL(),id()).optional()}),ef=ig({type:iT("audio"),data:U,mimeType:aL(),annotations:H.optional(),_meta:iP(aL(),id()).optional()}),eh=ig({type:iT("tool_use"),name:aL(),id:aL(),input:iP(aL(),id()),_meta:iP(aL(),id()).optional()}),em=ig({type:iT("resource"),resource:ib([D,V]),annotations:H.optional(),_meta:iP(aL(),id()).optional()}),ev=ig({role:F,content:eg=ib([ed,ep,ef,ey=K.extend({type:iT("resource_link")}),em])}),e_=f.extend({description:aL().optional(),messages:im(ev)}),eb=p.extend({method:iT("notifications/prompts/list_changed"),params:d.optional()}),eS=ig({title:aL().optional(),readOnlyHint:ii().optional(),destructiveHint:ii().optional(),idempotentHint:ii().optional(),openWorldHint:ii().optional()}),e$=ig({taskSupport:iO(["required","optional","forbidden"]).optional()}),ew=ig({...b.shape,..._.shape,description:aL().optional(),inputSchema:ig({type:iT("object"),properties:iP(aL(),e).optional(),required:im(aL()).optional()}).catchall(id()),outputSchema:ig({type:iT("object"),properties:iP(aL(),e).optional(),required:im(aL()).optional()}).catchall(id()).optional(),annotations:eS.optional(),execution:e$.optional(),_meta:iP(aL(),id()).optional()}),eE=q.extend({method:iT("tools/list")}),eR=z.extend({tools:im(ew)}),eP=f.extend({content:im(eg),structuredContent:iP(aL(),id()).optional(),isError:ii().optional()}),ek=c.extend({name:aL(),arguments:iP(aL(),id()).optional()}),eO=u.extend({method:iT("tools/call"),params:ek}),ex=p.extend({method:iT("notifications/tools/list_changed"),params:d.optional()}),eT=iO(["debug","info","notice","warning","error","critical","alert","emergency"]),ej=l.extend({level:eT}),eC=u.extend({method:iT("logging/setLevel"),params:ej}),eI=d.extend({level:eT,logger:aL().optional(),data:id()}),eN=p.extend({method:iT("notifications/message"),params:eI}),eA=ig({name:aL().optional()}),eM=ig({hints:im(eA).optional(),costPriority:it().min(0).max(1).optional(),speedPriority:it().min(0).max(1).optional(),intelligencePriority:it().min(0).max(1).optional()}),eq=ig({mode:iO(["auto","required","none"]).optional()}),ez=ig({type:iT("tool_result"),toolUseId:aL().describe("The unique identifier for the corresponding tool call."),content:im(eg),structuredContent:ig({}).loose().optional(),isError:ii().optional(),_meta:iP(aL(),id()).optional()}),eL=i$("type",[ed,ep,ef]),eU=ig({role:F,content:ib([eD=i$("type",[ed,ep,ef,eh,ez]),im(eD)]),_meta:iP(aL(),id()).optional()}),eV=c.extend({messages:im(eU),modelPreferences:eM.optional(),systemPrompt:aL().optional(),includeContext:iO(["none","thisServer","allServers"]).optional(),temperature:it().optional(),maxTokens:it().int(),stopSequences:im(aL()).optional(),metadata:t.optional(),tools:im(ew).optional(),toolChoice:eq.optional()}),eF=u.extend({method:iT("sampling/createMessage"),params:eV}),eH=f.extend({model:aL(),stopReason:iN(iO(["endTurn","stopSequence","maxTokens"]).or(aL())),role:F,content:eL}),eK=f.extend({model:aL(),stopReason:iN(iO(["endTurn","stopSequence","maxTokens","toolUse"]).or(aL())),role:F,content:ib([eD,im(eD)])}),eG=ig({type:iT("boolean"),title:aL().optional(),description:aL().optional(),default:ii().optional()}),eB=ig({type:iT("string"),title:aL().optional(),description:aL().optional(),minLength:it().optional(),maxLength:it().optional(),format:iO(["email","uri","date","date-time"]).optional(),default:aL().optional()}),eJ=ig({type:iO(["number","integer"]),title:aL().optional(),description:aL().optional(),minimum:it().optional(),maximum:it().optional(),default:it().optional()}),eZ=ig({type:iT("string"),title:aL().optional(),description:aL().optional(),enum:im(aL()),default:aL().optional()}),eW=ig({type:iT("string"),title:aL().optional(),description:aL().optional(),oneOf:im(ig({const:aL(),title:aL()})),default:aL().optional()}),eX=ig({type:iT("string"),title:aL().optional(),description:aL().optional(),enum:im(aL()),enumNames:im(aL()).optional(),default:aL().optional()}),eY=ib([eZ,eW]),eQ=ig({type:iT("array"),title:aL().optional(),description:aL().optional(),minItems:it().optional(),maxItems:it().optional(),items:ig({type:iT("string"),enum:im(aL())}),default:im(aL()).optional()}),e1=ib([eQ,e0=ig({type:iT("array"),title:aL().optional(),description:aL().optional(),minItems:it().optional(),maxItems:it().optional(),items:ig({anyOf:im(ig({const:aL(),title:aL()}))}),default:im(aL()).optional()})]),e2=ib([eX,eY,e1]),e9=ib([e2,eG,eB,eJ]),e3=c.extend({mode:iT("form").optional(),message:aL(),requestedSchema:ig({type:iT("object"),properties:iP(aL(),e9),required:im(aL()).optional()}).catchall(id())}),e4=ib([e3,e5=c.extend({mode:iT("url"),message:aL(),elicitationId:aL(),url:aL().url()})]),e6=u.extend({method:iT("elicitation/create"),params:e4}),e8=d.extend({elicitationId:aL()}),e7=p.extend({method:iT("notifications/elicitation/complete"),params:e8}),te=f.extend({action:iO(["accept","decline","cancel"]),content:iZ(e=>null===e?void 0:e,iP(aL(),ib([aL(),it(),ii(),im(aL())])).optional())}),tt=ig({type:iT("ref/resource"),uri:aL()}),tr=ig({type:iT("ref/prompt"),name:aL()}),to=l.extend({ref:ib([tr,tt]),argument:ig({name:aL(),value:aL()}),context:ig({arguments:iP(aL(),aL()).optional()}).optional()}),ta=u.extend({method:iT("completion/complete"),params:to}),ti=f.extend({completion:iv({values:im(aL()).max(100),total:iN(it().int()),hasMore:iN(ii())})}),tn=ig({uri:aL().startsWith("file://"),name:aL().optional(),_meta:iP(aL(),id()).optional()}),ts=u.extend({method:iT("roots/list"),params:l.optional()}),tl=f.extend({roots:im(tn)}),tc=p.extend({method:iT("notifications/roots/list_changed"),params:d.optional()}),tu=iv({ttl:it().optional(),pollInterval:it().optional()}),td=iO(["working","input_required","completed","failed","cancelled"]),tp=ig({taskId:aL(),status:td,ttl:ib([it(),il()]),createdAt:aL(),lastUpdatedAt:aL(),pollInterval:iN(it()),statusMessage:iN(aL())}),tf=f.extend({task:tp}),th=d.merge(tp),tm=p.extend({method:iT("notifications/tasks/status"),params:th}),ty=u.extend({method:iT("tasks/get"),params:l.extend({taskId:aL()})}),tg=f.merge(tp),tv=u.extend({method:iT("tasks/result"),params:l.extend({taskId:aL()})}),t_=f.loose(),tb=q.extend({method:iT("tasks/list")}),tS=z.extend({tasks:im(tp)}),t$=u.extend({method:iT("tasks/cancel"),params:l.extend({taskId:aL()})}),{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:i,RelatedTaskMetadataSchema:n,RequestMetaSchema:s,BaseRequestParamsSchema:l,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:d,NotificationSchema:p,ResultSchema:f,RequestIdSchema:h,EmptyResultSchema:m,CancelledNotificationParamsSchema:y,CancelledNotificationSchema:g,IconSchema:v,IconsSchema:_,BaseMetadataSchema:b,ImplementationSchema:S,ClientTasksCapabilitySchema:E,ServerTasksCapabilitySchema:R,ClientCapabilitiesSchema:P,InitializeRequestParamsSchema:k,InitializeRequestSchema:O,ServerCapabilitiesSchema:x,InitializeResultSchema:T,InitializedNotificationSchema:j,PingRequestSchema:C,ProgressSchema:I,ProgressNotificationParamsSchema:N,ProgressNotificationSchema:A,PaginatedRequestParamsSchema:M,PaginatedRequestSchema:q,PaginatedResultSchema:z,ResourceContentsSchema:L,TextResourceContentsSchema:D,BlobResourceContentsSchema:V,RoleSchema:F,AnnotationsSchema:H,ResourceSchema:K,ResourceTemplateSchema:G,ListResourcesRequestSchema:B,ListResourcesResultSchema:J,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:en,ListPromptsRequestSchema:es,ListPromptsResultSchema:el,GetPromptRequestParamsSchema:ec,GetPromptRequestSchema:eu,TextContentSchema:ed,ImageContentSchema:ep,AudioContentSchema:ef,ToolUseContentSchema:eh,EmbeddedResourceSchema:em,ResourceLinkSchema:ey,ContentBlockSchema:eg,PromptMessageSchema:ev,GetPromptResultSchema:e_,PromptListChangedNotificationSchema:eb,ToolAnnotationsSchema:eS,ToolExecutionSchema:e$,ToolSchema:ew,ListToolsRequestSchema:eE,ListToolsResultSchema:eR,CallToolResultSchema:eP,CallToolRequestParamsSchema:ek,CallToolRequestSchema:eO,ToolListChangedNotificationSchema:ex,LoggingLevelSchema:eT,SetLevelRequestParamsSchema:ej,SetLevelRequestSchema:eC,LoggingMessageNotificationParamsSchema:eI,LoggingMessageNotificationSchema:eN,ModelHintSchema:eA,ModelPreferencesSchema:eM,ToolChoiceSchema:eq,ToolResultContentSchema:ez,SamplingContentSchema:eL,SamplingMessageContentBlockSchema:eD,SamplingMessageSchema:eU,CreateMessageRequestParamsSchema:eV,CreateMessageRequestSchema:eF,CreateMessageResultSchema:eH,CreateMessageResultWithToolsSchema:eK,BooleanSchemaSchema:eG,StringSchemaSchema:eB,NumberSchemaSchema:eJ,UntitledSingleSelectEnumSchemaSchema:eZ,TitledSingleSelectEnumSchemaSchema:eW,LegacyTitledEnumSchemaSchema:eX,SingleSelectEnumSchemaSchema:eY,UntitledMultiSelectEnumSchemaSchema:eQ,TitledMultiSelectEnumSchemaSchema:e0,MultiSelectEnumSchemaSchema:e1,EnumSchemaSchema:e2,PrimitiveSchemaDefinitionSchema:e9,ElicitRequestFormParamsSchema:e3,ElicitRequestURLParamsSchema:e5,ElicitRequestParamsSchema:e4,ElicitRequestSchema:e6,ElicitationCompleteNotificationParamsSchema:e8,ElicitationCompleteNotificationSchema:e7,ElicitResultSchema:te,ResourceTemplateReferenceSchema:tt,PromptReferenceSchema:tr,CompleteRequestParamsSchema:to,CompleteRequestSchema:ta,CompleteResultSchema:ti,RootSchema:tn,ListRootsRequestSchema:ts,ListRootsResultSchema:tl,RootsListChangedNotificationSchema:tc,TaskCreationParamsSchema:tu,TaskStatusSchema:td,TaskSchema:tp,CreateTaskResultSchema:tf,TaskStatusNotificationParamsSchema:th,TaskStatusNotificationSchema:tm,GetTaskRequestSchema:ty,GetTaskResultSchema:tg,GetTaskPayloadRequestSchema:tv,GetTaskPayloadResultSchema:t_,ListTasksRequestSchema:tb,ListTasksResultSchema:tS,CancelTaskRequestSchema:t$,CancelTaskResultSchema:f.merge(tp),ClientRequestSchema:ib([C,O,ta,eC,eu,es,B,Z,Y,et,er,eO,eE,ty,tv,tb,t$]),ClientNotificationSchema:ib([g,A,j,tc,tm]),ClientResultSchema:ib([m,eH,eK,te,tl,tg,tS,tf]),ServerRequestSchema:ib([C,eF,e6,ts,ty,tv,tb,t$]),ServerNotificationSchema:ib([g,A,eN,ea,ee,ex,eb,tm,e7]),ServerResultSchema:ib([m,T,ti,e_,el,J,W,Q,eP,eR,tg,tS,tf]),CallToolResultWireSchema:id().superRefine((e,t)=>{if(!("object"!=typeof e||null===e||Array.isArray(e))&&void 0===e.content){for(let r of dk)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(dO).pipe(eP)})}function dT(e){return"object"!==e.type}let dj=new Set(["const","enum","default","examples"]),dC=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function dI(e){return void 0!==e&&!("string"==typeof e&&e.startsWith("#"))}let dN={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},dA={"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},dM={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 dq(){if(s)return s;let e=dx();return s={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 dz(e){return Object.prototype.hasOwnProperty.call(dN,e)}function dL(e){return Object.prototype.hasOwnProperty.call(dA,e)}function dD(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function dU(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(dN),Object.keys(dA);let dV={ok:!1,reason:"not-in-era"};function dF(e){return dD(e)&&dD(e.outputSchema)&&dT(e.outputSchema)}let dH={era:"2025-11-25",hasRequestMethod:dz,hasNotificationMethod:dL,validateRequest:(e,t)=>dU(dz(e)?dq().requestSchemas[e]:void 0,t),validateResult:(e,t)=>dU(Object.prototype.hasOwnProperty.call(dM,e)?dq().resultSchemas[e]:void 0,t),validateNotification:(e,t)=>dU(dL(e)?dq().notificationSchemas[e]:void 0,t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>dV,validateInputResponse:()=>dV,samplingResultVariant:(e,t)=>{let r=dx();return dU(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=dP(e),o=r.structuredContent;if(void 0===o)return r;let a="object"!=typeof o||null===o||Array.isArray(o),i=void 0!==t&&dT(t);return a||i?{...r,structuredContent:{result:o}}:r},decodeResult(e,t){if(dD(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=>dF(e))?{...t,tools:r.map(e=>dF(e)?{...e,outputSchema:function(e){var t;let r="string"==typeof e.$schema?e.$schema:void 0;if(dI(e.$id))return{...void 0!==r&&{$schema:r},type:"object",properties:{result:e},required:["result"]};let o="string"==typeof(t=e.$schema)&&du.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&&dI(e.$id))return e;let r={},i=!1;for(let[n,s]of Object.entries(e))t?r[n]=a(s,!1):("$ref"===n||"$dynamicRef"===n)&&"string"==typeof s?r[n]="#"===s?"#/properties/result":s.startsWith("#/")?`#/properties/result${s.slice(1)}`:s:"$recursiveRef"===n&&"#"===s&&o?i=!0:dj.has(n)?r[n]=s:dC.has(n)?r[n]=a(s,!0):r[n]=a(s,!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 dK(){return l??=function(){let e=iB(()=>ib([aL(),it(),ii(),il(),iP(aL(),e),im(e)])),t=iP(aL(),e),r=ib([aL(),it().int()]),o=aL(),a=ib([aL(),it().int()]),i=iO(["user","assistant"]),n=iO(["debug","info","notice","warning","error","critical","alert","emergency"]),s=aL().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),l=ig({ttl:it().optional()}),c=ig({taskId:aL()}),u=iv({progressToken:r.optional(),"io.modelcontextprotocol/related-task":c.optional()}),d=ig({_meta:u.optional()}),p=d.extend({task:l.optional()}),f=ig({_meta:u.optional()}),h=ig({method:aL(),params:f.loose().optional()}),m=ig({src:aL(),mimeType:aL().optional(),sizes:im(aL()).optional(),theme:iO(["light","dark"]).optional()}),y=ig({icons:im(m).optional()}),g=ig({name:aL(),title:aL().optional()}),v=g.extend({...g.shape,...y.shape,version:aL(),websiteUrl:aL().optional(),description:aL().optional()}),_=iE(ig({applyDefaults:ii().optional()}),t),b=iZ(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,iE(ig({form:_.optional(),url:t.optional()}),t.optional())),S=iv({list:t.optional(),cancel:t.optional(),requests:iv({sampling:iv({createMessage:t.optional()}).optional(),elicitation:iv({create:t.optional()}).optional()}).optional()}),$=iv({list:t.optional(),cancel:t.optional(),requests:iv({tools:iv({call:t.optional()}).optional()}).optional()}),w=ig({experimental:iP(aL(),t).optional(),sampling:ig({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:ig({listChanged:ii().optional()}).optional(),tasks:S.optional(),extensions:iP(aL(),t).optional()}),E=ig({experimental:iP(aL(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:ig({listChanged:ii().optional()}).optional(),resources:ig({subscribe:ii().optional(),listChanged:ii().optional()}).optional(),tools:ig({listChanged:ii().optional()}).optional(),tasks:$.optional(),extensions:iP(aL(),t).optional()}),R=ig({progress:it(),total:iN(it()),message:iN(aL())}),P=ig({...f.shape,...R.shape,progressToken:r}),k=h.extend({method:iT("notifications/progress"),params:P}),O=f.extend({level:n,logger:aL().optional(),data:id()}),x=h.extend({method:iT("notifications/message"),params:O}),T=ig({uri:aL(),mimeType:iN(aL()),_meta:iP(aL(),id()).optional()}),j=T.extend({text:aL()}),C=T.extend({blob:s}),I=ig({audience:im(i).optional(),priority:it().min(0).max(1).optional(),lastModified:or(aU,{offset:!0}).optional()}),N=ig({...g.shape,...y.shape,uri:aL(),description:iN(aL()),mimeType:iN(aL()),size:iN(it()),annotations:I.optional(),_meta:iN(iv({}))}),A=ig({...g.shape,...y.shape,uriTemplate:aL(),description:iN(aL()),mimeType:iN(aL()),annotations:I.optional(),_meta:iN(iv({}))}),M=h.extend({method:iT("notifications/resources/list_changed"),params:f.optional()}),q=f.extend({uri:aL()}),z=h.extend({method:iT("notifications/resources/updated"),params:q}),L=ig({name:aL(),description:iN(aL()),required:iN(ii())}),D=ig({...g.shape,...y.shape,description:iN(aL()),arguments:iN(im(L)),_meta:iN(iv({}))}),U=h.extend({method:iT("notifications/prompts/list_changed"),params:f.optional()}),V=ig({type:iT("text"),text:aL(),annotations:I.optional(),_meta:iP(aL(),id()).optional()}),F=ig({type:iT("image"),data:s,mimeType:aL(),annotations:I.optional(),_meta:iP(aL(),id()).optional()}),H=ig({type:iT("audio"),data:s,mimeType:aL(),annotations:I.optional(),_meta:iP(aL(),id()).optional()}),K=ig({type:iT("tool_use"),name:aL(),id:aL(),input:iP(aL(),id()),_meta:iP(aL(),id()).optional()}),G=ig({type:iT("resource"),resource:ib([j,C]),annotations:I.optional(),_meta:iP(aL(),id()).optional()}),B=N.extend({type:iT("resource_link")}),J=ib([V,F,H,B,G]),Z=ig({role:i,content:J}),W=ig({title:aL().optional(),readOnlyHint:ii().optional(),destructiveHint:ii().optional(),idempotentHint:ii().optional(),openWorldHint:ii().optional()}),X=h.extend({method:iT("notifications/tools/list_changed"),params:f.optional()}),Y=ig({name:aL().optional()}),Q=ig({hints:im(Y).optional(),costPriority:it().min(0).max(1).optional(),speedPriority:it().min(0).max(1).optional(),intelligencePriority:it().min(0).max(1).optional()}),ee=ig({mode:iO(["auto","required","none"]).optional()}),et=ig({type:iT("boolean"),title:aL().optional(),description:aL().optional(),default:ii().optional()}),er=ig({type:iT("string"),title:aL().optional(),description:aL().optional(),minLength:it().optional(),maxLength:it().optional(),format:iO(["email","uri","date","date-time"]).optional(),default:aL().optional()}),eo=ig({type:iO(["number","integer"]),title:aL().optional(),description:aL().optional(),minimum:it().optional(),maximum:it().optional(),default:it().optional()}),ea=ig({type:iT("string"),title:aL().optional(),description:aL().optional(),enum:im(aL()),default:aL().optional()}),ei=ig({type:iT("string"),title:aL().optional(),description:aL().optional(),oneOf:im(ig({const:aL(),title:aL()})),default:aL().optional()}),en=ig({type:iT("string"),title:aL().optional(),description:aL().optional(),enum:im(aL()),enumNames:im(aL()).optional(),default:aL().optional()}),es=ib([ea,ei]),el=ig({type:iT("array"),title:aL().optional(),description:aL().optional(),minItems:it().optional(),maxItems:it().optional(),items:ig({type:iT("string"),enum:im(aL())}),default:im(aL()).optional()}),ec=ig({type:iT("array"),title:aL().optional(),description:aL().optional(),minItems:it().optional(),maxItems:it().optional(),items:ig({anyOf:im(ig({const:aL(),title:aL()}))}),default:im(aL()).optional()}),eu=ib([el,ec]),ed=ib([en,es,eu]),ep=ib([ed,et,er,eo]),ef=p.extend({mode:iT("form").optional(),message:aL(),requestedSchema:ig({type:iT("object"),properties:iP(aL(),ep),required:im(aL()).optional()}).catchall(id())}),eh=ig({type:iT("ref/resource"),uri:aL()}),em=ig({type:iT("ref/prompt"),name:aL()}),ey=ig({uri:aL().startsWith("file://"),name:aL().optional(),_meta:iP(aL(),id()).optional()}),eg=w.shape,ev=ig({experimental:eg.experimental,sampling:eg.sampling,elicitation:eg.elicitation,roots:eg.roots,extensions:eg.extensions}),e_=E.shape,eb=ig({experimental:e_.experimental,logging:e_.logging,completions:e_.completions,prompts:e_.prompts,resources:e_.resources,tools:e_.tools,extensions:e_.extensions}),eS=iv({progressToken:r.optional(),[iY]:aL(),[iQ]:v.optional(),[i1]:ev,[i9]:n.optional()}),e$=ig({...g.shape,...y.shape,description:aL().optional(),inputSchema:iv({$schema:aL().optional(),type:iT("object")}),outputSchema:iv({$schema:aL().optional()}).optional(),annotations:W.optional(),_meta:iP(aL(),id()).optional()}),ew=ig({type:iT("tool_result"),toolUseId:aL(),content:im(J),structuredContent:id().optional(),isError:ii().optional(),_meta:iP(aL(),id()).optional()}),eE=ib([V,F,H,K,ew]),eR=ig({role:i,content:ib([eE,im(eE)]),_meta:iP(aL(),id()).optional()}),eP=aL(),ek=iv({[i0]:v.optional().catch(void 0)}),eO=ek.optional();function ex(e){return iv({_meta:eO,resultType:eP.default("complete"),...e})}let eT=ex({}),ej=ex({nextCursor:o.optional()}),eC=ex({content:im(J),structuredContent:id().optional(),isError:ii().optional()}),eI=ex({ttlMs:it().int().min(0),cacheScope:iO(["public","private"]),tools:im(e$),nextCursor:o.optional()}),eN=ex({ttlMs:it().int().min(0),cacheScope:iO(["public","private"]),prompts:im(D),nextCursor:o.optional()}),eA=ex({description:aL().optional(),messages:im(Z)}),eM=ex({ttlMs:it().int().min(0),cacheScope:iO(["public","private"]),resources:im(N),nextCursor:o.optional()}),eq=ex({ttlMs:it().int().min(0),cacheScope:iO(["public","private"]),resourceTemplates:im(A),nextCursor:o.optional()}),ez=ex({ttlMs:it().int().min(0),cacheScope:iO(["public","private"]),contents:im(ib([j,C]))}),eL=ex({completion:ig({values:im(aL()).max(100),total:it().int().optional(),hasMore:ii().optional()}).loose()}),eD=ex({ttlMs:it().int().min(0),cacheScope:iO(["public","private"])}),eU=ex({ttlMs:it().int().min(0).catch(0),cacheScope:iO(["public","private"]).catch("private"),supportedVersions:im(aL()),capabilities:eb,instructions:aL().optional()}),eV=ig({messages:im(eR),modelPreferences:Q.optional(),systemPrompt:aL().optional(),includeContext:iO(["none","thisServer","allServers"]).optional(),temperature:it().optional(),maxTokens:it().int(),stopSequences:im(aL()).optional(),metadata:t.optional(),tools:im(e$).optional(),toolChoice:ee.optional()}),eF=ig({method:iT("sampling/createMessage"),params:eV}),eH=ig({method:iT("roots/list"),params:ig({_meta:iP(aL(),id()).optional()}).optional()}),eK=ig({...eR.shape,model:aL(),stopReason:aL().optional()}),eG=ig({roots:im(ey)}),eB=ig({action:iO(["accept","decline","cancel"]),content:iP(aL(),ib([aL(),it(),ii(),im(aL())])).optional()}),eJ=ig({mode:iT("url"),message:aL(),url:aL().url()}),eZ=ib([ef,eJ]),eW=ig({method:iT("elicitation/create"),params:eZ}),eX=ib([eF,eH,eW]),eY=ib([eK,eG,eB]),eQ=iP(aL(),eX),e0=iP(aL(),eY),e1=ex({inputRequests:eQ.optional(),requestState:aL().optional()}),e2={inputResponses:e0.optional(),requestState:aL().optional()},e9=ig({_meta:eS,...e2}),e3=iv({progressToken:r.optional()});function e5(e,t){return ig({method:iT(e),params:ig({_meta:eS,...t})})}function e4(e,t){return ig({method:iT(e),params:ig({_meta:e3.optional(),...t}).optional()})}let e6={name:aL(),arguments:iP(aL(),id()).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:aL(),arguments:iP(aL(),aL()).optional(),...e2}),to=e5("resources/list",e8),ta=e5("resources/templates/list",e8),ti=e5("resources/read",{uri:aL(),...e2}),tn={ref:ib([em,eh]),argument:ig({name:aL(),value:aL()}),context:ig({arguments:iP(aL(),aL()).optional()}).optional()},ts=e5("completion/complete",tn),tl=e5("server/discover",{}),tc=ig({toolsListChanged:ii().optional(),promptsListChanged:ii().optional(),resourcesListChanged:ii().optional(),resourceSubscriptions:im(aL()).optional()}),tu={notifications:tc},td=e5("subscriptions/listen",tu),tp=ek.extend({"io.modelcontextprotocol/subscriptionId":a}),tf=iv({_meta:tp,resultType:eP.default("complete")}),th={"tools/call":e4("tools/call",e6),"tools/list":e4("tools/list",e8),"prompts/get":e4("prompts/get",{name:aL(),arguments:iP(aL(),aL()).optional()}),"prompts/list":e4("prompts/list",e8),"resources/list":e4("resources/list",e8),"resources/templates/list":e4("resources/templates/list",e8),"resources/read":e4("resources/read",{uri:aL()}),"completion/complete":e4("completion/complete",tn),"server/discover":e4("server/discover",{}),"subscriptions/listen":e4("subscriptions/listen",tu)};function tm(e){return iv({_meta:eO,...e})}let ty={"tools/call":tm({content:im(J),structuredContent:id().optional(),isError:ii().optional()}),"tools/list":tm({ttlMs:it().int().min(0),cacheScope:iO(["public","private"]),tools:im(e$),nextCursor:o.optional()}),"prompts/get":tm({description:aL().optional(),messages:im(Z)}),"prompts/list":tm({ttlMs:it().int().min(0),cacheScope:iO(["public","private"]),prompts:im(D),nextCursor:o.optional()}),"resources/list":tm({ttlMs:it().int().min(0),cacheScope:iO(["public","private"]),resources:im(N),nextCursor:o.optional()}),"resources/templates/list":tm({ttlMs:it().int().min(0),cacheScope:iO(["public","private"]),resourceTemplates:im(A),nextCursor:o.optional()}),"resources/read":tm({ttlMs:it().int().min(0),cacheScope:iO(["public","private"]),contents:im(ib([j,C]))}),"completion/complete":tm({completion:ig({values:im(aL()).max(100),total:it().int().optional(),hasMore:ii().optional()}).loose()}),"server/discover":tm({ttlMs:it().int().min(0).catch(0),cacheScope:iO(["public","private"]).catch("private"),supportedVersions:im(aL()),capabilities:eb,instructions:aL().optional()}),"subscriptions/listen":tm({})},tg=iv({"io.modelcontextprotocol/subscriptionId":a.optional()}),tv=ig({method:iT("notifications/subscriptions/acknowledged"),params:ig({_meta:tg.optional(),notifications:tc})}),t_=ig({_meta:tg.optional(),requestId:a,reason:aL().optional()}),tb=ig({method:iT("notifications/cancelled"),params:t_}),tS=e=>ig({jsonrpc:iT("2.0"),id:ib([aL(),it().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:a,RoleSchema:i,LoggingLevelSchema:n,TaskMetadataSchema:l,RelatedTaskMetadataSchema:c,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:p,NotificationsParamsSchema:f,NotificationSchema:h,IconSchema:m,IconsSchema:y,BaseMetadataSchema:g,ImplementationSchema:v,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:$,ClientCapabilitiesSchema:w,ServerCapabilitiesSchema:E,ProgressSchema:R,ProgressNotificationParamsSchema:P,ProgressNotificationSchema:k,LoggingMessageNotificationParamsSchema:O,LoggingMessageNotificationSchema:x,ResourceContentsSchema:T,TextResourceContentsSchema:j,BlobResourceContentsSchema:C,AnnotationsSchema:I,ResourceSchema:N,ResourceTemplateSchema:A,ResourceListChangedNotificationSchema:M,ResourceUpdatedNotificationParamsSchema:q,ResourceUpdatedNotificationSchema:z,PromptArgumentSchema:L,PromptSchema:D,PromptListChangedNotificationSchema:U,TextContentSchema:V,ImageContentSchema:F,AudioContentSchema:H,ToolUseContentSchema:K,EmbeddedResourceSchema:G,ResourceLinkSchema:B,ContentBlockSchema:J,PromptMessageSchema:Z,ToolAnnotationsSchema:W,ToolListChangedNotificationSchema:X,ModelHintSchema:Y,ModelPreferencesSchema:Q,ToolChoiceSchema:ee,BooleanSchemaSchema:et,StringSchemaSchema:er,NumberSchemaSchema:eo,UntitledSingleSelectEnumSchemaSchema:ea,TitledSingleSelectEnumSchemaSchema:ei,LegacyTitledEnumSchemaSchema:en,SingleSelectEnumSchemaSchema:es,UntitledMultiSelectEnumSchemaSchema:el,TitledMultiSelectEnumSchemaSchema:ec,MultiSelectEnumSchemaSchema:eu,EnumSchemaSchema:ed,PrimitiveSchemaDefinitionSchema:ep,ElicitRequestFormParamsSchema:ef,ResourceTemplateReferenceSchema:eh,PromptReferenceSchema:em,RootSchema:ey,ClientCapabilities2026Schema:ev,ServerCapabilities2026Schema:eb,RequestMetaEnvelopeSchema:eS,ToolSchema:e$,ToolResultContentSchema:ew,SamplingMessageContentBlockSchema:eE,SamplingMessageSchema:eR,ResultTypeSchema:eP,ResultMetaSchema:ek,ResultSchema:eT,PaginatedResultSchema:ej,CallToolResultSchema:eC,ListToolsResultSchema:eI,ListPromptsResultSchema:eN,GetPromptResultSchema:eA,ListResourcesResultSchema:eM,ListResourceTemplatesResultSchema:eq,ReadResourceResultSchema:ez,CompleteResultSchema:eL,CacheableResultSchema:eD,DiscoverResultSchema:eU,CreateMessageRequestParamsSchema:eV,CreateMessageRequestSchema:eF,ListRootsRequestSchema:eH,CreateMessageResultSchema:eK,ListRootsResultSchema:eG,ElicitResultSchema:eB,ElicitRequestURLParamsSchema:eJ,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:ts,DiscoverRequestSchema:tl,SubscriptionFilterSchema:tc,SubscriptionsListenRequestSchema:td,SubscriptionsListenResultMetaSchema:tp,SubscriptionsListenResultSchema:tf,dispatchRequestSchemas:th,dispatchResultSchemas:ty,NotificationMetaSchema:tg,SubscriptionsAcknowledgedNotificationSchema:tv,CancelledNotificationParamsSchema:t_,CancelledNotificationSchema:tb,notificationSchemas2026:{"notifications/cancelled":tb,"notifications/progress":k,"notifications/message":x,"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(eT),CallToolResultResponseSchema:tS(ib([eC,e1])),ListToolsResultResponseSchema:tS(eI),ListPromptsResultResponseSchema:tS(eN),GetPromptResultResponseSchema:tS(ib([eA,e1])),ListResourcesResultResponseSchema:tS(eM),ListResourceTemplatesResultResponseSchema:tS(eq),ReadResourceResultResponseSchema:tS(ib([ez,e1])),CompleteResultResponseSchema:tS(eL),DiscoverResultResponseSchema:tS(eU),SubscriptionsListenResultResponseSchema:tS(tf)}}()}let dG=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"],dB=Symbol("modelcontextprotocol.resultCacheHintFallback");function dJ(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function dZ(e){return"public"===e||"private"===e}let dW=((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 dX=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](e){return dm(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 dm(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="ProtocolError",dh(this,new.target)}static fromError(t,r,o){return t===dW.UrlElicitationRequired&&o&&o.elicitations?new dQ(o.elicitations,r):t===dW.UnsupportedProtocolVersion&&o&&Array.isArray(o.supported)&&"string"==typeof o.requested?new d0({supported:o.supported,requested:o.requested},r):(t===dW.InvalidParams||t===dW.ResourceNotFound)&&"string"==typeof o?.uri&&(t===dW.ResourceNotFound||1===Object.keys(o).length)?new dY(o.uri,r):t===dW.MissingRequiredClientCapability&&o&&null!==o.requiredCapabilities&&"object"==typeof o.requiredCapabilities&&!Array.isArray(o.requiredCapabilities)?new d1({requiredCapabilities:o.requiredCapabilities},r):new e(t,r,o)}},dY=class extends dX{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(dW.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},dQ=class extends dX{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(dW.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},d0=class extends dX{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(dW.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},d1=class extends dX{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(dW.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};let d2=["tools/call","prompts/get","resources/read"],d9=["elicitation/create","sampling/createMessage","roots/list"];function d3(){if(c)return c;let e=dK();return c={request:{"elicitation/create":ig({method:iT("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":ig({method:iT("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":ig({method:iT("roots/list"),params:iv({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}}}function d5(e){return d9.includes(e)}function d4(e){return d5(e)?d3().request[e]:void 0}let d6={"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},d8={"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 d7(e){return Object.prototype.hasOwnProperty.call(d6,e)}function pe(e){return Object.prototype.hasOwnProperty.call(d8,e)}function pt(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function pr(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(d6),Object.keys(d8);let po={ok:!1,reason:"not-in-era"},pa=[iY,i1],pi={era:"2026-07-28",hasRequestMethod:d7,hasNotificationMethod:pe,hasInputRequestMethod:e=>void 0!==d4(e),validateRequest:(e,t)=>pr(d7(e)?dK().dispatchRequestSchemas[e]:void 0,t),validateResult:(e,t)=>pr(Object.prototype.hasOwnProperty.call(d6,e)?dK().dispatchResultSchemas[e]:void 0,t),validateNotification:(e,t)=>pr(pe(e)?dK().notificationSchemas2026[e]:void 0,t),validateInputRequest:(e,t)=>pr(d4(e),t),validateInputResponse:(e,t)=>pr(d5(e)?d3().response[e]:void 0,t),samplingResultVariant:()=>po,outboundEnvelope:e=>({[iY]:e.protocolVersion,[iQ]:e.clientInfo,[i1]:e.clientCapabilities,...void 0!==e.logLevel&&{[i9]:e.logLevel}}),validateEnvelopeMeta(e){let t=[];for(let r of pa)r in e||t.push({key:r,problem:"missing"});let r=dK().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=>dP(e),inputRequestSchema:d4,decodeResult(e,t){if(!pt(t))return{kind:"invalid",error:new d_(dv.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(void 0===r)return{kind:"invalid",error:new d_(dv.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 d_(dv.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if("input_required"===r){let r=t.inputRequests,o=pt(r)?r:{},a=t.requestState,i=void 0===t._meta?void 0:dK().ResultMetaSchema.safeParse(t._meta),n=i?.success?i.data:void 0;return 0===Object.keys(o).length&&"string"!=typeof a?{kind:"invalid",error:new d_(dv.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},...void 0!==n&&{_meta:n}}}if("complete"!==r)return{kind:"invalid",error:new d_(dv.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=function(){if(u)return u;let e=dK();return u={"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 d_(dv.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:{[i0]:t}}:null===r||"object"!=typeof r||Array.isArray(r)||void 0!==r[i0]?e:{...e,_meta:{...r,[i0]:t}}})(function(e,t){var r,o;let a=t[dB];if("complete"!==t.resultType||!dG.includes(e)){let e;return void 0===a?t:(e={...t},delete e[dB],e)}let i=dJ(t.ttlMs)?t.ttlMs:void 0!==(r=a)&&dJ(r.ttlMs)?r.ttlMs:0,n=dZ(t.cacheScope)?t.cacheScope:void 0!==(o=a)&&dZ(o.cacheScope)?o.cacheScope:"private",s={...t,ttlMs:i,cacheScope:n};return delete s[dB],s}(e,function(e,t){let r=t.resultType;if(void 0===r)return{...t,resultType:"complete"};if("complete"===r||d2.includes(e))return t;throw new dX(dW.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=>pt(e)&&"execution"in e)&&(a().tools=i.map(e=>{if(!pt(e)||!("execution"in e))return e;let t={...e};return delete t.execution,t}));let n=t.capabilities;if(pt(n)&&"tasks"in n){let e={...n};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=dK().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("; ")}`}},pn="2026-07-28";function ps(e){return void 0!==e&&e>=d$?pi:dH}function pl(e){return void 0!==e.revision?ps(e.revision).era:"modern"===e.era?pi.era:dH.era}function pc(e){return pp.some(t=>t.hasRequestMethod(e))}function pu(e){return pp.some(t=>t.hasNotificationMethod(e))}function pd(e){return"tasks/get"===e||"tasks/cancel"===e}let pp=[dH,pi];var pf=(e=>{let t={};for(var r in e)dt(t,r,{get:e[r],enumerable:!0});return t})({AnnotationsSchema:()=>nB,AudioContentSchema:()=>sf,BaseMetadataSchema:()=>nS,BaseRequestParamsSchema:()=>nr,BlobResourceContentsSchema:()=>nK,BooleanSchemaSchema:()=>sJ,CallToolRequestParamsSchema:()=>sO,CallToolRequestSchema:()=>sx,CallToolResultSchema:()=>sP,CancelTaskRequestSchema:()=>lE,CancelTaskResultSchema:()=>lR,CancelledNotificationParamsSchema:()=>ng,CancelledNotificationSchema:()=>nv,ClientCapabilitiesSchema:()=>nk,ClientNotificationSchema:()=>lk,ClientRequestSchema:()=>lP,ClientResultSchema:()=>lO,ClientTasksCapabilitySchema:()=>nR,CompatibilityCallToolResultSchema:()=>sk,CompleteRequestParamsSchema:()=>li,CompleteRequestSchema:()=>ln,CompleteResultSchema:()=>ls,ContentBlockSchema:()=>sg,CreateMessageRequestParamsSchema:()=>sH,CreateMessageRequestSchema:()=>sK,CreateMessageResultSchema:()=>sG,CreateMessageResultWithToolsSchema:()=>sB,CreateTaskResultSchema:()=>lm,CursorSchema:()=>i8,DiscoverRequestSchema:()=>nI,DiscoverResultSchema:()=>nN,ElicitRequestFormParamsSchema:()=>s4,ElicitRequestParamsSchema:()=>s8,ElicitRequestSchema:()=>s7,ElicitRequestURLParamsSchema:()=>s6,ElicitResultSchema:()=>lr,ElicitationCompleteNotificationParamsSchema:()=>le,ElicitationCompleteNotificationSchema:()=>lt,EmbeddedResourceSchema:()=>sm,EmptyResultSchema:()=>ny,EnumSchemaSchema:()=>s3,GetPromptRequestParamsSchema:()=>sc,GetPromptRequestSchema:()=>su,GetPromptResultSchema:()=>s_,GetTaskPayloadRequestSchema:()=>lb,GetTaskPayloadResultSchema:()=>lS,GetTaskRequestSchema:()=>lv,GetTaskResultSchema:()=>l_,IconSchema:()=>n_,IconsSchema:()=>nb,ImageContentSchema:()=>sp,ImplementationSchema:()=>n$,InitializeRequestParamsSchema:()=>nO,InitializeRequestSchema:()=>nx,InitializeResultSchema:()=>nj,InitializedNotificationSchema:()=>nC,JSONArraySchema:()=>i4,JSONObjectSchema:()=>i5,JSONRPCErrorResponseSchema:()=>nf,JSONRPCMessageSchema:()=>nh,JSONRPCNotificationSchema:()=>nd,JSONRPCRequestSchema:()=>nu,JSONRPCResponseSchema:()=>nm,JSONRPCResultResponseSchema:()=>np,JSONValueSchema:()=>i3,LegacyTitledEnumSchemaSchema:()=>sQ,ListChangedOptionsBaseSchema:()=>sj,ListPromptsRequestSchema:()=>ss,ListPromptsResultSchema:()=>sl,ListResourceTemplatesRequestSchema:()=>nY,ListResourceTemplatesResultSchema:()=>nQ,ListResourcesRequestSchema:()=>nW,ListResourcesResultSchema:()=>nX,ListRootsRequestSchema:()=>lc,ListRootsResultSchema:()=>lu,ListTasksRequestSchema:()=>l$,ListTasksResultSchema:()=>lw,ListToolsRequestSchema:()=>sE,ListToolsResultSchema:()=>sR,LoggingLevelSchema:()=>sC,LoggingMessageNotificationParamsSchema:()=>sA,LoggingMessageNotificationSchema:()=>sM,ModelHintSchema:()=>sq,ModelPreferencesSchema:()=>sz,MultiSelectEnumSchemaSchema:()=>s9,NotificationSchema:()=>nn,NotificationsParamsSchema:()=>ni,NumberSchemaSchema:()=>sW,PaginatedRequestParamsSchema:()=>nL,PaginatedRequestSchema:()=>nD,PaginatedResultSchema:()=>nU,PingRequestSchema:()=>nA,PrimitiveSchemaDefinitionSchema:()=>s5,ProgressNotificationParamsSchema:()=>nq,ProgressNotificationSchema:()=>nz,ProgressSchema:()=>nM,ProgressTokenSchema:()=>i6,PromptArgumentSchema:()=>si,PromptListChangedNotificationSchema:()=>sb,PromptMessageSchema:()=>sv,PromptReferenceSchema:()=>la,PromptSchema:()=>sn,ReadResourceRequestParamsSchema:()=>n0,ReadResourceRequestSchema:()=>n1,ReadResourceResultSchema:()=>n2,RelatedTaskMetadataSchema:()=>ne,RequestIdSchema:()=>nc,RequestMetaSchema:()=>nt,RequestSchema:()=>na,ResourceContentsSchema:()=>nV,ResourceLinkSchema:()=>sy,ResourceListChangedNotificationSchema:()=>n9,ResourceRequestParamsSchema:()=>n0,ResourceSchema:()=>nJ,ResourceTemplateReferenceSchema:()=>lo,ResourceTemplateSchema:()=>nZ,ResourceUpdatedNotificationParamsSchema:()=>so,ResourceUpdatedNotificationSchema:()=>sa,ResultMetaObjectSchema:()=>ns,ResultSchema:()=>nl,RoleSchema:()=>nG,RootSchema:()=>ll,RootsListChangedNotificationSchema:()=>ld,SamplingContentSchema:()=>sU,SamplingMessageContentBlockSchema:()=>sV,SamplingMessageSchema:()=>sF,ServerCapabilitiesSchema:()=>nT,ServerNotificationSchema:()=>lT,ServerRequestSchema:()=>lx,ServerResultSchema:()=>lj,ServerTasksCapabilitySchema:()=>nP,SetLevelRequestParamsSchema:()=>sI,SetLevelRequestSchema:()=>sN,SingleSelectEnumSchemaSchema:()=>s0,StringSchemaSchema:()=>sZ,SubscribeRequestParamsSchema:()=>n0,SubscribeRequestSchema:()=>n3,SubscriptionFilterSchema:()=>n4,SubscriptionsAcknowledgedNotificationParamsSchema:()=>n7,SubscriptionsAcknowledgedNotificationSchema:()=>se,SubscriptionsListenRequestParamsSchema:()=>n6,SubscriptionsListenRequestSchema:()=>n8,SubscriptionsListenResultMetaSchema:()=>st,SubscriptionsListenResultSchema:()=>sr,TaskAugmentedRequestParamsSchema:()=>no,TaskCreationParamsSchema:()=>lp,TaskMetadataSchema:()=>i7,TaskSchema:()=>lh,TaskStatusNotificationParamsSchema:()=>ly,TaskStatusNotificationSchema:()=>lg,TaskStatusSchema:()=>lf,TextContentSchema:()=>sd,TextResourceContentsSchema:()=>nF,TitledMultiSelectEnumSchemaSchema:()=>s2,TitledSingleSelectEnumSchemaSchema:()=>sY,ToolAnnotationsSchema:()=>sS,ToolChoiceSchema:()=>sL,ToolExecutionSchema:()=>s$,ToolListChangedNotificationSchema:()=>sT,ToolResultContentSchema:()=>sD,ToolSchema:()=>sw,ToolUseContentSchema:()=>sh,UnsubscribeRequestParamsSchema:()=>n0,UnsubscribeRequestSchema:()=>n5,UntitledMultiSelectEnumSchemaSchema:()=>s1,UntitledSingleSelectEnumSchemaSchema:()=>sX});let ph=e=>np.safeParse(e).success,pm=e=>nf.safeParse(e).success,py=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&"input_required"===e.resultType,pg="x-mcp-header",pv=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,p_=new Set(["string","integer","boolean"]);function pb(e){let t,r=[],o=new Map,a=(e,i,n)=>{if(null===e||"object"!=typeof e)return;if(pg in e){if(!n||0===i.length)return`${pw(i)}: 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 a=e[pg];if("string"!=typeof a||0===a.length)return`${pw(i)}: x-mcp-header MUST be a non-empty string`;if(!pv.test(a))return`${pw(i)}: x-mcp-header '${a}' 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||!p_.has(s)){let e=`${pw(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${s??"<none>"}`;if("number"!==s)return e;t??=e}let l=a.toLowerCase(),c=o.get(l);if(void 0!==c)return`x-mcp-header '${a}' is not case-insensitively unique (also declared as '${c}')`;o.set(l,a),r.push({path:i,headerName:a,type:s})}let s=e.properties;if(null!==s&&"object"==typeof s)for(let[e,t]of Object.entries(s)){let r=a(t,[...i,e],n);if(void 0!==r)return r}for(let t of pS){let r=e[t];if(void 0!==r)for(let e of Array.isArray(r)?r:null!==r&&"object"==typeof r&&p$.has(t)?Object.values(r):[r]){let r=a(e,[...i,`<${t}>`],!1);if(void 0!==r)return r}}},i=a(e,[],!0);return void 0!==i?{valid:!1,reason:t??i}:void 0===t?{valid:!0,declarations:r}:{valid:!1,reason:t,declarations:r}}let pS=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],p$=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function pw(e){return 0===e.length?"<root>":e.join(".")}let pE="=?base64?";function pR(e){return!function(e){if(0===e.length||e.startsWith(pE)&&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:`${pE}${function(e){let t=new TextEncoder().encode(e),r="";for(let e of t)r+=String.fromCodePoint(e);return btoa(r)}(e)}?=`}dW.InvalidRequest,dW.UnsupportedProtocolVersion,dW.InvalidParams,dW.MethodNotFound,dW.InvalidParams,dW.MissingRequiredClientCapability,dW.ParseError,dW.InvalidRequest,dW.MethodNotFound,dW.UnsupportedProtocolVersion,dW.MissingRequiredClientCapability;let pP={"tools/call":"name","prompts/get":"name","resources/read":"uri","tasks/get":"taskId","tasks/update":"taskId","tasks/cancel":"taskId"};function pk(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function pO(e){if(null==e)return!1;let t=typeof e;return("object"===t||"function"===t)&&"~standard"in e&&"function"==typeof e["~standard"]?.validate}let px=!1,pT="draft-2020-12",pj=/^#\/(\$defs|definitions)\/([^/~%]+)$/;async function pC(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 pI=/\\\.\\d\{(\d+)\}/;function pN(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let pA=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function pM(e){return pA.has(e)||e.startsWith("x-")}let pq=new Set(["$schema",...Object.keys(s4.shape.requestedSchema.shape)]),pz={string:pk([sZ,sX,sY,sQ]),number:pk([sW]),integer:pk([sW]),boolean:pk([sJ]),array:pk([s1,s2])},pL=new Set(sZ.shape.format.unwrap().options);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(!pO(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&&pN(i)?r[a]=Object.fromEntries(Object.entries(i).map(([e,r])=>[e,function(e,t,r,o){if(!pN(e))return e;let a="string"==typeof e.type&&Object.hasOwn(pz,e.type)?pz[e.type]:void 0;if(void 0===a)return e;let i={};for(let[s,l]of Object.entries(e))if(a.has(s)||pM(s))i[s]=l;else if("pattern"===s&&"string"===e.type&&"string"==typeof e.format)if(pL.has(e.format)){var n;"string"==typeof l&&(n=e.format,"zod"!==r||(function(e,t){let r;switch(e){case"email":r=[oe(aK,void 0)];break;case"uri":r=[ot(aJ,void 0)];break;case"date":r=[oo(aV,void 0)];break;case"date-time":let o,a;o=pI.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=>or(aU,{local:e,offset:t,precision:r}))))}return new Set(r.map(e=>{let t;return t=an(e,{target:pT,io:"input"}),"string"==typeof t.pattern?t.pattern:void 0}).filter(e=>void 0!==e))})(n,l).has(l))||o.push(`${t}.${s}`)}else i[s]=l;else o.push(`${t}.${s}`);return i}(r,`properties.${e}`,t,o)])):pq.has(a)?r[a]=i:pM(a)||o.push(a);if(o.length>0)throw new dX(dW.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:pT});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().");px||(px=!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=an(e,{target:pT,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,r=t){if("properties"in t||"patternProperties"in t||"additionalProperties"in t||"required"in t)return!0;let o="string"==typeof t.$ref&&pj.exec(t.$ref);if(o&&r[o[1]]?.[o[2]]?.type==="object")return!0;for(let o of["oneOf","anyOf","allOf"]){let a=t[o];if(Array.isArray(a)&&a.length>0)return a.every(t=>null!==t&&"object"==typeof t&&("object"===t.type||e(t,"$id"in t?{}:r)))}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 dX(dW.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${e}`)}}(e.requestedSchema),r),a=(t=s4.shape.requestedSchema,aR(t,o));if(!a.success)throw new dX(dW.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(e,t){if(!pN(e.properties))return t;let r=Object.entries(e.properties).filter(([,e])=>!aR(s5,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}]`)):pN(t)&&pN(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):pM(t)?[]:[i]}):[]}(o,a.data);if(i.length>0)throw new dX(dW.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(", ")}`);let n=(a.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(a.data.properties,e));if(n.length>0)throw new dX(dW.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${n.join(", ")}`);return{...e,mode:"form",requestedSchema:a.data}}(e)}}catch(e){throw e instanceof dX?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 pD={},pU={};function pV(e,t){let r=e.slice(0,-6);pD[r]=t,pU[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"])pV(e,pf[e]);for(let[e,t]of Object.entries({IdJagTokenExchangeResponseSchema:lz,OAuthClientInformationFullSchema:lF,OAuthClientInformationSchema:lV,OAuthClientMetadataSchema:lU,OAuthClientRegistrationErrorSchema:lH,OAuthErrorResponseSchema:lL,OAuthMetadataSchema:lN,OAuthProtectedResourceMetadataSchema:lI,OAuthTokenRevocationRequestSchema:lK,OAuthTokensSchema:lq,OpenIdProviderDiscoveryMetadataSchema:lM,OpenIdProviderMetadataSchema:lA}))pV(e,t);Object.freeze(pD);let pF=Object.freeze(pU),pH=[iY,iQ,i1,i9],pK=["inputResponses","requestState"];function pG(e,t){let r=e.params;if(!pW(r))return{message:e,lifted:{}};let o=r._meta,a=pW(o)?pH.filter(e=>e in o):[],i="request"===t?pK.filter(e=>e in r):[];if(0===a.length&&0===i.length)return{message:e,lifted:{}};let n={},s={...r};if(a.length>0&&pW(o)){let e={},t={...o};for(let r of a)e[r]=o[r],delete t[r];n.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of i)"inputResponses"===e&&(n.inputResponses=s[e]),"requestState"===e&&(n.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:n}}function pB(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 pJ=(k=void 0,()=>k);var pZ=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_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??iX,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 d_(dv.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){void 0!==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 d_(dv.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),ph(e)||pm(e))this._onresponse(e);else if(nu.safeParse(e).success)this._onrequest(e,t);else nd.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 d_(dv.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}=pG(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&"drop"===this._shouldDropInbound(e))return;if(t?.classification!==void 0){let e=pl(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(pu(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}=pG(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 n=this._transport,s=(e,t,r)=>{let a={jsonrpc:"2.0",id:o.id,error:{code:e,message:t,...void 0!==r&&{data:r}}};n?.send(a).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=pl(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;s(dW.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(pc(o.method)&&!i.hasRequestMethod(o.method)&&!(pd(o.method)&&this._customSchemaRequestMethods.has(o.method)))return void s(dW.MethodNotFound,"Method not found");let l=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(void 0===l)return void s(dW.MethodNotFound,"Method not found");let c=i.checkInboundEnvelope(a);if(void 0!==c)return void s(dW.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 f=void 0===a.inputResponses?void 0:function(e){let t={},r=[];if(!pX(e))return{accepted:t,droppedKeys:r};for(let[o,a]of Object.entries(e)){if(!pX(a)||"method"in a||"result"in a){r.push(o);continue}t[o]=a}return{accepted:t,droppedKeys:r}}(a.inputResponses),h={sessionId:n?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...void 0!==a.envelope&&{envelope:a.envelope},...void 0!==f&&{inputResponses:f.accepted},...void 0!==f&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:void 0===a.requestState?pJ:(r=a.requestState,()=>r),signal:p.signal,send:(e,t,r)=>{let o=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(o,e.method),pO(t))return d(e,t,r);let a=pB(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(h,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}`)),s(dW.InternalError,"Internal error");return}let r={result:t,jsonrpc:"2.0",id:o.id};await n?.send(r)},async e=>{if(p.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:dW.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 n?.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),n=this._timeoutInfo.get(o);if(n&&i&&n.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(ph(e)?e:dX.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(pO(t))return pd(e.method)||this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r);this._assertOutboundRequestInEra(o,e.method);let a=pB(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 ps(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 ps(void 0);case"server/discover":return ps(pn);default:return}}(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(pc(t)&&!e.hasRequestMethod(t))throw new d_(dv.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:n,resumptionToken:s,onresumptiontoken:l,headers:c}=o??{},u=Date.now();return new Promise((d,p)=>{let f=e=>{p(e)};if(!this._transport)return void f(Error("Not connected"));if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){f(e);return}if(o?.signal?.aborted){let e=o.signal.reason;throw e instanceof d_?e:new d_(dv.RequestTimeout,String(e))}let h=e.era===pn&&!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,_=e=>{v||(this._progressHandlers.delete(m),void 0===h?"initialize"!==t.method&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(e)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:l}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):h.abort(),p(e instanceof d_?e:new d_(dv.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 n;return o?.allowInputRequired===!0?d({resultType:"input_required",inputRequests:(n=i).inputRequests,...void 0!==n.requestState&&{requestState:n.requestState},...void 0!==n._meta&&{_meta:n._meta}}):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)}))}pC(r,i.result).then(e=>{e.success?d(e.data):p(new d_(dv.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},p)}}),a=()=>_(o?.signal?.reason),o?.signal?.addEventListener("abort",a,{once:!0});let b=o?.timeout??6e4;this._setupTimeout(m,b,o?.maxTotalTimeout,()=>_(new d_(dv.RequestTimeout,"Request timed out",{timeout:b})),o?.resetTimeoutOnProgress??!1),this._transport.send(g,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:l,headers:c,requestSignal:h?.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 await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new d_(dv.NotConnected,"Not connected");if(pu(t.method)&&!e.hasNotificationMethod(t.method))throw new d_(dv.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===void 0){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(!pc(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 dX(dW.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 pC(t.params,{...o.params});if(!i.success)throw new dX(dW.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,a)};else throw TypeError("setRequestHandler: handler is required");"function"==typeof t?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.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(!pu(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 dX(dW.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 pC(t.params,{...o.params});if(!a.success)throw new dX(dW.InvalidParams,`Invalid params for notification ${e}: ${a.error}`);await r(a.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function pW(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function pX(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function pY(e){throw new d_(dv.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}var pQ=dl((ds(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,n,s,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;n=t.exec(l);){if(n.index!==c)throw TypeError("invalid parameter format");c+=n[0].length,i=n[1].toLowerCase(),34===(s=n[2]).charCodeAt(0)&&-1!==(s=s.slice(1,-1)).indexOf("\\")&&(s=s.replace(r,"$1")),d.parameters[i]=s}if(c!==l.length)throw TypeError("invalid parameter format")}return d}}))(),1),p0=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,nh.parse(JSON.parse(e))}catch(e){if(e instanceof SyntaxError)continue;throw e}}return null}clear(){this._buffer=void 0}};function p1(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}let p2=new Set([301,302,303,307,308]);function p9(e,t){let r=p2.has(t.status)?t.headers?.get("location"):void 0;if(r)try{return new URL(r,e)}catch{return}}let p3=new WeakSet;function p5(e){return p3.has(e)?e:async(t,r)=>{if(r?.redirect==="error"||r?.redirect==="manual")return e(t,r);let o=(r?.method??"GET").toUpperCase(),a=t;for(let t=0;;t++){let i=await e(a,{...r,redirect:"manual"}),n=p9(a,i);if(!n||5===t)return i;let s=new URL(a),l="GET"===o||307===i.status||308===i.status,c=!(n.username||n.password)||n.username===s.username&&n.password===s.password;if(!l||!c||(s.protocol!==n.protocol||s.host!==n.host)&&("http:"!==s.protocol||"https:"!==n.protocol||s.hostname!==n.hostname||s.port||n.port))return i;await i.text?.().catch(()=>{}),a=n}}}var p4=ds(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;)s(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 n(e,...t){let a=[l(e[0])],c=0;for(;c<t.length;)a.push(i),s(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 s(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=n,e.addCodeArg=s,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:n`${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())}}),p6=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=p4();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 n=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=n;let s=(0,t._)`\n`;var l=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new n(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,n=this._values[a];if(n){let e=n.get(i);if(e)return e}else n=this._values[a]=new Map;n.set(i,o);let s=this._scope[a]||(this._scope[a]=[]),l=s.length;return s[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,n={},s){let l=t.nil;for(let c in r){let u=r[c];if(!u)continue;let d=n[c]=n[c]||new Map;u.forEach(r=>{if(d.has(r))return;d.set(r,o.Started);let n=i(r);if(n){let o=this.opts.es5?e.varKinds.var:e.varKinds.const;l=(0,t._)`${l}${o} ${r} = ${n};${this.opts._n}`}else if(n=null==s?void 0:s(r))l=(0,t._)`${l}${n}${this.opts._n}`;else throw new a(r);d.set(r,o.Completed)})}return l}};e.ValueScope=l}),p8=ds(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=p4(),r=p6();var o=p4();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=p6();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}},n=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=T(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=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=T(this.rhs,e,r),this}get names(){return x(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},l=class extends s{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=T(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},f=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)=>O(e,t.names),{})}},h=class extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},m=class extends f{},y=class extends h{};y.kind="else";var g=class e extends h{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=T(this.condition,e,t),this}get names(){let e=super.names;return x(e,this.condition),this.else&&O(e,this.else.names),e}};g.kind="if";var v=class extends h{};v.kind="for";var _=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=T(this.iteration,e,t),this}get names(){return O(super.names,this.iteration.names)}},b=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 x(x(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=T(this.iterable,e,t),this}get names(){return O(super.names,this.iterable.names)}},$=class extends h{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 f{render(e){return"return "+super.render(e)}};w.kind="return";var E=class extends h{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&&O(e,this.catch.names),this.finally&&O(e,this.finally.names),e}},R=class extends h{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};R.kind="catch";var P=class extends h{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 n(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 s(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 _(e),t)}forRange(e,t,o,a,i=this.opts.es5?r.varKinds.var:r.varKinds.let){let n=this._scope.toName(e);return this._for(new b(i,n,t,o),()=>a(n))}forOf(e,o,a,i=r.varKinds.const){let n=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(n,(0,t._)`${e}[${r}]`),a(n)})}return this._for(new S("of",i,n,o),()=>a(n))}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 n=this._scope.toName(e);return this._for(new S("in",i,n,o),()=>a(n))}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 O(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function x(e,r){return r instanceof t._CodeOrName?O(e,r.names):e}function T(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=N(e.operators.AND);e.and=function(...e){return e.reduce(C)};let I=N(e.operators.OR);function N(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(I)}}),p7=ds(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=p8(),a=p4();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]||f(e,`unknown keyword: "${r}"`)}function n(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function s(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,n,s,l)=>{let c=void 0===s?n:s instanceof o.Name?(n instanceof o.Name?e(i,n,s):t(i,n,s),s):n instanceof o.Name?(t(i,s,n),n):r(n,s);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),!n(t,e.self.RULES.all))},e.checkUnknownRules=i,e.schemaHasRules=n,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(s(e))},e.escapeJsonPointer=s,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 f(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():"/"+s(e)},e.checkStrictMode=f}),fe=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8();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")}}),ft=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=p8(),r=p7(),o=fe();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,n,l){let{it:c}=r,{gen:u,compositeRule:d,allErrors:p}=c,f=s(r,o,n);(null!=l?l:d||p)?a(u,f):i(c,(0,t._)`[${f}]`)},e.reportExtraError=function(t,r=e.keywordError,n){let{it:l}=t,{gen:c,compositeRule:u,allErrors:d}=l;a(c,s(t,r,n)),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:n,it:s}){if(void 0===n)throw Error("ajv implementation error");let l=e.name("err");e.forRange("i",n,o.default.errors,n=>{e.const(l,(0,t._)`${o.default.vErrors}[${n}]`),e.if((0,t._)`${l}.instancePath === undefined`,()=>e.assign((0,t._)`${l}.instancePath`,(0,t.strConcat)(o.default.instancePath,s.errorPath))),e.assign((0,t._)`${l}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${r}`),s.opts.verbose&&(e.assign((0,t._)`${l}.schema`,a),e.assign((0,t._)`${l}.data`,i))})};let n={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 s(e,a,i){let{createErrors:s}=e.it;return!1===s?(0,t._)`{}`:function(e,a,i={}){let{gen:s,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 s=i?o:(0,t.str)`${o}/${e}`;return a&&(s=(0,t.str)`${s}${(0,r.getErrorPath)(a,r.Type.Str)}`),[n.schemaPath,s]}(e,i)];return function(e,{params:r,message:a},i){let{keyword:s,data:l,schemaValue:c,it:u}=e,{opts:d,propertyName:p,topSchemaRef:f,schemaPath:h}=u;i.push([n.keyword,s],[n.params,"function"==typeof r?r(e):r||(0,t._)`{}`]),d.messages&&i.push([n.message,"function"==typeof a?a(e):a]),d.verbose&&i.push([n.schema,c],[n.parentSchema,(0,t._)`${f}${h}`],[o.default.data,l]),p&&i.push([n.propertyName,p])}(e,a,c),s.object(...c)}(e,a,i)}}),fr=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=ft(),r=p8(),o=fe(),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:n}=e;!1===a?i(e,!1):"object"==typeof a&&!0===a.$async?t.return(o.default.data):(t.assign((0,r._)`${n}.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)}}),fo=ds(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:{}}}}),fa=ds(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}),fi=ds(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=fo(),a=fa(),i=ft(),n=p8(),s=p7();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:s,data:l,opts:u}=e,p=(o=r,(i=u.coerceTypes)?o.filter(e=>c.has(e)||"array"===i&&"array"===e):[]),h=r.length>0&&!(0===p.length&&1===r.length&&(0,a.schemaHasRulesForType)(e,r[0]));if(h){let o=d(r,l,u.strictNumbers,t.Wrong);s.if(o,()=>{p.length?function(e,t,r){let{gen:o,data:a,opts:i}=e,s=o.let("dataType",(0,n._)`typeof ${a}`),l=o.let("coerced",(0,n._)`undefined`);for(let e of("array"===i.coerceTypes&&o.if((0,n._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>o.assign(a,(0,n._)`${a}[0]`).assign(s,(0,n._)`typeof ${a}`).if(d(t,a,i.strictNumbers),()=>o.assign(l,a))),o.if((0,n._)`${l} !== undefined`),r))(c.has(e)||"array"===e&&"array"===i.coerceTypes)&&function(e){switch(e){case"string":o.elseIf((0,n._)`${s} == "number" || ${s} == "boolean"`).assign(l,(0,n._)`"" + ${a}`).elseIf((0,n._)`${a} === null`).assign(l,(0,n._)`""`);return;case"number":o.elseIf((0,n._)`${s} == "boolean" || ${a} === null
|
|
66
|
+
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),n(e,r)}};function i(e,r=e.schema){let{gen:a,data:n,it:s}=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,n,i,s.opts.ownProperties);e.setParams({property:i,depsCount:c.length,deps:c.join(", ")}),s.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 n(e,t=e.schema){let{gen:a,data:i,keyword:s,it:l}=e,c=a.name("valid");for(let n in t)(0,r.alwaysValidSchema)(l,t[n])||(a.if((0,o.propertyInData)(a,i,n,l.opts.ownProperties),()=>{let t=e.subschema({keyword:s,schemaProp:n},c);e.mergeValidEvaluated(t,c)},()=>a.var(c,!0)),e.ok(c))}e.validatePropertyDeps=i,e.validateSchemaDeps=n,e.default=a}),uc=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP(),r=cO();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:n}=e;if((0,r.alwaysValidSchema)(n,a))return;let s=o.name("valid");o.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},s),o.if((0,t.not)(s),()=>{e.error(!0),n.allErrors||o.break()})}),e.ok(s)}}}),uu=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cA(),r=cP(),o=ck(),a=cO();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:n,parentSchema:s,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,n))return;let f=(0,t.allSchemaProperties)(s.properties),h=(0,t.allSchemaProperties)(s.patternProperties);function m(e){i.code((0,r._)`delete ${l}[${e}]`)}function y(t){if("all"===p.removeAdditional||p.removeAdditional&&!1===n)return void m(t);if(!1===n){e.setParams({additionalProperty:t}),e.error(),d||i.break();return}if("object"==typeof n&&!(0,a.alwaysValidSchema)(u,n)){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=>{f.length||h.length?i.if(function(o){let n;if(f.length>8){let e=(0,a.schemaRefOrVal)(u,s.properties,"properties");n=(0,t.isOwnProperty)(i,e,o)}else n=f.length?(0,r.or)(...f.map(e=>(0,r._)`${o} === ${e}`)):r.nil;return h.length&&(n=(0,r.or)(n,...h.map(a=>(0,r._)`${(0,t.usePattern)(e,a)}.test(${o})`))),(0,r.not)(n)}(o),()=>y(o)):y(o)}),e.ok((0,r._)`${c} === ${o.default.errors}`)}}}),ud=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cU(),r=cA(),o=cO(),a=uu();e.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:i,schema:n,parentSchema:s,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===s.additionalProperties&&a.default.code(new t.KeywordCxt(c,a.default,"additionalProperties"));let u=(0,r.allSchemaProperties)(n);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,n[e]));if(0===d.length)return;let p=i.name("valid");for(let t of d){var f;(f=t,c.opts.useDefaults&&!c.compositeRule&&void 0!==n[f].default)?h(t):(i.if((0,r.propertyInData)(i,l,t,c.opts.ownProperties)),h(t),c.allErrors||i.else().var(p,!0),i.endIf()),e.it.definedProperties.add(t),e.ok(p)}function h(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}}}),up=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cA(),r=cP(),o=cO(),a=cO();e.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:i,schema:n,data:s,parentSchema:l,it:c}=e,{opts:u}=c,d=(0,t.allSchemaProperties)(n),p=d.filter(e=>(0,o.alwaysValidSchema)(c,n[e]));if(0===d.length||p.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;let f=u.strictSchema&&!u.allowMatchingProperties&&l.properties,h=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)f&&function(e){for(let t in f)new RegExp(e).test(t)&&(0,o.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),c.allErrors?y(e):(i.var(h,!0),y(e),i.if(h));function y(o){i.forIn("key",s,n=>{i.if((0,r._)`${(0,t.usePattern)(e,o)}.test(${n})`,()=>{let t=p.includes(o);t||e.subschema({keyword:"patternProperties",schemaProp:o,dataProp:n,dataPropType:a.Type.Str},h),c.opts.unevaluated&&!0!==m?i.assign((0,r._)`${m}[${n}]`,!0):t||c.allErrors||i.if((0,r.not)(h),()=>i.break())})})}}}}),uf=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cO();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"}}}),uh=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cA().validateUnion,error:{message:"must match a schema in anyOf"}}}),um=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP(),r=cO();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:n}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let s=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)(n,a)?o.var(c,!0):u=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},c),i>0&&o.if((0,t._)`${c} && ${s}`).assign(s,!1).assign(l,(0,t._)`[${l}, ${i}]`).else(),o.if(c,()=>{o.assign(s,!0),o.assign(l,i),u&&e.mergeEvaluated(u,t.Name)})})}),e.result(s,()=>e.reset(),()=>e.error(!0))}}}),uy=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cO();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 n=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(n)})}}}),ug=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP(),r=cO();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:n,it:s}=e;void 0===n.then&&void 0===n.else&&(0,r.checkStrictMode)(s,'"if" without "then" and "else" is ignored');let l=o(s,"then"),c=o(s,"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))}}}),uv=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cO();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`)}}}),u_=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uo(),r=ui(),o=ua(),a=un(),i=us(),n=ul(),s=uc(),l=uu(),c=ud(),u=up(),d=uf(),p=uh(),f=um(),h=uy(),m=ug(),y=uv();e.default=function(e=!1){let g=[d.default,p.default,f.default,h.default,m.default,y.default,s.default,l.default,n.default,c.default,u.default];return e?g.push(r.default,a.default):g.push(t.default,o.default),g.push(i.default),g}}),ub=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP();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,n,s,l,{gen:c,data:u,$data:d,schema:p,schemaCode:f,it:h}=e,{opts:m,errSchemaPath:y,schemaEnv:g,self:v}=h;m.validateFormats&&(d?(o=c.scopeValue("formats",{ref:v.formats,code:m.code.formats}),a=c.const("fDef",(0,t._)`${o}[${f}]`),i=c.let("fType"),n=c.let("format"),c.if((0,t._)`typeof ${a} == "object" && !(${a} instanceof RegExp)`,()=>c.assign(i,(0,t._)`${a}.type || "string"`).assign(n,(0,t._)`${a}.validate`),()=>c.assign(i,(0,t._)`"string"`).assign(n,a)),e.fail$data((0,t.or)(!1===m.strictSchema?t.nil:(0,t._)`${f} && !${n}`,(s=g.$async?(0,t._)`(${a}.async ? await ${n}(${u}) : ${n}(${u}))`:(0,t._)`${n}(${u})`,l=(0,t._)`(typeof ${n} == "function" ? ${s} : ${n}.test(${u}))`,(0,t._)`${n} && ${n} !== true && ${i} === ${r} && !${l}`)))):function(){var o;let a,i,n=v.formats[p];if(!n){if(!1===m.strictSchema)return v.logger.warn(s());throw Error(s());function s(){return`unknown format "${p}" ignored in schema at path "${y}"`}}if(!0===n)return;let[l,d,f]=(a=(o=n)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 n&&!(n instanceof RegExp)&&n.async){if(!g.$async)throw Error("async format in sync schema");return(0,t._)`await ${f}(${u})`}return"function"==typeof d?(0,t._)`${f}(${u})`:(0,t._)`${f}.test(${u})`}())}())}}}),uS=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[ub().default]}),u$=ec(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"]}),uw=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cQ(),r=ur(),o=u_(),a=uS(),i=u$();e.default=[t.default,r.default,(0,o.default)(),a.default,i.metadataVocabulary,i.contentVocabulary]}),uE=ec(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(r=t||(e.DiscrError=t={})).Tag="tag",r.Mapping="mapping"}),uR=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP(),r=uE(),o=cH(),a=cF(),i=cO();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:n,data:s,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 f=n.let("valid",!1),h=n.const("tag",(0,t._)`${s}${(0,t.getProperty)(p)}`);n.if((0,t._)`typeof ${h} == "string"`,()=>(function(){let s=function(){var e;let t={},r=s(c),n=!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 f=null==(e=null==c?void 0:c.properties)?void 0:e[p];if("object"!=typeof f)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);n=n&&(r||s(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"`)}(f,t)}if(!n)throw Error(`discriminator: "${p}" must be required`);return t;function s({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 n.if(!1),s)n.elseIf((0,t._)`${h} === ${r}`),n.assign(f,function(r){let o=n.name("valid"),a=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(a,t.Name),o}(s[r]));n.else(),e.error(!1,{discrError:r.DiscrError.Mapping,tag:h,tagName:p}),n.endIf()})(),()=>e.error(!1,{discrError:r.DiscrError.Tag,tag:h,tagName:p})),e.ok(f)}}}),uP=ec((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}}),uO=ec((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=cW(),o=uw(),a=uR(),i=uP(),n=["/properties"],s="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,n):i;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv=l,t.exports=e=l,t.exports.Ajv=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var c=cU();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=cP();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=cV();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=cF();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),uk=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=cP(),r=ck(),o=cH(),a=cY();function i(e,i){let{gen:n,it:s}=e;s.schemaEnv.root.dynamicAnchors[i]=!0;let l=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(i)}`,c="#"===s.errSchemaPath?s.validateName:function(e){let{schemaEnv:t,schema:r,self:i}=e.it,{root:n,baseId:s,localRefs:l,meta:c}=t.root,{schemaId:u}=i.opts,d=new o.SchemaEnv({schema:r,schemaId:u,root:n,baseId:s,localRefs:l,meta:c});return o.compileSchema.call(i,d),(0,a.getValidate)(e,d)}(e);n.if((0,t._)`!${l}`,()=>n.assign(l,c))}e.dynamicAnchor=i,e.default={keyword:"$dynamicAnchor",schemaType:"string",code:e=>i(e,e.schema)}}),ux=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=cP(),r=ck(),o=cY();function a(e,a){let{gen:i,keyword:n,it:s}=e;if("#"!==a[0])throw Error(`"${n}" only supports hash fragment reference`);let l=a.slice(1);if(s.allErrors)c();else{let t=i.let("valid",!1);c(t),e.ok(t)}function c(e){if(s.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(s.validateName,e))}else u(s.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)}}),uT=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uk(),r=cO();e.default={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,t.dynamicAnchor)(e,""):(0,r.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}}}),uC=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ux();e.default={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,t.dynamicRef)(e,e.schema)}}),uj=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uk(),r=ux(),o=uT(),a=uC();e.default=[t.default,r.default,o.default,a.default]}),uI=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ul();e.default={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}}),uN=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ul();e.default={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,t.validateSchemaDeps)(e)}}),uA=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cO();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`)}}}),uM=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uI(),r=uN(),o=uA();e.default=[t.default,r.default,o.default]}),uq=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP(),r=cO(),o=ck();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:n,errsCount:s,it:l}=e;if(!s)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",n,e=>{var r,o;return a.if((r=u,o=e,(0,t._)`!${r} || !${r}[${o}]`),()=>d(e))})):!0!==u&&a.forIn("key",n,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._)`${s} === ${o.default.errors}`)}}}),uz=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cP(),r=cO();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:n}=e,s=n.items||0;if(!0===s)return;let l=o.const("len",(0,t._)`${i}.length`);if(!1===a)e.setParams({len:s}),e.fail((0,t._)`${l} > ${s}`);else if("object"==typeof a&&!(0,r.alwaysValidSchema)(n,a)){let a=o.var("valid",(0,t._)`${l} <= ${s}`);o.if((0,t.not)(a),()=>{var i,c;return i=a,c=s,void o.forRange("i",c,l,a=>{e.subschema({keyword:"unevaluatedItems",dataProp:a,dataPropType:r.Type.Num},i),n.allErrors||o.if((0,t.not)(i),()=>o.break())})}),e.ok(a)}n.items=!0}}}),uL=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uq(),r=uz();e.default=[t.default,r.default]}),uD=ec((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"}]}}}}}),uU=ec((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:"#"}}}}}),uV=ec((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:"#"}}}}),uF=ec((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:{}}}}}),uH=ec((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"}}}}),uK=ec((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}}}}),uG=ec((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:[]}}}}),uB=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uD(),r=uU(),o=uV(),a=uF(),i=uH(),n=uK(),s=uG(),l=["/properties"];e.default=function(e){return[t,r,o,a,c(this,i),n,c(this,s)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function c(t,r){return e?t.$dataMetaSchema(r,l):r}}}),uJ=ec((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=cW(),o=uw(),a=uj(),i=uM(),n=uL(),s=uR(),l=uB(),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(n.default),this.opts.discriminator&&this.addKeyword(s.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=cU();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var p=cP();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 f=cV();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=cF();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})}),uZ=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cQ(),r=ur(),o=u_(),a=uj(),i=uM(),n=uL(),s=uS(),l=u$();e.default=[a.default,t.default,r.default,(0,o.default)(!0),s.default,l.metadataVocabulary,l.contentVocabulary,i.default,n.default]}),uW=ec((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}}}}),uX=ec((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"}}}}}),uY=ec((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"}}}}),uQ=ec((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"}}}}),u0=ec((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"}}}}),u1=ec((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"}}}}),u2=ec((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}}}}),u9=ec((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:[]}}}}),u3=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uW(),r=uX(),o=uY(),a=uQ(),i=u0(),n=u1(),s=u2(),l=u9(),c=["/properties"];e.default=function(e){return[t,r,o,a,i,u(this,n),s,u(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,r){return e?t.$dataMetaSchema(r,c):r}}}),u5=ec((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=cW(),o=uZ(),a=uR(),i=u3(),n="https://json-schema.org/draft/2020-12/schema";var s=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"]=n)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var l=cU();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=cP();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=cV();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=cF();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),u4=ec(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(s(!0),l),"date-time":t(d(!0),p),"iso-time":t(s(),c),"iso-date-time":t(d(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return h.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(b.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:_},double:{type:"number",validate:_},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,f),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],n=+a[2],s=+a[3];return n>=1&&n<=12&&s>=1&&s<=(2===n&&(t=i)%4==0&&(t%100!=0||t%400==0)?29:o[n])}function i(e,t){if(e&&t)return e>t?1:e<t?-1:0}let n=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function s(e){return function(t){let r=n.exec(t);if(!r)return!1;let o=+r[1],a=+r[2],i=+r[3],s=r[4],l="-"===r[5]?-1:1,c=+(r[6]||0),u=+(r[7]||0);if(c>23||u>59||e&&!s)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=n.exec(e),o=n.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=s(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 f(e,t){if(!(e&&t))return;let[r,o]=e.split(u),[a,n]=t.split(u),s=i(r,a);if(void 0!==s)return s||l(o,n)}let h=/\/|:/,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=0x7fffffff;function _(){return!0}let b=/[^\\]\\Z/}),u6=ec(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=uO(),r=cP(),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:n,data:s,schemaCode:l,keyword:c,it:u}=e,{opts:d,self:p}=u;if(!d.validateFormats)return;let f=new t.KeywordCxt(u,p.RULES.all.format.definition,"format");function h(e){return(0,r._)`${e}.compare(${s}, ${l}) ${a[c].fail} 0`}f.$data?(o=n.scopeValue("formats",{ref:p.formats,code:d.code.formats}),i=n.const("fmt",(0,r._)`${o}[${f.schemaCode}]`),e.fail$data((0,r.or)((0,r._)`typeof ${i} != "object"`,(0,r._)`${i} instanceof RegExp`,(0,r._)`typeof ${i}.compare != "function"`,h(i)))):function(){let t=f.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=n.scopeValue("formats",{key:t,ref:o,code:d.code.formats?(0,r._)`${d.code.formats}${(0,r.getProperty)(t)}`:void 0});e.fail$data(h(a))}()},dependencies:["format"]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}),u8=ec((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=u4(),o=u6(),a=cP(),i=new a.Name("fullFormats"),n=new a.Name("fastFormats"),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return l(e,t,r.fullFormats,i),e;let[a,s]="fast"===t.mode?[r.fastFormats,n]:[r.fullFormats,i];return l(e,t.formats||r.formatNames,a,s),t.keywords&&(0,o.default)(e),e};function l(e,t,r,o){var i;for(let n of(null!=(i=e.opts.code).formats||(i.formats=(0,a._)`require("ajv-formats/dist/formats").${o}`),t))e.addFormat(n,r[n])}s.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=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s}),u7=uO(),de=uJ(),dt=u5();(R=null!=(E=u8())?eo(es(E)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var o,a=en(t),i=0,n=a.length;i<n;i++)o=a[i],el.call(e,o)||void 0===o||ea(e,o,{get:(e=>t[e]).bind(null,o),enumerable:!(r=ei(t,o))||r.enumerable});return e})(ea(R,"default",{value:E,enumerable:!0}),E)).default;u7.Ajv;let dr=require("node:process"),da=Symbol.for("mcp.completable");function di(e,t){return Object.defineProperty(e,da,{value:{complete:t},enumerable:!1,writable:!1,configurable:!1}),e}function dn(e){let t="";for(let r of e)t+=String.fromCodePoint(r);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function ds(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 dl(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,n=()=>t??=r.importKey("raw",o,{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]),s=new TextEncoder,l=async e=>dn(new Uint8Array(await r.sign("HMAC",await n(),s.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=dn(s.encode(JSON.stringify(o)));return`v1.${c}.${dn(new Uint8Array(await r.sign("HMAC",await n(),s.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=ds(e.slice(c+1))}catch{throw Error("malformed")}if(!await r.verify("HMAC",await n(),o,s.encode("v1."+u)))throw Error("mac");try{a=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(ds(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 dc=Object.create,du=Object.defineProperty,dd=Object.getOwnPropertyDescriptor,dp=Object.getOwnPropertyNames,df=Object.getPrototypeOf,dh=Object.prototype.hasOwnProperty,dm=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),dy=(e,t,r)=>(r=null!=e?dc(df(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var o,a=dp(t),i=0,n=a.length;i<n;i++)o=a[i],dh.call(e,o)||void 0===o||du(e,o,{get:(e=>t[e]).bind(null,o),enumerable:!(r=dd(t,o))||r.enumerable});return e})(!t&&e&&e.__esModule?r:du(r,"default",{value:e,enumerable:!0}),e));let dg=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),dv=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),d_=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),db=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),dS=Symbol.for("mcp.sdk.errorBrands");function d$(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,dS,{value:r,enumerable:!1,configurable:!0})}function dw(e,t){try{if("object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&"string"==typeof e.mcpBrand&&Object.prototype.hasOwnProperty.call(t,dS)){let r=t[dS];if(r&&"function"==typeof r.has&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}let dE=((T={}).InvalidRequest="invalid_request",T.InvalidClient="invalid_client",T.InvalidGrant="invalid_grant",T.UnauthorizedClient="unauthorized_client",T.UnsupportedGrantType="unsupported_grant_type",T.InvalidScope="invalid_scope",T.AccessDenied="access_denied",T.ServerError="server_error",T.TemporarilyUnavailable="temporarily_unavailable",T.UnsupportedResponseType="unsupported_response_type",T.UnsupportedTokenType="unsupported_token_type",T.InvalidToken="invalid_token",T.MethodNotAllowed="method_not_allowed",T.TooManyRequests="too_many_requests",T.InvalidClientMetadata="invalid_client_metadata",T.InvalidRedirectUri="invalid_redirect_uri",T.InsufficientScope="insufficient_scope",T.InvalidTarget="invalid_target",T.InvalidDpopProof="invalid_dpop_proof",T.UseDpopNonce="use_dpop_nonce",T);var dR=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](e){return dw(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 dw(this,e)}constructor(e,t,r){super(t),this.code=e,this.errorUri=r,this.name="OAuthError",d$(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 dP=((C={}).NotConnected="NOT_CONNECTED",C.AlreadyConnected="ALREADY_CONNECTED",C.NotInitialized="NOT_INITIALIZED",C.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",C.RequestTimeout="REQUEST_TIMEOUT",C.ConnectionClosed="CONNECTION_CLOSED",C.SendFailed="SEND_FAILED",C.InvalidResult="INVALID_RESULT",C.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",C.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",C.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",C.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",C.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",C.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",C.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",C.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",C.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",C.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",C.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",C);var dO=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return dw(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 dw(this,e)}constructor(e,t,r,o){super(t,o),this.code=e,this.data=r,this.name="SdkError",d$(this,new.target)}},dk=class extends dO{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r,o){super(e,t,r,o),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function dx(e){if("object"!=typeof e||null===e||Array.isArray(e))return e;let t={...e};return delete t.issuer,t}let dT="2026-07-28",dC=[dT];function dj(e){return e.filter(e=>!(e>=dT))}function dI(e){return e.filter(e=>e>=dT)}function dN(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 dA=["task","inputRequests","requestState"];function dM(e){return null===e||"object"!=typeof e||Array.isArray(e)||void 0!==e.content||dA.some(t=>t in e)?e:{...e,content:[]}}function dq(){let e,t,r,o,a,i,s,l,c,u,d,p,f,h,m,y,g,v,_,b,S,$,w,E,R,P,O,k,x,T,C,j,I,N,A,M,q,z,L,D,U,V,F,H,K,G,B,J,Z,W,X,Y,Q,ee,et,er,eo,ea,ei,en,es,el,ec,eu,ed,ep,ef,eh,em,ey,eg,ev,e_,eb,eS,e$,ew,eE,eR,eP,eO,ek,ex,eT,eC,ej,eI,eN,eA,eM,eq,ez,eL,eD,eU,eV,eF,eH,eK,eG,eB,eJ,eZ,eW,eX,eY,eQ,e0,e1,e2,e9,e3,e5,e4,e6,e8,e7,te,tt,tr,to,ta,ti,tn,ts,tl,tc,tu,td,tp,tf,th,tm,ty,tg,tv,t_,tb,tS,t$;return n??=(e=i0(()=>iO([aG(),ic(),ih(),iy(),iI(aG(),e),i$(e)])),t=iI(aG(),e),r=iO([aG(),ic().int()]),o=aG(),a=iE({ttl:ic().optional()}),i=iE({taskId:aG()}),s=iR({progressToken:r.optional(),"io.modelcontextprotocol/related-task":i.optional()}),c=(l=iE({_meta:s.optional()})).extend({task:a.optional()}),u=iE({method:aG(),params:l.loose().optional()}),d=iE({_meta:s.optional()}),p=iE({method:aG(),params:d.loose().optional()}),f=iR({_meta:s.optional()}),h=iO([aG(),ic().int()]),m=f.strict(),y=d.extend({requestId:h.optional(),reason:aG().optional()}),g=p.extend({method:iq("notifications/cancelled"),params:y}),v=iE({src:aG(),mimeType:aG().optional(),sizes:i$(aG()).optional(),theme:iA(["light","dark"]).optional()}),_=iE({icons:i$(v).optional()}),S=(b=iE({name:aG(),title:aG().optional()})).extend({...b.shape,..._.shape,version:aG(),websiteUrl:aG().optional(),description:aG().optional()}),$=iC(iE({applyDefaults:ih().optional()}),t),w=i2(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,iC(iE({form:$.optional(),url:t.optional()}),t.optional())),E=iR({list:t.optional(),cancel:t.optional(),requests:iR({sampling:iR({createMessage:t.optional()}).optional(),elicitation:iR({create:t.optional()}).optional()}).optional()}),R=iR({list:t.optional(),cancel:t.optional(),requests:iR({tools:iR({call:t.optional()}).optional()}).optional()}),P=iE({experimental:iI(aG(),t).optional(),sampling:iE({context:t.optional(),tools:t.optional()}).optional(),elicitation:w.optional(),roots:iE({listChanged:ih().optional()}).optional(),tasks:E.optional(),extensions:iI(aG(),t).optional()}),O=l.extend({protocolVersion:aG(),capabilities:P,clientInfo:S}),k=u.extend({method:iq("initialize"),params:O}),x=iE({experimental:iI(aG(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:iE({listChanged:ih().optional()}).optional(),resources:iE({subscribe:ih().optional(),listChanged:ih().optional()}).optional(),tools:iE({listChanged:ih().optional()}).optional(),tasks:R.optional(),extensions:iI(aG(),t).optional()}),T=f.extend({protocolVersion:aG(),capabilities:x,serverInfo:S,instructions:aG().optional()}),C=p.extend({method:iq("notifications/initialized"),params:d.optional()}),j=u.extend({method:iq("ping"),params:l.optional()}),I=iE({progress:ic(),total:iU(ic()),message:iU(aG())}),N=iE({...d.shape,...I.shape,progressToken:r}),A=p.extend({method:iq("notifications/progress"),params:N}),M=l.extend({cursor:o.optional()}),q=u.extend({params:M.optional()}),z=f.extend({nextCursor:o.optional()}),D=(L=iE({uri:aG(),mimeType:iU(aG()),_meta:iI(aG(),i_()).optional()})).extend({text:aG()}),U=aG().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),V=L.extend({blob:U}),F=iA(["user","assistant"]),H=iE({audience:i$(F).optional(),priority:ic().min(0).max(1).optional(),lastModified:oc(aJ,{offset:!0}).optional()}),K=iE({...b.shape,..._.shape,uri:aG(),description:iU(aG()),mimeType:iU(aG()),size:iU(ic()),annotations:H.optional(),_meta:iU(iR({}))}),G=iE({...b.shape,..._.shape,uriTemplate:aG(),description:iU(aG()),mimeType:iU(aG()),annotations:H.optional(),_meta:iU(iR({}))}),B=q.extend({method:iq("resources/list")}),J=z.extend({resources:i$(K)}),Z=q.extend({method:iq("resources/templates/list")}),W=z.extend({resourceTemplates:i$(G)}),X=l.extend({uri:aG()}),Y=u.extend({method:iq("resources/read"),params:X}),Q=f.extend({contents:i$(iO([D,V]))}),ee=p.extend({method:iq("notifications/resources/list_changed"),params:d.optional()}),et=u.extend({method:iq("resources/subscribe"),params:X}),er=u.extend({method:iq("resources/unsubscribe"),params:X}),eo=d.extend({uri:aG()}),ea=p.extend({method:iq("notifications/resources/updated"),params:eo}),ei=iE({name:aG(),description:iU(aG()),required:iU(ih())}),en=iE({...b.shape,..._.shape,description:iU(aG()),arguments:iU(i$(ei)),_meta:iU(iR({}))}),es=q.extend({method:iq("prompts/list")}),el=z.extend({prompts:i$(en)}),ec=l.extend({name:aG(),arguments:iI(aG(),aG()).optional()}),eu=u.extend({method:iq("prompts/get"),params:ec}),ed=iE({type:iq("text"),text:aG(),annotations:H.optional(),_meta:iI(aG(),i_()).optional()}),ep=iE({type:iq("image"),data:U,mimeType:aG(),annotations:H.optional(),_meta:iI(aG(),i_()).optional()}),ef=iE({type:iq("audio"),data:U,mimeType:aG(),annotations:H.optional(),_meta:iI(aG(),i_()).optional()}),eh=iE({type:iq("tool_use"),name:aG(),id:aG(),input:iI(aG(),i_()),_meta:iI(aG(),i_()).optional()}),em=iE({type:iq("resource"),resource:iO([D,V]),annotations:H.optional(),_meta:iI(aG(),i_()).optional()}),ey=K.extend({type:iq("resource_link")}),eg=iO([ed,ep,ef,ey,em]),ev=iE({role:F,content:eg}),e_=f.extend({description:aG().optional(),messages:i$(ev)}),eb=p.extend({method:iq("notifications/prompts/list_changed"),params:d.optional()}),eS=iE({title:aG().optional(),readOnlyHint:ih().optional(),destructiveHint:ih().optional(),idempotentHint:ih().optional(),openWorldHint:ih().optional()}),e$=iE({taskSupport:iA(["required","optional","forbidden"]).optional()}),ew=iE({...b.shape,..._.shape,description:aG().optional(),inputSchema:iE({type:iq("object"),properties:iI(aG(),e).optional(),required:i$(aG()).optional()}).catchall(i_()),outputSchema:iE({type:iq("object"),properties:iI(aG(),e).optional(),required:i$(aG()).optional()}).catchall(i_()).optional(),annotations:eS.optional(),execution:e$.optional(),_meta:iI(aG(),i_()).optional()}),eE=q.extend({method:iq("tools/list")}),eR=z.extend({tools:i$(ew)}),eP=f.extend({content:i$(eg),structuredContent:iI(aG(),i_()).optional(),isError:ih().optional()}),eO=c.extend({name:aG(),arguments:iI(aG(),i_()).optional()}),ek=u.extend({method:iq("tools/call"),params:eO}),ex=p.extend({method:iq("notifications/tools/list_changed"),params:d.optional()}),eT=iA(["debug","info","notice","warning","error","critical","alert","emergency"]),eC=l.extend({level:eT}),ej=u.extend({method:iq("logging/setLevel"),params:eC}),eI=d.extend({level:eT,logger:aG().optional(),data:i_()}),eN=p.extend({method:iq("notifications/message"),params:eI}),eA=iE({name:aG().optional()}),eM=iE({hints:i$(eA).optional(),costPriority:ic().min(0).max(1).optional(),speedPriority:ic().min(0).max(1).optional(),intelligencePriority:ic().min(0).max(1).optional()}),eq=iE({mode:iA(["auto","required","none"]).optional()}),ez=iE({type:iq("tool_result"),toolUseId:aG().describe("The unique identifier for the corresponding tool call."),content:i$(eg),structuredContent:iE({}).loose().optional(),isError:ih().optional(),_meta:iI(aG(),i_()).optional()}),eL=ix("type",[ed,ep,ef]),eD=ix("type",[ed,ep,ef,eh,ez]),eU=iE({role:F,content:iO([eD,i$(eD)]),_meta:iI(aG(),i_()).optional()}),eV=c.extend({messages:i$(eU),modelPreferences:eM.optional(),systemPrompt:aG().optional(),includeContext:iA(["none","thisServer","allServers"]).optional(),temperature:ic().optional(),maxTokens:ic().int(),stopSequences:i$(aG()).optional(),metadata:t.optional(),tools:i$(ew).optional(),toolChoice:eq.optional()}),eF=u.extend({method:iq("sampling/createMessage"),params:eV}),eH=f.extend({model:aG(),stopReason:iU(iA(["endTurn","stopSequence","maxTokens"]).or(aG())),role:F,content:eL}),eK=f.extend({model:aG(),stopReason:iU(iA(["endTurn","stopSequence","maxTokens","toolUse"]).or(aG())),role:F,content:iO([eD,i$(eD)])}),eG=iE({type:iq("boolean"),title:aG().optional(),description:aG().optional(),default:ih().optional()}),eB=iE({type:iq("string"),title:aG().optional(),description:aG().optional(),minLength:ic().optional(),maxLength:ic().optional(),format:iA(["email","uri","date","date-time"]).optional(),default:aG().optional()}),eJ=iE({type:iA(["number","integer"]),title:aG().optional(),description:aG().optional(),minimum:ic().optional(),maximum:ic().optional(),default:ic().optional()}),eZ=iE({type:iq("string"),title:aG().optional(),description:aG().optional(),enum:i$(aG()),default:aG().optional()}),eW=iE({type:iq("string"),title:aG().optional(),description:aG().optional(),oneOf:i$(iE({const:aG(),title:aG()})),default:aG().optional()}),eX=iE({type:iq("string"),title:aG().optional(),description:aG().optional(),enum:i$(aG()),enumNames:i$(aG()).optional(),default:aG().optional()}),eY=iO([eZ,eW]),eQ=iE({type:iq("array"),title:aG().optional(),description:aG().optional(),minItems:ic().optional(),maxItems:ic().optional(),items:iE({type:iq("string"),enum:i$(aG())}),default:i$(aG()).optional()}),e0=iE({type:iq("array"),title:aG().optional(),description:aG().optional(),minItems:ic().optional(),maxItems:ic().optional(),items:iE({anyOf:i$(iE({const:aG(),title:aG()}))}),default:i$(aG()).optional()}),e1=iO([eQ,e0]),e2=iO([eX,eY,e1]),e9=iO([e2,eG,eB,eJ]),e3=c.extend({mode:iq("form").optional(),message:aG(),requestedSchema:iE({type:iq("object"),properties:iI(aG(),e9),required:i$(aG()).optional()}).catchall(i_())}),e5=c.extend({mode:iq("url"),message:aG(),elicitationId:aG(),url:aG().url()}),e4=iO([e3,e5]),e6=u.extend({method:iq("elicitation/create"),params:e4}),e8=d.extend({elicitationId:aG()}),e7=p.extend({method:iq("notifications/elicitation/complete"),params:e8}),te=f.extend({action:iA(["accept","decline","cancel"]),content:i2(e=>null===e?void 0:e,iI(aG(),iO([aG(),ic(),ih(),i$(aG())])).optional())}),tt=iE({type:iq("ref/resource"),uri:aG()}),tr=iE({type:iq("ref/prompt"),name:aG()}),to=l.extend({ref:iO([tr,tt]),argument:iE({name:aG(),value:aG()}),context:iE({arguments:iI(aG(),aG()).optional()}).optional()}),ta=u.extend({method:iq("completion/complete"),params:to}),ti=f.extend({completion:iR({values:i$(aG()).max(100),total:iU(ic().int()),hasMore:iU(ih())})}),tn=iE({uri:aG().startsWith("file://"),name:aG().optional(),_meta:iI(aG(),i_()).optional()}),ts=u.extend({method:iq("roots/list"),params:l.optional()}),tl=f.extend({roots:i$(tn)}),tc=p.extend({method:iq("notifications/roots/list_changed"),params:d.optional()}),tu=iR({ttl:ic().optional(),pollInterval:ic().optional()}),td=iA(["working","input_required","completed","failed","cancelled"]),tp=iE({taskId:aG(),status:td,ttl:iO([ic(),iy()]),createdAt:aG(),lastUpdatedAt:aG(),pollInterval:iU(ic()),statusMessage:iU(aG())}),tf=f.extend({task:tp}),th=d.merge(tp),tm=p.extend({method:iq("notifications/tasks/status"),params:th}),ty=u.extend({method:iq("tasks/get"),params:l.extend({taskId:aG()})}),tg=f.merge(tp),tv=u.extend({method:iq("tasks/result"),params:l.extend({taskId:aG()})}),t_=f.loose(),tb=q.extend({method:iq("tasks/list")}),tS=z.extend({tasks:i$(tp)}),t$=u.extend({method:iq("tasks/cancel"),params:l.extend({taskId:aG()})}),{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:a,RelatedTaskMetadataSchema:i,RequestMetaSchema:s,BaseRequestParamsSchema:l,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:d,NotificationSchema:p,ResultSchema:f,RequestIdSchema:h,EmptyResultSchema:m,CancelledNotificationParamsSchema:y,CancelledNotificationSchema:g,IconSchema:v,IconsSchema:_,BaseMetadataSchema:b,ImplementationSchema:S,ClientTasksCapabilitySchema:E,ServerTasksCapabilitySchema:R,ClientCapabilitiesSchema:P,InitializeRequestParamsSchema:O,InitializeRequestSchema:k,ServerCapabilitiesSchema:x,InitializeResultSchema:T,InitializedNotificationSchema:C,PingRequestSchema:j,ProgressSchema:I,ProgressNotificationParamsSchema:N,ProgressNotificationSchema:A,PaginatedRequestParamsSchema:M,PaginatedRequestSchema:q,PaginatedResultSchema:z,ResourceContentsSchema:L,TextResourceContentsSchema:D,BlobResourceContentsSchema:V,RoleSchema:F,AnnotationsSchema:H,ResourceSchema:K,ResourceTemplateSchema:G,ListResourcesRequestSchema:B,ListResourcesResultSchema:J,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:en,ListPromptsRequestSchema:es,ListPromptsResultSchema:el,GetPromptRequestParamsSchema:ec,GetPromptRequestSchema:eu,TextContentSchema:ed,ImageContentSchema:ep,AudioContentSchema:ef,ToolUseContentSchema:eh,EmbeddedResourceSchema:em,ResourceLinkSchema:ey,ContentBlockSchema:eg,PromptMessageSchema:ev,GetPromptResultSchema:e_,PromptListChangedNotificationSchema:eb,ToolAnnotationsSchema:eS,ToolExecutionSchema:e$,ToolSchema:ew,ListToolsRequestSchema:eE,ListToolsResultSchema:eR,CallToolResultSchema:eP,CallToolRequestParamsSchema:eO,CallToolRequestSchema:ek,ToolListChangedNotificationSchema:ex,LoggingLevelSchema:eT,SetLevelRequestParamsSchema:eC,SetLevelRequestSchema:ej,LoggingMessageNotificationParamsSchema:eI,LoggingMessageNotificationSchema:eN,ModelHintSchema:eA,ModelPreferencesSchema:eM,ToolChoiceSchema:eq,ToolResultContentSchema:ez,SamplingContentSchema:eL,SamplingMessageContentBlockSchema:eD,SamplingMessageSchema:eU,CreateMessageRequestParamsSchema:eV,CreateMessageRequestSchema:eF,CreateMessageResultSchema:eH,CreateMessageResultWithToolsSchema:eK,BooleanSchemaSchema:eG,StringSchemaSchema:eB,NumberSchemaSchema:eJ,UntitledSingleSelectEnumSchemaSchema:eZ,TitledSingleSelectEnumSchemaSchema:eW,LegacyTitledEnumSchemaSchema:eX,SingleSelectEnumSchemaSchema:eY,UntitledMultiSelectEnumSchemaSchema:eQ,TitledMultiSelectEnumSchemaSchema:e0,MultiSelectEnumSchemaSchema:e1,EnumSchemaSchema:e2,PrimitiveSchemaDefinitionSchema:e9,ElicitRequestFormParamsSchema:e3,ElicitRequestURLParamsSchema:e5,ElicitRequestParamsSchema:e4,ElicitRequestSchema:e6,ElicitationCompleteNotificationParamsSchema:e8,ElicitationCompleteNotificationSchema:e7,ElicitResultSchema:te,ResourceTemplateReferenceSchema:tt,PromptReferenceSchema:tr,CompleteRequestParamsSchema:to,CompleteRequestSchema:ta,CompleteResultSchema:ti,RootSchema:tn,ListRootsRequestSchema:ts,ListRootsResultSchema:tl,RootsListChangedNotificationSchema:tc,TaskCreationParamsSchema:tu,TaskStatusSchema:td,TaskSchema:tp,CreateTaskResultSchema:tf,TaskStatusNotificationParamsSchema:th,TaskStatusNotificationSchema:tm,GetTaskRequestSchema:ty,GetTaskResultSchema:tg,GetTaskPayloadRequestSchema:tv,GetTaskPayloadResultSchema:t_,ListTasksRequestSchema:tb,ListTasksResultSchema:tS,CancelTaskRequestSchema:t$,CancelTaskResultSchema:f.merge(tp),ClientRequestSchema:iO([j,k,ta,ej,eu,es,B,Z,Y,et,er,ek,eE,ty,tv,tb,t$]),ClientNotificationSchema:iO([g,A,C,tc,tm]),ClientResultSchema:iO([m,eH,eK,te,tl,tg,tS,tf]),ServerRequestSchema:iO([j,eF,e6,ts,ty,tv,tb,t$]),ServerNotificationSchema:iO([g,A,eN,ea,ee,ex,eb,tm,e7]),ServerResultSchema:iO([m,T,ti,e_,el,J,W,Q,eP,eR,tg,tS,tf]),CallToolResultWireSchema:i_().superRefine((e,t)=>{if(!("object"!=typeof e||null===e||Array.isArray(e))&&void 0===e.content){for(let r of dA)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(dM).pipe(eP)})}function dz(e){return"object"!==e.type}let dL=new Set(["const","enum","default","examples"]),dD=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function dU(e){return void 0!==e&&!("string"==typeof e&&e.startsWith("#"))}let dV={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},dF={"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},dH={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 dK(){if(s)return s;let e=dq();return s={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 dG(e){return Object.prototype.hasOwnProperty.call(dV,e)}function dB(e){return Object.prototype.hasOwnProperty.call(dF,e)}function dJ(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function dZ(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(dV),Object.keys(dF);let dW={ok:!1,reason:"not-in-era"};function dX(e){return dJ(e)&&dJ(e.outputSchema)&&dz(e.outputSchema)}let dY={era:"2025-11-25",hasRequestMethod:dG,hasNotificationMethod:dB,validateRequest:(e,t)=>{var r;return dZ(dG(r=e)?dK().requestSchemas[r]:void 0,t)},validateResult:(e,t)=>{var r,o;return dZ((o=r=e,Object.prototype.hasOwnProperty.call(dH,o))?dK().resultSchemas[r]:void 0,t)},validateNotification:(e,t)=>{var r;return dZ(dB(r=e)?dK().notificationSchemas[r]:void 0,t)},hasInputRequestMethod:()=>!1,validateInputRequest:()=>dW,validateInputResponse:()=>dW,samplingResultVariant:(e,t)=>{let r=dq();return dZ(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=dN(e),o=r.structuredContent;if(void 0===o)return r;let a="object"!=typeof o||null===o||Array.isArray(o),i=void 0!==t&&dz(t);return a||i?{...r,structuredContent:{result:o}}:r},decodeResult(e,t){if(dJ(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=>dX(e))?{...t,tools:r.map(e=>dX(e)?{...e,outputSchema:function(e){var t;let r="string"==typeof e.$schema?e.$schema:void 0;if(dU(e.$id))return{...void 0!==r&&{$schema:r},type:"object",properties:{result:e},required:["result"]};let o="string"==typeof(t=e.$schema)&&dv.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&&dU(e.$id))return e;let r={},i=!1;for(let[n,s]of Object.entries(e))t?r[n]=a(s,!1):("$ref"===n||"$dynamicRef"===n)&&"string"==typeof s?r[n]="#"===s?"#/properties/result":s.startsWith("#/")?`#/properties/result${s.slice(1)}`:s:"$recursiveRef"===n&&"#"===s&&o?i=!0:dL.has(n)?r[n]=s:dD.has(n)?r[n]=a(s,!0):r[n]=a(s,!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 dQ(){return l??=function(){let e=i0(()=>iO([aG(),ic(),ih(),iy(),iI(aG(),e),i$(e)])),t=iI(aG(),e),r=iO([aG(),ic().int()]),o=aG(),a=iO([aG(),ic().int()]),i=iA(["user","assistant"]),n=iA(["debug","info","notice","warning","error","critical","alert","emergency"]),s=aG().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),l=iE({ttl:ic().optional()}),c=iE({taskId:aG()}),u=iR({progressToken:r.optional(),"io.modelcontextprotocol/related-task":c.optional()}),d=iE({_meta:u.optional()}),p=d.extend({task:l.optional()}),f=iE({_meta:u.optional()}),h=iE({method:aG(),params:f.loose().optional()}),m=iE({src:aG(),mimeType:aG().optional(),sizes:i$(aG()).optional(),theme:iA(["light","dark"]).optional()}),y=iE({icons:i$(m).optional()}),g=iE({name:aG(),title:aG().optional()}),v=g.extend({...g.shape,...y.shape,version:aG(),websiteUrl:aG().optional(),description:aG().optional()}),_=iC(iE({applyDefaults:ih().optional()}),t),b=i2(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,iC(iE({form:_.optional(),url:t.optional()}),t.optional())),S=iR({list:t.optional(),cancel:t.optional(),requests:iR({sampling:iR({createMessage:t.optional()}).optional(),elicitation:iR({create:t.optional()}).optional()}).optional()}),$=iR({list:t.optional(),cancel:t.optional(),requests:iR({tools:iR({call:t.optional()}).optional()}).optional()}),w=iE({experimental:iI(aG(),t).optional(),sampling:iE({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:iE({listChanged:ih().optional()}).optional(),tasks:S.optional(),extensions:iI(aG(),t).optional()}),E=iE({experimental:iI(aG(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:iE({listChanged:ih().optional()}).optional(),resources:iE({subscribe:ih().optional(),listChanged:ih().optional()}).optional(),tools:iE({listChanged:ih().optional()}).optional(),tasks:$.optional(),extensions:iI(aG(),t).optional()}),R=iE({progress:ic(),total:iU(ic()),message:iU(aG())}),P=iE({...f.shape,...R.shape,progressToken:r}),O=h.extend({method:iq("notifications/progress"),params:P}),k=f.extend({level:n,logger:aG().optional(),data:i_()}),x=h.extend({method:iq("notifications/message"),params:k}),T=iE({uri:aG(),mimeType:iU(aG()),_meta:iI(aG(),i_()).optional()}),C=T.extend({text:aG()}),j=T.extend({blob:s}),I=iE({audience:i$(i).optional(),priority:ic().min(0).max(1).optional(),lastModified:oc(aJ,{offset:!0}).optional()}),N=iE({...g.shape,...y.shape,uri:aG(),description:iU(aG()),mimeType:iU(aG()),size:iU(ic()),annotations:I.optional(),_meta:iU(iR({}))}),A=iE({...g.shape,...y.shape,uriTemplate:aG(),description:iU(aG()),mimeType:iU(aG()),annotations:I.optional(),_meta:iU(iR({}))}),M=h.extend({method:iq("notifications/resources/list_changed"),params:f.optional()}),q=f.extend({uri:aG()}),z=h.extend({method:iq("notifications/resources/updated"),params:q}),L=iE({name:aG(),description:iU(aG()),required:iU(ih())}),D=iE({...g.shape,...y.shape,description:iU(aG()),arguments:iU(i$(L)),_meta:iU(iR({}))}),U=h.extend({method:iq("notifications/prompts/list_changed"),params:f.optional()}),V=iE({type:iq("text"),text:aG(),annotations:I.optional(),_meta:iI(aG(),i_()).optional()}),F=iE({type:iq("image"),data:s,mimeType:aG(),annotations:I.optional(),_meta:iI(aG(),i_()).optional()}),H=iE({type:iq("audio"),data:s,mimeType:aG(),annotations:I.optional(),_meta:iI(aG(),i_()).optional()}),K=iE({type:iq("tool_use"),name:aG(),id:aG(),input:iI(aG(),i_()),_meta:iI(aG(),i_()).optional()}),G=iE({type:iq("resource"),resource:iO([C,j]),annotations:I.optional(),_meta:iI(aG(),i_()).optional()}),B=N.extend({type:iq("resource_link")}),J=iO([V,F,H,B,G]),Z=iE({role:i,content:J}),W=iE({title:aG().optional(),readOnlyHint:ih().optional(),destructiveHint:ih().optional(),idempotentHint:ih().optional(),openWorldHint:ih().optional()}),X=h.extend({method:iq("notifications/tools/list_changed"),params:f.optional()}),Y=iE({name:aG().optional()}),Q=iE({hints:i$(Y).optional(),costPriority:ic().min(0).max(1).optional(),speedPriority:ic().min(0).max(1).optional(),intelligencePriority:ic().min(0).max(1).optional()}),ee=iE({mode:iA(["auto","required","none"]).optional()}),et=iE({type:iq("boolean"),title:aG().optional(),description:aG().optional(),default:ih().optional()}),er=iE({type:iq("string"),title:aG().optional(),description:aG().optional(),minLength:ic().optional(),maxLength:ic().optional(),format:iA(["email","uri","date","date-time"]).optional(),default:aG().optional()}),eo=iE({type:iA(["number","integer"]),title:aG().optional(),description:aG().optional(),minimum:ic().optional(),maximum:ic().optional(),default:ic().optional()}),ea=iE({type:iq("string"),title:aG().optional(),description:aG().optional(),enum:i$(aG()),default:aG().optional()}),ei=iE({type:iq("string"),title:aG().optional(),description:aG().optional(),oneOf:i$(iE({const:aG(),title:aG()})),default:aG().optional()}),en=iE({type:iq("string"),title:aG().optional(),description:aG().optional(),enum:i$(aG()),enumNames:i$(aG()).optional(),default:aG().optional()}),es=iO([ea,ei]),el=iE({type:iq("array"),title:aG().optional(),description:aG().optional(),minItems:ic().optional(),maxItems:ic().optional(),items:iE({type:iq("string"),enum:i$(aG())}),default:i$(aG()).optional()}),ec=iE({type:iq("array"),title:aG().optional(),description:aG().optional(),minItems:ic().optional(),maxItems:ic().optional(),items:iE({anyOf:i$(iE({const:aG(),title:aG()}))}),default:i$(aG()).optional()}),eu=iO([el,ec]),ed=iO([en,es,eu]),ep=iO([ed,et,er,eo]),ef=p.extend({mode:iq("form").optional(),message:aG(),requestedSchema:iE({type:iq("object"),properties:iI(aG(),ep),required:i$(aG()).optional()}).catchall(i_())}),eh=iE({type:iq("ref/resource"),uri:aG()}),em=iE({type:iq("ref/prompt"),name:aG()}),ey=iE({uri:aG().startsWith("file://"),name:aG().optional(),_meta:iI(aG(),i_()).optional()}),eg=w.shape,ev=iE({experimental:eg.experimental,sampling:eg.sampling,elicitation:eg.elicitation,roots:eg.roots,extensions:eg.extensions}),e_=E.shape,eb=iE({experimental:e_.experimental,logging:e_.logging,completions:e_.completions,prompts:e_.prompts,resources:e_.resources,tools:e_.tools,extensions:e_.extensions}),eS=iR({progressToken:r.optional(),[i5]:aG(),[i4]:v.optional(),[i8]:ev,[ne]:n.optional()}),e$=iE({...g.shape,...y.shape,description:aG().optional(),inputSchema:iR({$schema:aG().optional(),type:iq("object")}),outputSchema:iR({$schema:aG().optional()}).optional(),annotations:W.optional(),_meta:iI(aG(),i_()).optional()}),ew=iE({type:iq("tool_result"),toolUseId:aG(),content:i$(J),structuredContent:i_().optional(),isError:ih().optional(),_meta:iI(aG(),i_()).optional()}),eE=iO([V,F,H,K,ew]),eR=iE({role:i,content:iO([eE,i$(eE)]),_meta:iI(aG(),i_()).optional()}),eP=aG(),eO=iR({[i6]:v.optional().catch(void 0)}),ek=eO.optional();function ex(e){return iR({_meta:ek,resultType:eP.default("complete"),...e})}let eT=ex({}),eC=ex({nextCursor:o.optional()}),ej=ex({content:i$(J),structuredContent:i_().optional(),isError:ih().optional()}),eI=ex({ttlMs:ic().int().min(0),cacheScope:iA(["public","private"]),tools:i$(e$),nextCursor:o.optional()}),eN=ex({ttlMs:ic().int().min(0),cacheScope:iA(["public","private"]),prompts:i$(D),nextCursor:o.optional()}),eA=ex({description:aG().optional(),messages:i$(Z)}),eM=ex({ttlMs:ic().int().min(0),cacheScope:iA(["public","private"]),resources:i$(N),nextCursor:o.optional()}),eq=ex({ttlMs:ic().int().min(0),cacheScope:iA(["public","private"]),resourceTemplates:i$(A),nextCursor:o.optional()}),ez=ex({ttlMs:ic().int().min(0),cacheScope:iA(["public","private"]),contents:i$(iO([C,j]))}),eL=ex({completion:iE({values:i$(aG()).max(100),total:ic().int().optional(),hasMore:ih().optional()}).loose()}),eD=ex({ttlMs:ic().int().min(0),cacheScope:iA(["public","private"])}),eU=ex({ttlMs:ic().int().min(0).catch(0),cacheScope:iA(["public","private"]).catch("private"),supportedVersions:i$(aG()),capabilities:eb,instructions:aG().optional()}),eV=iE({messages:i$(eR),modelPreferences:Q.optional(),systemPrompt:aG().optional(),includeContext:iA(["none","thisServer","allServers"]).optional(),temperature:ic().optional(),maxTokens:ic().int(),stopSequences:i$(aG()).optional(),metadata:t.optional(),tools:i$(e$).optional(),toolChoice:ee.optional()}),eF=iE({method:iq("sampling/createMessage"),params:eV}),eH=iE({method:iq("roots/list"),params:iE({_meta:iI(aG(),i_()).optional()}).optional()}),eK=iE({...eR.shape,model:aG(),stopReason:aG().optional()}),eG=iE({roots:i$(ey)}),eB=iE({action:iA(["accept","decline","cancel"]),content:iI(aG(),iO([aG(),ic(),ih(),i$(aG())])).optional()}),eJ=iE({mode:iq("url"),message:aG(),url:aG().url()}),eZ=iO([ef,eJ]),eW=iE({method:iq("elicitation/create"),params:eZ}),eX=iO([eF,eH,eW]),eY=iO([eK,eG,eB]),eQ=iI(aG(),eX),e0=iI(aG(),eY),e1=ex({inputRequests:eQ.optional(),requestState:aG().optional()}),e2={inputResponses:e0.optional(),requestState:aG().optional()},e9=iE({_meta:eS,...e2}),e3=iR({progressToken:r.optional()});function e5(e,t){return iE({method:iq(e),params:iE({_meta:eS,...t})})}function e4(e,t){return iE({method:iq(e),params:iE({_meta:e3.optional(),...t}).optional()})}let e6={name:aG(),arguments:iI(aG(),i_()).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:aG(),arguments:iI(aG(),aG()).optional(),...e2}),to=e5("resources/list",e8),ta=e5("resources/templates/list",e8),ti=e5("resources/read",{uri:aG(),...e2}),tn={ref:iO([em,eh]),argument:iE({name:aG(),value:aG()}),context:iE({arguments:iI(aG(),aG()).optional()}).optional()},ts=e5("completion/complete",tn),tl=e5("server/discover",{}),tc=iE({toolsListChanged:ih().optional(),promptsListChanged:ih().optional(),resourcesListChanged:ih().optional(),resourceSubscriptions:i$(aG()).optional()}),tu={notifications:tc},td=e5("subscriptions/listen",tu),tp=eO.extend({"io.modelcontextprotocol/subscriptionId":a}),tf=iR({_meta:tp,resultType:eP.default("complete")}),th={"tools/call":e4("tools/call",e6),"tools/list":e4("tools/list",e8),"prompts/get":e4("prompts/get",{name:aG(),arguments:iI(aG(),aG()).optional()}),"prompts/list":e4("prompts/list",e8),"resources/list":e4("resources/list",e8),"resources/templates/list":e4("resources/templates/list",e8),"resources/read":e4("resources/read",{uri:aG()}),"completion/complete":e4("completion/complete",tn),"server/discover":e4("server/discover",{}),"subscriptions/listen":e4("subscriptions/listen",tu)};function tm(e){return iR({_meta:ek,...e})}let ty={"tools/call":tm({content:i$(J),structuredContent:i_().optional(),isError:ih().optional()}),"tools/list":tm({ttlMs:ic().int().min(0),cacheScope:iA(["public","private"]),tools:i$(e$),nextCursor:o.optional()}),"prompts/get":tm({description:aG().optional(),messages:i$(Z)}),"prompts/list":tm({ttlMs:ic().int().min(0),cacheScope:iA(["public","private"]),prompts:i$(D),nextCursor:o.optional()}),"resources/list":tm({ttlMs:ic().int().min(0),cacheScope:iA(["public","private"]),resources:i$(N),nextCursor:o.optional()}),"resources/templates/list":tm({ttlMs:ic().int().min(0),cacheScope:iA(["public","private"]),resourceTemplates:i$(A),nextCursor:o.optional()}),"resources/read":tm({ttlMs:ic().int().min(0),cacheScope:iA(["public","private"]),contents:i$(iO([C,j]))}),"completion/complete":tm({completion:iE({values:i$(aG()).max(100),total:ic().int().optional(),hasMore:ih().optional()}).loose()}),"server/discover":tm({ttlMs:ic().int().min(0).catch(0),cacheScope:iA(["public","private"]).catch("private"),supportedVersions:i$(aG()),capabilities:eb,instructions:aG().optional()}),"subscriptions/listen":tm({})},tg=iR({"io.modelcontextprotocol/subscriptionId":a.optional()}),tv=iE({method:iq("notifications/subscriptions/acknowledged"),params:iE({_meta:tg.optional(),notifications:tc})}),t_=iE({_meta:tg.optional(),requestId:a,reason:aG().optional()}),tb=iE({method:iq("notifications/cancelled"),params:t_}),tS=e=>iE({jsonrpc:iq("2.0"),id:iO([aG(),ic().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:a,RoleSchema:i,LoggingLevelSchema:n,TaskMetadataSchema:l,RelatedTaskMetadataSchema:c,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:p,NotificationsParamsSchema:f,NotificationSchema:h,IconSchema:m,IconsSchema:y,BaseMetadataSchema:g,ImplementationSchema:v,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:$,ClientCapabilitiesSchema:w,ServerCapabilitiesSchema:E,ProgressSchema:R,ProgressNotificationParamsSchema:P,ProgressNotificationSchema:O,LoggingMessageNotificationParamsSchema:k,LoggingMessageNotificationSchema:x,ResourceContentsSchema:T,TextResourceContentsSchema:C,BlobResourceContentsSchema:j,AnnotationsSchema:I,ResourceSchema:N,ResourceTemplateSchema:A,ResourceListChangedNotificationSchema:M,ResourceUpdatedNotificationParamsSchema:q,ResourceUpdatedNotificationSchema:z,PromptArgumentSchema:L,PromptSchema:D,PromptListChangedNotificationSchema:U,TextContentSchema:V,ImageContentSchema:F,AudioContentSchema:H,ToolUseContentSchema:K,EmbeddedResourceSchema:G,ResourceLinkSchema:B,ContentBlockSchema:J,PromptMessageSchema:Z,ToolAnnotationsSchema:W,ToolListChangedNotificationSchema:X,ModelHintSchema:Y,ModelPreferencesSchema:Q,ToolChoiceSchema:ee,BooleanSchemaSchema:et,StringSchemaSchema:er,NumberSchemaSchema:eo,UntitledSingleSelectEnumSchemaSchema:ea,TitledSingleSelectEnumSchemaSchema:ei,LegacyTitledEnumSchemaSchema:en,SingleSelectEnumSchemaSchema:es,UntitledMultiSelectEnumSchemaSchema:el,TitledMultiSelectEnumSchemaSchema:ec,MultiSelectEnumSchemaSchema:eu,EnumSchemaSchema:ed,PrimitiveSchemaDefinitionSchema:ep,ElicitRequestFormParamsSchema:ef,ResourceTemplateReferenceSchema:eh,PromptReferenceSchema:em,RootSchema:ey,ClientCapabilities2026Schema:ev,ServerCapabilities2026Schema:eb,RequestMetaEnvelopeSchema:eS,ToolSchema:e$,ToolResultContentSchema:ew,SamplingMessageContentBlockSchema:eE,SamplingMessageSchema:eR,ResultTypeSchema:eP,ResultMetaSchema:eO,ResultSchema:eT,PaginatedResultSchema:eC,CallToolResultSchema:ej,ListToolsResultSchema:eI,ListPromptsResultSchema:eN,GetPromptResultSchema:eA,ListResourcesResultSchema:eM,ListResourceTemplatesResultSchema:eq,ReadResourceResultSchema:ez,CompleteResultSchema:eL,CacheableResultSchema:eD,DiscoverResultSchema:eU,CreateMessageRequestParamsSchema:eV,CreateMessageRequestSchema:eF,ListRootsRequestSchema:eH,CreateMessageResultSchema:eK,ListRootsResultSchema:eG,ElicitResultSchema:eB,ElicitRequestURLParamsSchema:eJ,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:ts,DiscoverRequestSchema:tl,SubscriptionFilterSchema:tc,SubscriptionsListenRequestSchema:td,SubscriptionsListenResultMetaSchema:tp,SubscriptionsListenResultSchema:tf,dispatchRequestSchemas:th,dispatchResultSchemas:ty,NotificationMetaSchema:tg,SubscriptionsAcknowledgedNotificationSchema:tv,CancelledNotificationParamsSchema:t_,CancelledNotificationSchema:tb,notificationSchemas2026:{"notifications/cancelled":tb,"notifications/progress":O,"notifications/message":x,"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(eT),CallToolResultResponseSchema:tS(iO([ej,e1])),ListToolsResultResponseSchema:tS(eI),ListPromptsResultResponseSchema:tS(eN),GetPromptResultResponseSchema:tS(iO([eA,e1])),ListResourcesResultResponseSchema:tS(eM),ListResourceTemplatesResultResponseSchema:tS(eq),ReadResourceResultResponseSchema:tS(iO([ez,e1])),CompleteResultResponseSchema:tS(eL),DiscoverResultResponseSchema:tS(eU),SubscriptionsListenResultResponseSchema:tS(tf)}}()}let d0=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"],d1=Symbol("modelcontextprotocol.resultCacheHintFallback");function d2(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function d9(e){return"public"===e||"private"===e}let d3=((j={})[j.ParseError=-32700]="ParseError",j[j.InvalidRequest=-32600]="InvalidRequest",j[j.MethodNotFound=-32601]="MethodNotFound",j[j.InvalidParams=-32602]="InvalidParams",j[j.InternalError=-32603]="InternalError",j[j.ResourceNotFound=-32002]="ResourceNotFound",j[j.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",j[j.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",j[j.UrlElicitationRequired=-32042]="UrlElicitationRequired",j);var d5=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](e){return dw(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 dw(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="ProtocolError",d$(this,new.target)}static fromError(t,r,o){return t===d3.UrlElicitationRequired&&o&&o.elicitations?new d6(o.elicitations,r):t===d3.UnsupportedProtocolVersion&&o&&Array.isArray(o.supported)&&"string"==typeof o.requested?new d8({supported:o.supported,requested:o.requested},r):(t===d3.InvalidParams||t===d3.ResourceNotFound)&&"string"==typeof o?.uri&&(t===d3.ResourceNotFound||1===Object.keys(o).length)?new d4(o.uri,r):t===d3.MissingRequiredClientCapability&&o&&null!==o.requiredCapabilities&&"object"==typeof o.requiredCapabilities&&!Array.isArray(o.requiredCapabilities)?new d7({requiredCapabilities:o.requiredCapabilities},r):new e(t,r,o)}},d4=class extends d5{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(d3.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},d6=class extends d5{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(d3.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},d8=class extends d5{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(d3.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},d7=class extends d5{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(d3.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};let pe=["tools/call","prompts/get","resources/read"],pt=["elicitation/create","sampling/createMessage","roots/list"];function pr(){if(c)return c;let e=dQ();return c={request:{"elicitation/create":iE({method:iq("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":iE({method:iq("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":iE({method:iq("roots/list"),params:iR({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}}}function po(e){return pt.includes(e)}function pa(e){return po(e)?pr().request[e]:void 0}let pi={"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},pn={"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 ps(e){return Object.prototype.hasOwnProperty.call(pi,e)}function pl(e){return Object.prototype.hasOwnProperty.call(pn,e)}function pc(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function pu(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(pi),Object.keys(pn);let pd={ok:!1,reason:"not-in-era"},pp=[i5,i8],pf={era:"2026-07-28",hasRequestMethod:ps,hasNotificationMethod:pl,hasInputRequestMethod:e=>void 0!==pa(e),validateRequest:(e,t)=>{var r;return pu(ps(r=e)?dQ().dispatchRequestSchemas[r]:void 0,t)},validateResult:(e,t)=>{var r,o;return pu((o=r=e,Object.prototype.hasOwnProperty.call(pi,o))?dQ().dispatchResultSchemas[r]:void 0,t)},validateNotification:(e,t)=>{var r;return pu(pl(r=e)?dQ().notificationSchemas2026[r]:void 0,t)},validateInputRequest:(e,t)=>pu(pa(e),t),validateInputResponse:(e,t)=>{var r;return pu(po(r=e)?pr().response[r]:void 0,t)},samplingResultVariant:()=>pd,outboundEnvelope:e=>({[i5]:e.protocolVersion,[i4]:e.clientInfo,[i8]:e.clientCapabilities,...void 0!==e.logLevel&&{[ne]:e.logLevel}}),validateEnvelopeMeta(e){let t=[];for(let r of pp)r in e||t.push({key:r,problem:"missing"});let r=dQ().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=>dN(e),inputRequestSchema:pa,decodeResult(e,t){if(!pc(t))return{kind:"invalid",error:new dO(dP.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(void 0===r)return{kind:"invalid",error:new dO(dP.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 dO(dP.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if("input_required"===r){let r=t.inputRequests,o=pc(r)?r:{},a=t.requestState,i=void 0===t._meta?void 0:dQ().ResultMetaSchema.safeParse(t._meta),n=i?.success?i.data:void 0;return 0===Object.keys(o).length&&"string"!=typeof a?{kind:"invalid",error:new dO(dP.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},...void 0!==n&&{_meta:n}}}if("complete"!==r)return{kind:"invalid",error:new dO(dP.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=function(){if(u)return u;let e=dQ();return u={"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 dO(dP.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){var r;if(void 0===t)return e;let o=e._meta;return void 0===o?{...e,_meta:{[i6]:t}}:null===(r=o)||"object"!=typeof r||Array.isArray(r)||void 0!==o[i6]?e:{...e,_meta:{...o,[i6]:t}}})(function(e,t){var r,o,a,i;let n=t[d1];if("complete"!==t.resultType||(r=e,!d0.includes(r))){let e;return void 0===n?t:(e={...o=t},delete e[d1],e)}let s=d2(t.ttlMs)?t.ttlMs:void 0!==(a=n)&&d2(a.ttlMs)?a.ttlMs:0,l=d9(t.cacheScope)?t.cacheScope:void 0!==(i=n)&&d9(i.cacheScope)?i.cacheScope:"private",c={...t,ttlMs:s,cacheScope:l};return delete c[d1],c}(e,function(e,t){let r=t.resultType;if(void 0===r)return{...t,resultType:"complete"};if("complete"===r||pe.includes(e))return t;throw new d5(d3.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=>pc(e)&&"execution"in e)&&(a().tools=i.map(e=>{if(!pc(e)||!("execution"in e))return e;let t={...e};return delete t.execution,t}));let n=t.capabilities;if(pc(n)&&"tasks"in n){let e={...n};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=dQ().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("; ")}`}},ph="2026-07-28";function pm(e){return void 0!==e&&e>=dT?pf:dY}function py(e){return void 0!==e.revision?pm(e.revision).era:"modern"===e.era?pf.era:dY.era}function pg(e){return pb.some(t=>t.hasRequestMethod(e))}function pv(e){return pb.some(t=>t.hasNotificationMethod(e))}function p_(e){return"tasks/get"===e||"tasks/cancel"===e}let pb=[dY,pf];var pS=(e=>{let t={};for(var r in e)du(t,r,{get:e[r],enumerable:!0});return t})({AnnotationsSchema:()=>n0,AudioContentSchema:()=>sb,BaseMetadataSchema:()=>nk,BaseRequestParamsSchema:()=>nc,BlobResourceContentsSchema:()=>nY,BooleanSchemaSchema:()=>s1,CallToolRequestParamsSchema:()=>sA,CallToolRequestSchema:()=>sM,CallToolResultSchema:()=>sI,CancelTaskRequestSchema:()=>lC,CancelTaskResultSchema:()=>lj,CancelledNotificationParamsSchema:()=>nE,CancelledNotificationSchema:()=>nR,ClientCapabilitiesSchema:()=>nN,ClientNotificationSchema:()=>lN,ClientRequestSchema:()=>lI,ClientResultSchema:()=>lA,ClientTasksCapabilitySchema:()=>nj,CompatibilityCallToolResultSchema:()=>sN,CompleteRequestParamsSchema:()=>lp,CompleteRequestSchema:()=>lf,CompleteResultSchema:()=>lh,ContentBlockSchema:()=>sE,CreateMessageRequestParamsSchema:()=>sX,CreateMessageRequestSchema:()=>sY,CreateMessageResultSchema:()=>sQ,CreateMessageResultWithToolsSchema:()=>s0,CreateTaskResultSchema:()=>l$,CursorSchema:()=>ni,DiscoverRequestSchema:()=>nD,DiscoverResultSchema:()=>nU,ElicitRequestFormParamsSchema:()=>lo,ElicitRequestParamsSchema:()=>li,ElicitRequestSchema:()=>ln,ElicitRequestURLParamsSchema:()=>la,ElicitResultSchema:()=>lc,ElicitationCompleteNotificationParamsSchema:()=>ls,ElicitationCompleteNotificationSchema:()=>ll,EmbeddedResourceSchema:()=>s$,EmptyResultSchema:()=>nw,EnumSchemaSchema:()=>lt,GetPromptRequestParamsSchema:()=>sy,GetPromptRequestSchema:()=>sg,GetPromptResultSchema:()=>sP,GetTaskPayloadRequestSchema:()=>lO,GetTaskPayloadResultSchema:()=>lk,GetTaskRequestSchema:()=>lR,GetTaskResultSchema:()=>lP,IconSchema:()=>nP,IconsSchema:()=>nO,ImageContentSchema:()=>s_,ImplementationSchema:()=>nx,InitializeRequestParamsSchema:()=>nA,InitializeRequestSchema:()=>nM,InitializeResultSchema:()=>nz,InitializedNotificationSchema:()=>nL,JSONArraySchema:()=>no,JSONObjectSchema:()=>nr,JSONRPCErrorResponseSchema:()=>nb,JSONRPCMessageSchema:()=>nS,JSONRPCNotificationSchema:()=>nv,JSONRPCRequestSchema:()=>ng,JSONRPCResponseSchema:()=>n$,JSONRPCResultResponseSchema:()=>n_,JSONValueSchema:()=>nt,LegacyTitledEnumSchemaSchema:()=>s4,ListChangedOptionsBaseSchema:()=>sz,ListPromptsRequestSchema:()=>sh,ListPromptsResultSchema:()=>sm,ListResourceTemplatesRequestSchema:()=>n5,ListResourceTemplatesResultSchema:()=>n4,ListResourcesRequestSchema:()=>n9,ListResourcesResultSchema:()=>n3,ListRootsRequestSchema:()=>ly,ListRootsResultSchema:()=>lg,ListTasksRequestSchema:()=>lx,ListTasksResultSchema:()=>lT,ListToolsRequestSchema:()=>sC,ListToolsResultSchema:()=>sj,LoggingLevelSchema:()=>sL,LoggingMessageNotificationParamsSchema:()=>sV,LoggingMessageNotificationSchema:()=>sF,ModelHintSchema:()=>sH,ModelPreferencesSchema:()=>sK,MultiSelectEnumSchemaSchema:()=>le,NotificationSchema:()=>nf,NotificationsParamsSchema:()=>np,NumberSchemaSchema:()=>s9,PaginatedRequestParamsSchema:()=>nG,PaginatedRequestSchema:()=>nB,PaginatedResultSchema:()=>nJ,PingRequestSchema:()=>nV,PrimitiveSchemaDefinitionSchema:()=>lr,ProgressNotificationParamsSchema:()=>nH,ProgressNotificationSchema:()=>nK,ProgressSchema:()=>nF,ProgressTokenSchema:()=>na,PromptArgumentSchema:()=>sp,PromptListChangedNotificationSchema:()=>sO,PromptMessageSchema:()=>sR,PromptReferenceSchema:()=>ld,PromptSchema:()=>sf,ReadResourceRequestParamsSchema:()=>n6,ReadResourceRequestSchema:()=>n8,ReadResourceResultSchema:()=>n7,RelatedTaskMetadataSchema:()=>ns,RequestIdSchema:()=>ny,RequestMetaSchema:()=>nl,RequestSchema:()=>nd,ResourceContentsSchema:()=>nZ,ResourceLinkSchema:()=>sw,ResourceListChangedNotificationSchema:()=>se,ResourceRequestParamsSchema:()=>n6,ResourceSchema:()=>n1,ResourceTemplateReferenceSchema:()=>lu,ResourceTemplateSchema:()=>n2,ResourceUpdatedNotificationParamsSchema:()=>su,ResourceUpdatedNotificationSchema:()=>sd,ResultMetaObjectSchema:()=>nh,ResultSchema:()=>nm,RoleSchema:()=>nQ,RootSchema:()=>lm,RootsListChangedNotificationSchema:()=>lv,SamplingContentSchema:()=>sJ,SamplingMessageContentBlockSchema:()=>sZ,SamplingMessageSchema:()=>sW,ServerCapabilitiesSchema:()=>nq,ServerNotificationSchema:()=>lq,ServerRequestSchema:()=>lM,ServerResultSchema:()=>lz,ServerTasksCapabilitySchema:()=>nI,SetLevelRequestParamsSchema:()=>sD,SetLevelRequestSchema:()=>sU,SingleSelectEnumSchemaSchema:()=>s6,StringSchemaSchema:()=>s2,SubscribeRequestParamsSchema:()=>n6,SubscribeRequestSchema:()=>st,SubscriptionFilterSchema:()=>so,SubscriptionsAcknowledgedNotificationParamsSchema:()=>sn,SubscriptionsAcknowledgedNotificationSchema:()=>ss,SubscriptionsListenRequestParamsSchema:()=>sa,SubscriptionsListenRequestSchema:()=>si,SubscriptionsListenResultMetaSchema:()=>sl,SubscriptionsListenResultSchema:()=>sc,TaskAugmentedRequestParamsSchema:()=>nu,TaskCreationParamsSchema:()=>l_,TaskMetadataSchema:()=>nn,TaskSchema:()=>lS,TaskStatusNotificationParamsSchema:()=>lw,TaskStatusNotificationSchema:()=>lE,TaskStatusSchema:()=>lb,TextContentSchema:()=>sv,TextResourceContentsSchema:()=>nW,TitledMultiSelectEnumSchemaSchema:()=>s7,TitledSingleSelectEnumSchemaSchema:()=>s5,ToolAnnotationsSchema:()=>sk,ToolChoiceSchema:()=>sG,ToolExecutionSchema:()=>sx,ToolListChangedNotificationSchema:()=>sq,ToolResultContentSchema:()=>sB,ToolSchema:()=>sT,ToolUseContentSchema:()=>sS,UnsubscribeRequestParamsSchema:()=>n6,UnsubscribeRequestSchema:()=>sr,UntitledMultiSelectEnumSchemaSchema:()=>s8,UntitledSingleSelectEnumSchemaSchema:()=>s3});let p$=e=>n_.safeParse(e).success,pw=e=>nb.safeParse(e).success,pE=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&"input_required"===e.resultType,pR="x-mcp-header",pP=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,pO=new Set(["string","integer","boolean"]);function pk(e){let t,r=[],o=new Map,a=(e,i,n)=>{if(null===e||"object"!=typeof e)return;if(pR in e){if(!n||0===i.length)return`${pC(i)}: 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 a=e[pR];if("string"!=typeof a||0===a.length)return`${pC(i)}: x-mcp-header MUST be a non-empty string`;if(!pP.test(a))return`${pC(i)}: x-mcp-header '${a}' 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||!pO.has(s)){let e=`${pC(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${s??"<none>"}`;if("number"!==s)return e;t??=e}let l=a.toLowerCase(),c=o.get(l);if(void 0!==c)return`x-mcp-header '${a}' is not case-insensitively unique (also declared as '${c}')`;o.set(l,a),r.push({path:i,headerName:a,type:s})}let s=e.properties;if(null!==s&&"object"==typeof s)for(let[e,t]of Object.entries(s)){let r=a(t,[...i,e],n);if(void 0!==r)return r}for(let t of px){let r=e[t];if(void 0!==r)for(let e of Array.isArray(r)?r:null!==r&&"object"==typeof r&&pT.has(t)?Object.values(r):[r]){let r=a(e,[...i,`<${t}>`],!1);if(void 0!==r)return r}}},i=a(e,[],!0);return void 0!==i?{valid:!1,reason:t??i}:void 0===t?{valid:!0,declarations:r}:{valid:!1,reason:t,declarations:r}}let px=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],pT=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function pC(e){return 0===e.length?"<root>":e.join(".")}let pj="=?base64?";function pI(e){return!function(e){if(0===e.length||e.startsWith(pj)&&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:`${pj}${function(e){let t=new TextEncoder().encode(e),r="";for(let e of t)r+=String.fromCodePoint(e);return btoa(r)}(e)}?=`}d3.InvalidRequest,d3.UnsupportedProtocolVersion,d3.InvalidParams,d3.MethodNotFound,d3.InvalidParams,d3.MissingRequiredClientCapability,d3.ParseError,d3.InvalidRequest,d3.MethodNotFound,d3.UnsupportedProtocolVersion,d3.MissingRequiredClientCapability;let pN={"tools/call":"name","prompts/get":"name","resources/read":"uri","tasks/get":"taskId","tasks/update":"taskId","tasks/cancel":"taskId"};function pA(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function pM(e){if(null==e)return!1;let t=typeof e;return("object"===t||"function"===t)&&"~standard"in e&&"function"==typeof e["~standard"]?.validate}let pq=!1,pz="draft-2020-12",pL=/^#\/(\$defs|definitions)\/([^/~%]+)$/;async function pD(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(e=>{var t;return t=e,t.path?.length?`${t.path.map(e=>String("object"==typeof e?e.key:e)).join(".")}: ${t.message}`:t.message}).join(", ")}:{success:!0,data:r.value}}let pU=/\\\.\\d\{(\d+)\}/;function pV(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let pF=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function pH(e){return pF.has(e)||e.startsWith("x-")}let pK=new Set(["$schema",...Object.keys(lo.shape.requestedSchema.shape)]),pG={string:pA([s2,s3,s5,s4]),number:pA([s9]),integer:pA([s9]),boolean:pA([s1]),array:pA([s8,s7])},pB=new Set(s2.shape.format.unwrap().options);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(!pM(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&&pV(i)?r[a]=Object.fromEntries(Object.entries(i).map(([e,r])=>[e,function(e,t,r,o){if(!pV(e))return e;let a="string"==typeof e.type&&Object.hasOwn(pG,e.type)?pG[e.type]:void 0;if(void 0===a)return e;let i={};for(let[l,c]of Object.entries(e))if(a.has(l)||pH(l))i[l]=c;else if("pattern"===l&&"string"===e.type&&"string"==typeof e.format)if(pB.has(e.format)){var n,s;"string"==typeof c&&(n=e.format,s=c,"zod"!==r||(function(e,t){let r;switch(e){case"email":r=[os(aY,void 0)];break;case"uri":r=[ol(a1,void 0)];break;case"date":r=[ou(aZ,void 0)];break;case"date-time":var o;let a,i;o=t,a=pU.exec(o),i=[void 0,-1,0],a&&i.push(Number(a[1])),r=[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>i.map(r=>oc(aJ,{local:e,offset:t,precision:r}))))}return new Set(r.map(e=>{let t;return t=af(e,{target:pz,io:"input"}),"string"==typeof t.pattern?t.pattern:void 0}).filter(e=>void 0!==e))})(n,s).has(s))||o.push(`${t}.${l}`)}else i[l]=c;else o.push(`${t}.${l}`);return i}(r,`properties.${e}`,t,o)])):pK.has(a)?r[a]=i:pH(a)||o.push(a);if(o.length>0)throw new d5(d3.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:pz});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().");pq||(pq=!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=af(e,{target:pz,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,r=t){if("properties"in t||"patternProperties"in t||"additionalProperties"in t||"required"in t)return!0;let o="string"==typeof t.$ref&&pL.exec(t.$ref);if(o&&r[o[1]]?.[o[2]]?.type==="object")return!0;for(let o of["oneOf","anyOf","allOf"]){let a=t[o];if(Array.isArray(a)&&a.length>0)return a.every(t=>null!==t&&"object"==typeof t&&("object"===t.type||e(t,"$id"in t?{}:r)))}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 d5(d3.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${e}`)}}(e.requestedSchema),r),a=(t=lo.shape.requestedSchema,aj(t,o));if(!a.success)throw new d5(d3.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(e,t){if(!pV(e.properties))return t;let r=Object.entries(e.properties).filter(([,e])=>!aj(lr,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}]`)):pV(t)&&pV(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):pH(t)?[]:[i]}):[]}(o,a.data);if(i.length>0)throw new d5(d3.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(", ")}`);let n=(a.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(a.data.properties,e));if(n.length>0)throw new d5(d3.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${n.join(", ")}`);return{...e,mode:"form",requestedSchema:a.data}}(e)}}catch(e){throw e instanceof d5?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 pJ={},pZ={};function pW(e,t){let r=e.slice(0,-6);pJ[r]=t,pZ[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"])pW(e,pS[e]);for(let[e,t]of Object.entries({IdJagTokenExchangeResponseSchema:lG,OAuthClientInformationFullSchema:lX,OAuthClientInformationSchema:lW,OAuthClientMetadataSchema:lZ,OAuthClientRegistrationErrorSchema:lY,OAuthErrorResponseSchema:lB,OAuthMetadataSchema:lV,OAuthProtectedResourceMetadataSchema:lU,OAuthTokenRevocationRequestSchema:lQ,OAuthTokensSchema:lK,OpenIdProviderDiscoveryMetadataSchema:lH,OpenIdProviderMetadataSchema:lF}))pW(e,t);Object.freeze(pJ);let pX=Object.freeze(pZ),pY=[i5,i4,i8,ne],pQ=["inputResponses","requestState"];function p0(e,t){let r=e.params;if(!p3(r))return{message:e,lifted:{}};let o=r._meta,a=p3(o)?pY.filter(e=>e in o):[],i="request"===t?pQ.filter(e=>e in r):[];if(0===a.length&&0===i.length)return{message:e,lifted:{}};let n={},s={...r};if(a.length>0&&p3(o)){let e={},t={...o};for(let r of a)e[r]=o[r],delete t[r];n.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of i)"inputResponses"===e&&(n.inputResponses=s[e]),"requestState"===e&&(n.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:n}}function p1(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 p2=(I=void 0,()=>I);var p9=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_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??i3,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 dO(dP.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){void 0!==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 dO(dP.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),p$(e)||pw(e))this._onresponse(e);else{let r;if(r=e,ng.safeParse(r).success)this._onrequest(e,t);else{let r;(r=e,nv.safeParse(r).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 dO(dP.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}=p0(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&"drop"===this._shouldDropInbound(e))return;if(t?.classification!==void 0){let e=py(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(pv(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}=p0(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 n=this._transport,s=(e,t,r)=>{let a={jsonrpc:"2.0",id:o.id,error:{code:e,message:t,...void 0!==r&&{data:r}}};n?.send(a).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=py(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;s(d3.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(pg(o.method)&&!i.hasRequestMethod(o.method)&&!(p_(o.method)&&this._customSchemaRequestMethods.has(o.method)))return void s(d3.MethodNotFound,"Method not found");let l=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(void 0===l)return void s(d3.MethodNotFound,"Method not found");let c=i.checkInboundEnvelope(a);if(void 0!==c)return void s(d3.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 f=void 0===a.inputResponses?void 0:function(e){let t={},r=[];if(!p5(e))return{accepted:t,droppedKeys:r};for(let[o,a]of Object.entries(e)){if(!p5(a)||"method"in a||"result"in a){r.push(o);continue}t[o]=a}return{accepted:t,droppedKeys:r}}(a.inputResponses),h={sessionId:n?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...void 0!==a.envelope&&{envelope:a.envelope},...void 0!==f&&{inputResponses:f.accepted},...void 0!==f&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:void 0===a.requestState?p2:(r=a.requestState,()=>r),signal:p.signal,send:(e,t,r)=>{let o=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(o,e.method),pM(t))return d(e,t,r);let a=p1(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(h,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}`)),s(d3.InternalError,"Internal error");return}let r={result:t,jsonrpc:"2.0",id:o.id};await n?.send(r)},async e=>{if(p.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:d3.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 n?.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),n=this._timeoutInfo.get(o);if(n&&i&&n.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(p$(e)?e:d5.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(pM(t))return p_(e.method)||this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r);this._assertOutboundRequestInEra(o,e.method);let a=p1(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 pm(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 pm(void 0);case"server/discover":return pm(ph);default:return}}(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(pg(t)&&!e.hasRequestMethod(t))throw new dO(dP.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:n,resumptionToken:s,onresumptiontoken:l,headers:c}=o??{},u=Date.now();return new Promise((d,p)=>{let f=e=>{p(e)};if(!this._transport)return void f(Error("Not connected"));if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){f(e);return}if(o?.signal?.aborted){let e=o.signal.reason;throw e instanceof dO?e:new dO(dP.RequestTimeout,String(e))}let h=e.era===ph&&!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,_=e=>{v||(this._progressHandlers.delete(m),void 0===h?"initialize"!==t.method&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(e)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:l}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):h.abort(),p(e instanceof dO?e:new dO(dP.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 n;return o?.allowInputRequired===!0?d({resultType:"input_required",inputRequests:(n=i).inputRequests,...void 0!==n.requestState&&{requestState:n.requestState},...void 0!==n._meta&&{_meta:n._meta}}):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)}))}pD(r,i.result).then(e=>{e.success?d(e.data):p(new dO(dP.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},p)}}),a=()=>_(o?.signal?.reason),o?.signal?.addEventListener("abort",a,{once:!0});let b=o?.timeout??6e4;this._setupTimeout(m,b,o?.maxTotalTimeout,()=>_(new dO(dP.RequestTimeout,"Request timed out",{timeout:b})),o?.resetTimeoutOnProgress??!1),this._transport.send(g,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:l,headers:c,requestSignal:h?.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 await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new dO(dP.NotConnected,"Not connected");if(pv(t.method)&&!e.hasNotificationMethod(t.method))throw new dO(dP.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===void 0){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(!pg(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 d5(d3.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 pD(t.params,{...o.params});if(!i.success)throw new d5(d3.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,a)};else throw TypeError("setRequestHandler: handler is required");"function"==typeof t?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.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(!pv(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 d5(d3.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 pD(t.params,{...o.params});if(!a.success)throw new d5(d3.InvalidParams,`Invalid params for notification ${e}: ${a.error}`);await r(a.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function p3(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function p5(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function p4(e){throw new dO(dP.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}var p6=dy((dm(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,n,s,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;n=t.exec(l);){if(n.index!==c)throw TypeError("invalid parameter format");c+=n[0].length,i=n[1].toLowerCase(),34===(s=n[2]).charCodeAt(0)&&-1!==(s=s.slice(1,-1)).indexOf("\\")&&(s=s.replace(r,"$1")),d.parameters[i]=s}if(c!==l.length)throw TypeError("invalid parameter format")}return d}}))(),1),p8=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,nS.parse(JSON.parse(e))}catch(e){if(e instanceof SyntaxError)continue;throw e}}return null}clear(){this._buffer=void 0}};function p7(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}let fe=new Set([301,302,303,307,308]);function ft(e,t){let r=fe.has(t.status)?t.headers?.get("location"):void 0;if(r)try{return new URL(r,e)}catch{return}}let fr=new WeakSet;function fo(e){return fr.has(e)?e:async(t,r)=>{if(r?.redirect==="error"||r?.redirect==="manual")return e(t,r);let o=(r?.method??"GET").toUpperCase(),a=t;for(let t=0;;t++){var i,n;let s=await e(a,{...r,redirect:"manual"}),l=ft(a,s);if(!l||5===t)return s;let c=new URL(a),u="GET"===o||307===s.status||308===s.status,d=!(l.username||l.password)||l.username===c.username&&l.password===c.password;if(!u||!d||(i=c,n=l,(i.protocol!==n.protocol||i.host!==n.host)&&("http:"!==i.protocol||"https:"!==n.protocol||i.hostname!==n.hostname||i.port||n.port)))return s;await s.text?.().catch(()=>{}),a=l}}}var fa=dm(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;)s(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 n(e,...t){let a=[l(e[0])],c=0;for(;c<t.length;)a.push(i),s(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 s(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=n,e.addCodeArg=s,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:n`${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())}}),fi=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=fa();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 n=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=n;let s=(0,t._)`\n`;var l=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new n(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,n=this._values[a];if(n){let e=n.get(i);if(e)return e}else n=this._values[a]=new Map;n.set(i,o);let s=this._scope[a]||(this._scope[a]=[]),l=s.length;return s[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,n={},s){let l=t.nil;for(let c in r){let u=r[c];if(!u)continue;let d=n[c]=n[c]||new Map;u.forEach(r=>{if(d.has(r))return;d.set(r,o.Started);let n=i(r);if(n){let o=this.opts.es5?e.varKinds.var:e.varKinds.const;l=(0,t._)`${l}${o} ${r} = ${n};${this.opts._n}`}else if(n=null==s?void 0:s(r))l=(0,t._)`${l}${n}${this.opts._n}`;else throw new a(r);d.set(r,o.Completed)})}return l}};e.ValueScope=l}),fn=dm(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=fa(),r=fi();var o=fa();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=fi();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}},n=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=T(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=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=T(this.rhs,e,r),this}get names(){return x(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},l=class extends s{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=T(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},f=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)=>k(e,t.names),{})}},h=class extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},m=class extends f{},y=class extends h{};y.kind="else";var g=class e extends h{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(C(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=T(this.condition,e,t),this}get names(){let e=super.names;return x(e,this.condition),this.else&&k(e,this.else.names),e}};g.kind="if";var v=class extends h{};v.kind="for";var _=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=T(this.iteration,e,t),this}get names(){return k(super.names,this.iteration.names)}},b=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 x(x(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=T(this.iterable,e,t),this}get names(){return k(super.names,this.iterable.names)}},$=class extends h{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 f{render(e){return"return "+super.render(e)}};w.kind="return";var E=class extends h{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&&k(e,this.catch.names),this.finally&&k(e,this.finally.names),e}},R=class extends h{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};R.kind="catch";var P=class extends h{render(e){return"finally"+super.render(e)}};P.kind="finally";var O=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 n(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 s(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 _(e),t)}forRange(e,t,o,a,i=this.opts.es5?r.varKinds.var:r.varKinds.let){let n=this._scope.toName(e);return this._for(new b(i,n,t,o),()=>a(n))}forOf(e,o,a,i=r.varKinds.const){let n=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(n,(0,t._)`${e}[${r}]`),a(n)})}return this._for(new S("of",i,n,o),()=>a(n))}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 n=this._scope.toName(e);return this._for(new S("in",i,n,o),()=>a(n))}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 k(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function x(e,r){return r instanceof t._CodeOrName?k(e,r.names):e}function T(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 C(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,t._)`!${A(e)}`}e.CodeGen=O,e.not=C;let j=N(e.operators.AND);e.and=function(...e){return e.reduce(j)};let I=N(e.operators.OR);function N(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(I)}}),fs=dm(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=fn(),a=fa();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]||f(e,`unknown keyword: "${r}"`)}function n(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function s(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,n,s,l)=>{let c=void 0===s?n:s instanceof o.Name?(n instanceof o.Name?e(i,n,s):t(i,n,s),s):n instanceof o.Name?(t(i,s,n),n):r(n,s);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),!n(t,e.self.RULES.all))},e.checkUnknownRules=i,e.schemaHasRules=n,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(s(e))},e.escapeJsonPointer=s,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 f(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():"/"+s(e)},e.checkStrictMode=f}),fl=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn();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")}}),fc=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=fn(),r=fs(),o=fl();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,n,l){let{it:c}=r,{gen:u,compositeRule:d,allErrors:p}=c,f=s(r,o,n);(null!=l?l:d||p)?a(u,f):i(c,(0,t._)`[${f}]`)},e.reportExtraError=function(t,r=e.keywordError,n){let{it:l}=t,{gen:c,compositeRule:u,allErrors:d}=l;a(c,s(t,r,n)),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:n,it:s}){if(void 0===n)throw Error("ajv implementation error");let l=e.name("err");e.forRange("i",n,o.default.errors,n=>{e.const(l,(0,t._)`${o.default.vErrors}[${n}]`),e.if((0,t._)`${l}.instancePath === undefined`,()=>e.assign((0,t._)`${l}.instancePath`,(0,t.strConcat)(o.default.instancePath,s.errorPath))),e.assign((0,t._)`${l}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${r}`),s.opts.verbose&&(e.assign((0,t._)`${l}.schema`,a),e.assign((0,t._)`${l}.data`,i))})};let n={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 s(e,a,i){let{createErrors:s}=e.it;return!1===s?(0,t._)`{}`:function(e,a,i={}){let{gen:s,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 s=i?o:(0,t.str)`${o}/${e}`;return a&&(s=(0,t.str)`${s}${(0,r.getErrorPath)(a,r.Type.Str)}`),[n.schemaPath,s]}(e,i)];return function(e,{params:r,message:a},i){let{keyword:s,data:l,schemaValue:c,it:u}=e,{opts:d,propertyName:p,topSchemaRef:f,schemaPath:h}=u;i.push([n.keyword,s],[n.params,"function"==typeof r?r(e):r||(0,t._)`{}`]),d.messages&&i.push([n.message,"function"==typeof a?a(e):a]),d.verbose&&i.push([n.schema,c],[n.parentSchema,(0,t._)`${f}${h}`],[o.default.data,l]),p&&i.push([n.propertyName,p])}(e,a,c),s.object(...c)}(e,a,i)}}),fu=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=fc(),r=fn(),o=fl(),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:n}=e;!1===a?i(e,!1):"object"==typeof a&&!0===a.$async?t.return(o.default.data):(t.assign((0,r._)`${n}.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)}}),fd=dm(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:{}}}}),fp=dm(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}),ff=dm(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=fd(),a=fp(),i=fc(),n=fn(),s=fs();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:s,data:l,opts:u}=e,p=(o=r,(i=u.coerceTypes)?o.filter(e=>c.has(e)||"array"===i&&"array"===e):[]),h=r.length>0&&!(0===p.length&&1===r.length&&(0,a.schemaHasRulesForType)(e,r[0]));if(h){let o=d(r,l,u.strictNumbers,t.Wrong);s.if(o,()=>{p.length?function(e,t,r){let{gen:o,data:a,opts:i}=e,s=o.let("dataType",(0,n._)`typeof ${a}`),l=o.let("coerced",(0,n._)`undefined`);for(let e of("array"===i.coerceTypes&&o.if((0,n._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>o.assign(a,(0,n._)`${a}[0]`).assign(s,(0,n._)`typeof ${a}`).if(d(t,a,i.strictNumbers),()=>o.assign(l,a))),o.if((0,n._)`${l} !== undefined`),r))(c.has(e)||"array"===e&&"array"===i.coerceTypes)&&function(e){switch(e){case"string":o.elseIf((0,n._)`${s} == "number" || ${s} == "boolean"`).assign(l,(0,n._)`"" + ${a}`).elseIf((0,n._)`${a} === null`).assign(l,(0,n._)`""`);return;case"number":o.elseIf((0,n._)`${s} == "boolean" || ${a} === null
|
|
67
67
|
|| (${s} == "string" && ${a} && ${a} == +${a})`).assign(l,(0,n._)`+${a}`);return;case"integer":o.elseIf((0,n._)`${s} === "boolean" || ${a} === null
|
|
68
68
|
|| (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(l,(0,n._)`+${a}`);return;case"boolean":o.elseIf((0,n._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(l,!1).elseIf((0,n._)`${a} === "true" || ${a} === 1`).assign(l,!0);return;case"null":o.elseIf((0,n._)`${a} === "" || ${a} === 0 || ${a} === false`),o.assign(l,null);return;case"array":o.elseIf((0,n._)`${s} === "string" || ${s} === "number"
|
|
69
|
-
|| ${s} === "boolean" || ${a} === null`).assign(l,(0,n._)`[${a}]`)}}(e);o.else(),f(e),o.endIf(),o.if((0,n._)`${l} !== undefined`,()=>{o.assign(a,l),function({gen:e,parentData:t,parentDataProperty:r},o){e.if((0,n._)`${t} !== undefined`,()=>e.assign((0,n._)`${t}[${r}]`,o))}(e,l)})}(e,r,p):f(e)})}return h};let c=new Set(["string","number","integer","boolean","null"]);function u(e,r,o,a=t.Correct){let i,s=a===t.Correct?n.operators.EQ:n.operators.NEQ;switch(e){case"null":return(0,n._)`${r} ${s} null`;case"array":i=(0,n._)`Array.isArray(${r})`;break;case"object":i=(0,n._)`${r} && typeof ${r} == "object" && !Array.isArray(${r})`;break;case"integer":i=l((0,n._)`!(${r} % 1) && !isNaN(${r})`);break;case"number":i=l();break;default:return(0,n._)`typeof ${r} ${s} ${e}`}return a===t.Correct?i:(0,n.not)(i);function l(e=n.nil){return(0,n.and)((0,n._)`typeof ${r} == "number"`,e,o?(0,n._)`isFinite(${r})`:n.nil)}}function d(e,t,r,o){let a;if(1===e.length)return u(e[0],t,r,o);let i=(0,s.toHash)(e);if(i.array&&i.object){let e=(0,n._)`typeof ${t} != "object"`;a=i.null?e:(0,n._)`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else a=n.nil;for(let e in i.number&&delete i.integer,i)a=(0,n.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,n._)`{type: ${e}}`:(0,n._)`{type: ${t}}`};function f(e){let t=function(e){let{gen:t,data:r,schema:o}=e,a=(0,s.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=f}),fn=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=p8(),r=p7();function o(e,o,a){let{gen:i,compositeRule:n,data:s,opts:l}=e;if(void 0===a)return;let c=(0,t._)`${s}${(0,t.getProperty)(o)}`;if(n)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))}}),fs=ds(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=p8(),r=p7(),o=fe(),a=p7();function i(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}function n(e,r,o){return(0,t._)`${i(e)}.call(${r}, ${o})`}function s(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} === undefined`;return a?(0,t.or)(i,(0,t.not)(n(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(s(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)(s(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=n,e.propertyInData=function(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} !== undefined`;return a?(0,t._)`${i} && ${n(e,r,o)}`:i},e.noPropertyInData=s,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:n,errorPath:s},it:l},c,u,d){let p=d?(0,t._)`${e}, ${r}, ${i}${n}`:r,f=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,s)],[o.default.parentData,l.parentData],[o.default.parentDataProperty,l.parentDataProperty],[o.default.rootData,o.default.rootData]];l.opts.dynamicRef&&f.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let h=(0,t._)`${p}, ${a.object(...f)}`;return u!==t.nil?(0,t._)`${c}.call(${u}, ${h})`:(0,t._)`${c}(${h})`};let c=(0,t._)`new RegExp`;e.usePattern=function({gen:e,it:{opts:r}},o){let i=r.unicodeRegExp?"u":"",{regExp:n}=r.code,s=n(o,i);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,t._)`${"new RegExp"===n.code?c:(0,a.useFunc)(e,n)}(${o}, ${i})`})},e.validateArray=function(e){let{gen:o,data:a,keyword:i,it:n}=e,s=o.name("valid");if(n.allErrors){let e=o.let("valid",!0);return l(()=>o.assign(e,!1)),e}return o.var(s,!0),l(()=>o.break()),s;function l(n){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},s),o.if((0,t.not)(s),n)})}},e.validateUnion=function(e){let{gen:o,schema:a,keyword:i,it:n}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(a.some(e=>(0,r.alwaysValidSchema)(n,e))&&!n.opts.unevaluated)return;let s=o.let("valid",!1),l=o.name("_valid");o.block(()=>a.forEach((r,a)=>{let n=e.subschema({keyword:i,schemaProp:a,compositeRule:!0},l);o.assign(s,(0,t._)`${s} || ${l}`),e.mergeValidEvaluated(n,l)||o.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}}),fl=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=p8(),r=fe(),o=fs(),a=ft();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 n(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:s,it:l}=e,c=r.macro.call(l.self,i,s,l),u=n(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,s){var l;let{gen:c,keyword:u,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,s);let m=n(c,u,!f&&s.compile?s.compile.call(h.self,d,p,h):s.validate),y=c.let("valid");function g(a=s.async?(0,t._)`await `:t.nil){let i=h.opts.passContext?r.default.this:r.default.self,n=!("compile"in s&&!f||!1===s.schema);c.assign(y,(0,t._)`${a}${(0,o.callValidateCode)(e,m,i,n)}`,s.modifying)}function v(e){var r;c.if((0,t.not)(null!=(r=s.valid)?r:y),e)}e.block$data(y,function(){if(!1===s.errors)g(),s.modifying&&i(e),v(()=>e.error());else{let o,n,l=s.async?(o=c.let("ruleErrs",null),c.try(()=>g((0,t._)`await `),e=>c.assign(y,!1).if((0,t._)`${e} instanceof ${h.ValidationError}`,()=>c.assign(o,(0,t._)`${e}.errors`),()=>c.throw(e))),o):(n=(0,t._)`${m}.errors`,c.assign(n,null),g(t.nil),n);s.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=s.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 n=a.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(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)}}}),fc=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=p8(),r=p7();e.getSubschema=function(e,{keyword:o,schemaProp:a,schema:i,schemaPath:n,errSchemaPath:s,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===n||void 0===s||void 0===l)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:l,errSchemaPath:s}}throw Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(e,o,{dataProp:a,dataPropType:i,data:n,dataTypes:s,propertyName:l}){if(void 0!==n&&void 0!==a)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=o;if(void 0!==a){let{errorPath:n,dataPathArr:s,opts:l}=o;u(c.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0)),e.errorPath=(0,t.str)`${n}${(0,r.getErrorPath)(a,i,l.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${a}`,e.dataPathArr=[...s,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!==n&&(u(n instanceof t.Name?n:c.let("data",n,!0)),void 0!==l&&(e.propertyName=l)),s&&(e.dataTypes=s)},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}}),fu=ds((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,n=i[a];if(!e(t[n],r[n]))return!1}return!0}return t!=t&&r!=r}}),fd=ds((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,n,s,l,c,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in o(i,n,s,l,c,u,d),i){var f=i[p];if(Array.isArray(f)){if(p in r.arrayKeywords)for(var h=0;h<f.length;h++)e(t,o,a,f[h],n+"/"+p+"/"+h,s,n,p,i,h)}else if(p in r.propsKeywords){if(f&&"object"==typeof f)for(var m in f)e(t,o,a,f[m],n+"/"+p+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),s,n,p,i,m)}else(p in r.keywords||t.allKeys&&!(p in r.skipKeywords))&&e(t,o,a,f,n+"/"+p,s,n,p,i)}a(i,n,s,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}}),fp=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=p7(),r=fu(),o=fd(),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)),1/0===o)))return 1/0;return o}(e)<=r)};let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function n(e,t="",r){return!1!==r&&(t=c(t)),s(e,e.parse(t))}function s(e,t){return e.serialize(t).split("#")[0]+"#"}e.getFullPath=n,e._getFullPath=s;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,s=c(e[a]||t),l={"":s},d=n(i,s,!1),p={},f=new Set;return o(e,{allKeys:!0},(e,t,r,o)=>{if(void 0===o)return;let i=d+t,n=l[o];function s(t){let r=this.opts.uriResolver.resolve;if(t=c(n?r(n,t):t),f.has(t))throw m(t);f.add(t);let o=this.refs[t];return"string"==typeof o&&(o=this.refs[o]),"object"==typeof o?h(e,o.schema,t):t!==c(i)&&("#"===t[0]?(h(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}"`);s.call(this,`#${e}`)}}"string"==typeof e[a]&&(n=s.call(this,e[a])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),l[t]=n}),p;function h(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`)}}}),ff=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=fr(),r=fi(),o=fa(),a=fi(),i=fn(),n=fl(),s=fc(),l=p8(),c=fe(),u=fp(),d=p7(),p=ft();function f({gen:e,validateName:t,schema:r,schemaEnv:o,opts:a},i){var n;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"; ${h(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}, ${(n=a,(0,l._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${n.dynamicRef?(0,l._)`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`)}`,o.$async,()=>e.code(h(r,a)).code(i))}function h(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 b(e,[],!1,t);let o=(0,r.getSchemaTypes)(e.schema);b(e,o,!(0,r.coerceAndCheckDataType)(e,o),t)}function _({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 b(e,t,r,i){var n,s,u,p;let{gen:f,schema:h,data:m,allErrors:y,opts:g,self:v}=e,{RULES:_}=v;if(h.$ref&&(g.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(h,_)))return void f.block(()=>R(e,"$ref",_.all.$ref.definition));function b(n){(0,o.shouldUseGroup)(h,n)&&(n.type?(f.if((0,a.checkDataType)(n.type,m,g.strictNumbers)),S(e,n),1===t.length&&t[0]===n.type&&r&&(f.else(),(0,a.reportTypeError)(e)),f.endIf()):S(e,n),y||f.if((0,l._)`${c.default.errors} === ${i||0}`))}g.jtd||(n=e,s=t,!n.schemaEnv.meta&&n.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)}}(n,s),n.opts.allowUnionTypes||(u=n,(p=s).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}"`)}}}(n,n.dataTypes))),f.block(()=>{for(let e of _.rules)b(e);b(_.post)})}function S(e,t){let{gen:r,schema:a,opts:{useDefaults:n}}=e;n&&(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;f(e,()=>{r.$comment&&t.$comment&&_(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):f(e,()=>(0,t.topBoolOrEmptySchema)(e))};var E=class{constructor(e,t,r){if((0,n.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",O(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,n.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,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(o,this.it,e),(0,s.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:n}=e;n.$comment&&a.$comment&&_(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 s=i.const("_errs",c.default.errors);v(e,s),i.var(t,(0,l._)`${s} === ${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,n.funcKeywordCode)(a,r):"macro"in r?(0,n.macroKeywordCode)(a,r):(r.compile||r.validate)&&(0,n.funcKeywordCode)(a,r)}e.KeywordCxt=E;let P=/^\/(?:[^~]|~0|~1)*$/,k=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function O(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 n=k.exec(e);if(!n)throw Error(`Invalid JSON-pointer: ${e}`);let l=+n[1];if("#"===(a=n[2])){if(l>=t)throw Error(s("property/index",l));return o[t-l]}if(l>t)throw Error(s("data",l));if(i=r[t-l],!a)return i}let n=i;for(let e of a.split("/"))e&&(i=(0,l._)`${i}${(0,l.getProperty)((0,d.unescapeJsonPointer)(e))}`,n=(0,l._)`${n} && ${i}`);return n;function s(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}e.getData=O}),fh=ds(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}}}),fm=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fp();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))}}}),fy=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=p8(),r=fh(),o=fe(),a=fp(),i=p7(),n=ff();var s=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,s,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:f}=this.opts,h=new t.CodeGen(this.scope,{es5:d,lines:p,ownProperties:f});e.$async&&(i=h.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=h.scopeName("validate");e.validateName=m;let y={gen:h,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:h.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,n.validateFunctionCode)(y),h.optimize(this.opts.code.optimize);let r=h.toString();s=`${h.scopeRefs(o.default.scope)}return ${r}`,this.opts.code.process&&(s=this.opts.code.process(s,e));let a=Function(`${o.default.self}`,`${o.default.scope}`,s)(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:h._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,s&&this.logger.error("Error compiling schema, function code:",s),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 h.call(this,r,e);let n=(0,a.normalizeId)(o),c=this.refs[n]||this.schemas[n];if("string"==typeof c){let t=p.call(this,e,c);if("object"!=typeof(null==t?void 0:t.schema))return;return h.call(this,r,t)}if("object"==typeof(null==c?void 0:c.schema)){if(c.validate||l.call(this,c),n===(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 s({schema:t,schemaId:r,root:e,baseId:i})}return h.call(this,r,c)}}e.SchemaEnv=s,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 n=d.call(this,e,r);if(void 0===n){let a=null==(o=e.localRefs)?void 0:o[r],{schemaId:i}=this.opts;a&&(n=new s({schema:a,schemaId:i,root:e,baseId:t}))}if(void 0!==n)return e.refs[r]=c.call(this,n)},e.getCompilingSchema=u,e.resolveSchema=p;let f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,{baseId:t,schema:r,root:o}){var n;let l;if((null==(n=e.fragment)?void 0:n[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 n="object"==typeof(r=e)&&r[this.opts.schemaId];!f.has(o)&&n&&(t=(0,a.resolveUrl)(this.opts.uriResolver,t,n))}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 s({schema:r,schemaId:c,root:o,baseId:t})).schema!==l.root.schema)return l}}),fg=ds((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}}),fv=ds((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),a=RegExp.prototype.test.bind(/^\d*$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),n=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),s=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),l=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),c=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),u=Array(256);{let e="0123456789ABCDEF";for(let t=0;t<256;t++)u[t]="%"+e[t>>4]+e[15&t]}function d(e){return e<2048?u[192|e>>6]+u[128|63&e]:e<65536?u[224|e>>12]+u[128|e>>6&63]+u[128|63&e]:u[240|e>>18]+u[128|e>>12&63]+u[128|e>>6&63]+u[128|63&e]}let p=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),f=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),h=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),m=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function y(e){let t=-1,r=0,o=-1,a=0;for(let i=0;i<e.length;i++)"0"===e[i]?(-1===o&&(o=i),++a>r&&(r=a,t=o)):(o=-1,a=0);return r<2?e.join(":"):e.slice(0,t).join(":")+"::"+e.slice(t+r).join(":")}function g(e){let t="["===e[0]&&"]"===e[e.length-1];if(("["===e[0]||"]"===e[e.length-1])&&!t)return{host:e,isIPV6:!1,error:!0};let r=t?e.slice(1,-1):e;if(t&&f(r))return r=r.toLowerCase(),{host:`[${r}]`,escapedHost:r,isIPV6:!1,isIPVFuture:!0};if(2>function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(r))return{host:e,isIPV6:!1,error:t};let a="",n=r.indexOf("%");if(-1!==n){let t="%25"===r.slice(n,n+3).toLowerCase()?3:1;if(!function(e){if(0===e.length)return!1;for(let t=0;t<e.length;t++)if(!h(e[t])){if("%"===e[t]&&t+2<e.length&&i(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}(a=r.slice(n+t)))return{host:e,isIPV6:!1,error:!0};r=r.slice(0,n)}let s=function(e){let t=e.indexOf("::");if(-1!==t&&-1!==e.indexOf("::",t+1))return;let r=-1===t?e.split(":"):e.slice(0,t).split(":"),a=-1===t?[]:e.slice(t+2).split(":");-1!==t&&(1===r.length&&""===r[0]&&(r.length=0),1===a.length&&""===a[0]&&(a.length=0));let i=r.concat(a),n=0;for(let e=0;e<i.length;e++){let r=i[e];if(""===r)return;if(-1!==r.indexOf(".")){if(e!==i.length-1||-1!==t&&0===a.length||!o(r))return;n+=2;continue}if(!p(r))return;i[e]=parseInt(r,16).toString(16),n++}if(-1===t){if(8!==n)return;return y(i)}if(n>=8)return;let s=i.slice(0,r.length);for(let e=n;e<8;e++)s.push("0");for(let e=r.length;e<i.length;e++)s.push(i[e]);return y(s)}(r);return void 0===s?{host:e,isIPV6:!1,error:!0}:{host:s+(a?"%"+a:""),escapedHost:s+(a?"%25"+a:""),isIPV6:!0}}let v={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},_=/[@/?#:]/g,b=/[@/?#]/g;function S(e,t){let r=t?b:_;return r.lastIndex=0,e.replace(r,e=>v[e])}function $(e,t=!1){if(-1===e.indexOf("%"))return e;let r="";for(let o=0;o<e.length;o++){if("%"===e[o]&&o+2<e.length){let a=e.slice(o+1,o+3);if(i(a)){let e=a.toUpperCase(),i=String.fromCharCode(parseInt(e,16));t&&n(i)?r+=i:r+="%"+e,o+=2;continue}}r+=e[o]}return r}function w(e,t){let r="";for(let o=0;o<e.length;o++){let a=e[o];if("%"===a&&o+2<e.length){let t=e.slice(o+1,o+3);if(i(t)){r+="%"+t.toUpperCase(),o+=2;continue}}if(t(a))r+=a;else{let t=e.charCodeAt(o);if(t<128)r+=u[t];else if(t<55296||t>57343)r+=d(t);else if(t<=56319&&o+1<e.length){let a=e.charCodeAt(o+1);a>=56320&&a<=57343?(r+=d(65536+(t-55296<<10)+(a-56320)),o++):r+=d(65533)}else r+=d(65533)}}return r}function E(e){return w(e,c)}function R(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||42===e||43===e||45===e||46===e||47===e||64===e||95===e}t.exports={nonSimpleDomain:m,recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(E(e.userinfo)),t.push("@")),void 0!==e.host){let r=e.host;if(!o(r)){let e=g(r);!0!==e.isIPV6&&!0!==e.isIPVFuture&&(e=g(r=$(r,!0))),r=!0===e.isIPV6||!0===e.isIPVFuture?`[${e.escapedHost}]`:S(r,!1)}t.push(r)}if("number"==typeof e.port||"string"==typeof e.port){let r=String(e.port);if(!a(r))throw TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0},reescapeHostDelimiters:S,normalizePercentEncoding:$,normalizePathEncoding:function(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];if("%"===o&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),a=String.fromCharCode(parseInt(e,16));"."!==a&&n(a)?t+=a:t+="%"+e,r+=2;continue}}if(s(o))t+=o;else{let a=e.charCodeAt(r);if(a<128)t+=R(a)?o:u[a];else if(a<55296||a>57343)t+=d(a);else if(a<=56319&&r+1<e.length){let o=e.charCodeAt(r+1);o>=56320&&o<=57343?(t+=d(65536+(a-55296<<10)+(o-56320)),r++):t+=d(65533)}else t+=d(65533)}}return t},serializePathEncoding:function(e,t=!1){let r="",o=t&&"/"!==e[0];for(let t=0;t<e.length;t++){let a=e[t];if("%"===a&&t+2<e.length){let o=e.slice(t+1,t+3);if(i(o)){r+="%"+o.toUpperCase(),t+=2;continue}}if("/"===a&&(o=!1),s(a)&&(":"!==a||!o))r+=a;else{let o=e.charCodeAt(t);if(o<128)r+=u[o];else if(o<55296||o>57343)r+=d(o);else if(o<=56319&&t+1<e.length){let a=e.charCodeAt(t+1);a>=56320&&a<=57343?(r+=d(65536+(o-55296<<10)+(a-56320)),t++):r+=d(65533)}else r+=d(65533)}}return r},normalizeQueryFragmentEncoding:function(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];if("%"===o&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),a=String.fromCharCode(parseInt(e,16));n(a)?t+=a:t+="%"+e,r+=2;continue}}if(l(o))t+=o;else{let a=e.charCodeAt(r);if(a<128)t+=R(a)?o:u[a];else if(a<55296||a>57343)t+=d(a);else if(a<=56319&&r+1<e.length){let o=e.charCodeAt(r+1);o>=56320&&o<=57343?(t+=d(65536+(a-55296<<10)+(o-56320)),r++):t+=d(65533)}else t+=d(65533)}}return t},encodeUserinfo:E,encodeQuery:function(e){return w(e,l)},encodeFragment:function(e){return w(e,l)},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(i(o)){t+="%"+o.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t},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:g,stringArrayToHexStripped:function(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}}}),f_=ds((e,t)=>{let{isUUID:r}=fv(),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 n(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function s(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:n,serialize:s},c={scheme:"https",domainHost:l.domainHost,parse:n,serialize:s},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=e.resourceName.indexOf("?"),r=-1===t?e.resourceName:e.resourceName.slice(0,t);e.path=r&&"/"!==r?r:void 0,e.query=-1===t?void 0:e.resourceName.slice(t+1),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&&r[0]===e.path){let o=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let a=f(`${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=f(`${r}:${t.nid||o}`);a&&(e=a.serialize(e,t));let i=e,n=e.nss;return i.path=`${o||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&&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 f(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:f}}),fb=ds((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:a,normalizePercentEncoding:i,normalizePathEncoding:n,serializePathEncoding:s,normalizeQueryFragmentEncoding:l,encodeQuery:c,encodeFragment:u,reescapeHostDelimiters:d,isIPv4:p,nonSimpleDomain:f}=fv(),{SCHEMES:h,getSchemeHandler:m}=f_(),y=/^[A-Za-z][A-Za-z0-9+.-]*$/u,g="URI scheme is malformed.";function v(e){let t=unescape(String(e));if(!y.test(t))throw TypeError(g);return t}function _(e,t,r,a){let i={};return a||(e=O(b(e,r),r),t=O(b(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 b(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),l=[];r.scheme&&(r.scheme=v(r.scheme));let d=m(n.scheme||r.scheme);d&&d.serialize&&d.serialize(r,n);let p=void 0!==r.userinfo||void 0!==r.host||void 0!==r.port,f=!n.skipEscape&&void 0===r.scheme&&!p;void 0!==r.path&&(n.skipEscape?r.path=i(r.path):r.path=s(r.path,f)),"suffix"!==n.reference&&r.scheme&&(r.scheme=v(r.scheme),l.push(r.scheme,":"));let h=a(r);if(void 0!==h&&("suffix"!==n.reference&&l.push("//"),l.push(h),r.path&&"/"!==r.path[0]&&l.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||d&&d.absolutePath||(e=o(e)),f&&(e=s(e,!0)),void 0===h&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),l.push(e)}return void 0!==r.query&&l.push("?",c(r.query)),void 0!==r.fragment&&l.push("#",u(r.fragment)),l.join("")}let S=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,$=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,w=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function E(e){if(void 0===e)return!1;let t=e.indexOf("%");for(;-1!==t;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function R(e){return"["===e[0]&&"]"===e[e.length-1]}function P(e,t,r,o){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!R(e.host)&&(t.domainHost||r&&r.domainHost)&&!1===o&&f(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(t){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+t,!0}return!1}function k(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},s=!1,c=!1,u=!1,f=!1,v=!1,_=!1,b=!1;"suffix"===o.reference&&(e=o.scheme?o.scheme+":"+e:"//"+e);let k=e.match($);null!==k&&-1!==k[1].indexOf("\\")&&(a.error="URI authority must not contain a literal backslash.",s=!0);let O=e.match(w);if(null!==O){let e=O[1],t=e.replace(/[\t\n\r]/g,"");t.length>=2&&("//"!==t.slice(0,2)?(a.error=a.error||"URI authority must not contain a literal backslash.",s=!0):e.length!==t.length&&(a.error=a.error||"URI authority introducer must not contain whitespace.",s=!0))}let x=e.match(S);if(x){let t;if(a.scheme=x[1],a.userinfo=x[3],a.host=x[4],a.port=parseInt(x[5],10),a.path=x[6]||"",a.query=x[7],a.fragment=x[8],void 0!==a.scheme){let e=unescape(a.scheme);y.test(e)?a.scheme=e.toLowerCase():(a.error=a.error||g,_=!0)}t=x[4],(c=E(x[3])||void 0!==t&&!R(t)&&E(t)||E(x[6])||E(x[7])||E(x[8]))&&(a.error=a.error||"URI contains malformed percent-encoding."),isNaN(a.port)&&(a.port=x[5]);let S=void 0!==x[2]&&a.path&&"/"!==a.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof a.port&&(a.port<0||a.port>65535)?"URI port is malformed.":void 0;if(void 0!==S&&(a.error=a.error||S,s=!0),a.host)if(!1===p(a.host)){let e=R(a.host),t=-1!==a.host.indexOf("[")||-1!==a.host.indexOf("]"),o=r(a.host);b=o.isIPV6||!0===o.isIPVFuture,v=t&&(!e||!0===o.error),a.host=b?o.host:o.host.toLowerCase(),v&&(a.error=a.error||"URI host is malformed.",s=!0)}else b=!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 $=m(o.scheme||a.scheme);if(v||(f=P(a,o,$,b)),-1!==e.indexOf("%")&&void 0!==a.host&&!v){let e=b?a.host:i(a.host,!0);b||(e=i(e.toLowerCase())),a.host=d(e,b)}(!$||$&&!$.skipNormalize)&&(a.path&&(a.path=n(a.path)),a.query&&(a.query=l(a.query)),a.fragment&&(a.fragment=l(a.fragment))),$&&$.parse&&($.parse(a,o),$===h.urn&&void 0===a.nid&&(u=!0))}else a.error=a.error||"URI can not be parsed.";return{parsed:a,malformedAuthorityOrPort:s,malformedPercentEncoding:c,malformedSchemeSpecific:u,malformedHost:f,malformedScheme:_}}function O(e,t){return k(e,t).parsed}function x(e,t){let{parsed:r,malformedAuthorityOrPort:o,malformedPercentEncoding:a,malformedSchemeSpecific:i,malformedHost:n,malformedScheme:s}=k(e,t);return{normalized:o||a||i||n||s?e:b(r,t),malformedAuthorityOrPort:o,malformedPercentEncoding:a,malformedSchemeSpecific:i,malformedHost:n,malformedScheme:s}}function T(e,t){let r;if("string"!=typeof e&&"object"!=typeof e)return;try{r="string"==typeof e?e:b(e,t)}catch{return}let{normalized:o,malformedAuthorityOrPort:a,malformedPercentEncoding:i,malformedSchemeSpecific:n,malformedHost:s,malformedScheme:l}=x(r,t);return a||i||n||s||l?void 0:o}let j={SCHEMES:h,normalize:function(e,t){return"string"==typeof e?e=x(e,t).normalized:"object"==typeof e&&(e=O(b(e,t),t)),e},resolve:function(e,t,o){let a=o?Object.assign({scheme:"null"},o):{scheme:"null"},{parsed:i,malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:l,malformedHost:c,malformedScheme:u}=k(e,a),{parsed:d,malformedAuthorityOrPort:f,malformedPercentEncoding:h,malformedSchemeSpecific:y,malformedHost:g,malformedScheme:v}=k(t,a);if(n||f||s||h||l||y||c||g||u||v)throw Error(i.error||d.error||"URI is malformed.");let S=_(i,d,a,!0),$=m(o&&o.scheme||S.scheme),w=S.host;P(S,o||{},$,void 0!==w&&""!==w&&(p(w)||r(w).isIPV6));let E=w&&-1!==w.indexOf("%")&&!/\P{ASCII}/u.test(w);if(S.error&&!E)throw Error(S.error);return a.skipEscape=!0,b(S,a)},resolveComponent:_,equal:function(e,t,r){let o=T(e,r),a=T(t,r);return void 0!==o&&void 0!==a&&o===a},serialize:b,parse:O};t.exports=j,t.exports.default=j,t.exports.fastUri=j}),fS=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fb();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),f$=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=ff();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=p8();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=fh(),a=fm(),i=fo(),n=fy(),s=p8(),l=fp(),c=fi(),u=p7(),d=fg(),p=fS(),f=(e,t)=>new RegExp(e,t);f.code="new RegExp";let h=["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={}){var t,r,o,a,n,l,c,u,d,h,v,b,P,k,O,x,T,j,C,I,N,A,M,q,z,L;let D,U,V,F,H;this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...(D=(t=e).strict,V=!0===(U=null==(r=t.code)?void 0:r.optimize)||void 0===U?1:U||0,F=null!=(a=null==(o=t.code)?void 0:o.regExp)?a:f,H=null!=(n=t.uriResolver)?n:p.default,{strictSchema:null==(c=null!=(l=t.strictSchema)?l:D)||c,strictNumbers:null==(d=null!=(u=t.strictNumbers)?u:D)||d,strictTypes:null!=(v=null!=(h=t.strictTypes)?h:D)?v:"log",strictTuples:null!=(P=null!=(b=t.strictTuples)?b:D)?P:"log",strictRequired:null!=(O=null!=(k=t.strictRequired)?k:D)&&O,code:t.code?{...t.code,optimize:V,regExp:F}:{optimize:V,regExp:F},loopRequired:null!=(x=t.loopRequired)?x:200,loopEnum:null!=(T=t.loopEnum)?T:200,meta:null==(j=t.meta)||j,messages:null==(C=t.messages)||C,inlineRefs:null==(I=t.inlineRefs)||I,schemaId:null!=(N=t.schemaId)?N:"$id",addUsedSchema:null==(A=t.addUsedSchema)||A,validateSchema:null==(M=t.validateSchema)||M,validateFormats:null==(q=t.validateFormats)||q,unicodeRegExp:null==(z=t.unicodeRegExp)||z,int32range:null==(L=t.int32range)||L,uriResolver:H})};let{es5:K,lines:G}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:K,lines:G}),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);let B=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),_.call(this,y,e,"NOT SUPPORTED"),_.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=B}_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||n.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await o.call(this,{$ref:e},!0)}async function n(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await l.call(this,t.missingSchema),n.call(this,e)}}function s({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=b.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,o=new n.SchemaEnv({schema:{},schemaId:r});if(!(t=n.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=b.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=>O.call(this,e)),this;T.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=>O.call(this,e,o):e=>o.type.forEach(t=>O.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:s}=this.opts;if("object"==typeof e)i=e[s];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 n.SchemaEnv({schema:e,schemaId:s,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):n.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{n.compileSchema.call(this,e)}finally{this.opts=t}}};function _(e,t,r,o="error"){for(let a in e)a in t&&this.logger[o](`${r}: option ${a}. ${e[a]}`)}function b(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 h)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 O(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,n=a?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 s={keyword:e,definition:{...t,type:(0,c.getJSONTypes)(t.type),schemaType:(0,c.getJSONTypes)(t.schemaType)}};t.before?x.call(this,n,s,t.before):n.rules.push(s),i.all[e]=s,null==(o=t.implements)||o.forEach(e=>this.addKeyword(e))}function x(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 T(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]}}}),fw=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}}),fE=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=fm(),r=fs(),o=p8(),a=fe(),i=fy(),n=p7();function s(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,s){let{gen:l,it:c}=e,{allErrors:u,schemaEnv:d,opts:p}=c,f=p.passContext?a.default.this:o.nil;function h(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=n.mergeEvaluated.props(l,r.props,c.props));else{let t=l.var("props",(0,o._)`${e}.evaluated.props`);c.props=n.mergeEvaluated.props(l,t,c.props,o.Name)}if(!0!==c.items)if(r&&!r.dynamicItems)void 0!==r.items&&(c.items=n.mergeEvaluated.items(l,r.items,c.items));else{let t=l.var("items",(0,o._)`${e}.evaluated.items`);c.items=n.mergeEvaluated.items(l,t,c.items,o.Name)}}s?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,f)}`),m(t),u||l.assign(a,!0)},e=>{l.if((0,o._)`!(${e} instanceof ${c.ValidationError})`,()=>l.throw(e)),h(e),u||l.assign(a,!1)}),e.ok(a)}():e.result((0,r.callValidateCode)(e,t,f),()=>m(t),()=>h(t))}e.getValidate=s,e.callRef=l,e.default={keyword:"$ref",schemaType:"string",code(e){var r,a;let n,c,u,{gen:d,schema:p,it:f}=e,{baseId:h,schemaEnv:m,validateName:y,opts:g,self:v}=f,{root:_}=m;if(("#"===p||"#/"===p)&&h===_.baseId){if(m===_)return l(e,y,m,m.$async);let t=d.scopeValue("root",{ref:_});return l(e,(0,o._)`${t}.validate`,_,_.$async)}let b=i.resolveRef.call(v,_,h,p);if(void 0===b)throw new t.default(f.opts.uriResolver,h,p);return b instanceof i.SchemaEnv?void l(e,s(e,r=b),r,r.$async):(a=b,n=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:n,errSchemaPath:p},c),void(e.mergeEvaluated(u),e.ok(c)))}}}),fR=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fw(),r=fE();e.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default]}),fP=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8(),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})`)}}}),fk=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8();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,n=i.opts.multipleOfPrecision,s=r.let("res"),l=n?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${n}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${a} === 0 || (${s} = ${o}/${a}, ${l}))`)}}}),fO=ds(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'}),fx=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8(),r=p7(),o=fO();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:n,it:s}=e,l="maxLength"===a?t.operators.GT:t.operators.LT,c=!1===s.opts.unicode?(0,t._)`${i}.length`:(0,t._)`${(0,r.useFunc)(e.gen,o.default)}(${i})`;e.fail$data((0,t._)`${c} ${l} ${n}`)}}}),fT=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fs(),r=p7(),o=p8();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:n,schema:s,schemaCode:l,it:c}=e,u=c.opts.unicodeRegExp?"u":"";if(n){let{regExp:t}=c.opts.code,n="new RegExp"===t.code?(0,o._)`new RegExp`:(0,r.useFunc)(a,t),s=a.let("valid");a.try(()=>a.assign(s,(0,o._)`${n}(${l}, ${u}).test(${i})`),()=>a.assign(s,!1)),e.fail$data((0,o._)`!${s}`)}else{let r=(0,t.usePattern)(e,s);e.fail$data((0,o._)`!${r}.test(${i})`)}}}}),fj=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8();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}`)}}}),fC=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fs(),r=p8(),o=p7();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:n,data:s,$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,n,()=>{a.assign(c,(0,t.propertyInData)(a,s,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",n,r=>{e.setParams({missingProperty:r}),a.if((0,t.noPropertyInData)(a,s,r,u.ownProperties),()=>e.error())})}}}}),fI=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8();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}`)}}}),fN=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fu();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),fA=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fi(),r=p8(),o=p7(),a=fN();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:n,$data:s,schema:l,parentSchema:c,schemaCode:u,it:d}=e;if(!s&&!l)return;let p=i.let("valid"),f=c.items?(0,t.getSchemaTypes)(c.items):[];e.block$data(p,function(){let s=i.let("i",(0,r._)`${n}.length`),l=i.let("j");e.setParams({i:s,j:l}),i.assign(p,!0),i.if((0,r._)`${s} > 1`,()=>(f.length>0&&!f.some(e=>"object"===e||"array"===e)?function(o,a){let s=i.name("item"),l=(0,t.checkDataTypes)(f,s,d.opts.strictNumbers,t.DataType.Wrong),c=i.const("indices",(0,r._)`{}`);i.for((0,r._)`;${o}--;`,()=>{i.let(s,(0,r._)`${n}[${o}]`),i.if(l,(0,r._)`continue`),f.length>1&&i.if((0,r._)`typeof ${s} == "string"`,(0,r._)`${s} += "_"`),i.if((0,r._)`typeof ${c}[${s}] == "number"`,()=>{i.assign(a,(0,r._)`${c}[${s}]`),e.error(),i.assign(p,!1).break()}).code((0,r._)`${c}[${s}] = ${o}`)})}:function(t,s){let l=(0,o.useFunc)(i,a.default),c=i.name("outer");i.label(c).for((0,r._)`;${t}--;`,()=>i.for((0,r._)`${s} = ${t}; ${s}--;`,()=>i.if((0,r._)`${l}(${n}[${t}], ${n}[${s}])`,()=>{e.error(),i.assign(p,!1).break(c)})))})(s,l))},(0,r._)`${u} === false`),e.ok(p)}}}),fM=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8(),r=p7(),o=fN();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:n,schemaCode:s,schema:l}=e;n||l&&"object"==typeof l?e.fail$data((0,t._)`!${(0,r.useFunc)(a,o.default)}(${i}, ${s})`):e.fail((0,t._)`${l} !== ${i}`)}}}),fq=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8(),r=p7(),o=fN();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:n,data:s,$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,f=()=>null!=a?a:a=(0,r.useFunc)(n,o.default);if(p||l)i=n.let("valid"),e.block$data(i,function(){n.assign(i,!1),n.forOf("v",u,e=>n.if((0,t._)`${f()}(${s}, ${e})`,()=>n.assign(i,!0).break()))});else{if(!Array.isArray(c))throw Error("ajv implementation error");let e=n.const("vSchema",u);i=(0,t.or)(...c.map((r,o)=>{var a,i;let n;return a=e,"object"==typeof(n=c[i=o])&&null!==n?(0,t._)`${f()}(${s}, ${a}[${i}])`:(0,t._)`${s} === ${n}`}))}e.pass(i)}}}),fz=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fP(),r=fk(),o=fx(),a=fT(),i=fj(),n=fC(),s=fI(),l=fA(),c=fM(),u=fq();e.default=[t.default,r.default,o.default,a.default,i.default,n.default,s.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default]}),fL=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=p8(),r=p7();function o(e,o){let{gen:a,schema:i,data:n,keyword:s,it:l}=e;l.items=!0;let c=a.const("len",(0,t._)`${n}.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 n;return n=i,void a.forRange("i",o.length,c,o=>{e.subschema({keyword:s,dataProp:o,dataPropType:r.Type.Num},n),l.allErrors||a.if((0,t.not)(n),()=>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')}}}),fD=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=p8(),r=p7(),o=fs();function a(e,o,i=e.schema){let{gen:n,parentSchema:s,data:l,keyword:c,it:u}=e;(function(e){let{opts:t,errSchemaPath:a}=u,n=i.length,s=n===e.minItems&&(n===e.maxItems||!1===e[o]);if(t.strictTuples&&!s){let e=`"${c}" is ${n}-tuple, but minItems or maxItems/${o} are not specified or different at path "${a}"`;(0,r.checkStrictMode)(u,e,t.strictTuples)}})(s),u.opts.unevaluated&&i.length&&!0!==u.items&&(u.items=r.mergeEvaluated.items(n,i.length,u.items));let d=n.name("valid"),p=n.const("len",(0,t._)`${l}.length`);i.forEach((o,a)=>{(0,r.alwaysValidSchema)(u,o)||(n.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))}}}),fU=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fD();e.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,t.validateTuple)(e,"items")}}),fV=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8(),r=p7(),o=fs(),a=fL();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:n}=e,{prefixItems:s}=i;n.items=!0,(0,r.alwaysValidSchema)(n,t)||(s?(0,a.validateAdditionalItems)(e,s):e.ok((0,o.validateArray)(e)))}}}),fF=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8(),r=p7();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:n,parentSchema:s,data:l,it:c}=e,{minContains:u,maxContains:d}=s;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,n)){let r=(0,t._)`${p} >= ${o}`;void 0!==a&&(r=(0,t._)`${r} && ${p} <= ${a}`),e.pass(r);return}c.items=!0;let f=i.name("valid");function h(){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(f,!0).break()):(i.if((0,t._)`${e} > ${a}`,()=>i.assign(f,!1).break()),1===o?i.assign(f,!0):i.if((0,t._)`${e} >= ${o}`,()=>i.assign(f,!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(f,()=>i.if(f,()=>i.break())):0===o?(i.let(f,!0),void 0!==a&&i.if((0,t._)`${l}.length > 0`,h)):(i.let(f,!1),h()),e.result(f,()=>e.reset())}}}),fH=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=p8(),r=p7(),o=fs();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},
|
|
69
|
+
|| ${s} === "boolean" || ${a} === null`).assign(l,(0,n._)`[${a}]`)}}(e);o.else(),f(e),o.endIf(),o.if((0,n._)`${l} !== undefined`,()=>{o.assign(a,l),function({gen:e,parentData:t,parentDataProperty:r},o){e.if((0,n._)`${t} !== undefined`,()=>e.assign((0,n._)`${t}[${r}]`,o))}(e,l)})}(e,r,p):f(e)})}return h};let c=new Set(["string","number","integer","boolean","null"]);function u(e,r,o,a=t.Correct){let i,s=a===t.Correct?n.operators.EQ:n.operators.NEQ;switch(e){case"null":return(0,n._)`${r} ${s} null`;case"array":i=(0,n._)`Array.isArray(${r})`;break;case"object":i=(0,n._)`${r} && typeof ${r} == "object" && !Array.isArray(${r})`;break;case"integer":i=l((0,n._)`!(${r} % 1) && !isNaN(${r})`);break;case"number":i=l();break;default:return(0,n._)`typeof ${r} ${s} ${e}`}return a===t.Correct?i:(0,n.not)(i);function l(e=n.nil){return(0,n.and)((0,n._)`typeof ${r} == "number"`,e,o?(0,n._)`isFinite(${r})`:n.nil)}}function d(e,t,r,o){let a;if(1===e.length)return u(e[0],t,r,o);let i=(0,s.toHash)(e);if(i.array&&i.object){let e=(0,n._)`typeof ${t} != "object"`;a=i.null?e:(0,n._)`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else a=n.nil;for(let e in i.number&&delete i.integer,i)a=(0,n.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,n._)`{type: ${e}}`:(0,n._)`{type: ${t}}`};function f(e){let t=function(e){let{gen:t,data:r,schema:o}=e,a=(0,s.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=f}),fh=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=fn(),r=fs();function o(e,o,a){let{gen:i,compositeRule:n,data:s,opts:l}=e;if(void 0===a)return;let c=(0,t._)`${s}${(0,t.getProperty)(o)}`;if(n)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))}}),fm=dm(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=fn(),r=fs(),o=fl(),a=fs();function i(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}function n(e,r,o){return(0,t._)`${i(e)}.call(${r}, ${o})`}function s(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} === undefined`;return a?(0,t.or)(i,(0,t.not)(n(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(s(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)(s(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=n,e.propertyInData=function(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} !== undefined`;return a?(0,t._)`${i} && ${n(e,r,o)}`:i},e.noPropertyInData=s,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:n,errorPath:s},it:l},c,u,d){let p=d?(0,t._)`${e}, ${r}, ${i}${n}`:r,f=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,s)],[o.default.parentData,l.parentData],[o.default.parentDataProperty,l.parentDataProperty],[o.default.rootData,o.default.rootData]];l.opts.dynamicRef&&f.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let h=(0,t._)`${p}, ${a.object(...f)}`;return u!==t.nil?(0,t._)`${c}.call(${u}, ${h})`:(0,t._)`${c}(${h})`};let c=(0,t._)`new RegExp`;e.usePattern=function({gen:e,it:{opts:r}},o){let i=r.unicodeRegExp?"u":"",{regExp:n}=r.code,s=n(o,i);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,t._)`${"new RegExp"===n.code?c:(0,a.useFunc)(e,n)}(${o}, ${i})`})},e.validateArray=function(e){let{gen:o,data:a,keyword:i,it:n}=e,s=o.name("valid");if(n.allErrors){let e=o.let("valid",!0);return l(()=>o.assign(e,!1)),e}return o.var(s,!0),l(()=>o.break()),s;function l(n){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},s),o.if((0,t.not)(s),n)})}},e.validateUnion=function(e){let{gen:o,schema:a,keyword:i,it:n}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(a.some(e=>(0,r.alwaysValidSchema)(n,e))&&!n.opts.unevaluated)return;let s=o.let("valid",!1),l=o.name("_valid");o.block(()=>a.forEach((r,a)=>{let n=e.subschema({keyword:i,schemaProp:a,compositeRule:!0},l);o.assign(s,(0,t._)`${s} || ${l}`),e.mergeValidEvaluated(n,l)||o.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}}),fy=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=fn(),r=fl(),o=fm(),a=fc();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 n(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:s,it:l}=e,c=r.macro.call(l.self,i,s,l),u=n(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,s){var l;let{gen:c,keyword:u,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,s);let m=n(c,u,!f&&s.compile?s.compile.call(h.self,d,p,h):s.validate),y=c.let("valid");function g(a=s.async?(0,t._)`await `:t.nil){let i=h.opts.passContext?r.default.this:r.default.self,n=!("compile"in s&&!f||!1===s.schema);c.assign(y,(0,t._)`${a}${(0,o.callValidateCode)(e,m,i,n)}`,s.modifying)}function v(e){var r;c.if((0,t.not)(null!=(r=s.valid)?r:y),e)}e.block$data(y,function(){if(!1===s.errors)g(),s.modifying&&i(e),v(()=>e.error());else{let o,n,l=s.async?(o=c.let("ruleErrs",null),c.try(()=>g((0,t._)`await `),e=>c.assign(y,!1).if((0,t._)`${e} instanceof ${h.ValidationError}`,()=>c.assign(o,(0,t._)`${e}.errors`),()=>c.throw(e))),o):(n=(0,t._)`${m}.errors`,c.assign(n,null),g(t.nil),n);s.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=s.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 n=a.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(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)}}}),fg=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=fn(),r=fs();e.getSubschema=function(e,{keyword:o,schemaProp:a,schema:i,schemaPath:n,errSchemaPath:s,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===n||void 0===s||void 0===l)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:l,errSchemaPath:s}}throw Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(e,o,{dataProp:a,dataPropType:i,data:n,dataTypes:s,propertyName:l}){if(void 0!==n&&void 0!==a)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=o;if(void 0!==a){let{errorPath:n,dataPathArr:s,opts:l}=o;u(c.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0)),e.errorPath=(0,t.str)`${n}${(0,r.getErrorPath)(a,i,l.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${a}`,e.dataPathArr=[...s,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!==n&&(u(n instanceof t.Name?n:c.let("data",n,!0)),void 0!==l&&(e.propertyName=l)),s&&(e.dataTypes=s)},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}}),fv=dm((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,n=i[a];if(!e(t[n],r[n]))return!1}return!0}return t!=t&&r!=r}}),f_=dm((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,n,s,l,c,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in o(i,n,s,l,c,u,d),i){var f,h=i[p];if(Array.isArray(h)){if(p in r.arrayKeywords)for(var m=0;m<h.length;m++)e(t,o,a,h[m],n+"/"+p+"/"+m,s,n,p,i,m)}else if(p in r.propsKeywords){if(h&&"object"==typeof h)for(var y in h){e(t,o,a,h[y],n+"/"+p+"/"+(f=y).replace(/~/g,"~0").replace(/\//g,"~1"),s,n,p,i,y)}}else(p in r.keywords||t.allKeys&&!(p in r.skipKeywords))&&e(t,o,a,h,n+"/"+p,s,n,p,i)}a(i,n,s,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}}),fb=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=fs(),r=fv(),o=f_(),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)),1/0===o)))return 1/0;return o}(e)<=r)};let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function n(e,t="",r){return!1!==r&&(t=c(t)),s(e,e.parse(t))}function s(e,t){return e.serialize(t).split("#")[0]+"#"}e.getFullPath=n,e._getFullPath=s;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,s=c(e[a]||t),l={"":s},d=n(i,s,!1),p={},f=new Set;return o(e,{allKeys:!0},(e,t,r,o)=>{if(void 0===o)return;let i=d+t,n=l[o];function s(t){let r=this.opts.uriResolver.resolve;if(t=c(n?r(n,t):t),f.has(t))throw m(t);f.add(t);let o=this.refs[t];return"string"==typeof o&&(o=this.refs[o]),"object"==typeof o?h(e,o.schema,t):t!==c(i)&&("#"===t[0]?(h(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}"`);s.call(this,`#${e}`)}}"string"==typeof e[a]&&(n=s.call(this,e[a])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),l[t]=n}),p;function h(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`)}}}),fS=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=fu(),r=ff(),o=fp(),a=ff(),i=fh(),n=fy(),s=fg(),l=fn(),c=fl(),u=fb(),d=fs(),p=fc();function f({gen:e,validateName:t,schema:r,schemaEnv:o,opts:a},i){var n;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"; ${h(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}, ${(n=a,(0,l._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${n.dynamicRef?(0,l._)`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`)}`,o.$async,()=>e.code(h(r,a)).code(i))}function h(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 b(e,[],!1,t);let o=(0,r.getSchemaTypes)(e.schema);b(e,o,!(0,r.coerceAndCheckDataType)(e,o),t)}function _({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 b(e,t,r,i){var n,s,u,p;let{gen:f,schema:h,data:m,allErrors:y,opts:g,self:v}=e,{RULES:_}=v;if(h.$ref&&(g.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(h,_)))return void f.block(()=>R(e,"$ref",_.all.$ref.definition));function b(n){(0,o.shouldUseGroup)(h,n)&&(n.type?(f.if((0,a.checkDataType)(n.type,m,g.strictNumbers)),S(e,n),1===t.length&&t[0]===n.type&&r&&(f.else(),(0,a.reportTypeError)(e)),f.endIf()):S(e,n),y||f.if((0,l._)`${c.default.errors} === ${i||0}`))}g.jtd||(n=e,s=t,!n.schemaEnv.meta&&n.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)}}(n,s),n.opts.allowUnionTypes||(u=n,(p=s).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}"`)}}}(n,n.dataTypes))),f.block(()=>{for(let e of _.rules)b(e);b(_.post)})}function S(e,t){let{gen:r,schema:a,opts:{useDefaults:n}}=e;n&&(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;f(e,()=>{r.$comment&&t.$comment&&_(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):f(e,()=>(0,t.topBoolOrEmptySchema)(e))};var E=class{constructor(e,t,r){if((0,n.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",k(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,n.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,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(o,this.it,e),(0,s.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:n}=e;n.$comment&&a.$comment&&_(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 s=i.const("_errs",c.default.errors);v(e,s),i.var(t,(0,l._)`${s} === ${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,n.funcKeywordCode)(a,r):"macro"in r?(0,n.macroKeywordCode)(a,r):(r.compile||r.validate)&&(0,n.funcKeywordCode)(a,r)}e.KeywordCxt=E;let P=/^\/(?:[^~]|~0|~1)*$/,O=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function k(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 n=O.exec(e);if(!n)throw Error(`Invalid JSON-pointer: ${e}`);let l=+n[1];if("#"===(a=n[2])){if(l>=t)throw Error(s("property/index",l));return o[t-l]}if(l>t)throw Error(s("data",l));if(i=r[t-l],!a)return i}let n=i;for(let e of a.split("/"))e&&(i=(0,l._)`${i}${(0,l.getProperty)((0,d.unescapeJsonPointer)(e))}`,n=(0,l._)`${n} && ${i}`);return n;function s(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}e.getData=k}),f$=dm(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}}}),fw=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fb();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))}}}),fE=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=fn(),r=f$(),o=fl(),a=fb(),i=fs(),n=fS();var s=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,s,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:f}=this.opts,h=new t.CodeGen(this.scope,{es5:d,lines:p,ownProperties:f});e.$async&&(i=h.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=h.scopeName("validate");e.validateName=m;let y={gen:h,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:h.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,n.validateFunctionCode)(y),h.optimize(this.opts.code.optimize);let r=h.toString();s=`${h.scopeRefs(o.default.scope)}return ${r}`,this.opts.code.process&&(s=this.opts.code.process(s,e));let a=Function(`${o.default.self}`,`${o.default.scope}`,s)(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:h._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,s&&this.logger.error("Error compiling schema, function code:",s),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 h.call(this,r,e);let n=(0,a.normalizeId)(o),c=this.refs[n]||this.schemas[n];if("string"==typeof c){let t=p.call(this,e,c);if("object"!=typeof(null==t?void 0:t.schema))return;return h.call(this,r,t)}if("object"==typeof(null==c?void 0:c.schema)){if(c.validate||l.call(this,c),n===(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 s({schema:t,schemaId:r,root:e,baseId:i})}return h.call(this,r,c)}}e.SchemaEnv=s,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 n=d.call(this,e,r);if(void 0===n){let a=null==(o=e.localRefs)?void 0:o[r],{schemaId:i}=this.opts;a&&(n=new s({schema:a,schemaId:i,root:e,baseId:t}))}if(void 0!==n)return e.refs[r]=c.call(this,n)},e.getCompilingSchema=u,e.resolveSchema=p;let f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,{baseId:t,schema:r,root:o}){var n;let l;if((null==(n=e.fragment)?void 0:n[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 n="object"==typeof(r=e)&&r[this.opts.schemaId];!f.has(o)&&n&&(t=(0,a.resolveUrl)(this.opts.uriResolver,t,n))}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 s({schema:r,schemaId:c,root:o,baseId:t})).schema!==l.root.schema)return l}}),fR=dm((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}}),fP=dm((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),a=RegExp.prototype.test.bind(/^\d*$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),n=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),s=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),l=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),c=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),u=Array(256);{let e="0123456789ABCDEF";for(let t=0;t<256;t++)u[t]="%"+e[t>>4]+e[15&t]}function d(e){return e<2048?u[192|e>>6]+u[128|63&e]:e<65536?u[224|e>>12]+u[128|e>>6&63]+u[128|63&e]:u[240|e>>18]+u[128|e>>12&63]+u[128|e>>6&63]+u[128|63&e]}let p=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),f=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),h=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),m=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function y(e){let t=-1,r=0,o=-1,a=0;for(let i=0;i<e.length;i++)"0"===e[i]?(-1===o&&(o=i),++a>r&&(r=a,t=o)):(o=-1,a=0);if(r<2)return e.join(":");let i=e.slice(0,t).join(":");return i+"::"+e.slice(t+r).join(":")}function g(e){let t="["===e[0]&&"]"===e[e.length-1];if(("["===e[0]||"]"===e[e.length-1])&&!t)return{host:e,isIPV6:!1,error:!0};let r=t?e.slice(1,-1):e;if(t&&f(r))return r=r.toLowerCase(),{host:`[${r}]`,escapedHost:r,isIPV6:!1,isIPVFuture:!0};if(2>function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(r))return{host:e,isIPV6:!1,error:t};let a="",n=r.indexOf("%");if(-1!==n){let t="%25"===r.slice(n,n+3).toLowerCase()?3:1;if(!function(e){if(0===e.length)return!1;for(let t=0;t<e.length;t++)if(!h(e[t])){if("%"===e[t]&&t+2<e.length&&i(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}(a=r.slice(n+t)))return{host:e,isIPV6:!1,error:!0};r=r.slice(0,n)}let s=function(e){let t=e.indexOf("::");if(-1!==t&&-1!==e.indexOf("::",t+1))return;let r=-1===t?e.split(":"):e.slice(0,t).split(":"),a=-1===t?[]:e.slice(t+2).split(":");-1!==t&&(1===r.length&&""===r[0]&&(r.length=0),1===a.length&&""===a[0]&&(a.length=0));let i=r.concat(a),n=0;for(let e=0;e<i.length;e++){let r=i[e];if(""===r)return;if(-1!==r.indexOf(".")){if(e!==i.length-1||-1!==t&&0===a.length||!o(r))return;n+=2;continue}if(!p(r))return;i[e]=parseInt(r,16).toString(16),n++}if(-1===t){if(8!==n)return;return y(i)}if(n>=8)return;let s=i.slice(0,r.length);for(let e=n;e<8;e++)s.push("0");for(let e=r.length;e<i.length;e++)s.push(i[e]);return y(s)}(r);return void 0===s?{host:e,isIPV6:!1,error:!0}:{host:s+(a?"%"+a:""),escapedHost:s+(a?"%25"+a:""),isIPV6:!0}}let v={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},_=/[@/?#:]/g,b=/[@/?#]/g;function S(e,t){let r=t?b:_;return r.lastIndex=0,e.replace(r,e=>v[e])}function $(e,t=!1){if(-1===e.indexOf("%"))return e;let r="";for(let o=0;o<e.length;o++){if("%"===e[o]&&o+2<e.length){let a=e.slice(o+1,o+3);if(i(a)){let e=a.toUpperCase(),i=String.fromCharCode(parseInt(e,16));t&&n(i)?r+=i:r+="%"+e,o+=2;continue}}r+=e[o]}return r}function w(e,t){let r="";for(let o=0;o<e.length;o++){let a=e[o];if("%"===a&&o+2<e.length){let t=e.slice(o+1,o+3);if(i(t)){r+="%"+t.toUpperCase(),o+=2;continue}}if(t(a))r+=a;else{let t=e.charCodeAt(o);if(t<128)r+=u[t];else if(t<55296||t>57343)r+=d(t);else if(t<=56319&&o+1<e.length){let a=e.charCodeAt(o+1);a>=56320&&a<=57343?(r+=d(65536+(t-55296<<10)+(a-56320)),o++):r+=d(65533)}else r+=d(65533)}}return r}function E(e){return w(e,c)}function R(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||42===e||43===e||45===e||46===e||47===e||64===e||95===e}t.exports={nonSimpleDomain:m,recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(E(e.userinfo)),t.push("@")),void 0!==e.host){let r=e.host;if(!o(r)){let e=g(r);!0!==e.isIPV6&&!0!==e.isIPVFuture&&(e=g(r=$(r,!0))),r=!0===e.isIPV6||!0===e.isIPVFuture?`[${e.escapedHost}]`:S(r,!1)}t.push(r)}if("number"==typeof e.port||"string"==typeof e.port){let r=String(e.port);if(!a(r))throw TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0},reescapeHostDelimiters:S,normalizePercentEncoding:$,normalizePathEncoding:function(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];if("%"===o&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),a=String.fromCharCode(parseInt(e,16));"."!==a&&n(a)?t+=a:t+="%"+e,r+=2;continue}}if(s(o))t+=o;else{let a=e.charCodeAt(r);if(a<128)t+=R(a)?o:u[a];else if(a<55296||a>57343)t+=d(a);else if(a<=56319&&r+1<e.length){let o=e.charCodeAt(r+1);o>=56320&&o<=57343?(t+=d(65536+(a-55296<<10)+(o-56320)),r++):t+=d(65533)}else t+=d(65533)}}return t},serializePathEncoding:function(e,t=!1){let r="",o=t&&"/"!==e[0];for(let t=0;t<e.length;t++){let a=e[t];if("%"===a&&t+2<e.length){let o=e.slice(t+1,t+3);if(i(o)){r+="%"+o.toUpperCase(),t+=2;continue}}if("/"===a&&(o=!1),s(a)&&(":"!==a||!o))r+=a;else{let o=e.charCodeAt(t);if(o<128)r+=u[o];else if(o<55296||o>57343)r+=d(o);else if(o<=56319&&t+1<e.length){let a=e.charCodeAt(t+1);a>=56320&&a<=57343?(r+=d(65536+(o-55296<<10)+(a-56320)),t++):r+=d(65533)}else r+=d(65533)}}return r},normalizeQueryFragmentEncoding:function(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];if("%"===o&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),a=String.fromCharCode(parseInt(e,16));n(a)?t+=a:t+="%"+e,r+=2;continue}}if(l(o))t+=o;else{let a=e.charCodeAt(r);if(a<128)t+=R(a)?o:u[a];else if(a<55296||a>57343)t+=d(a);else if(a<=56319&&r+1<e.length){let o=e.charCodeAt(r+1);o>=56320&&o<=57343?(t+=d(65536+(a-55296<<10)+(o-56320)),r++):t+=d(65533)}else t+=d(65533)}}return t},encodeUserinfo:E,encodeQuery:function(e){return w(e,l)},encodeFragment:function(e){return w(e,l)},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(i(o)){t+="%"+o.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t},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:g,stringArrayToHexStripped:function(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}}}),fO=dm((e,t)=>{let{isUUID:r}=fP(),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 n(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function s(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:n,serialize:s},c={scheme:"https",domainHost:l.domainHost,parse:n,serialize:s},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=e.resourceName.indexOf("?"),r=-1===t?e.resourceName:e.resourceName.slice(0,t);e.path=r&&"/"!==r?r:void 0,e.query=-1===t?void 0:e.resourceName.slice(t+1),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&&r[0]===e.path){let o=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let a=f(`${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=f(`${r}:${t.nid||o}`);a&&(e=a.serialize(e,t));let i=e,n=e.nss;return i.path=`${o||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&&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 f(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:f}}),fk=dm((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:a,normalizePercentEncoding:i,normalizePathEncoding:n,serializePathEncoding:s,normalizeQueryFragmentEncoding:l,encodeQuery:c,encodeFragment:u,reescapeHostDelimiters:d,isIPv4:p,nonSimpleDomain:f}=fP(),{SCHEMES:h,getSchemeHandler:m}=fO(),y=/^[A-Za-z][A-Za-z0-9+.-]*$/u,g="URI scheme is malformed.";function v(e){let t=unescape(String(e));if(!y.test(t))throw TypeError(g);return t}function _(e,t,r,a){let i={};return a||(e=k(b(e,r),r),t=k(b(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 b(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),l=[];r.scheme&&(r.scheme=v(r.scheme));let d=m(n.scheme||r.scheme);d&&d.serialize&&d.serialize(r,n);let p=void 0!==r.userinfo||void 0!==r.host||void 0!==r.port,f=!n.skipEscape&&void 0===r.scheme&&!p;void 0!==r.path&&(n.skipEscape?r.path=i(r.path):r.path=s(r.path,f)),"suffix"!==n.reference&&r.scheme&&(r.scheme=v(r.scheme),l.push(r.scheme,":"));let h=a(r);if(void 0!==h&&("suffix"!==n.reference&&l.push("//"),l.push(h),r.path&&"/"!==r.path[0]&&l.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||d&&d.absolutePath||(e=o(e)),f&&(e=s(e,!0)),void 0===h&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),l.push(e)}return void 0!==r.query&&l.push("?",c(r.query)),void 0!==r.fragment&&l.push("#",u(r.fragment)),l.join("")}let S=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,$=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,w=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function E(e){if(void 0===e)return!1;let t=e.indexOf("%");for(;-1!==t;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function R(e){return"["===e[0]&&"]"===e[e.length-1]}function P(e,t,r,o){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!R(e.host)&&(t.domainHost||r&&r.domainHost)&&!1===o&&f(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(t){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+t,!0}return!1}function O(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},s=!1,c=!1,u=!1,f=!1,v=!1,_=!1,b=!1;"suffix"===o.reference&&(e=o.scheme?o.scheme+":"+e:"//"+e);let O=e.match($);null!==O&&-1!==O[1].indexOf("\\")&&(a.error="URI authority must not contain a literal backslash.",s=!0);let k=e.match(w);if(null!==k){let e=k[1],t=e.replace(/[\t\n\r]/g,"");t.length>=2&&("//"!==t.slice(0,2)?(a.error=a.error||"URI authority must not contain a literal backslash.",s=!0):e.length!==t.length&&(a.error=a.error||"URI authority introducer must not contain whitespace.",s=!0))}let x=e.match(S);if(x){var T,C;let t;if(a.scheme=x[1],a.userinfo=x[3],a.host=x[4],a.port=parseInt(x[5],10),a.path=x[6]||"",a.query=x[7],a.fragment=x[8],void 0!==a.scheme){let e=unescape(a.scheme);y.test(e)?a.scheme=e.toLowerCase():(a.error=a.error||g,_=!0)}t=(T=x)[4],(c=E(T[3])||void 0!==t&&!R(t)&&E(t)||E(T[6])||E(T[7])||E(T[8]))&&(a.error=a.error||"URI contains malformed percent-encoding."),isNaN(a.port)&&(a.port=x[5]);let S=(C=a,void 0!==x[2]&&C.path&&"/"!==C.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof C.port&&(C.port<0||C.port>65535)?"URI port is malformed.":void 0);if(void 0!==S&&(a.error=a.error||S,s=!0),a.host)if(!1===p(a.host)){let e=R(a.host),t=-1!==a.host.indexOf("[")||-1!==a.host.indexOf("]"),o=r(a.host);b=o.isIPV6||!0===o.isIPVFuture,v=t&&(!e||!0===o.error),a.host=b?o.host:o.host.toLowerCase(),v&&(a.error=a.error||"URI host is malformed.",s=!0)}else b=!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 $=m(o.scheme||a.scheme);if(v||(f=P(a,o,$,b)),-1!==e.indexOf("%")&&void 0!==a.host&&!v){let e=b?a.host:i(a.host,!0);b||(e=i(e.toLowerCase())),a.host=d(e,b)}(!$||$&&!$.skipNormalize)&&(a.path&&(a.path=n(a.path)),a.query&&(a.query=l(a.query)),a.fragment&&(a.fragment=l(a.fragment))),$&&$.parse&&($.parse(a,o),$===h.urn&&void 0===a.nid&&(u=!0))}else a.error=a.error||"URI can not be parsed.";return{parsed:a,malformedAuthorityOrPort:s,malformedPercentEncoding:c,malformedSchemeSpecific:u,malformedHost:f,malformedScheme:_}}function k(e,t){return O(e,t).parsed}function x(e,t){let{parsed:r,malformedAuthorityOrPort:o,malformedPercentEncoding:a,malformedSchemeSpecific:i,malformedHost:n,malformedScheme:s}=O(e,t);return{normalized:o||a||i||n||s?e:b(r,t),malformedAuthorityOrPort:o,malformedPercentEncoding:a,malformedSchemeSpecific:i,malformedHost:n,malformedScheme:s}}function T(e,t){let r;if("string"!=typeof e&&"object"!=typeof e)return;try{r="string"==typeof e?e:b(e,t)}catch{return}let{normalized:o,malformedAuthorityOrPort:a,malformedPercentEncoding:i,malformedSchemeSpecific:n,malformedHost:s,malformedScheme:l}=x(r,t);return a||i||n||s||l?void 0:o}let C={SCHEMES:h,normalize:function(e,t){var r,o;return"string"==typeof e?e=x(r=e,o=t).normalized:"object"==typeof e&&(e=k(b(e,t),t)),e},resolve:function(e,t,o){let a=o?Object.assign({scheme:"null"},o):{scheme:"null"},{parsed:i,malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:l,malformedHost:c,malformedScheme:u}=O(e,a),{parsed:d,malformedAuthorityOrPort:f,malformedPercentEncoding:h,malformedSchemeSpecific:y,malformedHost:g,malformedScheme:v}=O(t,a);if(n||f||s||h||l||y||c||g||u||v)throw Error(i.error||d.error||"URI is malformed.");let S=_(i,d,a,!0),$=m(o&&o.scheme||S.scheme),w=S.host;P(S,o||{},$,void 0!==w&&""!==w&&(p(w)||r(w).isIPV6));let E=w&&-1!==w.indexOf("%")&&!/\P{ASCII}/u.test(w);if(S.error&&!E)throw Error(S.error);return a.skipEscape=!0,b(S,a)},resolveComponent:_,equal:function(e,t,r){let o=T(e,r),a=T(t,r);return void 0!==o&&void 0!==a&&o===a},serialize:b,parse:k};t.exports=C,t.exports.default=C,t.exports.fastUri=C}),fx=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fk();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),fT=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=fS();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=fn();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=f$(),a=fw(),i=fd(),n=fE(),s=fn(),l=fb(),c=ff(),u=fs(),d=fR(),p=fx(),f=(e,t)=>new RegExp(e,t);f.code="new RegExp";let h=["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={}){var t,r,o,a,n,l,c,u,d,h,v,b,P,O,k,x,T,C,j,I,N,A,M,q,z,L;let D,U,V,F,H;this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...(D=(t=e).strict,V=!0===(U=null==(r=t.code)?void 0:r.optimize)||void 0===U?1:U||0,F=null!=(a=null==(o=t.code)?void 0:o.regExp)?a:f,H=null!=(n=t.uriResolver)?n:p.default,{strictSchema:null==(c=null!=(l=t.strictSchema)?l:D)||c,strictNumbers:null==(d=null!=(u=t.strictNumbers)?u:D)||d,strictTypes:null!=(v=null!=(h=t.strictTypes)?h:D)?v:"log",strictTuples:null!=(P=null!=(b=t.strictTuples)?b:D)?P:"log",strictRequired:null!=(k=null!=(O=t.strictRequired)?O:D)&&k,code:t.code?{...t.code,optimize:V,regExp:F}:{optimize:V,regExp:F},loopRequired:null!=(x=t.loopRequired)?x:200,loopEnum:null!=(T=t.loopEnum)?T:200,meta:null==(C=t.meta)||C,messages:null==(j=t.messages)||j,inlineRefs:null==(I=t.inlineRefs)||I,schemaId:null!=(N=t.schemaId)?N:"$id",addUsedSchema:null==(A=t.addUsedSchema)||A,validateSchema:null==(M=t.validateSchema)||M,validateFormats:null==(q=t.validateFormats)||q,unicodeRegExp:null==(z=t.unicodeRegExp)||z,int32range:null==(L=t.int32range)||L,uriResolver:H})};let{es5:K,lines:G}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:K,lines:G}),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);let B=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),_.call(this,y,e,"NOT SUPPORTED"),_.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=B}_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||n.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await o.call(this,{$ref:e},!0)}async function n(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await l.call(this,t.missingSchema),n.call(this,e)}}function s({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=b.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,o=new n.SchemaEnv({schema:{},schemaId:r});if(!(t=n.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=b.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(O.call(this,r,t),!t)return(0,u.eachItem)(r,e=>k.call(this,e)),this;T.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=>k.call(this,e,o):e=>o.type.forEach(t=>k.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]=j(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:s}=this.opts;if("object"==typeof e)i=e[s];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 n.SchemaEnv({schema:e,schemaId:s,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):n.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{n.compileSchema.call(this,e)}finally{this.opts=t}}};function _(e,t,r,o="error"){for(let a in e)a in t&&this.logger[o](`${r}: option ${a}. ${e[a]}`)}function b(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 h)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 O(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 k(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,n=a?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 s={keyword:e,definition:{...t,type:(0,c.getJSONTypes)(t.type),schemaType:(0,c.getJSONTypes)(t.schemaType)}};t.before?x.call(this,n,s,t.before):n.rules.push(s),i.all[e]=s,null==(o=t.implements)||o.forEach(e=>this.addKeyword(e))}function x(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 T(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=j(t)),e.validateSchema=this.compile(t,!0))}let C={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function j(e){return{anyOf:[e,C]}}}),fC=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}}),fj=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=fw(),r=fm(),o=fn(),a=fl(),i=fE(),n=fs();function s(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,s){let{gen:l,it:c}=e,{allErrors:u,schemaEnv:d,opts:p}=c,f=p.passContext?a.default.this:o.nil;function h(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=n.mergeEvaluated.props(l,r.props,c.props));else{let t=l.var("props",(0,o._)`${e}.evaluated.props`);c.props=n.mergeEvaluated.props(l,t,c.props,o.Name)}if(!0!==c.items)if(r&&!r.dynamicItems)void 0!==r.items&&(c.items=n.mergeEvaluated.items(l,r.items,c.items));else{let t=l.var("items",(0,o._)`${e}.evaluated.items`);c.items=n.mergeEvaluated.items(l,t,c.items,o.Name)}}s?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,f)}`),m(t),u||l.assign(a,!0)},e=>{l.if((0,o._)`!(${e} instanceof ${c.ValidationError})`,()=>l.throw(e)),h(e),u||l.assign(a,!1)}),e.ok(a)}():e.result((0,r.callValidateCode)(e,t,f),()=>m(t),()=>h(t))}e.getValidate=s,e.callRef=l,e.default={keyword:"$ref",schemaType:"string",code(e){var r,a;let n,c,u,{gen:d,schema:p,it:f}=e,{baseId:h,schemaEnv:m,validateName:y,opts:g,self:v}=f,{root:_}=m;if(("#"===p||"#/"===p)&&h===_.baseId){if(m===_)return l(e,y,m,m.$async);let t=d.scopeValue("root",{ref:_});return l(e,(0,o._)`${t}.validate`,_,_.$async)}let b=i.resolveRef.call(v,_,h,p);if(void 0===b)throw new t.default(f.opts.uriResolver,h,p);return b instanceof i.SchemaEnv?void l(e,s(e,r=b),r,r.$async):(a=b,n=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:n,errSchemaPath:p},c),void(e.mergeEvaluated(u),e.ok(c)))}}}),fI=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fC(),r=fj();e.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default]}),fN=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn(),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})`)}}}),fA=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn();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,n=i.opts.multipleOfPrecision,s=r.let("res"),l=n?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${n}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${a} === 0 || (${s} = ${o}/${a}, ${l}))`)}}}),fM=dm(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'}),fq=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn(),r=fs(),o=fM();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:n,it:s}=e,l="maxLength"===a?t.operators.GT:t.operators.LT,c=!1===s.opts.unicode?(0,t._)`${i}.length`:(0,t._)`${(0,r.useFunc)(e.gen,o.default)}(${i})`;e.fail$data((0,t._)`${c} ${l} ${n}`)}}}),fz=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fm(),r=fs(),o=fn();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:n,schema:s,schemaCode:l,it:c}=e,u=c.opts.unicodeRegExp?"u":"";if(n){let{regExp:t}=c.opts.code,n="new RegExp"===t.code?(0,o._)`new RegExp`:(0,r.useFunc)(a,t),s=a.let("valid");a.try(()=>a.assign(s,(0,o._)`${n}(${l}, ${u}).test(${i})`),()=>a.assign(s,!1)),e.fail$data((0,o._)`!${s}`)}else{let r=(0,t.usePattern)(e,s);e.fail$data((0,o._)`!${r}.test(${i})`)}}}}),fL=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn();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}`)}}}),fD=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fm(),r=fn(),o=fs();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:n,data:s,$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,n,()=>{a.assign(c,(0,t.propertyInData)(a,s,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",n,r=>{e.setParams({missingProperty:r}),a.if((0,t.noPropertyInData)(a,s,r,u.ownProperties),()=>e.error())})}}}}),fU=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn();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}`)}}}),fV=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fv();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),fF=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ff(),r=fn(),o=fs(),a=fV();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:n,$data:s,schema:l,parentSchema:c,schemaCode:u,it:d}=e;if(!s&&!l)return;let p=i.let("valid"),f=c.items?(0,t.getSchemaTypes)(c.items):[];e.block$data(p,function(){let s=i.let("i",(0,r._)`${n}.length`),l=i.let("j");e.setParams({i:s,j:l}),i.assign(p,!0),i.if((0,r._)`${s} > 1`,()=>(f.length>0&&!f.some(e=>"object"===e||"array"===e)?function(o,a){let s=i.name("item"),l=(0,t.checkDataTypes)(f,s,d.opts.strictNumbers,t.DataType.Wrong),c=i.const("indices",(0,r._)`{}`);i.for((0,r._)`;${o}--;`,()=>{i.let(s,(0,r._)`${n}[${o}]`),i.if(l,(0,r._)`continue`),f.length>1&&i.if((0,r._)`typeof ${s} == "string"`,(0,r._)`${s} += "_"`),i.if((0,r._)`typeof ${c}[${s}] == "number"`,()=>{i.assign(a,(0,r._)`${c}[${s}]`),e.error(),i.assign(p,!1).break()}).code((0,r._)`${c}[${s}] = ${o}`)})}:function(t,s){let l=(0,o.useFunc)(i,a.default),c=i.name("outer");i.label(c).for((0,r._)`;${t}--;`,()=>i.for((0,r._)`${s} = ${t}; ${s}--;`,()=>i.if((0,r._)`${l}(${n}[${t}], ${n}[${s}])`,()=>{e.error(),i.assign(p,!1).break(c)})))})(s,l))},(0,r._)`${u} === false`),e.ok(p)}}}),fH=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn(),r=fs(),o=fV();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:n,schemaCode:s,schema:l}=e;n||l&&"object"==typeof l?e.fail$data((0,t._)`!${(0,r.useFunc)(a,o.default)}(${i}, ${s})`):e.fail((0,t._)`${l} !== ${i}`)}}}),fK=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn(),r=fs(),o=fV();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:n,data:s,$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,f=()=>null!=a?a:a=(0,r.useFunc)(n,o.default);if(p||l)i=n.let("valid"),e.block$data(i,function(){n.assign(i,!1),n.forOf("v",u,e=>n.if((0,t._)`${f()}(${s}, ${e})`,()=>n.assign(i,!0).break()))});else{if(!Array.isArray(c))throw Error("ajv implementation error");let e=n.const("vSchema",u);i=(0,t.or)(...c.map((r,o)=>{var a,i;let n;return a=e,"object"==typeof(n=c[i=o])&&null!==n?(0,t._)`${f()}(${s}, ${a}[${i}])`:(0,t._)`${s} === ${n}`}))}e.pass(i)}}}),fG=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fN(),r=fA(),o=fq(),a=fz(),i=fL(),n=fD(),s=fU(),l=fF(),c=fH(),u=fK();e.default=[t.default,r.default,o.default,a.default,i.default,n.default,s.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default]}),fB=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=fn(),r=fs();function o(e,o){let{gen:a,schema:i,data:n,keyword:s,it:l}=e;l.items=!0;let c=a.const("len",(0,t._)`${n}.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 n;return n=i,void a.forRange("i",o.length,c,o=>{e.subschema({keyword:s,dataProp:o,dataPropType:r.Type.Num},n),l.allErrors||a.if((0,t.not)(n),()=>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')}}}),fJ=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=fn(),r=fs(),o=fm();function a(e,o,i=e.schema){let{gen:n,parentSchema:s,data:l,keyword:c,it:u}=e;(function(e){let{opts:t,errSchemaPath:a}=u,n=i.length,s=n===e.minItems&&(n===e.maxItems||!1===e[o]);if(t.strictTuples&&!s){let e=`"${c}" is ${n}-tuple, but minItems or maxItems/${o} are not specified or different at path "${a}"`;(0,r.checkStrictMode)(u,e,t.strictTuples)}})(s),u.opts.unevaluated&&i.length&&!0!==u.items&&(u.items=r.mergeEvaluated.items(n,i.length,u.items));let d=n.name("valid"),p=n.const("len",(0,t._)`${l}.length`);i.forEach((o,a)=>{(0,r.alwaysValidSchema)(u,o)||(n.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))}}}),fZ=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fJ();e.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,t.validateTuple)(e,"items")}}),fW=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn(),r=fs(),o=fm(),a=fB();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:n}=e,{prefixItems:s}=i;n.items=!0,(0,r.alwaysValidSchema)(n,t)||(s?(0,a.validateAdditionalItems)(e,s):e.ok((0,o.validateArray)(e)))}}}),fX=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn(),r=fs();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:n,parentSchema:s,data:l,it:c}=e,{minContains:u,maxContains:d}=s;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,n)){let r=(0,t._)`${p} >= ${o}`;void 0!==a&&(r=(0,t._)`${r} && ${p} <= ${a}`),e.pass(r);return}c.items=!0;let f=i.name("valid");function h(){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(f,!0).break()):(i.if((0,t._)`${e} > ${a}`,()=>i.assign(f,!1).break()),1===o?i.assign(f,!0):i.if((0,t._)`${e} >= ${o}`,()=>i.assign(f,!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(f,()=>i.if(f,()=>i.break())):0===o?(i.let(f,!0),void 0!==a&&i.if((0,t._)`${l}.length > 0`,h)):(i.let(f,!1),h()),e.result(f,()=>e.reset())}}}),fY=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=fn(),r=fs(),o=fm();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},
|
|
70
70
|
missingProperty: ${a},
|
|
71
71
|
depsCount: ${r},
|
|
72
|
-
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),n(e,r)}};function i(e,r=e.schema){let{gen:a,data:n,it:s}=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,n,i,s.opts.ownProperties);e.setParams({property:i,depsCount:c.length,deps:c.join(", ")}),s.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 n(e,t=e.schema){let{gen:a,data:i,keyword:s,it:l}=e,c=a.name("valid");for(let n in t)(0,r.alwaysValidSchema)(l,t[n])||(a.if((0,o.propertyInData)(a,i,n,l.opts.ownProperties),()=>{let t=e.subschema({keyword:s,schemaProp:n},c);e.mergeValidEvaluated(t,c)},()=>a.var(c,!0)),e.ok(c))}e.validatePropertyDeps=i,e.validateSchemaDeps=n,e.default=a}),fK=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8(),r=p7();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:n}=e;if((0,r.alwaysValidSchema)(n,a))return;let s=o.name("valid");o.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},s),o.if((0,t.not)(s),()=>{e.error(!0),n.allErrors||o.break()})}),e.ok(s)}}}),fG=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fs(),r=p8(),o=fe(),a=p7();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:n,parentSchema:s,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,n))return;let f=(0,t.allSchemaProperties)(s.properties),h=(0,t.allSchemaProperties)(s.patternProperties);function m(e){i.code((0,r._)`delete ${l}[${e}]`)}function y(t){if("all"===p.removeAdditional||p.removeAdditional&&!1===n)return void m(t);if(!1===n){e.setParams({additionalProperty:t}),e.error(),d||i.break();return}if("object"==typeof n&&!(0,a.alwaysValidSchema)(u,n)){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=>{f.length||h.length?i.if(function(o){let n;if(f.length>8){let e=(0,a.schemaRefOrVal)(u,s.properties,"properties");n=(0,t.isOwnProperty)(i,e,o)}else n=f.length?(0,r.or)(...f.map(e=>(0,r._)`${o} === ${e}`)):r.nil;return h.length&&(n=(0,r.or)(n,...h.map(a=>(0,r._)`${(0,t.usePattern)(e,a)}.test(${o})`))),(0,r.not)(n)}(o),()=>y(o)):y(o)}),e.ok((0,r._)`${c} === ${o.default.errors}`)}}}),fB=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ff(),r=fs(),o=p7(),a=fG();e.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:i,schema:n,parentSchema:s,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===s.additionalProperties&&a.default.code(new t.KeywordCxt(c,a.default,"additionalProperties"));let u=(0,r.allSchemaProperties)(n);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,n[e]));if(0===d.length)return;let p=i.name("valid");for(let t of d){var f;(f=t,c.opts.useDefaults&&!c.compositeRule&&void 0!==n[f].default)?h(t):(i.if((0,r.propertyInData)(i,l,t,c.opts.ownProperties)),h(t),c.allErrors||i.else().var(p,!0),i.endIf()),e.it.definedProperties.add(t),e.ok(p)}function h(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}}}),fJ=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fs(),r=p8(),o=p7(),a=p7();e.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:i,schema:n,data:s,parentSchema:l,it:c}=e,{opts:u}=c,d=(0,t.allSchemaProperties)(n),p=d.filter(e=>(0,o.alwaysValidSchema)(c,n[e]));if(0===d.length||p.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;let f=u.strictSchema&&!u.allowMatchingProperties&&l.properties,h=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)f&&function(e){for(let t in f)new RegExp(e).test(t)&&(0,o.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),c.allErrors?y(e):(i.var(h,!0),y(e),i.if(h));function y(o){i.forIn("key",s,n=>{i.if((0,r._)`${(0,t.usePattern)(e,o)}.test(${n})`,()=>{let t=p.includes(o);t||e.subschema({keyword:"patternProperties",schemaProp:o,dataProp:n,dataPropType:a.Type.Str},h),c.opts.unevaluated&&!0!==m?i.assign((0,r._)`${m}[${n}]`,!0):t||c.allErrors||i.if((0,r.not)(h),()=>i.break())})})}}}}),fZ=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p7();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"}}}),fW=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fs().validateUnion,error:{message:"must match a schema in anyOf"}}}),fX=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8(),r=p7();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:n}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let s=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)(n,a)?o.var(c,!0):u=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},c),i>0&&o.if((0,t._)`${c} && ${s}`).assign(s,!1).assign(l,(0,t._)`[${l}, ${i}]`).else(),o.if(c,()=>{o.assign(s,!0),o.assign(l,i),u&&e.mergeEvaluated(u,t.Name)})})}),e.result(s,()=>e.reset(),()=>e.error(!0))}}}),fY=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p7();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 n=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(n)})}}}),fQ=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8(),r=p7();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:n,it:s}=e;void 0===n.then&&void 0===n.else&&(0,r.checkStrictMode)(s,'"if" without "then" and "else" is ignored');let l=o(s,"then"),c=o(s,"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))}}}),f0=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p7();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`)}}}),f1=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fL(),r=fU(),o=fD(),a=fV(),i=fF(),n=fH(),s=fK(),l=fG(),c=fB(),u=fJ(),d=fZ(),p=fW(),f=fX(),h=fY(),m=fQ(),y=f0();e.default=function(e=!1){let g=[d.default,p.default,f.default,h.default,m.default,y.default,s.default,l.default,n.default,c.default,u.default];return e?g.push(r.default,a.default):g.push(t.default,o.default),g.push(i.default),g}}),f2=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8();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,n,s,l,{gen:c,data:u,$data:d,schema:p,schemaCode:f,it:h}=e,{opts:m,errSchemaPath:y,schemaEnv:g,self:v}=h;m.validateFormats&&(d?(o=c.scopeValue("formats",{ref:v.formats,code:m.code.formats}),a=c.const("fDef",(0,t._)`${o}[${f}]`),i=c.let("fType"),n=c.let("format"),c.if((0,t._)`typeof ${a} == "object" && !(${a} instanceof RegExp)`,()=>c.assign(i,(0,t._)`${a}.type || "string"`).assign(n,(0,t._)`${a}.validate`),()=>c.assign(i,(0,t._)`"string"`).assign(n,a)),e.fail$data((0,t.or)(!1===m.strictSchema?t.nil:(0,t._)`${f} && !${n}`,(s=g.$async?(0,t._)`(${a}.async ? await ${n}(${u}) : ${n}(${u}))`:(0,t._)`${n}(${u})`,l=(0,t._)`(typeof ${n} == "function" ? ${s} : ${n}.test(${u}))`,(0,t._)`${n} && ${n} !== true && ${i} === ${r} && !${l}`)))):function(){var o;let a,i,n=v.formats[p];if(!n){if(!1===m.strictSchema)return v.logger.warn(s());throw Error(s());function s(){return`unknown format "${p}" ignored in schema at path "${y}"`}}if(!0===n)return;let[l,d,f]=(a=(o=n)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 n&&!(n instanceof RegExp)&&n.async){if(!g.$async)throw Error("async format in sync schema");return(0,t._)`await ${f}(${u})`}return"function"==typeof d?(0,t._)`${f}(${u})`:(0,t._)`${f}.test(${u})`}())}())}}}),f9=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[f2().default]}),f3=ds(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"]}),f5=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fR(),r=fz(),o=f1(),a=f9(),i=f3();e.default=[t.default,r.default,(0,o.default)(),a.default,i.metadataVocabulary,i.contentVocabulary]}),f4=ds(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(r=t||(e.DiscrError=t={})).Tag="tag",r.Mapping="mapping"}),f6=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8(),r=f4(),o=fy(),a=fm(),i=p7();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:n,data:s,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 f=n.let("valid",!1),h=n.const("tag",(0,t._)`${s}${(0,t.getProperty)(p)}`);n.if((0,t._)`typeof ${h} == "string"`,()=>(function(){let s=function(){var e;let t={},r=s(c),n=!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 f=null==(e=null==c?void 0:c.properties)?void 0:e[p];if("object"!=typeof f)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);n=n&&(r||s(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"`)}(f,t)}if(!n)throw Error(`discriminator: "${p}" must be required`);return t;function s({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 n.if(!1),s)n.elseIf((0,t._)`${h} === ${r}`),n.assign(f,function(r){let o=n.name("valid"),a=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(a,t.Name),o}(s[r]));n.else(),e.error(!1,{discrError:r.DiscrError.Mapping,tag:h,tagName:p}),n.endIf()})(),()=>e.error(!1,{discrError:r.DiscrError.Tag,tag:h,tagName:p})),e.ok(f)}}}),f8=ds((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}}),f7=ds((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=f$(),o=f5(),a=f6(),i=f8(),n=["/properties"],s="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,n):i;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv=l,t.exports=e=l,t.exports.Ajv=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var c=ff();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=p8();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=fh();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=fm();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),he=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=p8(),r=fe(),o=fy(),a=fE();function i(e,i){let{gen:n,it:s}=e;s.schemaEnv.root.dynamicAnchors[i]=!0;let l=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(i)}`,c="#"===s.errSchemaPath?s.validateName:function(e){let{schemaEnv:t,schema:r,self:i}=e.it,{root:n,baseId:s,localRefs:l,meta:c}=t.root,{schemaId:u}=i.opts,d=new o.SchemaEnv({schema:r,schemaId:u,root:n,baseId:s,localRefs:l,meta:c});return o.compileSchema.call(i,d),(0,a.getValidate)(e,d)}(e);n.if((0,t._)`!${l}`,()=>n.assign(l,c))}e.dynamicAnchor=i,e.default={keyword:"$dynamicAnchor",schemaType:"string",code:e=>i(e,e.schema)}}),ht=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=p8(),r=fe(),o=fE();function a(e,a){let{gen:i,keyword:n,it:s}=e;if("#"!==a[0])throw Error(`"${n}" only supports hash fragment reference`);let l=a.slice(1);if(s.allErrors)c();else{let t=i.let("valid",!1);c(t),e.ok(t)}function c(e){if(s.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(s.validateName,e))}else u(s.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)}}),hr=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=he(),r=p7();e.default={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,t.dynamicAnchor)(e,""):(0,r.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}}}),ho=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ht();e.default={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,t.dynamicRef)(e,e.schema)}}),ha=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=he(),r=ht(),o=hr(),a=ho();e.default=[t.default,r.default,o.default,a.default]}),hi=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fH();e.default={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}}),hn=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fH();e.default={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,t.validateSchemaDeps)(e)}}),hs=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p7();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`)}}}),hl=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hi(),r=hn(),o=hs();e.default=[t.default,r.default,o.default]}),hc=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8(),r=p7(),o=fe();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:n,errsCount:s,it:l}=e;if(!s)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",n,e=>{var r,o;return a.if((r=u,o=e,(0,t._)`!${r} || !${r}[${o}]`),()=>d(e))})):!0!==u&&a.forIn("key",n,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._)`${s} === ${o.default.errors}`)}}}),hu=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p8(),r=p7();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:n}=e,s=n.items||0;if(!0===s)return;let l=o.const("len",(0,t._)`${i}.length`);if(!1===a)e.setParams({len:s}),e.fail((0,t._)`${l} > ${s}`);else if("object"==typeof a&&!(0,r.alwaysValidSchema)(n,a)){let a=o.var("valid",(0,t._)`${l} <= ${s}`);o.if((0,t.not)(a),()=>{var i,c;return i=a,c=s,void o.forRange("i",c,l,a=>{e.subschema({keyword:"unevaluatedItems",dataProp:a,dataPropType:r.Type.Num},i),n.allErrors||o.if((0,t.not)(i),()=>o.break())})}),e.ok(a)}n.items=!0}}}),hd=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hc(),r=hu();e.default=[t.default,r.default]}),hp=ds((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"}]}}}}}),hf=ds((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:"#"}}}}}),hh=ds((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:"#"}}}}),hm=ds((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:{}}}}}),hy=ds((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"}}}}),hg=ds((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}}}}),hv=ds((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:[]}}}}),h_=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hp(),r=hf(),o=hh(),a=hm(),i=hy(),n=hg(),s=hv(),l=["/properties"];e.default=function(e){return[t,r,o,a,c(this,i),n,c(this,s)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function c(t,r){return e?t.$dataMetaSchema(r,l):r}}}),hb=ds((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=f$(),o=f5(),a=ha(),i=hl(),n=hd(),s=f6(),l=h_(),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(n.default),this.opts.discriminator&&this.addKeyword(s.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=ff();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var p=p8();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 f=fh();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=fm();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})}),hS=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fR(),r=fz(),o=f1(),a=ha(),i=hl(),n=hd(),s=f9(),l=f3();e.default=[a.default,t.default,r.default,(0,o.default)(!0),s.default,l.metadataVocabulary,l.contentVocabulary,i.default,n.default]}),h$=ds((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}}}}),hw=ds((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"}}}}}),hE=ds((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"}}}}),hR=ds((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"}}}}),hP=ds((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"}}}}),hk=ds((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"}}}}),hO=ds((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}}}}),hx=ds((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:[]}}}}),hT=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=h$(),r=hw(),o=hE(),a=hR(),i=hP(),n=hk(),s=hO(),l=hx(),c=["/properties"];e.default=function(e){return[t,r,o,a,i,u(this,n),s,u(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,r){return e?t.$dataMetaSchema(r,c):r}}}),hj=ds((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=f$(),o=hS(),a=f6(),i=hT(),n="https://json-schema.org/draft/2020-12/schema";var s=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"]=n)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var l=ff();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=p8();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=fh();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=fm();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),hC=ds(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(s(!0),l),"date-time":t(d(!0),p),"iso-time":t(s(),c),"iso-date-time":t(d(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return h.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(b.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:_},double:{type:"number",validate:_},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,f),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],n=+a[2],s=+a[3];return n>=1&&n<=12&&s>=1&&s<=(2===n&&(t=i)%4==0&&(t%100!=0||t%400==0)?29:o[n])}function i(e,t){if(e&&t)return e>t?1:e<t?-1:0}let n=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function s(e){return function(t){let r=n.exec(t);if(!r)return!1;let o=+r[1],a=+r[2],i=+r[3],s=r[4],l="-"===r[5]?-1:1,c=+(r[6]||0),u=+(r[7]||0);if(c>23||u>59||e&&!s)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=n.exec(e),o=n.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=s(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 f(e,t){if(!(e&&t))return;let[r,o]=e.split(u),[a,n]=t.split(u),s=i(r,a);if(void 0!==s)return s||l(o,n)}let h=/\/|:/,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=0x7fffffff;function _(){return!0}let b=/[^\\]\\Z/}),hI=ds(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=f7(),r=p8(),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:n,data:s,schemaCode:l,keyword:c,it:u}=e,{opts:d,self:p}=u;if(!d.validateFormats)return;let f=new t.KeywordCxt(u,p.RULES.all.format.definition,"format");function h(e){return(0,r._)`${e}.compare(${s}, ${l}) ${a[c].fail} 0`}f.$data?(o=n.scopeValue("formats",{ref:p.formats,code:d.code.formats}),i=n.const("fmt",(0,r._)`${o}[${f.schemaCode}]`),e.fail$data((0,r.or)((0,r._)`typeof ${i} != "object"`,(0,r._)`${i} instanceof RegExp`,(0,r._)`typeof ${i}.compare != "function"`,h(i)))):function(){let t=f.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=n.scopeValue("formats",{key:t,ref:o,code:d.code.formats?(0,r._)`${d.code.formats}${(0,r.getProperty)(t)}`:void 0});e.fail$data(h(a))}()},dependencies:["format"]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}),hN=ds((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=hC(),o=hI(),a=p8(),i=new a.Name("fullFormats"),n=new a.Name("fastFormats"),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return l(e,t,r.fullFormats,i),e;let[a,s]="fast"===t.mode?[r.fastFormats,n]:[r.fullFormats,i];return l(e,t.formats||r.formatNames,a,s),t.keywords&&(0,o.default)(e),e};function l(e,t,r,o){var i;for(let n of(null!=(i=e.opts.code).formats||(i.formats=(0,a._)`require("ajv-formats/dist/formats").${o}`),t))e.addFormat(n,r[n])}s.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=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s}),hA=f7(),hM=hb(),hq=hj();let hz=(dl(hN(),1)).default;function hL(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return hz(t),t}var hD=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=void 0!==e,this._ajv=e}get ajv(){return this._ajv??=hL(hq.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(dc.has(r))return"2020-12";if(du.has(r))return"2019-09";if(dd.has(r)||dp.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??=hL(hM.Ajv2019):this._ajvDraft7??=hL(hA.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)}}};hA.Ajv,d=globalThis.crypto?.webcrypto??globalThis.crypto??Promise.resolve().then(i.t.bind(i,7598,19)).then(e=>e.webcrypto);var hU=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return dm(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 dm(this,e)}constructor(e){super(e),this.name=new.target.name,dh(this,new.target)}},hV=class extends hU{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}},hF=class extends hU{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}},hH=class extends hU{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 / *.localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},hK=class extends hU{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`),this.recordedIssuer=e,this.currentIssuer=t}},hG=class extends hU{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 hB(e,t,r){if(e)return"string"!=typeof 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."),void 0===e.issuer?e:{...e,issuer:void 0}):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}var hZ=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return dm(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 dm(this,e)}constructor(e){super(e??"Unauthorized"),this.name="UnauthorizedError",dh(this,new.target)}};function hW(e){return e?.authorization_response_iss_parameter_supported===!0}function hX({iss:e,expectedIssuer:t,issParameterSupported:r}){if(void 0!==t){if(void 0===e){if(r)throw new hV("authorization_response",t,void 0);return}if(e!==t)throw new hV("authorization_response",t,e)}}function hY(...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}let hQ="code",h0="S256";function h1(e){return"localhost"===e||e.endsWith(".localhost")||"127.0.0.1"===e||"[::1]"===e||"::1"===e}async function h2(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let e=lL.parse(JSON.parse(r));return dg.fromResponse(e)}catch(o){let e=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${o}. Raw body: ${r}`;return new dg(dy.ServerError,e)}}function h9(e,t,r){let o=void 0===e.invalidateCredentials?`retrying authorization without discarding the stored ${r} (provider implements no invalidateCredentials())`:`invalidating the stored ${r} and retrying authorization`;console.warn(`[mcp-sdk] OAuth ${JSON.stringify(t.code)} — ${o}. Cause: ${JSON.stringify(t.message)}`)}async function h3(e,t){try{return await h5(e,t)}catch(r){if(r instanceof dg){if(r.code===dy.InvalidClient||r.code===dy.UnauthorizedClient)return h9(e,r,"client credentials and tokens"),await e.invalidateCredentials?.("client"),await e.invalidateCredentials?.("tokens"),await h5(e,t);else if(r.code===dy.InvalidGrant||r.code===dy.InvalidDpopProof)return h9(e,r,"tokens"),await e.invalidateCredentials?.("tokens"),await h5(e,t)}throw r}}async function h5(e,{serverUrl:t,authorizationCode:r,iss:o,scope:a,resourceMetadataUrl:i,fetchFn:n,skipIssuerMetadataValidation:s,forceReauthorization:l}){let c,u,p,f,h,m={...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||h1(e.hostname))return"native"}return"web"}(h.redirect_uris)},y=await e.discoveryState?.(),g=i;if(!g&&y?.resourceMetadataUrl&&(g=new URL(y.resourceMetadataUrl)),y?.authorizationServerUrl){if(u=y.authorizationServerUrl,c=y.resourceMetadata,p=y.authorizationServerMetadata??await mr(u,{fetchFn:n,skipIssuerValidation:s}),!c)try{c=await h7(t,{resourceMetadataUrl:g},n)}catch(e){if(e instanceof TypeError)throw e}(p!==y.authorizationServerMetadata||c!==y.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(u),resourceMetadataUrl:g?.toString(),resourceMetadata:c,authorizationServerMetadata:p})}else{let e=await mo(t,{resourceMetadataUrl:g,fetchFn:n,skipIssuerMetadataValidation:s});u=e.authorizationServerUrl,p=e.authorizationServerMetadata,c=e.resourceMetadata,f={authorizationServerUrl:String(u),resourceMetadataUrl:g?.toString(),resourceMetadata:c,authorizationServerMetadata:p}}let v=p?.issuer??String(u),_={issuer:v};if(await e.saveAuthorizationServerUrl?.(v),void 0!==r){let t=y?.authorizationServerMetadata?.issuer??y?.authorizationServerUrl;if(void 0===t){if(void 0!==e.saveDiscoveryState)throw new hK("discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier",v);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,v))throw new hK(t,v)}f&&await e.saveDiscoveryState?.(f);let b=await async function(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)}}(t,e,c),S=b&&c&&!e.validateResourceURL?c.resource:b;S&&await e.saveResourceUrl?.(ma(S));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:p,clientMetadata:e.clientMetadata}),w=await Promise.resolve(e.clientInformation(_)),E=hB(w,v,{canPersistStamp:void 0!==e.saveClientInformation});if(void 0===E&&w?.issuer&&void 0===e.saveClientInformation)throw new hK(w.issuer,v);if(E&&void 0===E.issuer&&(E={...E,issuer:v},await e.saveClientInformation?.(E,_)),!E){if(void 0!==r)throw Error("Existing OAuth client information is required when exchanging an authorization code");let t=p?.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 dg(dy.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${o}`);if(t&&o)E={client_id:o,issuer:v},await e.saveClientInformation?.(E,_);else{if(!e.saveClientInformation)throw Error("OAuth client information must be saveable for dynamic registration");E={...await async function(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 n={...r,...void 0===o?{}:{scope:o}},s=await p5(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!s.ok)throw new hF({status:s.status,body:await s.text(),submittedMetadata:n});return lF.parse(dS(await s.json()))}(u,{metadata:p,clientMetadata:m,scope:$,fetchFn:n}),issuer:v},await e.saveClientInformation(E,_)}}let R=!e.redirectUrl;if(void 0!==r||R){void 0!==r&&hX({iss:o,expectedIssuer:p?.issuer,issParameterSupported:hW(p)});let t=await async function(e,t,{metadata:r,resource:o,authorizationCode:a,iss:i,scope:n,fetchFn:s}={}){let l;void 0!==a&&hX({iss:i,expectedIssuer:r?.issuer,issParameterSupported:hW(r)});let c=r?.issuer??String(t),u=async()=>{let t=await e.clientInformation({issuer:c}),r=hB(t,c,{canPersistStamp:!1});if(t&&void 0===r)throw new hK(String(t.issuer),c);return r},d=await u(),p=n??e.clientMetadata.scope;if(e.prepareTokenRequest&&(l=await e.prepareTokenRequest(p)),!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)})}return mi(t,{metadata:r,tokenRequestParams:l,clientInformation:d??=await u(),addClientAuthentication:e.addClientAuthentication,resource:o,dpop:await e.dpop?.(),fetchFn:s})}(e,u,{metadata:p,resource:S,authorizationCode:r,iss:o,scope:$,fetchFn:n});return await e.saveTokens({...t,issuer:v},_),"AUTHORIZED"}let P=hB(await e.tokens(_),v);if(P&&void 0===P.issuer&&(P={...P,issuer:v},await e.saveTokens(P,_)),P?.refresh_token&&!l){let t,r=await e.scopeForRefresh?.(P);try{t=await async function(e,{metadata:t,clientInformation:r,refreshToken:o,scope:a,resource:i,addClientAuthentication:n,dpop:s,fetchFn:l}){let c=new URLSearchParams({grant_type:"refresh_token",refresh_token:o});a&&c.set("scope",a);let u=await mi(e,{metadata:t,tokenRequestParams:c,clientInformation:r,addClientAuthentication:n,resource:i,dpop:s,fetchFn:l});return{refresh_token:o,...u,...a&&!u.scope&&{scope:a}}}(u,{metadata:p,clientInformation:E,refreshToken:P.refresh_token,scope:r,resource:S,addClientAuthentication:e.addClientAuthentication,dpop:await e.dpop?.(),fetchFn:n})}catch(e){if(e instanceof hH||e instanceof dg&&e.code!==dy.ServerError)throw e;console.warn(`[mcp-sdk] Could not refresh OAuth tokens; falling back to a new authorization request. Cause: ${JSON.stringify(e instanceof Error?e.message:String(e))}`)}if(t)return await e.saveTokens({...t,issuer:v},_),"AUTHORIZED"}let k=e.state?await e.state():void 0,{authorizationUrl:O,codeVerifier:x}=await async function(e,{metadata:t,clientInformation:r,redirectUrl:o,scope:a,state:i,resource:n}){let s;if(t){if(s=new URL(t.authorization_endpoint),!t.response_types_supported.includes(hQ))throw Error(`Incompatible auth server: does not support response type ${hQ}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(h0))throw Error(`Incompatible auth server: does not support code challenge method ${h0}`)}else s=new URL("/authorize",e);let l=await async function(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await async function(e){return await async function(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=256-256%t.length,o="";for(;o.length<e;)for(let a of(await async function(e){return(await d).getRandomValues(new Uint8Array(e))}(e-o.length)))a<r&&(o+=t[a%t.length]);return o}(e)}(e),r=await async function(e){return btoa(String.fromCharCode(...new Uint8Array(await (await d).subtle.digest("SHA-256",new TextEncoder().encode(e))))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}(t);return{code_verifier:t,code_challenge:r}}(),c=l.code_verifier,u=l.code_challenge;return s.searchParams.set("response_type",hQ),s.searchParams.set("client_id",r.client_id),s.searchParams.set("code_challenge",u),s.searchParams.set("code_challenge_method",h0),s.searchParams.set("redirect_uri",String(o)),i&&s.searchParams.set("state",i),a&&s.searchParams.set("scope",a),a?.split(" ").includes("offline_access")&&s.searchParams.append("prompt","consent"),n&&s.searchParams.set("resource",ma(n)),{authorizationUrl:s,codeVerifier:c}}(u,{metadata:p,clientInformation:E,state:k,redirectUrl:e.redirectUrl,scope:$,resource:S});return await e.saveCodeVerifier(x),await e.redirectToAuthorization(O),"REDIRECT"}let h4=new Set(["bearer","dpop"]);function h6(e){let t,r=e.headers.get("WWW-Authenticate");if(!r)return{};let[o,a]=r.split(" ");if(!o||!h4.has(o.toLowerCase())||!a)return{};let i=h8(e,"resource_metadata")||void 0;if(i)try{t=new URL(i)}catch{}let n=h8(e,"scope")||void 0;return{resourceMetadataUrl:t,scope:n,error:h8(e,"error")||void 0,errorDescription:h8(e,"error_description")||void 0}}function h8(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 h7(e,t,r=fetch){let o=await async function(e,t,r,o){var a,i;let n,s=new URL(e),l=o?.protocolVersion??iW;o?.metadataUrl?n=new URL(o.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,s.pathname),o?.metadataServerUrl??s)).search=s.search;let c=await mt(n,l,r);return o?.metadataUrl||(a=c,i=s.pathname,a&&("/"===i||(a.ok||!(a.status<500))&&502!==a.status))||(c=await mt(new URL(`/.well-known/${t}`,s),l,r)),c}(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 lI.parse(await o.json())}async function me(e,t,r=fetch){let o=p5(r);try{return await o(e,{headers:t})}catch(e){throw e}}async function mt(e,t,r=fetch){return await me(e,{"MCP-Protocol-Version":t},r)}async function mr(e,{fetchFn:t=fetch,protocolVersion:r=iW,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 n=await me(r,a,t);if(!n)continue;if(!n.ok){if(await n.text?.().catch(()=>{}),n.status<500||502===n.status)continue;throw Error(`HTTP ${n.status} trying to load ${"oauth"===i?"OAuth":"OpenID provider"} metadata from ${r}`)}let s="oauth"===i?lN.parse(await n.json()):lM.parse(await n.json());if(!o){let t="string"==typeof e?e:e.href;if(!(s.issuer===t||t.endsWith("/")&&s.issuer===t.slice(0,-1)))throw new hV("metadata",t,s.issuer)}return s}}async function mo(e,t){let r,o;try{(r=await h7(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 mr(o,{fetchFn:t?.fetchFn,skipIssuerValidation:t?.skipIssuerMetadataValidation});return{authorizationServerUrl:o,authorizationServerMetadata:a,resourceMetadata:r}}function ma(e){return"string"==typeof e?e:e.href}async function mi(e,{metadata:t,tokenRequestParams:r,clientInformation:o,addClientAuthentication:a,resource:i,dpop:n,fetchFn:s}){var l,c;let u,d=function(e){let t=new URL(String(e));if("https:"!==t.protocol&&!h1(t.hostname))throw new hH(t.href);return t}(t?.token_endpoint??new URL("/token",e)),p=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});i&&r.set("resource",ma(i)),!a&&o&&function(e,t,r,o){let{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":var n,s,l,c,u=a,d=i,p=r;if(!d)throw Error("client_secret_basic authentication requires a client_secret");let f=btoa(`${u}:${d}`);p.set("Authorization",`Basic ${f}`);return;case"client_secret_post":n=a,s=i,(l=o).set("client_id",n),s&&l.set("client_secret",s);return;case"none":c=a,o.set("client_id",c);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}((l=o,c=t?.token_endpoint_auth_methods_supported??[],u=void 0!==l.client_secret,"token_endpoint_auth_method"in l&&l.token_endpoint_auth_method&&["client_secret_basic","client_secret_post","none"].includes(l.token_endpoint_auth_method)&&(0===c.length||c.includes(l.token_endpoint_auth_method))?l.token_endpoint_auth_method:0===c.length?u?"client_secret_basic":"none":u&&c.includes("client_secret_basic")?"client_secret_basic":u&&c.includes("client_secret_post")?"client_secret_post":c.includes("none")?"none":u?"client_secret_post":"none"),o,p,r);let f=async()=>{let e=new Headers(p);return a&&await a(e,r,d,t),n&&e.set("DPoP",await n.buildProof({htm:"POST",htu:d})),p5(s??fetch)(d,{method:"POST",headers:e,body:r})},h=await f();if(n&&400===h.status&&(await h.clone().json().catch(()=>{}))?.error===dy.UseDpopNonce&&(n.observeNonce(h,d),h=await f()),n?.observeNonce(h,d),!h.ok)throw await h2(h);let m=await h.json();try{return lq.parse(dS(m))}catch(e){if("object"==typeof m&&null!==m&&"error"in m)throw await h2(JSON.stringify(m));throw e}}let mn=new Set(["tools/list","prompts/list","resources/list","resources/templates/list","server/discover"]);var ms=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(ml(e))}set(e,t){let r=ml(e),o=mn.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(!mn.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(ml(e))&&!mn.has(e.method)&&this._cappedSize--}evict(e){let t=`${e}\0`,r=mn.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 ml(e){return`${e.method}\0${JSON.stringify([e.partition??"",e.params??""])}`}function mc(e,t){return void 0===t?e:`${e}\0${t}`}var mu=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 n=await this._store.get({...r,partition:i});return n?.scope==="public"?n: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=mc(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=mc(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(mc(e,o?.params))??0)!==r)return;let a=o?.params??"",i=this._partitionFor("private"),n=this._partitionFor("public"),s=(o?.scope??"private")==="public"?n:i;try{await this._store.set({method:e,params:a,partition:s},{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(n!==i)try{await this._store.delete({method:e,params:a,partition:s===i?n: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 md=Symbol.for("mcp.authSeamEscape");function mp(e){if("object"==typeof e&&null!==e||"function"==typeof e)try{Object.defineProperty(e,md,{value:!0,configurable:!0})}catch{}return e}let mf=new Set([-32001,-32020,-32021]);function mh(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 d0({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=dR(e),n=t.clientModernVersions.find(e=>i.includes(e));return void 0!==n?{kind:"corrective",version:n,error:r}:i.length>0?{kind:"error",error:r}:t.fallbackAvailable?{kind:"legacy"}:{kind:"error",error:r}}return mf.has(r),{kind:"legacy"}}function mm(e,t){var r;return"browser"===t.environment&&((r=e)instanceof TypeError||r instanceof Error&&"TypeError"===r.name)?{kind:"legacy"}:{kind:"error",error:new d_(dv.EraNegotiationFailed,`Version negotiation probe failed: ${my(e)}`,{cause:e},{cause:e})}}function my(e){return e instanceof Error?e.message:String(e)}function mg(){let e=globalThis;return void 0!==e.window&&void 0!==e.document?"browser":"node"}function mv(e){return"stderr"in e&&"pid"in e?"stdio":"http"}var m_=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&&(ph(e)||pm(e))&&e.id===t.id){r._pending=void 0,ph(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(n),this._pending?.id===r&&(this._pending=void 0),o(e))},n=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,mb.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 mb=new WeakMap;function mS(e){let t=mb.get(e);mb.delete(e),t?.()}async function m$(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,n="auto"===e.kind&&e.fallbackAvailable,s=await m_.open(t.transport);try{r=await (async()=>{let r=i[0],l=!1,c=a;for(;;){let a=await s.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:ps(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[md]||t instanceof hZ||t instanceof Error&&"UnauthorizedError"===t.name)return{kind:"auth-required",error:t};if(t instanceof db){let e=t.data?.text;return{kind:"http-error",status:t.data.status,body:"string"==typeof e?e:void 0,statusText:t.data.statusText}}if(t instanceof d_&&t.code===dv.ClientHttpUnexpectedContent||t instanceof Error&&"SyntaxError"===t.name)return{kind:"unusable-reply",error:t};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=ps(pn).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 d0({supported:[...o],requested:t.requestedVersion})}}(e.result,t);case"rpc-error":return mh(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 db(t?dv.ClientHttpForbidden:dv.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 db(dv.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?mh(r,t):{kind:"legacy"}}(e,t);case"network-error":return mm(e.error,t);case"unusable-reply":return{kind:"error",error:new d_(dv.EraNegotiationFailed,`Version negotiation probe failed: the server answered with an unusable reply (${my(e.error)})`,{cause:e.error},{cause:e.error})};case"auth-required":return{kind:"error",error:e.error};case"closed":if("stdio"===t.transportKind)return{kind:"legacy"};return mm(Error("Connection closed during the version negotiation probe"),t);case"timeout":if("stdio"===t.transportKind)return{kind:"legacy"};return{kind:"error",error:new d_(dv.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}(u,{clientModernVersions:i,requestedVersion:r,fallbackAvailable:n,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 d_(dv.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 d_(dv.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 d_(dv.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}}})()}catch(e){throw s.detach(),e}return s.release(),r}function mw(){return new d_(dv.EraNegotiationFailed,"Version negotiation failed: the transport was closed during the server/discover probe")}function mE(e){let t=e._meta?.[i0];return pF.Implementation(t)?t:void 0}let mR={"notifications/tools/list_changed":["tools/list"],"notifications/prompts/list_changed":["prompts/list"],"notifications/resources/list_changed":["resources/list","resources/templates/list"]},mP={};var mk=class extends pZ{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;static{mP.enforceStrictCapabilities=e=>e._enforceStrictCapabilities,mP.walkPages=(e,t,r,o)=>e._walkPages(t,r,o),mP.readResource=(e,t,r)=>e._readResource(t,r)}_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 d_(dv.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){var r;super(t),this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new hD,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=(r=t?.inputRequired,{autoFulfill:r?.autoFulfill??!0,maxRounds:r?.maxRounds??10}),this._cache=new mu(t?.responseCacheStore??new ms,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>=d$&&nu.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:n,flowStartedAt:s}=o,l={inputRequests:r.inputRequests,...void 0!==r.requestState&&{requestState:r.requestState}};return async function(e){let{config:t,method:r,originalParams:o,requestOptions:a,hooks:i,signal:n}=e,s=e.flowStartedAt??Date.now(),l=e.firstPayload,c=0;for(;;){let e;if((c+=1)>t.maxRounds){var u;throw new d_(dv.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)}}(n);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){return new Promise((t,r)=>{if(e?.aborted)return void r(e.reason instanceof d_?e.reason:new d_(dv.RequestTimeout,String(e.reason)));let o=setTimeout(()=>{e?.removeEventListener("abort",a),t()},250),a=()=>{clearTimeout(o),r(e?.reason instanceof d_?e.reason:new d_(dv.RequestTimeout,String(e?.reason)))};e?.addEventListener("abort",a,{once:!0})})}(n);let p={...void 0!==a.timeout&&{timeout:a.timeout}};if(void 0!==a.maxTotalTimeout){let e=Date.now()-s,t=a.maxTotalTimeout-e;if(t<=0)throw new d_(dv.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:a.maxTotalTimeout,totalElapsed:e});p.maxTotalTimeout=t}let f=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(py(f)){l={inputRequests:f.inputRequests??{},...void 0!==f.requestState&&{requestState:f.requestState}};continue}return f}}({config:t,method:i.method,originalParams:i.params,firstPayload:l,flowStartedAt:s,signal:n?.signal,requestOptions:{...n?.timeout!==void 0&&{timeout:n.timeout},...n?.maxTotalTimeout!==void 0&&{maxTotalTimeout:n.maxTotalTimeout},...n?.onprogress!==void 0&&{onprogress:n.onprogress}},hooks:{dispatchInputRequest:(t,r,o)=>(async function(e,t,r,o,a){var i;if(!pX(o)||"string"!=typeof o.method)throw new d_(dv.InvalidResult,`Invalid input request '${r}': each inputRequests entry must be an embedded request object with a method`,{key:r});let n=o.method;if(!t.hasInputRequestMethod(n))throw new d_(dv.InvalidResult,`Invalid input request '${r}': '${n}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:r,method:n});let s=e.getRequestHandler(n);if(void 0===s)throw new d_(dv.CapabilityNotSupported,`Cannot fulfil input request '${r}': no handler is registered for '${n}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:r,method:n});let l=pX(o.params)?o.params:void 0;return await s({jsonrpc:"2.0",id:r,method:n,...void 0!==l&&{params:l}},e.buildContext({sessionId:e.sessionId,mcpReq:{id:r,method:n,_meta:l?._meta,requestState:(i=void 0,()=>i),signal:a,send:()=>pY("send"),notify:()=>pY("notify")}}))})(e,a,t,r,o),retry:(e,t)=>o.retry(e,{...n?.signal!==void 0&&{signal:n.signal},...n?.onprogress!==void 0&&{onprogress:n.onprogress},...n?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:n.resetTimeoutOnProgress},...n?.headers!==void 0&&{headers:n.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 d_(dv.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]=pW(a)&&pW(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=ps(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 dX("not-in-era"===a.reason?dW.InternalError:dW.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:n,supportsUrlMode:s}=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&&!n)throw new dX(dW.InvalidParams,"Client does not support form-mode elicitation requests");if("url"===i.mode&&!s)throw new dX(dW.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 dX("not-in-era"===c.reason?dW.InternalError:dW.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=ps(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 dX("not-in-era"===a.reason?dW.InternalError:dW.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,n=await t(e,r),s=!!(i.tools||i.toolChoice),l=o.samplingResultVariant(s,n);if(l.ok||"not-in-era"!==l.reason||(l=o.validateInputResponse("sampling/createMessage",n)),!l.ok)throw new dX("not-in-era"===l.reason?dW.InternalError:dW.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 d_(dv.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&&nN.safeParse(e.discover).success))return e;throw new d_(dv.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>=d$))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?dR(t):[];return{kind:"auto",modernVersions:a.length>0?a:[...dw],fallbackAvailable:!t||dE(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=dE(this._supportedProtocolVersions);try{let o=r[0];if(void 0===o)throw new d_(dv.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=mv(e),i={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:mg(),defaultTimeoutMs:r?.timeout??6e4},n="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===n?await m$(t,{...i,transport:e,transportKind:a}):await async function(e,t,r,o){let a,i,n=new t.constructor({...r,stderr:"ignore"}),s=t.close,l=!1,c=new Promise((e,t)=>{a=()=>t(mw())});t.close=async function(){return l=!0,a?.(),s.call(t)};try{let t=m$(e,{...o,transport:n,transportKind:"stdio",disposableProbe:!0});t.catch(()=>{}),i=await Promise.race([t,c])}finally{await async function(e){try{let t=e._dispose;await ("function"==typeof t?t.call(e):e.close())}catch{}}(n),t.close=s}if(l)throw mw();return i}(t,e,n,i)}catch(t){throw await e.close().catch(()=>{}),mS(e),t}if(mS(e),await super.connect(e),"legacy"===o.era)return void await this._legacyHandshake(e,r);if(this._serverCapabilities=o.discover.capabilities,this._serverVersion=mE(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&&dR(a).length>0?dR(a):dw).find(e=>o.supportedVersions.includes(e));if(void 0===i)throw new d_(dv.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=mE(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>=d$?"modern":"legacy"}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new d_(dv.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new d_(dv.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 d_(dv.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if("resources/subscribe"===e&&!this._serverCapabilities.resources.subscribe)throw new d_(dv.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new d_(dv.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new d_(dv.CapabilityNotSupported,`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if("notifications/roots/list_changed"===e&&!this._capabilities.roots?.listChanged)throw new d_(dv.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 d_(dv.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new d_(dv.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new d_(dv.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"},nN,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=>e.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=>e.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=>e.resourceTemplates)}async _listAllPages(e,t,r,o,a){let i=r?.cacheMode==="bypass",n=this._cache.captureGeneration(e),s=o=>{let a=void 0===o?t&&{...t}:{...t,cursor:o};return this.request({method:e,...a&&{params:a}},r)},l=await this._walkPages(e,s,o);return delete l.nextCursor,a?.(l),i||await this._cache.write(e,l,n,this._freshness(l)),l}async _walkPages(e,t,r){let o=await t(void 0),a=o.nextCursor,i=o,n=1;for(;void 0!==a;){if(0!==this._listMaxPages&&n>=this._listMaxPages)throw new d_(dv.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});let s=await t(a);if(s.nextCursor===a&&JSON.stringify(r(s))===JSON.stringify(r(i)))break;r(o).push(...r(s)),i=s,a=s.nextCursor,n++}return o}_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 d_?e:new d_(dv.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:pb(r.inputSchema)}async readResource(e,t){let{result:r}=await this._readResource(e,t);return r}async _readResource(e,t){let r=await this._serveFromCache("resources/read",e.uri,t);if(void 0!==r)return{result:r,cached:!0};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{result:a,cached:!1}}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,n;if(void 0===this.transport)throw new d_(dv.NotConnected,"Not connected");let s=this._negotiatedProtocolVersion;if(void 0===s||!(s>=d$))throw new d_(dv.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${s??"none"}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:"subscriptions/listen",protocolVersion:s});if(t?.signal?.aborted){let e=t.signal.reason;throw e instanceof d_?e:new d_(dv.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=>{n=e}),f=e=>{if("closed"===u)return;let s="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(),n(e.cause),s&&i(e.error??new d_(dv.ConnectionClosed,"subscriptions/listen closed before the server acknowledged"))},h=async()=>{l.abort(),await this.notification({method:"notifications/cancelled",params:{requestId:c}}).catch(()=>{})};this._listenState.set(c,{settle:f});let m=t?.timeout??6e4;if(r=setTimeout(()=>{f({cause:"remote",error:new d_(dv.RequestTimeout,"subscriptions/listen ack timed out",{timeout:m})}),h().catch(()=>{})},m),t?.signal){let e=t.signal;o=()=>{if("closed"===u)return;let t=e.reason;f({cause:"local",error:t instanceof Error?t:Error(String(t??"Aborted"))}),h().catch(()=>{})},e.addEventListener("abort",o,{once:!0})}let y={jsonrpc:"2.0",id:c,method:"subscriptions/listen",params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}},g=e=>{f({cause:"remote",error:e instanceof Error?e:Error(String(e))})};try{this.transport.send(y,{requestSignal:l.signal,onRequestStreamEnd:()=>f({cause:"remote",error:Error("subscriptions/listen: stream ended")})}).catch(g)}catch(e){g(e)}return{honoredFilter:await d,close:async()=>{"closed"!==u&&(f({cause:"local"}),await h())},closed:p}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let r=Object.hasOwn(mR,e.method)?mR[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?.[i2],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?pm(e)?r.settle({cause:"remote",error:dX.fromError(e.error.code,e.error.message,e.error.data)}):r.settle({cause:"graceful",error:new d_(dv.ConnectionClosed,"subscriptions/listen: server closed the subscription gracefully before acknowledging")}):super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new d_(dv.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"!==mg(),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}`]=pR(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),n=()=>{if(void 0===i||i.ok)return;let t=i.compileError,r=(t instanceof Error?t.message:String(t)).slice(0,200);throw new dX(dW.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${r}`)};n();try{r=await this.request({method:"tools/call",params:e},await a())}catch(c){let s=c instanceof dX&&-32020===c.code;if(!o||!s||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)),n(),r=await this.request({method:"tools/call",params:e},await a())}let s=void 0!==i&&i.ok?i.validator:void 0;if(s){if(void 0===r.structuredContent&&!r.isError)throw new dX(dW.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(void 0!==r.structuredContent&&!r.isError)try{let e=s(r.structuredContent);if(!e.valid)throw new dX(dW.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){if(e instanceof dX)throw e;throw new dX(dW.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=>e.tools,e=>this._excludeInvalidXMcpHeaderTools(e))}_excludeInvalidXMcpHeaderTools(e){if("modern"!==this.getProtocolEra()||!this.transport||"stdio"===mv(this.transport))return;let t=e.tools.filter(e=>{let t=pb(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=aR(sj,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:n}=a.data,{onChanged:s}=r,l=async()=>{if(!i)return void s(null,null);try{s(null,await o())}catch(e){s(e instanceof Error?e:Error(String(e)),null)}},c=()=>{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,c)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};class mO 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 mx(e){}function mT(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 mj(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 mC 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=mx,onError:r=mx,onRetry:o=mx,onComment:a,maxBufferSize:i}=e,n=[],s=0,l=!0,c,u="",d=0,p,f=!1;function h(){void 0!==i&&(s+u.length<=i||(f=!0,n.length=0,s=0,c=void 0,u="",d=0,p=void 0,r(new mO(`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(`
|
|
72
|
+
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),n(e,r)}};function i(e,r=e.schema){let{gen:a,data:n,it:s}=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,n,i,s.opts.ownProperties);e.setParams({property:i,depsCount:c.length,deps:c.join(", ")}),s.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 n(e,t=e.schema){let{gen:a,data:i,keyword:s,it:l}=e,c=a.name("valid");for(let n in t)(0,r.alwaysValidSchema)(l,t[n])||(a.if((0,o.propertyInData)(a,i,n,l.opts.ownProperties),()=>{let t=e.subschema({keyword:s,schemaProp:n},c);e.mergeValidEvaluated(t,c)},()=>a.var(c,!0)),e.ok(c))}e.validatePropertyDeps=i,e.validateSchemaDeps=n,e.default=a}),fQ=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn(),r=fs();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:n}=e;if((0,r.alwaysValidSchema)(n,a))return;let s=o.name("valid");o.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},s),o.if((0,t.not)(s),()=>{e.error(!0),n.allErrors||o.break()})}),e.ok(s)}}}),f0=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fm(),r=fn(),o=fl(),a=fs();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:n,parentSchema:s,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,n))return;let f=(0,t.allSchemaProperties)(s.properties),h=(0,t.allSchemaProperties)(s.patternProperties);function m(e){i.code((0,r._)`delete ${l}[${e}]`)}function y(t){if("all"===p.removeAdditional||p.removeAdditional&&!1===n)return void m(t);if(!1===n){e.setParams({additionalProperty:t}),e.error(),d||i.break();return}if("object"==typeof n&&!(0,a.alwaysValidSchema)(u,n)){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=>{f.length||h.length?i.if(function(o){let n;if(f.length>8){let e=(0,a.schemaRefOrVal)(u,s.properties,"properties");n=(0,t.isOwnProperty)(i,e,o)}else n=f.length?(0,r.or)(...f.map(e=>(0,r._)`${o} === ${e}`)):r.nil;return h.length&&(n=(0,r.or)(n,...h.map(a=>(0,r._)`${(0,t.usePattern)(e,a)}.test(${o})`))),(0,r.not)(n)}(o),()=>y(o)):y(o)}),e.ok((0,r._)`${c} === ${o.default.errors}`)}}}),f1=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fS(),r=fm(),o=fs(),a=f0();e.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:i,schema:n,parentSchema:s,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===s.additionalProperties&&a.default.code(new t.KeywordCxt(c,a.default,"additionalProperties"));let u=(0,r.allSchemaProperties)(n);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,n[e]));if(0===d.length)return;let p=i.name("valid");for(let t of d){var f;(f=t,c.opts.useDefaults&&!c.compositeRule&&void 0!==n[f].default)?h(t):(i.if((0,r.propertyInData)(i,l,t,c.opts.ownProperties)),h(t),c.allErrors||i.else().var(p,!0),i.endIf()),e.it.definedProperties.add(t),e.ok(p)}function h(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}}}),f2=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fm(),r=fn(),o=fs(),a=fs();e.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:i,schema:n,data:s,parentSchema:l,it:c}=e,{opts:u}=c,d=(0,t.allSchemaProperties)(n),p=d.filter(e=>(0,o.alwaysValidSchema)(c,n[e]));if(0===d.length||p.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;let f=u.strictSchema&&!u.allowMatchingProperties&&l.properties,h=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)f&&function(e){for(let t in f)new RegExp(e).test(t)&&(0,o.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),c.allErrors?y(e):(i.var(h,!0),y(e),i.if(h));function y(o){i.forIn("key",s,n=>{i.if((0,r._)`${(0,t.usePattern)(e,o)}.test(${n})`,()=>{let t=p.includes(o);t||e.subschema({keyword:"patternProperties",schemaProp:o,dataProp:n,dataPropType:a.Type.Str},h),c.opts.unevaluated&&!0!==m?i.assign((0,r._)`${m}[${n}]`,!0):t||c.allErrors||i.if((0,r.not)(h),()=>i.break())})})}}}}),f9=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fs();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"}}}),f3=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fm().validateUnion,error:{message:"must match a schema in anyOf"}}}),f5=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn(),r=fs();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:n}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let s=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)(n,a)?o.var(c,!0):u=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},c),i>0&&o.if((0,t._)`${c} && ${s}`).assign(s,!1).assign(l,(0,t._)`[${l}, ${i}]`).else(),o.if(c,()=>{o.assign(s,!0),o.assign(l,i),u&&e.mergeEvaluated(u,t.Name)})})}),e.result(s,()=>e.reset(),()=>e.error(!0))}}}),f4=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fs();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 n=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(n)})}}}),f6=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn(),r=fs();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:n,it:s}=e;void 0===n.then&&void 0===n.else&&(0,r.checkStrictMode)(s,'"if" without "then" and "else" is ignored');let l=o(s,"then"),c=o(s,"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))}}}),f8=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fs();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`)}}}),f7=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fB(),r=fZ(),o=fJ(),a=fW(),i=fX(),n=fY(),s=fQ(),l=f0(),c=f1(),u=f2(),d=f9(),p=f3(),f=f5(),h=f4(),m=f6(),y=f8();e.default=function(e=!1){let g=[d.default,p.default,f.default,h.default,m.default,y.default,s.default,l.default,n.default,c.default,u.default];return e?g.push(r.default,a.default):g.push(t.default,o.default),g.push(i.default),g}}),he=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn();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,n,s,l,{gen:c,data:u,$data:d,schema:p,schemaCode:f,it:h}=e,{opts:m,errSchemaPath:y,schemaEnv:g,self:v}=h;m.validateFormats&&(d?(o=c.scopeValue("formats",{ref:v.formats,code:m.code.formats}),a=c.const("fDef",(0,t._)`${o}[${f}]`),i=c.let("fType"),n=c.let("format"),c.if((0,t._)`typeof ${a} == "object" && !(${a} instanceof RegExp)`,()=>c.assign(i,(0,t._)`${a}.type || "string"`).assign(n,(0,t._)`${a}.validate`),()=>c.assign(i,(0,t._)`"string"`).assign(n,a)),e.fail$data((0,t.or)(!1===m.strictSchema?t.nil:(0,t._)`${f} && !${n}`,(s=g.$async?(0,t._)`(${a}.async ? await ${n}(${u}) : ${n}(${u}))`:(0,t._)`${n}(${u})`,l=(0,t._)`(typeof ${n} == "function" ? ${s} : ${n}.test(${u}))`,(0,t._)`${n} && ${n} !== true && ${i} === ${r} && !${l}`)))):function(){var o;let a,i,n=v.formats[p];if(!n){if(!1===m.strictSchema)return v.logger.warn(s());throw Error(s());function s(){return`unknown format "${p}" ignored in schema at path "${y}"`}}if(!0===n)return;let[l,d,f]=(a=(o=n)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 n&&!(n instanceof RegExp)&&n.async){if(!g.$async)throw Error("async format in sync schema");return(0,t._)`await ${f}(${u})`}return"function"==typeof d?(0,t._)`${f}(${u})`:(0,t._)`${f}.test(${u})`}())}())}}}),ht=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[he().default]}),hr=dm(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"]}),ho=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fI(),r=fG(),o=f7(),a=ht(),i=hr();e.default=[t.default,r.default,(0,o.default)(),a.default,i.metadataVocabulary,i.contentVocabulary]}),ha=dm(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(r=t||(e.DiscrError=t={})).Tag="tag",r.Mapping="mapping"}),hi=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn(),r=ha(),o=fE(),a=fw(),i=fs();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:n,data:s,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 f=n.let("valid",!1),h=n.const("tag",(0,t._)`${s}${(0,t.getProperty)(p)}`);n.if((0,t._)`typeof ${h} == "string"`,()=>(function(){let s=function(){var e;let t={},r=s(c),n=!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 f=null==(e=null==c?void 0:c.properties)?void 0:e[p];if("object"!=typeof f)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);n=n&&(r||s(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"`)}(f,t)}if(!n)throw Error(`discriminator: "${p}" must be required`);return t;function s({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 n.if(!1),s)n.elseIf((0,t._)`${h} === ${r}`),n.assign(f,function(r){let o=n.name("valid"),a=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(a,t.Name),o}(s[r]));n.else(),e.error(!1,{discrError:r.DiscrError.Mapping,tag:h,tagName:p}),n.endIf()})(),()=>e.error(!1,{discrError:r.DiscrError.Tag,tag:h,tagName:p})),e.ok(f)}}}),hn=dm((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}}),hs=dm((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=fT(),o=ho(),a=hi(),i=hn(),n=["/properties"],s="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,n):i;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv=l,t.exports=e=l,t.exports.Ajv=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var c=fS();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=fn();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=f$();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=fw();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),hl=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=fn(),r=fl(),o=fE(),a=fj();function i(e,i){let{gen:n,it:s}=e;s.schemaEnv.root.dynamicAnchors[i]=!0;let l=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(i)}`,c="#"===s.errSchemaPath?s.validateName:function(e){let{schemaEnv:t,schema:r,self:i}=e.it,{root:n,baseId:s,localRefs:l,meta:c}=t.root,{schemaId:u}=i.opts,d=new o.SchemaEnv({schema:r,schemaId:u,root:n,baseId:s,localRefs:l,meta:c});return o.compileSchema.call(i,d),(0,a.getValidate)(e,d)}(e);n.if((0,t._)`!${l}`,()=>n.assign(l,c))}e.dynamicAnchor=i,e.default={keyword:"$dynamicAnchor",schemaType:"string",code:e=>i(e,e.schema)}}),hc=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=fn(),r=fl(),o=fj();function a(e,a){let{gen:i,keyword:n,it:s}=e;if("#"!==a[0])throw Error(`"${n}" only supports hash fragment reference`);let l=a.slice(1);if(s.allErrors)c();else{let t=i.let("valid",!1);c(t),e.ok(t)}function c(e){if(s.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(s.validateName,e))}else u(s.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)}}),hu=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hl(),r=fs();e.default={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,t.dynamicAnchor)(e,""):(0,r.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}}}),hd=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hc();e.default={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,t.dynamicRef)(e,e.schema)}}),hp=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hl(),r=hc(),o=hu(),a=hd();e.default=[t.default,r.default,o.default,a.default]}),hf=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fY();e.default={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}}),hh=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fY();e.default={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,t.validateSchemaDeps)(e)}}),hm=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fs();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`)}}}),hy=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hf(),r=hh(),o=hm();e.default=[t.default,r.default,o.default]}),hg=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn(),r=fs(),o=fl();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:n,errsCount:s,it:l}=e;if(!s)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",n,e=>{var r,o;return a.if((r=u,o=e,(0,t._)`!${r} || !${r}[${o}]`),()=>d(e))})):!0!==u&&a.forIn("key",n,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._)`${s} === ${o.default.errors}`)}}}),hv=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fn(),r=fs();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:n}=e,s=n.items||0;if(!0===s)return;let l=o.const("len",(0,t._)`${i}.length`);if(!1===a)e.setParams({len:s}),e.fail((0,t._)`${l} > ${s}`);else if("object"==typeof a&&!(0,r.alwaysValidSchema)(n,a)){let a=o.var("valid",(0,t._)`${l} <= ${s}`);o.if((0,t.not)(a),()=>{var i,c;return i=a,c=s,void o.forRange("i",c,l,a=>{e.subschema({keyword:"unevaluatedItems",dataProp:a,dataPropType:r.Type.Num},i),n.allErrors||o.if((0,t.not)(i),()=>o.break())})}),e.ok(a)}n.items=!0}}}),h_=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hg(),r=hv();e.default=[t.default,r.default]}),hb=dm((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"}]}}}}}),hS=dm((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:"#"}}}}}),h$=dm((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:"#"}}}}),hw=dm((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:{}}}}}),hE=dm((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"}}}}),hR=dm((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}}}}),hP=dm((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:[]}}}}),hO=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hb(),r=hS(),o=h$(),a=hw(),i=hE(),n=hR(),s=hP(),l=["/properties"];e.default=function(e){return[t,r,o,a,c(this,i),n,c(this,s)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function c(t,r){return e?t.$dataMetaSchema(r,l):r}}}),hk=dm((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=fT(),o=ho(),a=hp(),i=hy(),n=h_(),s=hi(),l=hO(),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(n.default),this.opts.discriminator&&this.addKeyword(s.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=fS();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var p=fn();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 f=f$();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=fw();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})}),hx=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fI(),r=fG(),o=f7(),a=hp(),i=hy(),n=h_(),s=ht(),l=hr();e.default=[a.default,t.default,r.default,(0,o.default)(!0),s.default,l.metadataVocabulary,l.contentVocabulary,i.default,n.default]}),hT=dm((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}}}}),hC=dm((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"}}}}}),hj=dm((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"}}}}),hI=dm((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"}}}}),hN=dm((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"}}}}),hA=dm((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"}}}}),hM=dm((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}}}}),hq=dm((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:[]}}}}),hz=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hT(),r=hC(),o=hj(),a=hI(),i=hN(),n=hA(),s=hM(),l=hq(),c=["/properties"];e.default=function(e){return[t,r,o,a,i,u(this,n),s,u(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,r){return e?t.$dataMetaSchema(r,c):r}}}),hL=dm((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=fT(),o=hx(),a=hi(),i=hz(),n="https://json-schema.org/draft/2020-12/schema";var s=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"]=n)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var l=fS();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=fn();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=f$();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=fw();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),hD=dm(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(s(!0),l),"date-time":t(d(!0),p),"iso-time":t(s(),c),"iso-date-time":t(d(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return h.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(b.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:_},double:{type:"number",validate:_},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,f),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],n=+a[2],s=+a[3];return n>=1&&n<=12&&s>=1&&s<=(2===n&&(t=i)%4==0&&(t%100!=0||t%400==0)?29:o[n])}function i(e,t){if(e&&t)return e>t?1:e<t?-1:0}let n=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function s(e){return function(t){let r=n.exec(t);if(!r)return!1;let o=+r[1],a=+r[2],i=+r[3],s=r[4],l="-"===r[5]?-1:1,c=+(r[6]||0),u=+(r[7]||0);if(c>23||u>59||e&&!s)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=n.exec(e),o=n.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=s(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 f(e,t){if(!(e&&t))return;let[r,o]=e.split(u),[a,n]=t.split(u),s=i(r,a);if(void 0!==s)return s||l(o,n)}let h=/\/|:/,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=0x7fffffff;function _(){return!0}let b=/[^\\]\\Z/}),hU=dm(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=hs(),r=fn(),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:n,data:s,schemaCode:l,keyword:c,it:u}=e,{opts:d,self:p}=u;if(!d.validateFormats)return;let f=new t.KeywordCxt(u,p.RULES.all.format.definition,"format");function h(e){return(0,r._)`${e}.compare(${s}, ${l}) ${a[c].fail} 0`}f.$data?(o=n.scopeValue("formats",{ref:p.formats,code:d.code.formats}),i=n.const("fmt",(0,r._)`${o}[${f.schemaCode}]`),e.fail$data((0,r.or)((0,r._)`typeof ${i} != "object"`,(0,r._)`${i} instanceof RegExp`,(0,r._)`typeof ${i}.compare != "function"`,h(i)))):function(){let t=f.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=n.scopeValue("formats",{key:t,ref:o,code:d.code.formats?(0,r._)`${d.code.formats}${(0,r.getProperty)(t)}`:void 0});e.fail$data(h(a))}()},dependencies:["format"]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}),hV=dm((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=hD(),o=hU(),a=fn(),i=new a.Name("fullFormats"),n=new a.Name("fastFormats"),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return l(e,t,r.fullFormats,i),e;let[a,s]="fast"===t.mode?[r.fastFormats,n]:[r.fullFormats,i];return l(e,t.formats||r.formatNames,a,s),t.keywords&&(0,o.default)(e),e};function l(e,t,r,o){var i;for(let n of(null!=(i=e.opts.code).formats||(i.formats=(0,a._)`require("ajv-formats/dist/formats").${o}`),t))e.addFormat(n,r[n])}s.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=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s}),hF=hs(),hH=hk(),hK=hL();let hG=(dy(hV(),1)).default;function hB(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return hG(t),t}var hJ=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=void 0!==e,this._ajv=e}get ajv(){return this._ajv??=hB(hK.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(dg.has(r))return"2020-12";if(dv.has(r))return"2019-09";if(d_.has(r)||db.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??=hB(hH.Ajv2019):this._ajvDraft7??=hB(hF.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)}}};hF.Ajv,d=globalThis.crypto?.webcrypto??globalThis.crypto??Promise.resolve().then(a.t.bind(a,7598,19)).then(e=>e.webcrypto);var hZ=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return dw(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 dw(this,e)}constructor(e){super(e),this.name=new.target.name,d$(this,new.target)}},hW=class extends hZ{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}},hX=class extends hZ{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}},hY=class extends hZ{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 / *.localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},hQ=class extends hZ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`),this.recordedIssuer=e,this.currentIssuer=t}},h0=class extends hZ{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 h1(e,t,r){if(e)return"string"!=typeof 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."),void 0===e.issuer?e:{...e,issuer:void 0}):h2(e.issuer,t)?e:void 0}function h2(e,t){return e===t||e.endsWith("/")&&e.slice(0,-1)===t||t.endsWith("/")&&t.slice(0,-1)===e}var h9=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return dw(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 dw(this,e)}constructor(e){super(e??"Unauthorized"),this.name="UnauthorizedError",d$(this,new.target)}};function h3(e){return e?.authorization_response_iss_parameter_supported===!0}function h5({iss:e,expectedIssuer:t,issParameterSupported:r}){if(void 0!==t){if(void 0===e){if(r)throw new hW("authorization_response",t,void 0);return}if(e!==t)throw new hW("authorization_response",t,e)}}function h4(...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}let h6="code",h8="S256";function h7(e){return"localhost"===e||e.endsWith(".localhost")||"127.0.0.1"===e||"[::1]"===e||"::1"===e}async function me(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let e=lB.parse(JSON.parse(r));return dR.fromResponse(e)}catch(o){let e=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${o}. Raw body: ${r}`;return new dR(dE.ServerError,e)}}function mt(e,t,r){let o=void 0===e.invalidateCredentials?`retrying authorization without discarding the stored ${r} (provider implements no invalidateCredentials())`:`invalidating the stored ${r} and retrying authorization`;console.warn(`[mcp-sdk] OAuth ${JSON.stringify(t.code)} — ${o}. Cause: ${JSON.stringify(t.message)}`)}async function mr(e,t){try{return await mo(e,t)}catch(r){if(r instanceof dR){if(r.code===dE.InvalidClient||r.code===dE.UnauthorizedClient)return mt(e,r,"client credentials and tokens"),await e.invalidateCredentials?.("client"),await e.invalidateCredentials?.("tokens"),await mo(e,t);else if(r.code===dE.InvalidGrant||r.code===dE.InvalidDpopProof)return mt(e,r,"tokens"),await e.invalidateCredentials?.("tokens"),await mo(e,t)}throw r}}async function mo(e,{serverUrl:t,authorizationCode:r,iss:o,scope:a,resourceMetadataUrl:i,fetchFn:n,skipIssuerMetadataValidation:s,forceReauthorization:l}){var c;let u,p,f,h,m,y={...m=(c=e).clientMetadata,grant_types:m.grant_types??(void 0===c.redirectUrl?void 0:["authorization_code","refresh_token"]),application_type:m.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||h7(e.hostname))return"native"}return"web"}(m.redirect_uris)},g=await e.discoveryState?.(),v=i;if(!v&&g?.resourceMetadataUrl&&(v=new URL(g.resourceMetadataUrl)),g?.authorizationServerUrl){if(p=g.authorizationServerUrl,u=g.resourceMetadata,f=g.authorizationServerMetadata??await mu(p,{fetchFn:n,skipIssuerValidation:s}),!u)try{u=await ms(t,{resourceMetadataUrl:v},n)}catch(e){if(e instanceof TypeError)throw e}(f!==g.authorizationServerMetadata||u!==g.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(p),resourceMetadataUrl:v?.toString(),resourceMetadata:u,authorizationServerMetadata:f})}else{let e=await md(t,{resourceMetadataUrl:v,fetchFn:n,skipIssuerMetadataValidation:s});p=e.authorizationServerUrl,f=e.authorizationServerMetadata,u=e.resourceMetadata,h={authorizationServerUrl:String(p),resourceMetadataUrl:v?.toString(),resourceMetadata:u,authorizationServerMetadata:f}}let _=f?.issuer??String(p),b={issuer:_};if(await e.saveAuthorizationServerUrl?.(_),void 0!==r){let t=g?.authorizationServerMetadata?.issuer??g?.authorizationServerUrl;if(void 0===t){if(void 0!==e.saveDiscoveryState)throw new hQ("discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier",_);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(!h2(t,_))throw new hQ(t,_)}h&&await e.saveDiscoveryState?.(h);let S=await async function(e,t,r){var o;let a,i=((a=new URL("string"==typeof(o=e)?o:o.href)).hash="",a);if(t.validateResourceURL)return await t.validateResourceURL(i,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:i,configuredResource:r.resource}))throw Error(`Protected resource ${r.resource} does not match expected ${i} (or origin)`);return new URL(r.resource)}}(t,e,u),$=S&&u&&!e.validateResourceURL?u.resource:S;$&&await e.saveResourceUrl?.(mp($));let w=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:u,authServerMetadata:f,clientMetadata:e.clientMetadata}),E=await Promise.resolve(e.clientInformation(b)),R=h1(E,_,{canPersistStamp:void 0!==e.saveClientInformation});if(void 0===R&&E?.issuer&&void 0===e.saveClientInformation)throw new hQ(E.issuer,_);if(R&&void 0===R.issuer&&(R={...R,issuer:_},await e.saveClientInformation?.(R,b)),!R){if(void 0!==r)throw Error("Existing OAuth client information is required when exchanging an authorization code");let t=f?.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 dR(dE.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${o}`);if(t&&o)R={client_id:o,issuer:_},await e.saveClientInformation?.(R,b);else{if(!e.saveClientInformation)throw Error("OAuth client information must be saveable for dynamic registration");R={...await async function(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 n={...r,...void 0===o?{}:{scope:o}},s=await fo(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!s.ok)throw new hX({status:s.status,body:await s.text(),submittedMetadata:n});return lX.parse(dx(await s.json()))}(p,{metadata:f,clientMetadata:y,scope:w,fetchFn:n}),issuer:_},await e.saveClientInformation(R,b)}}let P=!e.redirectUrl;if(void 0!==r||P){void 0!==r&&h5({iss:o,expectedIssuer:f?.issuer,issParameterSupported:h3(f)});let t=await async function(e,t,{metadata:r,resource:o,authorizationCode:a,iss:i,scope:n,fetchFn:s}={}){let l;void 0!==a&&h5({iss:i,expectedIssuer:r?.issuer,issParameterSupported:h3(r)});let c=r?.issuer??String(t),u=async()=>{let t=await e.clientInformation({issuer:c}),r=h1(t,c,{canPersistStamp:!1});if(t&&void 0===r)throw new hQ(String(t.issuer),c);return r},d=await u(),p=n??e.clientMetadata.scope;if(e.prepareTokenRequest&&(l=await e.prepareTokenRequest(p)),!l){var f,h;if(!a)throw Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw Error("redirectUrl is required for authorization_code flow");f=a,h=await e.codeVerifier(),l=new URLSearchParams({grant_type:"authorization_code",code:f,code_verifier:h,redirect_uri:String(e.redirectUrl)})}return mf(t,{metadata:r,tokenRequestParams:l,clientInformation:d??=await u(),addClientAuthentication:e.addClientAuthentication,resource:o,dpop:await e.dpop?.(),fetchFn:s})}(e,p,{metadata:f,resource:$,authorizationCode:r,iss:o,scope:w,fetchFn:n});return await e.saveTokens({...t,issuer:_},b),"AUTHORIZED"}let O=h1(await e.tokens(b),_);if(O&&void 0===O.issuer&&(O={...O,issuer:_},await e.saveTokens(O,b)),O?.refresh_token&&!l){let t,r=await e.scopeForRefresh?.(O);try{t=await async function(e,{metadata:t,clientInformation:r,refreshToken:o,scope:a,resource:i,addClientAuthentication:n,dpop:s,fetchFn:l}){let c=new URLSearchParams({grant_type:"refresh_token",refresh_token:o});a&&c.set("scope",a);let u=await mf(e,{metadata:t,tokenRequestParams:c,clientInformation:r,addClientAuthentication:n,resource:i,dpop:s,fetchFn:l});return{refresh_token:o,...u,...a&&!u.scope&&{scope:a}}}(p,{metadata:f,clientInformation:R,refreshToken:O.refresh_token,scope:r,resource:$,addClientAuthentication:e.addClientAuthentication,dpop:await e.dpop?.(),fetchFn:n})}catch(e){if(e instanceof hY||e instanceof dR&&e.code!==dE.ServerError)throw e;console.warn(`[mcp-sdk] Could not refresh OAuth tokens; falling back to a new authorization request. Cause: ${JSON.stringify(e instanceof Error?e.message:String(e))}`)}if(t)return await e.saveTokens({...t,issuer:_},b),"AUTHORIZED"}let k=e.state?await e.state():void 0,{authorizationUrl:x,codeVerifier:T}=await async function(e,{metadata:t,clientInformation:r,redirectUrl:o,scope:a,state:i,resource:n}){let s;if(t){if(s=new URL(t.authorization_endpoint),!t.response_types_supported.includes(h6))throw Error(`Incompatible auth server: does not support response type ${h6}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(h8))throw Error(`Incompatible auth server: does not support code challenge method ${h8}`)}else s=new URL("/authorize",e);let l=await async function(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await async function(e){return await async function(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=256-256%t.length,o="";for(;o.length<e;)for(let a of(await async function(e){return(await d).getRandomValues(new Uint8Array(e))}(e-o.length)))a<r&&(o+=t[a%t.length]);return o}(e)}(e),r=await async function(e){return btoa(String.fromCharCode(...new Uint8Array(await (await d).subtle.digest("SHA-256",new TextEncoder().encode(e))))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}(t);return{code_verifier:t,code_challenge:r}}(),c=l.code_verifier,u=l.code_challenge;return s.searchParams.set("response_type",h6),s.searchParams.set("client_id",r.client_id),s.searchParams.set("code_challenge",u),s.searchParams.set("code_challenge_method",h8),s.searchParams.set("redirect_uri",String(o)),i&&s.searchParams.set("state",i),a&&s.searchParams.set("scope",a),a?.split(" ").includes("offline_access")&&s.searchParams.append("prompt","consent"),n&&s.searchParams.set("resource",mp(n)),{authorizationUrl:s,codeVerifier:c}}(p,{metadata:f,clientInformation:R,state:k,redirectUrl:e.redirectUrl,scope:w,resource:$});return await e.saveCodeVerifier(T),await e.redirectToAuthorization(x),"REDIRECT"}let ma=new Set(["bearer","dpop"]);function mi(e){let t,r=e.headers.get("WWW-Authenticate");if(!r)return{};let[o,a]=r.split(" ");if(!o||!ma.has(o.toLowerCase())||!a)return{};let i=mn(e,"resource_metadata")||void 0;if(i)try{t=new URL(i)}catch{}let n=mn(e,"scope")||void 0,s=mn(e,"error")||void 0;return{resourceMetadataUrl:t,scope:n,error:s,errorDescription:mn(e,"error_description")||void 0}}function mn(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 ms(e,t,r=fetch){let o=await async function(e,t,r,o){var a,i;let n,s=new URL(e),l=o?.protocolVersion??i9;o?.metadataUrl?n=new URL(o.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,s.pathname),o?.metadataServerUrl??s)).search=s.search;let c=await mc(n,l,r);return o?.metadataUrl||(a=c,i=s.pathname,a&&("/"===i||(a.ok||!(a.status<500))&&502!==a.status))||(c=await mc(new URL(`/.well-known/${t}`,s),l,r)),c}(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 lU.parse(await o.json())}async function ml(e,t,r=fetch){let o=fo(r);try{return await o(e,{headers:t})}catch(e){throw e}}async function mc(e,t,r=fetch){return await ml(e,{"MCP-Protocol-Version":t},r)}async function mu(e,{fetchFn:t=fetch,protocolVersion:r=i9,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 n=await ml(r,a,t);if(!n)continue;if(!n.ok){if(await n.text?.().catch(()=>{}),n.status<500||502===n.status)continue;throw Error(`HTTP ${n.status} trying to load ${"oauth"===i?"OAuth":"OpenID provider"} metadata from ${r}`)}let s="oauth"===i?lV.parse(await n.json()):lH.parse(await n.json());if(!o){let t="string"==typeof e?e:e.href;if(!(s.issuer===t||t.endsWith("/")&&s.issuer===t.slice(0,-1)))throw new hW("metadata",t,s.issuer)}return s}}async function md(e,t){let r,o;try{(r=await ms(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 mu(o,{fetchFn:t?.fetchFn,skipIssuerValidation:t?.skipIssuerMetadataValidation});return{authorizationServerUrl:o,authorizationServerMetadata:a,resourceMetadata:r}}function mp(e){return"string"==typeof e?e:e.href}async function mf(e,{metadata:t,tokenRequestParams:r,clientInformation:o,addClientAuthentication:a,resource:i,dpop:n,fetchFn:s}){var l,c;let u,d=function(e){let t=new URL(String(e));if("https:"!==t.protocol&&!h7(t.hostname))throw new hY(t.href);return t}(t?.token_endpoint??new URL("/token",e)),p=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});i&&r.set("resource",mp(i)),!a&&o&&function(e,t,r,o){let{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":var n,s,l,c,u=a,d=i,p=r;if(!d)throw Error("client_secret_basic authentication requires a client_secret");let f=btoa(`${u}:${d}`);p.set("Authorization",`Basic ${f}`);return;case"client_secret_post":n=a,s=i,(l=o).set("client_id",n),s&&l.set("client_secret",s);return;case"none":c=a,o.set("client_id",c);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}((l=o,c=t?.token_endpoint_auth_methods_supported??[],u=void 0!==l.client_secret,"token_endpoint_auth_method"in l&&l.token_endpoint_auth_method&&["client_secret_basic","client_secret_post","none"].includes(l.token_endpoint_auth_method)&&(0===c.length||c.includes(l.token_endpoint_auth_method))?l.token_endpoint_auth_method:0===c.length?u?"client_secret_basic":"none":u&&c.includes("client_secret_basic")?"client_secret_basic":u&&c.includes("client_secret_post")?"client_secret_post":c.includes("none")?"none":u?"client_secret_post":"none"),o,p,r);let f=async()=>{let e=new Headers(p);return a&&await a(e,r,d,t),n&&e.set("DPoP",await n.buildProof({htm:"POST",htu:d})),fo(s??fetch)(d,{method:"POST",headers:e,body:r})},h=await f();if(n&&400===h.status&&(await h.clone().json().catch(()=>{}))?.error===dE.UseDpopNonce&&(n.observeNonce(h,d),h=await f()),n?.observeNonce(h,d),!h.ok)throw await me(h);let m=await h.json();try{return lK.parse(dx(m))}catch(e){if("object"==typeof m&&null!==m&&"error"in m)throw await me(JSON.stringify(m));throw e}}let mh=new Set(["tools/list","prompts/list","resources/list","resources/templates/list","server/discover"]);var mm=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(my(e))}set(e,t){let r=my(e),o=mh.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(!mh.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(my(e))&&!mh.has(e.method)&&this._cappedSize--}evict(e){let t=`${e}\0`,r=mh.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 my(e){return`${e.method}\0${JSON.stringify([e.partition??"",e.params??""])}`}function mg(e,t){return void 0===t?e:`${e}\0${t}`}var mv=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 n=await this._store.get({...r,partition:i});return n?.scope==="public"?n: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=mg(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=mg(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(mg(e,o?.params))??0)!==r)return;let a=o?.params??"",i=this._partitionFor("private"),n=this._partitionFor("public"),s=(o?.scope??"private")==="public"?n:i;try{await this._store.set({method:e,params:a,partition:s},{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(n!==i)try{await this._store.delete({method:e,params:a,partition:s===i?n: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 m_=Symbol.for("mcp.authSeamEscape");function mb(e){if("object"==typeof e&&null!==e||"function"==typeof e)try{Object.defineProperty(e,m_,{value:!0,configurable:!0})}catch{}return e}let mS=new Set([-32001,-32020,-32021]);function m$(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 d8({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=dI(e),n=t.clientModernVersions.find(e=>i.includes(e));return void 0!==n?{kind:"corrective",version:n,error:r}:i.length>0?{kind:"error",error:r}:t.fallbackAvailable?{kind:"legacy"}:{kind:"error",error:r}}return mS.has(r),{kind:"legacy"}}function mw(e,t){var r;return"browser"===t.environment&&((r=e)instanceof TypeError||r instanceof Error&&"TypeError"===r.name)?{kind:"legacy"}:{kind:"error",error:new dO(dP.EraNegotiationFailed,`Version negotiation probe failed: ${mE(e)}`,{cause:e},{cause:e})}}function mE(e){return e instanceof Error?e.message:String(e)}function mR(){let e=globalThis;return void 0!==e.window&&void 0!==e.document?"browser":"node"}function mP(e){return"stderr"in e&&"pid"in e?"stdio":"http"}var mO=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&&(p$(e)||pw(e))&&e.id===t.id){r._pending=void 0,p$(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(n),this._pending?.id===r&&(this._pending=void 0),o(e))},n=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,mk.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 mk=new WeakMap;function mx(e){let t=mk.get(e);mk.delete(e),t?.()}async function mT(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,n="auto"===e.kind&&e.fallbackAvailable,s=await mO.open(t.transport);try{r=await (async()=>{let r=i[0],l=!1,c=a;for(;;){let a=await s.exchange(e=>{var o,a,i,n;return o=e,a=r,i=t.clientInfo,n=t.capabilities,{jsonrpc:"2.0",id:o,method:"server/discover",params:{_meta:pm(a).outboundEnvelope({protocolVersion:a,clientInfo:i,clientCapabilities:n})}}},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":{var r,o;let t=e.error;if(("object"==typeof(r=t)&&null!==r||"function"==typeof r)&&!0===r[m_]||t instanceof h9||t instanceof Error&&"UnauthorizedError"===t.name)return{kind:"auth-required",error:t};if(t instanceof dk){let e=t.data?.text;return{kind:"http-error",status:t.data.status,body:"string"==typeof e?e:void 0,statusText:t.data.statusText}}if((o=t)instanceof dO&&o.code===dP.ClientHttpUnexpectedContent||o instanceof Error&&"SyntaxError"===o.name)return{kind:"unusable-reply",error:t};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=pm(ph).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 d8({supported:[...o],requested:t.requestedVersion})}}(e.result,t);case"rpc-error":return m$(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 dk(t?dP.ClientHttpForbidden:dP.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 dk(dP.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?m$(r,t):{kind:"legacy"}}(e,t);case"network-error":return mw(e.error,t);case"unusable-reply":return{kind:"error",error:new dO(dP.EraNegotiationFailed,`Version negotiation probe failed: the server answered with an unusable reply (${mE(e.error)})`,{cause:e.error},{cause:e.error})};case"auth-required":return{kind:"error",error:e.error};case"closed":if("stdio"===t.transportKind)return{kind:"legacy"};return mw(Error("Connection closed during the version negotiation probe"),t);case"timeout":if("stdio"===t.transportKind)return{kind:"legacy"};return{kind:"error",error:new dO(dP.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}(u,{clientModernVersions:i,requestedVersion:r,fallbackAvailable:n,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 dO(dP.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 dO(dP.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 dO(dP.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}}})()}catch(e){throw s.detach(),e}return s.release(),r}function mC(){return new dO(dP.EraNegotiationFailed,"Version negotiation failed: the transport was closed during the server/discover probe")}function mj(e){let t=e._meta?.[i6];return pX.Implementation(t)?t:void 0}let mI={"notifications/tools/list_changed":["tools/list"],"notifications/prompts/list_changed":["prompts/list"],"notifications/resources/list_changed":["resources/list","resources/templates/list"]},mN={};var mA=class extends p9{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;static{mN.enforceStrictCapabilities=e=>e._enforceStrictCapabilities,mN.walkPages=(e,t,r,o)=>e._walkPages(t,r,o),mN.readResource=(e,t,r)=>e._readResource(t,r)}_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 dO(dP.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){var r;super(t),this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new hJ,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=(r=t?.inputRequired,{autoFulfill:r?.autoFulfill??!0,maxRounds:r?.maxRounds??10}),this._cache=new mv(t?.responseCacheStore??new mm,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){let t;if(void 0!==this._negotiatedProtocolVersion&&this._negotiatedProtocolVersion>=dT&&(t=e,ng.safeParse(t).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:n,flowStartedAt:s}=o,l={inputRequests:r.inputRequests,...void 0!==r.requestState&&{requestState:r.requestState}};return async function(e){let{config:t,method:r,originalParams:o,requestOptions:a,hooks:i,signal:n}=e,s=e.flowStartedAt??Date.now(),l=e.firstPayload,c=0;for(;;){let e;if((c+=1)>t.maxRounds){var u,d;throw new dO(dP.InputRequiredRoundsExceeded,(u=r,d=t.maxRounds,`Multi-round-trip request '${u}' still required input after ${d} 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 p=Object.entries(l.inputRequests??{});if(p.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)}}(n);try{let r=await Promise.all(p.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){return new Promise((t,r)=>{if(e?.aborted)return void r(e.reason instanceof dO?e.reason:new dO(dP.RequestTimeout,String(e.reason)));let o=setTimeout(()=>{e?.removeEventListener("abort",a),t()},250),a=()=>{clearTimeout(o),r(e?.reason instanceof dO?e.reason:new dO(dP.RequestTimeout,String(e?.reason)))};e?.addEventListener("abort",a,{once:!0})})}(n);let f={...void 0!==a.timeout&&{timeout:a.timeout}};if(void 0!==a.maxTotalTimeout){let e=Date.now()-s,t=a.maxTotalTimeout-e;if(t<=0)throw new dO(dP.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:a.maxTotalTimeout,totalElapsed:e});f.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),f);if(pE(h)){l={inputRequests:h.inputRequests??{},...void 0!==h.requestState&&{requestState:h.requestState}};continue}return h}}({config:t,method:i.method,originalParams:i.params,firstPayload:l,flowStartedAt:s,signal:n?.signal,requestOptions:{...n?.timeout!==void 0&&{timeout:n.timeout},...n?.maxTotalTimeout!==void 0&&{maxTotalTimeout:n.maxTotalTimeout},...n?.onprogress!==void 0&&{onprogress:n.onprogress}},hooks:{dispatchInputRequest:(t,r,o)=>(async function(e,t,r,o,a){var i,n,s,l,c;if(!p5(o)||"string"!=typeof o.method)throw new dO(dP.InvalidResult,`Invalid input request '${r}': each inputRequests entry must be an embedded request object with a method`,{key:r});let u=o.method;if(!t.hasInputRequestMethod(u))throw new dO(dP.InvalidResult,`Invalid input request '${r}': '${u}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:r,method:u});let d=e.getRequestHandler(u);if(void 0===d)throw new dO(dP.CapabilityNotSupported,`Cannot fulfil input request '${r}': no handler is registered for '${u}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:r,method:u});let p=p5(o.params)?o.params:void 0;return await d({jsonrpc:"2.0",id:r,method:u,...void 0!==p&&{params:p}},e.buildContext((i=r,n=u,s=p,l=a,{sessionId:e.sessionId,mcpReq:{id:i,method:n,_meta:s?._meta,requestState:(c=void 0,()=>c),signal:l,send:()=>p4("send"),notify:()=>p4("notify")}})))})(e,a,t,r,o),retry:(e,t)=>{var r,a;return o.retry(e,(r=n,a=t,{...r?.signal!==void 0&&{signal:r.signal},...r?.onprogress!==void 0&&{onprogress:r.onprogress},...r?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:r.resetTimeoutOnProgress},...r?.headers!==void 0&&{headers:r.headers},...void 0!==a.timeout&&{timeout:a.timeout},...void 0!==a.maxTotalTimeout&&{maxTotalTimeout:a.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 dO(dP.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]=p3(a)&&p3(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=pm(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 d5("not-in-era"===a.reason?d3.InternalError:d3.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:n,supportsUrlMode:s}=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&&!n)throw new d5(d3.InvalidParams,"Client does not support form-mode elicitation requests");if("url"===i.mode&&!s)throw new d5(d3.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 d5("not-in-era"===c.reason?d3.InternalError:d3.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=pm(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 d5("not-in-era"===a.reason?d3.InternalError:d3.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,n=await t(e,r),s=!!(i.tools||i.toolChoice),l=o.samplingResultVariant(s,n);if(l.ok||"not-in-era"!==l.reason||(l=o.validateInputResponse("sampling/createMessage",n)),!l.ok)throw new d5("not-in-era"===l.reason?d3.InternalError:d3.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 dO(dP.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&&nU.safeParse(e.discover).success))return e;throw new dO(dP.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>=dT))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?dI(t):[];return{kind:"auto",modernVersions:a.length>0?a:[...dC],fallbackAvailable:!t||dj(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=dj(this._supportedProtocolVersions);try{let o=r[0];if(void 0===o)throw new dO(dP.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=mP(e),i={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:mR(),defaultTimeoutMs:r?.timeout??6e4},n="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===n?await mT(t,{...i,transport:e,transportKind:a}):await async function(e,t,r,o){let a,i,n=new t.constructor({...r,stderr:"ignore"}),s=t.close,l=!1,c=new Promise((e,t)=>{a=()=>t(mC())});t.close=async function(){return l=!0,a?.(),s.call(t)};try{let t=mT(e,{...o,transport:n,transportKind:"stdio",disposableProbe:!0});t.catch(()=>{}),i=await Promise.race([t,c])}finally{await async function(e){try{let t=e._dispose;await ("function"==typeof t?t.call(e):e.close())}catch{}}(n),t.close=s}if(l)throw mC();return i}(t,e,n,i)}catch(t){throw await e.close().catch(()=>{}),mx(e),t}if(mx(e),await super.connect(e),"legacy"===o.era)return void await this._legacyHandshake(e,r);if(this._serverCapabilities=o.discover.capabilities,this._serverVersion=mj(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&&dI(a).length>0?dI(a):dC).find(e=>o.supportedVersions.includes(e));if(void 0===i)throw new dO(dP.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=mj(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>=dT?"modern":"legacy"}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new dO(dP.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new dO(dP.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 dO(dP.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if("resources/subscribe"===e&&!this._serverCapabilities.resources.subscribe)throw new dO(dP.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new dO(dP.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new dO(dP.CapabilityNotSupported,`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if("notifications/roots/list_changed"===e&&!this._capabilities.roots?.listChanged)throw new dO(dP.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 dO(dP.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new dO(dP.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new dO(dP.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"},nU,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=>e.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=>e.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=>e.resourceTemplates)}async _listAllPages(e,t,r,o,a){let i=r?.cacheMode==="bypass",n=this._cache.captureGeneration(e),s=o=>{let a=void 0===o?t&&{...t}:{...t,cursor:o};return this.request({method:e,...a&&{params:a}},r)},l=await this._walkPages(e,s,o);return delete l.nextCursor,a?.(l),i||await this._cache.write(e,l,n,this._freshness(l)),l}async _walkPages(e,t,r){let o=await t(void 0),a=o.nextCursor,i=o,n=1;for(;void 0!==a;){if(0!==this._listMaxPages&&n>=this._listMaxPages)throw new dO(dP.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});let s=await t(a);if(s.nextCursor===a&&JSON.stringify(r(s))===JSON.stringify(r(i)))break;r(o).push(...r(s)),i=s,a=s.nextCursor,n++}return o}_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 dO?e:new dO(dP.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:pk(r.inputSchema)}async readResource(e,t){let{result:r}=await this._readResource(e,t);return r}async _readResource(e,t){let r=await this._serveFromCache("resources/read",e.uri,t);if(void 0!==r)return{result:r,cached:!0};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{result:a,cached:!1}}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,n;if(void 0===this.transport)throw new dO(dP.NotConnected,"Not connected");let s=this._negotiatedProtocolVersion;if(void 0===s||!(s>=dT))throw new dO(dP.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${s??"none"}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:"subscriptions/listen",protocolVersion:s});if(t?.signal?.aborted){let e=t.signal.reason;throw e instanceof dO?e:new dO(dP.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=>{n=e}),f=e=>{if("closed"===u)return;let s="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(),n(e.cause),s&&i(e.error??new dO(dP.ConnectionClosed,"subscriptions/listen closed before the server acknowledged"))},h=async()=>{l.abort(),await this.notification({method:"notifications/cancelled",params:{requestId:c}}).catch(()=>{})};this._listenState.set(c,{settle:f});let m=t?.timeout??6e4;if(r=setTimeout(()=>{f({cause:"remote",error:new dO(dP.RequestTimeout,"subscriptions/listen ack timed out",{timeout:m})}),h().catch(()=>{})},m),t?.signal){let e=t.signal;o=()=>{if("closed"===u)return;let t=e.reason;f({cause:"local",error:t instanceof Error?t:Error(String(t??"Aborted"))}),h().catch(()=>{})},e.addEventListener("abort",o,{once:!0})}let y={jsonrpc:"2.0",id:c,method:"subscriptions/listen",params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}},g=e=>{f({cause:"remote",error:e instanceof Error?e:Error(String(e))})};try{this.transport.send(y,{requestSignal:l.signal,onRequestStreamEnd:()=>f({cause:"remote",error:Error("subscriptions/listen: stream ended")})}).catch(g)}catch(e){g(e)}return{honoredFilter:await d,close:async()=>{"closed"!==u&&(f({cause:"local"}),await h())},closed:p}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let r=Object.hasOwn(mI,e.method)?mI[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?.[i7],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?pw(e)?r.settle({cause:"remote",error:d5.fromError(e.error.code,e.error.message,e.error.data)}):r.settle({cause:"graceful",error:new dO(dP.ConnectionClosed,"subscriptions/listen: server closed the subscription gracefully before acknowledging")}):super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new dO(dP.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"!==mR(),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}`]=pI(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),n=()=>{if(void 0===i||i.ok)return;let t=i.compileError,r=(t instanceof Error?t.message:String(t)).slice(0,200);throw new d5(d3.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${r}`)};n();try{r=await this.request({method:"tools/call",params:e},await a())}catch(c){let s=c instanceof d5&&-32020===c.code;if(!o||!s||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)),n(),r=await this.request({method:"tools/call",params:e},await a())}let s=void 0!==i&&i.ok?i.validator:void 0;if(s){if(void 0===r.structuredContent&&!r.isError)throw new d5(d3.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(void 0!==r.structuredContent&&!r.isError)try{let e=s(r.structuredContent);if(!e.valid)throw new d5(d3.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){if(e instanceof d5)throw e;throw new d5(d3.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=>e.tools,e=>this._excludeInvalidXMcpHeaderTools(e))}_excludeInvalidXMcpHeaderTools(e){if("modern"!==this.getProtocolEra()||!this.transport||"stdio"===mP(this.transport))return;let t=e.tools.filter(e=>{let t=pk(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=aj(sz,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:n}=a.data,{onChanged:s}=r,l=async()=>{if(!i)return void s(null,null);try{s(null,await o())}catch(e){s(e instanceof Error?e:Error(String(e)),null)}},c=()=>{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,c)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};class mM 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 mq(e){}function mz(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 mL(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 mD 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=mq,onError:r=mq,onRetry:o=mq,onComment:a,maxBufferSize:i}=e,n=[],s=0,l=!0,c,u="",d=0,p,f=!1;function h(){void 0!==i&&(s+u.length<=i||(f=!0,n.length=0,s=0,c=void 0,u="",d=0,p=void 0,r(new mM(`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(`
|
|
73
73
|
`,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(`
|
|
74
|
-
`,r);continue}let a=e.charCodeAt(r);if(
|
|
74
|
+
`,r);continue}let a=e.charCodeAt(r);if(mz(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(`
|
|
75
75
|
`,r);continue}u=0===d?i:`${u}
|
|
76
|
-
${i}`,d++}else
|
|
76
|
+
${i}`,d++}else mL(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(`
|
|
77
77
|
`,r)}return e.slice(r)}for(;r<e.length;){let t=e.indexOf("\r",r),o=e.indexOf(`
|
|
78
|
-
`,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(
|
|
79
|
-
${a}`,d++;return}if(
|
|
80
|
-
${t}`,d++;break;case"id":t.includes("\0")||(c=t);break;case"retry":/^\d+$/.test(t)?o(parseInt(t,10)):r(new
|
|
81
|
-
`)&&-1===e.indexOf("\r")){n.push(e),s+=e.length,h();return}n.push(e);let t=n.join("");n.length=0,s=0;let r=m(t);""!==r&&(n.push(r),s=r.length),h()},reset:function(e={}){if(e.consume&&n.length>0){let e=n.join("");y(e,0,e.length)}l=!0,c=void 0,u="",d=0,p=void 0,n.length=0,s=0,f=!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)}})}}(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return dm(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 dm(this,e)}constructor(e,t,r){super(`SSE error: ${t}`),this.code=e,this.event=r,dh(this,new.target)}});let mI={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},mN=new Set(["authorization","dpop","content-type","mcp-protocol-version","mcp-method","mcp-name","mcp-session-id"]);function mA(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 mM=class{_abortController;_url;_resourceMetadataUrl;_scope;_requestInit;_authProvider;_oauthProvider;_skipIssuerMetadataValidation;_fetch;_fetchWithInit;_redirectPolicy;_sessionId;_reconnectionOptions;_protocolVersion;_onInsufficientScope;_maxStepUpRetries;_serverRetryMs;_reconnectionScheduler;_cancelReconnection;onclose;onerror;onmessage;hasPerRequestStream=!0;constructor(e,t){var r,o,a,i,n;let s;if(this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._skipIssuerMetadataValidation=t?.skipIssuerMetadataValidation,this._fetch=t?.fetch,null==(r=t?.authProvider)?1:"function"!=typeof r.tokens||"function"!=typeof r.clientInformation)this._authProvider=t?.authProvider;else{let e,r;this._oauthProvider=t.authProvider,this._authProvider=(o=t.authProvider,a={skipIssuerMetadataValidation:t.skipIssuerMetadataValidation},{token:async()=>(await o.tokens())?.access_token,onUnauthorized:async e=>(async function(e,t,r){let{resourceMetadataUrl:o,scope:a}=h6(t.response);if(await h3(e,{serverUrl:t.serverUrl,resourceMetadataUrl:o,scope:a,fetchFn:t.fetchFn,...r})!=="AUTHORIZED")throw new hZ})(o,e,a)}),t.authProvider.dpop&&(this._fetch=(i=t.authProvider,e=async()=>{try{return await i.dpop?.()}catch(e){throw mp(e)}},r=async()=>{let e;try{e=await i.tokens()}catch(e){throw mp(e)}return e?.token_type?.toLowerCase()==="dpop"?e.access_token:void 0},t=>{let o=e;return async(e,a)=>{let i=(a?.method??"GET").toUpperCase(),n=new URL(e.toString()),s=await o();if(!s)return t(e,a);let l=async()=>{let o=await r();if(!o)return t(e,a);let l=new Headers(a?.headers),c=await s.buildProof({htm:i,htu:n,accessToken:o});return l.set("Authorization",`DPoP ${o}`),l.set("DPoP",c),t(e,{...a,headers:l})},c=await l();return function(e){if(401!==e.status)return!1;let t=e.headers.get("www-authenticate")??"";return/(?:^|,)\s*dpop(?:\s|$|,)/i.test(t)&&/use_dpop_nonce/i.test(t)}(c)&&c.headers.has("dpop-nonce")&&(s.observeNonce(c,n),await c.text?.().catch(()=>{}),c=await l()),s.observeNonce(c,n),c}})(t.fetch??fetch))}this._redirectPolicy=t?.redirectPolicy,this._fetchWithInit=function(e=fetch,t){return t?async(r,o)=>e(r,{...t,...o,headers:o?.headers?{...p1(t.headers),...p1(o.headers)}:t.headers}):e}(t?.fetch,t?.requestInit),"follow"===this._redirectPolicy&&(this._fetchWithInit=(n=this._fetchWithInit,s=(e,t)=>n(e,t),p3.add(s),s)),this._sessionId=t?.sessionId,this._protocolVersion=t?.protocolVersion,this._reconnectionOptions=t?.reconnectionOptions??mI,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 mp(e)}}async _stepUpAuthorizeInner(e,t){if("throw"===this._onInsufficientScope||!this._oauthProvider)throw new hG({requiredScope:e.scope,resourceMetadataUrl:e.resourceMetadataUrl,errorDescription:e.errorDescription});if(t>=this._maxStepUpRetries)throw new db(dv.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=hY(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 h3(this._oauthProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:o,forceReauthorization:a,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})}_redirects(e){return"follow"===this._redirectPolicy?e:p5(e)}_unfollowedRedirect(e,t){let r="follow"===this._redirectPolicy?void 0:function(e,t){if("opaqueredirect"===t.type)return"Redirect not followed: this runtime does not expose where it points";let r=p9(t.url||e,t);if(r)return(r.username=r.password=r.search=r.hash="","http:"===r.protocol&&"https:"===new URL(t.url||e).protocol)?(r.protocol="https:",`Redirect from https to plain http not followed; try ${r.href} as the endpoint`):`Redirect to ${r.href} not followed; use that URL as the endpoint if it is the intended server`}(e,t);return r&&`${r} (redirectPolicy: 'same-origin')`}async _commonHeaders(){let e,t=new Headers(this._requestInit?.headers||void 0);try{e=await this._authProvider?.token()}catch(e){throw mp(e)}return e&&t.set("Authorization",`Bearer ${e}`),this._sessionId&&t.set("mcp-session-id",this._sessionId),this._protocolVersion&&t.set("mcp-protocol-version",this._protocolVersion),t}_applyBodyDerivedHeaders(e,t){if(Array.isArray(t)||!nu.safeParse(t).success)return;let r=t.params?._meta?.[iY];if("string"!=typeof r)return;e.set("mcp-protocol-version",r),e.set("mcp-method",t.method);let o=function(e,t){var r;let o=Object.hasOwn(pP,e)?pP[e]:void 0;if(void 0===o)return;let a=null===(r=t)||"object"!=typeof r||Array.isArray(r)?void 0:t[o];return{field:o,value:"string"==typeof a?a:void 0}}(t.method,t.params);o?.value!==void 0&&e.set("mcp-name",pR(o.value))}_isModernEnvelopedRequest(e){if(Array.isArray(e)||!nu.safeParse(e).success)return!1;let t=e.params?._meta?.[iY];return"string"==typeof t&&t>=d$}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(),n=[...i.get("accept")?.split(",").map(e=>e.trim().toLowerCase())??[],"text/event-stream"];i.set("accept",[...new Set(n)].join(", ")),o&&i.set("last-event-id",o);let s=this._abortController?.signal,l=void 0!==a&&void 0!==s?mA(s,a):a??s,c=await this._redirects(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}=h6(c);this._resourceMetadataUrl=e,this._scope=hY(this._scope,t)}if(this._authProvider.onUnauthorized&&!t){try{await this._authProvider.onUnauthorized({response:c,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw mp(e)}return await c.text?.().catch(()=>{}),this._startOrAuthSse(e,!0,r)}if(await c.text?.().catch(()=>{}),t)throw mp(new db(dv.ClientHttpAuthentication,"Server returned 401 after re-authentication",{status:401,statusText:c.statusText}));throw mp(new hZ)}if(403===c.status){let{resourceMetadataUrl:o,scope:a,error:i,errorDescription:n}=h6(c);if("insufficient_scope"===i){let i=await c.text?.().catch(()=>null);if(await this._stepUpAuthorize({scope:a,resourceMetadataUrl:o,errorDescription:n,statusText:c.statusText,text:i},r)!=="AUTHORIZED")throw mp(new hZ);return this._startOrAuthSse(e,t,r+1)}}if(await c.text?.().catch(()=>{}),405===c.status)return void e.onRequestStreamEnd?.();let o=this._unfollowedRedirect(this._url,c)??c.statusText;throw new db(dv.ClientHttpFailedToOpenStream,`Failed to open SSE stream: ${o}`,{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:n,onRequestStreamEnd:s}=t,l=()=>this._abortController?.signal.aborted===!0||n?.aborted===!0,c=!1,u=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new mC({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=nh.parse(JSON.parse(e.data));(ph(t)||pm(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:n,onRequestStreamEnd:s},0):l()||s?.()}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:n,onRequestStreamEnd:s},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`)),s?.()}else s?.()}})()}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 hZ("finishAuth requires an OAuthClientProvider");let{authorizationCode:r,iss:o}=await async function(e,t,r,o,a){if("string"==typeof e)return{authorizationCode:e,iss:t};let i=e.get("iss")??void 0,n=e.get("code");if(n)return{authorizationCode:n,iss:i};let s=(await r.discoveryState?.())?.authorizationServerMetadata;if(!s)try{s=(await mo(o,a)).authorizationServerMetadata}catch{s=void 0}if(!s)throw new hZ("Authorization callback failed and the issuer could not be verified");hX({iss:i,expectedIssuer:s.issuer,issParameterSupported:hW(s)});let l=e.get("error");if(l)throw new dg(l,e.get("error_description")??l,e.get("error_uri")??void 0);throw new hZ("Authorization callback contained neither `code` nor `error`")}(e,t,this._oauthProvider,this._url,{fetchFn:this._fetchWithInit,resourceMetadataUrl:this._resourceMetadataUrl});if(await h3(this._oauthProvider,{serverUrl:this._url,authorizationCode:r,iss:o,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})!=="AUTHORIZED")throw new hZ("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:nu.safeParse(e).success?e.id:void 0,requestSignal:t?.requestSignal}).catch(e=>this.onerror?.(e));let n=await this._commonHeaders();this._applyBodyDerivedHeaders(n,e);let s=Array.isArray(e)?e.some(e=>nx.safeParse(e).success):nx.safeParse(e).success;if(s&&n.delete("mcp-session-id"),t?.headers!==void 0)for(let[e,r]of Object.entries(t.headers))mN.has(e.toLowerCase())||n.set(e,r);n.set("content-type","application/json");let l=[...n.get("accept")?.split(",").map(e=>e.trim().toLowerCase())??[],"application/json","text/event-stream"];n.set("accept",[...new Set(l)].join(", "));let c=this._abortController?.signal,u=t?.requestSignal!==void 0&&void 0!==c?mA(c,t.requestSignal):t?.requestSignal??c,d={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(e),signal:u},p=await this._redirects(this._fetch??fetch)(this._url,d);if(s&&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}=h6(p);this._resourceMetadataUrl=e,this._scope=hY(this._scope,t)}if(this._authProvider.onUnauthorized&&!r){try{await this._authProvider.onUnauthorized({response:p,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw mp(e)}return await p.text?.().catch(()=>{}),this._send(e,t,!0,o)}if(await p.text?.().catch(()=>{}),r)throw mp(new db(dv.ClientHttpAuthentication,"Server returned 401 after re-authentication",{status:401,statusText:p.statusText}));throw mp(new hZ)}let a=await p.text?.().catch(()=>null);if(403===p.status){let{resourceMetadataUrl:i,scope:n,error:s,errorDescription:l}=h6(p);if("insufficient_scope"===s){if(await this._stepUpAuthorize({scope:n,resourceMetadataUrl:i,errorDescription:l,statusText:p.statusText,text:a},o)!=="AUTHORIZED")throw mp(new hZ);return this._send(e,t,r,o+1)}}if(400===p.status&&"string"==typeof a&&this._isModernEnvelopedRequest(e))try{let t=nh.parse(JSON.parse(a)),r=(Array.isArray(e)?e:[e]).filter(e=>nu.safeParse(e).success);if(pm(t)&&r.some(e=>e.id===t.id))return void this.onmessage?.(t)}catch{}let i=this._unfollowedRedirect(this._url,p)??a;throw new db(dv.ClientHttpNotImplemented,`Error POSTing to endpoint: ${i}`,{status:p.status,statusText:p.statusText,text:a})}if(202===p.status){await p.text?.().catch(()=>{}),nC.safeParse(e).success&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let f=(Array.isArray(e)?e:[e]).some(e=>"method"in e&&"id"in e&&void 0!==e.id),h=p.headers.get("content-type"),m=function(e){if(e)try{return pQ.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();if(""===t||e.slice(t.length).includes(","))return;return t}}(h);if(f)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=>nh.parse(e)):[nh.parse(e)])this.onmessage?.(t)}else throw await p.text?.().catch(()=>{}),new d_(dv.ClientHttpUnexpectedContent,`Unexpected content type: ${h}`,{contentType:h});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._redirects(this._fetch??fetch)(this._url,t);if(await r.text?.().catch(()=>{}),!r.ok&&405!==r.status)throw new db(dv.ClientHttpFailedToTerminateSession,`Failed to terminate session: ${this._unfollowedRedirect(this._url,r)??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 mq=require("node:stream");var mz=i(6507);let mL="win32"===u3.platform?["APPDATA","COMSPEC","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PATHEXT","PROCESSOR_ARCHITECTURE","PROGRAMDATA","PROGRAMFILES","PROGRAMFILES(X86)","PROGRAMW6432","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","WINDIR"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];var mD=class{_process;_readBuffer;_serverParams;_stderrStream=null;onclose;onerror;onmessage;constructor(e){this._serverParams=e,this._readBuffer=new p0({maxBufferSize:e.maxBufferSize}),("pipe"===e.stderr||"overlapped"===e.stderr)&&(this._stderrStream=new mq.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=mz(this._serverParams.command,this._serverParams.args??[],{env:{...function(){let e={};for(let t of mL){let r=u3.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"===u3.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 d_(dv.NotConnected,"Not connected");let r=JSON.stringify(e)+"\n";this._process.stdin.write(r)?t():this._process.stdin.once("drain",t)})}};let mU=e=>"env"in e&&"string"==typeof e.env,mV=e=>{let t={};return e.forEach(e=>{let r=e.name.trim();if(mU(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},mF=i(8330),mH={name:mF.name,version:mF.version};function mK(e={}){let t,r=new mk(mH,{capabilities:(t={},e.sampling&&(t.sampling={}),e.elicitation&&(t.elicitation={form:{},url:{}}),e.roots&&(t.roots={}),t),versionNegotiation:{mode:"auto"}});return e.sampling&&r.setRequestHandler("sampling/createMessage",e.sampling),e.elicitation&&r.setRequestHandler("elicitation/create",e.elicitation),e.roots&&r.setRequestHandler("roots/list",e.roots),r}async function mG({url:e,headers:t,handlers:r}){let o=mK(r),a=t?mV(t):{},i=new mM(new URL(e),{...t?{requestInit:{headers:a}}:{},reconnectionOptions:{maxReconnectionDelay:3e4,initialReconnectionDelay:1e3,reconnectionDelayGrowFactor:1.5,maxRetries:2}});return await o.connect(i),o}async function mB(e){let{onStderrData:t,handlers:r,...o}=e,a=mK(r),i=new mD({...o,stderr:o.stderr??"pipe"}),n=i.stderr;if(n){let e=t??(e=>{console.error(`[STDIO MCP Server stderr]: ${e}`)});n.on("data",e)}return await a.connect(i),{client:a,transport:i}}async function mJ(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 mZ(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 mW(e){try{await e.transport.close(),await e.client.close()}catch(e){throw console.error("Error disconnecting from stdio MCP server:",e),e}}function mX(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 mY="2026-01-26",mQ="ui/initialize",m0="ui/notifications/initialized",m1="ui/request-display-mode",m2="ui/open-link",m9="ui/update-model-context",m3="ui/message",m5="notifications/message",m4="resources/read",m6="ui/notifications/host-context-changed",m8="ui/notifications/size-changed";function m7(e){return!!e&&"object"==typeof e}function ye(e,t){return e instanceof Error&&e.message?e.message:t}function yt(e={}){let t=e.targetWindow??("u"<typeof window?null:window),r=e.requestTimeoutMs??15e3,o=e.connectionTimeoutMs??2e3,a=100,i=!1,n=!1,s={isConnected:!!t&&t.parent!==t,hostContext:null,hostCapabilities:null},l=new Set,c=new Map,u=e=>{if(e.isConnected!==s.isConnected||e.hostContext!==s.hostContext||e.hostCapabilities!==s.hostCapabilities)for(let t of(s=e,l))t(s)},d=e=>{var t,r;let o;u({isConnected:!0,hostContext:e.hostContext?(t=s.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):s.hostContext,hostCapabilities:e.hostCapabilities?{...s.hostCapabilities??{},...e.hostCapabilities}:s.hostCapabilities})},p=e=>{if(!t||e.source!==t.parent||!m7(e.data))return;n=!0,s.isConnected||u({...s,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),m7(r.error)?e.reject(Error("string"==typeof r.error.message?r.error.message:"MCP request failed")):e.resolve(r.result))}1===r.id&&m7(r.result)&&d({hostContext:m7(r.result.hostContext)?r.result.hostContext:void 0,hostCapabilities:m7(r.result.hostCapabilities)?r.result.hostCapabilities:void 0}),r.method===m6&&m7(r.params)&&d({hostContext:r.params}),"ui/hostContextChanged"===r.method&&m7(r.params)&&m7(r.params.hostContext)&&d({hostContext:r.params.hostContext})};t&&(t.addEventListener("message",p),t.parent!==t&&setTimeout(()=>{i||n||s.hostContext||u({...s,isConnected:!1})},o));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 o=f();return new Promise((i,n)=>{let s=a++,l=setTimeout(()=>{c.has(s)&&(c.delete(s),n(Error(`MCP request timed out: ${e}`)))},r);c.set(s,{resolve:i,reject:n,timeoutId:l}),o.parent.postMessage({jsonrpc:"2.0",id:s,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=ye(t,"MCP request failed");if(!/method not found|unknown method/i.test(e))throw t}throw r instanceof Error?r:Error("MCP request failed")};return{callTool:(e,t)=>m("tools/call",{name:e,arguments:t??{}}),requestDisplayMode:e=>y([m1,"ui/requestDisplayMode"],{mode:e}),async openLink(e){try{await y([m2,"ui/openLink"],{url:e})}catch(r){if(!s.isConnected||!t)return void await (async e=>{if(t?.open)return void t.open(e,"_blank","noopener,noreferrer");throw Error("Unable to open link without a browser window")})(e);throw Error(ye(r,"Failed to open link"))}},readResource:e=>m(m4,{uri:e}),sendMessage:e=>m(m3,e),updateModelContext:e=>m(m9,e),async logMessage(e){h(m5,e)},async notifySizeChanged(e){h(m8,e)},getState:()=>s,getHostContext:()=>s.hostContext,getHostCapabilities:()=>s.hostCapabilities,isConnected:()=>s.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()}}}}C().config()})(),n})());
|
|
78
|
+
`,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(mz(e,r,i)){let t=32===e.charCodeAt(r+5)?r+6:r+5,a=e.slice(t,o);u=0===d?a:`${u}
|
|
79
|
+
${a}`,d++;return}if(mL(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);t.includes("\0")||(c=t);return}if(58===i){a&&a(e.slice(r,o).slice(32===e.charCodeAt(r+1)?2:1));return}let n=e.slice(r,o),s=n.indexOf(":");if(-1===s)return void g(n,"",n);let l=n.slice(0,s),f=32===n.charCodeAt(s+1)?2:1;g(l,n.slice(s+f),n)}function g(e,t,a){switch(e){case"event":p=t||void 0;break;case"data":u=0===d?t:`${u}
|
|
80
|
+
${t}`,d++;break;case"id":t.includes("\0")||(c=t);break;case"retry":/^\d+$/.test(t)?o(parseInt(t,10)):r(new mM(`Invalid \`retry\` value: "${t}"`,{type:"invalid-retry",value:t,line:a}));break;default:r(new mM(`Unknown field "${e.length>20?`${e.slice(0,20)}…`:e}"`,{type:"unknown-field",field:e,value:t,line:a}))}}return{feed:function(e){if(f)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===n.length){let t=m(e);""!==t&&(n.push(t),s=t.length),h();return}if(-1===e.indexOf(`
|
|
81
|
+
`)&&-1===e.indexOf("\r")){n.push(e),s+=e.length,h();return}n.push(e);let t=n.join("");n.length=0,s=0;let r=m(t);""!==r&&(n.push(r),s=r.length),h()},reset:function(e={}){if(e.consume&&n.length>0){let e=n.join("");y(e,0,e.length)}l=!0,c=void 0,u="",d=0,p=void 0,n.length=0,s=0,f=!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)}})}}(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return dw(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 dw(this,e)}constructor(e,t,r){super(`SSE error: ${t}`),this.code=e,this.event=r,d$(this,new.target)}});let mU={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},mV=new Set(["authorization","dpop","content-type","mcp-protocol-version","mcp-method","mcp-name","mcp-session-id"]);function mF(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 mH=class{_abortController;_url;_resourceMetadataUrl;_scope;_requestInit;_authProvider;_oauthProvider;_skipIssuerMetadataValidation;_fetch;_fetchWithInit;_redirectPolicy;_sessionId;_reconnectionOptions;_protocolVersion;_onInsufficientScope;_maxStepUpRetries;_serverRetryMs;_reconnectionScheduler;_cancelReconnection;onclose;onerror;onmessage;hasPerRequestStream=!0;constructor(e,t){var r,o,a,i,n;let s;if(this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._skipIssuerMetadataValidation=t?.skipIssuerMetadataValidation,this._fetch=t?.fetch,null==(r=t?.authProvider)?1:"function"!=typeof r.tokens||"function"!=typeof r.clientInformation)this._authProvider=t?.authProvider;else{let e,r;this._oauthProvider=t.authProvider,this._authProvider=(o=t.authProvider,a={skipIssuerMetadataValidation:t.skipIssuerMetadataValidation},{token:async()=>(await o.tokens())?.access_token,onUnauthorized:async e=>(async function(e,t,r){let{resourceMetadataUrl:o,scope:a}=mi(t.response);if(await mr(e,{serverUrl:t.serverUrl,resourceMetadataUrl:o,scope:a,fetchFn:t.fetchFn,...r})!=="AUTHORIZED")throw new h9})(o,e,a)}),t.authProvider.dpop&&(this._fetch=(i=t.authProvider,e=async()=>{try{return await i.dpop?.()}catch(e){throw mb(e)}},r=async()=>{let e;try{e=await i.tokens()}catch(e){throw mb(e)}return e?.token_type?.toLowerCase()==="dpop"?e.access_token:void 0},t=>{let o="function"==typeof e?e:()=>e;return async(e,a)=>{let i=(a?.method??"GET").toUpperCase(),n=new URL(e.toString()),s=await o();if(!s)return t(e,a);let l=async()=>{let o=await r();if(!o)return t(e,a);let l=new Headers(a?.headers),c=await s.buildProof({htm:i,htu:n,accessToken:o});return l.set("Authorization",`DPoP ${o}`),l.set("DPoP",c),t(e,{...a,headers:l})},c=await l();return function(e){var t;if(401!==e.status)return!1;let r=e.headers.get("www-authenticate")??"";return t=r,/(?:^|,)\s*dpop(?:\s|$|,)/i.test(t)&&/use_dpop_nonce/i.test(r)}(c)&&c.headers.has("dpop-nonce")&&(s.observeNonce(c,n),await c.text?.().catch(()=>{}),c=await l()),s.observeNonce(c,n),c}})(t.fetch??fetch))}this._redirectPolicy=t?.redirectPolicy,this._fetchWithInit=function(e=fetch,t){return t?async(r,o)=>e(r,{...t,...o,headers:o?.headers?{...p7(t.headers),...p7(o.headers)}:t.headers}):e}(t?.fetch,t?.requestInit),"follow"===this._redirectPolicy&&(this._fetchWithInit=(n=this._fetchWithInit,s=(e,t)=>n(e,t),fr.add(s),s)),this._sessionId=t?.sessionId,this._protocolVersion=t?.protocolVersion,this._reconnectionOptions=t?.reconnectionOptions??mU,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 mb(e)}}async _stepUpAuthorizeInner(e,t){if("throw"===this._onInsufficientScope||!this._oauthProvider)throw new h0({requiredScope:e.scope,resourceMetadataUrl:e.resourceMetadataUrl,errorDescription:e.errorDescription});if(t>=this._maxStepUpRetries)throw new dk(dP.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=h4(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 mr(this._oauthProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:o,forceReauthorization:a,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})}_redirects(e){return"follow"===this._redirectPolicy?e:fo(e)}_unfollowedRedirect(e,t){let r="follow"===this._redirectPolicy?void 0:function(e,t){if("opaqueredirect"===t.type)return"Redirect not followed: this runtime does not expose where it points";let r=ft(t.url||e,t);if(r)return(r.username=r.password=r.search=r.hash="","http:"===r.protocol&&"https:"===new URL(t.url||e).protocol)?(r.protocol="https:",`Redirect from https to plain http not followed; try ${r.href} as the endpoint`):`Redirect to ${r.href} not followed; use that URL as the endpoint if it is the intended server`}(e,t);return r&&`${r} (redirectPolicy: 'same-origin')`}async _commonHeaders(){let e,t=new Headers(this._requestInit?.headers||void 0);try{e=await this._authProvider?.token()}catch(e){throw mb(e)}return e&&t.set("Authorization",`Bearer ${e}`),this._sessionId&&t.set("mcp-session-id",this._sessionId),this._protocolVersion&&t.set("mcp-protocol-version",this._protocolVersion),t}_applyBodyDerivedHeaders(e,t){let r;if(Array.isArray(t)||(r=t,!ng.safeParse(r).success))return;let o=t.params?._meta?.[i5];if("string"!=typeof o)return;e.set("mcp-protocol-version",o),e.set("mcp-method",t.method);let a=function(e,t){var r;let o=Object.hasOwn(pN,e)?pN[e]:void 0;if(void 0===o)return;let a=null===(r=t)||"object"!=typeof r||Array.isArray(r)?void 0:t[o];return{field:o,value:"string"==typeof a?a:void 0}}(t.method,t.params);a?.value!==void 0&&e.set("mcp-name",pI(a.value))}_isModernEnvelopedRequest(e){let t;if(Array.isArray(e)||(t=e,!ng.safeParse(t).success))return!1;let r=e.params?._meta?.[i5];return"string"==typeof r&&r>=dT}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(),n=[...i.get("accept")?.split(",").map(e=>e.trim().toLowerCase())??[],"text/event-stream"];i.set("accept",[...new Set(n)].join(", ")),o&&i.set("last-event-id",o);let s=this._abortController?.signal,l=void 0!==a&&void 0!==s?mF(s,a):a??s,c=await this._redirects(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}=mi(c);this._resourceMetadataUrl=e,this._scope=h4(this._scope,t)}if(this._authProvider.onUnauthorized&&!t){try{await this._authProvider.onUnauthorized({response:c,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw mb(e)}return await c.text?.().catch(()=>{}),this._startOrAuthSse(e,!0,r)}if(await c.text?.().catch(()=>{}),t)throw mb(new dk(dP.ClientHttpAuthentication,"Server returned 401 after re-authentication",{status:401,statusText:c.statusText}));throw mb(new h9)}if(403===c.status){let{resourceMetadataUrl:o,scope:a,error:i,errorDescription:n}=mi(c);if("insufficient_scope"===i){let i=await c.text?.().catch(()=>null);if(await this._stepUpAuthorize({scope:a,resourceMetadataUrl:o,errorDescription:n,statusText:c.statusText,text:i},r)!=="AUTHORIZED")throw mb(new h9);return this._startOrAuthSse(e,t,r+1)}}if(await c.text?.().catch(()=>{}),405===c.status)return void e.onRequestStreamEnd?.();let o=this._unfollowedRedirect(this._url,c)??c.statusText;throw new dk(dP.ClientHttpFailedToOpenStream,`Failed to open SSE stream: ${o}`,{status:c.status,statusText:c.statusText})}this._handleSseStream(c.body,e,!0)}catch(e){throw i()||this.onerror?.(e),e}}_getNextReconnectionDelay(e){if(void 0!==this._serverRetryMs)return this._serverRetryMs;let t=this._reconnectionOptions.initialReconnectionDelay,r=this._reconnectionOptions.reconnectionDelayGrowFactor;return Math.min(t*Math.pow(r,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:n,onRequestStreamEnd:s}=t,l=()=>this._abortController?.signal.aborted===!0||n?.aborted===!0,c=!1,u=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new mD({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=nS.parse(JSON.parse(e.data));(p$(t)||pw(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:n,onRequestStreamEnd:s},0):l()||s?.()}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:n,onRequestStreamEnd:s},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`)),s?.()}else s?.()}})()}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 h9("finishAuth requires an OAuthClientProvider");let{authorizationCode:r,iss:o}=await async function(e,t,r,o,a){if("string"==typeof e)return{authorizationCode:e,iss:t};let i=e.get("iss")??void 0,n=e.get("code");if(n)return{authorizationCode:n,iss:i};let s=(await r.discoveryState?.())?.authorizationServerMetadata;if(!s)try{s=(await md(o,a)).authorizationServerMetadata}catch{s=void 0}if(!s)throw new h9("Authorization callback failed and the issuer could not be verified");h5({iss:i,expectedIssuer:s.issuer,issParameterSupported:h3(s)});let l=e.get("error");if(l)throw new dR(l,e.get("error_description")??l,e.get("error_uri")??void 0);throw new h9("Authorization callback contained neither `code` nor `error`")}(e,t,this._oauthProvider,this._url,{fetchFn:this._fetchWithInit,resourceMetadataUrl:this._resourceMetadataUrl});if(await mr(this._oauthProvider,{serverUrl:this._url,authorizationCode:r,iss:o,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})!=="AUTHORIZED")throw new h9("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 a,{resumptionToken:i,onresumptiontoken:n}=t||{};if(i){let r;return void this._startOrAuthSse({resumptionToken:i,replayMessageId:(r=e,ng.safeParse(r).success)?e.id:void 0,requestSignal:t?.requestSignal}).catch(e=>this.onerror?.(e))}let s=await this._commonHeaders();this._applyBodyDerivedHeaders(s,e);let l=Array.isArray(e)?e.some(e=>{let t;return t=e,nM.safeParse(t).success}):(a=e,nM.safeParse(a).success);if(l&&s.delete("mcp-session-id"),t?.headers!==void 0)for(let[e,r]of Object.entries(t.headers))mV.has(e.toLowerCase())||s.set(e,r);s.set("content-type","application/json");let c=[...s.get("accept")?.split(",").map(e=>e.trim().toLowerCase())??[],"application/json","text/event-stream"];s.set("accept",[...new Set(c)].join(", "));let u=this._abortController?.signal,d=t?.requestSignal!==void 0&&void 0!==u?mF(u,t.requestSignal):t?.requestSignal??u,p={...this._requestInit,method:"POST",headers:s,body:JSON.stringify(e),signal:d},f=await this._redirects(this._fetch??fetch)(this._url,p);if(l&&f.ok&&(this._sessionId=f.headers.get("mcp-session-id")||void 0),!f.ok){if(401===f.status&&this._authProvider){if(f.headers.has("www-authenticate")){let{resourceMetadataUrl:e,scope:t}=mi(f);this._resourceMetadataUrl=e,this._scope=h4(this._scope,t)}if(this._authProvider.onUnauthorized&&!r){try{await this._authProvider.onUnauthorized({response:f,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw mb(e)}return await f.text?.().catch(()=>{}),this._send(e,t,!0,o)}if(await f.text?.().catch(()=>{}),r)throw mb(new dk(dP.ClientHttpAuthentication,"Server returned 401 after re-authentication",{status:401,statusText:f.statusText}));throw mb(new h9)}let a=await f.text?.().catch(()=>null);if(403===f.status){let{resourceMetadataUrl:i,scope:n,error:s,errorDescription:l}=mi(f);if("insufficient_scope"===s){if(await this._stepUpAuthorize({scope:n,resourceMetadataUrl:i,errorDescription:l,statusText:f.statusText,text:a},o)!=="AUTHORIZED")throw mb(new h9);return this._send(e,t,r,o+1)}}if(400===f.status&&"string"==typeof a&&this._isModernEnvelopedRequest(e))try{let t=nS.parse(JSON.parse(a)),r=(Array.isArray(e)?e:[e]).filter(e=>{let t;return t=e,ng.safeParse(t).success});if(pw(t)&&r.some(e=>e.id===t.id))return void this.onmessage?.(t)}catch{}let i=this._unfollowedRedirect(this._url,f)??a;throw new dk(dP.ClientHttpNotImplemented,`Error POSTing to endpoint: ${i}`,{status:f.status,statusText:f.statusText,text:a})}if(202===f.status){let t;await f.text?.().catch(()=>{}),t=e,nL.safeParse(t).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),m=f.headers.get("content-type"),y=function(e){if(e)try{return p6.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();if(""===t||e.slice(t.length).includes(","))return;return t}}(m);if(h)if("text/event-stream"===y)this._handleSseStream(f.body,{onresumptiontoken:n,requestSignal:t?.requestSignal,onRequestStreamEnd:t?.onRequestStreamEnd},!1);else if("application/json"===y){let e=await f.json();for(let t of Array.isArray(e)?e.map(e=>nS.parse(e)):[nS.parse(e)])this.onmessage?.(t)}else throw await f.text?.().catch(()=>{}),new dO(dP.ClientHttpUnexpectedContent,`Unexpected content type: ${m}`,{contentType:m});else await f.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._redirects(this._fetch??fetch)(this._url,t);if(await r.text?.().catch(()=>{}),!r.ok&&405!==r.status)throw new dk(dP.ClientHttpFailedToTerminateSession,`Failed to terminate session: ${this._unfollowedRedirect(this._url,r)??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 mK=require("node:stream");var mG=a(6507);let mB="win32"===dr.platform?["APPDATA","COMSPEC","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PATHEXT","PROCESSOR_ARCHITECTURE","PROGRAMDATA","PROGRAMFILES","PROGRAMFILES(X86)","PROGRAMW6432","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","WINDIR"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];var mJ=class{_process;_readBuffer;_serverParams;_stderrStream=null;onclose;onerror;onmessage;constructor(e){this._serverParams=e,this._readBuffer=new p8({maxBufferSize:e.maxBufferSize}),("pipe"===e.stderr||"overlapped"===e.stderr)&&(this._stderrStream=new mK.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=mG(this._serverParams.command,this._serverParams.args??[],{env:{...function(){let e={};for(let t of mB){let r=dr.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"===dr.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 dO(dP.NotConnected,"Not connected");let r=JSON.stringify(e)+"\n";this._process.stdin.write(r)?t():this._process.stdin.once("drain",t)})}};let mZ=e=>"env"in e&&"string"==typeof e.env,mW=e=>{let t={};return e.forEach(e=>{let r=e.name.trim();if(mZ(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},mX=a(8330),mY={name:mX.name,version:mX.version};function mQ(e={}){var t,r,o;let a,i=new mA(mY,{capabilities:(a={},(t=e).sampling&&(a.sampling={}),t.elicitation&&(a.elicitation={form:{},url:{}}),t.roots&&(a.roots={}),a),versionNegotiation:{mode:"auto"}});return r=i,(o=e).sampling&&r.setRequestHandler("sampling/createMessage",o.sampling),o.elicitation&&r.setRequestHandler("elicitation/create",o.elicitation),o.roots&&r.setRequestHandler("roots/list",o.roots),i}async function m0({url:e,headers:t,handlers:r}){let o=mQ(r),a=t?mW(t):{},i=new URL(e),n=new mH(i,{...t?{requestInit:{headers:a}}:{},reconnectionOptions:{maxReconnectionDelay:3e4,initialReconnectionDelay:1e3,reconnectionDelayGrowFactor:1.5,maxRetries:2}});return await o.connect(n),o}async function m1(e){let{onStderrData:t,handlers:r,...o}=e,a=mQ(r),i=new mJ({...o,stderr:o.stderr??"pipe"}),n=i.stderr;if(n){let e=t??(e=>{console.error(`[STDIO MCP Server stderr]: ${e}`)});n.on("data",e)}return await a.connect(i),{client:a,transport:i}}async function m2(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 m9(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 m3(e){try{await e.transport.close(),await e.client.close()}catch(e){throw console.error("Error disconnecting from stdio MCP server:",e),e}}function m5(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 m4="2026-01-26",m6="ui/initialize",m8="ui/notifications/initialized",m7="ui/request-display-mode",ye="ui/open-link",yt="ui/update-model-context",yr="ui/message",yo="notifications/message",ya="resources/read",yi="ui/notifications/host-context-changed",yn="ui/notifications/size-changed";function ys(e){return!!e&&"object"==typeof e}function yl(e,t){return e instanceof Error&&e.message?e.message:t}function yc(e={}){let t=e.targetWindow??("u"<typeof window?null:window),r=e.requestTimeoutMs??15e3,o=e.connectionTimeoutMs??2e3,a=100,i=!1,n=!1,s={isConnected:!!t&&t.parent!==t,hostContext:null,hostCapabilities:null},l=new Set,c=new Map,u=e=>{if(e.isConnected!==s.isConnected||e.hostContext!==s.hostContext||e.hostCapabilities!==s.hostCapabilities)for(let t of(s=e,l))t(s)},d=e=>{var t,r;let o,a=e.hostContext?(t=s.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):s.hostContext;u({isConnected:!0,hostContext:a,hostCapabilities:e.hostCapabilities?{...s.hostCapabilities??{},...e.hostCapabilities}:s.hostCapabilities})},p=e=>{if(!t||e.source!==t.parent||!ys(e.data))return;n=!0,s.isConnected||u({...s,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),ys(r.error)?e.reject(Error("string"==typeof r.error.message?r.error.message:"MCP request failed")):e.resolve(r.result))}1===r.id&&ys(r.result)&&d({hostContext:ys(r.result.hostContext)?r.result.hostContext:void 0,hostCapabilities:ys(r.result.hostCapabilities)?r.result.hostCapabilities:void 0}),r.method===yi&&ys(r.params)&&d({hostContext:r.params}),"ui/hostContextChanged"===r.method&&ys(r.params)&&ys(r.params.hostContext)&&d({hostContext:r.params.hostContext})};t&&(t.addEventListener("message",p),t.parent!==t&&setTimeout(()=>{i||n||s.hostContext||u({...s,isConnected:!1})},o));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 o=f();return new Promise((i,n)=>{let s=a++,l=setTimeout(()=>{c.has(s)&&(c.delete(s),n(Error(`MCP request timed out: ${e}`)))},r);c.set(s,{resolve:i,reject:n,timeoutId:l}),o.parent.postMessage({jsonrpc:"2.0",id:s,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=yl(t,"MCP request failed");if(!/method not found|unknown method/i.test(e))throw t}throw r instanceof Error?r:Error("MCP request failed")};return{callTool:(e,t)=>m("tools/call",{name:e,arguments:t??{}}),requestDisplayMode:e=>y([m7,"ui/requestDisplayMode"],{mode:e}),async openLink(e){try{await y([ye,"ui/openLink"],{url:e})}catch(r){if(!s.isConnected||!t)return void await (async e=>{if(t?.open)return void t.open(e,"_blank","noopener,noreferrer");throw Error("Unable to open link without a browser window")})(e);throw Error(yl(r,"Failed to open link"))}},readResource:e=>m(ya,{uri:e}),sendMessage:e=>m(yr,e),updateModelContext:e=>m(yt,e),async logMessage(e){h(yo,e)},async notifySizeChanged(e){h(yn,e)},getState:()=>s,getHostContext:()=>s.hostContext,getHostCapabilities:()=>s.hostCapabilities,isConnected:()=>s.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()}}}}z().config()})(),exports.HOST_CONTEXT_CHANGED_METHOD=i.HOST_CONTEXT_CHANGED_METHOD,exports.INITIALIZED_METHOD=i.INITIALIZED_METHOD,exports.INITIALIZE_METHOD=i.INITIALIZE_METHOD,exports.LOG_MESSAGE_METHOD=i.LOG_MESSAGE_METHOD,exports.MCP_APPS_PROTOCOL_VERSION=i.MCP_APPS_PROTOCOL_VERSION,exports.OPEN_LINK_METHOD=i.OPEN_LINK_METHOD,exports.REQUEST_DISPLAY_MODE_METHOD=i.REQUEST_DISPLAY_MODE_METHOD,exports.RESOURCES_READ_METHOD=i.RESOURCES_READ_METHOD,exports.SIZE_CHANGED_METHOD=i.SIZE_CHANGED_METHOD,exports.UI_MESSAGE_METHOD=i.UI_MESSAGE_METHOD,exports.UPDATE_MODEL_CONTEXT_METHOD=i.UPDATE_MODEL_CONTEXT_METHOD,exports.UrlElicitationRequiredError=i.UrlElicitationRequiredError,exports.acceptedContent=i.acceptedContent,exports.apiKeyAuthMiddleware=i.apiKeyAuthMiddleware,exports.audio=i.audio,exports.callSTDIOClientTool=i.callSTDIOClientTool,exports.completable=i.completable,exports.createContext=i.createContext,exports.createHTTPClient=i.createHTTPClient,exports.createMcpHostBridge=i.createMcpHostBridge,exports.createRequestStateCodec=i.createRequestStateCodec,exports.createSTDIOClient=i.createSTDIOClient,exports.disconnectSTDIOClient=i.disconnectSTDIOClient,exports.embeddedResource=i.embeddedResource,exports.extractToolNamesFromRequest=i.extractToolNamesFromRequest,exports.getRequestContext=i.getRequestContext,exports.headersToRecord=i.headersToRecord,exports.image=i.image,exports.inputRequired=i.inputRequired,exports.inputResponse=i.inputResponse,exports.isEnvHeader=i.isEnvHeader,exports.isInputRequiredResult=i.isInputRequiredResult,exports.jwtAuthMiddleware=i.jwtAuthMiddleware,exports.listSTDIOClientTools=i.listSTDIOClientTools,i)-1===["HOST_CONTEXT_CHANGED_METHOD","INITIALIZED_METHOD","INITIALIZE_METHOD","LOG_MESSAGE_METHOD","MCP_APPS_PROTOCOL_VERSION","OPEN_LINK_METHOD","REQUEST_DISPLAY_MODE_METHOD","RESOURCES_READ_METHOD","SIZE_CHANGED_METHOD","UI_MESSAGE_METHOD","UPDATE_MODEL_CONTEXT_METHOD","UrlElicitationRequiredError","acceptedContent","apiKeyAuthMiddleware","audio","callSTDIOClientTool","completable","createContext","createHTTPClient","createMcpHostBridge","createRequestStateCodec","createSTDIOClient","disconnectSTDIOClient","embeddedResource","extractToolNamesFromRequest","getRequestContext","headersToRecord","image","inputRequired","inputResponse","isEnvHeader","isInputRequiredResult","jwtAuthMiddleware","listSTDIOClientTools"].indexOf(n)&&(exports[n]=i[n]);Object.defineProperty(exports,"__esModule",{value:!0})})();
|