/home/sylamedg/public_html/wp-content/plugins/elementor/assets/js/packages/editor-mcp/editor-mcp.js
/*! For license information please see editor-mcp.js.LICENSE.txt */
!function(){var r={"./packages/node_modules/ajv/lib/ajv.js":function(r,a,d){"use strict";var h=d("./packages/node_modules/ajv/lib/compile/index.js"),g=d("./packages/node_modules/ajv/lib/compile/resolve.js"),y=d("./packages/node_modules/ajv/lib/cache.js"),_=d("./packages/node_modules/ajv/lib/compile/schema_obj.js"),b=d("./packages/node_modules/fast-json-stable-stringify/index.js"),P=d("./packages/node_modules/ajv/lib/compile/formats.js"),j=d("./packages/node_modules/ajv/lib/compile/rules.js"),Z=d("./packages/node_modules/ajv/lib/data.js"),D=d("./packages/node_modules/ajv/lib/compile/util.js");r.exports=Ajv,Ajv.prototype.validate=function validate(r,a){var d;if("string"==typeof r){if(!(d=this.getSchema(r)))throw new Error('no schema with key or ref "'+r+'"')}else{var h=this._addSchema(r);d=h.validate||this._compile(h)}var g=d(a);!0!==d.$async&&(this.errors=d.errors);return g},Ajv.prototype.compile=function compile(r,a){var d=this._addSchema(r,void 0,a);return d.validate||this._compile(d)},Ajv.prototype.addSchema=function addSchema(r,a,d,h){if(Array.isArray(r)){for(var y=0;y<r.length;y++)this.addSchema(r[y],void 0,d,h);return this}var _=this._getId(r);if(void 0!==_&&"string"!=typeof _)throw new Error("schema id must be string");return checkUnique(this,a=g.normalizeId(a||_)),this._schemas[a]=this._addSchema(r,d,h,!0),this},Ajv.prototype.addMetaSchema=function addMetaSchema(r,a,d){return this.addSchema(r,a,d,!0),this},Ajv.prototype.validateSchema=function validateSchema(r,a){var d=r.$schema;if(void 0!==d&&"string"!=typeof d)throw new Error("$schema must be a string");if(!(d=d||this._opts.defaultMeta||function defaultMeta(r){var a=r._opts.meta;return r._opts.defaultMeta="object"==typeof a?r._getId(a)||a:r.getSchema(z)?z:void 0,r._opts.defaultMeta}(this)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var h=this.validate(d,r);if(!h&&a){var g="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(g);this.logger.error(g)}return h},Ajv.prototype.getSchema=function getSchema(r){var a=_getSchemaObj(this,r);switch(typeof a){case"object":return a.validate||this._compile(a);case"string":return this.getSchema(a);case"undefined":return function _getSchemaFragment(r,a){var d=g.schema.call(r,{schema:{}},a);if(d){var y=d.schema,b=d.root,P=d.baseId,j=h.call(r,y,b,void 0,P);return r._fragments[a]=new _({ref:a,fragment:!0,schema:y,root:b,baseId:P,validate:j}),j}}(this,r)}},Ajv.prototype.removeSchema=function removeSchema(r){if(r instanceof RegExp)return _removeAllSchemas(this,this._schemas,r),_removeAllSchemas(this,this._refs,r),this;switch(typeof r){case"undefined":return _removeAllSchemas(this,this._schemas),_removeAllSchemas(this,this._refs),this._cache.clear(),this;case"string":var a=_getSchemaObj(this,r);return a&&this._cache.del(a.cacheKey),delete this._schemas[r],delete this._refs[r],this;case"object":var d=this._opts.serialize,h=d?d(r):r;this._cache.del(h);var y=this._getId(r);y&&(y=g.normalizeId(y),delete this._schemas[y],delete this._refs[y])}return this},Ajv.prototype.addFormat=function addFormat(r,a){"string"==typeof a&&(a=new RegExp(a));return this._formats[r]=a,this},Ajv.prototype.errorsText=function errorsText(r,a){if(!(r=r||this.errors))return"No errors";for(var d=void 0===(a=a||{}).separator?", ":a.separator,h=void 0===a.dataVar?"data":a.dataVar,g="",y=0;y<r.length;y++){var _=r[y];_&&(g+=h+_.dataPath+" "+_.message+d)}return g.slice(0,-d.length)},Ajv.prototype._addSchema=function _addSchema(r,a,d,h){if("object"!=typeof r&&"boolean"!=typeof r)throw new Error("schema should be object or boolean");var y=this._opts.serialize,b=y?y(r):r,P=this._cache.get(b);if(P)return P;h=h||!1!==this._opts.addUsedSchema;var j=g.normalizeId(this._getId(r));j&&h&&checkUnique(this,j);var Z,D=!1!==this._opts.validateSchema&&!a;D&&!(Z=j&&j==g.normalizeId(r.$schema))&&this.validateSchema(r,!0);var N=g.ids.call(this,r),$=new _({id:j,schema:r,localRefs:N,cacheKey:b,meta:d});"#"!=j[0]&&h&&(this._refs[j]=$);this._cache.put(b,$),D&&Z&&this.validateSchema(r,!0);return $},Ajv.prototype._compile=function _compile(r,a){if(r.compiling)return r.validate=callValidate,callValidate.schema=r.schema,callValidate.errors=null,callValidate.root=a||callValidate,!0===r.schema.$async&&(callValidate.$async=!0),callValidate;var d,g;r.compiling=!0,r.meta&&(d=this._opts,this._opts=this._metaOpts);try{g=h.call(this,r.schema,a,r.localRefs)}catch(a){throw delete r.validate,a}finally{r.compiling=!1,r.meta&&(this._opts=d)}return r.validate=g,r.refs=g.refs,r.refVal=g.refVal,r.root=g.root,g;function callValidate(){var a=r.validate,d=a.apply(this,arguments);return callValidate.errors=a.errors,d}},Ajv.prototype.compileAsync=d("./packages/node_modules/ajv/lib/compile/async.js");var N=d("./packages/node_modules/ajv/lib/keyword.js");Ajv.prototype.addKeyword=N.add,Ajv.prototype.getKeyword=N.get,Ajv.prototype.removeKeyword=N.remove,Ajv.prototype.validateKeyword=N.validate;var $=d("./packages/node_modules/ajv/lib/compile/error_classes.js");Ajv.ValidationError=$.Validation,Ajv.MissingRefError=$.MissingRef,Ajv.$dataMetaSchema=Z;var z="http://json-schema.org/draft-07/schema",L=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],F=["/properties"];function Ajv(r){if(!(this instanceof Ajv))return new Ajv(r);r=this._opts=D.copy(r)||{},function setLogger(r){var a=r._opts.logger;if(!1===a)r.logger={log:noop,warn:noop,error:noop};else{if(void 0===a&&(a=console),!("object"==typeof a&&a.log&&a.warn&&a.error))throw new Error("logger must implement log, warn and error methods");r.logger=a}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=P(r.format),this._cache=r.cache||new y,this._loadingSchemas={},this._compilations=[],this.RULES=j(),this._getId=function chooseGetId(r){switch(r.schemaId){case"auto":return _get$IdOrId;case"id":return _getId;default:return _get$Id}}(r),r.loopRequired=r.loopRequired||1/0,"property"==r.errorDataPath&&(r._errorDataPathProperty=!0),void 0===r.serialize&&(r.serialize=b),this._metaOpts=function getMetaSchemaOptions(r){for(var a=D.copy(r._opts),d=0;d<L.length;d++)delete a[L[d]];return a}(this),r.formats&&function addInitialFormats(r){for(var a in r._opts.formats){var d=r._opts.formats[a];r.addFormat(a,d)}}(this),r.keywords&&function addInitialKeywords(r){for(var a in r._opts.keywords){var d=r._opts.keywords[a];r.addKeyword(a,d)}}(this),function addDefaultMetaSchema(r){var a;r._opts.$data&&(a=d("./packages/node_modules/ajv/lib/refs/data.json"),r.addMetaSchema(a,a.$id,!0));if(!1===r._opts.meta)return;var h=d("./packages/node_modules/ajv/lib/refs/json-schema-draft-07.json");r._opts.$data&&(h=Z(h,F));r.addMetaSchema(h,z,!0),r._refs["http://json-schema.org/schema"]=z}(this),"object"==typeof r.meta&&this.addMetaSchema(r.meta),r.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),function addInitialSchemas(r){var a=r._opts.schemas;if(!a)return;if(Array.isArray(a))r.addSchema(a);else for(var d in a)r.addSchema(a[d],d)}(this)}function _getSchemaObj(r,a){return a=g.normalizeId(a),r._schemas[a]||r._refs[a]||r._fragments[a]}function _removeAllSchemas(r,a,d){for(var h in a){var g=a[h];g.meta||d&&!d.test(h)||(r._cache.del(g.cacheKey),delete a[h])}}function _getId(r){return r.$id&&this.logger.warn("schema $id ignored",r.$id),r.id}function _get$Id(r){return r.id&&this.logger.warn("schema id ignored",r.id),r.$id}function _get$IdOrId(r){if(r.$id&&r.id&&r.$id!=r.id)throw new Error("schema $id is different from id");return r.$id||r.id}function checkUnique(r,a){if(r._schemas[a]||r._refs[a])throw new Error('schema with key or id "'+a+'" already exists')}function noop(){}},"./packages/node_modules/ajv/lib/cache.js":function(r){"use strict";var a=r.exports=function Cache(){this._cache={}};a.prototype.put=function Cache_put(r,a){this._cache[r]=a},a.prototype.get=function Cache_get(r){return this._cache[r]},a.prototype.del=function Cache_del(r){delete this._cache[r]},a.prototype.clear=function Cache_clear(){this._cache={}}},"./packages/node_modules/ajv/lib/compile/async.js":function(r,a,d){"use strict";var h=d("./packages/node_modules/ajv/lib/compile/error_classes.js").MissingRef;r.exports=function compileAsync(r,a,d){var g=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof a&&(d=a,a=void 0);var y=loadMetaSchemaOf(r).then(function(){var d=g._addSchema(r,void 0,a);return d.validate||_compileAsync(d)});d&&y.then(function(r){d(null,r)},d);return y;function loadMetaSchemaOf(r){var a=r.$schema;return a&&!g.getSchema(a)?compileAsync.call(g,{$ref:a},!0):Promise.resolve()}function _compileAsync(r){try{return g._compile(r)}catch(d){if(d instanceof h)return function loadMissingSchema(d){var h=d.missingSchema;if(added(h))throw new Error("Schema "+h+" is loaded but "+d.missingRef+" cannot be resolved");var y=g._loadingSchemas[h];y||(y=g._loadingSchemas[h]=g._opts.loadSchema(h)).then(removePromise,removePromise);return y.then(function(r){if(!added(h))return loadMetaSchemaOf(r).then(function(){added(h)||g.addSchema(r,h,void 0,a)})}).then(function(){return _compileAsync(r)});function removePromise(){delete g._loadingSchemas[h]}function added(r){return g._refs[r]||g._schemas[r]}}(d);throw d}}}},"./packages/node_modules/ajv/lib/compile/error_classes.js":function(r,a,d){"use strict";var h=d("./packages/node_modules/ajv/lib/compile/resolve.js");function MissingRefError(r,a,d){this.message=d||MissingRefError.message(r,a),this.missingRef=h.url(r,a),this.missingSchema=h.normalizeId(h.fullPath(this.missingRef))}function errorSubclass(r){return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}r.exports={Validation:errorSubclass(function ValidationError(r){this.message="validation failed",this.errors=r,this.ajv=this.validation=!0}),MissingRef:errorSubclass(MissingRefError)},MissingRefError.message=function(r,a){return"can't resolve reference "+a+" from id "+r}},"./packages/node_modules/ajv/lib/compile/formats.js":function(r,a,d){"use strict";var h=d("./packages/node_modules/ajv/lib/compile/util.js"),g=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,y=[0,31,28,31,30,31,30,31,31,30,31,30,31],_=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,b=/^(?=.{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,P=/^(?:[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,j=/^(?:(?:[^\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,Z=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,D=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,N=/^(?:\/(?:[^~/]|~0|~1)*)*$/,$=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,z=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function formats(r){return r="full"==r?"full":"fast",h.copy(formats[r])}function date(r){var a=r.match(g);if(!a)return!1;var d=+a[1],h=+a[2],_=+a[3];return h>=1&&h<=12&&_>=1&&_<=(2==h&&function isLeapYear(r){return r%4==0&&(r%100!=0||r%400==0)}(d)?29:y[h])}function time(r,a){var d=r.match(_);if(!d)return!1;var h=d[1],g=d[2],y=d[3],b=d[5];return(h<=23&&g<=59&&y<=59||23==h&&59==g&&60==y)&&(!a||b)}r.exports=formats,formats.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\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,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":j,url:Z,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,hostname:b,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:regex,uuid:D,"json-pointer":N,"json-pointer-uri-fragment":$,"relative-json-pointer":z},formats.full={date:date,time:time,"date-time":function date_time(r){var a=r.split(L);return 2==a.length&&date(a[0])&&time(a[1],!0)},uri:function uri(r){return F.test(r)&&P.test(r)},"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":j,url:Z,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:b,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:regex,uuid:D,"json-pointer":N,"json-pointer-uri-fragment":$,"relative-json-pointer":z};var L=/t|\s/i;var F=/\/|:/;var M=/[^\\]\\Z/;function regex(r){if(M.test(r))return!1;try{return new RegExp(r),!0}catch(r){return!1}}},"./packages/node_modules/ajv/lib/compile/index.js":function(r,a,d){"use strict";var h=d("./packages/node_modules/ajv/lib/compile/resolve.js"),g=d("./packages/node_modules/ajv/lib/compile/util.js"),y=d("./packages/node_modules/ajv/lib/compile/error_classes.js"),_=d("./packages/node_modules/fast-json-stable-stringify/index.js"),b=d("./packages/node_modules/ajv/lib/dotjs/validate.js"),P=g.ucs2length,j=d("./packages/node_modules/fast-deep-equal/index.js"),Z=y.Validation;function checkCompiling(r,a,d){var h=compIndex.call(this,r,a,d);return h>=0?{index:h,compiling:!0}:(h=this._compilations.length,this._compilations[h]={schema:r,root:a,baseId:d},{index:h,compiling:!1})}function endCompiling(r,a,d){var h=compIndex.call(this,r,a,d);h>=0&&this._compilations.splice(h,1)}function compIndex(r,a,d){for(var h=0;h<this._compilations.length;h++){var g=this._compilations[h];if(g.schema==r&&g.root==a&&g.baseId==d)return h}return-1}function patternCode(r,a){return"var pattern"+r+" = new RegExp("+g.toQuotedString(a[r])+");"}function defaultCode(r){return"var default"+r+" = defaults["+r+"];"}function refValCode(r,a){return void 0===a[r]?"":"var refVal"+r+" = refVal["+r+"];"}function customRuleCode(r){return"var customRule"+r+" = customRules["+r+"];"}function vars(r,a){if(!r.length)return"";for(var d="",h=0;h<r.length;h++)d+=a(h,r);return d}r.exports=function compile(r,a,d,D){var N=this,$=this._opts,z=[void 0],L={},F=[],M={},U=[],q={},V=[];a=a||{schema:r,refVal:z,refs:L};var K=checkCompiling.call(this,r,a,D),H=this._compilations[K.index];if(K.compiling)return H.callValidate=function callValidate(){var r=H.validate,a=r.apply(this,arguments);return callValidate.errors=r.errors,a};var B=this._formats,G=this.RULES;try{var ze=localCompile(r,a,d,D);H.validate=ze;var Fe=H.callValidate;return Fe&&(Fe.schema=ze.schema,Fe.errors=null,Fe.refs=ze.refs,Fe.refVal=ze.refVal,Fe.root=ze.root,Fe.$async=ze.$async,$.sourceCode&&(Fe.source=ze.source)),ze}finally{endCompiling.call(this,r,a,D)}function localCompile(r,d,_,D){var M=!d||d&&d.schema==r;if(d.schema!=a.schema)return compile.call(N,r,d,_,D);var q,K=!0===r.$async,H=b({isTop:!0,schema:r,isRoot:M,baseId:D,root:d,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:y.MissingRef,RULES:G,validate:b,util:g,resolve:h,resolveRef:resolveRef,usePattern:usePattern,useDefault:useDefault,useCustomRule:useCustomRule,opts:$,formats:B,logger:N.logger,self:N});H=vars(z,refValCode)+vars(F,patternCode)+vars(U,defaultCode)+vars(V,customRuleCode)+H,$.processCode&&(H=$.processCode(H,r));try{q=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",H)(N,G,B,a,z,U,V,j,P,Z),z[0]=q}catch(r){throw N.logger.error("Error compiling schema, function code:",H),r}return q.schema=r,q.errors=null,q.refs=L,q.refVal=z,q.root=M?q:d,K&&(q.$async=!0),!0===$.sourceCode&&(q.source={code:H,patterns:F,defaults:U}),q}function resolveRef(r,g,y){g=h.url(r,g);var _,b,P=L[g];if(void 0!==P)return resolvedRef(_=z[P],b="refVal["+P+"]");if(!y&&a.refs){var j=a.refs[g];if(void 0!==j)return resolvedRef(_=a.refVal[j],b=addLocalRef(g,_))}b=addLocalRef(g);var Z=h.call(N,localCompile,a,g);if(void 0===Z){var D=d&&d[g];D&&(Z=h.inlineRef(D,$.inlineRefs)?D:compile.call(N,D,a,d,r))}if(void 0!==Z)return function replaceLocalRef(r,a){var d=L[r];z[d]=a}(g,Z),resolvedRef(Z,b);!function removeLocalRef(r){delete L[r]}(g)}function addLocalRef(r,a){var d=z.length;return z[d]=a,L[r]=d,"refVal"+d}function resolvedRef(r,a){return"object"==typeof r||"boolean"==typeof r?{code:a,schema:r,inline:!0}:{code:a,$async:r&&!!r.$async}}function usePattern(r){var a=M[r];return void 0===a&&(a=M[r]=F.length,F[a]=r),"pattern"+a}function useDefault(r){switch(typeof r){case"boolean":case"number":return""+r;case"string":return g.toQuotedString(r);case"object":if(null===r)return"null";var a=_(r),d=q[a];return void 0===d&&(d=q[a]=U.length,U[d]=r),"default"+d}}function useCustomRule(r,a,d,h){if(!1!==N._opts.validateSchema){var g=r.definition.dependencies;if(g&&!g.every(function(r){return Object.prototype.hasOwnProperty.call(d,r)}))throw new Error("parent schema must have all required keywords: "+g.join(","));var y=r.definition.validateSchema;if(y)if(!y(a)){var _="keyword schema is invalid: "+N.errorsText(y.errors);if("log"!=N._opts.validateSchema)throw new Error(_);N.logger.error(_)}}var b,P=r.definition.compile,j=r.definition.inline,Z=r.definition.macro;if(P)b=P.call(N,a,d,h);else if(Z)b=Z.call(N,a,d,h),!1!==$.validateSchema&&N.validateSchema(b,!0);else if(j)b=j.call(N,h,r.keyword,a,d);else if(!(b=r.definition.validate))return;if(void 0===b)throw new Error('custom keyword "'+r.keyword+'"failed to compile');var D=V.length;return V[D]=b,{code:"customRule"+D,validate:b}}}},"./packages/node_modules/ajv/lib/compile/resolve.js":function(r,a,d){"use strict";var h=d("./packages/node_modules/uri-js/dist/es5/uri.all.js"),g=d("./packages/node_modules/fast-deep-equal/index.js"),y=d("./packages/node_modules/ajv/lib/compile/util.js"),_=d("./packages/node_modules/ajv/lib/compile/schema_obj.js"),b=d("./packages/node_modules/json-schema-traverse/index.js");function resolve(r,a,d){var h=this._refs[d];if("string"==typeof h){if(!this._refs[h])return resolve.call(this,r,a,h);h=this._refs[h]}if((h=h||this._schemas[d])instanceof _)return inlineRef(h.schema,this._opts.inlineRefs)?h.schema:h.validate||this._compile(h);var g,y,b,P=resolveSchema.call(this,a,d);return P&&(g=P.schema,a=P.root,b=P.baseId),g instanceof _?y=g.validate||r.call(this,g.schema,a,void 0,b):void 0!==g&&(y=inlineRef(g,this._opts.inlineRefs)?g:r.call(this,g,a,void 0,b)),y}function resolveSchema(r,a){var d=h.parse(a),g=_getFullPath(d),y=getFullPath(this._getId(r.schema));if(0===Object.keys(r.schema).length||g!==y){var b=normalizeId(g),P=this._refs[b];if("string"==typeof P)return resolveRecursive.call(this,r,P,d);if(P instanceof _)P.validate||this._compile(P),r=P;else{if(!((P=this._schemas[b])instanceof _))return;if(P.validate||this._compile(P),b==normalizeId(a))return{schema:P,root:r,baseId:y};r=P}if(!r.schema)return;y=getFullPath(this._getId(r.schema))}return getJsonPointer.call(this,d,y,r.schema,r)}function resolveRecursive(r,a,d){var h=resolveSchema.call(this,r,a);if(h){var g=h.schema,y=h.baseId;r=h.root;var _=this._getId(g);return _&&(y=resolveUrl(y,_)),getJsonPointer.call(this,d,y,g,r)}}r.exports=resolve,resolve.normalizeId=normalizeId,resolve.fullPath=getFullPath,resolve.url=resolveUrl,resolve.ids=function resolveIds(r){var a=normalizeId(this._getId(r)),d={"":a},_={"":getFullPath(a,!1)},P={},j=this;return b(r,{allKeys:!0},function(r,a,b,Z,D,N,$){if(""!==a){var z=j._getId(r),L=d[Z],F=_[Z]+"/"+D;if(void 0!==$&&(F+="/"+("number"==typeof $?$:y.escapeFragment($))),"string"==typeof z){z=L=normalizeId(L?h.resolve(L,z):z);var M=j._refs[z];if("string"==typeof M&&(M=j._refs[M]),M&&M.schema){if(!g(r,M.schema))throw new Error('id "'+z+'" resolves to more than one schema')}else if(z!=normalizeId(F))if("#"==z[0]){if(P[z]&&!g(r,P[z]))throw new Error('id "'+z+'" resolves to more than one schema');P[z]=r}else j._refs[z]=F}d[a]=L,_[a]=F}}),P},resolve.inlineRef=inlineRef,resolve.schema=resolveSchema;var P=y.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(r,a,d,h){if(r.fragment=r.fragment||"","/"==r.fragment.slice(0,1)){for(var g=r.fragment.split("/"),_=1;_<g.length;_++){var b=g[_];if(b){if(void 0===(d=d[b=y.unescapeFragment(b)]))break;var j;if(!P[b]&&((j=this._getId(d))&&(a=resolveUrl(a,j)),d.$ref)){var Z=resolveUrl(a,d.$ref),D=resolveSchema.call(this,h,Z);D&&(d=D.schema,h=D.root,a=D.baseId)}}}return void 0!==d&&d!==h.schema?{schema:d,root:h,baseId:a}:void 0}}var j=y.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function inlineRef(r,a){return!1!==a&&(void 0===a||!0===a?checkNoRef(r):a?countKeys(r)<=a:void 0)}function checkNoRef(r){var a;if(Array.isArray(r)){for(var d=0;d<r.length;d++)if("object"==typeof(a=r[d])&&!checkNoRef(a))return!1}else for(var h in r){if("$ref"==h)return!1;if("object"==typeof(a=r[h])&&!checkNoRef(a))return!1}return!0}function countKeys(r){var a,d=0;if(Array.isArray(r)){for(var h=0;h<r.length;h++)if("object"==typeof(a=r[h])&&(d+=countKeys(a)),d==1/0)return 1/0}else for(var g in r){if("$ref"==g)return 1/0;if(j[g])d++;else if("object"==typeof(a=r[g])&&(d+=countKeys(a)+1),d==1/0)return 1/0}return d}function getFullPath(r,a){return!1!==a&&(r=normalizeId(r)),_getFullPath(h.parse(r))}function _getFullPath(r){return h.serialize(r).split("#")[0]+"#"}var Z=/#\/?$/;function normalizeId(r){return r?r.replace(Z,""):""}function resolveUrl(r,a){return a=normalizeId(a),h.resolve(r,a)}},"./packages/node_modules/ajv/lib/compile/rules.js":function(r,a,d){"use strict";var h=d("./packages/node_modules/ajv/lib/dotjs/index.js"),g=d("./packages/node_modules/ajv/lib/compile/util.js").toHash;r.exports=function rules(){var r=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],a=["type","$comment"];return r.all=g(a),r.types=g(["number","integer","string","array","object","boolean","null"]),r.forEach(function(d){d.rules=d.rules.map(function(d){var g;if("object"==typeof d){var y=Object.keys(d)[0];g=d[y],d=y,g.forEach(function(d){a.push(d),r.all[d]=!0})}return a.push(d),r.all[d]={keyword:d,code:h[d],implements:g}}),r.all.$comment={keyword:"$comment",code:h.$comment},d.type&&(r.types[d.type]=d)}),r.keywords=g(a.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),r.custom={},r}},"./packages/node_modules/ajv/lib/compile/schema_obj.js":function(r,a,d){"use strict";var h=d("./packages/node_modules/ajv/lib/compile/util.js");r.exports=function SchemaObject(r){h.copy(r,this)}},"./packages/node_modules/ajv/lib/compile/ucs2length.js":function(r){"use strict";r.exports=function ucs2length(r){for(var a,d=0,h=r.length,g=0;g<h;)d++,(a=r.charCodeAt(g++))>=55296&&a<=56319&&g<h&&56320==(64512&(a=r.charCodeAt(g)))&&g++;return d}},"./packages/node_modules/ajv/lib/compile/util.js":function(r,a,d){"use strict";function checkDataType(r,a,d,h){var g=h?" !== ":" === ",y=h?" || ":" && ",_=h?"!":"",b=h?"":"!";switch(r){case"null":return a+g+"null";case"array":return _+"Array.isArray("+a+")";case"object":return"("+_+a+y+"typeof "+a+g+'"object"'+y+b+"Array.isArray("+a+"))";case"integer":return"(typeof "+a+g+'"number"'+y+b+"("+a+" % 1)"+y+a+g+a+(d?y+_+"isFinite("+a+")":"")+")";case"number":return"(typeof "+a+g+'"'+r+'"'+(d?y+_+"isFinite("+a+")":"")+")";default:return"typeof "+a+g+'"'+r+'"'}}r.exports={copy:function copy(r,a){for(var d in a=a||{},r)a[d]=r[d];return a},checkDataType:checkDataType,checkDataTypes:function checkDataTypes(r,a,d){if(1===r.length)return checkDataType(r[0],a,d,!0);var h="",g=toHash(r);for(var y in g.array&&g.object&&(h=g.null?"(":"(!"+a+" || ",h+="typeof "+a+' !== "object")',delete g.null,delete g.array,delete g.object),g.number&&delete g.integer,g)h+=(h?" && ":"")+checkDataType(y,a,d,!0);return h},coerceToTypes:function coerceToTypes(r,a){if(Array.isArray(a)){for(var d=[],g=0;g<a.length;g++){var y=a[g];(h[y]||"array"===r&&"array"===y)&&(d[d.length]=y)}if(d.length)return d}else{if(h[a])return[a];if("array"===r&&"array"===a)return["array"]}},toHash:toHash,getProperty:getProperty,escapeQuotes:escapeQuotes,equal:d("./packages/node_modules/fast-deep-equal/index.js"),ucs2length:d("./packages/node_modules/ajv/lib/compile/ucs2length.js"),varOccurences:function varOccurences(r,a){a+="[^0-9]";var d=r.match(new RegExp(a,"g"));return d?d.length:0},varReplace:function varReplace(r,a,d){return a+="([^0-9])",d=d.replace(/\$/g,"$$$$"),r.replace(new RegExp(a,"g"),d+"$1")},schemaHasRules:function schemaHasRules(r,a){if("boolean"==typeof r)return!r;for(var d in r)if(a[d])return!0},schemaHasRulesExcept:function schemaHasRulesExcept(r,a,d){if("boolean"==typeof r)return!r&&"not"!=d;for(var h in r)if(h!=d&&a[h])return!0},schemaUnknownRules:function schemaUnknownRules(r,a){if("boolean"==typeof r)return;for(var d in r)if(!a[d])return d},toQuotedString:toQuotedString,getPathExpr:function getPathExpr(r,a,d,h){return joinPaths(r,d?"'/' + "+a+(h?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):h?"'[' + "+a+" + ']'":"'[\\'' + "+a+" + '\\']'")},getPath:function getPath(r,a,d){var h=toQuotedString(d?"/"+escapeJsonPointer(a):getProperty(a));return joinPaths(r,h)},getData:function getData(r,a,d){var h,g,y,P;if(""===r)return"rootData";if("/"==r[0]){if(!_.test(r))throw new Error("Invalid JSON-pointer: "+r);g=r,y="rootData"}else{if(!(P=r.match(b)))throw new Error("Invalid JSON-pointer: "+r);if(h=+P[1],"#"==(g=P[2])){if(h>=a)throw new Error("Cannot access property/index "+h+" levels up, current level is "+a);return d[a-h]}if(h>a)throw new Error("Cannot access data "+h+" levels up, current level is "+a);if(y="data"+(a-h||""),!g)return y}for(var j=y,Z=g.split("/"),D=0;D<Z.length;D++){var N=Z[D];N&&(j+=" && "+(y+=getProperty(unescapeJsonPointer(N))))}return j},unescapeFragment:function unescapeFragment(r){return unescapeJsonPointer(decodeURIComponent(r))},unescapeJsonPointer:unescapeJsonPointer,escapeFragment:function escapeFragment(r){return encodeURIComponent(escapeJsonPointer(r))},escapeJsonPointer:escapeJsonPointer};var h=toHash(["string","number","integer","boolean","null"]);function toHash(r){for(var a={},d=0;d<r.length;d++)a[r[d]]=!0;return a}var g=/^[a-z$_][a-z$_0-9]*$/i,y=/'|\\/g;function getProperty(r){return"number"==typeof r?"["+r+"]":g.test(r)?"."+r:"['"+escapeQuotes(r)+"']"}function escapeQuotes(r){return r.replace(y,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function toQuotedString(r){return"'"+escapeQuotes(r)+"'"}var _=/^\/(?:[^~]|~0|~1)*$/,b=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function joinPaths(r,a){return'""'==r?a:(r+" + "+a).replace(/([^\\])' \+ '/g,"$1")}function escapeJsonPointer(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}function unescapeJsonPointer(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}},"./packages/node_modules/ajv/lib/data.js":function(r){"use strict";var a=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];r.exports=function(r,d){for(var h=0;h<d.length;h++){r=JSON.parse(JSON.stringify(r));var g,y=d[h].split("/"),_=r;for(g=1;g<y.length;g++)_=_[y[g]];for(g=0;g<a.length;g++){var b=a[g],P=_[b];P&&(_[b]={anyOf:[P,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return r}},"./packages/node_modules/ajv/lib/definition_schema.js":function(r,a,d){"use strict";var h=d("./packages/node_modules/ajv/lib/refs/json-schema-draft-07.json");r.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:h.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:h.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},"./packages/node_modules/ajv/lib/dotjs/_limit.js":function(r){"use strict";r.exports=function generate__limit(r,a,d){var h,g=" ",y=r.level,_=r.dataLevel,b=r.schema[a],P=r.schemaPath+r.util.getProperty(a),j=r.errSchemaPath+"/"+a,Z=!r.opts.allErrors,D="data"+(_||""),N=r.opts.$data&&b&&b.$data;N?(g+=" var schema"+y+" = "+r.util.getData(b.$data,_,r.dataPathArr)+"; ",h="schema"+y):h=b;var $="maximum"==a,z=$?"exclusiveMaximum":"exclusiveMinimum",L=r.schema[z],F=r.opts.$data&&L&&L.$data,M=$?"<":">",U=$?">":"<",q=void 0;if(!N&&"number"!=typeof b&&void 0!==b)throw new Error(a+" must be number");if(!F&&void 0!==L&&"number"!=typeof L&&"boolean"!=typeof L)throw new Error(z+" must be number or boolean");if(F){var V=r.util.getData(L.$data,_,r.dataPathArr),K="exclusive"+y,H="exclType"+y,B="exclIsNumber"+y,G="' + "+(Ue="op"+y)+" + '";g+=" var schemaExcl"+y+" = "+V+"; ",g+=" var "+K+"; var "+H+" = typeof "+(V="schemaExcl"+y)+"; if ("+H+" != 'boolean' && "+H+" != 'undefined' && "+H+" != 'number') { ";var ze;q=z;(ze=ze||[]).push(g),g="",!1!==r.createErrors?(g+=" { keyword: '"+(q||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(j)+" , params: {} ",!1!==r.opts.messages&&(g+=" , message: '"+z+" should be boolean' "),r.opts.verbose&&(g+=" , schema: validate.schema"+P+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+D+" "),g+=" } "):g+=" {} ";var Fe=g;g=ze.pop(),!r.compositeRule&&Z?r.async?g+=" throw new ValidationError(["+Fe+"]); ":g+=" validate.errors = ["+Fe+"]; return false; ":g+=" var err = "+Fe+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+=" } else if ( ",N&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),g+=" "+H+" == 'number' ? ( ("+K+" = "+h+" === undefined || "+V+" "+M+"= "+h+") ? "+D+" "+U+"= "+V+" : "+D+" "+U+" "+h+" ) : ( ("+K+" = "+V+" === true) ? "+D+" "+U+"= "+h+" : "+D+" "+U+" "+h+" ) || "+D+" !== "+D+") { var op"+y+" = "+K+" ? '"+M+"' : '"+M+"='; ",void 0===b&&(q=z,j=r.errSchemaPath+"/"+z,h=V,N=F)}else{G=M;if((B="number"==typeof L)&&N){var Ue="'"+G+"'";g+=" if ( ",N&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),g+=" ( "+h+" === undefined || "+L+" "+M+"= "+h+" ? "+D+" "+U+"= "+L+" : "+D+" "+U+" "+h+" ) || "+D+" !== "+D+") { "}else{B&&void 0===b?(K=!0,q=z,j=r.errSchemaPath+"/"+z,h=L,U+="="):(B&&(h=Math[$?"min":"max"](L,b)),L===(!B||h)?(K=!0,q=z,j=r.errSchemaPath+"/"+z,U+="="):(K=!1,G+="="));Ue="'"+G+"'";g+=" if ( ",N&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),g+=" "+D+" "+U+" "+h+" || "+D+" !== "+D+") { "}}q=q||a,(ze=ze||[]).push(g),g="",!1!==r.createErrors?(g+=" { keyword: '"+(q||"_limit")+"' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(j)+" , params: { comparison: "+Ue+", limit: "+h+", exclusive: "+K+" } ",!1!==r.opts.messages&&(g+=" , message: 'should be "+G+" ",g+=N?"' + "+h:h+"'"),r.opts.verbose&&(g+=" , schema: ",g+=N?"validate.schema"+P:""+b,g+=" , parentSchema: validate.schema"+r.schemaPath+" , data: "+D+" "),g+=" } "):g+=" {} ";Fe=g;return g=ze.pop(),!r.compositeRule&&Z?r.async?g+=" throw new ValidationError(["+Fe+"]); ":g+=" validate.errors = ["+Fe+"]; return false; ":g+=" var err = "+Fe+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+=" } ",Z&&(g+=" else { "),g}},"./packages/node_modules/ajv/lib/dotjs/_limitItems.js":function(r){"use strict";r.exports=function generate__limitItems(r,a,d){var h,g=" ",y=r.level,_=r.dataLevel,b=r.schema[a],P=r.schemaPath+r.util.getProperty(a),j=r.errSchemaPath+"/"+a,Z=!r.opts.allErrors,D="data"+(_||""),N=r.opts.$data&&b&&b.$data;if(N?(g+=" var schema"+y+" = "+r.util.getData(b.$data,_,r.dataPathArr)+"; ",h="schema"+y):h=b,!N&&"number"!=typeof b)throw new Error(a+" must be number");g+="if ( ",N&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),g+=" "+D+".length "+("maxItems"==a?">":"<")+" "+h+") { ";var $=a,z=z||[];z.push(g),g="",!1!==r.createErrors?(g+=" { keyword: '"+($||"_limitItems")+"' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(j)+" , params: { limit: "+h+" } ",!1!==r.opts.messages&&(g+=" , message: 'should NOT have ",g+="maxItems"==a?"more":"fewer",g+=" than ",g+=N?"' + "+h+" + '":""+b,g+=" items' "),r.opts.verbose&&(g+=" , schema: ",g+=N?"validate.schema"+P:""+b,g+=" , parentSchema: validate.schema"+r.schemaPath+" , data: "+D+" "),g+=" } "):g+=" {} ";var L=g;return g=z.pop(),!r.compositeRule&&Z?r.async?g+=" throw new ValidationError(["+L+"]); ":g+=" validate.errors = ["+L+"]; return false; ":g+=" var err = "+L+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+="} ",Z&&(g+=" else { "),g}},"./packages/node_modules/ajv/lib/dotjs/_limitLength.js":function(r){"use strict";r.exports=function generate__limitLength(r,a,d){var h,g=" ",y=r.level,_=r.dataLevel,b=r.schema[a],P=r.schemaPath+r.util.getProperty(a),j=r.errSchemaPath+"/"+a,Z=!r.opts.allErrors,D="data"+(_||""),N=r.opts.$data&&b&&b.$data;if(N?(g+=" var schema"+y+" = "+r.util.getData(b.$data,_,r.dataPathArr)+"; ",h="schema"+y):h=b,!N&&"number"!=typeof b)throw new Error(a+" must be number");var $="maxLength"==a?">":"<";g+="if ( ",N&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),!1===r.opts.unicode?g+=" "+D+".length ":g+=" ucs2length("+D+") ",g+=" "+$+" "+h+") { ";var z=a,L=L||[];L.push(g),g="",!1!==r.createErrors?(g+=" { keyword: '"+(z||"_limitLength")+"' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(j)+" , params: { limit: "+h+" } ",!1!==r.opts.messages&&(g+=" , message: 'should NOT be ",g+="maxLength"==a?"longer":"shorter",g+=" than ",g+=N?"' + "+h+" + '":""+b,g+=" characters' "),r.opts.verbose&&(g+=" , schema: ",g+=N?"validate.schema"+P:""+b,g+=" , parentSchema: validate.schema"+r.schemaPath+" , data: "+D+" "),g+=" } "):g+=" {} ";var F=g;return g=L.pop(),!r.compositeRule&&Z?r.async?g+=" throw new ValidationError(["+F+"]); ":g+=" validate.errors = ["+F+"]; return false; ":g+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+="} ",Z&&(g+=" else { "),g}},"./packages/node_modules/ajv/lib/dotjs/_limitProperties.js":function(r){"use strict";r.exports=function generate__limitProperties(r,a,d){var h,g=" ",y=r.level,_=r.dataLevel,b=r.schema[a],P=r.schemaPath+r.util.getProperty(a),j=r.errSchemaPath+"/"+a,Z=!r.opts.allErrors,D="data"+(_||""),N=r.opts.$data&&b&&b.$data;if(N?(g+=" var schema"+y+" = "+r.util.getData(b.$data,_,r.dataPathArr)+"; ",h="schema"+y):h=b,!N&&"number"!=typeof b)throw new Error(a+" must be number");g+="if ( ",N&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),g+=" Object.keys("+D+").length "+("maxProperties"==a?">":"<")+" "+h+") { ";var $=a,z=z||[];z.push(g),g="",!1!==r.createErrors?(g+=" { keyword: '"+($||"_limitProperties")+"' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(j)+" , params: { limit: "+h+" } ",!1!==r.opts.messages&&(g+=" , message: 'should NOT have ",g+="maxProperties"==a?"more":"fewer",g+=" than ",g+=N?"' + "+h+" + '":""+b,g+=" properties' "),r.opts.verbose&&(g+=" , schema: ",g+=N?"validate.schema"+P:""+b,g+=" , parentSchema: validate.schema"+r.schemaPath+" , data: "+D+" "),g+=" } "):g+=" {} ";var L=g;return g=z.pop(),!r.compositeRule&&Z?r.async?g+=" throw new ValidationError(["+L+"]); ":g+=" validate.errors = ["+L+"]; return false; ":g+=" var err = "+L+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+="} ",Z&&(g+=" else { "),g}},"./packages/node_modules/ajv/lib/dotjs/allOf.js":function(r){"use strict";r.exports=function generate_allOf(r,a,d){var h=" ",g=r.schema[a],y=r.schemaPath+r.util.getProperty(a),_=r.errSchemaPath+"/"+a,b=!r.opts.allErrors,P=r.util.copy(r),j="";P.level++;var Z="valid"+P.level,D=P.baseId,N=!0,$=g;if($)for(var z,L=-1,F=$.length-1;L<F;)z=$[L+=1],(r.opts.strictKeywords?"object"==typeof z&&Object.keys(z).length>0||!1===z:r.util.schemaHasRules(z,r.RULES.all))&&(N=!1,P.schema=z,P.schemaPath=y+"["+L+"]",P.errSchemaPath=_+"/"+L,h+=" "+r.validate(P)+" ",P.baseId=D,b&&(h+=" if ("+Z+") { ",j+="}"));return b&&(h+=N?" if (true) { ":" "+j.slice(0,-1)+" "),h}},"./packages/node_modules/ajv/lib/dotjs/anyOf.js":function(r){"use strict";r.exports=function generate_anyOf(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||""),D="valid"+g,N="errs__"+g,$=r.util.copy(r),z="";$.level++;var L="valid"+$.level,F=_.every(function(a){return r.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0||!1===a:r.util.schemaHasRules(a,r.RULES.all)});if(F){var M=$.baseId;h+=" var "+N+" = errors; var "+D+" = false; ";var U=r.compositeRule;r.compositeRule=$.compositeRule=!0;var q=_;if(q)for(var V,K=-1,H=q.length-1;K<H;)V=q[K+=1],$.schema=V,$.schemaPath=b+"["+K+"]",$.errSchemaPath=P+"/"+K,h+=" "+r.validate($)+" ",$.baseId=M,h+=" "+D+" = "+D+" || "+L+"; if (!"+D+") { ",z+="}";r.compositeRule=$.compositeRule=U,h+=" "+z+" if (!"+D+") { var err = ",!1!==r.createErrors?(h+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: {} ",!1!==r.opts.messages&&(h+=" , message: 'should match some schema in anyOf' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ",h+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!r.compositeRule&&j&&(r.async?h+=" throw new ValidationError(vErrors); ":h+=" validate.errors = vErrors; return false; "),h+=" } else { errors = "+N+"; if (vErrors !== null) { if ("+N+") vErrors.length = "+N+"; else vErrors = null; } ",r.opts.allErrors&&(h+=" } ")}else j&&(h+=" if (true) { ");return h}},"./packages/node_modules/ajv/lib/dotjs/comment.js":function(r){"use strict";r.exports=function generate_comment(r,a,d){var h=" ",g=r.schema[a],y=r.errSchemaPath+"/"+a,_=(r.opts.allErrors,r.util.toQuotedString(g));return!0===r.opts.$comment?h+=" console.log("+_+");":"function"==typeof r.opts.$comment&&(h+=" self._opts.$comment("+_+", "+r.util.toQuotedString(y)+", validate.root.schema);"),h}},"./packages/node_modules/ajv/lib/dotjs/const.js":function(r){"use strict";r.exports=function generate_const(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||""),D="valid"+g,N=r.opts.$data&&_&&_.$data;N&&(h+=" var schema"+g+" = "+r.util.getData(_.$data,y,r.dataPathArr)+"; "),N||(h+=" var schema"+g+" = validate.schema"+b+";"),h+="var "+D+" = equal("+Z+", schema"+g+"); if (!"+D+") { ";var $=$||[];$.push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'const' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { allowedValue: schema"+g+" } ",!1!==r.opts.messages&&(h+=" , message: 'should be equal to constant' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var z=h;return h=$.pop(),!r.compositeRule&&j?r.async?h+=" throw new ValidationError(["+z+"]); ":h+=" validate.errors = ["+z+"]; return false; ":h+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" }",j&&(h+=" else { "),h}},"./packages/node_modules/ajv/lib/dotjs/contains.js":function(r){"use strict";r.exports=function generate_contains(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||""),D="valid"+g,N="errs__"+g,$=r.util.copy(r);$.level++;var z="valid"+$.level,L="i"+g,F=$.dataLevel=r.dataLevel+1,M="data"+F,U=r.baseId,q=r.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0||!1===_:r.util.schemaHasRules(_,r.RULES.all);if(h+="var "+N+" = errors;var "+D+";",q){var V=r.compositeRule;r.compositeRule=$.compositeRule=!0,$.schema=_,$.schemaPath=b,$.errSchemaPath=P,h+=" var "+z+" = false; for (var "+L+" = 0; "+L+" < "+Z+".length; "+L+"++) { ",$.errorPath=r.util.getPathExpr(r.errorPath,L,r.opts.jsonPointers,!0);var K=Z+"["+L+"]";$.dataPathArr[F]=L;var H=r.validate($);$.baseId=U,r.util.varOccurences(H,M)<2?h+=" "+r.util.varReplace(H,M,K)+" ":h+=" var "+M+" = "+K+"; "+H+" ",h+=" if ("+z+") break; } ",r.compositeRule=$.compositeRule=V,h+=" if (!"+z+") {"}else h+=" if ("+Z+".length == 0) {";var B=B||[];B.push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: {} ",!1!==r.opts.messages&&(h+=" , message: 'should contain a valid item' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var G=h;return h=B.pop(),!r.compositeRule&&j?r.async?h+=" throw new ValidationError(["+G+"]); ":h+=" validate.errors = ["+G+"]; return false; ":h+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" } else { ",q&&(h+=" errors = "+N+"; if (vErrors !== null) { if ("+N+") vErrors.length = "+N+"; else vErrors = null; } "),r.opts.allErrors&&(h+=" } "),h}},"./packages/node_modules/ajv/lib/dotjs/custom.js":function(r){"use strict";r.exports=function generate_custom(r,a,d){var h,g,y=" ",_=r.level,b=r.dataLevel,P=r.schema[a],j=r.schemaPath+r.util.getProperty(a),Z=r.errSchemaPath+"/"+a,D=!r.opts.allErrors,N="data"+(b||""),$="valid"+_,z="errs__"+_,L=r.opts.$data&&P&&P.$data;L?(y+=" var schema"+_+" = "+r.util.getData(P.$data,b,r.dataPathArr)+"; ",g="schema"+_):g=P;var F,M,U,q,V,K=this,H="definition"+_,B=K.definition,G="";if(L&&B.$data){V="keywordValidate"+_;var ze=B.validateSchema;y+=" var "+H+" = RULES.custom['"+a+"'].definition; var "+V+" = "+H+".validate;"}else{if(!(q=r.useCustomRule(K,P,r.schema,r)))return;g="validate.schema"+j,V=q.code,F=B.compile,M=B.inline,U=B.macro}var Fe=V+".errors",Ue="i"+_,qe="ruleErr"+_,Ve=B.async;if(Ve&&!r.async)throw new Error("async keyword in sync schema");if(M||U||(y+=Fe+" = null;"),y+="var "+z+" = errors;var "+$+";",L&&B.$data&&(G+="}",y+=" if ("+g+" === undefined) { "+$+" = true; } else { ",ze&&(G+="}",y+=" "+$+" = "+H+".validateSchema("+g+"); if ("+$+") { ")),M)B.statements?y+=" "+q.validate+" ":y+=" "+$+" = "+q.validate+"; ";else if(U){var Ke=r.util.copy(r);G="";Ke.level++;var He="valid"+Ke.level;Ke.schema=q.validate,Ke.schemaPath="";var Be=r.compositeRule;r.compositeRule=Ke.compositeRule=!0;var Qe=r.validate(Ke).replace(/validate\.schema/g,V);r.compositeRule=Ke.compositeRule=Be,y+=" "+Qe}else{(Xe=Xe||[]).push(y),y="",y+=" "+V+".call( ",r.opts.passContext?y+="this":y+="self",F||!1===B.schema?y+=" , "+N+" ":y+=" , "+g+" , "+N+" , validate.schema"+r.schemaPath+" ",y+=" , (dataPath || '')",'""'!=r.errorPath&&(y+=" + "+r.errorPath);var Je=b?"data"+(b-1||""):"parentData",We=b?r.dataPathArr[b]:"parentDataProperty",Ye=y+=" , "+Je+" , "+We+" , rootData ) ";y=Xe.pop(),!1===B.errors?(y+=" "+$+" = ",Ve&&(y+="await "),y+=Ye+"; "):y+=Ve?" var "+(Fe="customErrors"+_)+" = null; try { "+$+" = await "+Ye+"; } catch (e) { "+$+" = false; if (e instanceof ValidationError) "+Fe+" = e.errors; else throw e; } ":" "+Fe+" = null; "+$+" = "+Ye+"; "}if(B.modifying&&(y+=" if ("+Je+") "+N+" = "+Je+"["+We+"];"),y+=""+G,B.valid)D&&(y+=" if (true) { ");else{var Xe;y+=" if ( ",void 0===B.valid?(y+=" !",y+=U?""+He:""+$):y+=" "+!B.valid+" ",y+=") { ",h=K.keyword,(Xe=Xe||[]).push(y),y="",(Xe=Xe||[]).push(y),y="",!1!==r.createErrors?(y+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(Z)+" , params: { keyword: '"+K.keyword+"' } ",!1!==r.opts.messages&&(y+=" , message: 'should pass \""+K.keyword+"\" keyword validation' "),r.opts.verbose&&(y+=" , schema: validate.schema"+j+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+N+" "),y+=" } "):y+=" {} ";var et=y;y=Xe.pop(),!r.compositeRule&&D?r.async?y+=" throw new ValidationError(["+et+"]); ":y+=" validate.errors = ["+et+"]; return false; ":y+=" var err = "+et+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var tt=y;y=Xe.pop(),M?B.errors?"full"!=B.errors&&(y+=" for (var "+Ue+"="+z+"; "+Ue+"<errors; "+Ue+"++) { var "+qe+" = vErrors["+Ue+"]; if ("+qe+".dataPath === undefined) "+qe+".dataPath = (dataPath || '') + "+r.errorPath+"; if ("+qe+".schemaPath === undefined) { "+qe+'.schemaPath = "'+Z+'"; } ',r.opts.verbose&&(y+=" "+qe+".schema = "+g+"; "+qe+".data = "+N+"; "),y+=" } "):!1===B.errors?y+=" "+tt+" ":(y+=" if ("+z+" == errors) { "+tt+" } else { for (var "+Ue+"="+z+"; "+Ue+"<errors; "+Ue+"++) { var "+qe+" = vErrors["+Ue+"]; if ("+qe+".dataPath === undefined) "+qe+".dataPath = (dataPath || '') + "+r.errorPath+"; if ("+qe+".schemaPath === undefined) { "+qe+'.schemaPath = "'+Z+'"; } ',r.opts.verbose&&(y+=" "+qe+".schema = "+g+"; "+qe+".data = "+N+"; "),y+=" } } "):U?(y+=" var err = ",!1!==r.createErrors?(y+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(Z)+" , params: { keyword: '"+K.keyword+"' } ",!1!==r.opts.messages&&(y+=" , message: 'should pass \""+K.keyword+"\" keyword validation' "),r.opts.verbose&&(y+=" , schema: validate.schema"+j+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+N+" "),y+=" } "):y+=" {} ",y+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!r.compositeRule&&D&&(r.async?y+=" throw new ValidationError(vErrors); ":y+=" validate.errors = vErrors; return false; ")):!1===B.errors?y+=" "+tt+" ":(y+=" if (Array.isArray("+Fe+")) { if (vErrors === null) vErrors = "+Fe+"; else vErrors = vErrors.concat("+Fe+"); errors = vErrors.length; for (var "+Ue+"="+z+"; "+Ue+"<errors; "+Ue+"++) { var "+qe+" = vErrors["+Ue+"]; if ("+qe+".dataPath === undefined) "+qe+".dataPath = (dataPath || '') + "+r.errorPath+"; "+qe+'.schemaPath = "'+Z+'"; ',r.opts.verbose&&(y+=" "+qe+".schema = "+g+"; "+qe+".data = "+N+"; "),y+=" } } else { "+tt+" } "),y+=" } ",D&&(y+=" else { ")}return y}},"./packages/node_modules/ajv/lib/dotjs/dependencies.js":function(r){"use strict";r.exports=function generate_dependencies(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||""),D="errs__"+g,N=r.util.copy(r),$="";N.level++;var z="valid"+N.level,L={},F={},M=r.opts.ownProperties;for(K in _)if("__proto__"!=K){var U=_[K],q=Array.isArray(U)?F:L;q[K]=U}h+="var "+D+" = errors;";var V=r.errorPath;for(var K in h+="var missing"+g+";",F)if((q=F[K]).length){if(h+=" if ( "+Z+r.util.getProperty(K)+" !== undefined ",M&&(h+=" && Object.prototype.hasOwnProperty.call("+Z+", '"+r.util.escapeQuotes(K)+"') "),j){h+=" && ( ";var H=q;if(H)for(var B=-1,G=H.length-1;B<G;){Ke=H[B+=1],B&&(h+=" || "),h+=" ( ( "+(Je=Z+(Qe=r.util.getProperty(Ke)))+" === undefined ",M&&(h+=" || ! Object.prototype.hasOwnProperty.call("+Z+", '"+r.util.escapeQuotes(Ke)+"') "),h+=") && (missing"+g+" = "+r.util.toQuotedString(r.opts.jsonPointers?Ke:Qe)+") ) "}h+=")) { ";var ze="missing"+g,Fe="' + "+ze+" + '";r.opts._errorDataPathProperty&&(r.errorPath=r.opts.jsonPointers?r.util.getPathExpr(V,ze,!0):V+" + "+ze);var Ue=Ue||[];Ue.push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { property: '"+r.util.escapeQuotes(K)+"', missingProperty: '"+Fe+"', depsCount: "+q.length+", deps: '"+r.util.escapeQuotes(1==q.length?q[0]:q.join(", "))+"' } ",!1!==r.opts.messages&&(h+=" , message: 'should have ",1==q.length?h+="property "+r.util.escapeQuotes(q[0]):h+="properties "+r.util.escapeQuotes(q.join(", ")),h+=" when property "+r.util.escapeQuotes(K)+" is present' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var qe=h;h=Ue.pop(),!r.compositeRule&&j?r.async?h+=" throw new ValidationError(["+qe+"]); ":h+=" validate.errors = ["+qe+"]; return false; ":h+=" var err = "+qe+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{h+=" ) { ";var Ve=q;if(Ve)for(var Ke,He=-1,Be=Ve.length-1;He<Be;){Ke=Ve[He+=1];var Qe=r.util.getProperty(Ke),Je=(Fe=r.util.escapeQuotes(Ke),Z+Qe);r.opts._errorDataPathProperty&&(r.errorPath=r.util.getPath(V,Ke,r.opts.jsonPointers)),h+=" if ( "+Je+" === undefined ",M&&(h+=" || ! Object.prototype.hasOwnProperty.call("+Z+", '"+r.util.escapeQuotes(Ke)+"') "),h+=") { var err = ",!1!==r.createErrors?(h+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { property: '"+r.util.escapeQuotes(K)+"', missingProperty: '"+Fe+"', depsCount: "+q.length+", deps: '"+r.util.escapeQuotes(1==q.length?q[0]:q.join(", "))+"' } ",!1!==r.opts.messages&&(h+=" , message: 'should have ",1==q.length?h+="property "+r.util.escapeQuotes(q[0]):h+="properties "+r.util.escapeQuotes(q.join(", ")),h+=" when property "+r.util.escapeQuotes(K)+" is present' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ",h+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}h+=" } ",j&&($+="}",h+=" else { ")}r.errorPath=V;var We=N.baseId;for(var K in L){U=L[K];(r.opts.strictKeywords?"object"==typeof U&&Object.keys(U).length>0||!1===U:r.util.schemaHasRules(U,r.RULES.all))&&(h+=" "+z+" = true; if ( "+Z+r.util.getProperty(K)+" !== undefined ",M&&(h+=" && Object.prototype.hasOwnProperty.call("+Z+", '"+r.util.escapeQuotes(K)+"') "),h+=") { ",N.schema=U,N.schemaPath=b+r.util.getProperty(K),N.errSchemaPath=P+"/"+r.util.escapeFragment(K),h+=" "+r.validate(N)+" ",N.baseId=We,h+=" } ",j&&(h+=" if ("+z+") { ",$+="}"))}return j&&(h+=" "+$+" if ("+D+" == errors) {"),h}},"./packages/node_modules/ajv/lib/dotjs/enum.js":function(r){"use strict";r.exports=function generate_enum(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||""),D="valid"+g,N=r.opts.$data&&_&&_.$data;N&&(h+=" var schema"+g+" = "+r.util.getData(_.$data,y,r.dataPathArr)+"; ");var $="i"+g,z="schema"+g;N||(h+=" var "+z+" = validate.schema"+b+";"),h+="var "+D+";",N&&(h+=" if (schema"+g+" === undefined) "+D+" = true; else if (!Array.isArray(schema"+g+")) "+D+" = false; else {"),h+=D+" = false;for (var "+$+"=0; "+$+"<"+z+".length; "+$+"++) if (equal("+Z+", "+z+"["+$+"])) { "+D+" = true; break; }",N&&(h+=" } "),h+=" if (!"+D+") { ";var L=L||[];L.push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { allowedValues: schema"+g+" } ",!1!==r.opts.messages&&(h+=" , message: 'should be equal to one of the allowed values' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var F=h;return h=L.pop(),!r.compositeRule&&j?r.async?h+=" throw new ValidationError(["+F+"]); ":h+=" validate.errors = ["+F+"]; return false; ":h+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" }",j&&(h+=" else { "),h}},"./packages/node_modules/ajv/lib/dotjs/format.js":function(r){"use strict";r.exports=function generate_format(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||"");if(!1===r.opts.format)return j&&(h+=" if (true) { "),h;var D,N=r.opts.$data&&_&&_.$data;N?(h+=" var schema"+g+" = "+r.util.getData(_.$data,y,r.dataPathArr)+"; ",D="schema"+g):D=_;var $=r.opts.unknownFormats,z=Array.isArray($);if(N){h+=" var "+(L="format"+g)+" = formats["+D+"]; var "+(F="isObject"+g)+" = typeof "+L+" == 'object' && !("+L+" instanceof RegExp) && "+L+".validate; var "+(M="formatType"+g)+" = "+F+" && "+L+".type || 'string'; if ("+F+") { ",r.async&&(h+=" var async"+g+" = "+L+".async; "),h+=" "+L+" = "+L+".validate; } if ( ",N&&(h+=" ("+D+" !== undefined && typeof "+D+" != 'string') || "),h+=" (","ignore"!=$&&(h+=" ("+D+" && !"+L+" ",z&&(h+=" && self._opts.unknownFormats.indexOf("+D+") == -1 "),h+=") || "),h+=" ("+L+" && "+M+" == '"+d+"' && !(typeof "+L+" == 'function' ? ",r.async?h+=" (async"+g+" ? await "+L+"("+Z+") : "+L+"("+Z+")) ":h+=" "+L+"("+Z+") ",h+=" : "+L+".test("+Z+"))))) {"}else{var L;if(!(L=r.formats[_])){if("ignore"==$)return r.logger.warn('unknown format "'+_+'" ignored in schema at path "'+r.errSchemaPath+'"'),j&&(h+=" if (true) { "),h;if(z&&$.indexOf(_)>=0)return j&&(h+=" if (true) { "),h;throw new Error('unknown format "'+_+'" is used in schema at path "'+r.errSchemaPath+'"')}var F,M=(F="object"==typeof L&&!(L instanceof RegExp)&&L.validate)&&L.type||"string";if(F){var U=!0===L.async;L=L.validate}if(M!=d)return j&&(h+=" if (true) { "),h;if(U){if(!r.async)throw new Error("async format in sync schema");h+=" if (!(await "+(q="formats"+r.util.getProperty(_)+".validate")+"("+Z+"))) { "}else{h+=" if (! ";var q="formats"+r.util.getProperty(_);F&&(q+=".validate"),h+="function"==typeof L?" "+q+"("+Z+") ":" "+q+".test("+Z+") ",h+=") { "}}var V=V||[];V.push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'format' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { format: ",h+=N?""+D:""+r.util.toQuotedString(_),h+=" } ",!1!==r.opts.messages&&(h+=" , message: 'should match format \"",h+=N?"' + "+D+" + '":""+r.util.escapeQuotes(_),h+="\"' "),r.opts.verbose&&(h+=" , schema: ",h+=N?"validate.schema"+b:""+r.util.toQuotedString(_),h+=" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var K=h;return h=V.pop(),!r.compositeRule&&j?r.async?h+=" throw new ValidationError(["+K+"]); ":h+=" validate.errors = ["+K+"]; return false; ":h+=" var err = "+K+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" } ",j&&(h+=" else { "),h}},"./packages/node_modules/ajv/lib/dotjs/if.js":function(r){"use strict";r.exports=function generate_if(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||""),D="valid"+g,N="errs__"+g,$=r.util.copy(r);$.level++;var z="valid"+$.level,L=r.schema.then,F=r.schema.else,M=void 0!==L&&(r.opts.strictKeywords?"object"==typeof L&&Object.keys(L).length>0||!1===L:r.util.schemaHasRules(L,r.RULES.all)),U=void 0!==F&&(r.opts.strictKeywords?"object"==typeof F&&Object.keys(F).length>0||!1===F:r.util.schemaHasRules(F,r.RULES.all)),q=$.baseId;if(M||U){var V;$.createErrors=!1,$.schema=_,$.schemaPath=b,$.errSchemaPath=P,h+=" var "+N+" = errors; var "+D+" = true; ";var K=r.compositeRule;r.compositeRule=$.compositeRule=!0,h+=" "+r.validate($)+" ",$.baseId=q,$.createErrors=!0,h+=" errors = "+N+"; if (vErrors !== null) { if ("+N+") vErrors.length = "+N+"; else vErrors = null; } ",r.compositeRule=$.compositeRule=K,M?(h+=" if ("+z+") { ",$.schema=r.schema.then,$.schemaPath=r.schemaPath+".then",$.errSchemaPath=r.errSchemaPath+"/then",h+=" "+r.validate($)+" ",$.baseId=q,h+=" "+D+" = "+z+"; ",M&&U?h+=" var "+(V="ifClause"+g)+" = 'then'; ":V="'then'",h+=" } ",U&&(h+=" else { ")):h+=" if (!"+z+") { ",U&&($.schema=r.schema.else,$.schemaPath=r.schemaPath+".else",$.errSchemaPath=r.errSchemaPath+"/else",h+=" "+r.validate($)+" ",$.baseId=q,h+=" "+D+" = "+z+"; ",M&&U?h+=" var "+(V="ifClause"+g)+" = 'else'; ":V="'else'",h+=" } "),h+=" if (!"+D+") { var err = ",!1!==r.createErrors?(h+=" { keyword: 'if' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { failingKeyword: "+V+" } ",!1!==r.opts.messages&&(h+=" , message: 'should match \"' + "+V+" + '\" schema' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ",h+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!r.compositeRule&&j&&(r.async?h+=" throw new ValidationError(vErrors); ":h+=" validate.errors = vErrors; return false; "),h+=" } ",j&&(h+=" else { ")}else j&&(h+=" if (true) { ");return h}},"./packages/node_modules/ajv/lib/dotjs/index.js":function(r,a,d){"use strict";r.exports={$ref:d("./packages/node_modules/ajv/lib/dotjs/ref.js"),allOf:d("./packages/node_modules/ajv/lib/dotjs/allOf.js"),anyOf:d("./packages/node_modules/ajv/lib/dotjs/anyOf.js"),$comment:d("./packages/node_modules/ajv/lib/dotjs/comment.js"),const:d("./packages/node_modules/ajv/lib/dotjs/const.js"),contains:d("./packages/node_modules/ajv/lib/dotjs/contains.js"),dependencies:d("./packages/node_modules/ajv/lib/dotjs/dependencies.js"),enum:d("./packages/node_modules/ajv/lib/dotjs/enum.js"),format:d("./packages/node_modules/ajv/lib/dotjs/format.js"),if:d("./packages/node_modules/ajv/lib/dotjs/if.js"),items:d("./packages/node_modules/ajv/lib/dotjs/items.js"),maximum:d("./packages/node_modules/ajv/lib/dotjs/_limit.js"),minimum:d("./packages/node_modules/ajv/lib/dotjs/_limit.js"),maxItems:d("./packages/node_modules/ajv/lib/dotjs/_limitItems.js"),minItems:d("./packages/node_modules/ajv/lib/dotjs/_limitItems.js"),maxLength:d("./packages/node_modules/ajv/lib/dotjs/_limitLength.js"),minLength:d("./packages/node_modules/ajv/lib/dotjs/_limitLength.js"),maxProperties:d("./packages/node_modules/ajv/lib/dotjs/_limitProperties.js"),minProperties:d("./packages/node_modules/ajv/lib/dotjs/_limitProperties.js"),multipleOf:d("./packages/node_modules/ajv/lib/dotjs/multipleOf.js"),not:d("./packages/node_modules/ajv/lib/dotjs/not.js"),oneOf:d("./packages/node_modules/ajv/lib/dotjs/oneOf.js"),pattern:d("./packages/node_modules/ajv/lib/dotjs/pattern.js"),properties:d("./packages/node_modules/ajv/lib/dotjs/properties.js"),propertyNames:d("./packages/node_modules/ajv/lib/dotjs/propertyNames.js"),required:d("./packages/node_modules/ajv/lib/dotjs/required.js"),uniqueItems:d("./packages/node_modules/ajv/lib/dotjs/uniqueItems.js"),validate:d("./packages/node_modules/ajv/lib/dotjs/validate.js")}},"./packages/node_modules/ajv/lib/dotjs/items.js":function(r){"use strict";r.exports=function generate_items(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||""),D="valid"+g,N="errs__"+g,$=r.util.copy(r),z="";$.level++;var L="valid"+$.level,F="i"+g,M=$.dataLevel=r.dataLevel+1,U="data"+M,q=r.baseId;if(h+="var "+N+" = errors;var "+D+";",Array.isArray(_)){var V=r.schema.additionalItems;if(!1===V){h+=" "+D+" = "+Z+".length <= "+_.length+"; ";var K=P;P=r.errSchemaPath+"/additionalItems",h+=" if (!"+D+") { ";var H=H||[];H.push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { limit: "+_.length+" } ",!1!==r.opts.messages&&(h+=" , message: 'should NOT have more than "+_.length+" items' "),r.opts.verbose&&(h+=" , schema: false , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var B=h;h=H.pop(),!r.compositeRule&&j?r.async?h+=" throw new ValidationError(["+B+"]); ":h+=" validate.errors = ["+B+"]; return false; ":h+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" } ",P=K,j&&(z+="}",h+=" else { ")}var G=_;if(G)for(var ze,Fe=-1,Ue=G.length-1;Fe<Ue;)if(ze=G[Fe+=1],r.opts.strictKeywords?"object"==typeof ze&&Object.keys(ze).length>0||!1===ze:r.util.schemaHasRules(ze,r.RULES.all)){h+=" "+L+" = true; if ("+Z+".length > "+Fe+") { ";var qe=Z+"["+Fe+"]";$.schema=ze,$.schemaPath=b+"["+Fe+"]",$.errSchemaPath=P+"/"+Fe,$.errorPath=r.util.getPathExpr(r.errorPath,Fe,r.opts.jsonPointers,!0),$.dataPathArr[M]=Fe;var Ve=r.validate($);$.baseId=q,r.util.varOccurences(Ve,U)<2?h+=" "+r.util.varReplace(Ve,U,qe)+" ":h+=" var "+U+" = "+qe+"; "+Ve+" ",h+=" } ",j&&(h+=" if ("+L+") { ",z+="}")}if("object"==typeof V&&(r.opts.strictKeywords?"object"==typeof V&&Object.keys(V).length>0||!1===V:r.util.schemaHasRules(V,r.RULES.all))){$.schema=V,$.schemaPath=r.schemaPath+".additionalItems",$.errSchemaPath=r.errSchemaPath+"/additionalItems",h+=" "+L+" = true; if ("+Z+".length > "+_.length+") { for (var "+F+" = "+_.length+"; "+F+" < "+Z+".length; "+F+"++) { ",$.errorPath=r.util.getPathExpr(r.errorPath,F,r.opts.jsonPointers,!0);qe=Z+"["+F+"]";$.dataPathArr[M]=F;Ve=r.validate($);$.baseId=q,r.util.varOccurences(Ve,U)<2?h+=" "+r.util.varReplace(Ve,U,qe)+" ":h+=" var "+U+" = "+qe+"; "+Ve+" ",j&&(h+=" if (!"+L+") break; "),h+=" } } ",j&&(h+=" if ("+L+") { ",z+="}")}}else if(r.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0||!1===_:r.util.schemaHasRules(_,r.RULES.all)){$.schema=_,$.schemaPath=b,$.errSchemaPath=P,h+=" for (var "+F+" = 0; "+F+" < "+Z+".length; "+F+"++) { ",$.errorPath=r.util.getPathExpr(r.errorPath,F,r.opts.jsonPointers,!0);qe=Z+"["+F+"]";$.dataPathArr[M]=F;Ve=r.validate($);$.baseId=q,r.util.varOccurences(Ve,U)<2?h+=" "+r.util.varReplace(Ve,U,qe)+" ":h+=" var "+U+" = "+qe+"; "+Ve+" ",j&&(h+=" if (!"+L+") break; "),h+=" }"}return j&&(h+=" "+z+" if ("+N+" == errors) {"),h}},"./packages/node_modules/ajv/lib/dotjs/multipleOf.js":function(r){"use strict";r.exports=function generate_multipleOf(r,a,d){var h,g=" ",y=r.level,_=r.dataLevel,b=r.schema[a],P=r.schemaPath+r.util.getProperty(a),j=r.errSchemaPath+"/"+a,Z=!r.opts.allErrors,D="data"+(_||""),N=r.opts.$data&&b&&b.$data;if(N?(g+=" var schema"+y+" = "+r.util.getData(b.$data,_,r.dataPathArr)+"; ",h="schema"+y):h=b,!N&&"number"!=typeof b)throw new Error(a+" must be number");g+="var division"+y+";if (",N&&(g+=" "+h+" !== undefined && ( typeof "+h+" != 'number' || "),g+=" (division"+y+" = "+D+" / "+h+", ",r.opts.multipleOfPrecision?g+=" Math.abs(Math.round(division"+y+") - division"+y+") > 1e-"+r.opts.multipleOfPrecision+" ":g+=" division"+y+" !== parseInt(division"+y+") ",g+=" ) ",N&&(g+=" ) "),g+=" ) { ";var $=$||[];$.push(g),g="",!1!==r.createErrors?(g+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(j)+" , params: { multipleOf: "+h+" } ",!1!==r.opts.messages&&(g+=" , message: 'should be multiple of ",g+=N?"' + "+h:h+"'"),r.opts.verbose&&(g+=" , schema: ",g+=N?"validate.schema"+P:""+b,g+=" , parentSchema: validate.schema"+r.schemaPath+" , data: "+D+" "),g+=" } "):g+=" {} ";var z=g;return g=$.pop(),!r.compositeRule&&Z?r.async?g+=" throw new ValidationError(["+z+"]); ":g+=" validate.errors = ["+z+"]; return false; ":g+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+="} ",Z&&(g+=" else { "),g}},"./packages/node_modules/ajv/lib/dotjs/not.js":function(r){"use strict";r.exports=function generate_not(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||""),D="errs__"+g,N=r.util.copy(r);N.level++;var $="valid"+N.level;if(r.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0||!1===_:r.util.schemaHasRules(_,r.RULES.all)){N.schema=_,N.schemaPath=b,N.errSchemaPath=P,h+=" var "+D+" = errors; ";var z,L=r.compositeRule;r.compositeRule=N.compositeRule=!0,N.createErrors=!1,N.opts.allErrors&&(z=N.opts.allErrors,N.opts.allErrors=!1),h+=" "+r.validate(N)+" ",N.createErrors=!0,z&&(N.opts.allErrors=z),r.compositeRule=N.compositeRule=L,h+=" if ("+$+") { ";var F=F||[];F.push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'not' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: {} ",!1!==r.opts.messages&&(h+=" , message: 'should NOT be valid' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var M=h;h=F.pop(),!r.compositeRule&&j?r.async?h+=" throw new ValidationError(["+M+"]); ":h+=" validate.errors = ["+M+"]; return false; ":h+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" } else { errors = "+D+"; if (vErrors !== null) { if ("+D+") vErrors.length = "+D+"; else vErrors = null; } ",r.opts.allErrors&&(h+=" } ")}else h+=" var err = ",!1!==r.createErrors?(h+=" { keyword: 'not' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: {} ",!1!==r.opts.messages&&(h+=" , message: 'should NOT be valid' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ",h+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",j&&(h+=" if (false) { ");return h}},"./packages/node_modules/ajv/lib/dotjs/oneOf.js":function(r){"use strict";r.exports=function generate_oneOf(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||""),D="valid"+g,N="errs__"+g,$=r.util.copy(r),z="";$.level++;var L="valid"+$.level,F=$.baseId,M="prevValid"+g,U="passingSchemas"+g;h+="var "+N+" = errors , "+M+" = false , "+D+" = false , "+U+" = null; ";var q=r.compositeRule;r.compositeRule=$.compositeRule=!0;var V=_;if(V)for(var K,H=-1,B=V.length-1;H<B;)K=V[H+=1],(r.opts.strictKeywords?"object"==typeof K&&Object.keys(K).length>0||!1===K:r.util.schemaHasRules(K,r.RULES.all))?($.schema=K,$.schemaPath=b+"["+H+"]",$.errSchemaPath=P+"/"+H,h+=" "+r.validate($)+" ",$.baseId=F):h+=" var "+L+" = true; ",H&&(h+=" if ("+L+" && "+M+") { "+D+" = false; "+U+" = ["+U+", "+H+"]; } else { ",z+="}"),h+=" if ("+L+") { "+D+" = "+M+" = true; "+U+" = "+H+"; }";return r.compositeRule=$.compositeRule=q,h+=z+"if (!"+D+") { var err = ",!1!==r.createErrors?(h+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { passingSchemas: "+U+" } ",!1!==r.opts.messages&&(h+=" , message: 'should match exactly one schema in oneOf' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ",h+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!r.compositeRule&&j&&(r.async?h+=" throw new ValidationError(vErrors); ":h+=" validate.errors = vErrors; return false; "),h+="} else { errors = "+N+"; if (vErrors !== null) { if ("+N+") vErrors.length = "+N+"; else vErrors = null; }",r.opts.allErrors&&(h+=" } "),h}},"./packages/node_modules/ajv/lib/dotjs/pattern.js":function(r){"use strict";r.exports=function generate_pattern(r,a,d){var h,g=" ",y=r.level,_=r.dataLevel,b=r.schema[a],P=r.schemaPath+r.util.getProperty(a),j=r.errSchemaPath+"/"+a,Z=!r.opts.allErrors,D="data"+(_||""),N=r.opts.$data&&b&&b.$data;N?(g+=" var schema"+y+" = "+r.util.getData(b.$data,_,r.dataPathArr)+"; ",h="schema"+y):h=b,g+="if ( ",N&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'string') || "),g+=" !"+(N?"(new RegExp("+h+"))":r.usePattern(b))+".test("+D+") ) { ";var $=$||[];$.push(g),g="",!1!==r.createErrors?(g+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(j)+" , params: { pattern: ",g+=N?""+h:""+r.util.toQuotedString(b),g+=" } ",!1!==r.opts.messages&&(g+=" , message: 'should match pattern \"",g+=N?"' + "+h+" + '":""+r.util.escapeQuotes(b),g+="\"' "),r.opts.verbose&&(g+=" , schema: ",g+=N?"validate.schema"+P:""+r.util.toQuotedString(b),g+=" , parentSchema: validate.schema"+r.schemaPath+" , data: "+D+" "),g+=" } "):g+=" {} ";var z=g;return g=$.pop(),!r.compositeRule&&Z?r.async?g+=" throw new ValidationError(["+z+"]); ":g+=" validate.errors = ["+z+"]; return false; ":g+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+="} ",Z&&(g+=" else { "),g}},"./packages/node_modules/ajv/lib/dotjs/properties.js":function(r){"use strict";r.exports=function generate_properties(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||""),D="errs__"+g,N=r.util.copy(r),$="";N.level++;var z="valid"+N.level,L="key"+g,F="idx"+g,M=N.dataLevel=r.dataLevel+1,U="data"+M,q="dataProperties"+g,V=Object.keys(_||{}).filter(notProto),K=r.schema.patternProperties||{},H=Object.keys(K).filter(notProto),B=r.schema.additionalProperties,G=V.length||H.length,ze=!1===B,Fe="object"==typeof B&&Object.keys(B).length,Ue=r.opts.removeAdditional,qe=ze||Fe||Ue,Ve=r.opts.ownProperties,Ke=r.baseId,He=r.schema.required;if(He&&(!r.opts.$data||!He.$data)&&He.length<r.opts.loopRequired)var Be=r.util.toHash(He);function notProto(r){return"__proto__"!==r}if(h+="var "+D+" = errors;var "+z+" = true;",Ve&&(h+=" var "+q+" = undefined;"),qe){if(h+=Ve?" "+q+" = "+q+" || Object.keys("+Z+"); for (var "+F+"=0; "+F+"<"+q+".length; "+F+"++) { var "+L+" = "+q+"["+F+"]; ":" for (var "+L+" in "+Z+") { ",G){if(h+=" var isAdditional"+g+" = !(false ",V.length)if(V.length>8)h+=" || validate.schema"+b+".hasOwnProperty("+L+") ";else{var Qe=V;if(Qe)for(var Je=-1,We=Qe.length-1;Je<We;)ut=Qe[Je+=1],h+=" || "+L+" == "+r.util.toQuotedString(ut)+" "}if(H.length){var Ye=H;if(Ye)for(var Xe=-1,et=Ye.length-1;Xe<et;)bt=Ye[Xe+=1],h+=" || "+r.usePattern(bt)+".test("+L+") "}h+=" ); if (isAdditional"+g+") { "}if("all"==Ue)h+=" delete "+Z+"["+L+"]; ";else{var tt=r.errorPath,rt="' + "+L+" + '";if(r.opts._errorDataPathProperty&&(r.errorPath=r.util.getPathExpr(r.errorPath,L,r.opts.jsonPointers)),ze)if(Ue)h+=" delete "+Z+"["+L+"]; ";else{h+=" "+z+" = false; ";var st=P;P=r.errSchemaPath+"/additionalProperties",(vt=vt||[]).push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { additionalProperty: '"+rt+"' } ",!1!==r.opts.messages&&(h+=" , message: '",r.opts._errorDataPathProperty?h+="is an invalid additional property":h+="should NOT have additional properties",h+="' "),r.opts.verbose&&(h+=" , schema: false , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var at=h;h=vt.pop(),!r.compositeRule&&j?r.async?h+=" throw new ValidationError(["+at+"]); ":h+=" validate.errors = ["+at+"]; return false; ":h+=" var err = "+at+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",P=st,j&&(h+=" break; ")}else if(Fe)if("failing"==Ue){h+=" var "+D+" = errors; ";var nt=r.compositeRule;r.compositeRule=N.compositeRule=!0,N.schema=B,N.schemaPath=r.schemaPath+".additionalProperties",N.errSchemaPath=r.errSchemaPath+"/additionalProperties",N.errorPath=r.opts._errorDataPathProperty?r.errorPath:r.util.getPathExpr(r.errorPath,L,r.opts.jsonPointers);var ot=Z+"["+L+"]";N.dataPathArr[M]=L;var it=r.validate(N);N.baseId=Ke,r.util.varOccurences(it,U)<2?h+=" "+r.util.varReplace(it,U,ot)+" ":h+=" var "+U+" = "+ot+"; "+it+" ",h+=" if (!"+z+") { errors = "+D+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+Z+"["+L+"]; } ",r.compositeRule=N.compositeRule=nt}else{N.schema=B,N.schemaPath=r.schemaPath+".additionalProperties",N.errSchemaPath=r.errSchemaPath+"/additionalProperties",N.errorPath=r.opts._errorDataPathProperty?r.errorPath:r.util.getPathExpr(r.errorPath,L,r.opts.jsonPointers);ot=Z+"["+L+"]";N.dataPathArr[M]=L;it=r.validate(N);N.baseId=Ke,r.util.varOccurences(it,U)<2?h+=" "+r.util.varReplace(it,U,ot)+" ":h+=" var "+U+" = "+ot+"; "+it+" ",j&&(h+=" if (!"+z+") break; ")}r.errorPath=tt}G&&(h+=" } "),h+=" } ",j&&(h+=" if ("+z+") { ",$+="}")}var dt=r.opts.useDefaults&&!r.compositeRule;if(V.length){var ct=V;if(ct)for(var ut,lt=-1,pt=ct.length-1;lt<pt;){var mt=_[ut=ct[lt+=1]];if(r.opts.strictKeywords?"object"==typeof mt&&Object.keys(mt).length>0||!1===mt:r.util.schemaHasRules(mt,r.RULES.all)){var ht=r.util.getProperty(ut),ft=(ot=Z+ht,dt&&void 0!==mt.default);N.schema=mt,N.schemaPath=b+ht,N.errSchemaPath=P+"/"+r.util.escapeFragment(ut),N.errorPath=r.util.getPath(r.errorPath,ut,r.opts.jsonPointers),N.dataPathArr[M]=r.util.toQuotedString(ut);it=r.validate(N);if(N.baseId=Ke,r.util.varOccurences(it,U)<2){it=r.util.varReplace(it,U,ot);var gt=ot}else{gt=U;h+=" var "+U+" = "+ot+"; "}if(ft)h+=" "+it+" ";else{if(Be&&Be[ut]){h+=" if ( "+gt+" === undefined ",Ve&&(h+=" || ! Object.prototype.hasOwnProperty.call("+Z+", '"+r.util.escapeQuotes(ut)+"') "),h+=") { "+z+" = false; ";tt=r.errorPath,st=P;var vt,yt=r.util.escapeQuotes(ut);r.opts._errorDataPathProperty&&(r.errorPath=r.util.getPath(tt,ut,r.opts.jsonPointers)),P=r.errSchemaPath+"/required",(vt=vt||[]).push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'required' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { missingProperty: '"+yt+"' } ",!1!==r.opts.messages&&(h+=" , message: '",r.opts._errorDataPathProperty?h+="is a required property":h+="should have required property \\'"+yt+"\\'",h+="' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";at=h;h=vt.pop(),!r.compositeRule&&j?r.async?h+=" throw new ValidationError(["+at+"]); ":h+=" validate.errors = ["+at+"]; return false; ":h+=" var err = "+at+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",P=st,r.errorPath=tt,h+=" } else { "}else j?(h+=" if ( "+gt+" === undefined ",Ve&&(h+=" || ! Object.prototype.hasOwnProperty.call("+Z+", '"+r.util.escapeQuotes(ut)+"') "),h+=") { "+z+" = true; } else { "):(h+=" if ("+gt+" !== undefined ",Ve&&(h+=" && Object.prototype.hasOwnProperty.call("+Z+", '"+r.util.escapeQuotes(ut)+"') "),h+=" ) { ");h+=" "+it+" } "}}j&&(h+=" if ("+z+") { ",$+="}")}}if(H.length){var _t=H;if(_t)for(var bt,Pt=-1,kt=_t.length-1;Pt<kt;){mt=K[bt=_t[Pt+=1]];if(r.opts.strictKeywords?"object"==typeof mt&&Object.keys(mt).length>0||!1===mt:r.util.schemaHasRules(mt,r.RULES.all)){N.schema=mt,N.schemaPath=r.schemaPath+".patternProperties"+r.util.getProperty(bt),N.errSchemaPath=r.errSchemaPath+"/patternProperties/"+r.util.escapeFragment(bt),h+=Ve?" "+q+" = "+q+" || Object.keys("+Z+"); for (var "+F+"=0; "+F+"<"+q+".length; "+F+"++) { var "+L+" = "+q+"["+F+"]; ":" for (var "+L+" in "+Z+") { ",h+=" if ("+r.usePattern(bt)+".test("+L+")) { ",N.errorPath=r.util.getPathExpr(r.errorPath,L,r.opts.jsonPointers);ot=Z+"["+L+"]";N.dataPathArr[M]=L;it=r.validate(N);N.baseId=Ke,r.util.varOccurences(it,U)<2?h+=" "+r.util.varReplace(it,U,ot)+" ":h+=" var "+U+" = "+ot+"; "+it+" ",j&&(h+=" if (!"+z+") break; "),h+=" } ",j&&(h+=" else "+z+" = true; "),h+=" } ",j&&(h+=" if ("+z+") { ",$+="}")}}}return j&&(h+=" "+$+" if ("+D+" == errors) {"),h}},"./packages/node_modules/ajv/lib/dotjs/propertyNames.js":function(r){"use strict";r.exports=function generate_propertyNames(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||""),D="errs__"+g,N=r.util.copy(r);N.level++;var $="valid"+N.level;if(h+="var "+D+" = errors;",r.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0||!1===_:r.util.schemaHasRules(_,r.RULES.all)){N.schema=_,N.schemaPath=b,N.errSchemaPath=P;var z="key"+g,L="idx"+g,F="i"+g,M="' + "+z+" + '",U="data"+(N.dataLevel=r.dataLevel+1),q="dataProperties"+g,V=r.opts.ownProperties,K=r.baseId;V&&(h+=" var "+q+" = undefined; "),h+=V?" "+q+" = "+q+" || Object.keys("+Z+"); for (var "+L+"=0; "+L+"<"+q+".length; "+L+"++) { var "+z+" = "+q+"["+L+"]; ":" for (var "+z+" in "+Z+") { ",h+=" var startErrs"+g+" = errors; ";var H=z,B=r.compositeRule;r.compositeRule=N.compositeRule=!0;var G=r.validate(N);N.baseId=K,r.util.varOccurences(G,U)<2?h+=" "+r.util.varReplace(G,U,H)+" ":h+=" var "+U+" = "+H+"; "+G+" ",r.compositeRule=N.compositeRule=B,h+=" if (!"+$+") { for (var "+F+"=startErrs"+g+"; "+F+"<errors; "+F+"++) { vErrors["+F+"].propertyName = "+z+"; } var err = ",!1!==r.createErrors?(h+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { propertyName: '"+M+"' } ",!1!==r.opts.messages&&(h+=" , message: 'property name \\'"+M+"\\' is invalid' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ",h+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!r.compositeRule&&j&&(r.async?h+=" throw new ValidationError(vErrors); ":h+=" validate.errors = vErrors; return false; "),j&&(h+=" break; "),h+=" } }"}return j&&(h+=" if ("+D+" == errors) {"),h}},"./packages/node_modules/ajv/lib/dotjs/ref.js":function(r){"use strict";r.exports=function generate_ref(r,a,d){var h,g,y=" ",_=r.level,b=r.dataLevel,P=r.schema[a],j=r.errSchemaPath+"/"+a,Z=!r.opts.allErrors,D="data"+(b||""),N="valid"+_;if("#"==P||"#/"==P)r.isRoot?(h=r.async,g="validate"):(h=!0===r.root.schema.$async,g="root.refVal[0]");else{var $=r.resolveRef(r.baseId,P,r.isRoot);if(void 0===$){var z=r.MissingRefError.message(r.baseId,P);if("fail"==r.opts.missingRefs){r.logger.error(z),(U=U||[]).push(y),y="",!1!==r.createErrors?(y+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(j)+" , params: { ref: '"+r.util.escapeQuotes(P)+"' } ",!1!==r.opts.messages&&(y+=" , message: 'can\\'t resolve reference "+r.util.escapeQuotes(P)+"' "),r.opts.verbose&&(y+=" , schema: "+r.util.toQuotedString(P)+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+D+" "),y+=" } "):y+=" {} ";var L=y;y=U.pop(),!r.compositeRule&&Z?r.async?y+=" throw new ValidationError(["+L+"]); ":y+=" validate.errors = ["+L+"]; return false; ":y+=" var err = "+L+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",Z&&(y+=" if (false) { ")}else{if("ignore"!=r.opts.missingRefs)throw new r.MissingRefError(r.baseId,P,z);r.logger.warn(z),Z&&(y+=" if (true) { ")}}else if($.inline){var F=r.util.copy(r);F.level++;var M="valid"+F.level;F.schema=$.schema,F.schemaPath="",F.errSchemaPath=P,y+=" "+r.validate(F).replace(/validate\.schema/g,$.code)+" ",Z&&(y+=" if ("+M+") { ")}else h=!0===$.$async||r.async&&!1!==$.$async,g=$.code}if(g){var U;(U=U||[]).push(y),y="",r.opts.passContext?y+=" "+g+".call(this, ":y+=" "+g+"( ",y+=" "+D+", (dataPath || '')",'""'!=r.errorPath&&(y+=" + "+r.errorPath);var q=y+=" , "+(b?"data"+(b-1||""):"parentData")+" , "+(b?r.dataPathArr[b]:"parentDataProperty")+", rootData) ";if(y=U.pop(),h){if(!r.async)throw new Error("async schema referenced by sync schema");Z&&(y+=" var "+N+"; "),y+=" try { await "+q+"; ",Z&&(y+=" "+N+" = true; "),y+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",Z&&(y+=" "+N+" = false; "),y+=" } ",Z&&(y+=" if ("+N+") { ")}else y+=" if (!"+q+") { if (vErrors === null) vErrors = "+g+".errors; else vErrors = vErrors.concat("+g+".errors); errors = vErrors.length; } ",Z&&(y+=" else { ")}return y}},"./packages/node_modules/ajv/lib/dotjs/required.js":function(r){"use strict";r.exports=function generate_required(r,a,d){var h=" ",g=r.level,y=r.dataLevel,_=r.schema[a],b=r.schemaPath+r.util.getProperty(a),P=r.errSchemaPath+"/"+a,j=!r.opts.allErrors,Z="data"+(y||""),D="valid"+g,N=r.opts.$data&&_&&_.$data;N&&(h+=" var schema"+g+" = "+r.util.getData(_.$data,y,r.dataPathArr)+"; ");var $="schema"+g;if(!N)if(_.length<r.opts.loopRequired&&r.schema.properties&&Object.keys(r.schema.properties).length){var z=[],L=_;if(L)for(var F,M=-1,U=L.length-1;M<U;){F=L[M+=1];var q=r.schema.properties[F];q&&(r.opts.strictKeywords?"object"==typeof q&&Object.keys(q).length>0||!1===q:r.util.schemaHasRules(q,r.RULES.all))||(z[z.length]=F)}}else z=_;if(N||z.length){var V=r.errorPath,K=N||z.length>=r.opts.loopRequired,H=r.opts.ownProperties;if(j)if(h+=" var missing"+g+"; ",K){N||(h+=" var "+$+" = validate.schema"+b+"; ");var B="' + "+(Ve="schema"+g+"["+(Fe="i"+g)+"]")+" + '";r.opts._errorDataPathProperty&&(r.errorPath=r.util.getPathExpr(V,Ve,r.opts.jsonPointers)),h+=" var "+D+" = true; ",N&&(h+=" if (schema"+g+" === undefined) "+D+" = true; else if (!Array.isArray(schema"+g+")) "+D+" = false; else {"),h+=" for (var "+Fe+" = 0; "+Fe+" < "+$+".length; "+Fe+"++) { "+D+" = "+Z+"["+$+"["+Fe+"]] !== undefined ",H&&(h+=" && Object.prototype.hasOwnProperty.call("+Z+", "+$+"["+Fe+"]) "),h+="; if (!"+D+") break; } ",N&&(h+=" } "),h+=" if (!"+D+") { ",(qe=qe||[]).push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'required' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { missingProperty: '"+B+"' } ",!1!==r.opts.messages&&(h+=" , message: '",r.opts._errorDataPathProperty?h+="is a required property":h+="should have required property \\'"+B+"\\'",h+="' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var G=h;h=qe.pop(),!r.compositeRule&&j?r.async?h+=" throw new ValidationError(["+G+"]); ":h+=" validate.errors = ["+G+"]; return false; ":h+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" } else { "}else{h+=" if ( ";var ze=z;if(ze)for(var Fe=-1,Ue=ze.length-1;Fe<Ue;){He=ze[Fe+=1],Fe&&(h+=" || "),h+=" ( ( "+(We=Z+(Je=r.util.getProperty(He)))+" === undefined ",H&&(h+=" || ! Object.prototype.hasOwnProperty.call("+Z+", '"+r.util.escapeQuotes(He)+"') "),h+=") && (missing"+g+" = "+r.util.toQuotedString(r.opts.jsonPointers?He:Je)+") ) "}h+=") { ";var qe;B="' + "+(Ve="missing"+g)+" + '";r.opts._errorDataPathProperty&&(r.errorPath=r.opts.jsonPointers?r.util.getPathExpr(V,Ve,!0):V+" + "+Ve),(qe=qe||[]).push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'required' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { missingProperty: '"+B+"' } ",!1!==r.opts.messages&&(h+=" , message: '",r.opts._errorDataPathProperty?h+="is a required property":h+="should have required property \\'"+B+"\\'",h+="' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";G=h;h=qe.pop(),!r.compositeRule&&j?r.async?h+=" throw new ValidationError(["+G+"]); ":h+=" validate.errors = ["+G+"]; return false; ":h+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" } else { "}else if(K){N||(h+=" var "+$+" = validate.schema"+b+"; ");var Ve;B="' + "+(Ve="schema"+g+"["+(Fe="i"+g)+"]")+" + '";r.opts._errorDataPathProperty&&(r.errorPath=r.util.getPathExpr(V,Ve,r.opts.jsonPointers)),N&&(h+=" if ("+$+" && !Array.isArray("+$+")) { var err = ",!1!==r.createErrors?(h+=" { keyword: 'required' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { missingProperty: '"+B+"' } ",!1!==r.opts.messages&&(h+=" , message: '",r.opts._errorDataPathProperty?h+="is a required property":h+="should have required property \\'"+B+"\\'",h+="' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ",h+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+$+" !== undefined) { "),h+=" for (var "+Fe+" = 0; "+Fe+" < "+$+".length; "+Fe+"++) { if ("+Z+"["+$+"["+Fe+"]] === undefined ",H&&(h+=" || ! Object.prototype.hasOwnProperty.call("+Z+", "+$+"["+Fe+"]) "),h+=") { var err = ",!1!==r.createErrors?(h+=" { keyword: 'required' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { missingProperty: '"+B+"' } ",!1!==r.opts.messages&&(h+=" , message: '",r.opts._errorDataPathProperty?h+="is a required property":h+="should have required property \\'"+B+"\\'",h+="' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ",h+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",N&&(h+=" } ")}else{var Ke=z;if(Ke)for(var He,Be=-1,Qe=Ke.length-1;Be<Qe;){He=Ke[Be+=1];var Je=r.util.getProperty(He),We=(B=r.util.escapeQuotes(He),Z+Je);r.opts._errorDataPathProperty&&(r.errorPath=r.util.getPath(V,He,r.opts.jsonPointers)),h+=" if ( "+We+" === undefined ",H&&(h+=" || ! Object.prototype.hasOwnProperty.call("+Z+", '"+r.util.escapeQuotes(He)+"') "),h+=") { var err = ",!1!==r.createErrors?(h+=" { keyword: 'required' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(P)+" , params: { missingProperty: '"+B+"' } ",!1!==r.opts.messages&&(h+=" , message: '",r.opts._errorDataPathProperty?h+="is a required property":h+="should have required property \\'"+B+"\\'",h+="' "),r.opts.verbose&&(h+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ",h+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r.errorPath=V}else j&&(h+=" if (true) {");return h}},"./packages/node_modules/ajv/lib/dotjs/uniqueItems.js":function(r){"use strict";r.exports=function generate_uniqueItems(r,a,d){var h,g=" ",y=r.level,_=r.dataLevel,b=r.schema[a],P=r.schemaPath+r.util.getProperty(a),j=r.errSchemaPath+"/"+a,Z=!r.opts.allErrors,D="data"+(_||""),N="valid"+y,$=r.opts.$data&&b&&b.$data;if($?(g+=" var schema"+y+" = "+r.util.getData(b.$data,_,r.dataPathArr)+"; ",h="schema"+y):h=b,(b||$)&&!1!==r.opts.uniqueItems){$&&(g+=" var "+N+"; if ("+h+" === false || "+h+" === undefined) "+N+" = true; else if (typeof "+h+" != 'boolean') "+N+" = false; else { "),g+=" var i = "+D+".length , "+N+" = true , j; if (i > 1) { ";var z=r.schema.items&&r.schema.items.type,L=Array.isArray(z);if(!z||"object"==z||"array"==z||L&&(z.indexOf("object")>=0||z.indexOf("array")>=0))g+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+D+"[i], "+D+"[j])) { "+N+" = false; break outer; } } } ";else{g+=" var itemIndices = {}, item; for (;i--;) { var item = "+D+"[i]; ";var F="checkDataType"+(L?"s":"");g+=" if ("+r.util[F](z,"item",r.opts.strictNumbers,!0)+") continue; ",L&&(g+=" if (typeof item == 'string') item = '\"' + item; "),g+=" if (typeof itemIndices[item] == 'number') { "+N+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}g+=" } ",$&&(g+=" } "),g+=" if (!"+N+") { ";var M=M||[];M.push(g),g="",!1!==r.createErrors?(g+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(j)+" , params: { i: i, j: j } ",!1!==r.opts.messages&&(g+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),r.opts.verbose&&(g+=" , schema: ",g+=$?"validate.schema"+P:""+b,g+=" , parentSchema: validate.schema"+r.schemaPath+" , data: "+D+" "),g+=" } "):g+=" {} ";var U=g;g=M.pop(),!r.compositeRule&&Z?r.async?g+=" throw new ValidationError(["+U+"]); ":g+=" validate.errors = ["+U+"]; return false; ":g+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+=" } ",Z&&(g+=" else { ")}else Z&&(g+=" if (true) { ");return g}},"./packages/node_modules/ajv/lib/dotjs/validate.js":function(r){"use strict";r.exports=function generate_validate(r,a,d){var h="",g=!0===r.schema.$async,y=r.util.schemaHasRulesExcept(r.schema,r.RULES.all,"$ref"),_=r.self._getId(r.schema);if(r.opts.strictKeywords){var b=r.util.schemaUnknownRules(r.schema,r.RULES.keywords);if(b){var P="unknown keyword: "+b;if("log"!==r.opts.strictKeywords)throw new Error(P);r.logger.warn(P)}}if(r.isTop&&(h+=" var validate = ",g&&(r.async=!0,h+="async "),h+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",_&&(r.opts.sourceCode||r.opts.processCode)&&(h+=" /*# sourceURL="+_+" */ ")),"boolean"==typeof r.schema||!y&&!r.schema.$ref){a="false schema";var j=r.level,Z=r.dataLevel,D=r.schema[a],N=r.schemaPath+r.util.getProperty(a),$=r.errSchemaPath+"/"+a,z=!r.opts.allErrors,L="data"+(Z||""),F="valid"+j;if(!1===r.schema){r.isTop?z=!0:h+=" var "+F+" = false; ",(pt=pt||[]).push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString($)+" , params: {} ",!1!==r.opts.messages&&(h+=" , message: 'boolean schema is false' "),r.opts.verbose&&(h+=" , schema: false , parentSchema: validate.schema"+r.schemaPath+" , data: "+L+" "),h+=" } "):h+=" {} ";var M=h;h=pt.pop(),!r.compositeRule&&z?r.async?h+=" throw new ValidationError(["+M+"]); ":h+=" validate.errors = ["+M+"]; return false; ":h+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else r.isTop?h+=g?" return data; ":" validate.errors = null; return true; ":h+=" var "+F+" = true; ";return r.isTop&&(h+=" }; return validate; "),h}if(r.isTop){var U=r.isTop;j=r.level=0,Z=r.dataLevel=0,L="data";if(r.rootId=r.resolve.fullPath(r.self._getId(r.root.schema)),r.baseId=r.baseId||r.rootId,delete r.isTop,r.dataPathArr=[""],void 0!==r.schema.default&&r.opts.useDefaults&&r.opts.strictDefaults){var q="default is ignored in the schema root";if("log"!==r.opts.strictDefaults)throw new Error(q);r.logger.warn(q)}h+=" var vErrors = null; ",h+=" var errors = 0; ",h+=" if (rootData === undefined) rootData = data; "}else{j=r.level,L="data"+((Z=r.dataLevel)||"");if(_&&(r.baseId=r.resolve.url(r.baseId,_)),g&&!r.async)throw new Error("async schema in sync schema");h+=" var errs_"+j+" = errors;"}F="valid"+j,z=!r.opts.allErrors;var V="",K="",H=r.schema.type,B=Array.isArray(H);if(H&&r.opts.nullable&&!0===r.schema.nullable&&(B?-1==H.indexOf("null")&&(H=H.concat("null")):"null"!=H&&(H=[H,"null"],B=!0)),B&&1==H.length&&(H=H[0],B=!1),r.schema.$ref&&y){if("fail"==r.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+r.errSchemaPath+'" (see option extendRefs)');!0!==r.opts.extendRefs&&(y=!1,r.logger.warn('$ref: keywords ignored in schema at path "'+r.errSchemaPath+'"'))}if(r.schema.$comment&&r.opts.$comment&&(h+=" "+r.RULES.all.$comment.code(r,"$comment")),H){if(r.opts.coerceTypes)var G=r.util.coerceToTypes(r.opts.coerceTypes,H);var ze=r.RULES.types[H];if(G||B||!0===ze||ze&&!$shouldUseGroup(ze)){N=r.schemaPath+".type",$=r.errSchemaPath+"/type",N=r.schemaPath+".type",$=r.errSchemaPath+"/type";var Fe=B?"checkDataTypes":"checkDataType";if(h+=" if ("+r.util[Fe](H,L,r.opts.strictNumbers,!0)+") { ",G){var Ue="dataType"+j,qe="coerced"+j;h+=" var "+Ue+" = typeof "+L+"; var "+qe+" = undefined; ","array"==r.opts.coerceTypes&&(h+=" if ("+Ue+" == 'object' && Array.isArray("+L+") && "+L+".length == 1) { "+L+" = "+L+"[0]; "+Ue+" = typeof "+L+"; if ("+r.util.checkDataType(r.schema.type,L,r.opts.strictNumbers)+") "+qe+" = "+L+"; } "),h+=" if ("+qe+" !== undefined) ; ";var Ve=G;if(Ve)for(var Ke,He=-1,Be=Ve.length-1;He<Be;)"string"==(Ke=Ve[He+=1])?h+=" else if ("+Ue+" == 'number' || "+Ue+" == 'boolean') "+qe+" = '' + "+L+"; else if ("+L+" === null) "+qe+" = ''; ":"number"==Ke||"integer"==Ke?(h+=" else if ("+Ue+" == 'boolean' || "+L+" === null || ("+Ue+" == 'string' && "+L+" && "+L+" == +"+L+" ","integer"==Ke&&(h+=" && !("+L+" % 1)"),h+=")) "+qe+" = +"+L+"; "):"boolean"==Ke?h+=" else if ("+L+" === 'false' || "+L+" === 0 || "+L+" === null) "+qe+" = false; else if ("+L+" === 'true' || "+L+" === 1) "+qe+" = true; ":"null"==Ke?h+=" else if ("+L+" === '' || "+L+" === 0 || "+L+" === false) "+qe+" = null; ":"array"==r.opts.coerceTypes&&"array"==Ke&&(h+=" else if ("+Ue+" == 'string' || "+Ue+" == 'number' || "+Ue+" == 'boolean' || "+L+" == null) "+qe+" = ["+L+"]; ");h+=" else { ",(pt=pt||[]).push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'type' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString($)+" , params: { type: '",h+=B?""+H.join(","):""+H,h+="' } ",!1!==r.opts.messages&&(h+=" , message: 'should be ",h+=B?""+H.join(","):""+H,h+="' "),r.opts.verbose&&(h+=" , schema: validate.schema"+N+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+L+" "),h+=" } "):h+=" {} ";M=h;h=pt.pop(),!r.compositeRule&&z?r.async?h+=" throw new ValidationError(["+M+"]); ":h+=" validate.errors = ["+M+"]; return false; ":h+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" } if ("+qe+" !== undefined) { ";var Qe=Z?"data"+(Z-1||""):"parentData";h+=" "+L+" = "+qe+"; ",Z||(h+="if ("+Qe+" !== undefined)"),h+=" "+Qe+"["+(Z?r.dataPathArr[Z]:"parentDataProperty")+"] = "+qe+"; } "}else{(pt=pt||[]).push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'type' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString($)+" , params: { type: '",h+=B?""+H.join(","):""+H,h+="' } ",!1!==r.opts.messages&&(h+=" , message: 'should be ",h+=B?""+H.join(","):""+H,h+="' "),r.opts.verbose&&(h+=" , schema: validate.schema"+N+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+L+" "),h+=" } "):h+=" {} ";M=h;h=pt.pop(),!r.compositeRule&&z?r.async?h+=" throw new ValidationError(["+M+"]); ":h+=" validate.errors = ["+M+"]; return false; ":h+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}h+=" } "}}if(r.schema.$ref&&!y)h+=" "+r.RULES.all.$ref.code(r,"$ref")+" ",z&&(h+=" } if (errors === ",h+=U?"0":"errs_"+j,h+=") { ",K+="}");else{var Je=r.RULES;if(Je)for(var We=-1,Ye=Je.length-1;We<Ye;)if($shouldUseGroup(ze=Je[We+=1])){if(ze.type&&(h+=" if ("+r.util.checkDataType(ze.type,L,r.opts.strictNumbers)+") { "),r.opts.useDefaults)if("object"==ze.type&&r.schema.properties){D=r.schema.properties;var Xe=Object.keys(D);if(Xe)for(var et,tt=-1,rt=Xe.length-1;tt<rt;){if(void 0!==(nt=D[et=Xe[tt+=1]]).default){var st=L+r.util.getProperty(et);if(r.compositeRule){if(r.opts.strictDefaults){q="default is ignored for: "+st;if("log"!==r.opts.strictDefaults)throw new Error(q);r.logger.warn(q)}}else h+=" if ("+st+" === undefined ","empty"==r.opts.useDefaults&&(h+=" || "+st+" === null || "+st+" === '' "),h+=" ) "+st+" = ","shared"==r.opts.useDefaults?h+=" "+r.useDefault(nt.default)+" ":h+=" "+JSON.stringify(nt.default)+" ",h+="; "}}}else if("array"==ze.type&&Array.isArray(r.schema.items)){var at=r.schema.items;if(at){He=-1;for(var nt,ot=at.length-1;He<ot;)if(void 0!==(nt=at[He+=1]).default){st=L+"["+He+"]";if(r.compositeRule){if(r.opts.strictDefaults){q="default is ignored for: "+st;if("log"!==r.opts.strictDefaults)throw new Error(q);r.logger.warn(q)}}else h+=" if ("+st+" === undefined ","empty"==r.opts.useDefaults&&(h+=" || "+st+" === null || "+st+" === '' "),h+=" ) "+st+" = ","shared"==r.opts.useDefaults?h+=" "+r.useDefault(nt.default)+" ":h+=" "+JSON.stringify(nt.default)+" ",h+="; "}}}var it=ze.rules;if(it)for(var dt,ct=-1,ut=it.length-1;ct<ut;)if($shouldUseRule(dt=it[ct+=1])){var lt=dt.code(r,dt.keyword,ze.type);lt&&(h+=" "+lt+" ",z&&(V+="}"))}if(z&&(h+=" "+V+" ",V=""),ze.type&&(h+=" } ",H&&H===ze.type&&!G)){h+=" else { ";var pt;N=r.schemaPath+".type",$=r.errSchemaPath+"/type";(pt=pt||[]).push(h),h="",!1!==r.createErrors?(h+=" { keyword: 'type' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString($)+" , params: { type: '",h+=B?""+H.join(","):""+H,h+="' } ",!1!==r.opts.messages&&(h+=" , message: 'should be ",h+=B?""+H.join(","):""+H,h+="' "),r.opts.verbose&&(h+=" , schema: validate.schema"+N+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+L+" "),h+=" } "):h+=" {} ";M=h;h=pt.pop(),!r.compositeRule&&z?r.async?h+=" throw new ValidationError(["+M+"]); ":h+=" validate.errors = ["+M+"]; return false; ":h+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" } "}z&&(h+=" if (errors === ",h+=U?"0":"errs_"+j,h+=") { ",K+="}")}}function $shouldUseGroup(r){for(var a=r.rules,d=0;d<a.length;d++)if($shouldUseRule(a[d]))return!0}function $shouldUseRule(a){return void 0!==r.schema[a.keyword]||a.implements&&function $ruleImplementsSomeKeyword(a){for(var d=a.implements,h=0;h<d.length;h++)if(void 0!==r.schema[d[h]])return!0}(a)}return z&&(h+=" "+K+" "),U?(g?(h+=" if (errors === 0) return data; ",h+=" else throw new ValidationError(vErrors); "):(h+=" validate.errors = vErrors; ",h+=" return errors === 0; "),h+=" }; return validate;"):h+=" var "+F+" = errors === errs_"+j+";",h}},"./packages/node_modules/ajv/lib/keyword.js":function(r,a,d){"use strict";var h=/^[a-z_$][a-z0-9_$-]*$/i,g=d("./packages/node_modules/ajv/lib/dotjs/custom.js"),y=d("./packages/node_modules/ajv/lib/definition_schema.js");r.exports={add:function addKeyword(r,a){var d=this.RULES;if(d.keywords[r])throw new Error("Keyword "+r+" is already defined");if(!h.test(r))throw new Error("Keyword "+r+" is not a valid identifier");if(a){this.validateKeyword(a,!0);var y=a.type;if(Array.isArray(y))for(var _=0;_<y.length;_++)_addRule(r,y[_],a);else _addRule(r,y,a);var b=a.metaSchema;b&&(a.$data&&this._opts.$data&&(b={anyOf:[b,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),a.validateSchema=this.compile(b,!0))}function _addRule(r,a,h){for(var y,_=0;_<d.length;_++){var b=d[_];if(b.type==a){y=b;break}}y||(y={type:a,rules:[]},d.push(y));var P={keyword:r,definition:h,custom:!0,code:g,implements:h.implements};y.rules.push(P),d.custom[r]=P}return d.keywords[r]=d.all[r]=!0,this},get:function getKeyword(r){var a=this.RULES.custom[r];return a?a.definition:this.RULES.keywords[r]||!1},remove:function removeKeyword(r){var a=this.RULES;delete a.keywords[r],delete a.all[r],delete a.custom[r];for(var d=0;d<a.length;d++)for(var h=a[d].rules,g=0;g<h.length;g++)if(h[g].keyword==r){h.splice(g,1);break}return this},validate:function validateKeyword(r,a){validateKeyword.errors=null;var d=this._validateKeyword=this._validateKeyword||this.compile(y,!0);if(d(r))return!0;if(validateKeyword.errors=d.errors,a)throw new Error("custom keyword definition is invalid: "+this.errorsText(d.errors));return!1}}},"./packages/node_modules/ajv/lib/refs/data.json":function(r){"use strict";r.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},"./packages/node_modules/ajv/lib/refs/json-schema-draft-07.json":function(r){"use strict";r.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},"./packages/node_modules/fast-deep-equal/index.js":function(r){"use strict";r.exports=function equal(r,a){if(r===a)return!0;if(r&&a&&"object"==typeof r&&"object"==typeof a){if(r.constructor!==a.constructor)return!1;var d,h,g;if(Array.isArray(r)){if((d=r.length)!=a.length)return!1;for(h=d;0!==h--;)if(!equal(r[h],a[h]))return!1;return!0}if(r.constructor===RegExp)return r.source===a.source&&r.flags===a.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===a.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===a.toString();if((d=(g=Object.keys(r)).length)!==Object.keys(a).length)return!1;for(h=d;0!==h--;)if(!Object.prototype.hasOwnProperty.call(a,g[h]))return!1;for(h=d;0!==h--;){var y=g[h];if(!equal(r[y],a[y]))return!1}return!0}return r!=r&&a!=a}},"./packages/node_modules/fast-json-stable-stringify/index.js":function(r){"use strict";r.exports=function(r,a){a||(a={}),"function"==typeof a&&(a={cmp:a});var d,h="boolean"==typeof a.cycles&&a.cycles,g=a.cmp&&(d=a.cmp,function(r){return function(a,h){var g={key:a,value:r[a]},y={key:h,value:r[h]};return d(g,y)}}),y=[];return function stringify(r){if(r&&r.toJSON&&"function"==typeof r.toJSON&&(r=r.toJSON()),void 0!==r){if("number"==typeof r)return isFinite(r)?""+r:"null";if("object"!=typeof r)return JSON.stringify(r);var a,d;if(Array.isArray(r)){for(d="[",a=0;a<r.length;a++)a&&(d+=","),d+=stringify(r[a])||"null";return d+"]"}if(null===r)return"null";if(-1!==y.indexOf(r)){if(h)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var _=y.push(r)-1,b=Object.keys(r).sort(g&&g(r));for(d="",a=0;a<b.length;a++){var P=b[a],j=stringify(r[P]);j&&(d&&(d+=","),d+=JSON.stringify(P)+":"+j)}return y.splice(_,1),"{"+d+"}"}}(r)}},"./packages/node_modules/json-schema-traverse/index.js":function(r){"use strict";var a=r.exports=function(r,a,d){"function"==typeof a&&(d=a,a={}),_traverse(a,"function"==typeof(d=a.cb||d)?d:d.pre||function(){},d.post||function(){},r,"",r)};function _traverse(r,d,h,g,y,_,b,P,j,Z){if(g&&"object"==typeof g&&!Array.isArray(g)){for(var D in d(g,y,_,b,P,j,Z),g){var N=g[D];if(Array.isArray(N)){if(D in a.arrayKeywords)for(var $=0;$<N.length;$++)_traverse(r,d,h,N[$],y+"/"+D+"/"+$,_,y,D,g,$)}else if(D in a.propsKeywords){if(N&&"object"==typeof N)for(var z in N)_traverse(r,d,h,N[z],y+"/"+D+"/"+escapeJsonPtr(z),_,y,D,g,z)}else(D in a.keywords||r.allKeys&&!(D in a.skipKeywords))&&_traverse(r,d,h,N,y+"/"+D,_,y,D,g)}h(g,y,_,b,P,j,Z)}}function escapeJsonPtr(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}a.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},a.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},a.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},a.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}},"./packages/node_modules/uri-js/dist/es5/uri.all.js":function(r,a){!function(r){"use strict";function merge(){for(var r=arguments.length,a=Array(r),d=0;d<r;d++)a[d]=arguments[d];if(a.length>1){a[0]=a[0].slice(0,-1);for(var h=a.length-1,g=1;g<h;++g)a[g]=a[g].slice(1,-1);return a[h]=a[h].slice(1),a.join("")}return a[0]}function subexp(r){return"(?:"+r+")"}function typeOf(r){return void 0===r?"undefined":null===r?"null":Object.prototype.toString.call(r).split(" ").pop().split("]").shift().toLowerCase()}function toUpperCase(r){return r.toUpperCase()}function toArray(r){return null!=r?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[]}function assign(r,a){var d=r;if(a)for(var h in a)d[h]=a[h];return d}function buildExps(r){var a="[A-Za-z]",d="[0-9]",h=merge(d,"[A-Fa-f]"),g=subexp(subexp("%[EFef]"+h+"%"+h+h+"%"+h+h)+"|"+subexp("%[89A-Fa-f]"+h+"%"+h+h)+"|"+subexp("%"+h+h)),y="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",_=merge("[\\:\\/\\?\\#\\[\\]\\@]",y),b=r?"[\\uE000-\\uF8FF]":"[]",P=merge(a,d,"[\\-\\.\\_\\~]",r?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),j=subexp(a+merge(a,d,"[\\+\\-\\.]")+"*"),Z=subexp(subexp(g+"|"+merge(P,y,"[\\:]"))+"*"),D=(subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+d)+"|"+subexp("1"+d+d)+"|"+subexp("[1-9]"+d)+"|"+d),subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+d)+"|"+subexp("1"+d+d)+"|"+subexp("0?[1-9]"+d)+"|0?0?"+d)),N=subexp(D+"\\."+D+"\\."+D+"\\."+D),$=subexp(h+"{1,4}"),z=subexp(subexp($+"\\:"+$)+"|"+N),L=subexp(subexp($+"\\:")+"{6}"+z),F=subexp("\\:\\:"+subexp($+"\\:")+"{5}"+z),M=subexp(subexp($)+"?\\:\\:"+subexp($+"\\:")+"{4}"+z),U=subexp(subexp(subexp($+"\\:")+"{0,1}"+$)+"?\\:\\:"+subexp($+"\\:")+"{3}"+z),q=subexp(subexp(subexp($+"\\:")+"{0,2}"+$)+"?\\:\\:"+subexp($+"\\:")+"{2}"+z),V=subexp(subexp(subexp($+"\\:")+"{0,3}"+$)+"?\\:\\:"+$+"\\:"+z),K=subexp(subexp(subexp($+"\\:")+"{0,4}"+$)+"?\\:\\:"+z),H=subexp(subexp(subexp($+"\\:")+"{0,5}"+$)+"?\\:\\:"+$),B=subexp(subexp(subexp($+"\\:")+"{0,6}"+$)+"?\\:\\:"),G=subexp([L,F,M,U,q,V,K,H,B].join("|")),ze=subexp(subexp(P+"|"+g)+"+"),Fe=(subexp(G+"\\%25"+ze),subexp(G+subexp("\\%25|\\%(?!"+h+"{2})")+ze)),Ue=subexp("[vV]"+h+"+\\."+merge(P,y,"[\\:]")+"+"),qe=subexp("\\["+subexp(Fe+"|"+G+"|"+Ue)+"\\]"),Ve=subexp(subexp(g+"|"+merge(P,y))+"*"),Ke=subexp(qe+"|"+N+"(?!"+Ve+")|"+Ve),He=subexp(d+"*"),Be=subexp(subexp(Z+"@")+"?"+Ke+subexp("\\:"+He)+"?"),Qe=subexp(g+"|"+merge(P,y,"[\\:\\@]")),Je=subexp(Qe+"*"),We=subexp(Qe+"+"),Ye=subexp(subexp(g+"|"+merge(P,y,"[\\@]"))+"+"),Xe=subexp(subexp("\\/"+Je)+"*"),et=subexp("\\/"+subexp(We+Xe)+"?"),tt=subexp(Ye+Xe),rt=subexp(We+Xe),st="(?!"+Qe+")",at=(subexp(Xe+"|"+et+"|"+tt+"|"+rt+"|"+st),subexp(subexp(Qe+"|"+merge("[\\/\\?]",b))+"*")),nt=subexp(subexp(Qe+"|[\\/\\?]")+"*"),ot=subexp(subexp("\\/\\/"+Be+Xe)+"|"+et+"|"+rt+"|"+st),it=subexp(j+"\\:"+ot+subexp("\\?"+at)+"?"+subexp("\\#"+nt)+"?"),dt=subexp(subexp("\\/\\/"+Be+Xe)+"|"+et+"|"+tt+"|"+st),ct=subexp(dt+subexp("\\?"+at)+"?"+subexp("\\#"+nt)+"?");return subexp(it+"|"+ct),subexp(j+"\\:"+ot+subexp("\\?"+at)+"?"),subexp(subexp("\\/\\/("+subexp("("+Z+")@")+"?("+Ke+")"+subexp("\\:("+He+")")+"?)")+"?("+Xe+"|"+et+"|"+rt+"|"+st+")"),subexp("\\?("+at+")"),subexp("\\#("+nt+")"),subexp(subexp("\\/\\/("+subexp("("+Z+")@")+"?("+Ke+")"+subexp("\\:("+He+")")+"?)")+"?("+Xe+"|"+et+"|"+tt+"|"+st+")"),subexp("\\?("+at+")"),subexp("\\#("+nt+")"),subexp(subexp("\\/\\/("+subexp("("+Z+")@")+"?("+Ke+")"+subexp("\\:("+He+")")+"?)")+"?("+Xe+"|"+et+"|"+rt+"|"+st+")"),subexp("\\?("+at+")"),subexp("\\#("+nt+")"),subexp("("+Z+")@"),subexp("\\:("+He+")"),{NOT_SCHEME:new RegExp(merge("[^]",a,d,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(merge("[^\\%\\:]",P,y),"g"),NOT_HOST:new RegExp(merge("[^\\%\\[\\]\\:]",P,y),"g"),NOT_PATH:new RegExp(merge("[^\\%\\/\\:\\@]",P,y),"g"),NOT_PATH_NOSCHEME:new RegExp(merge("[^\\%\\/\\@]",P,y),"g"),NOT_QUERY:new RegExp(merge("[^\\%]",P,y,"[\\:\\@\\/\\?]",b),"g"),NOT_FRAGMENT:new RegExp(merge("[^\\%]",P,y,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(merge("[^]",P,y),"g"),UNRESERVED:new RegExp(P,"g"),OTHER_CHARS:new RegExp(merge("[^\\%]",P,_),"g"),PCT_ENCODED:new RegExp(g,"g"),IPV4ADDRESS:new RegExp("^("+N+")$"),IPV6ADDRESS:new RegExp("^\\[?("+G+")"+subexp(subexp("\\%25|\\%(?!"+h+"{2})")+"("+ze+")")+"?\\]?$")}}var a=buildExps(!1),d=buildExps(!0),h=function(){function sliceIterator(r,a){var d=[],h=!0,g=!1,y=void 0;try{for(var _,b=r[Symbol.iterator]();!(h=(_=b.next()).done)&&(d.push(_.value),!a||d.length!==a);h=!0);}catch(r){g=!0,y=r}finally{try{!h&&b.return&&b.return()}finally{if(g)throw y}}return d}return function(r,a){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return sliceIterator(r,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),toConsumableArray=function(r){if(Array.isArray(r)){for(var a=0,d=Array(r.length);a<r.length;a++)d[a]=r[a];return d}return Array.from(r)},g=2147483647,y=36,_=1,b=26,P=38,j=700,Z=72,D=128,N="-",$=/^xn--/,z=/[^\0-\x7E]/,L=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=y-_,U=Math.floor,q=String.fromCharCode;function error$1(r){throw new RangeError(F[r])}function map(r,a){for(var d=[],h=r.length;h--;)d[h]=a(r[h]);return d}function mapDomain(r,a){var d=r.split("@"),h="";return d.length>1&&(h=d[0]+"@",r=d[1]),h+map((r=r.replace(L,".")).split("."),a).join(".")}function ucs2decode(r){for(var a=[],d=0,h=r.length;d<h;){var g=r.charCodeAt(d++);if(g>=55296&&g<=56319&&d<h){var y=r.charCodeAt(d++);56320==(64512&y)?a.push(((1023&g)<<10)+(1023&y)+65536):(a.push(g),d--)}else a.push(g)}return a}var V=function basicToDigit(r){return r-48<10?r-22:r-65<26?r-65:r-97<26?r-97:y},K=function digitToBasic(r,a){return r+22+75*(r<26)-((0!=a)<<5)},H=function adapt(r,a,d){var h=0;for(r=d?U(r/j):r>>1,r+=U(r/a);r>M*b>>1;h+=y)r=U(r/M);return U(h+(M+1)*r/(r+P))},B=function decode(r){var a=[],d=r.length,h=0,P=D,j=Z,$=r.lastIndexOf(N);$<0&&($=0);for(var z=0;z<$;++z)r.charCodeAt(z)>=128&&error$1("not-basic"),a.push(r.charCodeAt(z));for(var L=$>0?$+1:0;L<d;){for(var F=h,M=1,q=y;;q+=y){L>=d&&error$1("invalid-input");var K=V(r.charCodeAt(L++));(K>=y||K>U((g-h)/M))&&error$1("overflow"),h+=K*M;var B=q<=j?_:q>=j+b?b:q-j;if(K<B)break;var G=y-B;M>U(g/G)&&error$1("overflow"),M*=G}var ze=a.length+1;j=H(h-F,ze,0==F),U(h/ze)>g-P&&error$1("overflow"),P+=U(h/ze),h%=ze,a.splice(h++,0,P)}return String.fromCodePoint.apply(String,a)},G=function encode(r){var a=[],d=(r=ucs2decode(r)).length,h=D,P=0,j=Z,$=!0,z=!1,L=void 0;try{for(var F,M=r[Symbol.iterator]();!($=(F=M.next()).done);$=!0){var V=F.value;V<128&&a.push(q(V))}}catch(r){z=!0,L=r}finally{try{!$&&M.return&&M.return()}finally{if(z)throw L}}var B=a.length,G=B;for(B&&a.push(N);G<d;){var ze=g,Fe=!0,Ue=!1,qe=void 0;try{for(var Ve,Ke=r[Symbol.iterator]();!(Fe=(Ve=Ke.next()).done);Fe=!0){var He=Ve.value;He>=h&&He<ze&&(ze=He)}}catch(r){Ue=!0,qe=r}finally{try{!Fe&&Ke.return&&Ke.return()}finally{if(Ue)throw qe}}var Be=G+1;ze-h>U((g-P)/Be)&&error$1("overflow"),P+=(ze-h)*Be,h=ze;var Qe=!0,Je=!1,We=void 0;try{for(var Ye,Xe=r[Symbol.iterator]();!(Qe=(Ye=Xe.next()).done);Qe=!0){var et=Ye.value;if(et<h&&++P>g&&error$1("overflow"),et==h){for(var tt=P,rt=y;;rt+=y){var st=rt<=j?_:rt>=j+b?b:rt-j;if(tt<st)break;var at=tt-st,nt=y-st;a.push(q(K(st+at%nt,0))),tt=U(at/nt)}a.push(q(K(tt,0))),j=H(P,Be,G==B),P=0,++G}}}catch(r){Je=!0,We=r}finally{try{!Qe&&Xe.return&&Xe.return()}finally{if(Je)throw We}}++P,++h}return a.join("")},ze=function toUnicode(r){return mapDomain(r,function(r){return $.test(r)?B(r.slice(4).toLowerCase()):r})},Fe=function toASCII(r){return mapDomain(r,function(r){return z.test(r)?"xn--"+G(r):r})},Ue={version:"2.1.0",ucs2:{decode:ucs2decode,encode:function ucs2encode(r){return String.fromCodePoint.apply(String,toConsumableArray(r))}},decode:B,encode:G,toASCII:Fe,toUnicode:ze},qe={};function pctEncChar(r){var a=r.charCodeAt(0);return a<16?"%0"+a.toString(16).toUpperCase():a<128?"%"+a.toString(16).toUpperCase():a<2048?"%"+(a>>6|192).toString(16).toUpperCase()+"%"+(63&a|128).toString(16).toUpperCase():"%"+(a>>12|224).toString(16).toUpperCase()+"%"+(a>>6&63|128).toString(16).toUpperCase()+"%"+(63&a|128).toString(16).toUpperCase()}function pctDecChars(r){for(var a="",d=0,h=r.length;d<h;){var g=parseInt(r.substr(d+1,2),16);if(g<128)a+=String.fromCharCode(g),d+=3;else if(g>=194&&g<224){if(h-d>=6){var y=parseInt(r.substr(d+4,2),16);a+=String.fromCharCode((31&g)<<6|63&y)}else a+=r.substr(d,6);d+=6}else if(g>=224){if(h-d>=9){var _=parseInt(r.substr(d+4,2),16),b=parseInt(r.substr(d+7,2),16);a+=String.fromCharCode((15&g)<<12|(63&_)<<6|63&b)}else a+=r.substr(d,9);d+=9}else a+=r.substr(d,3),d+=3}return a}function _normalizeComponentEncoding(r,a){function decodeUnreserved(r){var d=pctDecChars(r);return d.match(a.UNRESERVED)?d:r}return r.scheme&&(r.scheme=String(r.scheme).replace(a.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(a.NOT_SCHEME,"")),void 0!==r.userinfo&&(r.userinfo=String(r.userinfo).replace(a.PCT_ENCODED,decodeUnreserved).replace(a.NOT_USERINFO,pctEncChar).replace(a.PCT_ENCODED,toUpperCase)),void 0!==r.host&&(r.host=String(r.host).replace(a.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(a.NOT_HOST,pctEncChar).replace(a.PCT_ENCODED,toUpperCase)),void 0!==r.path&&(r.path=String(r.path).replace(a.PCT_ENCODED,decodeUnreserved).replace(r.scheme?a.NOT_PATH:a.NOT_PATH_NOSCHEME,pctEncChar).replace(a.PCT_ENCODED,toUpperCase)),void 0!==r.query&&(r.query=String(r.query).replace(a.PCT_ENCODED,decodeUnreserved).replace(a.NOT_QUERY,pctEncChar).replace(a.PCT_ENCODED,toUpperCase)),void 0!==r.fragment&&(r.fragment=String(r.fragment).replace(a.PCT_ENCODED,decodeUnreserved).replace(a.NOT_FRAGMENT,pctEncChar).replace(a.PCT_ENCODED,toUpperCase)),r}function _stripLeadingZeros(r){return r.replace(/^0*(.*)/,"$1")||"0"}function _normalizeIPv4(r,a){var d=r.match(a.IPV4ADDRESS)||[],g=h(d,2)[1];return g?g.split(".").map(_stripLeadingZeros).join("."):r}function _normalizeIPv6(r,a){var d=r.match(a.IPV6ADDRESS)||[],g=h(d,3),y=g[1],_=g[2];if(y){for(var b=y.toLowerCase().split("::").reverse(),P=h(b,2),j=P[0],Z=P[1],D=Z?Z.split(":").map(_stripLeadingZeros):[],N=j.split(":").map(_stripLeadingZeros),$=a.IPV4ADDRESS.test(N[N.length-1]),z=$?7:8,L=N.length-z,F=Array(z),M=0;M<z;++M)F[M]=D[M]||N[L+M]||"";$&&(F[z-1]=_normalizeIPv4(F[z-1],a));var U=F.reduce(function(r,a,d){if(!a||"0"===a){var h=r[r.length-1];h&&h.index+h.length===d?h.length++:r.push({index:d,length:1})}return r},[]).sort(function(r,a){return a.length-r.length})[0],q=void 0;if(U&&U.length>1){var V=F.slice(0,U.index),K=F.slice(U.index+U.length);q=V.join(":")+"::"+K.join(":")}else q=F.join(":");return _&&(q+="%"+_),q}return r}var Ve=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Ke=void 0==="".match(/(){0}/)[1];function parse(r){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g={},y=!1!==h.iri?d:a;"suffix"===h.reference&&(r=(h.scheme?h.scheme+":":"")+"//"+r);var _=r.match(Ve);if(_){Ke?(g.scheme=_[1],g.userinfo=_[3],g.host=_[4],g.port=parseInt(_[5],10),g.path=_[6]||"",g.query=_[7],g.fragment=_[8],isNaN(g.port)&&(g.port=_[5])):(g.scheme=_[1]||void 0,g.userinfo=-1!==r.indexOf("@")?_[3]:void 0,g.host=-1!==r.indexOf("//")?_[4]:void 0,g.port=parseInt(_[5],10),g.path=_[6]||"",g.query=-1!==r.indexOf("?")?_[7]:void 0,g.fragment=-1!==r.indexOf("#")?_[8]:void 0,isNaN(g.port)&&(g.port=r.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?_[4]:void 0)),g.host&&(g.host=_normalizeIPv6(_normalizeIPv4(g.host,y),y)),void 0!==g.scheme||void 0!==g.userinfo||void 0!==g.host||void 0!==g.port||g.path||void 0!==g.query?void 0===g.scheme?g.reference="relative":void 0===g.fragment?g.reference="absolute":g.reference="uri":g.reference="same-document",h.reference&&"suffix"!==h.reference&&h.reference!==g.reference&&(g.error=g.error||"URI is not a "+h.reference+" reference.");var b=qe[(h.scheme||g.scheme||"").toLowerCase()];if(h.unicodeSupport||b&&b.unicodeSupport)_normalizeComponentEncoding(g,y);else{if(g.host&&(h.domainHost||b&&b.domainHost))try{g.host=Ue.toASCII(g.host.replace(y.PCT_ENCODED,pctDecChars).toLowerCase())}catch(r){g.error=g.error||"Host's domain name can not be converted to ASCII via punycode: "+r}_normalizeComponentEncoding(g,a)}b&&b.parse&&b.parse(g,h)}else g.error=g.error||"URI can not be parsed.";return g}function _recomposeAuthority(r,h){var g=!1!==h.iri?d:a,y=[];return void 0!==r.userinfo&&(y.push(r.userinfo),y.push("@")),void 0!==r.host&&y.push(_normalizeIPv6(_normalizeIPv4(String(r.host),g),g).replace(g.IPV6ADDRESS,function(r,a,d){return"["+a+(d?"%25"+d:"")+"]"})),"number"!=typeof r.port&&"string"!=typeof r.port||(y.push(":"),y.push(String(r.port))),y.length?y.join(""):void 0}var He=/^\.\.?\//,Be=/^\/\.(\/|$)/,Qe=/^\/\.\.(\/|$)/,Je=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(r){for(var a=[];r.length;)if(r.match(He))r=r.replace(He,"");else if(r.match(Be))r=r.replace(Be,"/");else if(r.match(Qe))r=r.replace(Qe,"/"),a.pop();else if("."===r||".."===r)r="";else{var d=r.match(Je);if(!d)throw new Error("Unexpected dot segment condition");var h=d[0];r=r.slice(h.length),a.push(h)}return a.join("")}function serialize(r){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=h.iri?d:a,y=[],_=qe[(h.scheme||r.scheme||"").toLowerCase()];if(_&&_.serialize&&_.serialize(r,h),r.host)if(g.IPV6ADDRESS.test(r.host));else if(h.domainHost||_&&_.domainHost)try{r.host=h.iri?Ue.toUnicode(r.host):Ue.toASCII(r.host.replace(g.PCT_ENCODED,pctDecChars).toLowerCase())}catch(a){r.error=r.error||"Host's domain name can not be converted to "+(h.iri?"Unicode":"ASCII")+" via punycode: "+a}_normalizeComponentEncoding(r,g),"suffix"!==h.reference&&r.scheme&&(y.push(r.scheme),y.push(":"));var b=_recomposeAuthority(r,h);if(void 0!==b&&("suffix"!==h.reference&&y.push("//"),y.push(b),r.path&&"/"!==r.path.charAt(0)&&y.push("/")),void 0!==r.path){var P=r.path;h.absolutePath||_&&_.absolutePath||(P=removeDotSegments(P)),void 0===b&&(P=P.replace(/^\/\//,"/%2F")),y.push(P)}return void 0!==r.query&&(y.push("?"),y.push(r.query)),void 0!==r.fragment&&(y.push("#"),y.push(r.fragment)),y.join("")}function resolveComponents(r,a){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},h={};return arguments[3]||(r=parse(serialize(r,d),d),a=parse(serialize(a,d),d)),!(d=d||{}).tolerant&&a.scheme?(h.scheme=a.scheme,h.userinfo=a.userinfo,h.host=a.host,h.port=a.port,h.path=removeDotSegments(a.path||""),h.query=a.query):(void 0!==a.userinfo||void 0!==a.host||void 0!==a.port?(h.userinfo=a.userinfo,h.host=a.host,h.port=a.port,h.path=removeDotSegments(a.path||""),h.query=a.query):(a.path?("/"===a.path.charAt(0)?h.path=removeDotSegments(a.path):(void 0===r.userinfo&&void 0===r.host&&void 0===r.port||r.path?r.path?h.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+a.path:h.path=a.path:h.path="/"+a.path,h.path=removeDotSegments(h.path)),h.query=a.query):(h.path=r.path,void 0!==a.query?h.query=a.query:h.query=r.query),h.userinfo=r.userinfo,h.host=r.host,h.port=r.port),h.scheme=r.scheme),h.fragment=a.fragment,h}function resolve(r,a,d){var h=assign({scheme:"null"},d);return serialize(resolveComponents(parse(r,h),parse(a,h),h,!0),h)}function normalize(r,a){return"string"==typeof r?r=serialize(parse(r,a),a):"object"===typeOf(r)&&(r=parse(serialize(r,a),a)),r}function equal(r,a,d){return"string"==typeof r?r=serialize(parse(r,d),d):"object"===typeOf(r)&&(r=serialize(r,d)),"string"==typeof a?a=serialize(parse(a,d),d):"object"===typeOf(a)&&(a=serialize(a,d)),r===a}function escapeComponent(r,h){return r&&r.toString().replace(h&&h.iri?d.ESCAPE:a.ESCAPE,pctEncChar)}function unescapeComponent(r,h){return r&&r.toString().replace(h&&h.iri?d.PCT_ENCODED:a.PCT_ENCODED,pctDecChars)}var We={scheme:"http",domainHost:!0,parse:function parse(r,a){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r},serialize:function serialize(r,a){var d="https"===String(r.scheme).toLowerCase();return r.port!==(d?443:80)&&""!==r.port||(r.port=void 0),r.path||(r.path="/"),r}},Ye={scheme:"https",domainHost:We.domainHost,parse:We.parse,serialize:We.serialize};function isSecure(r){return"boolean"==typeof r.secure?r.secure:"wss"===String(r.scheme).toLowerCase()}var Xe={scheme:"ws",domainHost:!0,parse:function parse(r,a){var d=r;return d.secure=isSecure(d),d.resourceName=(d.path||"/")+(d.query?"?"+d.query:""),d.path=void 0,d.query=void 0,d},serialize:function serialize(r,a){if(r.port!==(isSecure(r)?443:80)&&""!==r.port||(r.port=void 0),"boolean"==typeof r.secure&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){var d=r.resourceName.split("?"),g=h(d,2),y=g[0],_=g[1];r.path=y&&"/"!==y?y:void 0,r.query=_,r.resourceName=void 0}return r.fragment=void 0,r}},et={scheme:"wss",domainHost:Xe.domainHost,parse:Xe.parse,serialize:Xe.serialize},tt={},rt="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",st="[0-9A-Fa-f]",at=subexp(subexp("%[EFef]"+st+"%"+st+st+"%"+st+st)+"|"+subexp("%[89A-Fa-f]"+st+"%"+st+st)+"|"+subexp("%"+st+st)),nt="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ot=merge("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),it="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",dt=new RegExp(rt,"g"),ct=new RegExp(at,"g"),ut=new RegExp(merge("[^]",nt,"[\\.]",'[\\"]',ot),"g"),lt=new RegExp(merge("[^]",rt,it),"g"),pt=lt;function decodeUnreserved(r){var a=pctDecChars(r);return a.match(dt)?a:r}var mt={scheme:"mailto",parse:function parse$$1(r,a){var d=r,h=d.to=d.path?d.path.split(","):[];if(d.path=void 0,d.query){for(var g=!1,y={},_=d.query.split("&"),b=0,P=_.length;b<P;++b){var j=_[b].split("=");switch(j[0]){case"to":for(var Z=j[1].split(","),D=0,N=Z.length;D<N;++D)h.push(Z[D]);break;case"subject":d.subject=unescapeComponent(j[1],a);break;case"body":d.body=unescapeComponent(j[1],a);break;default:g=!0,y[unescapeComponent(j[0],a)]=unescapeComponent(j[1],a)}}g&&(d.headers=y)}d.query=void 0;for(var $=0,z=h.length;$<z;++$){var L=h[$].split("@");if(L[0]=unescapeComponent(L[0]),a.unicodeSupport)L[1]=unescapeComponent(L[1],a).toLowerCase();else try{L[1]=Ue.toASCII(unescapeComponent(L[1],a).toLowerCase())}catch(r){d.error=d.error||"Email address's domain name can not be converted to ASCII via punycode: "+r}h[$]=L.join("@")}return d},serialize:function serialize$$1(r,a){var d=r,h=toArray(r.to);if(h){for(var g=0,y=h.length;g<y;++g){var _=String(h[g]),b=_.lastIndexOf("@"),P=_.slice(0,b).replace(ct,decodeUnreserved).replace(ct,toUpperCase).replace(ut,pctEncChar),j=_.slice(b+1);try{j=a.iri?Ue.toUnicode(j):Ue.toASCII(unescapeComponent(j,a).toLowerCase())}catch(r){d.error=d.error||"Email address's domain name can not be converted to "+(a.iri?"Unicode":"ASCII")+" via punycode: "+r}h[g]=P+"@"+j}d.path=h.join(",")}var Z=r.headers=r.headers||{};r.subject&&(Z.subject=r.subject),r.body&&(Z.body=r.body);var D=[];for(var N in Z)Z[N]!==tt[N]&&D.push(N.replace(ct,decodeUnreserved).replace(ct,toUpperCase).replace(lt,pctEncChar)+"="+Z[N].replace(ct,decodeUnreserved).replace(ct,toUpperCase).replace(pt,pctEncChar));return D.length&&(d.query=D.join("&")),d}},ht=/^([^\:]+)\:(.*)/,ft={scheme:"urn",parse:function parse$$1(r,a){var d=r.path&&r.path.match(ht),h=r;if(d){var g=a.scheme||h.scheme||"urn",y=d[1].toLowerCase(),_=d[2],b=g+":"+(a.nid||y),P=qe[b];h.nid=y,h.nss=_,h.path=void 0,P&&(h=P.parse(h,a))}else h.error=h.error||"URN can not be parsed.";return h},serialize:function serialize$$1(r,a){var d=a.scheme||r.scheme||"urn",h=r.nid,g=d+":"+(a.nid||h),y=qe[g];y&&(r=y.serialize(r,a));var _=r,b=r.nss;return _.path=(h||a.nid)+":"+b,_}},gt=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,vt={scheme:"urn:uuid",parse:function parse(r,a){var d=r;return d.uuid=d.nss,d.nss=void 0,a.tolerant||d.uuid&&d.uuid.match(gt)||(d.error=d.error||"UUID is not valid."),d},serialize:function serialize(r,a){var d=r;return d.nss=(r.uuid||"").toLowerCase(),d}};qe[We.scheme]=We,qe[Ye.scheme]=Ye,qe[Xe.scheme]=Xe,qe[et.scheme]=et,qe[mt.scheme]=mt,qe[ft.scheme]=ft,qe[vt.scheme]=vt,r.SCHEMES=qe,r.pctEncChar=pctEncChar,r.pctDecChars=pctDecChars,r.parse=parse,r.removeDotSegments=removeDotSegments,r.serialize=serialize,r.resolveComponents=resolveComponents,r.resolve=resolve,r.normalize=normalize,r.equal=equal,r.escapeComponent=escapeComponent,r.unescapeComponent=unescapeComponent,Object.defineProperty(r,"__esModule",{value:!0})}(a)},"./packages/node_modules/zod-to-json-schema/dist/esm/Options.js":function(r,a,d){"use strict";d.r(a),d.d(a,{defaultOptions:function(){return g},getDefaultOptions:function(){return getDefaultOptions},ignoreOverride:function(){return h},jsonDescription:function(){return jsonDescription}});const h=Symbol("Let zodToJsonSchema decide on which parser to use"),jsonDescription=(r,a)=>{if(a.description)try{return{...r,...JSON.parse(a.description)}}catch{}return r},g={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},getDefaultOptions=r=>"string"==typeof r?{...g,name:r}:{...g,...r}},"./packages/node_modules/zod-to-json-schema/dist/esm/Refs.js":function(r,a,d){"use strict";d.r(a),d.d(a,{getRefs:function(){return getRefs}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/Options.js");const getRefs=r=>{const a=(0,h.getDefaultOptions)(r),d=void 0!==a.name?[...a.basePath,a.definitionPath,a.name]:a.basePath;return{...a,flags:{hasReferencedOpenAiAnyType:!1},currentPath:d,propertyPath:void 0,seen:new Map(Object.entries(a.definitions).map(([r,d])=>[d._def,{def:d._def,path:[...a.basePath,a.definitionPath,r],jsonSchema:void 0}]))}}},"./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js":function(r,a,d){"use strict";function addErrorMessage(r,a,d,h){h?.errorMessages&&d&&(r.errorMessage={...r.errorMessage,[a]:d})}function setResponseValueAndErrors(r,a,d,h,g){r[a]=d,addErrorMessage(r,a,h,g)}d.r(a),d.d(a,{addErrorMessage:function(){return addErrorMessage},setResponseValueAndErrors:function(){return setResponseValueAndErrors}})},"./packages/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js":function(r,a,d){"use strict";d.r(a),d.d(a,{getRelativePath:function(){return getRelativePath}});const getRelativePath=(r,a)=>{let d=0;for(;d<r.length&&d<a.length&&r[d]===a[d];d++);return[(r.length-d).toString(),...a.slice(d)].join("/")}},"./packages/node_modules/zod-to-json-schema/dist/esm/index.js":function(r,a,d){"use strict";d.r(a),d.d(a,{addErrorMessage:function(){return y.addErrorMessage},defaultOptions:function(){return h.defaultOptions},getDefaultOptions:function(){return h.getDefaultOptions},getRefs:function(){return g.getRefs},getRelativePath:function(){return _.getRelativePath},ignoreOverride:function(){return h.ignoreOverride},jsonDescription:function(){return h.jsonDescription},parseAnyDef:function(){return P.parseAnyDef},parseArrayDef:function(){return j.parseArrayDef},parseBigintDef:function(){return Z.parseBigintDef},parseBooleanDef:function(){return D.parseBooleanDef},parseBrandedDef:function(){return N.parseBrandedDef},parseCatchDef:function(){return $.parseCatchDef},parseDateDef:function(){return z.parseDateDef},parseDef:function(){return b.parseDef},parseDefaultDef:function(){return L.parseDefaultDef},parseEffectsDef:function(){return F.parseEffectsDef},parseEnumDef:function(){return M.parseEnumDef},parseIntersectionDef:function(){return U.parseIntersectionDef},parseLiteralDef:function(){return q.parseLiteralDef},parseMapDef:function(){return V.parseMapDef},parseNativeEnumDef:function(){return K.parseNativeEnumDef},parseNeverDef:function(){return H.parseNeverDef},parseNullDef:function(){return B.parseNullDef},parseNullableDef:function(){return G.parseNullableDef},parseNumberDef:function(){return ze.parseNumberDef},parseObjectDef:function(){return Fe.parseObjectDef},parseOptionalDef:function(){return Ue.parseOptionalDef},parsePipelineDef:function(){return qe.parsePipelineDef},parsePromiseDef:function(){return Ve.parsePromiseDef},parseReadonlyDef:function(){return Ke.parseReadonlyDef},parseRecordDef:function(){return He.parseRecordDef},parseSetDef:function(){return Be.parseSetDef},parseStringDef:function(){return Qe.parseStringDef},parseTupleDef:function(){return Je.parseTupleDef},parseUndefinedDef:function(){return We.parseUndefinedDef},parseUnionDef:function(){return Ye.parseUnionDef},parseUnknownDef:function(){return Xe.parseUnknownDef},primitiveMappings:function(){return Ye.primitiveMappings},selectParser:function(){return et.selectParser},setResponseValueAndErrors:function(){return y.setResponseValueAndErrors},zodPatterns:function(){return Qe.zodPatterns},zodToJsonSchema:function(){return tt.zodToJsonSchema}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/Options.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/Refs.js"),y=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),_=d("./packages/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js"),b=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),P=(d("./packages/node_modules/zod-to-json-schema/dist/esm/parseTypes.js"),d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js")),j=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/array.js"),Z=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js"),D=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js"),N=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),$=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js"),z=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/date.js"),L=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/default.js"),F=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js"),M=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js"),U=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js"),q=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js"),V=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/map.js"),K=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js"),H=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/never.js"),B=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/null.js"),G=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js"),ze=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/number.js"),Fe=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/object.js"),Ue=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js"),qe=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js"),Ve=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js"),Ke=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js"),He=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),Be=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/set.js"),Qe=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),Je=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js"),We=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js"),Ye=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/union.js"),Xe=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js"),et=d("./packages/node_modules/zod-to-json-schema/dist/esm/selectParser.js"),tt=d("./packages/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js");a.default=tt.zodToJsonSchema},"./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseDef:function(){return parseDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/Options.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/selectParser.js"),y=d("./packages/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js"),_=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseDef(r,a,d=!1){const y=a.seen.get(r);if(a.override){const g=a.override?.(r,a,y,d);if(g!==h.ignoreOverride)return g}if(y&&!d){const r=get$ref(y,a);if(void 0!==r)return r}const _={def:r,path:a.currentPath,jsonSchema:void 0};a.seen.set(r,_);const b=(0,g.selectParser)(r,r.typeName,a),P="function"==typeof b?parseDef(b(),a):b;if(P&&addMeta(r,a,P),a.postProcess){const d=a.postProcess(P,r,a);return _.jsonSchema=P,d}return _.jsonSchema=P,P}const get$ref=(r,a)=>{switch(a.$refStrategy){case"root":return{$ref:r.path.join("/")};case"relative":return{$ref:(0,y.getRelativePath)(a.currentPath,r.path)};case"none":case"seen":return r.path.length<a.currentPath.length&&r.path.every((r,d)=>a.currentPath[d]===r)?(console.warn(`Recursive reference detected at ${a.currentPath.join("/")}! Defaulting to any`),(0,_.parseAnyDef)(a)):"seen"===a.$refStrategy?(0,_.parseAnyDef)(a):void 0}},addMeta=(r,a,d)=>(r.description&&(d.description=r.description,a.markdownDescription&&(d.markdownDescription=r.description)),d)},"./packages/node_modules/zod-to-json-schema/dist/esm/parseTypes.js":function(r,a,d){"use strict";d.r(a)},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseAnyDef:function(){return parseAnyDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js");function parseAnyDef(r){if("openAi"!==r.target)return{};const a=[...r.basePath,r.definitionPath,r.openAiAnyTypeName];return r.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===r.$refStrategy?(0,h.getRelativePath)(a,r.currentPath):a.join("/")}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/array.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseArrayDef:function(){return parseArrayDef}});var h=d("./packages/node_modules/zod/v3/types.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),y=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseArrayDef(r,a){const d={type:"array"};return r.type?._def&&r.type?._def?.typeName!==h.ZodFirstPartyTypeKind.ZodAny&&(d.items=(0,y.parseDef)(r.type._def,{...a,currentPath:[...a.currentPath,"items"]})),r.minLength&&(0,g.setResponseValueAndErrors)(d,"minItems",r.minLength.value,r.minLength.message,a),r.maxLength&&(0,g.setResponseValueAndErrors)(d,"maxItems",r.maxLength.value,r.maxLength.message,a),r.exactLength&&((0,g.setResponseValueAndErrors)(d,"minItems",r.exactLength.value,r.exactLength.message,a),(0,g.setResponseValueAndErrors)(d,"maxItems",r.exactLength.value,r.exactLength.message,a)),d}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseBigintDef:function(){return parseBigintDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseBigintDef(r,a){const d={type:"integer",format:"int64"};if(!r.checks)return d;for(const g of r.checks)switch(g.kind){case"min":"jsonSchema7"===a.target?g.inclusive?(0,h.setResponseValueAndErrors)(d,"minimum",g.value,g.message,a):(0,h.setResponseValueAndErrors)(d,"exclusiveMinimum",g.value,g.message,a):(g.inclusive||(d.exclusiveMinimum=!0),(0,h.setResponseValueAndErrors)(d,"minimum",g.value,g.message,a));break;case"max":"jsonSchema7"===a.target?g.inclusive?(0,h.setResponseValueAndErrors)(d,"maximum",g.value,g.message,a):(0,h.setResponseValueAndErrors)(d,"exclusiveMaximum",g.value,g.message,a):(g.inclusive||(d.exclusiveMaximum=!0),(0,h.setResponseValueAndErrors)(d,"maximum",g.value,g.message,a));break;case"multipleOf":(0,h.setResponseValueAndErrors)(d,"multipleOf",g.value,g.message,a)}return d}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js":function(r,a,d){"use strict";function parseBooleanDef(){return{type:"boolean"}}d.r(a),d.d(a,{parseBooleanDef:function(){return parseBooleanDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseBrandedDef:function(){return parseBrandedDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseBrandedDef(r,a){return(0,h.parseDef)(r.type._def,a)}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseCatchDef:function(){return parseCatchDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parseCatchDef=(r,a)=>(0,h.parseDef)(r.innerType._def,a)},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/date.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseDateDef:function(){return parseDateDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseDateDef(r,a,d){const h=d??a.dateStrategy;if(Array.isArray(h))return{anyOf:h.map((d,h)=>parseDateDef(r,a,d))};switch(h){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return integerDateParser(r,a)}}const integerDateParser=(r,a)=>{const d={type:"integer",format:"unix-time"};if("openApi3"===a.target)return d;for(const g of r.checks)switch(g.kind){case"min":(0,h.setResponseValueAndErrors)(d,"minimum",g.value,g.message,a);break;case"max":(0,h.setResponseValueAndErrors)(d,"maximum",g.value,g.message,a)}return d}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/default.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseDefaultDef:function(){return parseDefaultDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseDefaultDef(r,a){return{...(0,h.parseDef)(r.innerType._def,a),default:r.defaultValue()}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseEffectsDef:function(){return parseEffectsDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseEffectsDef(r,a){return"input"===a.effectStrategy?(0,h.parseDef)(r.schema._def,a):(0,g.parseAnyDef)(a)}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js":function(r,a,d){"use strict";function parseEnumDef(r){return{type:"string",enum:Array.from(r.values)}}d.r(a),d.d(a,{parseEnumDef:function(){return parseEnumDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseIntersectionDef:function(){return parseIntersectionDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const isJsonSchema7AllOfType=r=>(!("type"in r)||"string"!==r.type)&&"allOf"in r;function parseIntersectionDef(r,a){const d=[(0,h.parseDef)(r.left._def,{...a,currentPath:[...a.currentPath,"allOf","0"]}),(0,h.parseDef)(r.right._def,{...a,currentPath:[...a.currentPath,"allOf","1"]})].filter(r=>!!r);let g="jsonSchema2019-09"===a.target?{unevaluatedProperties:!1}:void 0;const y=[];return d.forEach(r=>{if(isJsonSchema7AllOfType(r))y.push(...r.allOf),void 0===r.unevaluatedProperties&&(g=void 0);else{let a=r;if("additionalProperties"in r&&!1===r.additionalProperties){const{additionalProperties:d,...h}=r;a=h}else g=void 0;y.push(a)}}),y.length?{allOf:y,...g}:void 0}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js":function(r,a,d){"use strict";function parseLiteralDef(r,a){const d=typeof r.value;return"bigint"!==d&&"number"!==d&&"boolean"!==d&&"string"!==d?{type:Array.isArray(r.value)?"array":"object"}:"openApi3"===a.target?{type:"bigint"===d?"integer":d,enum:[r.value]}:{type:"bigint"===d?"integer":d,const:r.value}}d.r(a),d.d(a,{parseLiteralDef:function(){return parseLiteralDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/map.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseMapDef:function(){return parseMapDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),y=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseMapDef(r,a){if("record"===a.mapStrategy)return(0,g.parseRecordDef)(r,a);return{type:"array",maxItems:125,items:{type:"array",items:[(0,h.parseDef)(r.keyType._def,{...a,currentPath:[...a.currentPath,"items","items","0"]})||(0,y.parseAnyDef)(a),(0,h.parseDef)(r.valueType._def,{...a,currentPath:[...a.currentPath,"items","items","1"]})||(0,y.parseAnyDef)(a)],minItems:2,maxItems:2}}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js":function(r,a,d){"use strict";function parseNativeEnumDef(r){const a=r.values,d=Object.keys(r.values).filter(r=>"number"!=typeof a[a[r]]).map(r=>a[r]),h=Array.from(new Set(d.map(r=>typeof r)));return{type:1===h.length?"string"===h[0]?"string":"number":["string","number"],enum:d}}d.r(a),d.d(a,{parseNativeEnumDef:function(){return parseNativeEnumDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/never.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseNeverDef:function(){return parseNeverDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseNeverDef(r){return"openAi"===r.target?void 0:{not:(0,h.parseAnyDef)({...r,currentPath:[...r.currentPath,"not"]})}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/null.js":function(r,a,d){"use strict";function parseNullDef(r){return"openApi3"===r.target?{enum:["null"],nullable:!0}:{type:"null"}}d.r(a),d.d(a,{parseNullDef:function(){return parseNullDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseNullableDef:function(){return parseNullableDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/union.js");function parseNullableDef(r,a){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(r.innerType._def.typeName)&&(!r.innerType._def.checks||!r.innerType._def.checks.length))return"openApi3"===a.target?{type:g.primitiveMappings[r.innerType._def.typeName],nullable:!0}:{type:[g.primitiveMappings[r.innerType._def.typeName],"null"]};if("openApi3"===a.target){const d=(0,h.parseDef)(r.innerType._def,{...a,currentPath:[...a.currentPath]});return d&&"$ref"in d?{allOf:[d],nullable:!0}:d&&{...d,nullable:!0}}const d=(0,h.parseDef)(r.innerType._def,{...a,currentPath:[...a.currentPath,"anyOf","0"]});return d&&{anyOf:[d,{type:"null"}]}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/number.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseNumberDef:function(){return parseNumberDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseNumberDef(r,a){const d={type:"number"};if(!r.checks)return d;for(const g of r.checks)switch(g.kind){case"int":d.type="integer",(0,h.addErrorMessage)(d,"type",g.message,a);break;case"min":"jsonSchema7"===a.target?g.inclusive?(0,h.setResponseValueAndErrors)(d,"minimum",g.value,g.message,a):(0,h.setResponseValueAndErrors)(d,"exclusiveMinimum",g.value,g.message,a):(g.inclusive||(d.exclusiveMinimum=!0),(0,h.setResponseValueAndErrors)(d,"minimum",g.value,g.message,a));break;case"max":"jsonSchema7"===a.target?g.inclusive?(0,h.setResponseValueAndErrors)(d,"maximum",g.value,g.message,a):(0,h.setResponseValueAndErrors)(d,"exclusiveMaximum",g.value,g.message,a):(g.inclusive||(d.exclusiveMaximum=!0),(0,h.setResponseValueAndErrors)(d,"maximum",g.value,g.message,a));break;case"multipleOf":(0,h.setResponseValueAndErrors)(d,"multipleOf",g.value,g.message,a)}return d}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/object.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseObjectDef:function(){return parseObjectDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseObjectDef(r,a){const d="openAi"===a.target,g={type:"object",properties:{}},y=[],_=r.shape();for(const r in _){let b=_[r];if(void 0===b||void 0===b._def)continue;let P=safeIsOptional(b);P&&d&&("ZodOptional"===b._def.typeName&&(b=b._def.innerType),b.isNullable()||(b=b.nullable()),P=!1);const j=(0,h.parseDef)(b._def,{...a,currentPath:[...a.currentPath,"properties",r],propertyPath:[...a.currentPath,"properties",r]});void 0!==j&&(g.properties[r]=j,P||y.push(r))}y.length&&(g.required=y);const b=function decideAdditionalProperties(r,a){if("ZodNever"!==r.catchall._def.typeName)return(0,h.parseDef)(r.catchall._def,{...a,currentPath:[...a.currentPath,"additionalProperties"]});switch(r.unknownKeys){case"passthrough":return a.allowedAdditionalProperties;case"strict":return a.rejectedAdditionalProperties;case"strip":return"strict"===a.removeAdditionalStrategy?a.allowedAdditionalProperties:a.rejectedAdditionalProperties}}(r,a);return void 0!==b&&(g.additionalProperties=b),g}function safeIsOptional(r){try{return r.isOptional()}catch{return!0}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseOptionalDef:function(){return parseOptionalDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");const parseOptionalDef=(r,a)=>{if(a.currentPath.toString()===a.propertyPath?.toString())return(0,h.parseDef)(r.innerType._def,a);const d=(0,h.parseDef)(r.innerType._def,{...a,currentPath:[...a.currentPath,"anyOf","1"]});return d?{anyOf:[{not:(0,g.parseAnyDef)(a)},d]}:(0,g.parseAnyDef)(a)}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parsePipelineDef:function(){return parsePipelineDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parsePipelineDef=(r,a)=>{if("input"===a.pipeStrategy)return(0,h.parseDef)(r.in._def,a);if("output"===a.pipeStrategy)return(0,h.parseDef)(r.out._def,a);const d=(0,h.parseDef)(r.in._def,{...a,currentPath:[...a.currentPath,"allOf","0"]});return{allOf:[d,(0,h.parseDef)(r.out._def,{...a,currentPath:[...a.currentPath,"allOf",d?"1":"0"]})].filter(r=>void 0!==r)}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parsePromiseDef:function(){return parsePromiseDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parsePromiseDef(r,a){return(0,h.parseDef)(r.type._def,a)}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseReadonlyDef:function(){return parseReadonlyDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parseReadonlyDef=(r,a)=>(0,h.parseDef)(r.innerType._def,a)},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/record.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseRecordDef:function(){return parseRecordDef}});var h=d("./packages/node_modules/zod/v3/types.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),y=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),_=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),b=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseRecordDef(r,a){if("openAi"===a.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===a.target&&r.keyType?._def.typeName===h.ZodFirstPartyTypeKind.ZodEnum)return{type:"object",required:r.keyType._def.values,properties:r.keyType._def.values.reduce((d,h)=>({...d,[h]:(0,g.parseDef)(r.valueType._def,{...a,currentPath:[...a.currentPath,"properties",h]})??(0,b.parseAnyDef)(a)}),{}),additionalProperties:a.rejectedAdditionalProperties};const d={type:"object",additionalProperties:(0,g.parseDef)(r.valueType._def,{...a,currentPath:[...a.currentPath,"additionalProperties"]})??a.allowedAdditionalProperties};if("openApi3"===a.target)return d;if(r.keyType?._def.typeName===h.ZodFirstPartyTypeKind.ZodString&&r.keyType._def.checks?.length){const{type:h,...g}=(0,y.parseStringDef)(r.keyType._def,a);return{...d,propertyNames:g}}if(r.keyType?._def.typeName===h.ZodFirstPartyTypeKind.ZodEnum)return{...d,propertyNames:{enum:r.keyType._def.values}};if(r.keyType?._def.typeName===h.ZodFirstPartyTypeKind.ZodBranded&&r.keyType._def.type._def.typeName===h.ZodFirstPartyTypeKind.ZodString&&r.keyType._def.type._def.checks?.length){const{type:h,...g}=(0,_.parseBrandedDef)(r.keyType._def,a);return{...d,propertyNames:g}}return d}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/set.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseSetDef:function(){return parseSetDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseSetDef(r,a){const d={type:"array",uniqueItems:!0,items:(0,g.parseDef)(r.valueType._def,{...a,currentPath:[...a.currentPath,"items"]})};return r.minSize&&(0,h.setResponseValueAndErrors)(d,"minItems",r.minSize.value,r.minSize.message,a),r.maxSize&&(0,h.setResponseValueAndErrors)(d,"maxItems",r.maxSize.value,r.maxSize.message,a),d}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/string.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseStringDef:function(){return parseStringDef},zodPatterns:function(){return y}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");let g;const y={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===g&&(g=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),g),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function parseStringDef(r,a){const d={type:"string"};if(r.checks)for(const g of r.checks)switch(g.kind){case"min":(0,h.setResponseValueAndErrors)(d,"minLength","number"==typeof d.minLength?Math.max(d.minLength,g.value):g.value,g.message,a);break;case"max":(0,h.setResponseValueAndErrors)(d,"maxLength","number"==typeof d.maxLength?Math.min(d.maxLength,g.value):g.value,g.message,a);break;case"email":switch(a.emailStrategy){case"format:email":addFormat(d,"email",g.message,a);break;case"format:idn-email":addFormat(d,"idn-email",g.message,a);break;case"pattern:zod":addPattern(d,y.email,g.message,a)}break;case"url":addFormat(d,"uri",g.message,a);break;case"uuid":addFormat(d,"uuid",g.message,a);break;case"regex":addPattern(d,g.regex,g.message,a);break;case"cuid":addPattern(d,y.cuid,g.message,a);break;case"cuid2":addPattern(d,y.cuid2,g.message,a);break;case"startsWith":addPattern(d,RegExp(`^${escapeLiteralCheckValue(g.value,a)}`),g.message,a);break;case"endsWith":addPattern(d,RegExp(`${escapeLiteralCheckValue(g.value,a)}$`),g.message,a);break;case"datetime":addFormat(d,"date-time",g.message,a);break;case"date":addFormat(d,"date",g.message,a);break;case"time":addFormat(d,"time",g.message,a);break;case"duration":addFormat(d,"duration",g.message,a);break;case"length":(0,h.setResponseValueAndErrors)(d,"minLength","number"==typeof d.minLength?Math.max(d.minLength,g.value):g.value,g.message,a),(0,h.setResponseValueAndErrors)(d,"maxLength","number"==typeof d.maxLength?Math.min(d.maxLength,g.value):g.value,g.message,a);break;case"includes":addPattern(d,RegExp(escapeLiteralCheckValue(g.value,a)),g.message,a);break;case"ip":"v6"!==g.version&&addFormat(d,"ipv4",g.message,a),"v4"!==g.version&&addFormat(d,"ipv6",g.message,a);break;case"base64url":addPattern(d,y.base64url,g.message,a);break;case"jwt":addPattern(d,y.jwt,g.message,a);break;case"cidr":"v6"!==g.version&&addPattern(d,y.ipv4Cidr,g.message,a),"v4"!==g.version&&addPattern(d,y.ipv6Cidr,g.message,a);break;case"emoji":addPattern(d,y.emoji(),g.message,a);break;case"ulid":addPattern(d,y.ulid,g.message,a);break;case"base64":switch(a.base64Strategy){case"format:binary":addFormat(d,"binary",g.message,a);break;case"contentEncoding:base64":(0,h.setResponseValueAndErrors)(d,"contentEncoding","base64",g.message,a);break;case"pattern:zod":addPattern(d,y.base64,g.message,a)}break;case"nanoid":addPattern(d,y.nanoid,g.message,a);case"toLowerCase":case"toUpperCase":case"trim":break;default:(()=>{})()}return d}function escapeLiteralCheckValue(r,a){return"escape"===a.patternStrategy?function escapeNonAlphaNumeric(r){let a="";for(let d=0;d<r.length;d++)_.has(r[d])||(a+="\\"),a+=r[d];return a}(r):r}const _=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function addFormat(r,a,d,g){r.format||r.anyOf?.some(r=>r.format)?(r.anyOf||(r.anyOf=[]),r.format&&(r.anyOf.push({format:r.format,...r.errorMessage&&g.errorMessages&&{errorMessage:{format:r.errorMessage.format}}}),delete r.format,r.errorMessage&&(delete r.errorMessage.format,0===Object.keys(r.errorMessage).length&&delete r.errorMessage)),r.anyOf.push({format:a,...d&&g.errorMessages&&{errorMessage:{format:d}}})):(0,h.setResponseValueAndErrors)(r,"format",a,d,g)}function addPattern(r,a,d,g){r.pattern||r.allOf?.some(r=>r.pattern)?(r.allOf||(r.allOf=[]),r.pattern&&(r.allOf.push({pattern:r.pattern,...r.errorMessage&&g.errorMessages&&{errorMessage:{pattern:r.errorMessage.pattern}}}),delete r.pattern,r.errorMessage&&(delete r.errorMessage.pattern,0===Object.keys(r.errorMessage).length&&delete r.errorMessage)),r.allOf.push({pattern:stringifyRegExpWithFlags(a,g),...d&&g.errorMessages&&{errorMessage:{pattern:d}}})):(0,h.setResponseValueAndErrors)(r,"pattern",stringifyRegExpWithFlags(a,g),d,g)}function stringifyRegExpWithFlags(r,a){if(!a.applyRegexFlags||!r.flags)return r.source;const d=r.flags.includes("i"),h=r.flags.includes("m"),g=r.flags.includes("s"),y=d?r.source.toLowerCase():r.source;let _="",b=!1,P=!1,j=!1;for(let r=0;r<y.length;r++)if(b)_+=y[r],b=!1;else{if(d)if(P){if(y[r].match(/[a-z]/)){j?(_+=y[r],_+=`${y[r-2]}-${y[r]}`.toUpperCase(),j=!1):"-"===y[r+1]&&y[r+2]?.match(/[a-z]/)?(_+=y[r],j=!0):_+=`${y[r]}${y[r].toUpperCase()}`;continue}}else if(y[r].match(/[a-z]/)){_+=`[${y[r]}${y[r].toUpperCase()}]`;continue}if(h){if("^"===y[r]){_+="(^|(?<=[\r\n]))";continue}if("$"===y[r]){_+="($|(?=[\r\n]))";continue}}g&&"."===y[r]?_+=P?`${y[r]}\r\n`:`[${y[r]}\r\n]`:(_+=y[r],"\\"===y[r]?b=!0:P&&"]"===y[r]?P=!1:P||"["!==y[r]||(P=!0))}try{new RegExp(_)}catch{return console.warn(`Could not convert regex pattern at ${a.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),r.source}return _}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseTupleDef:function(){return parseTupleDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseTupleDef(r,a){return r.rest?{type:"array",minItems:r.items.length,items:r.items.map((r,d)=>(0,h.parseDef)(r._def,{...a,currentPath:[...a.currentPath,"items",`${d}`]})).reduce((r,a)=>void 0===a?r:[...r,a],[]),additionalItems:(0,h.parseDef)(r.rest._def,{...a,currentPath:[...a.currentPath,"additionalItems"]})}:{type:"array",minItems:r.items.length,maxItems:r.items.length,items:r.items.map((r,d)=>(0,h.parseDef)(r._def,{...a,currentPath:[...a.currentPath,"items",`${d}`]})).reduce((r,a)=>void 0===a?r:[...r,a],[])}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseUndefinedDef:function(){return parseUndefinedDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseUndefinedDef(r){return{not:(0,h.parseAnyDef)(r)}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/union.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseUnionDef:function(){return parseUnionDef},primitiveMappings:function(){return g}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const g={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function parseUnionDef(r,a){if("openApi3"===a.target)return asAnyOf(r,a);const d=r.options instanceof Map?Array.from(r.options.values()):r.options;if(d.every(r=>r._def.typeName in g&&(!r._def.checks||!r._def.checks.length))){const r=d.reduce((r,a)=>{const d=g[a._def.typeName];return d&&!r.includes(d)?[...r,d]:r},[]);return{type:r.length>1?r:r[0]}}if(d.every(r=>"ZodLiteral"===r._def.typeName&&!r.description)){const r=d.reduce((r,a)=>{const d=typeof a._def.value;switch(d){case"string":case"number":case"boolean":return[...r,d];case"bigint":return[...r,"integer"];case"object":if(null===a._def.value)return[...r,"null"];default:return r}},[]);if(r.length===d.length){const a=r.filter((r,a,d)=>d.indexOf(r)===a);return{type:a.length>1?a:a[0],enum:d.reduce((r,a)=>r.includes(a._def.value)?r:[...r,a._def.value],[])}}}else if(d.every(r=>"ZodEnum"===r._def.typeName))return{type:"string",enum:d.reduce((r,a)=>[...r,...a._def.values.filter(a=>!r.includes(a))],[])};return asAnyOf(r,a)}const asAnyOf=(r,a)=>{const d=(r.options instanceof Map?Array.from(r.options.values()):r.options).map((r,d)=>(0,h.parseDef)(r._def,{...a,currentPath:[...a.currentPath,"anyOf",`${d}`]})).filter(r=>!!r&&(!a.strictUnions||"object"==typeof r&&Object.keys(r).length>0));return d.length?{anyOf:d}:void 0}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseUnknownDef:function(){return parseUnknownDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseUnknownDef(r){return(0,h.parseAnyDef)(r)}},"./packages/node_modules/zod-to-json-schema/dist/esm/selectParser.js":function(r,a,d){"use strict";d.r(a),d.d(a,{selectParser:function(){return selectParser}});var h=d("./packages/node_modules/zod/v3/types.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js"),y=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/array.js"),_=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js"),b=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js"),P=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),j=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js"),Z=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/date.js"),D=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/default.js"),N=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js"),$=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js"),z=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js"),L=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js"),F=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/map.js"),M=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js"),U=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/never.js"),q=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/null.js"),V=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js"),K=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/number.js"),H=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/object.js"),B=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js"),G=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js"),ze=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js"),Fe=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),Ue=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/set.js"),qe=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),Ve=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js"),Ke=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js"),He=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/union.js"),Be=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js"),Qe=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js");const selectParser=(r,a,d)=>{switch(a){case h.ZodFirstPartyTypeKind.ZodString:return(0,qe.parseStringDef)(r,d);case h.ZodFirstPartyTypeKind.ZodNumber:return(0,K.parseNumberDef)(r,d);case h.ZodFirstPartyTypeKind.ZodObject:return(0,H.parseObjectDef)(r,d);case h.ZodFirstPartyTypeKind.ZodBigInt:return(0,_.parseBigintDef)(r,d);case h.ZodFirstPartyTypeKind.ZodBoolean:return(0,b.parseBooleanDef)();case h.ZodFirstPartyTypeKind.ZodDate:return(0,Z.parseDateDef)(r,d);case h.ZodFirstPartyTypeKind.ZodUndefined:return(0,Ke.parseUndefinedDef)(d);case h.ZodFirstPartyTypeKind.ZodNull:return(0,q.parseNullDef)(d);case h.ZodFirstPartyTypeKind.ZodArray:return(0,y.parseArrayDef)(r,d);case h.ZodFirstPartyTypeKind.ZodUnion:case h.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return(0,He.parseUnionDef)(r,d);case h.ZodFirstPartyTypeKind.ZodIntersection:return(0,z.parseIntersectionDef)(r,d);case h.ZodFirstPartyTypeKind.ZodTuple:return(0,Ve.parseTupleDef)(r,d);case h.ZodFirstPartyTypeKind.ZodRecord:return(0,Fe.parseRecordDef)(r,d);case h.ZodFirstPartyTypeKind.ZodLiteral:return(0,L.parseLiteralDef)(r,d);case h.ZodFirstPartyTypeKind.ZodEnum:return(0,$.parseEnumDef)(r);case h.ZodFirstPartyTypeKind.ZodNativeEnum:return(0,M.parseNativeEnumDef)(r);case h.ZodFirstPartyTypeKind.ZodNullable:return(0,V.parseNullableDef)(r,d);case h.ZodFirstPartyTypeKind.ZodOptional:return(0,B.parseOptionalDef)(r,d);case h.ZodFirstPartyTypeKind.ZodMap:return(0,F.parseMapDef)(r,d);case h.ZodFirstPartyTypeKind.ZodSet:return(0,Ue.parseSetDef)(r,d);case h.ZodFirstPartyTypeKind.ZodLazy:return()=>r.getter()._def;case h.ZodFirstPartyTypeKind.ZodPromise:return(0,ze.parsePromiseDef)(r,d);case h.ZodFirstPartyTypeKind.ZodNaN:case h.ZodFirstPartyTypeKind.ZodNever:return(0,U.parseNeverDef)(d);case h.ZodFirstPartyTypeKind.ZodEffects:return(0,N.parseEffectsDef)(r,d);case h.ZodFirstPartyTypeKind.ZodAny:return(0,g.parseAnyDef)(d);case h.ZodFirstPartyTypeKind.ZodUnknown:return(0,Be.parseUnknownDef)(d);case h.ZodFirstPartyTypeKind.ZodDefault:return(0,D.parseDefaultDef)(r,d);case h.ZodFirstPartyTypeKind.ZodBranded:return(0,P.parseBrandedDef)(r,d);case h.ZodFirstPartyTypeKind.ZodReadonly:return(0,Qe.parseReadonlyDef)(r,d);case h.ZodFirstPartyTypeKind.ZodCatch:return(0,j.parseCatchDef)(r,d);case h.ZodFirstPartyTypeKind.ZodPipeline:return(0,G.parsePipelineDef)(r,d);case h.ZodFirstPartyTypeKind.ZodFunction:case h.ZodFirstPartyTypeKind.ZodVoid:case h.ZodFirstPartyTypeKind.ZodSymbol:default:return}}},"./packages/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js":function(r,a,d){"use strict";d.r(a),d.d(a,{zodToJsonSchema:function(){return zodToJsonSchema}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/Refs.js"),y=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");const zodToJsonSchema=(r,a)=>{const d=(0,g.getRefs)(a);let _="object"==typeof a&&a.definitions?Object.entries(a.definitions).reduce((r,[a,g])=>({...r,[a]:(0,h.parseDef)(g._def,{...d,currentPath:[...d.basePath,d.definitionPath,a]},!0)??(0,y.parseAnyDef)(d)}),{}):void 0;const b="string"==typeof a?a:"title"===a?.nameStrategy?void 0:a?.name,P=(0,h.parseDef)(r._def,void 0===b?d:{...d,currentPath:[...d.basePath,d.definitionPath,b]},!1)??(0,y.parseAnyDef)(d),j="object"==typeof a&&void 0!==a.name&&"title"===a.nameStrategy?a.name:void 0;void 0!==j&&(P.title=j),d.flags.hasReferencedOpenAiAnyType&&(_||(_={}),_[d.openAiAnyTypeName]||(_[d.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===d.$refStrategy?"1":[...d.basePath,d.definitionPath,d.openAiAnyTypeName].join("/")}}));const Z=void 0===b?_?{...P,[d.definitionPath]:_}:P:{$ref:[..."relative"===d.$refStrategy?[]:d.basePath,d.definitionPath,b].join("/"),[d.definitionPath]:{..._,[b]:P}};return"jsonSchema7"===d.target?Z.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"!==d.target&&"openAi"!==d.target||(Z.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===d.target&&("anyOf"in Z||"oneOf"in Z||"allOf"in Z||"type"in Z&&Array.isArray(Z.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),Z}},"./packages/node_modules/zod/v3/ZodError.js":function(r,a,d){"use strict";d.r(a),d.d(a,{ZodError:function(){return ZodError},ZodIssueCode:function(){return g},quotelessJson:function(){return quotelessJson}});var h=d("./packages/node_modules/zod/v3/helpers/util.js");const g=h.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(r){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=r}format(r){const a=r||function(r){return r.message},d={_errors:[]},processError=r=>{for(const h of r.issues)if("invalid_union"===h.code)h.unionErrors.map(processError);else if("invalid_return_type"===h.code)processError(h.returnTypeError);else if("invalid_arguments"===h.code)processError(h.argumentsError);else if(0===h.path.length)d._errors.push(a(h));else{let r=d,g=0;for(;g<h.path.length;){const d=h.path[g];g===h.path.length-1?(r[d]=r[d]||{_errors:[]},r[d]._errors.push(a(h))):r[d]=r[d]||{_errors:[]},r=r[d],g++}}};return processError(this),d}static assert(r){if(!(r instanceof ZodError))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,h.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(r=r=>r.message){const a={},d=[];for(const h of this.issues)if(h.path.length>0){const d=h.path[0];a[d]=a[d]||[],a[d].push(r(h))}else d.push(r(h));return{formErrors:d,fieldErrors:a}}get formErrors(){return this.flatten()}}ZodError.create=r=>new ZodError(r)},"./packages/node_modules/zod/v3/errors.js":function(r,a,d){"use strict";d.r(a),d.d(a,{defaultErrorMap:function(){return h.default},getErrorMap:function(){return getErrorMap},setErrorMap:function(){return setErrorMap}});var h=d("./packages/node_modules/zod/v3/locales/en.js");let g=h.default;function setErrorMap(r){g=r}function getErrorMap(){return g}},"./packages/node_modules/zod/v3/helpers/errorUtil.js":function(r,a,d){"use strict";var h;d.r(a),d.d(a,{errorUtil:function(){return h}}),function(r){r.errToObj=r=>"string"==typeof r?{message:r}:r||{},r.toString=r=>"string"==typeof r?r:r?.message}(h||(h={}))},"./packages/node_modules/zod/v3/helpers/parseUtil.js":function(r,a,d){"use strict";d.r(a),d.d(a,{DIRTY:function(){return DIRTY},EMPTY_PATH:function(){return y},INVALID:function(){return _},OK:function(){return OK},ParseStatus:function(){return ParseStatus},addIssueToContext:function(){return addIssueToContext},isAborted:function(){return isAborted},isAsync:function(){return isAsync},isDirty:function(){return isDirty},isValid:function(){return isValid},makeIssue:function(){return makeIssue}});var h=d("./packages/node_modules/zod/v3/errors.js"),g=d("./packages/node_modules/zod/v3/locales/en.js");const makeIssue=r=>{const{data:a,path:d,errorMaps:h,issueData:g}=r,y=[...d,...g.path||[]],_={...g,path:y};if(void 0!==g.message)return{...g,path:y,message:g.message};let b="";const P=h.filter(r=>!!r).slice().reverse();for(const r of P)b=r(_,{data:a,defaultError:b}).message;return{...g,path:y,message:b}},y=[];function addIssueToContext(r,a){const d=(0,h.getErrorMap)(),y=makeIssue({issueData:a,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,d,d===g.default?void 0:g.default].filter(r=>!!r)});r.common.issues.push(y)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(r,a){const d=[];for(const h of a){if("aborted"===h.status)return _;"dirty"===h.status&&r.dirty(),d.push(h.value)}return{status:r.value,value:d}}static async mergeObjectAsync(r,a){const d=[];for(const r of a){const a=await r.key,h=await r.value;d.push({key:a,value:h})}return ParseStatus.mergeObjectSync(r,d)}static mergeObjectSync(r,a){const d={};for(const h of a){const{key:a,value:g}=h;if("aborted"===a.status)return _;if("aborted"===g.status)return _;"dirty"===a.status&&r.dirty(),"dirty"===g.status&&r.dirty(),"__proto__"===a.value||void 0===g.value&&!h.alwaysSet||(d[a.value]=g.value)}return{status:r.value,value:d}}}const _=Object.freeze({status:"aborted"}),DIRTY=r=>({status:"dirty",value:r}),OK=r=>({status:"valid",value:r}),isAborted=r=>"aborted"===r.status,isDirty=r=>"dirty"===r.status,isValid=r=>"valid"===r.status,isAsync=r=>"undefined"!=typeof Promise&&r instanceof Promise},"./packages/node_modules/zod/v3/helpers/util.js":function(r,a,d){"use strict";var h,g;d.r(a),d.d(a,{ZodParsedType:function(){return y},getParsedType:function(){return getParsedType},objectUtil:function(){return g},util:function(){return h}}),function(r){r.assertEqual=r=>{},r.assertIs=function assertIs(r){},r.assertNever=function assertNever(r){throw new Error},r.arrayToEnum=r=>{const a={};for(const d of r)a[d]=d;return a},r.getValidEnumValues=a=>{const d=r.objectKeys(a).filter(r=>"number"!=typeof a[a[r]]),h={};for(const r of d)h[r]=a[r];return r.objectValues(h)},r.objectValues=a=>r.objectKeys(a).map(function(r){return a[r]}),r.objectKeys="function"==typeof Object.keys?r=>Object.keys(r):r=>{const a=[];for(const d in r)Object.prototype.hasOwnProperty.call(r,d)&&a.push(d);return a},r.find=(r,a)=>{for(const d of r)if(a(d))return d},r.isInteger="function"==typeof Number.isInteger?r=>Number.isInteger(r):r=>"number"==typeof r&&Number.isFinite(r)&&Math.floor(r)===r,r.joinValues=function joinValues(r,a=" | "){return r.map(r=>"string"==typeof r?`'${r}'`:r).join(a)},r.jsonStringifyReplacer=(r,a)=>"bigint"==typeof a?a.toString():a}(h||(h={})),function(r){r.mergeShapes=(r,a)=>({...r,...a})}(g||(g={}));const y=h.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=r=>{switch(typeof r){case"undefined":return y.undefined;case"string":return y.string;case"number":return Number.isNaN(r)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(r)?y.array:null===r?y.null:r.then&&"function"==typeof r.then&&r.catch&&"function"==typeof r.catch?y.promise:"undefined"!=typeof Map&&r instanceof Map?y.map:"undefined"!=typeof Set&&r instanceof Set?y.set:"undefined"!=typeof Date&&r instanceof Date?y.date:y.object;default:return y.unknown}}},"./packages/node_modules/zod/v3/locales/en.js":function(r,a,d){"use strict";d.r(a);var h=d("./packages/node_modules/zod/v3/ZodError.js"),g=d("./packages/node_modules/zod/v3/helpers/util.js");a.default=(r,a)=>{let d;switch(r.code){case h.ZodIssueCode.invalid_type:d=r.received===g.ZodParsedType.undefined?"Required":`Expected ${r.expected}, received ${r.received}`;break;case h.ZodIssueCode.invalid_literal:d=`Invalid literal value, expected ${JSON.stringify(r.expected,g.util.jsonStringifyReplacer)}`;break;case h.ZodIssueCode.unrecognized_keys:d=`Unrecognized key(s) in object: ${g.util.joinValues(r.keys,", ")}`;break;case h.ZodIssueCode.invalid_union:d="Invalid input";break;case h.ZodIssueCode.invalid_union_discriminator:d=`Invalid discriminator value. Expected ${g.util.joinValues(r.options)}`;break;case h.ZodIssueCode.invalid_enum_value:d=`Invalid enum value. Expected ${g.util.joinValues(r.options)}, received '${r.received}'`;break;case h.ZodIssueCode.invalid_arguments:d="Invalid function arguments";break;case h.ZodIssueCode.invalid_return_type:d="Invalid function return type";break;case h.ZodIssueCode.invalid_date:d="Invalid date";break;case h.ZodIssueCode.invalid_string:"object"==typeof r.validation?"includes"in r.validation?(d=`Invalid input: must include "${r.validation.includes}"`,"number"==typeof r.validation.position&&(d=`${d} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?d=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?d=`Invalid input: must end with "${r.validation.endsWith}"`:g.util.assertNever(r.validation):d="regex"!==r.validation?`Invalid ${r.validation}`:"Invalid";break;case h.ZodIssueCode.too_small:d="array"===r.type?`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:"string"===r.type?`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:"number"===r.type||"bigint"===r.type?`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:"date"===r.type?`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:"Invalid input";break;case h.ZodIssueCode.too_big:d="array"===r.type?`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:"string"===r.type?`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:"number"===r.type?`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:"bigint"===r.type?`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:"date"===r.type?`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:"Invalid input";break;case h.ZodIssueCode.custom:d="Invalid input";break;case h.ZodIssueCode.invalid_intersection_types:d="Intersection results could not be merged";break;case h.ZodIssueCode.not_multiple_of:d=`Number must be a multiple of ${r.multipleOf}`;break;case h.ZodIssueCode.not_finite:d="Number must be finite";break;default:d=a.defaultError,g.util.assertNever(r)}return{message:d}}},"./packages/node_modules/zod/v3/types.js":function(r,a,d){"use strict";d.r(a),d.d(a,{BRAND:function(){return Fe},NEVER:function(){return St},Schema:function(){return ZodType},ZodAny:function(){return ZodAny},ZodArray:function(){return ZodArray},ZodBigInt:function(){return ZodBigInt},ZodBoolean:function(){return ZodBoolean},ZodBranded:function(){return ZodBranded},ZodCatch:function(){return ZodCatch},ZodDate:function(){return ZodDate},ZodDefault:function(){return ZodDefault},ZodDiscriminatedUnion:function(){return ZodDiscriminatedUnion},ZodEffects:function(){return ZodEffects},ZodEnum:function(){return ZodEnum},ZodFirstPartyTypeKind:function(){return qe},ZodFunction:function(){return ZodFunction},ZodIntersection:function(){return ZodIntersection},ZodLazy:function(){return ZodLazy},ZodLiteral:function(){return ZodLiteral},ZodMap:function(){return ZodMap},ZodNaN:function(){return ZodNaN},ZodNativeEnum:function(){return ZodNativeEnum},ZodNever:function(){return ZodNever},ZodNull:function(){return ZodNull},ZodNullable:function(){return ZodNullable},ZodNumber:function(){return ZodNumber},ZodObject:function(){return ZodObject},ZodOptional:function(){return ZodOptional},ZodPipeline:function(){return ZodPipeline},ZodPromise:function(){return ZodPromise},ZodReadonly:function(){return ZodReadonly},ZodRecord:function(){return ZodRecord},ZodSchema:function(){return ZodType},ZodSet:function(){return ZodSet},ZodString:function(){return ZodString},ZodSymbol:function(){return ZodSymbol},ZodTransformer:function(){return ZodEffects},ZodTuple:function(){return ZodTuple},ZodType:function(){return ZodType},ZodUndefined:function(){return ZodUndefined},ZodUnion:function(){return ZodUnion},ZodUnknown:function(){return ZodUnknown},ZodVoid:function(){return ZodVoid},any:function(){return et},array:function(){return at},bigint:function(){return Be},boolean:function(){return Qe},coerce:function(){return jt},custom:function(){return custom},date:function(){return Je},datetimeRegex:function(){return datetimeRegex},discriminatedUnion:function(){return dt},effect:function(){return bt},enum:function(){return vt},function:function(){return ht},instanceof:function(){return instanceOfType},intersection:function(){return ct},late:function(){return Ue},lazy:function(){return ft},literal:function(){return gt},map:function(){return pt},nan:function(){return He},nativeEnum:function(){return yt},never:function(){return rt},null:function(){return Xe},nullable:function(){return kt},number:function(){return Ke},object:function(){return nt},oboolean:function(){return oboolean},onumber:function(){return onumber},optional:function(){return Pt},ostring:function(){return ostring},pipeline:function(){return xt},preprocess:function(){return wt},promise:function(){return _t},record:function(){return lt},set:function(){return mt},strictObject:function(){return ot},string:function(){return Ve},symbol:function(){return We},transformer:function(){return bt},tuple:function(){return ut},undefined:function(){return Ye},union:function(){return it},unknown:function(){return tt},void:function(){return st}});var h=d("./packages/node_modules/zod/v3/ZodError.js"),g=d("./packages/node_modules/zod/v3/errors.js"),y=d("./packages/node_modules/zod/v3/locales/en.js"),_=d("./packages/node_modules/zod/v3/helpers/errorUtil.js"),b=d("./packages/node_modules/zod/v3/helpers/parseUtil.js"),P=d("./packages/node_modules/zod/v3/helpers/util.js");class ParseInputLazyPath{constructor(r,a,d,h){this._cachedPath=[],this.parent=r,this.data=a,this._path=d,this._key=h}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(r,a)=>{if((0,b.isValid)(a))return{success:!0,data:a.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const a=new h.ZodError(r.common.issues);return this._error=a,this._error}}};function processCreateParams(r){if(!r)return{};const{errorMap:a,invalid_type_error:d,required_error:h,description:g}=r;if(a&&(d||h))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(a)return{errorMap:a,description:g};return{errorMap:(a,g)=>{const{message:y}=r;return"invalid_enum_value"===a.code?{message:y??g.defaultError}:void 0===g.data?{message:y??h??g.defaultError}:"invalid_type"!==a.code?{message:g.defaultError}:{message:y??d??g.defaultError}},description:g}}class ZodType{get description(){return this._def.description}_getType(r){return(0,P.getParsedType)(r.data)}_getOrReturnCtx(r,a){return a||{common:r.parent.common,data:r.data,parsedType:(0,P.getParsedType)(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new b.ParseStatus,ctx:{common:r.parent.common,data:r.data,parsedType:(0,P.getParsedType)(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){const a=this._parse(r);if((0,b.isAsync)(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(r){const a=this._parse(r);return Promise.resolve(a)}parse(r,a){const d=this.safeParse(r,a);if(d.success)return d.data;throw d.error}safeParse(r,a){const d={common:{issues:[],async:a?.async??!1,contextualErrorMap:a?.errorMap},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:(0,P.getParsedType)(r)},h=this._parseSync({data:r,path:d.path,parent:d});return handleResult(d,h)}"~validate"(r){const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:(0,P.getParsedType)(r)};if(!this["~standard"].async)try{const d=this._parseSync({data:r,path:[],parent:a});return(0,b.isValid)(d)?{value:d.value}:{issues:a.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:r,path:[],parent:a}).then(r=>(0,b.isValid)(r)?{value:r.value}:{issues:a.common.issues})}async parseAsync(r,a){const d=await this.safeParseAsync(r,a);if(d.success)return d.data;throw d.error}async safeParseAsync(r,a){const d={common:{issues:[],contextualErrorMap:a?.errorMap,async:!0},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:(0,P.getParsedType)(r)},h=this._parse({data:r,path:d.path,parent:d}),g=await((0,b.isAsync)(h)?h:Promise.resolve(h));return handleResult(d,g)}refine(r,a){const getIssueProperties=r=>"string"==typeof a||void 0===a?{message:a}:"function"==typeof a?a(r):a;return this._refinement((a,d)=>{const g=r(a),setError=()=>d.addIssue({code:h.ZodIssueCode.custom,...getIssueProperties(a)});return"undefined"!=typeof Promise&&g instanceof Promise?g.then(r=>!!r||(setError(),!1)):!!g||(setError(),!1)})}refinement(r,a){return this._refinement((d,h)=>!!r(d)||(h.addIssue("function"==typeof a?a(d,h):a),!1))}_refinement(r){return new ZodEffects({schema:this,typeName:qe.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}constructor(r){this.spa=this.safeParseAsync,this._def=r,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(r){return ZodUnion.create([this,r],this._def)}and(r){return ZodIntersection.create(this,r,this._def)}transform(r){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:qe.ZodEffects,effect:{type:"transform",transform:r}})}default(r){const a="function"==typeof r?r:()=>r;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:a,typeName:qe.ZodDefault})}brand(){return new ZodBranded({typeName:qe.ZodBranded,type:this,...processCreateParams(this._def)})}catch(r){const a="function"==typeof r?r:()=>r;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:a,typeName:qe.ZodCatch})}describe(r){return new(0,this.constructor)({...this._def,description:r})}pipe(r){return ZodPipeline.create(this,r)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const j=/^c[^\s-]{8,}$/i,Z=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Z]{26}$/i,N=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$=/^[a-z0-9_-]{21}$/i,z=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,L=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,F=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let M;const U=/^(?:(?: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])$/,q=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,V=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,K=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,H=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,B=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,G="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ze=new RegExp(`^${G}$`);function timeRegexSource(r){let a="[0-5]\\d";r.precision?a=`${a}\\.\\d{${r.precision}}`:null==r.precision&&(a=`${a}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${a})${r.precision?"+":"?"}`}function timeRegex(r){return new RegExp(`^${timeRegexSource(r)}$`)}function datetimeRegex(r){let a=`${G}T${timeRegexSource(r)}`;const d=[];return d.push(r.local?"Z?":"Z"),r.offset&&d.push("([+-]\\d{2}:?\\d{2})"),a=`${a}(${d.join("|")})`,new RegExp(`^${a}$`)}function isValidIP(r,a){return!("v4"!==a&&a||!U.test(r))||!("v6"!==a&&a||!V.test(r))}function isValidJWT(r,a){if(!z.test(r))return!1;try{const[d]=r.split(".");if(!d)return!1;const h=d.replace(/-/g,"+").replace(/_/g,"/").padEnd(d.length+(4-d.length%4)%4,"="),g=JSON.parse(atob(h));return"object"==typeof g&&null!==g&&((!("typ"in g)||"JWT"===g?.typ)&&(!!g.alg&&(!a||g.alg===a)))}catch{return!1}}function isValidCidr(r,a){return!("v4"!==a&&a||!q.test(r))||!("v6"!==a&&a||!K.test(r))}class ZodString extends ZodType{_parse(r){this._def.coerce&&(r.data=String(r.data));if(this._getType(r)!==P.ZodParsedType.string){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.string,received:a.parsedType}),b.INVALID}const a=new b.ParseStatus;let d;for(const g of this._def.checks)if("min"===g.kind)r.data.length<g.value&&(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),a.dirty());else if("max"===g.kind)r.data.length>g.value&&(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),a.dirty());else if("length"===g.kind){const y=r.data.length>g.value,_=r.data.length<g.value;(y||_)&&(d=this._getOrReturnCtx(r,d),y?(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}):_&&(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}),a.dirty())}else if("email"===g.kind)F.test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"email",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty());else if("emoji"===g.kind)M||(M=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),M.test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"emoji",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty());else if("uuid"===g.kind)N.test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"uuid",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty());else if("nanoid"===g.kind)$.test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"nanoid",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty());else if("cuid"===g.kind)j.test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"cuid",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty());else if("cuid2"===g.kind)Z.test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"cuid2",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty());else if("ulid"===g.kind)D.test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"ulid",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty());else if("url"===g.kind)try{new URL(r.data)}catch{d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"url",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty()}else if("regex"===g.kind){g.regex.lastIndex=0;g.regex.test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"regex",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty())}else if("trim"===g.kind)r.data=r.data.trim();else if("includes"===g.kind)r.data.includes(g.value,g.position)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_string,validation:{includes:g.value,position:g.position},message:g.message}),a.dirty());else if("toLowerCase"===g.kind)r.data=r.data.toLowerCase();else if("toUpperCase"===g.kind)r.data=r.data.toUpperCase();else if("startsWith"===g.kind)r.data.startsWith(g.value)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_string,validation:{startsWith:g.value},message:g.message}),a.dirty());else if("endsWith"===g.kind)r.data.endsWith(g.value)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_string,validation:{endsWith:g.value},message:g.message}),a.dirty());else if("datetime"===g.kind){datetimeRegex(g).test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_string,validation:"datetime",message:g.message}),a.dirty())}else if("date"===g.kind){ze.test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_string,validation:"date",message:g.message}),a.dirty())}else if("time"===g.kind){timeRegex(g).test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_string,validation:"time",message:g.message}),a.dirty())}else"duration"===g.kind?L.test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"duration",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty()):"ip"===g.kind?isValidIP(r.data,g.version)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"ip",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty()):"jwt"===g.kind?isValidJWT(r.data,g.alg)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"jwt",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty()):"cidr"===g.kind?isValidCidr(r.data,g.version)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"cidr",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty()):"base64"===g.kind?H.test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"base64",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty()):"base64url"===g.kind?B.test(r.data)||(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{validation:"base64url",code:h.ZodIssueCode.invalid_string,message:g.message}),a.dirty()):P.util.assertNever(g);return{status:a.value,value:r.data}}_regex(r,a,d){return this.refinement(a=>r.test(a),{validation:a,code:h.ZodIssueCode.invalid_string,..._.errorUtil.errToObj(d)})}_addCheck(r){return new ZodString({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",..._.errorUtil.errToObj(r)})}url(r){return this._addCheck({kind:"url",..._.errorUtil.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",..._.errorUtil.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",..._.errorUtil.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",..._.errorUtil.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",..._.errorUtil.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",..._.errorUtil.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",..._.errorUtil.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",..._.errorUtil.errToObj(r)})}base64url(r){return this._addCheck({kind:"base64url",..._.errorUtil.errToObj(r)})}jwt(r){return this._addCheck({kind:"jwt",..._.errorUtil.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",..._.errorUtil.errToObj(r)})}cidr(r){return this._addCheck({kind:"cidr",..._.errorUtil.errToObj(r)})}datetime(r){return"string"==typeof r?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:r}):this._addCheck({kind:"datetime",precision:void 0===r?.precision?null:r?.precision,offset:r?.offset??!1,local:r?.local??!1,..._.errorUtil.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return"string"==typeof r?this._addCheck({kind:"time",precision:null,message:r}):this._addCheck({kind:"time",precision:void 0===r?.precision?null:r?.precision,..._.errorUtil.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",..._.errorUtil.errToObj(r)})}regex(r,a){return this._addCheck({kind:"regex",regex:r,..._.errorUtil.errToObj(a)})}includes(r,a){return this._addCheck({kind:"includes",value:r,position:a?.position,..._.errorUtil.errToObj(a?.message)})}startsWith(r,a){return this._addCheck({kind:"startsWith",value:r,..._.errorUtil.errToObj(a)})}endsWith(r,a){return this._addCheck({kind:"endsWith",value:r,..._.errorUtil.errToObj(a)})}min(r,a){return this._addCheck({kind:"min",value:r,..._.errorUtil.errToObj(a)})}max(r,a){return this._addCheck({kind:"max",value:r,..._.errorUtil.errToObj(a)})}length(r,a){return this._addCheck({kind:"length",value:r,..._.errorUtil.errToObj(a)})}nonempty(r){return this.min(1,_.errorUtil.errToObj(r))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>"datetime"===r.kind)}get isDate(){return!!this._def.checks.find(r=>"date"===r.kind)}get isTime(){return!!this._def.checks.find(r=>"time"===r.kind)}get isDuration(){return!!this._def.checks.find(r=>"duration"===r.kind)}get isEmail(){return!!this._def.checks.find(r=>"email"===r.kind)}get isURL(){return!!this._def.checks.find(r=>"url"===r.kind)}get isEmoji(){return!!this._def.checks.find(r=>"emoji"===r.kind)}get isUUID(){return!!this._def.checks.find(r=>"uuid"===r.kind)}get isNANOID(){return!!this._def.checks.find(r=>"nanoid"===r.kind)}get isCUID(){return!!this._def.checks.find(r=>"cuid"===r.kind)}get isCUID2(){return!!this._def.checks.find(r=>"cuid2"===r.kind)}get isULID(){return!!this._def.checks.find(r=>"ulid"===r.kind)}get isIP(){return!!this._def.checks.find(r=>"ip"===r.kind)}get isCIDR(){return!!this._def.checks.find(r=>"cidr"===r.kind)}get isBase64(){return!!this._def.checks.find(r=>"base64"===r.kind)}get isBase64url(){return!!this._def.checks.find(r=>"base64url"===r.kind)}get minLength(){let r=null;for(const a of this._def.checks)"min"===a.kind&&(null===r||a.value>r)&&(r=a.value);return r}get maxLength(){let r=null;for(const a of this._def.checks)"max"===a.kind&&(null===r||a.value<r)&&(r=a.value);return r}}function floatSafeRemainder(r,a){const d=(r.toString().split(".")[1]||"").length,h=(a.toString().split(".")[1]||"").length,g=d>h?d:h;return Number.parseInt(r.toFixed(g).replace(".",""))%Number.parseInt(a.toFixed(g).replace(".",""))/10**g}ZodString.create=r=>new ZodString({checks:[],typeName:qe.ZodString,coerce:r?.coerce??!1,...processCreateParams(r)});class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){this._def.coerce&&(r.data=Number(r.data));if(this._getType(r)!==P.ZodParsedType.number){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.number,received:a.parsedType}),b.INVALID}let a;const d=new b.ParseStatus;for(const g of this._def.checks)if("int"===g.kind)P.util.isInteger(r.data)||(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:g.message}),d.dirty());else if("min"===g.kind){(g.inclusive?r.data<g.value:r.data<=g.value)&&(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.too_small,minimum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),d.dirty())}else if("max"===g.kind){(g.inclusive?r.data>g.value:r.data>=g.value)&&(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.too_big,maximum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),d.dirty())}else"multipleOf"===g.kind?0!==floatSafeRemainder(r.data,g.value)&&(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.not_multiple_of,multipleOf:g.value,message:g.message}),d.dirty()):"finite"===g.kind?Number.isFinite(r.data)||(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.not_finite,message:g.message}),d.dirty()):P.util.assertNever(g);return{status:d.value,value:r.data}}gte(r,a){return this.setLimit("min",r,!0,_.errorUtil.toString(a))}gt(r,a){return this.setLimit("min",r,!1,_.errorUtil.toString(a))}lte(r,a){return this.setLimit("max",r,!0,_.errorUtil.toString(a))}lt(r,a){return this.setLimit("max",r,!1,_.errorUtil.toString(a))}setLimit(r,a,d,h){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:r,value:a,inclusive:d,message:_.errorUtil.toString(h)}]})}_addCheck(r){return new ZodNumber({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:_.errorUtil.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.errorUtil.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.errorUtil.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.errorUtil.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.errorUtil.toString(r)})}multipleOf(r,a){return this._addCheck({kind:"multipleOf",value:r,message:_.errorUtil.toString(a)})}finite(r){return this._addCheck({kind:"finite",message:_.errorUtil.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.errorUtil.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.errorUtil.toString(r)})}get minValue(){let r=null;for(const a of this._def.checks)"min"===a.kind&&(null===r||a.value>r)&&(r=a.value);return r}get maxValue(){let r=null;for(const a of this._def.checks)"max"===a.kind&&(null===r||a.value<r)&&(r=a.value);return r}get isInt(){return!!this._def.checks.find(r=>"int"===r.kind||"multipleOf"===r.kind&&P.util.isInteger(r.value))}get isFinite(){let r=null,a=null;for(const d of this._def.checks){if("finite"===d.kind||"int"===d.kind||"multipleOf"===d.kind)return!0;"min"===d.kind?(null===a||d.value>a)&&(a=d.value):"max"===d.kind&&(null===r||d.value<r)&&(r=d.value)}return Number.isFinite(a)&&Number.isFinite(r)}}ZodNumber.create=r=>new ZodNumber({checks:[],typeName:qe.ZodNumber,coerce:r?.coerce||!1,...processCreateParams(r)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce)try{r.data=BigInt(r.data)}catch{return this._getInvalidInput(r)}if(this._getType(r)!==P.ZodParsedType.bigint)return this._getInvalidInput(r);let a;const d=new b.ParseStatus;for(const g of this._def.checks)if("min"===g.kind){(g.inclusive?r.data<g.value:r.data<=g.value)&&(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.too_small,type:"bigint",minimum:g.value,inclusive:g.inclusive,message:g.message}),d.dirty())}else if("max"===g.kind){(g.inclusive?r.data>g.value:r.data>=g.value)&&(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.too_big,type:"bigint",maximum:g.value,inclusive:g.inclusive,message:g.message}),d.dirty())}else"multipleOf"===g.kind?r.data%g.value!==BigInt(0)&&(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.not_multiple_of,multipleOf:g.value,message:g.message}),d.dirty()):P.util.assertNever(g);return{status:d.value,value:r.data}}_getInvalidInput(r){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.bigint,received:a.parsedType}),b.INVALID}gte(r,a){return this.setLimit("min",r,!0,_.errorUtil.toString(a))}gt(r,a){return this.setLimit("min",r,!1,_.errorUtil.toString(a))}lte(r,a){return this.setLimit("max",r,!0,_.errorUtil.toString(a))}lt(r,a){return this.setLimit("max",r,!1,_.errorUtil.toString(a))}setLimit(r,a,d,h){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:r,value:a,inclusive:d,message:_.errorUtil.toString(h)}]})}_addCheck(r){return new ZodBigInt({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.errorUtil.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.errorUtil.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.errorUtil.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.errorUtil.toString(r)})}multipleOf(r,a){return this._addCheck({kind:"multipleOf",value:r,message:_.errorUtil.toString(a)})}get minValue(){let r=null;for(const a of this._def.checks)"min"===a.kind&&(null===r||a.value>r)&&(r=a.value);return r}get maxValue(){let r=null;for(const a of this._def.checks)"max"===a.kind&&(null===r||a.value<r)&&(r=a.value);return r}}ZodBigInt.create=r=>new ZodBigInt({checks:[],typeName:qe.ZodBigInt,coerce:r?.coerce??!1,...processCreateParams(r)});class ZodBoolean extends ZodType{_parse(r){this._def.coerce&&(r.data=Boolean(r.data));if(this._getType(r)!==P.ZodParsedType.boolean){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.boolean,received:a.parsedType}),b.INVALID}return(0,b.OK)(r.data)}}ZodBoolean.create=r=>new ZodBoolean({typeName:qe.ZodBoolean,coerce:r?.coerce||!1,...processCreateParams(r)});class ZodDate extends ZodType{_parse(r){this._def.coerce&&(r.data=new Date(r.data));if(this._getType(r)!==P.ZodParsedType.date){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.date,received:a.parsedType}),b.INVALID}if(Number.isNaN(r.data.getTime())){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_date}),b.INVALID}const a=new b.ParseStatus;let d;for(const g of this._def.checks)"min"===g.kind?r.data.getTime()<g.value&&(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_small,message:g.message,inclusive:!0,exact:!1,minimum:g.value,type:"date"}),a.dirty()):"max"===g.kind?r.data.getTime()>g.value&&(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_big,message:g.message,inclusive:!0,exact:!1,maximum:g.value,type:"date"}),a.dirty()):P.util.assertNever(g);return{status:a.value,value:new Date(r.data.getTime())}}_addCheck(r){return new ZodDate({...this._def,checks:[...this._def.checks,r]})}min(r,a){return this._addCheck({kind:"min",value:r.getTime(),message:_.errorUtil.toString(a)})}max(r,a){return this._addCheck({kind:"max",value:r.getTime(),message:_.errorUtil.toString(a)})}get minDate(){let r=null;for(const a of this._def.checks)"min"===a.kind&&(null===r||a.value>r)&&(r=a.value);return null!=r?new Date(r):null}get maxDate(){let r=null;for(const a of this._def.checks)"max"===a.kind&&(null===r||a.value<r)&&(r=a.value);return null!=r?new Date(r):null}}ZodDate.create=r=>new ZodDate({checks:[],coerce:r?.coerce||!1,typeName:qe.ZodDate,...processCreateParams(r)});class ZodSymbol extends ZodType{_parse(r){if(this._getType(r)!==P.ZodParsedType.symbol){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.symbol,received:a.parsedType}),b.INVALID}return(0,b.OK)(r.data)}}ZodSymbol.create=r=>new ZodSymbol({typeName:qe.ZodSymbol,...processCreateParams(r)});class ZodUndefined extends ZodType{_parse(r){if(this._getType(r)!==P.ZodParsedType.undefined){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.undefined,received:a.parsedType}),b.INVALID}return(0,b.OK)(r.data)}}ZodUndefined.create=r=>new ZodUndefined({typeName:qe.ZodUndefined,...processCreateParams(r)});class ZodNull extends ZodType{_parse(r){if(this._getType(r)!==P.ZodParsedType.null){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.null,received:a.parsedType}),b.INVALID}return(0,b.OK)(r.data)}}ZodNull.create=r=>new ZodNull({typeName:qe.ZodNull,...processCreateParams(r)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(r){return(0,b.OK)(r.data)}}ZodAny.create=r=>new ZodAny({typeName:qe.ZodAny,...processCreateParams(r)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(r){return(0,b.OK)(r.data)}}ZodUnknown.create=r=>new ZodUnknown({typeName:qe.ZodUnknown,...processCreateParams(r)});class ZodNever extends ZodType{_parse(r){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.never,received:a.parsedType}),b.INVALID}}ZodNever.create=r=>new ZodNever({typeName:qe.ZodNever,...processCreateParams(r)});class ZodVoid extends ZodType{_parse(r){if(this._getType(r)!==P.ZodParsedType.undefined){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.void,received:a.parsedType}),b.INVALID}return(0,b.OK)(r.data)}}ZodVoid.create=r=>new ZodVoid({typeName:qe.ZodVoid,...processCreateParams(r)});class ZodArray extends ZodType{_parse(r){const{ctx:a,status:d}=this._processInputParams(r),g=this._def;if(a.parsedType!==P.ZodParsedType.array)return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.array,received:a.parsedType}),b.INVALID;if(null!==g.exactLength){const r=a.data.length>g.exactLength.value,y=a.data.length<g.exactLength.value;(r||y)&&((0,b.addIssueToContext)(a,{code:r?h.ZodIssueCode.too_big:h.ZodIssueCode.too_small,minimum:y?g.exactLength.value:void 0,maximum:r?g.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:g.exactLength.message}),d.dirty())}if(null!==g.minLength&&a.data.length<g.minLength.value&&((0,b.addIssueToContext)(a,{code:h.ZodIssueCode.too_small,minimum:g.minLength.value,type:"array",inclusive:!0,exact:!1,message:g.minLength.message}),d.dirty()),null!==g.maxLength&&a.data.length>g.maxLength.value&&((0,b.addIssueToContext)(a,{code:h.ZodIssueCode.too_big,maximum:g.maxLength.value,type:"array",inclusive:!0,exact:!1,message:g.maxLength.message}),d.dirty()),a.common.async)return Promise.all([...a.data].map((r,d)=>g.type._parseAsync(new ParseInputLazyPath(a,r,a.path,d)))).then(r=>b.ParseStatus.mergeArray(d,r));const y=[...a.data].map((r,d)=>g.type._parseSync(new ParseInputLazyPath(a,r,a.path,d)));return b.ParseStatus.mergeArray(d,y)}get element(){return this._def.type}min(r,a){return new ZodArray({...this._def,minLength:{value:r,message:_.errorUtil.toString(a)}})}max(r,a){return new ZodArray({...this._def,maxLength:{value:r,message:_.errorUtil.toString(a)}})}length(r,a){return new ZodArray({...this._def,exactLength:{value:r,message:_.errorUtil.toString(a)}})}nonempty(r){return this.min(1,r)}}function deepPartialify(r){if(r instanceof ZodObject){const a={};for(const d in r.shape){const h=r.shape[d];a[d]=ZodOptional.create(deepPartialify(h))}return new ZodObject({...r._def,shape:()=>a})}return r instanceof ZodArray?new ZodArray({...r._def,type:deepPartialify(r.element)}):r instanceof ZodOptional?ZodOptional.create(deepPartialify(r.unwrap())):r instanceof ZodNullable?ZodNullable.create(deepPartialify(r.unwrap())):r instanceof ZodTuple?ZodTuple.create(r.items.map(r=>deepPartialify(r))):r}ZodArray.create=(r,a)=>new ZodArray({type:r,minLength:null,maxLength:null,exactLength:null,typeName:qe.ZodArray,...processCreateParams(a)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const r=this._def.shape(),a=P.util.objectKeys(r);return this._cached={shape:r,keys:a},this._cached}_parse(r){if(this._getType(r)!==P.ZodParsedType.object){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.object,received:a.parsedType}),b.INVALID}const{status:a,ctx:d}=this._processInputParams(r),{shape:g,keys:y}=this._getCached(),_=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const r in d.data)y.includes(r)||_.push(r);const j=[];for(const r of y){const a=g[r],h=d.data[r];j.push({key:{status:"valid",value:r},value:a._parse(new ParseInputLazyPath(d,h,d.path,r)),alwaysSet:r in d.data})}if(this._def.catchall instanceof ZodNever){const r=this._def.unknownKeys;if("passthrough"===r)for(const r of _)j.push({key:{status:"valid",value:r},value:{status:"valid",value:d.data[r]}});else if("strict"===r)_.length>0&&((0,b.addIssueToContext)(d,{code:h.ZodIssueCode.unrecognized_keys,keys:_}),a.dirty());else if("strip"!==r)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const r=this._def.catchall;for(const a of _){const h=d.data[a];j.push({key:{status:"valid",value:a},value:r._parse(new ParseInputLazyPath(d,h,d.path,a)),alwaysSet:a in d.data})}}return d.common.async?Promise.resolve().then(async()=>{const r=[];for(const a of j){const d=await a.key,h=await a.value;r.push({key:d,value:h,alwaysSet:a.alwaysSet})}return r}).then(r=>b.ParseStatus.mergeObjectSync(a,r)):b.ParseStatus.mergeObjectSync(a,j)}get shape(){return this._def.shape()}strict(r){return _.errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==r?{errorMap:(a,d)=>{const h=this._def.errorMap?.(a,d).message??d.defaultError;return"unrecognized_keys"===a.code?{message:_.errorUtil.errToObj(r).message??h}:{message:h}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(r){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new ZodObject({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:qe.ZodObject})}setKey(r,a){return this.augment({[r]:a})}catchall(r){return new ZodObject({...this._def,catchall:r})}pick(r){const a={};for(const d of P.util.objectKeys(r))r[d]&&this.shape[d]&&(a[d]=this.shape[d]);return new ZodObject({...this._def,shape:()=>a})}omit(r){const a={};for(const d of P.util.objectKeys(this.shape))r[d]||(a[d]=this.shape[d]);return new ZodObject({...this._def,shape:()=>a})}deepPartial(){return deepPartialify(this)}partial(r){const a={};for(const d of P.util.objectKeys(this.shape)){const h=this.shape[d];r&&!r[d]?a[d]=h:a[d]=h.optional()}return new ZodObject({...this._def,shape:()=>a})}required(r){const a={};for(const d of P.util.objectKeys(this.shape))if(r&&!r[d])a[d]=this.shape[d];else{let r=this.shape[d];for(;r instanceof ZodOptional;)r=r._def.innerType;a[d]=r}return new ZodObject({...this._def,shape:()=>a})}keyof(){return createZodEnum(P.util.objectKeys(this.shape))}}ZodObject.create=(r,a)=>new ZodObject({shape:()=>r,unknownKeys:"strip",catchall:ZodNever.create(),typeName:qe.ZodObject,...processCreateParams(a)}),ZodObject.strictCreate=(r,a)=>new ZodObject({shape:()=>r,unknownKeys:"strict",catchall:ZodNever.create(),typeName:qe.ZodObject,...processCreateParams(a)}),ZodObject.lazycreate=(r,a)=>new ZodObject({shape:r,unknownKeys:"strip",catchall:ZodNever.create(),typeName:qe.ZodObject,...processCreateParams(a)});class ZodUnion extends ZodType{_parse(r){const{ctx:a}=this._processInputParams(r),d=this._def.options;if(a.common.async)return Promise.all(d.map(async r=>{const d={...a,common:{...a.common,issues:[]},parent:null};return{result:await r._parseAsync({data:a.data,path:a.path,parent:d}),ctx:d}})).then(function handleResults(r){for(const a of r)if("valid"===a.result.status)return a.result;for(const d of r)if("dirty"===d.result.status)return a.common.issues.push(...d.ctx.common.issues),d.result;const d=r.map(r=>new h.ZodError(r.ctx.common.issues));return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_union,unionErrors:d}),b.INVALID});{let r;const g=[];for(const h of d){const d={...a,common:{...a.common,issues:[]},parent:null},y=h._parseSync({data:a.data,path:a.path,parent:d});if("valid"===y.status)return y;"dirty"!==y.status||r||(r={result:y,ctx:d}),d.common.issues.length&&g.push(d.common.issues)}if(r)return a.common.issues.push(...r.ctx.common.issues),r.result;const y=g.map(r=>new h.ZodError(r));return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_union,unionErrors:y}),b.INVALID}}get options(){return this._def.options}}ZodUnion.create=(r,a)=>new ZodUnion({options:r,typeName:qe.ZodUnion,...processCreateParams(a)});const getDiscriminator=r=>r instanceof ZodLazy?getDiscriminator(r.schema):r instanceof ZodEffects?getDiscriminator(r.innerType()):r instanceof ZodLiteral?[r.value]:r instanceof ZodEnum?r.options:r instanceof ZodNativeEnum?P.util.objectValues(r.enum):r instanceof ZodDefault?getDiscriminator(r._def.innerType):r instanceof ZodUndefined?[void 0]:r instanceof ZodNull?[null]:r instanceof ZodOptional?[void 0,...getDiscriminator(r.unwrap())]:r instanceof ZodNullable?[null,...getDiscriminator(r.unwrap())]:r instanceof ZodBranded||r instanceof ZodReadonly?getDiscriminator(r.unwrap()):r instanceof ZodCatch?getDiscriminator(r._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(r){const{ctx:a}=this._processInputParams(r);if(a.parsedType!==P.ZodParsedType.object)return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.object,received:a.parsedType}),b.INVALID;const d=this.discriminator,g=a.data[d],y=this.optionsMap.get(g);return y?a.common.async?y._parseAsync({data:a.data,path:a.path,parent:a}):y._parseSync({data:a.data,path:a.path,parent:a}):((0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[d]}),b.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,a,d){const h=new Map;for(const d of a){const a=getDiscriminator(d.shape[r]);if(!a.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(const g of a){if(h.has(g))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(g)}`);h.set(g,d)}}return new ZodDiscriminatedUnion({typeName:qe.ZodDiscriminatedUnion,discriminator:r,options:a,optionsMap:h,...processCreateParams(d)})}}function mergeValues(r,a){const d=(0,P.getParsedType)(r),h=(0,P.getParsedType)(a);if(r===a)return{valid:!0,data:r};if(d===P.ZodParsedType.object&&h===P.ZodParsedType.object){const d=P.util.objectKeys(a),h=P.util.objectKeys(r).filter(r=>-1!==d.indexOf(r)),g={...r,...a};for(const d of h){const h=mergeValues(r[d],a[d]);if(!h.valid)return{valid:!1};g[d]=h.data}return{valid:!0,data:g}}if(d===P.ZodParsedType.array&&h===P.ZodParsedType.array){if(r.length!==a.length)return{valid:!1};const d=[];for(let h=0;h<r.length;h++){const g=mergeValues(r[h],a[h]);if(!g.valid)return{valid:!1};d.push(g.data)}return{valid:!0,data:d}}return d===P.ZodParsedType.date&&h===P.ZodParsedType.date&&+r===+a?{valid:!0,data:r}:{valid:!1}}class ZodIntersection extends ZodType{_parse(r){const{status:a,ctx:d}=this._processInputParams(r),handleParsed=(r,g)=>{if((0,b.isAborted)(r)||(0,b.isAborted)(g))return b.INVALID;const y=mergeValues(r.value,g.value);return y.valid?(((0,b.isDirty)(r)||(0,b.isDirty)(g))&&a.dirty(),{status:a.value,value:y.data}):((0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_intersection_types}),b.INVALID)};return d.common.async?Promise.all([this._def.left._parseAsync({data:d.data,path:d.path,parent:d}),this._def.right._parseAsync({data:d.data,path:d.path,parent:d})]).then(([r,a])=>handleParsed(r,a)):handleParsed(this._def.left._parseSync({data:d.data,path:d.path,parent:d}),this._def.right._parseSync({data:d.data,path:d.path,parent:d}))}}ZodIntersection.create=(r,a,d)=>new ZodIntersection({left:r,right:a,typeName:qe.ZodIntersection,...processCreateParams(d)});class ZodTuple extends ZodType{_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.parsedType!==P.ZodParsedType.array)return(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.array,received:d.parsedType}),b.INVALID;if(d.data.length<this._def.items.length)return(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b.INVALID;!this._def.rest&&d.data.length>this._def.items.length&&((0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());const g=[...d.data].map((r,a)=>{const h=this._def.items[a]||this._def.rest;return h?h._parse(new ParseInputLazyPath(d,r,d.path,a)):null}).filter(r=>!!r);return d.common.async?Promise.all(g).then(r=>b.ParseStatus.mergeArray(a,r)):b.ParseStatus.mergeArray(a,g)}get items(){return this._def.items}rest(r){return new ZodTuple({...this._def,rest:r})}}ZodTuple.create=(r,a)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:r,typeName:qe.ZodTuple,rest:null,...processCreateParams(a)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.parsedType!==P.ZodParsedType.object)return(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.object,received:d.parsedType}),b.INVALID;const g=[],y=this._def.keyType,_=this._def.valueType;for(const r in d.data)g.push({key:y._parse(new ParseInputLazyPath(d,r,d.path,r)),value:_._parse(new ParseInputLazyPath(d,d.data[r],d.path,r)),alwaysSet:r in d.data});return d.common.async?b.ParseStatus.mergeObjectAsync(a,g):b.ParseStatus.mergeObjectSync(a,g)}get element(){return this._def.valueType}static create(r,a,d){return new ZodRecord(a instanceof ZodType?{keyType:r,valueType:a,typeName:qe.ZodRecord,...processCreateParams(d)}:{keyType:ZodString.create(),valueType:r,typeName:qe.ZodRecord,...processCreateParams(a)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.parsedType!==P.ZodParsedType.map)return(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.map,received:d.parsedType}),b.INVALID;const g=this._def.keyType,y=this._def.valueType,_=[...d.data.entries()].map(([r,a],h)=>({key:g._parse(new ParseInputLazyPath(d,r,d.path,[h,"key"])),value:y._parse(new ParseInputLazyPath(d,a,d.path,[h,"value"]))}));if(d.common.async){const r=new Map;return Promise.resolve().then(async()=>{for(const d of _){const h=await d.key,g=await d.value;if("aborted"===h.status||"aborted"===g.status)return b.INVALID;"dirty"!==h.status&&"dirty"!==g.status||a.dirty(),r.set(h.value,g.value)}return{status:a.value,value:r}})}{const r=new Map;for(const d of _){const h=d.key,g=d.value;if("aborted"===h.status||"aborted"===g.status)return b.INVALID;"dirty"!==h.status&&"dirty"!==g.status||a.dirty(),r.set(h.value,g.value)}return{status:a.value,value:r}}}}ZodMap.create=(r,a,d)=>new ZodMap({valueType:a,keyType:r,typeName:qe.ZodMap,...processCreateParams(d)});class ZodSet extends ZodType{_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.parsedType!==P.ZodParsedType.set)return(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.set,received:d.parsedType}),b.INVALID;const g=this._def;null!==g.minSize&&d.data.size<g.minSize.value&&((0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_small,minimum:g.minSize.value,type:"set",inclusive:!0,exact:!1,message:g.minSize.message}),a.dirty()),null!==g.maxSize&&d.data.size>g.maxSize.value&&((0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_big,maximum:g.maxSize.value,type:"set",inclusive:!0,exact:!1,message:g.maxSize.message}),a.dirty());const y=this._def.valueType;function finalizeSet(r){const d=new Set;for(const h of r){if("aborted"===h.status)return b.INVALID;"dirty"===h.status&&a.dirty(),d.add(h.value)}return{status:a.value,value:d}}const _=[...d.data.values()].map((r,a)=>y._parse(new ParseInputLazyPath(d,r,d.path,a)));return d.common.async?Promise.all(_).then(r=>finalizeSet(r)):finalizeSet(_)}min(r,a){return new ZodSet({...this._def,minSize:{value:r,message:_.errorUtil.toString(a)}})}max(r,a){return new ZodSet({...this._def,maxSize:{value:r,message:_.errorUtil.toString(a)}})}size(r,a){return this.min(r,a).max(r,a)}nonempty(r){return this.min(1,r)}}ZodSet.create=(r,a)=>new ZodSet({valueType:r,minSize:null,maxSize:null,typeName:qe.ZodSet,...processCreateParams(a)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(r){const{ctx:a}=this._processInputParams(r);if(a.parsedType!==P.ZodParsedType.function)return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.function,received:a.parsedType}),b.INVALID;function makeArgsIssue(r,d){return(0,b.makeIssue)({data:r,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,(0,g.getErrorMap)(),y.default].filter(r=>!!r),issueData:{code:h.ZodIssueCode.invalid_arguments,argumentsError:d}})}function makeReturnsIssue(r,d){return(0,b.makeIssue)({data:r,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,(0,g.getErrorMap)(),y.default].filter(r=>!!r),issueData:{code:h.ZodIssueCode.invalid_return_type,returnTypeError:d}})}const d={errorMap:a.common.contextualErrorMap},_=a.data;if(this._def.returns instanceof ZodPromise){const r=this;return(0,b.OK)(async function(...a){const g=new h.ZodError([]),y=await r._def.args.parseAsync(a,d).catch(r=>{throw g.addIssue(makeArgsIssue(a,r)),g}),b=await Reflect.apply(_,this,y);return await r._def.returns._def.type.parseAsync(b,d).catch(r=>{throw g.addIssue(makeReturnsIssue(b,r)),g})})}{const r=this;return(0,b.OK)(function(...a){const g=r._def.args.safeParse(a,d);if(!g.success)throw new h.ZodError([makeArgsIssue(a,g.error)]);const y=Reflect.apply(_,this,g.data),b=r._def.returns.safeParse(y,d);if(!b.success)throw new h.ZodError([makeReturnsIssue(y,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new ZodFunction({...this._def,args:ZodTuple.create(r).rest(ZodUnknown.create())})}returns(r){return new ZodFunction({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,a,d){return new ZodFunction({args:r||ZodTuple.create([]).rest(ZodUnknown.create()),returns:a||ZodUnknown.create(),typeName:qe.ZodFunction,...processCreateParams(d)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(r){const{ctx:a}=this._processInputParams(r);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}}ZodLazy.create=(r,a)=>new ZodLazy({getter:r,typeName:qe.ZodLazy,...processCreateParams(a)});class ZodLiteral extends ZodType{_parse(r){if(r.data!==this._def.value){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{received:a.data,code:h.ZodIssueCode.invalid_literal,expected:this._def.value}),b.INVALID}return{status:"valid",value:r.data}}get value(){return this._def.value}}function createZodEnum(r,a){return new ZodEnum({values:r,typeName:qe.ZodEnum,...processCreateParams(a)})}ZodLiteral.create=(r,a)=>new ZodLiteral({value:r,typeName:qe.ZodLiteral,...processCreateParams(a)});class ZodEnum extends ZodType{_parse(r){if("string"!=typeof r.data){const a=this._getOrReturnCtx(r),d=this._def.values;return(0,b.addIssueToContext)(a,{expected:P.util.joinValues(d),received:a.parsedType,code:h.ZodIssueCode.invalid_type}),b.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(r.data)){const a=this._getOrReturnCtx(r),d=this._def.values;return(0,b.addIssueToContext)(a,{received:a.data,code:h.ZodIssueCode.invalid_enum_value,options:d}),b.INVALID}return(0,b.OK)(r.data)}get options(){return this._def.values}get enum(){const r={};for(const a of this._def.values)r[a]=a;return r}get Values(){const r={};for(const a of this._def.values)r[a]=a;return r}get Enum(){const r={};for(const a of this._def.values)r[a]=a;return r}extract(r,a=this._def){return ZodEnum.create(r,{...this._def,...a})}exclude(r,a=this._def){return ZodEnum.create(this.options.filter(a=>!r.includes(a)),{...this._def,...a})}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(r){const a=P.util.getValidEnumValues(this._def.values),d=this._getOrReturnCtx(r);if(d.parsedType!==P.ZodParsedType.string&&d.parsedType!==P.ZodParsedType.number){const r=P.util.objectValues(a);return(0,b.addIssueToContext)(d,{expected:P.util.joinValues(r),received:d.parsedType,code:h.ZodIssueCode.invalid_type}),b.INVALID}if(this._cache||(this._cache=new Set(P.util.getValidEnumValues(this._def.values))),!this._cache.has(r.data)){const r=P.util.objectValues(a);return(0,b.addIssueToContext)(d,{received:d.data,code:h.ZodIssueCode.invalid_enum_value,options:r}),b.INVALID}return(0,b.OK)(r.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(r,a)=>new ZodNativeEnum({values:r,typeName:qe.ZodNativeEnum,...processCreateParams(a)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(r){const{ctx:a}=this._processInputParams(r);if(a.parsedType!==P.ZodParsedType.promise&&!1===a.common.async)return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.promise,received:a.parsedType}),b.INVALID;const d=a.parsedType===P.ZodParsedType.promise?a.data:Promise.resolve(a.data);return(0,b.OK)(d.then(r=>this._def.type.parseAsync(r,{path:a.path,errorMap:a.common.contextualErrorMap})))}}ZodPromise.create=(r,a)=>new ZodPromise({type:r,typeName:qe.ZodPromise,...processCreateParams(a)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===qe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){const{status:a,ctx:d}=this._processInputParams(r),h=this._def.effect||null,g={addIssue:r=>{(0,b.addIssueToContext)(d,r),r.fatal?a.abort():a.dirty()},get path(){return d.path}};if(g.addIssue=g.addIssue.bind(g),"preprocess"===h.type){const r=h.transform(d.data,g);if(d.common.async)return Promise.resolve(r).then(async r=>{if("aborted"===a.value)return b.INVALID;const h=await this._def.schema._parseAsync({data:r,path:d.path,parent:d});return"aborted"===h.status?b.INVALID:"dirty"===h.status||"dirty"===a.value?(0,b.DIRTY)(h.value):h});{if("aborted"===a.value)return b.INVALID;const h=this._def.schema._parseSync({data:r,path:d.path,parent:d});return"aborted"===h.status?b.INVALID:"dirty"===h.status||"dirty"===a.value?(0,b.DIRTY)(h.value):h}}if("refinement"===h.type){const executeRefinement=r=>{const a=h.refinement(r,g);if(d.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return r};if(!1===d.common.async){const r=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});return"aborted"===r.status?b.INVALID:("dirty"===r.status&&a.dirty(),executeRefinement(r.value),{status:a.value,value:r.value})}return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(r=>"aborted"===r.status?b.INVALID:("dirty"===r.status&&a.dirty(),executeRefinement(r.value).then(()=>({status:a.value,value:r.value}))))}if("transform"===h.type){if(!1===d.common.async){const r=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});if(!(0,b.isValid)(r))return b.INVALID;const y=h.transform(r.value,g);if(y instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:y}}return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(r=>(0,b.isValid)(r)?Promise.resolve(h.transform(r.value,g)).then(r=>({status:a.value,value:r})):b.INVALID)}P.util.assertNever(h)}}ZodEffects.create=(r,a,d)=>new ZodEffects({schema:r,typeName:qe.ZodEffects,effect:a,...processCreateParams(d)}),ZodEffects.createWithPreprocess=(r,a,d)=>new ZodEffects({schema:a,effect:{type:"preprocess",transform:r},typeName:qe.ZodEffects,...processCreateParams(d)});class ZodOptional extends ZodType{_parse(r){return this._getType(r)===P.ZodParsedType.undefined?(0,b.OK)(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}ZodOptional.create=(r,a)=>new ZodOptional({innerType:r,typeName:qe.ZodOptional,...processCreateParams(a)});class ZodNullable extends ZodType{_parse(r){return this._getType(r)===P.ZodParsedType.null?(0,b.OK)(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}ZodNullable.create=(r,a)=>new ZodNullable({innerType:r,typeName:qe.ZodNullable,...processCreateParams(a)});class ZodDefault extends ZodType{_parse(r){const{ctx:a}=this._processInputParams(r);let d=a.data;return a.parsedType===P.ZodParsedType.undefined&&(d=this._def.defaultValue()),this._def.innerType._parse({data:d,path:a.path,parent:a})}removeDefault(){return this._def.innerType}}ZodDefault.create=(r,a)=>new ZodDefault({innerType:r,typeName:qe.ZodDefault,defaultValue:"function"==typeof a.default?a.default:()=>a.default,...processCreateParams(a)});class ZodCatch extends ZodType{_parse(r){const{ctx:a}=this._processInputParams(r),d={...a,common:{...a.common,issues:[]}},g=this._def.innerType._parse({data:d.data,path:d.path,parent:{...d}});return(0,b.isAsync)(g)?g.then(r=>({status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new h.ZodError(d.common.issues)},input:d.data})})):{status:"valid",value:"valid"===g.status?g.value:this._def.catchValue({get error(){return new h.ZodError(d.common.issues)},input:d.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(r,a)=>new ZodCatch({innerType:r,typeName:qe.ZodCatch,catchValue:"function"==typeof a.catch?a.catch:()=>a.catch,...processCreateParams(a)});class ZodNaN extends ZodType{_parse(r){if(this._getType(r)!==P.ZodParsedType.nan){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.nan,received:a.parsedType}),b.INVALID}return{status:"valid",value:r.data}}}ZodNaN.create=r=>new ZodNaN({typeName:qe.ZodNaN,...processCreateParams(r)});const Fe=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(r){const{ctx:a}=this._processInputParams(r),d=a.data;return this._def.type._parse({data:d,path:a.path,parent:a})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.common.async){return(async()=>{const r=await this._def.in._parseAsync({data:d.data,path:d.path,parent:d});return"aborted"===r.status?b.INVALID:"dirty"===r.status?(a.dirty(),(0,b.DIRTY)(r.value)):this._def.out._parseAsync({data:r.value,path:d.path,parent:d})})()}{const r=this._def.in._parseSync({data:d.data,path:d.path,parent:d});return"aborted"===r.status?b.INVALID:"dirty"===r.status?(a.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:d.path,parent:d})}}static create(r,a){return new ZodPipeline({in:r,out:a,typeName:qe.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(r){const a=this._def.innerType._parse(r),freeze=r=>((0,b.isValid)(r)&&(r.value=Object.freeze(r.value)),r);return(0,b.isAsync)(a)?a.then(r=>freeze(r)):freeze(a)}unwrap(){return this._def.innerType}}function cleanParams(r,a){const d="function"==typeof r?r(a):"string"==typeof r?{message:r}:r;return"string"==typeof d?{message:d}:d}function custom(r,a={},d){return r?ZodAny.create().superRefine((h,g)=>{const y=r(h);if(y instanceof Promise)return y.then(r=>{if(!r){const r=cleanParams(a,h),y=r.fatal??d??!0;g.addIssue({code:"custom",...r,fatal:y})}});if(!y){const r=cleanParams(a,h),y=r.fatal??d??!0;g.addIssue({code:"custom",...r,fatal:y})}}):ZodAny.create()}ZodReadonly.create=(r,a)=>new ZodReadonly({innerType:r,typeName:qe.ZodReadonly,...processCreateParams(a)});const Ue={object:ZodObject.lazycreate};var qe;!function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"}(qe||(qe={}));const instanceOfType=(r,a={message:`Input not instance of ${r.name}`})=>custom(a=>a instanceof r,a),Ve=ZodString.create,Ke=ZodNumber.create,He=ZodNaN.create,Be=ZodBigInt.create,Qe=ZodBoolean.create,Je=ZodDate.create,We=ZodSymbol.create,Ye=ZodUndefined.create,Xe=ZodNull.create,et=ZodAny.create,tt=ZodUnknown.create,rt=ZodNever.create,st=ZodVoid.create,at=ZodArray.create,nt=ZodObject.create,ot=ZodObject.strictCreate,it=ZodUnion.create,dt=ZodDiscriminatedUnion.create,ct=ZodIntersection.create,ut=ZodTuple.create,lt=ZodRecord.create,pt=ZodMap.create,mt=ZodSet.create,ht=ZodFunction.create,ft=ZodLazy.create,gt=ZodLiteral.create,vt=ZodEnum.create,yt=ZodNativeEnum.create,_t=ZodPromise.create,bt=ZodEffects.create,Pt=ZodOptional.create,kt=ZodNullable.create,wt=ZodEffects.createWithPreprocess,xt=ZodPipeline.create,ostring=()=>Ve().optional(),onumber=()=>Ke().optional(),oboolean=()=>Qe().optional(),jt={string:r=>ZodString.create({...r,coerce:!0}),number:r=>ZodNumber.create({...r,coerce:!0}),boolean:r=>ZodBoolean.create({...r,coerce:!0}),bigint:r=>ZodBigInt.create({...r,coerce:!0}),date:r=>ZodDate.create({...r,coerce:!0})},St=b.INVALID},"./packages/packages/libs/editor-mcp/node_modules/@elementor-external/angie-sdk/dist/index.js":function(r,a,d){"use strict";var h,g,y,_,b,P,j,Z,D;d.r(a),d.d(a,{ANGIE_SIDEBAR_STATE_OPEN:function(){return Mr},AngieDetector:function(){return c},AngieLocalServerTransport:function(){return g},AngieMCPTransport:function(){return h},AngieMcpSdk:function(){return ts},AngieRemoteServerTransport:function(){return y},AngieServerType:function(){return _},ClientManager:function(){return l},HostEventType:function(){return j},HostLocalStorageEventType:function(){return P},MessageEventType:function(){return b},RegistrationQueue:function(){return u},applyWidth:function(){return Un},getAngieIframe:function(){return Pn},getAngieSidebarSavedState:function(){return jn},initAngieSidebar:function(){return Kn},initializeResize:function(){return zn},loadState:function(){return qn},loadWidth:function(){return Dn},navigateAngieIframe:function(){return ns},saveWidth:function(){return Gn},toggleAngieSidebar:function(){return Vn},waitForDocumentReady:function(){return Wn}}),function(r){r.POST_MESSAGE="postMessage"}(h||(h={})),function(r){r.POST_MESSAGE="postMessage"}(g||(g={})),function(r){r.STREAMABLE_HTTP="streamableHttp",r.SSE="sse"}(y||(y={})),function(r){r.LOCAL="local",r.REMOTE="remote"}(_||(_={})),function(r){r.SDK_ANGIE_READY_PING="sdk-angie-ready-ping",r.SDK_ANGIE_REFRESH_PING="sdk-angie-refresh-ping",r.SDK_REQUEST_CLIENT_CREATION="sdk-request-client-creation",r.SDK_REQUEST_INIT_SERVER="sdk-request-init-server",r.SDK_TRIGGER_ANGIE="sdk-trigger-angie",r.SDK_TRIGGER_ANGIE_RESPONSE="sdk-trigger-angie-response"}(b||(b={})),function(r){r.SET="ANGIE_SET_LOCALSTORAGE",r.GET="ANGIE_GET_LOCALSTORAGE"}(P||(P={})),function(r){r.RESET_HASH="reset-hash",r.HOST_READY="host/ready",r.ANGIE_LOADED="angie/loaded",r.ANGIE_READY="angie/ready"}(j||(j={}));class c{isAngieReady=!1;readyPromise;readyResolve;constructor(){if(this.readyPromise=new Promise(r=>{this.readyResolve=r}),"undefined"==typeof window)return;let r=0;const t=()=>{if(this.isAngieReady||r>=500)return void(!this.isAngieReady&&r>=500&&this.handleDetectionTimeout());const a=new MessageChannel;a.port1.onmessage=r=>{this.handleAngieReady(r.data),a.port1.close(),a.port2.close()};const d={type:b.SDK_ANGIE_READY_PING,timestamp:Date.now()};window.postMessage(d,window.location.origin,[a.port2]),r++,setTimeout(t,500)};t()}handleAngieReady(r){this.isAngieReady=!0;const a={isReady:!0,version:r.version,capabilities:r.capabilities};this.readyResolve&&this.readyResolve(a)}handleDetectionTimeout(){this.readyResolve&&this.readyResolve({isReady:!1}),console.warn("AngieMcpSdk: AngieDetector: Detection timeout - Angie may not be available")}isReady(){return this.isAngieReady}async waitForReady(){return this.readyPromise}}class u{queue=[];isProcessing=!1;add(r){const a={id:this.generateId(r),config:r,timestamp:Date.now(),status:"pending"};return this.queue.push(a),console.log(`RegistrationQueue: Added server "${r.name}" to queue`),a}getAll(){return[...this.queue]}getPending(){return this.queue.filter(r=>"pending"===r.status)}updateStatus(r,a,d){const h=this.queue.find(a=>a.id===r);h&&(h.status=a,d?h.error=d:"pending"!==a&&"registered"!==a||delete h.error,console.log(`RegistrationQueue: Updated server ${r} status to ${a}`))}async processQueue(r){if(this.isProcessing)return void console.log("RegistrationQueue: Already processing queue");this.isProcessing=!0;const a=this.getPending();console.log(`RegistrationQueue: Processing ${a.length} pending registrations`);try{for(const d of a)try{await r(d),this.updateStatus(d.id,"registered")}catch(r){const a=r instanceof Error?r.message:String(r);this.updateStatus(d.id,"failed",a),console.error(`RegistrationQueue: Failed to process registration ${d.id}:`,a)}}finally{this.isProcessing=!1}}clear(){this.queue=[],console.log("RegistrationQueue: Cleared all registrations")}resetAllToPending(){if(this.isProcessing)return console.log("RegistrationQueue: Cannot reset to pending - processing in progress"),!1;const r=this.queue.filter(r=>"registered"===r.status).length,a=this.queue.filter(r=>"failed"===r.status).length;return this.queue.forEach(r=>{"pending"!==r.status&&(r.status="pending",delete r.error)}),console.log(`RegistrationQueue: Reset ${r+a} registrations to pending`),!0}remove(r){const a=this.queue.findIndex(a=>a.id===r);return-1!==a&&(this.queue.splice(a,1),console.log(`RegistrationQueue: Removed registration ${r}`),!0)}generateId(r){return`reg_${r.name}_${r.version}_${Date.now()}`}}class l{async requestClientCreation(r){const{config:a}=r,d={serverId:r.id,serverName:a.name,serverVersion:a.version,description:a.description,transport:a.transport||g.POST_MESSAGE,capabilities:a.capabilities,instanceId:r.instanceId};return"type"in a&&"remote"===a.type&&(d.remote={url:a.url}),new Promise((r,a)=>{const h=new MessageChannel,g=setTimeout(()=>{a(new Error("Client creation request timed out after 15000ms"))},15e3);h.port1.onmessage=a=>{clearTimeout(g),r(a.data)};const y={type:b.SDK_REQUEST_CLIENT_CREATION,payload:d,timestamp:Date.now()};window.postMessage(y,window.location.origin,[h.port2])})}}!function(r){r.assertEqual=r=>{},r.assertIs=function(r){},r.assertNever=function(r){throw new Error},r.arrayToEnum=r=>{const a={};for(const d of r)a[d]=d;return a},r.getValidEnumValues=a=>{const d=r.objectKeys(a).filter(r=>"number"!=typeof a[a[r]]),h={};for(const r of d)h[r]=a[r];return r.objectValues(h)},r.objectValues=a=>r.objectKeys(a).map(function(r){return a[r]}),r.objectKeys="function"==typeof Object.keys?r=>Object.keys(r):r=>{const a=[];for(const d in r)Object.prototype.hasOwnProperty.call(r,d)&&a.push(d);return a},r.find=(r,a)=>{for(const d of r)if(a(d))return d},r.isInteger="function"==typeof Number.isInteger?r=>Number.isInteger(r):r=>"number"==typeof r&&Number.isFinite(r)&&Math.floor(r)===r,r.joinValues=function(r,a=" | "){return r.map(r=>"string"==typeof r?`'${r}'`:r).join(a)},r.jsonStringifyReplacer=(r,a)=>"bigint"==typeof a?a.toString():a}(Z||(Z={})),function(r){r.mergeShapes=(r,a)=>({...r,...a})}(D||(D={}));const N=Z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),p=r=>{switch(typeof r){case"undefined":return N.undefined;case"string":return N.string;case"number":return Number.isNaN(r)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":return Array.isArray(r)?N.array:null===r?N.null:r.then&&"function"==typeof r.then&&r.catch&&"function"==typeof r.catch?N.promise:"undefined"!=typeof Map&&r instanceof Map?N.map:"undefined"!=typeof Set&&r instanceof Set?N.set:"undefined"!=typeof Date&&r instanceof Date?N.date:N.object;default:return N.unknown}},$=Z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class m extends Error{get errors(){return this.issues}constructor(r){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=r}format(r){const a=r||function(r){return r.message},d={_errors:[]},s=r=>{for(const h of r.issues)if("invalid_union"===h.code)h.unionErrors.map(s);else if("invalid_return_type"===h.code)s(h.returnTypeError);else if("invalid_arguments"===h.code)s(h.argumentsError);else if(0===h.path.length)d._errors.push(a(h));else{let r=d,g=0;for(;g<h.path.length;){const d=h.path[g];g===h.path.length-1?(r[d]=r[d]||{_errors:[]},r[d]._errors.push(a(h))):r[d]=r[d]||{_errors:[]},r=r[d],g++}}};return s(this),d}static assert(r){if(!(r instanceof m))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Z.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(r=r=>r.message){const a={},d=[];for(const h of this.issues)if(h.path.length>0){const d=h.path[0];a[d]=a[d]||[],a[d].push(r(h))}else d.push(r(h));return{formErrors:d,fieldErrors:a}}get formErrors(){return this.flatten()}}m.create=r=>new m(r);const f=(r,a)=>{let d;switch(r.code){case $.invalid_type:d=r.received===N.undefined?"Required":`Expected ${r.expected}, received ${r.received}`;break;case $.invalid_literal:d=`Invalid literal value, expected ${JSON.stringify(r.expected,Z.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:d=`Unrecognized key(s) in object: ${Z.joinValues(r.keys,", ")}`;break;case $.invalid_union:d="Invalid input";break;case $.invalid_union_discriminator:d=`Invalid discriminator value. Expected ${Z.joinValues(r.options)}`;break;case $.invalid_enum_value:d=`Invalid enum value. Expected ${Z.joinValues(r.options)}, received '${r.received}'`;break;case $.invalid_arguments:d="Invalid function arguments";break;case $.invalid_return_type:d="Invalid function return type";break;case $.invalid_date:d="Invalid date";break;case $.invalid_string:"object"==typeof r.validation?"includes"in r.validation?(d=`Invalid input: must include "${r.validation.includes}"`,"number"==typeof r.validation.position&&(d=`${d} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?d=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?d=`Invalid input: must end with "${r.validation.endsWith}"`:Z.assertNever(r.validation):d="regex"!==r.validation?`Invalid ${r.validation}`:"Invalid";break;case $.too_small:d="array"===r.type?`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:"string"===r.type?`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:"number"===r.type||"bigint"===r.type?`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:"date"===r.type?`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:"Invalid input";break;case $.too_big:d="array"===r.type?`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:"string"===r.type?`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:"number"===r.type?`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:"bigint"===r.type?`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:"date"===r.type?`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:"Invalid input";break;case $.custom:d="Invalid input";break;case $.invalid_intersection_types:d="Intersection results could not be merged";break;case $.not_multiple_of:d=`Number must be a multiple of ${r.multipleOf}`;break;case $.not_finite:d="Number must be finite";break;default:d=a.defaultError,Z.assertNever(r)}return{message:d}};let z=f;var L;function v(r,a){const d=z,h=(r=>{const{data:a,path:d,errorMaps:h,issueData:g}=r,y=[...d,...g.path||[]],_={...g,path:y};if(void 0!==g.message)return{...g,path:y,message:g.message};let b="";const P=h.filter(r=>!!r).slice().reverse();for(const r of P)b=r(_,{data:a,defaultError:b}).message;return{...g,path:y,message:b}})({issueData:a,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,d,d===f?void 0:f].filter(r=>!!r)});r.common.issues.push(h)}!function(r){r.errToObj=r=>"string"==typeof r?{message:r}:r||{},r.toString=r=>"string"==typeof r?r:r?.message}(L||(L={}));class w{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(r,a){const d=[];for(const h of a){if("aborted"===h.status)return F;"dirty"===h.status&&r.dirty(),d.push(h.value)}return{status:r.value,value:d}}static async mergeObjectAsync(r,a){const d=[];for(const r of a){const a=await r.key,h=await r.value;d.push({key:a,value:h})}return w.mergeObjectSync(r,d)}static mergeObjectSync(r,a){const d={};for(const h of a){const{key:a,value:g}=h;if("aborted"===a.status)return F;if("aborted"===g.status)return F;"dirty"===a.status&&r.dirty(),"dirty"===g.status&&r.dirty(),"__proto__"===a.value||void 0===g.value&&!h.alwaysSet||(d[a.value]=g.value)}return{status:r.value,value:d}}}const F=Object.freeze({status:"aborted"}),x=r=>({status:"dirty",value:r}),k=r=>({status:"valid",value:r}),S=r=>"aborted"===r.status,I=r=>"dirty"===r.status,A=r=>"valid"===r.status,E=r=>"undefined"!=typeof Promise&&r instanceof Promise;class T{constructor(r,a,d,h){this._cachedPath=[],this.parent=r,this.data=a,this._path=d,this._key=h}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const R=(r,a)=>{if(A(a))return{success:!0,data:a.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const a=new m(r.common.issues);return this._error=a,this._error}}};function O(r){if(!r)return{};const{errorMap:a,invalid_type_error:d,required_error:h,description:g}=r;if(a&&(d||h))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return a?{errorMap:a,description:g}:{errorMap:(a,g)=>{const{message:y}=r;return"invalid_enum_value"===a.code?{message:y??g.defaultError}:void 0===g.data?{message:y??h??g.defaultError}:"invalid_type"!==a.code?{message:g.defaultError}:{message:y??d??g.defaultError}},description:g}}class C{get description(){return this._def.description}_getType(r){return p(r.data)}_getOrReturnCtx(r,a){return a||{common:r.parent.common,data:r.data,parsedType:p(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new w,ctx:{common:r.parent.common,data:r.data,parsedType:p(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){const a=this._parse(r);if(E(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(r){const a=this._parse(r);return Promise.resolve(a)}parse(r,a){const d=this.safeParse(r,a);if(d.success)return d.data;throw d.error}safeParse(r,a){const d={common:{issues:[],async:a?.async??!1,contextualErrorMap:a?.errorMap},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:p(r)},h=this._parseSync({data:r,path:d.path,parent:d});return R(d,h)}"~validate"(r){const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:p(r)};if(!this["~standard"].async)try{const d=this._parseSync({data:r,path:[],parent:a});return A(d)?{value:d.value}:{issues:a.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:r,path:[],parent:a}).then(r=>A(r)?{value:r.value}:{issues:a.common.issues})}async parseAsync(r,a){const d=await this.safeParseAsync(r,a);if(d.success)return d.data;throw d.error}async safeParseAsync(r,a){const d={common:{issues:[],contextualErrorMap:a?.errorMap,async:!0},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:p(r)},h=this._parse({data:r,path:d.path,parent:d}),g=await(E(h)?h:Promise.resolve(h));return R(d,g)}refine(r,a){const n=r=>"string"==typeof a||void 0===a?{message:a}:"function"==typeof a?a(r):a;return this._refinement((a,d)=>{const h=r(a),i=()=>d.addIssue({code:$.custom,...n(a)});return"undefined"!=typeof Promise&&h instanceof Promise?h.then(r=>!!r||(i(),!1)):!!h||(i(),!1)})}refinement(r,a){return this._refinement((d,h)=>!!r(d)||(h.addIssue("function"==typeof a?a(d,h):a),!1))}_refinement(r){return new Ne({schema:this,typeName:Je.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}constructor(r){this.spa=this.safeParseAsync,this._def=r,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Pe.create(this,this._def)}nullable(){return $e.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ge.create(this)}promise(){return Ce.create(this,this._def)}or(r){return ye.create([this,r],this._def)}and(r){return be.create(this,r,this._def)}transform(r){return new Ne({...O(this._def),schema:this,typeName:Je.ZodEffects,effect:{type:"transform",transform:r}})}default(r){const a="function"==typeof r?r:()=>r;return new Le({...O(this._def),innerType:this,defaultValue:a,typeName:Je.ZodDefault})}brand(){return new De({typeName:Je.ZodBranded,type:this,...O(this._def)})}catch(r){const a="function"==typeof r?r:()=>r;return new Ze({...O(this._def),innerType:this,catchValue:a,typeName:Je.ZodCatch})}describe(r){return new(0,this.constructor)({...this._def,description:r})}pipe(r){return je.create(this,r)}readonly(){return Ge.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const M=/^c[^\s-]{8,}$/i,U=/^[0-9a-z]+$/,q=/^[0-9A-HJKMNP-TV-Z]{26}$/i,V=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,K=/^[a-z0-9_-]{21}$/i,H=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,B=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,G=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let ze;const Fe=/^(?:(?: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])$/,Ue=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,qe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ve=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ke=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,He=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Be="((\\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])))",Qe=new RegExp(`^${Be}$`);function W(r){let a="[0-5]\\d";return r.precision?a=`${a}\\.\\d{${r.precision}}`:null==r.precision&&(a=`${a}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${a})${r.precision?"+":"?"}`}function Q(r){return new RegExp(`^${W(r)}$`)}function Y(r){let a=`${Be}T${W(r)}`;const d=[];return d.push(r.local?"Z?":"Z"),r.offset&&d.push("([+-]\\d{2}:?\\d{2})"),a=`${a}(${d.join("|")})`,new RegExp(`^${a}$`)}function X(r,a){return!("v4"!==a&&a||!Fe.test(r))||!("v6"!==a&&a||!qe.test(r))}function J(r,a){if(!H.test(r))return!1;try{const[d]=r.split(".");if(!d)return!1;const h=d.replace(/-/g,"+").replace(/_/g,"/").padEnd(d.length+(4-d.length%4)%4,"="),g=JSON.parse(atob(h));return!("object"!=typeof g||null===g||"typ"in g&&"JWT"!==g?.typ||!g.alg||a&&g.alg!==a)}catch{return!1}}function ee(r,a){return!("v4"!==a&&a||!Ue.test(r))||!("v6"!==a&&a||!Ve.test(r))}class te extends C{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==N.string){const a=this._getOrReturnCtx(r);return v(a,{code:$.invalid_type,expected:N.string,received:a.parsedType}),F}const a=new w;let d;for(const h of this._def.checks)if("min"===h.kind)r.data.length<h.value&&(d=this._getOrReturnCtx(r,d),v(d,{code:$.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if("max"===h.kind)r.data.length>h.value&&(d=this._getOrReturnCtx(r,d),v(d,{code:$.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if("length"===h.kind){const g=r.data.length>h.value,y=r.data.length<h.value;(g||y)&&(d=this._getOrReturnCtx(r,d),g?v(d,{code:$.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):y&&v(d,{code:$.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if("email"===h.kind)G.test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"email",code:$.invalid_string,message:h.message}),a.dirty());else if("emoji"===h.kind)ze||(ze=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ze.test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"emoji",code:$.invalid_string,message:h.message}),a.dirty());else if("uuid"===h.kind)V.test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"uuid",code:$.invalid_string,message:h.message}),a.dirty());else if("nanoid"===h.kind)K.test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"nanoid",code:$.invalid_string,message:h.message}),a.dirty());else if("cuid"===h.kind)M.test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"cuid",code:$.invalid_string,message:h.message}),a.dirty());else if("cuid2"===h.kind)U.test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"cuid2",code:$.invalid_string,message:h.message}),a.dirty());else if("ulid"===h.kind)q.test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"ulid",code:$.invalid_string,message:h.message}),a.dirty());else if("url"===h.kind)try{new URL(r.data)}catch{d=this._getOrReturnCtx(r,d),v(d,{validation:"url",code:$.invalid_string,message:h.message}),a.dirty()}else"regex"===h.kind?(h.regex.lastIndex=0,h.regex.test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"regex",code:$.invalid_string,message:h.message}),a.dirty())):"trim"===h.kind?r.data=r.data.trim():"includes"===h.kind?r.data.includes(h.value,h.position)||(d=this._getOrReturnCtx(r,d),v(d,{code:$.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty()):"toLowerCase"===h.kind?r.data=r.data.toLowerCase():"toUpperCase"===h.kind?r.data=r.data.toUpperCase():"startsWith"===h.kind?r.data.startsWith(h.value)||(d=this._getOrReturnCtx(r,d),v(d,{code:$.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty()):"endsWith"===h.kind?r.data.endsWith(h.value)||(d=this._getOrReturnCtx(r,d),v(d,{code:$.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty()):"datetime"===h.kind?Y(h).test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{code:$.invalid_string,validation:"datetime",message:h.message}),a.dirty()):"date"===h.kind?Qe.test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{code:$.invalid_string,validation:"date",message:h.message}),a.dirty()):"time"===h.kind?Q(h).test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{code:$.invalid_string,validation:"time",message:h.message}),a.dirty()):"duration"===h.kind?B.test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"duration",code:$.invalid_string,message:h.message}),a.dirty()):"ip"===h.kind?X(r.data,h.version)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"ip",code:$.invalid_string,message:h.message}),a.dirty()):"jwt"===h.kind?J(r.data,h.alg)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"jwt",code:$.invalid_string,message:h.message}),a.dirty()):"cidr"===h.kind?ee(r.data,h.version)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"cidr",code:$.invalid_string,message:h.message}),a.dirty()):"base64"===h.kind?Ke.test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"base64",code:$.invalid_string,message:h.message}),a.dirty()):"base64url"===h.kind?He.test(r.data)||(d=this._getOrReturnCtx(r,d),v(d,{validation:"base64url",code:$.invalid_string,message:h.message}),a.dirty()):Z.assertNever(h);return{status:a.value,value:r.data}}_regex(r,a,d){return this.refinement(a=>r.test(a),{validation:a,code:$.invalid_string,...L.errToObj(d)})}_addCheck(r){return new te({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...L.errToObj(r)})}url(r){return this._addCheck({kind:"url",...L.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...L.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...L.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...L.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...L.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...L.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...L.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...L.errToObj(r)})}base64url(r){return this._addCheck({kind:"base64url",...L.errToObj(r)})}jwt(r){return this._addCheck({kind:"jwt",...L.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...L.errToObj(r)})}cidr(r){return this._addCheck({kind:"cidr",...L.errToObj(r)})}datetime(r){return"string"==typeof r?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:r}):this._addCheck({kind:"datetime",precision:void 0===r?.precision?null:r?.precision,offset:r?.offset??!1,local:r?.local??!1,...L.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return"string"==typeof r?this._addCheck({kind:"time",precision:null,message:r}):this._addCheck({kind:"time",precision:void 0===r?.precision?null:r?.precision,...L.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...L.errToObj(r)})}regex(r,a){return this._addCheck({kind:"regex",regex:r,...L.errToObj(a)})}includes(r,a){return this._addCheck({kind:"includes",value:r,position:a?.position,...L.errToObj(a?.message)})}startsWith(r,a){return this._addCheck({kind:"startsWith",value:r,...L.errToObj(a)})}endsWith(r,a){return this._addCheck({kind:"endsWith",value:r,...L.errToObj(a)})}min(r,a){return this._addCheck({kind:"min",value:r,...L.errToObj(a)})}max(r,a){return this._addCheck({kind:"max",value:r,...L.errToObj(a)})}length(r,a){return this._addCheck({kind:"length",value:r,...L.errToObj(a)})}nonempty(r){return this.min(1,L.errToObj(r))}trim(){return new te({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new te({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new te({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>"datetime"===r.kind)}get isDate(){return!!this._def.checks.find(r=>"date"===r.kind)}get isTime(){return!!this._def.checks.find(r=>"time"===r.kind)}get isDuration(){return!!this._def.checks.find(r=>"duration"===r.kind)}get isEmail(){return!!this._def.checks.find(r=>"email"===r.kind)}get isURL(){return!!this._def.checks.find(r=>"url"===r.kind)}get isEmoji(){return!!this._def.checks.find(r=>"emoji"===r.kind)}get isUUID(){return!!this._def.checks.find(r=>"uuid"===r.kind)}get isNANOID(){return!!this._def.checks.find(r=>"nanoid"===r.kind)}get isCUID(){return!!this._def.checks.find(r=>"cuid"===r.kind)}get isCUID2(){return!!this._def.checks.find(r=>"cuid2"===r.kind)}get isULID(){return!!this._def.checks.find(r=>"ulid"===r.kind)}get isIP(){return!!this._def.checks.find(r=>"ip"===r.kind)}get isCIDR(){return!!this._def.checks.find(r=>"cidr"===r.kind)}get isBase64(){return!!this._def.checks.find(r=>"base64"===r.kind)}get isBase64url(){return!!this._def.checks.find(r=>"base64url"===r.kind)}get minLength(){let r=null;for(const a of this._def.checks)"min"===a.kind&&(null===r||a.value>r)&&(r=a.value);return r}get maxLength(){let r=null;for(const a of this._def.checks)"max"===a.kind&&(null===r||a.value<r)&&(r=a.value);return r}}function ne(r,a){const d=(r.toString().split(".")[1]||"").length,h=(a.toString().split(".")[1]||"").length,g=d>h?d:h;return Number.parseInt(r.toFixed(g).replace(".",""))%Number.parseInt(a.toFixed(g).replace(".",""))/10**g}te.create=r=>new te({checks:[],typeName:Je.ZodString,coerce:r?.coerce??!1,...O(r)});class se extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==N.number){const a=this._getOrReturnCtx(r);return v(a,{code:$.invalid_type,expected:N.number,received:a.parsedType}),F}let a;const d=new w;for(const h of this._def.checks)"int"===h.kind?Z.isInteger(r.data)||(a=this._getOrReturnCtx(r,a),v(a,{code:$.invalid_type,expected:"integer",received:"float",message:h.message}),d.dirty()):"min"===h.kind?(h.inclusive?r.data<h.value:r.data<=h.value)&&(a=this._getOrReturnCtx(r,a),v(a,{code:$.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),d.dirty()):"max"===h.kind?(h.inclusive?r.data>h.value:r.data>=h.value)&&(a=this._getOrReturnCtx(r,a),v(a,{code:$.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),d.dirty()):"multipleOf"===h.kind?0!==ne(r.data,h.value)&&(a=this._getOrReturnCtx(r,a),v(a,{code:$.not_multiple_of,multipleOf:h.value,message:h.message}),d.dirty()):"finite"===h.kind?Number.isFinite(r.data)||(a=this._getOrReturnCtx(r,a),v(a,{code:$.not_finite,message:h.message}),d.dirty()):Z.assertNever(h);return{status:d.value,value:r.data}}gte(r,a){return this.setLimit("min",r,!0,L.toString(a))}gt(r,a){return this.setLimit("min",r,!1,L.toString(a))}lte(r,a){return this.setLimit("max",r,!0,L.toString(a))}lt(r,a){return this.setLimit("max",r,!1,L.toString(a))}setLimit(r,a,d,h){return new se({...this._def,checks:[...this._def.checks,{kind:r,value:a,inclusive:d,message:L.toString(h)}]})}_addCheck(r){return new se({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:L.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:L.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:L.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:L.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:L.toString(r)})}multipleOf(r,a){return this._addCheck({kind:"multipleOf",value:r,message:L.toString(a)})}finite(r){return this._addCheck({kind:"finite",message:L.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:L.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:L.toString(r)})}get minValue(){let r=null;for(const a of this._def.checks)"min"===a.kind&&(null===r||a.value>r)&&(r=a.value);return r}get maxValue(){let r=null;for(const a of this._def.checks)"max"===a.kind&&(null===r||a.value<r)&&(r=a.value);return r}get isInt(){return!!this._def.checks.find(r=>"int"===r.kind||"multipleOf"===r.kind&&Z.isInteger(r.value))}get isFinite(){let r=null,a=null;for(const d of this._def.checks){if("finite"===d.kind||"int"===d.kind||"multipleOf"===d.kind)return!0;"min"===d.kind?(null===a||d.value>a)&&(a=d.value):"max"===d.kind&&(null===r||d.value<r)&&(r=d.value)}return Number.isFinite(a)&&Number.isFinite(r)}}se.create=r=>new se({checks:[],typeName:Je.ZodNumber,coerce:r?.coerce||!1,...O(r)});class ae extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce)try{r.data=BigInt(r.data)}catch{return this._getInvalidInput(r)}if(this._getType(r)!==N.bigint)return this._getInvalidInput(r);let a;const d=new w;for(const h of this._def.checks)"min"===h.kind?(h.inclusive?r.data<h.value:r.data<=h.value)&&(a=this._getOrReturnCtx(r,a),v(a,{code:$.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),d.dirty()):"max"===h.kind?(h.inclusive?r.data>h.value:r.data>=h.value)&&(a=this._getOrReturnCtx(r,a),v(a,{code:$.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),d.dirty()):"multipleOf"===h.kind?r.data%h.value!==BigInt(0)&&(a=this._getOrReturnCtx(r,a),v(a,{code:$.not_multiple_of,multipleOf:h.value,message:h.message}),d.dirty()):Z.assertNever(h);return{status:d.value,value:r.data}}_getInvalidInput(r){const a=this._getOrReturnCtx(r);return v(a,{code:$.invalid_type,expected:N.bigint,received:a.parsedType}),F}gte(r,a){return this.setLimit("min",r,!0,L.toString(a))}gt(r,a){return this.setLimit("min",r,!1,L.toString(a))}lte(r,a){return this.setLimit("max",r,!0,L.toString(a))}lt(r,a){return this.setLimit("max",r,!1,L.toString(a))}setLimit(r,a,d,h){return new ae({...this._def,checks:[...this._def.checks,{kind:r,value:a,inclusive:d,message:L.toString(h)}]})}_addCheck(r){return new ae({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:L.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:L.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:L.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:L.toString(r)})}multipleOf(r,a){return this._addCheck({kind:"multipleOf",value:r,message:L.toString(a)})}get minValue(){let r=null;for(const a of this._def.checks)"min"===a.kind&&(null===r||a.value>r)&&(r=a.value);return r}get maxValue(){let r=null;for(const a of this._def.checks)"max"===a.kind&&(null===r||a.value<r)&&(r=a.value);return r}}ae.create=r=>new ae({checks:[],typeName:Je.ZodBigInt,coerce:r?.coerce??!1,...O(r)});class ie extends C{_parse(r){if(this._def.coerce&&(r.data=Boolean(r.data)),this._getType(r)!==N.boolean){const a=this._getOrReturnCtx(r);return v(a,{code:$.invalid_type,expected:N.boolean,received:a.parsedType}),F}return k(r.data)}}ie.create=r=>new ie({typeName:Je.ZodBoolean,coerce:r?.coerce||!1,...O(r)});class re extends C{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==N.date){const a=this._getOrReturnCtx(r);return v(a,{code:$.invalid_type,expected:N.date,received:a.parsedType}),F}if(Number.isNaN(r.data.getTime()))return v(this._getOrReturnCtx(r),{code:$.invalid_date}),F;const a=new w;let d;for(const h of this._def.checks)"min"===h.kind?r.data.getTime()<h.value&&(d=this._getOrReturnCtx(r,d),v(d,{code:$.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),a.dirty()):"max"===h.kind?r.data.getTime()>h.value&&(d=this._getOrReturnCtx(r,d),v(d,{code:$.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),a.dirty()):Z.assertNever(h);return{status:a.value,value:new Date(r.data.getTime())}}_addCheck(r){return new re({...this._def,checks:[...this._def.checks,r]})}min(r,a){return this._addCheck({kind:"min",value:r.getTime(),message:L.toString(a)})}max(r,a){return this._addCheck({kind:"max",value:r.getTime(),message:L.toString(a)})}get minDate(){let r=null;for(const a of this._def.checks)"min"===a.kind&&(null===r||a.value>r)&&(r=a.value);return null!=r?new Date(r):null}get maxDate(){let r=null;for(const a of this._def.checks)"max"===a.kind&&(null===r||a.value<r)&&(r=a.value);return null!=r?new Date(r):null}}re.create=r=>new re({checks:[],coerce:r?.coerce||!1,typeName:Je.ZodDate,...O(r)});class oe extends C{_parse(r){if(this._getType(r)!==N.symbol){const a=this._getOrReturnCtx(r);return v(a,{code:$.invalid_type,expected:N.symbol,received:a.parsedType}),F}return k(r.data)}}oe.create=r=>new oe({typeName:Je.ZodSymbol,...O(r)});class de extends C{_parse(r){if(this._getType(r)!==N.undefined){const a=this._getOrReturnCtx(r);return v(a,{code:$.invalid_type,expected:N.undefined,received:a.parsedType}),F}return k(r.data)}}de.create=r=>new de({typeName:Je.ZodUndefined,...O(r)});class ce extends C{_parse(r){if(this._getType(r)!==N.null){const a=this._getOrReturnCtx(r);return v(a,{code:$.invalid_type,expected:N.null,received:a.parsedType}),F}return k(r.data)}}ce.create=r=>new ce({typeName:Je.ZodNull,...O(r)});class ue extends C{constructor(){super(...arguments),this._any=!0}_parse(r){return k(r.data)}}ue.create=r=>new ue({typeName:Je.ZodAny,...O(r)});class le extends C{constructor(){super(...arguments),this._unknown=!0}_parse(r){return k(r.data)}}le.create=r=>new le({typeName:Je.ZodUnknown,...O(r)});class he extends C{_parse(r){const a=this._getOrReturnCtx(r);return v(a,{code:$.invalid_type,expected:N.never,received:a.parsedType}),F}}he.create=r=>new he({typeName:Je.ZodNever,...O(r)});class pe extends C{_parse(r){if(this._getType(r)!==N.undefined){const a=this._getOrReturnCtx(r);return v(a,{code:$.invalid_type,expected:N.void,received:a.parsedType}),F}return k(r.data)}}pe.create=r=>new pe({typeName:Je.ZodVoid,...O(r)});class ge extends C{_parse(r){const{ctx:a,status:d}=this._processInputParams(r),h=this._def;if(a.parsedType!==N.array)return v(a,{code:$.invalid_type,expected:N.array,received:a.parsedType}),F;if(null!==h.exactLength){const r=a.data.length>h.exactLength.value,g=a.data.length<h.exactLength.value;(r||g)&&(v(a,{code:r?$.too_big:$.too_small,minimum:g?h.exactLength.value:void 0,maximum:r?h.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:h.exactLength.message}),d.dirty())}if(null!==h.minLength&&a.data.length<h.minLength.value&&(v(a,{code:$.too_small,minimum:h.minLength.value,type:"array",inclusive:!0,exact:!1,message:h.minLength.message}),d.dirty()),null!==h.maxLength&&a.data.length>h.maxLength.value&&(v(a,{code:$.too_big,maximum:h.maxLength.value,type:"array",inclusive:!0,exact:!1,message:h.maxLength.message}),d.dirty()),a.common.async)return Promise.all([...a.data].map((r,d)=>h.type._parseAsync(new T(a,r,a.path,d)))).then(r=>w.mergeArray(d,r));const g=[...a.data].map((r,d)=>h.type._parseSync(new T(a,r,a.path,d)));return w.mergeArray(d,g)}get element(){return this._def.type}min(r,a){return new ge({...this._def,minLength:{value:r,message:L.toString(a)}})}max(r,a){return new ge({...this._def,maxLength:{value:r,message:L.toString(a)}})}length(r,a){return new ge({...this._def,exactLength:{value:r,message:L.toString(a)}})}nonempty(r){return this.min(1,r)}}function me(r){if(r instanceof fe){const a={};for(const d in r.shape){const h=r.shape[d];a[d]=Pe.create(me(h))}return new fe({...r._def,shape:()=>a})}return r instanceof ge?new ge({...r._def,type:me(r.element)}):r instanceof Pe?Pe.create(me(r.unwrap())):r instanceof $e?$e.create(me(r.unwrap())):r instanceof xe?xe.create(r.items.map(r=>me(r))):r}ge.create=(r,a)=>new ge({type:r,minLength:null,maxLength:null,exactLength:null,typeName:Je.ZodArray,...O(a)});class fe extends C{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const r=this._def.shape(),a=Z.objectKeys(r);return this._cached={shape:r,keys:a},this._cached}_parse(r){if(this._getType(r)!==N.object){const a=this._getOrReturnCtx(r);return v(a,{code:$.invalid_type,expected:N.object,received:a.parsedType}),F}const{status:a,ctx:d}=this._processInputParams(r),{shape:h,keys:g}=this._getCached(),y=[];if(!(this._def.catchall instanceof he&&"strip"===this._def.unknownKeys))for(const r in d.data)g.includes(r)||y.push(r);const _=[];for(const r of g){const a=h[r],g=d.data[r];_.push({key:{status:"valid",value:r},value:a._parse(new T(d,g,d.path,r)),alwaysSet:r in d.data})}if(this._def.catchall instanceof he){const r=this._def.unknownKeys;if("passthrough"===r)for(const r of y)_.push({key:{status:"valid",value:r},value:{status:"valid",value:d.data[r]}});else if("strict"===r)y.length>0&&(v(d,{code:$.unrecognized_keys,keys:y}),a.dirty());else if("strip"!==r)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const r=this._def.catchall;for(const a of y){const h=d.data[a];_.push({key:{status:"valid",value:a},value:r._parse(new T(d,h,d.path,a)),alwaysSet:a in d.data})}}return d.common.async?Promise.resolve().then(async()=>{const r=[];for(const a of _){const d=await a.key,h=await a.value;r.push({key:d,value:h,alwaysSet:a.alwaysSet})}return r}).then(r=>w.mergeObjectSync(a,r)):w.mergeObjectSync(a,_)}get shape(){return this._def.shape()}strict(r){return L.errToObj,new fe({...this._def,unknownKeys:"strict",...void 0!==r?{errorMap:(a,d)=>{const h=this._def.errorMap?.(a,d).message??d.defaultError;return"unrecognized_keys"===a.code?{message:L.errToObj(r).message??h}:{message:h}}}:{}})}strip(){return new fe({...this._def,unknownKeys:"strip"})}passthrough(){return new fe({...this._def,unknownKeys:"passthrough"})}extend(r){return new fe({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new fe({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:Je.ZodObject})}setKey(r,a){return this.augment({[r]:a})}catchall(r){return new fe({...this._def,catchall:r})}pick(r){const a={};for(const d of Z.objectKeys(r))r[d]&&this.shape[d]&&(a[d]=this.shape[d]);return new fe({...this._def,shape:()=>a})}omit(r){const a={};for(const d of Z.objectKeys(this.shape))r[d]||(a[d]=this.shape[d]);return new fe({...this._def,shape:()=>a})}deepPartial(){return me(this)}partial(r){const a={};for(const d of Z.objectKeys(this.shape)){const h=this.shape[d];r&&!r[d]?a[d]=h:a[d]=h.optional()}return new fe({...this._def,shape:()=>a})}required(r){const a={};for(const d of Z.objectKeys(this.shape))if(r&&!r[d])a[d]=this.shape[d];else{let r=this.shape[d];for(;r instanceof Pe;)r=r._def.innerType;a[d]=r}return new fe({...this._def,shape:()=>a})}keyof(){return Te(Z.objectKeys(this.shape))}}fe.create=(r,a)=>new fe({shape:()=>r,unknownKeys:"strip",catchall:he.create(),typeName:Je.ZodObject,...O(a)}),fe.strictCreate=(r,a)=>new fe({shape:()=>r,unknownKeys:"strict",catchall:he.create(),typeName:Je.ZodObject,...O(a)}),fe.lazycreate=(r,a)=>new fe({shape:r,unknownKeys:"strip",catchall:he.create(),typeName:Je.ZodObject,...O(a)});class ye extends C{_parse(r){const{ctx:a}=this._processInputParams(r),d=this._def.options;if(a.common.async)return Promise.all(d.map(async r=>{const d={...a,common:{...a.common,issues:[]},parent:null};return{result:await r._parseAsync({data:a.data,path:a.path,parent:d}),ctx:d}})).then(function(r){for(const a of r)if("valid"===a.result.status)return a.result;for(const d of r)if("dirty"===d.result.status)return a.common.issues.push(...d.ctx.common.issues),d.result;const d=r.map(r=>new m(r.ctx.common.issues));return v(a,{code:$.invalid_union,unionErrors:d}),F});{let r;const h=[];for(const g of d){const d={...a,common:{...a.common,issues:[]},parent:null},y=g._parseSync({data:a.data,path:a.path,parent:d});if("valid"===y.status)return y;"dirty"!==y.status||r||(r={result:y,ctx:d}),d.common.issues.length&&h.push(d.common.issues)}if(r)return a.common.issues.push(...r.ctx.common.issues),r.result;const g=h.map(r=>new m(r));return v(a,{code:$.invalid_union,unionErrors:g}),F}}get options(){return this._def.options}}ye.create=(r,a)=>new ye({options:r,typeName:Je.ZodUnion,...O(a)});const _e=r=>r instanceof Ae?_e(r.schema):r instanceof Ne?_e(r.innerType()):r instanceof Ee?[r.value]:r instanceof Re?r.options:r instanceof Oe?Z.objectValues(r.enum):r instanceof Le?_e(r._def.innerType):r instanceof de?[void 0]:r instanceof ce?[null]:r instanceof Pe?[void 0,..._e(r.unwrap())]:r instanceof $e?[null,..._e(r.unwrap())]:r instanceof De||r instanceof Ge?_e(r.unwrap()):r instanceof Ze?_e(r._def.innerType):[];class ve extends C{_parse(r){const{ctx:a}=this._processInputParams(r);if(a.parsedType!==N.object)return v(a,{code:$.invalid_type,expected:N.object,received:a.parsedType}),F;const d=this.discriminator,h=a.data[d],g=this.optionsMap.get(h);return g?a.common.async?g._parseAsync({data:a.data,path:a.path,parent:a}):g._parseSync({data:a.data,path:a.path,parent:a}):(v(a,{code:$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[d]}),F)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,a,d){const h=new Map;for(const d of a){const a=_e(d.shape[r]);if(!a.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(const g of a){if(h.has(g))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(g)}`);h.set(g,d)}}return new ve({typeName:Je.ZodDiscriminatedUnion,discriminator:r,options:a,optionsMap:h,...O(d)})}}function we(r,a){const d=p(r),h=p(a);if(r===a)return{valid:!0,data:r};if(d===N.object&&h===N.object){const d=Z.objectKeys(a),h=Z.objectKeys(r).filter(r=>-1!==d.indexOf(r)),g={...r,...a};for(const d of h){const h=we(r[d],a[d]);if(!h.valid)return{valid:!1};g[d]=h.data}return{valid:!0,data:g}}if(d===N.array&&h===N.array){if(r.length!==a.length)return{valid:!1};const d=[];for(let h=0;h<r.length;h++){const g=we(r[h],a[h]);if(!g.valid)return{valid:!1};d.push(g.data)}return{valid:!0,data:d}}return d===N.date&&h===N.date&&+r===+a?{valid:!0,data:r}:{valid:!1}}class be extends C{_parse(r){const{status:a,ctx:d}=this._processInputParams(r),s=(r,h)=>{if(S(r)||S(h))return F;const g=we(r.value,h.value);return g.valid?((I(r)||I(h))&&a.dirty(),{status:a.value,value:g.data}):(v(d,{code:$.invalid_intersection_types}),F)};return d.common.async?Promise.all([this._def.left._parseAsync({data:d.data,path:d.path,parent:d}),this._def.right._parseAsync({data:d.data,path:d.path,parent:d})]).then(([r,a])=>s(r,a)):s(this._def.left._parseSync({data:d.data,path:d.path,parent:d}),this._def.right._parseSync({data:d.data,path:d.path,parent:d}))}}be.create=(r,a,d)=>new be({left:r,right:a,typeName:Je.ZodIntersection,...O(d)});class xe extends C{_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.parsedType!==N.array)return v(d,{code:$.invalid_type,expected:N.array,received:d.parsedType}),F;if(d.data.length<this._def.items.length)return v(d,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F;!this._def.rest&&d.data.length>this._def.items.length&&(v(d,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());const h=[...d.data].map((r,a)=>{const h=this._def.items[a]||this._def.rest;return h?h._parse(new T(d,r,d.path,a)):null}).filter(r=>!!r);return d.common.async?Promise.all(h).then(r=>w.mergeArray(a,r)):w.mergeArray(a,h)}get items(){return this._def.items}rest(r){return new xe({...this._def,rest:r})}}xe.create=(r,a)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xe({items:r,typeName:Je.ZodTuple,rest:null,...O(a)})};class ke extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.parsedType!==N.object)return v(d,{code:$.invalid_type,expected:N.object,received:d.parsedType}),F;const h=[],g=this._def.keyType,y=this._def.valueType;for(const r in d.data)h.push({key:g._parse(new T(d,r,d.path,r)),value:y._parse(new T(d,d.data[r],d.path,r)),alwaysSet:r in d.data});return d.common.async?w.mergeObjectAsync(a,h):w.mergeObjectSync(a,h)}get element(){return this._def.valueType}static create(r,a,d){return new ke(a instanceof C?{keyType:r,valueType:a,typeName:Je.ZodRecord,...O(d)}:{keyType:te.create(),valueType:r,typeName:Je.ZodRecord,...O(a)})}}class Se extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.parsedType!==N.map)return v(d,{code:$.invalid_type,expected:N.map,received:d.parsedType}),F;const h=this._def.keyType,g=this._def.valueType,y=[...d.data.entries()].map(([r,a],y)=>({key:h._parse(new T(d,r,d.path,[y,"key"])),value:g._parse(new T(d,a,d.path,[y,"value"]))}));if(d.common.async){const r=new Map;return Promise.resolve().then(async()=>{for(const d of y){const h=await d.key,g=await d.value;if("aborted"===h.status||"aborted"===g.status)return F;"dirty"!==h.status&&"dirty"!==g.status||a.dirty(),r.set(h.value,g.value)}return{status:a.value,value:r}})}{const r=new Map;for(const d of y){const h=d.key,g=d.value;if("aborted"===h.status||"aborted"===g.status)return F;"dirty"!==h.status&&"dirty"!==g.status||a.dirty(),r.set(h.value,g.value)}return{status:a.value,value:r}}}}Se.create=(r,a,d)=>new Se({valueType:a,keyType:r,typeName:Je.ZodMap,...O(d)});class Ie extends C{_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.parsedType!==N.set)return v(d,{code:$.invalid_type,expected:N.set,received:d.parsedType}),F;const h=this._def;null!==h.minSize&&d.data.size<h.minSize.value&&(v(d,{code:$.too_small,minimum:h.minSize.value,type:"set",inclusive:!0,exact:!1,message:h.minSize.message}),a.dirty()),null!==h.maxSize&&d.data.size>h.maxSize.value&&(v(d,{code:$.too_big,maximum:h.maxSize.value,type:"set",inclusive:!0,exact:!1,message:h.maxSize.message}),a.dirty());const g=this._def.valueType;function i(r){const d=new Set;for(const h of r){if("aborted"===h.status)return F;"dirty"===h.status&&a.dirty(),d.add(h.value)}return{status:a.value,value:d}}const y=[...d.data.values()].map((r,a)=>g._parse(new T(d,r,d.path,a)));return d.common.async?Promise.all(y).then(r=>i(r)):i(y)}min(r,a){return new Ie({...this._def,minSize:{value:r,message:L.toString(a)}})}max(r,a){return new Ie({...this._def,maxSize:{value:r,message:L.toString(a)}})}size(r,a){return this.min(r,a).max(r,a)}nonempty(r){return this.min(1,r)}}Ie.create=(r,a)=>new Ie({valueType:r,minSize:null,maxSize:null,typeName:Je.ZodSet,...O(a)});class Ae extends C{get schema(){return this._def.getter()}_parse(r){const{ctx:a}=this._processInputParams(r);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}}Ae.create=(r,a)=>new Ae({getter:r,typeName:Je.ZodLazy,...O(a)});class Ee extends C{_parse(r){if(r.data!==this._def.value){const a=this._getOrReturnCtx(r);return v(a,{received:a.data,code:$.invalid_literal,expected:this._def.value}),F}return{status:"valid",value:r.data}}get value(){return this._def.value}}function Te(r,a){return new Re({values:r,typeName:Je.ZodEnum,...O(a)})}Ee.create=(r,a)=>new Ee({value:r,typeName:Je.ZodLiteral,...O(a)});class Re extends C{_parse(r){if("string"!=typeof r.data){const a=this._getOrReturnCtx(r),d=this._def.values;return v(a,{expected:Z.joinValues(d),received:a.parsedType,code:$.invalid_type}),F}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(r.data)){const a=this._getOrReturnCtx(r),d=this._def.values;return v(a,{received:a.data,code:$.invalid_enum_value,options:d}),F}return k(r.data)}get options(){return this._def.values}get enum(){const r={};for(const a of this._def.values)r[a]=a;return r}get Values(){const r={};for(const a of this._def.values)r[a]=a;return r}get Enum(){const r={};for(const a of this._def.values)r[a]=a;return r}extract(r,a=this._def){return Re.create(r,{...this._def,...a})}exclude(r,a=this._def){return Re.create(this.options.filter(a=>!r.includes(a)),{...this._def,...a})}}Re.create=Te;class Oe extends C{_parse(r){const a=Z.getValidEnumValues(this._def.values),d=this._getOrReturnCtx(r);if(d.parsedType!==N.string&&d.parsedType!==N.number){const r=Z.objectValues(a);return v(d,{expected:Z.joinValues(r),received:d.parsedType,code:$.invalid_type}),F}if(this._cache||(this._cache=new Set(Z.getValidEnumValues(this._def.values))),!this._cache.has(r.data)){const r=Z.objectValues(a);return v(d,{received:d.data,code:$.invalid_enum_value,options:r}),F}return k(r.data)}get enum(){return this._def.values}}Oe.create=(r,a)=>new Oe({values:r,typeName:Je.ZodNativeEnum,...O(a)});class Ce extends C{unwrap(){return this._def.type}_parse(r){const{ctx:a}=this._processInputParams(r);if(a.parsedType!==N.promise&&!1===a.common.async)return v(a,{code:$.invalid_type,expected:N.promise,received:a.parsedType}),F;const d=a.parsedType===N.promise?a.data:Promise.resolve(a.data);return k(d.then(r=>this._def.type.parseAsync(r,{path:a.path,errorMap:a.common.contextualErrorMap})))}}Ce.create=(r,a)=>new Ce({type:r,typeName:Je.ZodPromise,...O(a)});class Ne extends C{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Je.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){const{status:a,ctx:d}=this._processInputParams(r),h=this._def.effect||null,g={addIssue:r=>{v(d,r),r.fatal?a.abort():a.dirty()},get path(){return d.path}};if(g.addIssue=g.addIssue.bind(g),"preprocess"===h.type){const r=h.transform(d.data,g);if(d.common.async)return Promise.resolve(r).then(async r=>{if("aborted"===a.value)return F;const h=await this._def.schema._parseAsync({data:r,path:d.path,parent:d});return"aborted"===h.status?F:"dirty"===h.status||"dirty"===a.value?x(h.value):h});{if("aborted"===a.value)return F;const h=this._def.schema._parseSync({data:r,path:d.path,parent:d});return"aborted"===h.status?F:"dirty"===h.status||"dirty"===a.value?x(h.value):h}}if("refinement"===h.type){const e=r=>{const a=h.refinement(r,g);if(d.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return r};if(!1===d.common.async){const r=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});return"aborted"===r.status?F:("dirty"===r.status&&a.dirty(),e(r.value),{status:a.value,value:r.value})}return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(r=>"aborted"===r.status?F:("dirty"===r.status&&a.dirty(),e(r.value).then(()=>({status:a.value,value:r.value}))))}if("transform"===h.type){if(!1===d.common.async){const r=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});if(!A(r))return F;const y=h.transform(r.value,g);if(y instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:y}}return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(r=>A(r)?Promise.resolve(h.transform(r.value,g)).then(r=>({status:a.value,value:r})):F)}Z.assertNever(h)}}Ne.create=(r,a,d)=>new Ne({schema:r,typeName:Je.ZodEffects,effect:a,...O(d)}),Ne.createWithPreprocess=(r,a,d)=>new Ne({schema:a,effect:{type:"preprocess",transform:r},typeName:Je.ZodEffects,...O(d)});class Pe extends C{_parse(r){return this._getType(r)===N.undefined?k(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}Pe.create=(r,a)=>new Pe({innerType:r,typeName:Je.ZodOptional,...O(a)});class $e extends C{_parse(r){return this._getType(r)===N.null?k(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}$e.create=(r,a)=>new $e({innerType:r,typeName:Je.ZodNullable,...O(a)});class Le extends C{_parse(r){const{ctx:a}=this._processInputParams(r);let d=a.data;return a.parsedType===N.undefined&&(d=this._def.defaultValue()),this._def.innerType._parse({data:d,path:a.path,parent:a})}removeDefault(){return this._def.innerType}}Le.create=(r,a)=>new Le({innerType:r,typeName:Je.ZodDefault,defaultValue:"function"==typeof a.default?a.default:()=>a.default,...O(a)});class Ze extends C{_parse(r){const{ctx:a}=this._processInputParams(r),d={...a,common:{...a.common,issues:[]}},h=this._def.innerType._parse({data:d.data,path:d.path,parent:{...d}});return E(h)?h.then(r=>({status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new m(d.common.issues)},input:d.data})})):{status:"valid",value:"valid"===h.status?h.value:this._def.catchValue({get error(){return new m(d.common.issues)},input:d.data})}}removeCatch(){return this._def.innerType}}Ze.create=(r,a)=>new Ze({innerType:r,typeName:Je.ZodCatch,catchValue:"function"==typeof a.catch?a.catch:()=>a.catch,...O(a)});class Me extends C{_parse(r){if(this._getType(r)!==N.nan){const a=this._getOrReturnCtx(r);return v(a,{code:$.invalid_type,expected:N.nan,received:a.parsedType}),F}return{status:"valid",value:r.data}}}Me.create=r=>new Me({typeName:Je.ZodNaN,...O(r)}),Symbol("zod_brand");class De extends C{_parse(r){const{ctx:a}=this._processInputParams(r),d=a.data;return this._def.type._parse({data:d,path:a.path,parent:a})}unwrap(){return this._def.type}}class je extends C{_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:d.data,path:d.path,parent:d});return"aborted"===r.status?F:"dirty"===r.status?(a.dirty(),x(r.value)):this._def.out._parseAsync({data:r.value,path:d.path,parent:d})})();{const r=this._def.in._parseSync({data:d.data,path:d.path,parent:d});return"aborted"===r.status?F:"dirty"===r.status?(a.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:d.path,parent:d})}}static create(r,a){return new je({in:r,out:a,typeName:Je.ZodPipeline})}}class Ge extends C{_parse(r){const a=this._def.innerType._parse(r),n=r=>(A(r)&&(r.value=Object.freeze(r.value)),r);return E(a)?a.then(r=>n(r)):n(a)}unwrap(){return this._def.innerType}}var Je;Ge.create=(r,a)=>new Ge({innerType:r,typeName:Je.ZodReadonly,...O(a)}),fe.lazycreate,function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"}(Je||(Je={}));const We=te.create,Ye=se.create,Xe=(Me.create,ae.create,ie.create),et=(re.create,oe.create,de.create,ce.create,ue.create,le.create),tt=(he.create,pe.create,ge.create),rt=fe.create,st=(fe.strictCreate,ye.create),at=ve.create,nt=(be.create,xe.create,ke.create),ot=(Se.create,Ie.create,Ae.create,Ee.create),it=Re.create,dt=(Oe.create,Ce.create,Ne.create,Pe.create),ct=($e.create,Ne.createWithPreprocess,je.create,"2.0"),ut=st([We(),Ye().int()]),lt=We(),pt=rt({progressToken:dt(ut)}).passthrough(),mt=rt({_meta:dt(pt)}).passthrough(),ht=rt({method:We(),params:dt(mt)}),ft=rt({_meta:dt(rt({}).passthrough())}).passthrough(),gt=rt({method:We(),params:dt(ft)}),vt=rt({_meta:dt(rt({}).passthrough())}).passthrough(),yt=st([We(),Ye().int()]),_t=rt({jsonrpc:ot(ct),id:yt}).merge(ht).strict(),bt=rt({jsonrpc:ot(ct)}).merge(gt).strict(),Pt=rt({jsonrpc:ot(ct),id:yt,result:vt}).strict();var kt;!function(r){r[r.ConnectionClosed=-32e3]="ConnectionClosed",r[r.RequestTimeout=-32001]="RequestTimeout",r[r.ParseError=-32700]="ParseError",r[r.InvalidRequest=-32600]="InvalidRequest",r[r.MethodNotFound=-32601]="MethodNotFound",r[r.InvalidParams=-32602]="InvalidParams",r[r.InternalError=-32603]="InternalError"}(kt||(kt={}));const wt=st([_t,bt,Pt,rt({jsonrpc:ot(ct),id:yt,error:rt({code:Ye().int(),message:We(),data:dt(et())})}).strict()]),xt=vt.strict(),jt=gt.extend({method:ot("notifications/cancelled"),params:ft.extend({requestId:yt,reason:We().optional()})}),St=rt({name:We(),title:dt(We())}).passthrough(),Et=St.extend({version:We()}),It=rt({experimental:dt(rt({}).passthrough()),sampling:dt(rt({}).passthrough()),elicitation:dt(rt({}).passthrough()),roots:dt(rt({listChanged:dt(Xe())}).passthrough())}).passthrough(),Tt=ht.extend({method:ot("initialize"),params:mt.extend({protocolVersion:We(),capabilities:It,clientInfo:Et})}),Ct=rt({experimental:dt(rt({}).passthrough()),logging:dt(rt({}).passthrough()),completions:dt(rt({}).passthrough()),prompts:dt(rt({listChanged:dt(Xe())}).passthrough()),resources:dt(rt({subscribe:dt(Xe()),listChanged:dt(Xe())}).passthrough()),tools:dt(rt({listChanged:dt(Xe())}).passthrough())}).passthrough(),Rt=vt.extend({protocolVersion:We(),capabilities:Ct,serverInfo:Et,instructions:dt(We())}),At=gt.extend({method:ot("notifications/initialized")}),Zt=ht.extend({method:ot("ping")}),Ot=rt({progress:Ye(),total:dt(Ye()),message:dt(We())}).passthrough(),Dt=gt.extend({method:ot("notifications/progress"),params:ft.merge(Ot).extend({progressToken:ut})}),Nt=ht.extend({params:mt.extend({cursor:dt(lt)}).optional()}),$t=vt.extend({nextCursor:dt(lt)}),zt=rt({uri:We(),mimeType:dt(We()),_meta:dt(rt({}).passthrough())}).passthrough(),Lt=zt.extend({text:We()}),Ft=We().refine(r=>{try{return atob(r),!0}catch(r){return!1}},{message:"Invalid Base64 string"}),Mt=zt.extend({blob:Ft}),Ut=St.extend({uri:We(),description:dt(We()),mimeType:dt(We()),_meta:dt(rt({}).passthrough())}),qt=St.extend({uriTemplate:We(),description:dt(We()),mimeType:dt(We()),_meta:dt(rt({}).passthrough())}),Vt=Nt.extend({method:ot("resources/list")}),Kt=$t.extend({resources:tt(Ut)}),Ht=Nt.extend({method:ot("resources/templates/list")}),Bt=$t.extend({resourceTemplates:tt(qt)}),Gt=ht.extend({method:ot("resources/read"),params:mt.extend({uri:We()})}),Qt=vt.extend({contents:tt(st([Lt,Mt]))}),Jt=gt.extend({method:ot("notifications/resources/list_changed")}),Wt=ht.extend({method:ot("resources/subscribe"),params:mt.extend({uri:We()})}),Yt=ht.extend({method:ot("resources/unsubscribe"),params:mt.extend({uri:We()})}),Xt=gt.extend({method:ot("notifications/resources/updated"),params:ft.extend({uri:We()})}),er=rt({name:We(),description:dt(We()),required:dt(Xe())}).passthrough(),tr=St.extend({description:dt(We()),arguments:dt(tt(er)),_meta:dt(rt({}).passthrough())}),rr=Nt.extend({method:ot("prompts/list")}),sr=$t.extend({prompts:tt(tr)}),ar=ht.extend({method:ot("prompts/get"),params:mt.extend({name:We(),arguments:dt(nt(We()))})}),nr=rt({type:ot("text"),text:We(),_meta:dt(rt({}).passthrough())}).passthrough(),or=rt({type:ot("image"),data:Ft,mimeType:We(),_meta:dt(rt({}).passthrough())}).passthrough(),ir=rt({type:ot("audio"),data:Ft,mimeType:We(),_meta:dt(rt({}).passthrough())}).passthrough(),dr=rt({type:ot("resource"),resource:st([Lt,Mt]),_meta:dt(rt({}).passthrough())}).passthrough(),cr=st([nr,or,ir,Ut.extend({type:ot("resource_link")}),dr]),ur=rt({role:it(["user","assistant"]),content:cr}).passthrough(),lr=vt.extend({description:dt(We()),messages:tt(ur)}),pr=gt.extend({method:ot("notifications/prompts/list_changed")}),mr=rt({title:dt(We()),readOnlyHint:dt(Xe()),destructiveHint:dt(Xe()),idempotentHint:dt(Xe()),openWorldHint:dt(Xe())}).passthrough(),hr=St.extend({description:dt(We()),inputSchema:rt({type:ot("object"),properties:dt(rt({}).passthrough()),required:dt(tt(We()))}).passthrough(),outputSchema:dt(rt({type:ot("object"),properties:dt(rt({}).passthrough()),required:dt(tt(We()))}).passthrough()),annotations:dt(mr),_meta:dt(rt({}).passthrough())}),fr=Nt.extend({method:ot("tools/list")}),gr=$t.extend({tools:tt(hr)}),vr=vt.extend({content:tt(cr).default([]),structuredContent:rt({}).passthrough().optional(),isError:dt(Xe())}),yr=(vr.or(vt.extend({toolResult:et()})),ht.extend({method:ot("tools/call"),params:mt.extend({name:We(),arguments:dt(nt(et()))})})),_r=gt.extend({method:ot("notifications/tools/list_changed")}),br=it(["debug","info","notice","warning","error","critical","alert","emergency"]),Pr=ht.extend({method:ot("logging/setLevel"),params:mt.extend({level:br})}),kr=gt.extend({method:ot("notifications/message"),params:ft.extend({level:br,logger:dt(We()),data:et()})}),wr=rt({name:We().optional()}).passthrough(),xr=rt({hints:dt(tt(wr)),costPriority:dt(Ye().min(0).max(1)),speedPriority:dt(Ye().min(0).max(1)),intelligencePriority:dt(Ye().min(0).max(1))}).passthrough(),jr=rt({role:it(["user","assistant"]),content:st([nr,or,ir])}).passthrough(),Sr=ht.extend({method:ot("sampling/createMessage"),params:mt.extend({messages:tt(jr),systemPrompt:dt(We()),includeContext:dt(it(["none","thisServer","allServers"])),temperature:dt(Ye()),maxTokens:Ye().int(),stopSequences:dt(tt(We())),metadata:dt(rt({}).passthrough()),modelPreferences:dt(xr)})}),Er=vt.extend({model:We(),stopReason:dt(it(["endTurn","stopSequence","maxTokens"]).or(We())),role:it(["user","assistant"]),content:at("type",[nr,or,ir])}),Ir=st([rt({type:ot("boolean"),title:dt(We()),description:dt(We()),default:dt(Xe())}).passthrough(),rt({type:ot("string"),title:dt(We()),description:dt(We()),minLength:dt(Ye()),maxLength:dt(Ye()),format:dt(it(["email","uri","date","date-time"]))}).passthrough(),rt({type:it(["number","integer"]),title:dt(We()),description:dt(We()),minimum:dt(Ye()),maximum:dt(Ye())}).passthrough(),rt({type:ot("string"),title:dt(We()),description:dt(We()),enum:tt(We()),enumNames:dt(tt(We()))}).passthrough()]),Tr=ht.extend({method:ot("elicitation/create"),params:mt.extend({message:We(),requestedSchema:rt({type:ot("object"),properties:nt(We(),Ir),required:dt(tt(We()))}).passthrough()})}),Cr=vt.extend({action:it(["accept","decline","cancel"]),content:dt(nt(We(),et()))}),Rr=rt({type:ot("ref/resource"),uri:We()}).passthrough(),Ar=rt({type:ot("ref/prompt"),name:We()}).passthrough(),Zr=ht.extend({method:ot("completion/complete"),params:mt.extend({ref:st([Ar,Rr]),argument:rt({name:We(),value:We()}).passthrough(),context:dt(rt({arguments:dt(nt(We(),We()))}))})}),Or=vt.extend({completion:rt({values:tt(We()).max(100),total:dt(Ye().int()),hasMore:dt(Xe())}).passthrough()}),Dr=rt({uri:We().startsWith("file://"),name:dt(We()),_meta:dt(rt({}).passthrough())}).passthrough(),Nr=ht.extend({method:ot("roots/list")}),$r=vt.extend({roots:tt(Dr)}),zr=gt.extend({method:ot("notifications/roots/list_changed")});st([Zt,Tt,Zr,Pr,ar,rr,Vt,Ht,Gt,Wt,Yt,yr,fr]),st([jt,Dt,At,zr]),st([xt,Er,Cr,$r]),st([Zt,Sr,Tr,Nr]),st([jt,Dt,kr,Xt,Jt,_r,pr]),st([xt,Rt,Or,lr,sr,Kt,Bt,Qt,vr,gr]),Error;class Cn{sessionId;onmessage;onerror;onclose;_port;_started=!1;_closed=!1;constructor(r,a){if(!r)throw new Error("MessagePort is required");this._port=r,this.sessionId=a||this.generateId(),this._port.onmessage=r=>{try{const a=wt.parse(r.data);this.onmessage?.(a)}catch(r){const a=new Error(`Failed to parse message: ${r}`);this.onerror?.(a)}},this._port.onmessageerror=r=>{const a=new Error(`MessagePort error: ${JSON.stringify(r)}`);this.onerror?.(a)}}static generateSessionId(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,10)}`}async start(){if(this._started)throw new Error("BrowserContextTransport already started! If using Client or Server class, note that connect() calls start() automatically.");if(this._closed)throw new Error("Cannot start a closed BrowserContextTransport");this._started=!0,this._port.start()}async send(r){if(this._closed)throw new Error("Cannot send on a closed BrowserContextTransport");return new Promise((a,d)=>{try{this._port.postMessage(r),a()}catch(r){const a=r instanceof Error?r:new Error(String(r));this.onerror?.(a),d(a)}})}async close(){this._closed||(this._closed=!0,this._port.close(),this.onclose?.())}generateId(){return Cn.generateSessionId()}}let Lr=null;const Pn=()=>(Lr&&document.contains(Lr)||(Lr=document.querySelector('iframe[src*="angie/"]')),Lr),$n=(r,a)=>{console.log("postMessageToAngieIframe",r,a);const d=Pn();if(!d?.contentWindow)return!1;const h=a||(()=>{const r=Pn();if(!r)return null;try{return new URL(r.src).origin}catch(r){return console.error("Error parsing iframe URL:",r),null}})();return h?(d.contentWindow.postMessage(r,h),!0):(console.error("Could not determine target origin for Angie iframe"),!1)};let Fr=!1;const Mr="open",Ur="closed";function Dn(){if("undefined"==typeof window)return 370;try{const r=window.localStorage.getItem("angie_sidebar_width");if(r){const a=parseInt(r,10);if(a>=350&&a<=590)return a}}catch(r){console.warn("localStorage not available")}return 370}function jn(){return"undefined"==typeof window?null:localStorage.getItem("angie_sidebar_state")}function Gn(r){try{localStorage.setItem("angie_sidebar_width",r.toString())}catch(r){console.warn("localStorage not available")}}function Un(r){document.documentElement.style.setProperty("--angie-sidebar-width",`${r}px`)}function qn(){!function(){const r=new URLSearchParams(window.location.search);return r.has("start-oauth")||r.has("oauth_code")||r.has("oauth_state")||r.has("oauth_error")}()?Fn(jn()||Mr):function(){Fn(Ur);try{localStorage.setItem("angie_sidebar_state",Ur)}catch(r){console.warn("localStorage not available")}}()}function Fn(r){"undefined"!=typeof window&&window.toggleAngieSidebar&&window.toggleAngieSidebar(r===Mr,!0)}function zn(){const r=document.getElementById("angie-sidebar-container");if(!r)return;let a=!1,d=0,h=0;r.addEventListener("mousedown",g=>{const y=r.getBoundingClientRect();("rtl"===document.documentElement.dir?g.clientX<=y.left+4:g.clientX>=y.right-4)&&(a=!0,d=g.clientX,h=y.width,r.classList.add("angie-resizing"),document.body.style.cursor="ew-resize",document.body.style.userSelect="none",g.preventDefault(),g.stopPropagation())}),document.addEventListener("mousemove",r=>{if(!a)return;let g;g="rtl"===document.documentElement.dir?d-r.clientX:r.clientX-d,Un(Math.max(350,Math.min(590,h+g))),r.preventDefault(),r.stopPropagation()}),document.addEventListener("mouseup",d=>{if(a){a=!1,r.classList.remove("angie-resizing"),document.body.style.cursor="",document.body.style.userSelect="";const g=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--angie-sidebar-width"),10);Gn(g),$n({type:Kr.ANGIE_SIDEBAR_RESIZED,payload:{initialWidth:h,width:g}}),d.preventDefault(),d.stopPropagation()}}),Un(Dn())}function Kn(r){!function(){if("undefined"==typeof document||Fr)return;const r="angie-sidebar-styles";if(document.getElementById(r))return void(Fr=!0);const a=document.createElement("style");a.id=r,a.textContent="/* Angie Sidebar - CSS Variables */\n:root {\n --angie-sidebar-z-index: 1200; /* below MUI popups, elementor popups and media library modal */\n --angie-sidebar-width: 330px;\n --angie-sidebar-transition: margin 0.3s ease-in-out, transform 0.3s ease-in-out;\n /* Direction-aware transform values for sidebar positioning */\n --angie-sidebar-hide-transform: translateX(-100%); /* LTR: hide to the left */\n --angie-sidebar-show-transform: translateX(0);\n}\n\n/* RTL-specific transform values */\n[dir=\"rtl\"] {\n --angie-sidebar-hide-transform: translateX(100%); /* RTL: hide to the right */\n}\n\n/* Respect user's motion preferences */\n@media (prefers-reduced-motion: reduce) {\n :root {\n --angie-sidebar-transition: none;\n }\n}\n\n/* Apply transitions only when user is actively toggling */\nbody.angie-sidebar-transitioning {\n transition: var(--angie-sidebar-transition) !important;\n}\n\nbody.angie-sidebar-transitioning #angie-sidebar-container {\n transition: var(--angie-sidebar-transition) !important;\n}\n\n/* LTR Layout (default) - Push content to the right */\n@media (min-width: 768px) {\n body.angie-sidebar-active {\n padding-inline-start: var(--angie-sidebar-width) !important;\n }\n\n body.angie-sidebar-active #angie-body-top-padding {\n width: 100%;\n height: 8px;\n }\n\n /* Push WordPress Admin Bar - LTR */\n body.angie-sidebar-active #wpadminbar {\n inset-inline-start: var(--angie-sidebar-width) !important;\n inset-inline-end: 8px !important;\n width: calc(100% - 8px - var(--angie-sidebar-width)) !important;\n margin-top: 8px;\n }\n\n /* Sidebar container - LTR */\n #angie-sidebar-container {\n position: fixed;\n top: 0;\n inset-inline-start: 0;\n width: var(--angie-sidebar-width);\n height: 100vh;\n z-index: var(--angie-sidebar-z-index) !important; /* below elementor popups and media library modal */\n background: #FCFCFC;\n transform: var(--angie-sidebar-hide-transform);\n outline: none;\n overflow: hidden;\n /* No default transition - only when transitioning */\n }\n\n /* Resize handle */\n #angie-sidebar-container::after {\n content: '';\n position: absolute;\n top: 0;\n inset-inline-end: 0;\n width: 4px;\n height: 100%;\n cursor: ew-resize;\n background: transparent;\n z-index: 1000001;\n }\n\n /* Pink border during resize */\n #angie-sidebar-container.angie-resizing {\n border-inline-end-color: #ff69b4 !important;\n border-inline-end-width: 2px !important;\n }\n\n /* Disable iframe pointer events during resize */\n #angie-sidebar-container.angie-resizing iframe#angie-iframe {\n pointer-events: none !important;\n }\n}\n\n/* Active states */\nbody.angie-sidebar-active #angie-sidebar-container {\n transform: var(--angie-sidebar-show-transform);\n}\n\n/* Studio mode - sidebar takes full width */\n@media (min-width: 768px) {\n html.angie-studio-active body.angie-sidebar-active #angie-sidebar-container {\n width: 100%;\n }\n}\n\n/* High contrast mode support */\n@media (prefers-contrast: high) {\n #angie-sidebar-container {\n border-color: #000;\n box-shadow: none;\n }\n}\n\n/* Screen reader only class */\n.angie-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Plugin conflict resolution */\nbody.angie-sidebar-active {\n /* Reset common conflicting styles */\n box-sizing: border-box !important;\n position: relative !important;\n}\n\n#angie-sidebar-toggle {\n z-index: 99999 !important;\n}\n";const d=document.head||document.getElementsByTagName("head")[0];d.insertBefore(a,d.firstChild),Fr=!0}(),"undefined"!=typeof window&&(window.toggleAngieSidebar=function(r){return function(a,d){const h=document.body,g=document.getElementById("angie-sidebar-container");if(!g)return void console.warn("Angie Sidebar: Required elements not found!");const y=h.classList.contains("angie-sidebar-active"),_=void 0!==a?a:!y;d||(h.classList.add("angie-sidebar-transitioning"),setTimeout(function(){h.classList.remove("angie-sidebar-transitioning")},300)),_?h.classList.add("angie-sidebar-active"):h.classList.remove("angie-sidebar-active"),_&&setTimeout(function(){$n({type:"focusInput"})},d?0:300),r&&r(_,g,d),function(r){try{localStorage.setItem("angie_sidebar_state",r)}catch(r){console.warn("localStorage not available")}}(_?Mr:Ur);const b=new CustomEvent("angieSidebarToggle",{detail:{isOpen:_,sidebar:g,skipTransition:d}});document.dispatchEvent(b),$n({type:Kr.ANGIE_SIDEBAR_TOGGLED,payload:{state:_?"opened":"closed"}})}}(r),window.addEventListener("message",function(r){if(r.data&&"toggleAngieSidebar"===r.data.type){const{force:a,skipTransition:d}=r.data.payload||{};window.toggleAngieSidebar&&window.toggleAngieSidebar(a,d)}}))}const Vn=(r,a)=>{const d=document.getElementById("angie-sidebar-container");d&&d.setAttribute("aria-hidden",a?"false":"true"),a?r.removeAttribute("tabindex"):r.setAttribute("tabindex","-1")},Bn=(r,a)=>{r.postMessage({status:"success",payload:a})},Hn=(r,a)=>{r.postMessage({status:"error",payload:a})},Wn=()=>new Promise(r=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r):r(null)});var qr;(qr||(qr={})).POST_MESSAGE="postMessage";const Vr={open:!1,iframe:null,iframeUrlObject:null};function Xn(){const r=new URL(window.location.href);r.searchParams.set("start-oauth","1"),console.log("OAuth: Redirecting to wp-admin with OAuth:",r.toString()),window.location.href=r.toString()}var Kr;!function(r){r.SDK_ANGIE_ALL_SERVERS_REGISTERED="sdk-angie-all-servers-registered",r.SDK_ANGIE_READY_PING="sdk-angie-ready-ping",r.SDK_REQUEST_CLIENT_CREATION="sdk-request-client-creation",r.SDK_TRIGGER_ANGIE="sdk-trigger-angie",r.SDK_TRIGGER_ANGIE_RESPONSE="sdk-trigger-angie-response",r.ANGIE_SIDEBAR_RESIZED="angie-sidebar-resized",r.ANGIE_SIDEBAR_TOGGLED="angie-sidebar-toggled",r.ANGIE_CHAT_TOGGLE="angie-chat-toggle",r.ANGIE_STUDIO_TOGGLE="angie-studio-toggle",r.ANGIE_NAVIGATE_TO_URL="angie/navigate-to-url",r.ANGIE_PAGE_RELOAD="angie/page-reload"}(Kr||(Kr={}));class ts{angieDetector;registrationQueue;clientManager;isInitialized=!1;instanceId;constructor(){this.instanceId=Math.random().toString(36).substring(2,8),console.log(`AngieMcpSdk: Constructor called - initializing SDK (Instance: ${this.instanceId})`),this.angieDetector=new c,this.registrationQueue=new u,this.clientManager=new l,console.log(`AngieMcpSdk: Setting up event handlers (Instance: ${this.instanceId})`),this.setupAngieReadyHandler(),this.setupServerInitHandler(),this.setupReRegistrationHandler(),console.log(`AngieMcpSdk: SDK initialization complete (Instance: ${this.instanceId})`)}async loadSidebar(r){Kn(),await(async r=>{if(window.screen.availWidth<=768)return void console.log("Angie: Mobile detected, skipping iframe injection");let a=document.getElementById("angie-sidebar-container");if(!a){const r=performance.now();if(console.log("⏱️ Waiting for sidebar container..."),await new Promise(r=>{let d=0;const h=setInterval(()=>{a=document.getElementById("angie-sidebar-container"),d++,(a||d>20)&&(clearInterval(h),a&&r())},100);setTimeout(()=>{if(clearInterval(h),a)return void r();const d=new MutationObserver(()=>{a=document.getElementById("angie-sidebar-container"),a&&(d.disconnect(),r())});d.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{d.disconnect(),r()},8e3)},2e3)}),console.log(`⏱️ Sidebar container detection took: ${(performance.now()-r).toFixed(2)}ms`),!a)return void console.error("Angie: Sidebar container not found")}const{iframe:d,iframeUrlObject:h}=await(async r=>{const a=r.origin,d=new URL(r.path,a),h=d.pathname.slice(1).replace(/\//,"--")+"-"+Math.random().toString(36).substring(7);return new Promise(g=>{const y=new URL(a);y.pathname=d.pathname;const _=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(y.searchParams.append("colorScheme",r.uiTheme||_||"light"),y.searchParams.append("sdkVersion",r.sdkVersion),y.searchParams.append("instanceId",h),y.searchParams.append("origin",window.location.origin),r.isRTL&&y.searchParams.append("isRTL",r.isRTL?"true":"false"),"localhost"===window.location.hostname&&window.location.search.includes("debug_error")){const r=new URLSearchParams(window.location.search).get("debug_error");r&&y.searchParams.append("debug_error",r)}d.searchParams.forEach((r,a)=>{y.searchParams.set(a,r)}),y.searchParams.set("ver",(new Date).getTime().toString());const b=r.parent||document,P=b.createElement("iframe"),Z={"background-color":"transparent","color-scheme":"normal",...r.css};window.addEventListener("message",async r=>{if(r.origin===y.origin)switch(r.data.type){case j.ANGIE_READY:g({iframe:P,iframeUrlObject:y});break;case j.ANGIE_LOADED:P.contentWindow?.postMessage({type:j.HOST_READY,instanceId:h},y.origin)}}),P.setAttribute("src",y.href),P.id="angie-iframe",P.setAttribute("frameborder","0"),P.setAttribute("scrolling","no"),P.setAttribute("style",Object.entries(Z).map(([r,a])=>`${r}: ${a}`).join("; ")),P.setAttribute("allow","clipboard-write; clipboard-read"),r.insertCallback?r.insertCallback(P):b.body.appendChild(P)})})({origin:r.origin||"https://angie.elementor.com",path:"angie/wp-admin",insertCallback:r=>{console.log("Injecting Angie iframe into sidebar container"),r.setAttribute("title","Angie AI Assistant"),r.setAttribute("role","application"),r.setAttribute("aria-label","Angie AI Assistant Interface");const d=document.getElementById("angie-sidebar-loading");d&&(d.textContent=""),a?.appendChild(r),Vn(r,!0),r.addEventListener("load",()=>{r.focus()})},css:{width:"100%",height:"100%",border:"none",outline:"none"},uiTheme:r.uiTheme,isRTL:r.isRTL,sdkVersion:"1.0.3"});Vr.iframe=d,Vr.iframeUrlObject=h,window.addEventListener("message",r=>{if(r.origin===Vr.iframeUrlObject?.origin)switch(r.data.type){case P.SET:window.localStorage.setItem(r.data.key,r.data.value);break;case P.GET:const a=r.ports[0],d=window.localStorage.getItem(r.data.key);a.postMessage({value:d})}}),(r=>{window.addEventListener("message",async a=>{const d=a.origin===window.location.origin,h=a.origin===r.iframeUrlObject?.origin;if(d||h)switch(a?.data?.type){case Kr.SDK_ANGIE_ALL_SERVERS_REGISTERED:break;case Kr.SDK_ANGIE_READY_PING:const d=a.ports[0];console.log("Angie is ready",a),Bn(d,{message:"Angie is ready"});break;case Kr.SDK_REQUEST_CLIENT_CREATION:const h=a.data.payload;try{const d=a.ports[0],g=new MessageChannel;g.port1.onmessage=r=>{d.postMessage({success:!0,data:r.data})};const y={type:Kr.SDK_REQUEST_CLIENT_CREATION,payload:{success:!0,...h,clientId:`dynamic-client-${h.serverName}-${h.serverVersion}-${Date.now()}`,requestId:a.data.payload.requestId},timestamp:Date.now()};if(!r.iframe)throw new Error("Iframe not found");r.iframe.contentWindow?.postMessage(y,r.iframeUrlObject?.origin||"",[g.port2])}catch(r){console.error(`AngieMcpSdk:Failed to create client for SDK server "${h.serverName}":`,r)}break;case Kr.SDK_TRIGGER_ANGIE:console.log("SDK Trigger Angie received",a.data);try{const{requestId:d,prompt:h,context:g}=a.data.payload;if(!r.iframe)throw new Error("Iframe not found");r.iframe.contentWindow?.postMessage({type:Kr.SDK_TRIGGER_ANGIE,payload:{requestId:d,prompt:h,context:g}},r.iframeUrlObject?.origin||""),window.postMessage({type:Kr.SDK_TRIGGER_ANGIE_RESPONSE,payload:{success:!0,requestId:d,response:"Angie triggered successfully"}},window.location.origin)}catch(r){console.error("Failed to trigger Angie:",r),window.postMessage({type:Kr.SDK_TRIGGER_ANGIE_RESPONSE,payload:{success:!1,requestId:a.data.payload?.requestId,error:r instanceof Error?r.message:"Unknown error"}},window.location.origin)}}})})(Vr),window.addEventListener("message",r=>{if(r.origin===Vr.iframeUrlObject?.origin)switch(r.data.type){case"OAUTH_GET_CODE_AND_STATE":(r=>{const a=new URLSearchParams(window.location.search),d=a.get("oauth_code"),h=a.get("oauth_state");if(d&&h)Bn(r,{code:d,state:h});else{const g=a.get("oauth_error");if(g){Hn(r,{message:g,code:d||null,state:h||null});const a=new URL(window.location.href);a.searchParams.delete("oauth_error"),history.replaceState({},"",a.toString())}else Bn(r,{message:"No OAuth error found"})}})(r.ports[0]);break;case"OAUTH_GET_TOP_URL":console.log("OAuth: Iframe requested top window URL via MessageChannel"),Bn(r.ports[0],{topUrl:window.location.href});break;case"OAUTH_REDIRECT_TOP_WINDOW":console.log("OAuth: Iframe requested top window redirect to:",r.data.payload.url),window.location.href=r.data.payload.url;break;case"OAUTH_UPDATE_URL":console.log("OAuth: Iframe requested URL update to:",r.data.payload.url),function(r,a){if(!history?.replaceState)return console.warn("history.replaceState not supported in this browser"),void Hn(a,{message:"URL update not supported in this browser"});try{const d=window.location.href;history.replaceState({},"",r),function(r,a){const d=new URL(a),h=new URL(r),g=d.searchParams,y=h.searchParams,_=["oauth_code","oauth_state","start-oauth"];return _.some(r=>y?.has(r))&&!_.some(r=>g?.has(r))}(d,r)&&function(){console.log("OAuth parameters cleaned, opening sidebar");try{localStorage.setItem("angie_sidebar_state","open")}catch(r){console.warn("localStorage not available")}setTimeout(()=>{window.toggleAngieSidebar(!0)},500)}(),Bn(a,{message:"URL updated successfully"})}catch(r){console.warn("Failed to update URL via history.replaceState:",r),Hn(a,{message:"URL update failed: "+(r instanceof Error?r.message:"Unknown error")})}}(r.data.payload.url,r.ports[0]);break;case"ANGIE_REDIRECT_TO_WP_ADMIN_WITH_OAUTH":Xn();break;case"ANGIE_REDIRECT_TO_AUTH_ORIGIN_LOGOUT":try{Xn()}catch(r){console.error("OAuth: Auth origin logout fallback failed:",r),window.location.reload()}}}),window.addEventListener("message",async a=>{if([window.location.origin,r.origin||"https://angie.elementor.com"].includes(a.origin))if(a?.data?.type===Kr.ANGIE_CHAT_TOGGLE)Vr.open=a.data.open,Vr.iframe&&Vn(Vr.iframe,Vr.open);else if(a?.data?.type===Kr.ANGIE_STUDIO_TOGGLE){const r=a.data.isStudioOpen;if(!Vr.iframe)return;if(r)document.documentElement.classList.add("angie-studio-active");else{const r=Dn();document.documentElement.style.setProperty("--angie-sidebar-width",`${r}px`),document.documentElement.classList.remove("angie-studio-active")}}else if(a?.data?.type===Kr.ANGIE_NAVIGATE_TO_URL){const{url:r=""}=a.data;if(!((r,a=[])=>{const d=0===a.length&&"undefined"!=typeof window?[window.location.origin]:a;if(!r.startsWith("http"))return!1;try{const a=new URL(r);return d.includes(a.origin)}catch{return!1}})(r))throw new Error("Angie: Invalid URL - navigation blocked for security reasons");window.location.assign(r)}else a?.data?.type===Kr.ANGIE_PAGE_RELOAD?(console.log("Angie requested page reload - database operations completed"),window.location.reload()):a?.data?.type===j.RESET_HASH&&(window.location.hash="",Bn(a.ports[0],{message:"Hash reset successfully"}))})})({origin:r?.origin||"https://angie.elementor.com",uiTheme:r?.uiTheme||"light",isRTL:r?.isRTL||!1,...r}),this.setupPromptHashDetection()}setupReRegistrationHandler(){window.addEventListener("message",r=>{if(r.data?.type===b.SDK_ANGIE_REFRESH_PING)if(console.log(`AngieMcpSdk: Angie refresh ping received (Instance: ${this.instanceId})`),this.registrationQueue.resetAllToPending()){const r=this.registrationQueue.getPending().length;console.log(`AngieMcpSdk: Successfully reset ${r} registrations, processing queue (Instance: ${this.instanceId})`),this.handleAngieReady()}else console.log(`AngieMcpSdk: Skipping queue reset - processing already in progress (Instance: ${this.instanceId})`)})}setupAngieReadyHandler(){this.angieDetector.waitForReady().then(r=>{r.isReady?this.handleAngieReady():console.warn("AngieMcpSdk: Angie not detected - servers will remain queued")}).catch(r=>{console.error("AngieMcpSdk: Error waiting for Angie:",r)})}async handleAngieReady(){console.log(`AngieMcpSdk: Angie is ready, processing queued registrations (Instance: ${this.instanceId})`);try{await this.registrationQueue.processQueue(async r=>{console.log(`AngieMcpSdk: processQueue callback called for "${r.config.name}" (Instance: ${this.instanceId})`),await this.processRegistration(r)}),this.isInitialized=!0,console.log(`AngieMcpSdk: Initialization complete (Instance: ${this.instanceId})`)}catch(r){console.error(`AngieMcpSdk: Error processing registration queue (Instance: ${this.instanceId}):`,r)}}async processRegistration(r){console.log(`AngieMcpSdk: Processing registration for server "${r.config.name}" (ID: ${r.id}) (Instance: ${this.instanceId})`);try{console.log(`AngieMcpSdk: Calling clientManager.requestClientCreation for "${r.config.name}" (Instance: ${this.instanceId})`);const a={...r,instanceId:this.instanceId};await this.clientManager.requestClientCreation(a),console.log(`AngieMcpSdk: Successfully registered server "${r.config.name}" (Instance: ${this.instanceId})`)}catch(a){throw console.error(`AngieMcpSdk: Failed to register server "${r.config.name}" (Instance: ${this.instanceId}):`,a),a}}registerLocalServer(r){return r.type=_.LOCAL,r.transport=g.POST_MESSAGE,this.registerServer(r)}registerRemoteServer(r){return r.type=_.REMOTE,this.registerServer(r)}isLocalServerConfig(r){return r.type===_.LOCAL||!r.type&&"server"in r}isRemoteServerConfig(r){return r.type===_.REMOTE&&"url"in r}async registerServer(r){if(!r.type)return console.warn("AngieMcpSdk: for a local server, please use registerLocalServer instead of registerServer"),void this.registerLocalServer(r);if(console.log(`AngieMcpSdk: registerServer called for "${r.name}" (Instance: ${this.instanceId})`),!r.name)throw new Error("Server name is required");if(!r.description)throw new Error("Server description is required");if(this.isLocalServerConfig(r)&&!r.server)throw new Error("Server instance is required for local servers");console.log(`AngieMcpSdk: Registering server "${r.name}" (Instance: ${this.instanceId})`);const a=this.registrationQueue.add(r);if(console.log(`AngieMcpSdk: Added registration to queue: ${a.id} (Instance: ${this.instanceId})`),this.angieDetector.isReady())try{await this.processRegistration(a),this.registrationQueue.updateStatus(a.id,"registered"),console.log(`AngieMcpSdk: Server "${r.name}" registered successfully (Instance: ${this.instanceId})`)}catch(r){const d=r instanceof Error?r.message:String(r);throw this.registrationQueue.updateStatus(a.id,"failed",d),r}else console.log(`AngieMcpSdk: Server "${r.name}" queued until Angie is ready (Instance: ${this.instanceId})`)}getRegistrations(){return this.registrationQueue.getAll()}getPendingRegistrations(){return this.registrationQueue.getPending()}isAngieReady(){return this.angieDetector.isReady()}isReady(){return this.isInitialized}async waitForReady(){if(!(await this.angieDetector.waitForReady()).isReady)throw new Error("Angie is not available");for(;!this.isInitialized;)await new Promise(r=>setTimeout(r,100))}async triggerAngie(r){if(!this.isAngieReady())throw new Error("Angie is not ready. Please wait for Angie to be available before triggering.");const a=this.generateRequestId(),d=r.options?.timeout||3e4;return new Promise((h,g)=>{const y=setTimeout(()=>{g(new Error("Angie trigger request timed out"))},d),o=r=>{r.data?.type===b.SDK_TRIGGER_ANGIE_RESPONSE&&r.data?.payload?.requestId===a&&(clearTimeout(y),window.removeEventListener("message",o),h(r.data.payload))};window.addEventListener("message",o);const _={type:b.SDK_TRIGGER_ANGIE,payload:{requestId:a,prompt:r.prompt,options:r.options,context:{pageUrl:window.location.href,pageTitle:document.title,...r.context}},timestamp:Date.now()};console.log(`AngieMcpSdk: Triggering Angie with prompt (Request ID: ${a}, Instance: ${this.instanceId})`),window.postMessage(_,window.location.origin)})}destroy(){this.registrationQueue.clear(),console.log(`AngieMcpSdk: SDK destroyed (Instance: ${this.instanceId})`)}setupServerInitHandler(){window.addEventListener("message",r=>{r.data?.type===b.SDK_REQUEST_INIT_SERVER&&(console.log(`AngieMcpSdk: Server init request received (Instance: ${this.instanceId})`),this.handleServerInitRequest(r))})}handleServerInitRequest(r){const{clientId:a,serverId:d,instanceId:h}=r.data.payload||{};if(a&&d)if(console.log(`AngieMcpSdk: Server init request received - Request instanceId: ${h}, This instanceId: ${this.instanceId} (Instance: ${this.instanceId})`),h&&h!==this.instanceId)console.log(`AngieMcpSdk: Ignoring server init request for different instance. Request instanceId: ${h}, this instanceId: ${this.instanceId}`);else{console.log(`AngieMcpSdk: Handling server init request for clientId: ${a}, serverId: ${d} (Instance: ${this.instanceId})`);try{const a=this.registrationQueue.getAll().find(r=>r.id===d);if(!a)return void console.error(`AngieMcpSdk: No registration found for serverId: ${d} (Instance: ${this.instanceId})`);if("type"in a.config&&"remote"===a.config.type)return void console.log(`AngieMcpSdk: Remote server registration detected; skipping local connect (Instance: ${this.instanceId})`);const h=r.ports[0];if(!h)return void console.error(`AngieMcpSdk: No port provided in server init request (Instance: ${this.instanceId})`);const g=a.config.server,y=new Cn(h);g.connect(y),console.log(`AngieMcpSdk: Server "${a.config.name}" initialized successfully (Instance: ${this.instanceId})`)}catch(r){console.error(`AngieMcpSdk: Error initializing server for clientId ${a} (Instance: ${this.instanceId}):`,r)}}else console.error(`AngieMcpSdk: Invalid server init request - missing clientId or serverId (Instance: ${this.instanceId})`)}generateRequestId(){return`${this.instanceId}-${Date.now()}-${Math.random().toString(36).substring(2,8)}`}async handlePromptHash(){const r=window.location.hash;if(r.startsWith("#angie-prompt="))try{const a=r.replace("#angie-prompt=",""),d=decodeURIComponent(a);if(!d)return void console.warn("AngieMcpSdk: Empty prompt detected in hash");console.log("AngieMcpSdk: Detected prompt in hash:",d),await this.waitForReady();const h=await this.triggerAngie({prompt:d,context:{source:"hash-parameter",pageUrl:window.location.href,timestamp:(new Date).toISOString()}});console.log("AngieMcpSdk: Triggered successfully from hash:",h),window.location.hash=""}catch(r){console.error("AngieMcpSdk: Failed to trigger from hash:",r)}}setupPromptHashDetection(){this.handlePromptHash(),window.addEventListener("hashchange",()=>this.handlePromptHash())}}const ns=(r,a)=>{if(Pn()){a.isOpen&&window.toggleAngieSidebar&&window.toggleAngieSidebar(!0);const d=$n({type:"angie-route-navigation",path:r,payload:a});return d||console.error("Failed to post navigation message to Angie iframe"),d}return console.error("Angie iframe not found"),!1}},"./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js":function(r,a,d){"use strict";d.r(a),d.d(a,{Completable:function(){return Completable},McpZodTypeKind:function(){return h},completable:function(){return completable}});var h,g=d("./packages/node_modules/zod/v3/types.js");!function(r){r.Completable="McpCompletable"}(h||(h={}));class Completable extends g.ZodType{_parse(r){const{ctx:a}=this._processInputParams(r),d=a.data;return this._def.type._parse({data:d,path:a.path,parent:a})}unwrap(){return this._def.type}}function completable(r,a){return Completable.create(r,{...r._def,complete:a})}function processCreateParams(r){if(!r)return{};const{errorMap:a,invalid_type_error:d,required_error:h,description:g}=r;if(a&&(d||h))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(a)return{errorMap:a,description:g};return{errorMap:(a,g)=>{var y,_;const{message:b}=r;return"invalid_enum_value"===a.code?{message:null!=b?b:g.defaultError}:void 0===g.data?{message:null!==(y=null!=b?b:h)&&void 0!==y?y:g.defaultError}:"invalid_type"!==a.code?{message:g.defaultError}:{message:null!==(_=null!=b?b:d)&&void 0!==_?_:g.defaultError}},description:g}}Completable.create=(r,a)=>new Completable({type:r,typeName:h.Completable,complete:a.complete,...processCreateParams(a)})},"./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js":function(r,a,d){"use strict";d.r(a),d.d(a,{Server:function(){return Server}});var h=d("./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js"),g=d("./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),y=d("./packages/node_modules/ajv/lib/ajv.js");class Server extends h.Protocol{constructor(r,a){var d;super(a),this._serverInfo=r,this._capabilities=null!==(d=null==a?void 0:a.capabilities)&&void 0!==d?d:{},this._instructions=null==a?void 0:a.instructions,this.setRequestHandler(g.InitializeRequestSchema,r=>this._oninitialize(r)),this.setNotificationHandler(g.InitializedNotificationSchema,()=>{var r;return null===(r=this.oninitialized)||void 0===r?void 0:r.call(this)})}registerCapabilities(r){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=(0,h.mergeCapabilities)(this._capabilities,r)}assertCapabilityForMethod(r){var a,d,h;switch(r){case"sampling/createMessage":if(!(null===(a=this._clientCapabilities)||void 0===a?void 0:a.sampling))throw new Error(`Client does not support sampling (required for ${r})`);break;case"elicitation/create":if(!(null===(d=this._clientCapabilities)||void 0===d?void 0:d.elicitation))throw new Error(`Client does not support elicitation (required for ${r})`);break;case"roots/list":if(!(null===(h=this._clientCapabilities)||void 0===h?void 0:h.roots))throw new Error(`Client does not support listing roots (required for ${r})`)}}assertNotificationCapability(r){switch(r){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${r})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${r})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${r})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${r})`)}}assertRequestHandlerCapability(r){switch(r){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Server does not support sampling (required for ${r})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${r})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${r})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${r})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${r})`)}}async _oninitialize(r){const a=r.params.protocolVersion;this._clientCapabilities=r.params.capabilities,this._clientVersion=r.params.clientInfo;return{protocolVersion:g.SUPPORTED_PROTOCOL_VERSIONS.includes(a)?a:g.LATEST_PROTOCOL_VERSION,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},g.EmptyResultSchema)}async createMessage(r,a){return this.request({method:"sampling/createMessage",params:r},g.CreateMessageResultSchema,a)}async elicitInput(r,a){const d=await this.request({method:"elicitation/create",params:r},g.ElicitResultSchema,a);if("accept"===d.action&&d.content)try{const a=new y,h=a.compile(r.requestedSchema);if(!h(d.content))throw new g.McpError(g.ErrorCode.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorsText(h.errors)}`)}catch(r){if(r instanceof g.McpError)throw r;throw new g.McpError(g.ErrorCode.InternalError,`Error validating elicitation response: ${r}`)}return d}async listRoots(r,a){return this.request({method:"roots/list",params:r},g.ListRootsResultSchema,a)}async sendLoggingMessage(r){return this.notification({method:"notifications/message",params:r})}async sendResourceUpdated(r){return this.notification({method:"notifications/resources/updated",params:r})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}},"./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js":function(r,a,d){"use strict";d.r(a),d.d(a,{McpServer:function(){return McpServer},ResourceTemplate:function(){return ResourceTemplate}});var h=d("./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/index.js"),y=d("./packages/node_modules/zod/v3/types.js"),_=d("./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),b=d("./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js"),P=d("./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js");class McpServer{constructor(r,a){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new h.Server(r,a)}async connect(r){return await this.server.connect(r)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(_.ListToolsRequestSchema.shape.method.value),this.server.assertCanSetRequestHandler(_.CallToolRequestSchema.shape.method.value),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(_.ListToolsRequestSchema,()=>({tools:Object.entries(this._registeredTools).filter(([,r])=>r.enabled).map(([r,a])=>{const d={name:r,title:a.title,description:a.description,inputSchema:a.inputSchema?(0,g.zodToJsonSchema)(a.inputSchema,{strictUnions:!0}):j,annotations:a.annotations};return a.outputSchema&&(d.outputSchema=(0,g.zodToJsonSchema)(a.outputSchema,{strictUnions:!0})),d})})),this.server.setRequestHandler(_.CallToolRequestSchema,async(r,a)=>{const d=this._registeredTools[r.params.name];if(!d)throw new _.McpError(_.ErrorCode.InvalidParams,`Tool ${r.params.name} not found`);if(!d.enabled)throw new _.McpError(_.ErrorCode.InvalidParams,`Tool ${r.params.name} disabled`);let h;if(d.inputSchema){const g=await d.inputSchema.safeParseAsync(r.params.arguments);if(!g.success)throw new _.McpError(_.ErrorCode.InvalidParams,`Invalid arguments for tool ${r.params.name}: ${g.error.message}`);const y=g.data,b=d.callback;try{h=await Promise.resolve(b(y,a))}catch(r){h={content:[{type:"text",text:r instanceof Error?r.message:String(r)}],isError:!0}}}else{const r=d.callback;try{h=await Promise.resolve(r(a))}catch(r){h={content:[{type:"text",text:r instanceof Error?r.message:String(r)}],isError:!0}}}if(d.outputSchema&&!h.isError){if(!h.structuredContent)throw new _.McpError(_.ErrorCode.InvalidParams,`Tool ${r.params.name} has an output schema but no structured content was provided`);const a=await d.outputSchema.safeParseAsync(h.structuredContent);if(!a.success)throw new _.McpError(_.ErrorCode.InvalidParams,`Invalid structured content for tool ${r.params.name}: ${a.error.message}`)}return h}),this._toolHandlersInitialized=!0)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(_.CompleteRequestSchema.shape.method.value),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(_.CompleteRequestSchema,async r=>{switch(r.params.ref.type){case"ref/prompt":return this.handlePromptCompletion(r,r.params.ref);case"ref/resource":return this.handleResourceCompletion(r,r.params.ref);default:throw new _.McpError(_.ErrorCode.InvalidParams,`Invalid completion reference: ${r.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(r,a){const d=this._registeredPrompts[a.name];if(!d)throw new _.McpError(_.ErrorCode.InvalidParams,`Prompt ${a.name} not found`);if(!d.enabled)throw new _.McpError(_.ErrorCode.InvalidParams,`Prompt ${a.name} disabled`);if(!d.argsSchema)return Z;const h=d.argsSchema.shape[r.params.argument.name];if(!(h instanceof b.Completable))return Z;const g=h._def;return createCompletionResult(await g.complete(r.params.argument.value,r.params.context))}async handleResourceCompletion(r,a){const d=Object.values(this._registeredResourceTemplates).find(r=>r.resourceTemplate.uriTemplate.toString()===a.uri);if(!d){if(this._registeredResources[a.uri])return Z;throw new _.McpError(_.ErrorCode.InvalidParams,`Resource template ${r.params.ref.uri} not found`)}const h=d.resourceTemplate.completeCallback(r.params.argument.name);if(!h)return Z;return createCompletionResult(await h(r.params.argument.value,r.params.context))}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(_.ListResourcesRequestSchema.shape.method.value),this.server.assertCanSetRequestHandler(_.ListResourceTemplatesRequestSchema.shape.method.value),this.server.assertCanSetRequestHandler(_.ReadResourceRequestSchema.shape.method.value),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(_.ListResourcesRequestSchema,async(r,a)=>{const d=Object.entries(this._registeredResources).filter(([r,a])=>a.enabled).map(([r,a])=>({uri:r,name:a.name,...a.metadata})),h=[];for(const r of Object.values(this._registeredResourceTemplates)){if(!r.resourceTemplate.listCallback)continue;const d=await r.resourceTemplate.listCallback(a);for(const a of d.resources)h.push({...r.metadata,...a})}return{resources:[...d,...h]}}),this.server.setRequestHandler(_.ListResourceTemplatesRequestSchema,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,a])=>({name:r,uriTemplate:a.resourceTemplate.uriTemplate.toString(),...a.metadata}))})),this.server.setRequestHandler(_.ReadResourceRequestSchema,async(r,a)=>{const d=new URL(r.params.uri),h=this._registeredResources[d.toString()];if(h){if(!h.enabled)throw new _.McpError(_.ErrorCode.InvalidParams,`Resource ${d} disabled`);return h.readCallback(d,a)}for(const r of Object.values(this._registeredResourceTemplates)){const h=r.resourceTemplate.uriTemplate.match(d.toString());if(h)return r.readCallback(d,h,a)}throw new _.McpError(_.ErrorCode.InvalidParams,`Resource ${d} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(_.ListPromptsRequestSchema.shape.method.value),this.server.assertCanSetRequestHandler(_.GetPromptRequestSchema.shape.method.value),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(_.ListPromptsRequestSchema,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,r])=>r.enabled).map(([r,a])=>{return{name:r,title:a.title,description:a.description,arguments:a.argsSchema?(d=a.argsSchema,Object.entries(d.shape).map(([r,a])=>({name:r,description:a.description,required:!a.isOptional()}))):void 0};var d})})),this.server.setRequestHandler(_.GetPromptRequestSchema,async(r,a)=>{const d=this._registeredPrompts[r.params.name];if(!d)throw new _.McpError(_.ErrorCode.InvalidParams,`Prompt ${r.params.name} not found`);if(!d.enabled)throw new _.McpError(_.ErrorCode.InvalidParams,`Prompt ${r.params.name} disabled`);if(d.argsSchema){const h=await d.argsSchema.safeParseAsync(r.params.arguments);if(!h.success)throw new _.McpError(_.ErrorCode.InvalidParams,`Invalid arguments for prompt ${r.params.name}: ${h.error.message}`);const g=h.data,y=d.callback;return await Promise.resolve(y(g,a))}{const r=d.callback;return await Promise.resolve(r(a))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0)}resource(r,a,...d){let h;"object"==typeof d[0]&&(h=d.shift());const g=d[0];if("string"==typeof a){if(this._registeredResources[a])throw new Error(`Resource ${a} is already registered`);const d=this._createRegisteredResource(r,void 0,a,h,g);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),d}{if(this._registeredResourceTemplates[r])throw new Error(`Resource template ${r} is already registered`);const d=this._createRegisteredResourceTemplate(r,void 0,a,h,g);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),d}}registerResource(r,a,d,h){if("string"==typeof a){if(this._registeredResources[a])throw new Error(`Resource ${a} is already registered`);const g=this._createRegisteredResource(r,d.title,a,d,h);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),g}{if(this._registeredResourceTemplates[r])throw new Error(`Resource template ${r} is already registered`);const g=this._createRegisteredResourceTemplate(r,d.title,a,d,h);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),g}}_createRegisteredResource(r,a,d,h,g){const y={name:r,title:a,metadata:h,readCallback:g,enabled:!0,disable:()=>y.update({enabled:!1}),enable:()=>y.update({enabled:!0}),remove:()=>y.update({uri:null}),update:r=>{void 0!==r.uri&&r.uri!==d&&(delete this._registeredResources[d],r.uri&&(this._registeredResources[r.uri]=y)),void 0!==r.name&&(y.name=r.name),void 0!==r.title&&(y.title=r.title),void 0!==r.metadata&&(y.metadata=r.metadata),void 0!==r.callback&&(y.readCallback=r.callback),void 0!==r.enabled&&(y.enabled=r.enabled),this.sendResourceListChanged()}};return this._registeredResources[d]=y,y}_createRegisteredResourceTemplate(r,a,d,h,g){const y={resourceTemplate:d,title:a,metadata:h,readCallback:g,enabled:!0,disable:()=>y.update({enabled:!1}),enable:()=>y.update({enabled:!0}),remove:()=>y.update({name:null}),update:a=>{void 0!==a.name&&a.name!==r&&(delete this._registeredResourceTemplates[r],a.name&&(this._registeredResourceTemplates[a.name]=y)),void 0!==a.title&&(y.title=a.title),void 0!==a.template&&(y.resourceTemplate=a.template),void 0!==a.metadata&&(y.metadata=a.metadata),void 0!==a.callback&&(y.readCallback=a.callback),void 0!==a.enabled&&(y.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResourceTemplates[r]=y,y}_createRegisteredPrompt(r,a,d,h,g){const _={title:a,description:d,argsSchema:void 0===h?void 0:y.object(h),callback:g,enabled:!0,disable:()=>_.update({enabled:!1}),enable:()=>_.update({enabled:!0}),remove:()=>_.update({name:null}),update:a=>{void 0!==a.name&&a.name!==r&&(delete this._registeredPrompts[r],a.name&&(this._registeredPrompts[a.name]=_)),void 0!==a.title&&(_.title=a.title),void 0!==a.description&&(_.description=a.description),void 0!==a.argsSchema&&(_.argsSchema=y.object(a.argsSchema)),void 0!==a.callback&&(_.callback=a.callback),void 0!==a.enabled&&(_.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[r]=_,_}_createRegisteredTool(r,a,d,h,g,_,b){const P={title:a,description:d,inputSchema:void 0===h?void 0:y.object(h),outputSchema:void 0===g?void 0:y.object(g),annotations:_,callback:b,enabled:!0,disable:()=>P.update({enabled:!1}),enable:()=>P.update({enabled:!0}),remove:()=>P.update({name:null}),update:a=>{void 0!==a.name&&a.name!==r&&(delete this._registeredTools[r],a.name&&(this._registeredTools[a.name]=P)),void 0!==a.title&&(P.title=a.title),void 0!==a.description&&(P.description=a.description),void 0!==a.paramsSchema&&(P.inputSchema=y.object(a.paramsSchema)),void 0!==a.callback&&(P.callback=a.callback),void 0!==a.annotations&&(P.annotations=a.annotations),void 0!==a.enabled&&(P.enabled=a.enabled),this.sendToolListChanged()}};return this._registeredTools[r]=P,this.setToolRequestHandlers(),this.sendToolListChanged(),P}tool(r,...a){if(this._registeredTools[r])throw new Error(`Tool ${r} is already registered`);let d,h,g;if("string"==typeof a[0]&&(d=a.shift()),a.length>1){const r=a[0];isZodRawShape(r)?(h=a.shift(),a.length>1&&"object"==typeof a[0]&&null!==a[0]&&!isZodRawShape(a[0])&&(g=a.shift())):"object"==typeof r&&null!==r&&(g=a.shift())}const y=a[0];return this._createRegisteredTool(r,void 0,d,h,undefined,g,y)}registerTool(r,a,d){if(this._registeredTools[r])throw new Error(`Tool ${r} is already registered`);const{title:h,description:g,inputSchema:y,outputSchema:_,annotations:b}=a;return this._createRegisteredTool(r,h,g,y,_,b,d)}prompt(r,...a){if(this._registeredPrompts[r])throw new Error(`Prompt ${r} is already registered`);let d,h;"string"==typeof a[0]&&(d=a.shift()),a.length>1&&(h=a.shift());const g=a[0],y=this._createRegisteredPrompt(r,void 0,d,h,g);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),y}registerPrompt(r,a,d){if(this._registeredPrompts[r])throw new Error(`Prompt ${r} is already registered`);const{title:h,description:g,argsSchema:y}=a,_=this._createRegisteredPrompt(r,h,g,y,d);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),_}isConnected(){return void 0!==this.server.transport}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}}class ResourceTemplate{constructor(r,a){this._callbacks=a,this._uriTemplate="string"==typeof r?new P.UriTemplate(r):r}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(r){var a;return null===(a=this._callbacks.complete)||void 0===a?void 0:a[r]}}const j={type:"object",properties:{}};function isZodRawShape(r){if("object"!=typeof r||null===r)return!1;return 0===Object.keys(r).length||Object.values(r).some(isZodTypeLike)}function isZodTypeLike(r){return null!==r&&"object"==typeof r&&"parse"in r&&"function"==typeof r.parse&&"safeParse"in r&&"function"==typeof r.safeParse}function createCompletionResult(r){return{completion:{values:r.slice(0,100),total:r.length,hasMore:r.length>100}}}const Z={completion:{values:[],hasMore:!1}}},"./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js":function(r,a,d){"use strict";d.r(a),d.d(a,{DEFAULT_REQUEST_TIMEOUT_MSEC:function(){return g},Protocol:function(){return Protocol},mergeCapabilities:function(){return mergeCapabilities}});var h=d("./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");const g=6e4;class Protocol{constructor(r){this._options=r,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(h.CancelledNotificationSchema,r=>{const a=this._requestHandlerAbortControllers.get(r.params.requestId);null==a||a.abort(r.params.reason)}),this.setNotificationHandler(h.ProgressNotificationSchema,r=>{this._onprogress(r)}),this.setRequestHandler(h.PingRequestSchema,r=>({}))}_setupTimeout(r,a,d,h,g=!1){this._timeoutInfo.set(r,{timeoutId:setTimeout(h,a),startTime:Date.now(),timeout:a,maxTotalTimeout:d,resetTimeoutOnProgress:g,onTimeout:h})}_resetTimeout(r){const a=this._timeoutInfo.get(r);if(!a)return!1;const d=Date.now()-a.startTime;if(a.maxTotalTimeout&&d>=a.maxTotalTimeout)throw this._timeoutInfo.delete(r),new h.McpError(h.ErrorCode.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:a.maxTotalTimeout,totalElapsed:d});return clearTimeout(a.timeoutId),a.timeoutId=setTimeout(a.onTimeout,a.timeout),!0}_cleanupTimeout(r){const a=this._timeoutInfo.get(r);a&&(clearTimeout(a.timeoutId),this._timeoutInfo.delete(r))}async connect(r){var a,d,g;this._transport=r;const y=null===(a=this.transport)||void 0===a?void 0:a.onclose;this._transport.onclose=()=>{null==y||y(),this._onclose()};const _=null===(d=this.transport)||void 0===d?void 0:d.onerror;this._transport.onerror=r=>{null==_||_(r),this._onerror(r)};const b=null===(g=this._transport)||void 0===g?void 0:g.onmessage;this._transport.onmessage=(r,a)=>{null==b||b(r,a),(0,h.isJSONRPCResponse)(r)||(0,h.isJSONRPCError)(r)?this._onresponse(r):(0,h.isJSONRPCRequest)(r)?this._onrequest(r,a):(0,h.isJSONRPCNotification)(r)?this._onnotification(r):this._onerror(new Error(`Unknown message type: ${JSON.stringify(r)}`))},await this._transport.start()}_onclose(){var r;const a=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,null===(r=this.onclose)||void 0===r||r.call(this);const d=new h.McpError(h.ErrorCode.ConnectionClosed,"Connection closed");for(const r of a.values())r(d)}_onerror(r){var a;null===(a=this.onerror)||void 0===a||a.call(this,r)}_onnotification(r){var a;const d=null!==(a=this._notificationHandlers.get(r.method))&&void 0!==a?a:this.fallbackNotificationHandler;void 0!==d&&Promise.resolve().then(()=>d(r)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(r,a){var d,g;const y=null!==(d=this._requestHandlers.get(r.method))&&void 0!==d?d:this.fallbackRequestHandler,_=this._transport;if(void 0===y)return void(null==_||_.send({jsonrpc:"2.0",id:r.id,error:{code:h.ErrorCode.MethodNotFound,message:"Method not found"}}).catch(r=>this._onerror(new Error(`Failed to send an error response: ${r}`))));const b=new AbortController;this._requestHandlerAbortControllers.set(r.id,b);const P={signal:b.signal,sessionId:null==_?void 0:_.sessionId,_meta:null===(g=r.params)||void 0===g?void 0:g._meta,sendNotification:a=>this.notification(a,{relatedRequestId:r.id}),sendRequest:(a,d,h)=>this.request(a,d,{...h,relatedRequestId:r.id}),authInfo:null==a?void 0:a.authInfo,requestId:r.id,requestInfo:null==a?void 0:a.requestInfo};Promise.resolve().then(()=>y(r,P)).then(a=>{if(!b.signal.aborted)return null==_?void 0:_.send({result:a,jsonrpc:"2.0",id:r.id})},a=>{var d;if(!b.signal.aborted)return null==_?void 0:_.send({jsonrpc:"2.0",id:r.id,error:{code:Number.isSafeInteger(a.code)?a.code:h.ErrorCode.InternalError,message:null!==(d=a.message)&&void 0!==d?d:"Internal error"}})}).catch(r=>this._onerror(new Error(`Failed to send response: ${r}`))).finally(()=>{this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(r){const{progressToken:a,...d}=r.params,h=Number(a),g=this._progressHandlers.get(h);if(!g)return void this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(r)}`));const y=this._responseHandlers.get(h),_=this._timeoutInfo.get(h);if(_&&y&&_.resetTimeoutOnProgress)try{this._resetTimeout(h)}catch(r){return void y(r)}g(d)}_onresponse(r){const a=Number(r.id),d=this._responseHandlers.get(a);if(void 0!==d)if(this._responseHandlers.delete(a),this._progressHandlers.delete(a),this._cleanupTimeout(a),(0,h.isJSONRPCResponse)(r))d(r);else{d(new h.McpError(r.error.code,r.error.message,r.error.data))}else this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(r)}`))}get transport(){return this._transport}async close(){var r;await(null===(r=this._transport)||void 0===r?void 0:r.close())}request(r,a,d){const{relatedRequestId:y,resumptionToken:_,onresumptiontoken:b}=null!=d?d:{};return new Promise((P,j)=>{var Z,D,N,$,z,L;if(!this._transport)return void j(new Error("Not connected"));!0===(null===(Z=this._options)||void 0===Z?void 0:Z.enforceStrictCapabilities)&&this.assertCapabilityForMethod(r.method),null===(D=null==d?void 0:d.signal)||void 0===D||D.throwIfAborted();const F=this._requestMessageId++,M={...r,jsonrpc:"2.0",id:F};(null==d?void 0:d.onprogress)&&(this._progressHandlers.set(F,d.onprogress),M.params={...r.params,_meta:{...(null===(N=r.params)||void 0===N?void 0:N._meta)||{},progressToken:F}});const cancel=r=>{var a;this._responseHandlers.delete(F),this._progressHandlers.delete(F),this._cleanupTimeout(F),null===(a=this._transport)||void 0===a||a.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:F,reason:String(r)}},{relatedRequestId:y,resumptionToken:_,onresumptiontoken:b}).catch(r=>this._onerror(new Error(`Failed to send cancellation: ${r}`))),j(r)};this._responseHandlers.set(F,r=>{var h;if(!(null===(h=null==d?void 0:d.signal)||void 0===h?void 0:h.aborted)){if(r instanceof Error)return j(r);try{const d=a.parse(r.result);P(d)}catch(r){j(r)}}}),null===($=null==d?void 0:d.signal)||void 0===$||$.addEventListener("abort",()=>{var r;cancel(null===(r=null==d?void 0:d.signal)||void 0===r?void 0:r.reason)});const U=null!==(z=null==d?void 0:d.timeout)&&void 0!==z?z:g;this._setupTimeout(F,U,null==d?void 0:d.maxTotalTimeout,()=>cancel(new h.McpError(h.ErrorCode.RequestTimeout,"Request timed out",{timeout:U})),null!==(L=null==d?void 0:d.resetTimeoutOnProgress)&&void 0!==L&&L),this._transport.send(M,{relatedRequestId:y,resumptionToken:_,onresumptiontoken:b}).catch(r=>{this._cleanupTimeout(F),j(r)})})}async notification(r,a){var d,h;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(r.method);if((null!==(h=null===(d=this._options)||void 0===d?void 0:d.debouncedNotificationMethods)&&void 0!==h?h:[]).includes(r.method)&&!r.params&&!(null==a?void 0:a.relatedRequestId)){if(this._pendingDebouncedNotifications.has(r.method))return;return this._pendingDebouncedNotifications.add(r.method),void Promise.resolve().then(()=>{var d;if(this._pendingDebouncedNotifications.delete(r.method),!this._transport)return;const h={...r,jsonrpc:"2.0"};null===(d=this._transport)||void 0===d||d.send(h,a).catch(r=>this._onerror(r))})}const g={...r,jsonrpc:"2.0"};await this._transport.send(g,a)}setRequestHandler(r,a){const d=r.shape.method.value;this.assertRequestHandlerCapability(d),this._requestHandlers.set(d,(d,h)=>Promise.resolve(a(r.parse(d),h)))}removeRequestHandler(r){this._requestHandlers.delete(r)}assertCanSetRequestHandler(r){if(this._requestHandlers.has(r))throw new Error(`A request handler for ${r} already exists, which would be overridden`)}setNotificationHandler(r,a){this._notificationHandlers.set(r.shape.method.value,d=>Promise.resolve(a(r.parse(d))))}removeNotificationHandler(r){this._notificationHandlers.delete(r)}}function mergeCapabilities(r,a){return Object.entries(a).reduce((r,[a,d])=>(r[a]=d&&"object"==typeof d&&r[a]?{...r[a],...d}:d,r),{...r})}},"./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js":function(r,a,d){"use strict";d.r(a),d.d(a,{UriTemplate:function(){return UriTemplate}});const h=1e6,g=1e6;class UriTemplate{static isTemplate(r){return/\{[^}\s]+\}/.test(r)}static validateLength(r,a,d){if(r.length>a)throw new Error(`${d} exceeds maximum length of ${a} characters (got ${r.length})`)}get variableNames(){return this.parts.flatMap(r=>"string"==typeof r?[]:r.names)}constructor(r){UriTemplate.validateLength(r,h,"Template"),this.template=r,this.parts=this.parse(r)}toString(){return this.template}parse(r){const a=[];let d="",h=0,y=0;for(;h<r.length;)if("{"===r[h]){d&&(a.push(d),d="");const _=r.indexOf("}",h);if(-1===_)throw new Error("Unclosed template expression");if(y++,y>1e4)throw new Error("Template contains too many expressions (max 10000)");const b=r.slice(h+1,_),P=this.getOperator(b),j=b.includes("*"),Z=this.getNames(b),D=Z[0];for(const r of Z)UriTemplate.validateLength(r,g,"Variable name");a.push({name:D,operator:P,names:Z,exploded:j}),h=_+1}else d+=r[h],h++;return d&&a.push(d),a}getOperator(r){return["+","#",".","/","?","&"].find(a=>r.startsWith(a))||""}getNames(r){const a=this.getOperator(r);return r.slice(a.length).split(",").map(r=>r.replace("*","").trim()).filter(r=>r.length>0)}encodeValue(r,a){return UriTemplate.validateLength(r,g,"Variable value"),"+"===a||"#"===a?encodeURI(r):encodeURIComponent(r)}expandPart(r,a){if("?"===r.operator||"&"===r.operator){const d=r.names.map(d=>{const h=a[d];if(void 0===h)return"";return`${d}=${Array.isArray(h)?h.map(a=>this.encodeValue(a,r.operator)).join(","):this.encodeValue(h.toString(),r.operator)}`}).filter(r=>r.length>0);if(0===d.length)return"";return("?"===r.operator?"?":"&")+d.join("&")}if(r.names.length>1){const d=r.names.map(r=>a[r]).filter(r=>void 0!==r);return 0===d.length?"":d.map(r=>Array.isArray(r)?r[0]:r).join(",")}const d=a[r.name];if(void 0===d)return"";const h=(Array.isArray(d)?d:[d]).map(a=>this.encodeValue(a,r.operator));switch(r.operator){case"":case"+":default:return h.join(",");case"#":return"#"+h.join(",");case".":return"."+h.join(".");case"/":return"/"+h.join("/")}}expand(r){let a="",d=!1;for(const h of this.parts){if("string"==typeof h){a+=h;continue}const g=this.expandPart(h,r);g&&("?"!==h.operator&&"&"!==h.operator||!d?a+=g:a+=g.replace("?","&"),"?"!==h.operator&&"&"!==h.operator||(d=!0))}return a}escapeRegExp(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp(r){const a=[];for(const a of r.names)UriTemplate.validateLength(a,g,"Variable name");if("?"===r.operator||"&"===r.operator){for(let d=0;d<r.names.length;d++){const h=r.names[d],g=0===d?"\\"+r.operator:"&";a.push({pattern:g+this.escapeRegExp(h)+"=([^&]+)",name:h})}return a}let d;const h=r.name;switch(r.operator){case"":d=r.exploded?"([^/]+(?:,[^/]+)*)":"([^/,]+)";break;case"+":case"#":d="(.+)";break;case".":d="\\.([^/,]+)";break;case"/":d="/"+(r.exploded?"([^/]+(?:,[^/]+)*)":"([^/,]+)");break;default:d="([^/]+)"}return a.push({pattern:d,name:h}),a}match(r){UriTemplate.validateLength(r,h,"URI");let a="^";const d=[];for(const r of this.parts)if("string"==typeof r)a+=this.escapeRegExp(r);else{const h=this.partToRegExp(r);for(const{pattern:g,name:y}of h)a+=g,d.push({name:y,exploded:r.exploded})}a+="$",UriTemplate.validateLength(a,1e6,"Generated regex pattern");const g=new RegExp(a),y=r.match(g);if(!y)return null;const _={};for(let r=0;r<d.length;r++){const{name:a,exploded:h}=d[r],g=y[r+1],b=a.replace("*","");h&&g.includes(",")?_[b]=g.split(","):_[b]=g}return _}}},"./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js":function(r,a,d){"use strict";d.r(a),d.d(a,{AudioContentSchema:function(){return kt},BaseMetadataSchema:function(){return ze},BlobResourceContentsSchema:function(){return rt},BooleanSchemaSchema:function(){return Kt},CallToolRequestSchema:function(){return Dt},CallToolResultSchema:function(){return Zt},CancelledNotificationSchema:function(){return G},ClientCapabilitiesSchema:function(){return Ue},ClientNotificationSchema:function(){return dr},ClientRequestSchema:function(){return ir},ClientResultSchema:function(){return cr},CompatibilityCallToolResultSchema:function(){return Ot},CompleteRequestSchema:function(){return tr},CompleteResultSchema:function(){return rr},ContentBlockSchema:function(){return jt},CreateMessageRequestSchema:function(){return qt},CreateMessageResultSchema:function(){return Vt},CursorSchema:function(){return j},DEFAULT_NEGOTIATED_PROTOCOL_VERSION:function(){return y},ElicitRequestSchema:function(){return Jt},ElicitResultSchema:function(){return Wt},EmbeddedResourceSchema:function(){return wt},EmptyResultSchema:function(){return B},EnumSchemaSchema:function(){return Gt},ErrorCode:function(){return V},GetPromptRequestSchema:function(){return _t},GetPromptResultSchema:function(){return Et},ImageContentSchema:function(){return Pt},ImplementationSchema:function(){return Fe},InitializeRequestSchema:function(){return qe},InitializeResultSchema:function(){return Ke},InitializedNotificationSchema:function(){return He},JSONRPCErrorSchema:function(){return K},JSONRPCMessageSchema:function(){return H},JSONRPCNotificationSchema:function(){return U},JSONRPCRequestSchema:function(){return M},JSONRPCResponseSchema:function(){return q},JSONRPC_VERSION:function(){return b},LATEST_PROTOCOL_VERSION:function(){return g},ListPromptsRequestSchema:function(){return vt},ListPromptsResultSchema:function(){return yt},ListResourceTemplatesRequestSchema:function(){return it},ListResourceTemplatesResultSchema:function(){return dt},ListResourcesRequestSchema:function(){return nt},ListResourcesResultSchema:function(){return ot},ListRootsRequestSchema:function(){return ar},ListRootsResultSchema:function(){return nr},ListToolsRequestSchema:function(){return Rt},ListToolsResultSchema:function(){return At},LoggingLevelSchema:function(){return $t},LoggingMessageNotificationSchema:function(){return Lt},McpError:function(){return McpError},ModelHintSchema:function(){return Ft},ModelPreferencesSchema:function(){return Mt},NotificationSchema:function(){return z},NumberSchemaSchema:function(){return Bt},PaginatedRequestSchema:function(){return We},PaginatedResultSchema:function(){return Ye},PingRequestSchema:function(){return Be},PrimitiveSchemaDefinitionSchema:function(){return Qt},ProgressNotificationSchema:function(){return Je},ProgressSchema:function(){return Qe},ProgressTokenSchema:function(){return P},PromptArgumentSchema:function(){return ft},PromptListChangedNotificationSchema:function(){return It},PromptMessageSchema:function(){return St},PromptReferenceSchema:function(){return er},PromptSchema:function(){return gt},ReadResourceRequestSchema:function(){return ct},ReadResourceResultSchema:function(){return ut},RequestIdSchema:function(){return F},RequestSchema:function(){return N},ResourceContentsSchema:function(){return Xe},ResourceLinkSchema:function(){return xt},ResourceListChangedNotificationSchema:function(){return lt},ResourceReferenceSchema:function(){return Xt},ResourceSchema:function(){return st},ResourceTemplateReferenceSchema:function(){return Yt},ResourceTemplateSchema:function(){return at},ResourceUpdatedNotificationSchema:function(){return ht},ResultSchema:function(){return L},RootSchema:function(){return sr},RootsListChangedNotificationSchema:function(){return or},SUPPORTED_PROTOCOL_VERSIONS:function(){return _},SamplingMessageSchema:function(){return Ut},ServerCapabilitiesSchema:function(){return Ve},ServerNotificationSchema:function(){return lr},ServerRequestSchema:function(){return ur},ServerResultSchema:function(){return pr},SetLevelRequestSchema:function(){return zt},StringSchemaSchema:function(){return Ht},SubscribeRequestSchema:function(){return pt},TextContentSchema:function(){return bt},TextResourceContentsSchema:function(){return et},ToolAnnotationsSchema:function(){return Tt},ToolListChangedNotificationSchema:function(){return Nt},ToolSchema:function(){return Ct},UnsubscribeRequestSchema:function(){return mt},isInitializeRequest:function(){return isInitializeRequest},isInitializedNotification:function(){return isInitializedNotification},isJSONRPCError:function(){return isJSONRPCError},isJSONRPCNotification:function(){return isJSONRPCNotification},isJSONRPCRequest:function(){return isJSONRPCRequest},isJSONRPCResponse:function(){return isJSONRPCResponse}});var h=d("./packages/node_modules/zod/v3/types.js");const g="2025-06-18",y="2025-03-26",_=[g,"2025-03-26","2024-11-05","2024-10-07"],b="2.0",P=h.union([h.string(),h.number().int()]),j=h.string(),Z=h.object({progressToken:h.optional(P)}).passthrough(),D=h.object({_meta:h.optional(Z)}).passthrough(),N=h.object({method:h.string(),params:h.optional(D)}),$=h.object({_meta:h.optional(h.object({}).passthrough())}).passthrough(),z=h.object({method:h.string(),params:h.optional($)}),L=h.object({_meta:h.optional(h.object({}).passthrough())}).passthrough(),F=h.union([h.string(),h.number().int()]),M=h.object({jsonrpc:h.literal(b),id:F}).merge(N).strict(),isJSONRPCRequest=r=>M.safeParse(r).success,U=h.object({jsonrpc:h.literal(b)}).merge(z).strict(),isJSONRPCNotification=r=>U.safeParse(r).success,q=h.object({jsonrpc:h.literal(b),id:F,result:L}).strict(),isJSONRPCResponse=r=>q.safeParse(r).success;var V;!function(r){r[r.ConnectionClosed=-32e3]="ConnectionClosed",r[r.RequestTimeout=-32001]="RequestTimeout",r[r.ParseError=-32700]="ParseError",r[r.InvalidRequest=-32600]="InvalidRequest",r[r.MethodNotFound=-32601]="MethodNotFound",r[r.InvalidParams=-32602]="InvalidParams",r[r.InternalError=-32603]="InternalError"}(V||(V={}));const K=h.object({jsonrpc:h.literal(b),id:F,error:h.object({code:h.number().int(),message:h.string(),data:h.optional(h.unknown())})}).strict(),isJSONRPCError=r=>K.safeParse(r).success,H=h.union([M,U,q,K]),B=L.strict(),G=z.extend({method:h.literal("notifications/cancelled"),params:$.extend({requestId:F,reason:h.string().optional()})}),ze=h.object({name:h.string(),title:h.optional(h.string())}).passthrough(),Fe=ze.extend({version:h.string()}),Ue=h.object({experimental:h.optional(h.object({}).passthrough()),sampling:h.optional(h.object({}).passthrough()),elicitation:h.optional(h.object({}).passthrough()),roots:h.optional(h.object({listChanged:h.optional(h.boolean())}).passthrough())}).passthrough(),qe=N.extend({method:h.literal("initialize"),params:D.extend({protocolVersion:h.string(),capabilities:Ue,clientInfo:Fe})}),isInitializeRequest=r=>qe.safeParse(r).success,Ve=h.object({experimental:h.optional(h.object({}).passthrough()),logging:h.optional(h.object({}).passthrough()),completions:h.optional(h.object({}).passthrough()),prompts:h.optional(h.object({listChanged:h.optional(h.boolean())}).passthrough()),resources:h.optional(h.object({subscribe:h.optional(h.boolean()),listChanged:h.optional(h.boolean())}).passthrough()),tools:h.optional(h.object({listChanged:h.optional(h.boolean())}).passthrough())}).passthrough(),Ke=L.extend({protocolVersion:h.string(),capabilities:Ve,serverInfo:Fe,instructions:h.optional(h.string())}),He=z.extend({method:h.literal("notifications/initialized")}),isInitializedNotification=r=>He.safeParse(r).success,Be=N.extend({method:h.literal("ping")}),Qe=h.object({progress:h.number(),total:h.optional(h.number()),message:h.optional(h.string())}).passthrough(),Je=z.extend({method:h.literal("notifications/progress"),params:$.merge(Qe).extend({progressToken:P})}),We=N.extend({params:D.extend({cursor:h.optional(j)}).optional()}),Ye=L.extend({nextCursor:h.optional(j)}),Xe=h.object({uri:h.string(),mimeType:h.optional(h.string()),_meta:h.optional(h.object({}).passthrough())}).passthrough(),et=Xe.extend({text:h.string()}),tt=h.string().refine(r=>{try{return atob(r),!0}catch(r){return!1}},{message:"Invalid Base64 string"}),rt=Xe.extend({blob:tt}),st=ze.extend({uri:h.string(),description:h.optional(h.string()),mimeType:h.optional(h.string()),_meta:h.optional(h.object({}).passthrough())}),at=ze.extend({uriTemplate:h.string(),description:h.optional(h.string()),mimeType:h.optional(h.string()),_meta:h.optional(h.object({}).passthrough())}),nt=We.extend({method:h.literal("resources/list")}),ot=Ye.extend({resources:h.array(st)}),it=We.extend({method:h.literal("resources/templates/list")}),dt=Ye.extend({resourceTemplates:h.array(at)}),ct=N.extend({method:h.literal("resources/read"),params:D.extend({uri:h.string()})}),ut=L.extend({contents:h.array(h.union([et,rt]))}),lt=z.extend({method:h.literal("notifications/resources/list_changed")}),pt=N.extend({method:h.literal("resources/subscribe"),params:D.extend({uri:h.string()})}),mt=N.extend({method:h.literal("resources/unsubscribe"),params:D.extend({uri:h.string()})}),ht=z.extend({method:h.literal("notifications/resources/updated"),params:$.extend({uri:h.string()})}),ft=h.object({name:h.string(),description:h.optional(h.string()),required:h.optional(h.boolean())}).passthrough(),gt=ze.extend({description:h.optional(h.string()),arguments:h.optional(h.array(ft)),_meta:h.optional(h.object({}).passthrough())}),vt=We.extend({method:h.literal("prompts/list")}),yt=Ye.extend({prompts:h.array(gt)}),_t=N.extend({method:h.literal("prompts/get"),params:D.extend({name:h.string(),arguments:h.optional(h.record(h.string()))})}),bt=h.object({type:h.literal("text"),text:h.string(),_meta:h.optional(h.object({}).passthrough())}).passthrough(),Pt=h.object({type:h.literal("image"),data:tt,mimeType:h.string(),_meta:h.optional(h.object({}).passthrough())}).passthrough(),kt=h.object({type:h.literal("audio"),data:tt,mimeType:h.string(),_meta:h.optional(h.object({}).passthrough())}).passthrough(),wt=h.object({type:h.literal("resource"),resource:h.union([et,rt]),_meta:h.optional(h.object({}).passthrough())}).passthrough(),xt=st.extend({type:h.literal("resource_link")}),jt=h.union([bt,Pt,kt,xt,wt]),St=h.object({role:h.enum(["user","assistant"]),content:jt}).passthrough(),Et=L.extend({description:h.optional(h.string()),messages:h.array(St)}),It=z.extend({method:h.literal("notifications/prompts/list_changed")}),Tt=h.object({title:h.optional(h.string()),readOnlyHint:h.optional(h.boolean()),destructiveHint:h.optional(h.boolean()),idempotentHint:h.optional(h.boolean()),openWorldHint:h.optional(h.boolean())}).passthrough(),Ct=ze.extend({description:h.optional(h.string()),inputSchema:h.object({type:h.literal("object"),properties:h.optional(h.object({}).passthrough()),required:h.optional(h.array(h.string()))}).passthrough(),outputSchema:h.optional(h.object({type:h.literal("object"),properties:h.optional(h.object({}).passthrough()),required:h.optional(h.array(h.string()))}).passthrough()),annotations:h.optional(Tt),_meta:h.optional(h.object({}).passthrough())}),Rt=We.extend({method:h.literal("tools/list")}),At=Ye.extend({tools:h.array(Ct)}),Zt=L.extend({content:h.array(jt).default([]),structuredContent:h.object({}).passthrough().optional(),isError:h.optional(h.boolean())}),Ot=Zt.or(L.extend({toolResult:h.unknown()})),Dt=N.extend({method:h.literal("tools/call"),params:D.extend({name:h.string(),arguments:h.optional(h.record(h.unknown()))})}),Nt=z.extend({method:h.literal("notifications/tools/list_changed")}),$t=h.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),zt=N.extend({method:h.literal("logging/setLevel"),params:D.extend({level:$t})}),Lt=z.extend({method:h.literal("notifications/message"),params:$.extend({level:$t,logger:h.optional(h.string()),data:h.unknown()})}),Ft=h.object({name:h.string().optional()}).passthrough(),Mt=h.object({hints:h.optional(h.array(Ft)),costPriority:h.optional(h.number().min(0).max(1)),speedPriority:h.optional(h.number().min(0).max(1)),intelligencePriority:h.optional(h.number().min(0).max(1))}).passthrough(),Ut=h.object({role:h.enum(["user","assistant"]),content:h.union([bt,Pt,kt])}).passthrough(),qt=N.extend({method:h.literal("sampling/createMessage"),params:D.extend({messages:h.array(Ut),systemPrompt:h.optional(h.string()),includeContext:h.optional(h.enum(["none","thisServer","allServers"])),temperature:h.optional(h.number()),maxTokens:h.number().int(),stopSequences:h.optional(h.array(h.string())),metadata:h.optional(h.object({}).passthrough()),modelPreferences:h.optional(Mt)})}),Vt=L.extend({model:h.string(),stopReason:h.optional(h.enum(["endTurn","stopSequence","maxTokens"]).or(h.string())),role:h.enum(["user","assistant"]),content:h.discriminatedUnion("type",[bt,Pt,kt])}),Kt=h.object({type:h.literal("boolean"),title:h.optional(h.string()),description:h.optional(h.string()),default:h.optional(h.boolean())}).passthrough(),Ht=h.object({type:h.literal("string"),title:h.optional(h.string()),description:h.optional(h.string()),minLength:h.optional(h.number()),maxLength:h.optional(h.number()),format:h.optional(h.enum(["email","uri","date","date-time"]))}).passthrough(),Bt=h.object({type:h.enum(["number","integer"]),title:h.optional(h.string()),description:h.optional(h.string()),minimum:h.optional(h.number()),maximum:h.optional(h.number())}).passthrough(),Gt=h.object({type:h.literal("string"),title:h.optional(h.string()),description:h.optional(h.string()),enum:h.array(h.string()),enumNames:h.optional(h.array(h.string()))}).passthrough(),Qt=h.union([Kt,Ht,Bt,Gt]),Jt=N.extend({method:h.literal("elicitation/create"),params:D.extend({message:h.string(),requestedSchema:h.object({type:h.literal("object"),properties:h.record(h.string(),Qt),required:h.optional(h.array(h.string()))}).passthrough()})}),Wt=L.extend({action:h.enum(["accept","decline","cancel"]),content:h.optional(h.record(h.string(),h.unknown()))}),Yt=h.object({type:h.literal("ref/resource"),uri:h.string()}).passthrough(),Xt=Yt,er=h.object({type:h.literal("ref/prompt"),name:h.string()}).passthrough(),tr=N.extend({method:h.literal("completion/complete"),params:D.extend({ref:h.union([er,Yt]),argument:h.object({name:h.string(),value:h.string()}).passthrough(),context:h.optional(h.object({arguments:h.optional(h.record(h.string(),h.string()))}))})}),rr=L.extend({completion:h.object({values:h.array(h.string()).max(100),total:h.optional(h.number().int()),hasMore:h.optional(h.boolean())}).passthrough()}),sr=h.object({uri:h.string().startsWith("file://"),name:h.optional(h.string()),_meta:h.optional(h.object({}).passthrough())}).passthrough(),ar=N.extend({method:h.literal("roots/list")}),nr=L.extend({roots:h.array(sr)}),or=z.extend({method:h.literal("notifications/roots/list_changed")}),ir=h.union([Be,qe,tr,zt,_t,vt,nt,it,ct,pt,mt,Dt,Rt]),dr=h.union([G,Je,He,or]),cr=h.union([B,Vt,Wt,nr]),ur=h.union([Be,qt,Jt,ar]),lr=h.union([G,Je,Lt,ht,lt,Nt,It]),pr=h.union([B,Ke,rr,Et,yt,ot,dt,ut,Zt,At]);class McpError extends Error{constructor(r,a,d){super(`MCP error ${r}: ${a}`),this.code=r,this.data=d,this.name="McpError"}}},"./packages/packages/libs/editor-mcp/src/init.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{getSDK:function(){return getSDK},init:function(){return init},startMCPServer:function(){return startMCPServer}});var h=d("@elementor/editor-v1-adapters"),g=d("./packages/packages/libs/editor-mcp/node_modules/@elementor-external/angie-sdk/dist/index.js"),y=d("./packages/packages/libs/editor-mcp/src/mcp-registry.ts");let _;const getSDK=()=>globalThis.__ELEMENTOR_MCP_DISABLED__?{}:(_||(_=new g.AngieMcpSdk),_);function init(){return(0,h.isExperimentActive)("editor_mcp")?getSDK().waitForReady():Promise.resolve()}function startMCPServer(){return(0,h.isExperimentActive)("editor_mcp")?getSDK().waitForReady().then(()=>(0,y.activateMcpRegistration)(_)):Promise.resolve()}document.addEventListener("DOMContentLoaded",()=>{startMCPServer()},{once:!0})},"./packages/packages/libs/editor-mcp/src/mcp-registry.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{activateMcpRegistration:function(){return activateMcpRegistration},getMCPByDomain:function(){return getMCPByDomain},registerMcp:function(){return registerMcp}});var h=d("./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js"),g=d("./packages/packages/libs/editor-mcp/src/test-utils/mock-mcp-registry.ts");const y={},_={};let b=void 0!==globalThis.jest;const registerMcp=(r,a)=>{if(b)throw new Error("MCP Registration is already activated. Cannot register new MCP servers.");const d=isAlphabet(a);y[d]=r};async function activateMcpRegistration(r){if(b)return;b=!0;const a=Object.entries(y);for await(const d of a){const[a,h]=d;await r.registerServer({name:`editor-${a}`,server:h,version:"1.0.0",description:_[a]||a})}}const isAlphabet=r=>{if(!(!!r&&/^[a-z_]+$/.test(r)))throw new Error("Not alphabet");return r},getMCPByDomain=(r,a)=>{const d=`editor-${isAlphabet(r)}`;if(void 0!==globalThis.jest)return(0,g.mockMcpRegistry)();y[r]||(y[r]=new h.McpServer({name:d,version:"1.0.0"},{instructions:a?.instructions}));const P=y[r],{addTool:j}=function createToolRegistrator(r){function addTool(a){const d=a.outputSchema,h=a.schema?a.schema:{};if(b)throw new Error("MCP Registration is already activated. Cannot add new tools.");const toolCallback=async function(r,d){try{const h=await a.handler(a.schema?r:{},d);return{structuredContent:"string"==typeof h?void 0:h,content:[{type:"text",text:"string"==typeof h?h:JSON.stringify(h)},...a.resourceList||[]]}}catch(r){return{isError:!0,content:[{type:"text",text:r.message||"Unknown error"}]}}};r.registerTool(a.name,{description:a.description,inputSchema:h,outputSchema:d,title:a.name,annotations:{destructiveHint:a.isDestrcutive,readOnlyHint:!a.isDestrcutive&&void 0,title:a.name}},toolCallback)}return{addTool:addTool}}(P);return{mcpServer:P,addTool:j,setMCPDescription:a=>{_[r]=a},getActiveChatInfo:()=>{const r=localStorage.getItem("angie_active_chat_id");if(!r)return{expiresAt:0,sessionId:""};const a=JSON.parse(r);return{expiresAt:a.expiresAt,sessionId:a.sessionId}}}}},"./packages/packages/libs/editor-mcp/src/sampler.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{createSampler:function(){return createSampler}});var h=d("./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");const g={maxTokens:1e4,modelPreferences:"openai",model:"gpt-4o"},y={type:"object",properties:{content:{type:"string",description:"Result"}},required:["content"],additionalProperties:!1},createSampler=(r,a=g)=>{const{maxTokens:d=1e3,modelPreferences:_="openai",model:b="gpt-4o"}=a;return async a=>{const g={...a.systemPrompt?{systemPrompt:a.systemPrompt}:{}},P=await r.sendRequest({method:"sampling/createMessage",params:{maxTokens:d,modelPreferences:{hints:[{name:_}]},metadata:{model:b,...g,structured_output:a.structuredOutput||y},messages:a.messages}},h.SamplingMessageSchema);try{return JSON.parse(P.content.text)}catch{return P.content}}}},"./packages/packages/libs/editor-mcp/src/test-utils/mock-mcp-registry.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{mockMcpRegistry:function(){return mockMcpRegistry}});const h=new Proxy({},{get:()=>function mockedFn(...r){}}),mockMcpRegistry=()=>({addTool:()=>{},setMCPDescription:()=>{},getActiveChatInfo(){return{sessionId:"mock-session-id",expiresAt:Date.now()+36e5}},mcpServer:h})},"./packages/packages/libs/editor-mcp/src/utils/prompt-builder.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{toolPrompts:function(){return toolPrompts}});class ToolPrompts{_description="";_parameters={};_examples=[];_furtherInstructions=[];constructor(r){this.name=r}description(r){return void 0===r?this._description:(this._description=r,this)}parameter(r,a){return void 0===a?this._parameters[r]:(this._parameters[r]=`**${r}**:\n${a}`,this)}instruction(r){return this._furtherInstructions.push(r),this}example(r){return this._examples.push(r),this}get examples(){return this._examples.join("\n\n")}prompt(){return`# ${this.name}\n# Description\n${this._description}\n\n${this._parameters.length?"# Parameters":""}\n${Object.values(this._parameters).join("\n\n")}\n\n${this._examples.length?"# Examples":""}\n${this.examples}\n\n${this._furtherInstructions.length?"# Further Instructions":""}\n${this._furtherInstructions.join("\n\n")}\n`.trim()}}const toolPrompts=r=>new ToolPrompts(r)},"@elementor/editor-v1-adapters":function(r){"use strict";r.exports=window.elementorV2.editorV1Adapters}},a={};function __webpack_require__(d){var h=a[d];if(void 0!==h)return h.exports;var g=a[d]={exports:{}};return r[d].call(g.exports,g,g.exports,__webpack_require__),g.exports}__webpack_require__.n=function(r){var a=r&&r.__esModule?function(){return r.default}:function(){return r};return __webpack_require__.d(a,{a:a}),a},__webpack_require__.d=function(r,a){for(var d in a)__webpack_require__.o(a,d)&&!__webpack_require__.o(r,d)&&Object.defineProperty(r,d,{enumerable:!0,get:a[d]})},__webpack_require__.o=function(r,a){return Object.prototype.hasOwnProperty.call(r,a)},__webpack_require__.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var d={};!function(){"use strict";__webpack_require__.r(d),__webpack_require__.d(d,{McpServer:function(){return a.McpServer},ResourceTemplate:function(){return a.ResourceTemplate},SamplingMessageSchema:function(){return h.SamplingMessageSchema},activateMcpRegistration:function(){return g.activateMcpRegistration},createSampler:function(){return y.createSampler},getAngieSdk:function(){return getAngieSdk},getMCPByDomain:function(){return g.getMCPByDomain},init:function(){return r.init},registerMcp:function(){return g.registerMcp},toolPrompts:function(){return _.toolPrompts}});var r=__webpack_require__("./packages/packages/libs/editor-mcp/src/init.ts"),a=__webpack_require__("./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js"),h=__webpack_require__("./packages/packages/libs/editor-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),g=__webpack_require__("./packages/packages/libs/editor-mcp/src/mcp-registry.ts"),y=__webpack_require__("./packages/packages/libs/editor-mcp/src/sampler.ts"),_=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/prompt-builder.ts");const getAngieSdk=()=>(0,r.getSDK)()}(),(window.elementorV2=window.elementorV2||{}).editorMcp=d}(),window.elementorV2.editorMcp?.init?.();
//# sourceMappingURL=editor-mcp.js.map