/*! For license information please see editor-mcp.js.LICENSE.txt */ !function(){var t={"./packages/node_modules/@elementor-external/angie-sdk/dist/index.js":function(t,o,c){"use strict";var h,g,b,P;c.r(o),c.d(o,{AngieDetector:function(){return r},AngieMcpSdk:function(){return ws},ClientManager:function(){return i},RegistrationQueue:function(){return n}}),function(t){t.POST_MESSAGE="postMessage"}(h||(h={})),function(t){t.SDK_ANGIE_READY_PING="sdk-angie-ready-ping",t.SDK_REQUEST_CLIENT_CREATION="sdk-request-client-creation",t.SDK_REQUEST_INIT_SERVER="sdk-request-init-server"}(g||(g={}));class r{isAngieReady=!1;readyPromise;readyResolve;constructor(){if(this.readyPromise=new Promise(t=>{this.readyResolve=t}),"undefined"==typeof window)return;let t=0;const s=()=>{if(this.isAngieReady||t>=500)return void(!this.isAngieReady&&t>=500&&this.handleDetectionTimeout());const o=new MessageChannel;o.port1.onmessage=t=>{this.handleAngieReady(t.data),o.port1.close(),o.port2.close()};const c={type:g.SDK_ANGIE_READY_PING,timestamp:Date.now()};window.postMessage(c,window.location.origin,[o.port2]),t++,setTimeout(s,500)};s()}handleAngieReady(t){this.isAngieReady=!0;const o={isReady:!0,version:t.version,capabilities:t.capabilities};this.readyResolve&&this.readyResolve(o)}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 n{queue=[];isProcessing=!1;add(t){const o={id:this.generateId(t),config:t,timestamp:Date.now(),status:"pending"};return this.queue.push(o),console.log(`RegistrationQueue: Added server "${t.name}" to queue`),o}getAll(){return[...this.queue]}getPending(){return this.queue.filter(t=>"pending"===t.status)}updateStatus(t,o,c){const h=this.queue.find(o=>o.id===t);h&&(h.status=o,c&&(h.error=c),console.log(`RegistrationQueue: Updated server ${t} status to ${o}`))}async processQueue(t){if(this.isProcessing)return void console.log("RegistrationQueue: Already processing queue");this.isProcessing=!0;const o=this.getPending();console.log(`RegistrationQueue: Processing ${o.length} pending registrations`);try{for(const c of o)try{await t(c),this.updateStatus(c.id,"registered")}catch(t){const o=t instanceof Error?t.message:String(t);this.updateStatus(c.id,"failed",o),console.error(`RegistrationQueue: Failed to process registration ${c.id}:`,o)}}finally{this.isProcessing=!1}}clear(){this.queue=[],console.log("RegistrationQueue: Cleared all registrations")}remove(t){const o=this.queue.findIndex(o=>o.id===t);return-1!==o&&(this.queue.splice(o,1),console.log(`RegistrationQueue: Removed registration ${t}`),!0)}generateId(t){return`reg_${t.name}_${t.version}_${Date.now()}`}}class i{async requestClientCreation(t){const{config:o}=t,c={serverId:t.id,serverName:o.name,serverVersion:o.version,description:o.description,transport:h.POST_MESSAGE,capabilities:o.capabilities};return new Promise((t,o)=>{const h=new MessageChannel,b=setTimeout(()=>{o(new Error("Client creation request timed out after 10000ms"))},1e4);h.port1.onmessage=o=>{clearTimeout(b),t(o.data)};const P={type:g.SDK_REQUEST_CLIENT_CREATION,payload:c,timestamp:Date.now()};window.postMessage(P,window.location.origin,[h.port2])})}}!function(t){t.assertEqual=t=>{},t.assertIs=function(t){},t.assertNever=function(t){throw new Error},t.arrayToEnum=t=>{const o={};for(const c of t)o[c]=c;return o},t.getValidEnumValues=o=>{const c=t.objectKeys(o).filter(t=>"number"!=typeof o[o[t]]),h={};for(const t of c)h[t]=o[t];return t.objectValues(h)},t.objectValues=o=>t.objectKeys(o).map(function(t){return o[t]}),t.objectKeys="function"==typeof Object.keys?t=>Object.keys(t):t=>{const o=[];for(const c in t)Object.prototype.hasOwnProperty.call(t,c)&&o.push(c);return o},t.find=(t,o)=>{for(const c of t)if(o(c))return c},t.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&Number.isFinite(t)&&Math.floor(t)===t,t.joinValues=function(t,o=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(o)},t.jsonStringifyReplacer=(t,o)=>"bigint"==typeof o?o.toString():o}(b||(b={})),function(t){t.mergeShapes=(t,o)=>({...t,...o})}(P||(P={}));const j=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),d=t=>{switch(typeof t){case"undefined":return j.undefined;case"string":return j.string;case"number":return Number.isNaN(t)?j.nan:j.number;case"boolean":return j.boolean;case"function":return j.function;case"bigint":return j.bigint;case"symbol":return j.symbol;case"object":return Array.isArray(t)?j.array:null===t?j.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?j.promise:"undefined"!=typeof Map&&t instanceof Map?j.map:"undefined"!=typeof Set&&t instanceof Set?j.set:"undefined"!=typeof Date&&t instanceof Date?j.date:j.object;default:return j.unknown}},E=b.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 u extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=t=>{this.issues=[...this.issues,t]},this.addIssues=(t=[])=>{this.issues=[...this.issues,...t]};const o=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,o):this.__proto__=o,this.name="ZodError",this.issues=t}format(t){const o=t||function(t){return t.message},c={_errors:[]},a=t=>{for(const h of t.issues)if("invalid_union"===h.code)h.unionErrors.map(a);else if("invalid_return_type"===h.code)a(h.returnTypeError);else if("invalid_arguments"===h.code)a(h.argumentsError);else if(0===h.path.length)c._errors.push(o(h));else{let t=c,g=0;for(;gt.message){const o={},c=[];for(const h of this.issues)h.path.length>0?(o[h.path[0]]=o[h.path[0]]||[],o[h.path[0]].push(t(h))):c.push(t(h));return{formErrors:c,fieldErrors:o}}get formErrors(){return this.flatten()}}u.create=t=>new u(t);const l=(t,o)=>{let c;switch(t.code){case E.invalid_type:c=t.received===j.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case E.invalid_literal:c=`Invalid literal value, expected ${JSON.stringify(t.expected,b.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:c=`Unrecognized key(s) in object: ${b.joinValues(t.keys,", ")}`;break;case E.invalid_union:c="Invalid input";break;case E.invalid_union_discriminator:c=`Invalid discriminator value. Expected ${b.joinValues(t.options)}`;break;case E.invalid_enum_value:c=`Invalid enum value. Expected ${b.joinValues(t.options)}, received '${t.received}'`;break;case E.invalid_arguments:c="Invalid function arguments";break;case E.invalid_return_type:c="Invalid function return type";break;case E.invalid_date:c="Invalid date";break;case E.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(c=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(c=`${c} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?c=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?c=`Invalid input: must end with "${t.validation.endsWith}"`:b.assertNever(t.validation):c="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case E.too_small:c="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case E.too_big:c="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case E.custom:c="Invalid input";break;case E.invalid_intersection_types:c="Intersection results could not be merged";break;case E.not_multiple_of:c=`Number must be a multiple of ${t.multipleOf}`;break;case E.not_finite:c="Number must be finite";break;default:c=o.defaultError,b.assertNever(t)}return{message:c}};let C=l;function p(t,o){const c=C,h=(t=>{const{data:o,path:c,errorMaps:h,issueData:g}=t,b=[...c,...g.path||[]],P={...g,path:b};if(void 0!==g.message)return{...g,path:b,message:g.message};let j="";const E=h.filter(t=>!!t).slice().reverse();for(const t of E)j=t(P,{data:o,defaultError:j}).message;return{...g,path:b,message:j}})({issueData:o,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c,c===l?void 0:l].filter(t=>!!t)});t.common.issues.push(h)}class m{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,o){const c=[];for(const h of o){if("aborted"===h.status)return Z;"dirty"===h.status&&t.dirty(),c.push(h.value)}return{status:t.value,value:c}}static async mergeObjectAsync(t,o){const c=[];for(const t of o){const o=await t.key,h=await t.value;c.push({key:o,value:h})}return m.mergeObjectSync(t,c)}static mergeObjectSync(t,o){const c={};for(const h of o){const{key:o,value:g}=h;if("aborted"===o.status)return Z;if("aborted"===g.status)return Z;"dirty"===o.status&&t.dirty(),"dirty"===g.status&&t.dirty(),"__proto__"===o.value||void 0===g.value&&!h.alwaysSet||(c[o.value]=g.value)}return{status:t.value,value:c}}}const Z=Object.freeze({status:"aborted"}),f=t=>({status:"dirty",value:t}),y=t=>({status:"valid",value:t}),_=t=>"aborted"===t.status,v=t=>"dirty"===t.status,x=t=>"valid"===t.status,k=t=>"undefined"!=typeof Promise&&t instanceof Promise;var R;!function(t){t.errToObj=t=>"string"==typeof t?{message:t}:t||{},t.toString=t=>"string"==typeof t?t:t?.message}(R||(R={}));class w{constructor(t,o,c,h){this._cachedPath=[],this.parent=t,this.data=o,this._path=c,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 S=(t,o)=>{if(x(o))return{success:!0,data:o.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const o=new u(t.common.issues);return this._error=o,this._error}}};function T(t){if(!t)return{};const{errorMap:o,invalid_type_error:c,required_error:h,description:g}=t;if(o&&(c||h))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return o?{errorMap:o,description:g}:{errorMap:(o,g)=>{const{message:b}=t;return"invalid_enum_value"===o.code?{message:b??g.defaultError}:void 0===g.data?{message:b??h??g.defaultError}:"invalid_type"!==o.code?{message:g.defaultError}:{message:b??c??g.defaultError}},description:g}}class A{get description(){return this._def.description}_getType(t){return d(t.data)}_getOrReturnCtx(t,o){return o||{common:t.parent.common,data:t.data,parsedType:d(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new m,ctx:{common:t.parent.common,data:t.data,parsedType:d(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const o=this._parse(t);if(k(o))throw new Error("Synchronous parse encountered promise.");return o}_parseAsync(t){const o=this._parse(t);return Promise.resolve(o)}parse(t,o){const c=this.safeParse(t,o);if(c.success)return c.data;throw c.error}safeParse(t,o){const c={common:{issues:[],async:o?.async??!1,contextualErrorMap:o?.errorMap},path:o?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:d(t)},h=this._parseSync({data:t,path:c.path,parent:c});return S(c,h)}"~validate"(t){const o={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:d(t)};if(!this["~standard"].async)try{const c=this._parseSync({data:t,path:[],parent:o});return x(c)?{value:c.value}:{issues:o.common.issues}}catch(t){t?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),o.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:o}).then(t=>x(t)?{value:t.value}:{issues:o.common.issues})}async parseAsync(t,o){const c=await this.safeParseAsync(t,o);if(c.success)return c.data;throw c.error}async safeParseAsync(t,o){const c={common:{issues:[],contextualErrorMap:o?.errorMap,async:!0},path:o?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:d(t)},h=this._parse({data:t,path:c.path,parent:c}),g=await(k(h)?h:Promise.resolve(h));return S(c,g)}refine(t,o){const s=t=>"string"==typeof o||void 0===o?{message:o}:"function"==typeof o?o(t):o;return this._refinement((o,c)=>{const h=t(o),n=()=>c.addIssue({code:E.custom,...s(o)});return"undefined"!=typeof Promise&&h instanceof Promise?h.then(t=>!!t||(n(),!1)):!!h||(n(),!1)})}refinement(t,o){return this._refinement((c,h)=>!!t(c)||(h.addIssue("function"==typeof o?o(c,h):o),!1))}_refinement(t){return new Te({schema:this,typeName:Le.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Ae.create(this,this._def)}nullable(){return Ce.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return oe.create(this)}promise(){return Se.create(this,this._def)}or(t){return ue.create([this,t],this._def)}and(t){return me.create(this,t,this._def)}transform(t){return new Te({...T(this._def),schema:this,typeName:Le.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const o="function"==typeof t?t:()=>t;return new Re({...T(this._def),innerType:this,defaultValue:o,typeName:Le.ZodDefault})}brand(){return new Ie({typeName:Le.ZodBranded,type:this,...T(this._def)})}catch(t){const o="function"==typeof t?t:()=>t;return new Ze({...T(this._def),innerType:this,catchValue:o,typeName:Le.ZodCatch})}describe(t){return new(0,this.constructor)({...this._def,description:t})}pipe(t){return Ee.create(this,t)}readonly(){return Ne.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const I=/^c[^\s-]{8,}$/i,D=/^[0-9a-z]+$/,O=/^[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-_]*$/,F=/^[-+]?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)?)??$/,L=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let M;const 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])$/,V=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Pe=/^(([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]))$/,je=/^(([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])$/,De=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$e=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ze="((\\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])))",Fe=new RegExp(`^${ze}$`);function U(t){let o="[0-5]\\d";return t.precision?o=`${o}\\.\\d{${t.precision}}`:null==t.precision&&(o=`${o}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${o})${t.precision?"+":"?"}`}function K(t){let o=`${ze}T${U(t)}`;const c=[];return c.push(t.local?"Z?":"Z"),t.offset&&c.push("([+-]\\d{2}:?\\d{2})"),o=`${o}(${c.join("|")})`,new RegExp(`^${o}$`)}function Q(t,o){if(!z.test(t))return!1;try{const[c]=t.split("."),h=c.replace(/-/g,"+").replace(/_/g,"/").padEnd(c.length+(4-c.length%4)%4,"="),g=JSON.parse(atob(h));return!("object"!=typeof g||null===g||"typ"in g&&"JWT"!==g?.typ||!g.alg||o&&g.alg!==o)}catch{return!1}}function B(t,o){return!("v4"!==o&&o||!V.test(t))||!("v6"!==o&&o||!je.test(t))}class W extends A{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==j.string){const o=this._getOrReturnCtx(t);return p(o,{code:E.invalid_type,expected:j.string,received:o.parsedType}),Z}const o=new m;let c;for(const P of this._def.checks)if("min"===P.kind)t.data.lengthP.value&&(c=this._getOrReturnCtx(t,c),p(c,{code:E.too_big,maximum:P.value,type:"string",inclusive:!0,exact:!1,message:P.message}),o.dirty());else if("length"===P.kind){const h=t.data.length>P.value,g=t.data.lengtht.test(o),{validation:o,code:E.invalid_string,...R.errToObj(c)})}_addCheck(t){return new W({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...R.errToObj(t)})}url(t){return this._addCheck({kind:"url",...R.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...R.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...R.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...R.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...R.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...R.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...R.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...R.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...R.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...R.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...R.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...R.errToObj(t)})}datetime(t){return"string"==typeof t?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:void 0===t?.precision?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...R.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return"string"==typeof t?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:void 0===t?.precision?null:t?.precision,...R.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...R.errToObj(t)})}regex(t,o){return this._addCheck({kind:"regex",regex:t,...R.errToObj(o)})}includes(t,o){return this._addCheck({kind:"includes",value:t,position:o?.position,...R.errToObj(o?.message)})}startsWith(t,o){return this._addCheck({kind:"startsWith",value:t,...R.errToObj(o)})}endsWith(t,o){return this._addCheck({kind:"endsWith",value:t,...R.errToObj(o)})}min(t,o){return this._addCheck({kind:"min",value:t,...R.errToObj(o)})}max(t,o){return this._addCheck({kind:"max",value:t,...R.errToObj(o)})}length(t,o){return this._addCheck({kind:"length",value:t,...R.errToObj(o)})}nonempty(t){return this.min(1,R.errToObj(t))}trim(){return new W({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new W({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new W({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>"datetime"===t.kind)}get isDate(){return!!this._def.checks.find(t=>"date"===t.kind)}get isTime(){return!!this._def.checks.find(t=>"time"===t.kind)}get isDuration(){return!!this._def.checks.find(t=>"duration"===t.kind)}get isEmail(){return!!this._def.checks.find(t=>"email"===t.kind)}get isURL(){return!!this._def.checks.find(t=>"url"===t.kind)}get isEmoji(){return!!this._def.checks.find(t=>"emoji"===t.kind)}get isUUID(){return!!this._def.checks.find(t=>"uuid"===t.kind)}get isNANOID(){return!!this._def.checks.find(t=>"nanoid"===t.kind)}get isCUID(){return!!this._def.checks.find(t=>"cuid"===t.kind)}get isCUID2(){return!!this._def.checks.find(t=>"cuid2"===t.kind)}get isULID(){return!!this._def.checks.find(t=>"ulid"===t.kind)}get isIP(){return!!this._def.checks.find(t=>"ip"===t.kind)}get isCIDR(){return!!this._def.checks.find(t=>"cidr"===t.kind)}get isBase64(){return!!this._def.checks.find(t=>"base64"===t.kind)}get isBase64url(){return!!this._def.checks.find(t=>"base64url"===t.kind)}get minLength(){let t=null;for(const o of this._def.checks)"min"===o.kind&&(null===t||o.value>t)&&(t=o.value);return t}get maxLength(){let t=null;for(const o of this._def.checks)"max"===o.kind&&(null===t||o.valueh?c:h;return Number.parseInt(t.toFixed(g).replace(".",""))%Number.parseInt(o.toFixed(g).replace(".",""))/10**g}W.create=t=>new W({checks:[],typeName:Le.ZodString,coerce:t?.coerce??!1,...T(t)});class G extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==j.number){const o=this._getOrReturnCtx(t);return p(o,{code:E.invalid_type,expected:j.number,received:o.parsedType}),Z}let o;const c=new m;for(const h of this._def.checks)"int"===h.kind?b.isInteger(t.data)||(o=this._getOrReturnCtx(t,o),p(o,{code:E.invalid_type,expected:"integer",received:"float",message:h.message}),c.dirty()):"min"===h.kind?(h.inclusive?t.datah.value:t.data>=h.value)&&(o=this._getOrReturnCtx(t,o),p(o,{code:E.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),c.dirty()):"multipleOf"===h.kind?0!==H(t.data,h.value)&&(o=this._getOrReturnCtx(t,o),p(o,{code:E.not_multiple_of,multipleOf:h.value,message:h.message}),c.dirty()):"finite"===h.kind?Number.isFinite(t.data)||(o=this._getOrReturnCtx(t,o),p(o,{code:E.not_finite,message:h.message}),c.dirty()):b.assertNever(h);return{status:c.value,value:t.data}}gte(t,o){return this.setLimit("min",t,!0,R.toString(o))}gt(t,o){return this.setLimit("min",t,!1,R.toString(o))}lte(t,o){return this.setLimit("max",t,!0,R.toString(o))}lt(t,o){return this.setLimit("max",t,!1,R.toString(o))}setLimit(t,o,c,h){return new G({...this._def,checks:[...this._def.checks,{kind:t,value:o,inclusive:c,message:R.toString(h)}]})}_addCheck(t){return new G({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:R.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(t)})}multipleOf(t,o){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(o)})}finite(t){return this._addCheck({kind:"finite",message:R.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.toString(t)})}get minValue(){let t=null;for(const o of this._def.checks)"min"===o.kind&&(null===t||o.value>t)&&(t=o.value);return t}get maxValue(){let t=null;for(const o of this._def.checks)"max"===o.kind&&(null===t||o.value"int"===t.kind||"multipleOf"===t.kind&&b.isInteger(t.value))}get isFinite(){let t=null,o=null;for(const c of this._def.checks){if("finite"===c.kind||"int"===c.kind||"multipleOf"===c.kind)return!0;"min"===c.kind?(null===o||c.value>o)&&(o=c.value):"max"===c.kind&&(null===t||c.valuenew G({checks:[],typeName:Le.ZodNumber,coerce:t?.coerce||!1,...T(t)});class J extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==j.bigint)return this._getInvalidInput(t);let o;const c=new m;for(const h of this._def.checks)"min"===h.kind?(h.inclusive?t.datah.value:t.data>=h.value)&&(o=this._getOrReturnCtx(t,o),p(o,{code:E.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),c.dirty()):"multipleOf"===h.kind?t.data%h.value!==BigInt(0)&&(o=this._getOrReturnCtx(t,o),p(o,{code:E.not_multiple_of,multipleOf:h.value,message:h.message}),c.dirty()):b.assertNever(h);return{status:c.value,value:t.data}}_getInvalidInput(t){const o=this._getOrReturnCtx(t);return p(o,{code:E.invalid_type,expected:j.bigint,received:o.parsedType}),Z}gte(t,o){return this.setLimit("min",t,!0,R.toString(o))}gt(t,o){return this.setLimit("min",t,!1,R.toString(o))}lte(t,o){return this.setLimit("max",t,!0,R.toString(o))}lt(t,o){return this.setLimit("max",t,!1,R.toString(o))}setLimit(t,o,c,h){return new J({...this._def,checks:[...this._def.checks,{kind:t,value:o,inclusive:c,message:R.toString(h)}]})}_addCheck(t){return new J({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(t)})}multipleOf(t,o){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(o)})}get minValue(){let t=null;for(const o of this._def.checks)"min"===o.kind&&(null===t||o.value>t)&&(t=o.value);return t}get maxValue(){let t=null;for(const o of this._def.checks)"max"===o.kind&&(null===t||o.valuenew J({checks:[],typeName:Le.ZodBigInt,coerce:t?.coerce??!1,...T(t)});class Y extends A{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==j.boolean){const o=this._getOrReturnCtx(t);return p(o,{code:E.invalid_type,expected:j.boolean,received:o.parsedType}),Z}return y(t.data)}}Y.create=t=>new Y({typeName:Le.ZodBoolean,coerce:t?.coerce||!1,...T(t)});class X extends A{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==j.date){const o=this._getOrReturnCtx(t);return p(o,{code:E.invalid_type,expected:j.date,received:o.parsedType}),Z}if(Number.isNaN(t.data.getTime()))return p(this._getOrReturnCtx(t),{code:E.invalid_date}),Z;const o=new m;let c;for(const h of this._def.checks)"min"===h.kind?t.data.getTime()h.value&&(c=this._getOrReturnCtx(t,c),p(c,{code:E.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),o.dirty()):b.assertNever(h);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new X({...this._def,checks:[...this._def.checks,t]})}min(t,o){return this._addCheck({kind:"min",value:t.getTime(),message:R.toString(o)})}max(t,o){return this._addCheck({kind:"max",value:t.getTime(),message:R.toString(o)})}get minDate(){let t=null;for(const o of this._def.checks)"min"===o.kind&&(null===t||o.value>t)&&(t=o.value);return null!=t?new Date(t):null}get maxDate(){let t=null;for(const o of this._def.checks)"max"===o.kind&&(null===t||o.valuenew X({checks:[],coerce:t?.coerce||!1,typeName:Le.ZodDate,...T(t)});class ee extends A{_parse(t){if(this._getType(t)!==j.symbol){const o=this._getOrReturnCtx(t);return p(o,{code:E.invalid_type,expected:j.symbol,received:o.parsedType}),Z}return y(t.data)}}ee.create=t=>new ee({typeName:Le.ZodSymbol,...T(t)});class te extends A{_parse(t){if(this._getType(t)!==j.undefined){const o=this._getOrReturnCtx(t);return p(o,{code:E.invalid_type,expected:j.undefined,received:o.parsedType}),Z}return y(t.data)}}te.create=t=>new te({typeName:Le.ZodUndefined,...T(t)});class se extends A{_parse(t){if(this._getType(t)!==j.null){const o=this._getOrReturnCtx(t);return p(o,{code:E.invalid_type,expected:j.null,received:o.parsedType}),Z}return y(t.data)}}se.create=t=>new se({typeName:Le.ZodNull,...T(t)});class ae extends A{constructor(){super(...arguments),this._any=!0}_parse(t){return y(t.data)}}ae.create=t=>new ae({typeName:Le.ZodAny,...T(t)});class re extends A{constructor(){super(...arguments),this._unknown=!0}_parse(t){return y(t.data)}}re.create=t=>new re({typeName:Le.ZodUnknown,...T(t)});class ne extends A{_parse(t){const o=this._getOrReturnCtx(t);return p(o,{code:E.invalid_type,expected:j.never,received:o.parsedType}),Z}}ne.create=t=>new ne({typeName:Le.ZodNever,...T(t)});class ie extends A{_parse(t){if(this._getType(t)!==j.undefined){const o=this._getOrReturnCtx(t);return p(o,{code:E.invalid_type,expected:j.void,received:o.parsedType}),Z}return y(t.data)}}ie.create=t=>new ie({typeName:Le.ZodVoid,...T(t)});class oe extends A{_parse(t){const{ctx:o,status:c}=this._processInputParams(t),h=this._def;if(o.parsedType!==j.array)return p(o,{code:E.invalid_type,expected:j.array,received:o.parsedType}),Z;if(null!==h.exactLength){const t=o.data.length>h.exactLength.value,g=o.data.lengthh.maxLength.value&&(p(o,{code:E.too_big,maximum:h.maxLength.value,type:"array",inclusive:!0,exact:!1,message:h.maxLength.message}),c.dirty()),o.common.async)return Promise.all([...o.data].map((t,c)=>h.type._parseAsync(new w(o,t,o.path,c)))).then(t=>m.mergeArray(c,t));const g=[...o.data].map((t,c)=>h.type._parseSync(new w(o,t,o.path,c)));return m.mergeArray(c,g)}get element(){return this._def.type}min(t,o){return new oe({...this._def,minLength:{value:t,message:R.toString(o)}})}max(t,o){return new oe({...this._def,maxLength:{value:t,message:R.toString(o)}})}length(t,o){return new oe({...this._def,exactLength:{value:t,message:R.toString(o)}})}nonempty(t){return this.min(1,t)}}function de(t){if(t instanceof ce){const o={};for(const c in t.shape){const h=t.shape[c];o[c]=Ae.create(de(h))}return new ce({...t._def,shape:()=>o})}return t instanceof oe?new oe({...t._def,type:de(t.element)}):t instanceof Ae?Ae.create(de(t.unwrap())):t instanceof Ce?Ce.create(de(t.unwrap())):t instanceof ge?ge.create(t.items.map(t=>de(t))):t}oe.create=(t,o)=>new oe({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Le.ZodArray,...T(o)});class ce extends A{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),o=b.objectKeys(t);return this._cached={shape:t,keys:o},this._cached}_parse(t){if(this._getType(t)!==j.object){const o=this._getOrReturnCtx(t);return p(o,{code:E.invalid_type,expected:j.object,received:o.parsedType}),Z}const{status:o,ctx:c}=this._processInputParams(t),{shape:h,keys:g}=this._getCached(),b=[];if(!(this._def.catchall instanceof ne&&"strip"===this._def.unknownKeys))for(const t in c.data)g.includes(t)||b.push(t);const P=[];for(const t of g){const o=h[t],g=c.data[t];P.push({key:{status:"valid",value:t},value:o._parse(new w(c,g,c.path,t)),alwaysSet:t in c.data})}if(this._def.catchall instanceof ne){const t=this._def.unknownKeys;if("passthrough"===t)for(const t of b)P.push({key:{status:"valid",value:t},value:{status:"valid",value:c.data[t]}});else if("strict"===t)b.length>0&&(p(c,{code:E.unrecognized_keys,keys:b}),o.dirty());else if("strip"!==t)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const t=this._def.catchall;for(const o of b){const h=c.data[o];P.push({key:{status:"valid",value:o},value:t._parse(new w(c,h,c.path,o)),alwaysSet:o in c.data})}}return c.common.async?Promise.resolve().then(async()=>{const t=[];for(const o of P){const c=await o.key,h=await o.value;t.push({key:c,value:h,alwaysSet:o.alwaysSet})}return t}).then(t=>m.mergeObjectSync(o,t)):m.mergeObjectSync(o,P)}get shape(){return this._def.shape()}strict(t){return R.errToObj,new ce({...this._def,unknownKeys:"strict",...void 0!==t?{errorMap:(o,c)=>{const h=this._def.errorMap?.(o,c).message??c.defaultError;return"unrecognized_keys"===o.code?{message:R.errToObj(t).message??h}:{message:h}}}:{}})}strip(){return new ce({...this._def,unknownKeys:"strip"})}passthrough(){return new ce({...this._def,unknownKeys:"passthrough"})}extend(t){return new ce({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ce({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Le.ZodObject})}setKey(t,o){return this.augment({[t]:o})}catchall(t){return new ce({...this._def,catchall:t})}pick(t){const o={};for(const c of b.objectKeys(t))t[c]&&this.shape[c]&&(o[c]=this.shape[c]);return new ce({...this._def,shape:()=>o})}omit(t){const o={};for(const c of b.objectKeys(this.shape))t[c]||(o[c]=this.shape[c]);return new ce({...this._def,shape:()=>o})}deepPartial(){return de(this)}partial(t){const o={};for(const c of b.objectKeys(this.shape)){const h=this.shape[c];t&&!t[c]?o[c]=h:o[c]=h.optional()}return new ce({...this._def,shape:()=>o})}required(t){const o={};for(const c of b.objectKeys(this.shape))if(t&&!t[c])o[c]=this.shape[c];else{let t=this.shape[c];for(;t instanceof Ae;)t=t._def.innerType;o[c]=t}return new ce({...this._def,shape:()=>o})}keyof(){return ke(b.objectKeys(this.shape))}}ce.create=(t,o)=>new ce({shape:()=>t,unknownKeys:"strip",catchall:ne.create(),typeName:Le.ZodObject,...T(o)}),ce.strictCreate=(t,o)=>new ce({shape:()=>t,unknownKeys:"strict",catchall:ne.create(),typeName:Le.ZodObject,...T(o)}),ce.lazycreate=(t,o)=>new ce({shape:t,unknownKeys:"strip",catchall:ne.create(),typeName:Le.ZodObject,...T(o)});class ue extends A{_parse(t){const{ctx:o}=this._processInputParams(t),c=this._def.options;if(o.common.async)return Promise.all(c.map(async t=>{const c={...o,common:{...o.common,issues:[]},parent:null};return{result:await t._parseAsync({data:o.data,path:o.path,parent:c}),ctx:c}})).then(function(t){for(const o of t)if("valid"===o.result.status)return o.result;for(const c of t)if("dirty"===c.result.status)return o.common.issues.push(...c.ctx.common.issues),c.result;const c=t.map(t=>new u(t.ctx.common.issues));return p(o,{code:E.invalid_union,unionErrors:c}),Z});{let t;const h=[];for(const g of c){const c={...o,common:{...o.common,issues:[]},parent:null},b=g._parseSync({data:o.data,path:o.path,parent:c});if("valid"===b.status)return b;"dirty"!==b.status||t||(t={result:b,ctx:c}),c.common.issues.length&&h.push(c.common.issues)}if(t)return o.common.issues.push(...t.ctx.common.issues),t.result;const g=h.map(t=>new u(t));return p(o,{code:E.invalid_union,unionErrors:g}),Z}}get options(){return this._def.options}}ue.create=(t,o)=>new ue({options:t,typeName:Le.ZodUnion,...T(o)});const le=t=>t instanceof ve?le(t.schema):t instanceof Te?le(t.innerType()):t instanceof xe?[t.value]:t instanceof be?t.options:t instanceof we?b.objectValues(t.enum):t instanceof Re?le(t._def.innerType):t instanceof te?[void 0]:t instanceof se?[null]:t instanceof Ae?[void 0,...le(t.unwrap())]:t instanceof Ce?[null,...le(t.unwrap())]:t instanceof Ie||t instanceof Ne?le(t.unwrap()):t instanceof Ze?le(t._def.innerType):[];class he extends A{_parse(t){const{ctx:o}=this._processInputParams(t);if(o.parsedType!==j.object)return p(o,{code:E.invalid_type,expected:j.object,received:o.parsedType}),Z;const c=this.discriminator,h=o.data[c],g=this.optionsMap.get(h);return g?o.common.async?g._parseAsync({data:o.data,path:o.path,parent:o}):g._parseSync({data:o.data,path:o.path,parent:o}):(p(o,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[c]}),Z)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,o,c){const h=new Map;for(const c of o){const o=le(c.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const g of o){if(h.has(g))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(g)}`);h.set(g,c)}}return new he({typeName:Le.ZodDiscriminatedUnion,discriminator:t,options:o,optionsMap:h,...T(c)})}}function pe(t,o){const c=d(t),h=d(o);if(t===o)return{valid:!0,data:t};if(c===j.object&&h===j.object){const c=b.objectKeys(o),h=b.objectKeys(t).filter(t=>-1!==c.indexOf(t)),g={...t,...o};for(const c of h){const h=pe(t[c],o[c]);if(!h.valid)return{valid:!1};g[c]=h.data}return{valid:!0,data:g}}if(c===j.array&&h===j.array){if(t.length!==o.length)return{valid:!1};const c=[];for(let h=0;h{if(_(t)||_(h))return Z;const g=pe(t.value,h.value);return g.valid?((v(t)||v(h))&&o.dirty(),{status:o.value,value:g.data}):(p(c,{code:E.invalid_intersection_types}),Z)};return c.common.async?Promise.all([this._def.left._parseAsync({data:c.data,path:c.path,parent:c}),this._def.right._parseAsync({data:c.data,path:c.path,parent:c})]).then(([t,o])=>a(t,o)):a(this._def.left._parseSync({data:c.data,path:c.path,parent:c}),this._def.right._parseSync({data:c.data,path:c.path,parent:c}))}}me.create=(t,o,c)=>new me({left:t,right:o,typeName:Le.ZodIntersection,...T(c)});class ge extends A{_parse(t){const{status:o,ctx:c}=this._processInputParams(t);if(c.parsedType!==j.array)return p(c,{code:E.invalid_type,expected:j.array,received:c.parsedType}),Z;if(c.data.lengththis._def.items.length&&(p(c,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),o.dirty());const h=[...c.data].map((t,o)=>{const h=this._def.items[o]||this._def.rest;return h?h._parse(new w(c,t,c.path,o)):null}).filter(t=>!!t);return c.common.async?Promise.all(h).then(t=>m.mergeArray(o,t)):m.mergeArray(o,h)}get items(){return this._def.items}rest(t){return new ge({...this._def,rest:t})}}ge.create=(t,o)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ge({items:t,typeName:Le.ZodTuple,rest:null,...T(o)})};class fe extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:o,ctx:c}=this._processInputParams(t);if(c.parsedType!==j.object)return p(c,{code:E.invalid_type,expected:j.object,received:c.parsedType}),Z;const h=[],g=this._def.keyType,b=this._def.valueType;for(const t in c.data)h.push({key:g._parse(new w(c,t,c.path,t)),value:b._parse(new w(c,c.data[t],c.path,t)),alwaysSet:t in c.data});return c.common.async?m.mergeObjectAsync(o,h):m.mergeObjectSync(o,h)}get element(){return this._def.valueType}static create(t,o,c){return new fe(o instanceof A?{keyType:t,valueType:o,typeName:Le.ZodRecord,...T(c)}:{keyType:W.create(),valueType:t,typeName:Le.ZodRecord,...T(o)})}}class ye extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:o,ctx:c}=this._processInputParams(t);if(c.parsedType!==j.map)return p(c,{code:E.invalid_type,expected:j.map,received:c.parsedType}),Z;const h=this._def.keyType,g=this._def.valueType,b=[...c.data.entries()].map(([t,o],b)=>({key:h._parse(new w(c,t,c.path,[b,"key"])),value:g._parse(new w(c,o,c.path,[b,"value"]))}));if(c.common.async){const t=new Map;return Promise.resolve().then(async()=>{for(const c of b){const h=await c.key,g=await c.value;if("aborted"===h.status||"aborted"===g.status)return Z;"dirty"!==h.status&&"dirty"!==g.status||o.dirty(),t.set(h.value,g.value)}return{status:o.value,value:t}})}{const t=new Map;for(const c of b){const h=c.key,g=c.value;if("aborted"===h.status||"aborted"===g.status)return Z;"dirty"!==h.status&&"dirty"!==g.status||o.dirty(),t.set(h.value,g.value)}return{status:o.value,value:t}}}}ye.create=(t,o,c)=>new ye({valueType:o,keyType:t,typeName:Le.ZodMap,...T(c)});class _e extends A{_parse(t){const{status:o,ctx:c}=this._processInputParams(t);if(c.parsedType!==j.set)return p(c,{code:E.invalid_type,expected:j.set,received:c.parsedType}),Z;const h=this._def;null!==h.minSize&&c.data.sizeh.maxSize.value&&(p(c,{code:E.too_big,maximum:h.maxSize.value,type:"set",inclusive:!0,exact:!1,message:h.maxSize.message}),o.dirty());const g=this._def.valueType;function n(t){const c=new Set;for(const h of t){if("aborted"===h.status)return Z;"dirty"===h.status&&o.dirty(),c.add(h.value)}return{status:o.value,value:c}}const b=[...c.data.values()].map((t,o)=>g._parse(new w(c,t,c.path,o)));return c.common.async?Promise.all(b).then(t=>n(t)):n(b)}min(t,o){return new _e({...this._def,minSize:{value:t,message:R.toString(o)}})}max(t,o){return new _e({...this._def,maxSize:{value:t,message:R.toString(o)}})}size(t,o){return this.min(t,o).max(t,o)}nonempty(t){return this.min(1,t)}}_e.create=(t,o)=>new _e({valueType:t,minSize:null,maxSize:null,typeName:Le.ZodSet,...T(o)});class ve extends A{get schema(){return this._def.getter()}_parse(t){const{ctx:o}=this._processInputParams(t);return this._def.getter()._parse({data:o.data,path:o.path,parent:o})}}ve.create=(t,o)=>new ve({getter:t,typeName:Le.ZodLazy,...T(o)});class xe extends A{_parse(t){if(t.data!==this._def.value){const o=this._getOrReturnCtx(t);return p(o,{received:o.data,code:E.invalid_literal,expected:this._def.value}),Z}return{status:"valid",value:t.data}}get value(){return this._def.value}}function ke(t,o){return new be({values:t,typeName:Le.ZodEnum,...T(o)})}xe.create=(t,o)=>new xe({value:t,typeName:Le.ZodLiteral,...T(o)});class be extends A{_parse(t){if("string"!=typeof t.data){const o=this._getOrReturnCtx(t),c=this._def.values;return p(o,{expected:b.joinValues(c),received:o.parsedType,code:E.invalid_type}),Z}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const o=this._getOrReturnCtx(t),c=this._def.values;return p(o,{received:o.data,code:E.invalid_enum_value,options:c}),Z}return y(t.data)}get options(){return this._def.values}get enum(){const t={};for(const o of this._def.values)t[o]=o;return t}get Values(){const t={};for(const o of this._def.values)t[o]=o;return t}get Enum(){const t={};for(const o of this._def.values)t[o]=o;return t}extract(t,o=this._def){return be.create(t,{...this._def,...o})}exclude(t,o=this._def){return be.create(this.options.filter(o=>!t.includes(o)),{...this._def,...o})}}be.create=ke;class we extends A{_parse(t){const o=b.getValidEnumValues(this._def.values),c=this._getOrReturnCtx(t);if(c.parsedType!==j.string&&c.parsedType!==j.number){const t=b.objectValues(o);return p(c,{expected:b.joinValues(t),received:c.parsedType,code:E.invalid_type}),Z}if(this._cache||(this._cache=new Set(b.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const t=b.objectValues(o);return p(c,{received:c.data,code:E.invalid_enum_value,options:t}),Z}return y(t.data)}get enum(){return this._def.values}}we.create=(t,o)=>new we({values:t,typeName:Le.ZodNativeEnum,...T(o)});class Se extends A{unwrap(){return this._def.type}_parse(t){const{ctx:o}=this._processInputParams(t);if(o.parsedType!==j.promise&&!1===o.common.async)return p(o,{code:E.invalid_type,expected:j.promise,received:o.parsedType}),Z;const c=o.parsedType===j.promise?o.data:Promise.resolve(o.data);return y(c.then(t=>this._def.type.parseAsync(t,{path:o.path,errorMap:o.common.contextualErrorMap})))}}Se.create=(t,o)=>new Se({type:t,typeName:Le.ZodPromise,...T(o)});class Te extends A{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:o,ctx:c}=this._processInputParams(t),h=this._def.effect||null,g={addIssue:t=>{p(c,t),t.fatal?o.abort():o.dirty()},get path(){return c.path}};if(g.addIssue=g.addIssue.bind(g),"preprocess"===h.type){const t=h.transform(c.data,g);if(c.common.async)return Promise.resolve(t).then(async t=>{if("aborted"===o.value)return Z;const h=await this._def.schema._parseAsync({data:t,path:c.path,parent:c});return"aborted"===h.status?Z:"dirty"===h.status||"dirty"===o.value?f(h.value):h});{if("aborted"===o.value)return Z;const h=this._def.schema._parseSync({data:t,path:c.path,parent:c});return"aborted"===h.status?Z:"dirty"===h.status||"dirty"===o.value?f(h.value):h}}if("refinement"===h.type){const e=t=>{const o=h.refinement(t,g);if(c.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(!1===c.common.async){const t=this._def.schema._parseSync({data:c.data,path:c.path,parent:c});return"aborted"===t.status?Z:("dirty"===t.status&&o.dirty(),e(t.value),{status:o.value,value:t.value})}return this._def.schema._parseAsync({data:c.data,path:c.path,parent:c}).then(t=>"aborted"===t.status?Z:("dirty"===t.status&&o.dirty(),e(t.value).then(()=>({status:o.value,value:t.value}))))}if("transform"===h.type){if(!1===c.common.async){const t=this._def.schema._parseSync({data:c.data,path:c.path,parent:c});if(!x(t))return Z;const b=h.transform(t.value,g);if(b instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:o.value,value:b}}return this._def.schema._parseAsync({data:c.data,path:c.path,parent:c}).then(t=>x(t)?Promise.resolve(h.transform(t.value,g)).then(t=>({status:o.value,value:t})):Z)}b.assertNever(h)}}Te.create=(t,o,c)=>new Te({schema:t,typeName:Le.ZodEffects,effect:o,...T(c)}),Te.createWithPreprocess=(t,o,c)=>new Te({schema:o,effect:{type:"preprocess",transform:t},typeName:Le.ZodEffects,...T(c)});class Ae extends A{_parse(t){return this._getType(t)===j.undefined?y(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ae.create=(t,o)=>new Ae({innerType:t,typeName:Le.ZodOptional,...T(o)});class Ce extends A{_parse(t){return this._getType(t)===j.null?y(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ce.create=(t,o)=>new Ce({innerType:t,typeName:Le.ZodNullable,...T(o)});class Re extends A{_parse(t){const{ctx:o}=this._processInputParams(t);let c=o.data;return o.parsedType===j.undefined&&(c=this._def.defaultValue()),this._def.innerType._parse({data:c,path:o.path,parent:o})}removeDefault(){return this._def.innerType}}Re.create=(t,o)=>new Re({innerType:t,typeName:Le.ZodDefault,defaultValue:"function"==typeof o.default?o.default:()=>o.default,...T(o)});class Ze extends A{_parse(t){const{ctx:o}=this._processInputParams(t),c={...o,common:{...o.common,issues:[]}},h=this._def.innerType._parse({data:c.data,path:c.path,parent:{...c}});return k(h)?h.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new u(c.common.issues)},input:c.data})})):{status:"valid",value:"valid"===h.status?h.value:this._def.catchValue({get error(){return new u(c.common.issues)},input:c.data})}}removeCatch(){return this._def.innerType}}Ze.create=(t,o)=>new Ze({innerType:t,typeName:Le.ZodCatch,catchValue:"function"==typeof o.catch?o.catch:()=>o.catch,...T(o)});class Oe extends A{_parse(t){if(this._getType(t)!==j.nan){const o=this._getOrReturnCtx(t);return p(o,{code:E.invalid_type,expected:j.nan,received:o.parsedType}),Z}return{status:"valid",value:t.data}}}Oe.create=t=>new Oe({typeName:Le.ZodNaN,...T(t)}),Symbol("zod_brand");class Ie extends A{_parse(t){const{ctx:o}=this._processInputParams(t),c=o.data;return this._def.type._parse({data:c,path:o.path,parent:o})}unwrap(){return this._def.type}}class Ee extends A{_parse(t){const{status:o,ctx:c}=this._processInputParams(t);if(c.common.async)return(async()=>{const t=await this._def.in._parseAsync({data:c.data,path:c.path,parent:c});return"aborted"===t.status?Z:"dirty"===t.status?(o.dirty(),f(t.value)):this._def.out._parseAsync({data:t.value,path:c.path,parent:c})})();{const t=this._def.in._parseSync({data:c.data,path:c.path,parent:c});return"aborted"===t.status?Z:"dirty"===t.status?(o.dirty(),{status:"dirty",value:t.value}):this._def.out._parseSync({data:t.value,path:c.path,parent:c})}}static create(t,o){return new Ee({in:t,out:o,typeName:Le.ZodPipeline})}}class Ne extends A{_parse(t){const o=this._def.innerType._parse(t),s=t=>(x(t)&&(t.value=Object.freeze(t.value)),t);return k(o)?o.then(t=>s(t)):s(o)}unwrap(){return this._def.innerType}}var Le;Ne.create=(t,o)=>new Ne({innerType:t,typeName:Le.ZodReadonly,...T(o)}),ce.lazycreate,function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"}(Le||(Le={}));const Me=W.create,qe=G.create,Ue=(Oe.create,J.create,Y.create),Ve=(X.create,ee.create,te.create,se.create,ae.create,re.create),Ke=(ne.create,ie.create,oe.create),He=ce.create,Be=(ce.strictCreate,ue.create),Qe=he.create,Je=(me.create,ge.create,fe.create),We=(ye.create,_e.create,ve.create,xe.create),Ge=be.create,Ye=(we.create,Se.create,Te.create,Ae.create),Xe=(Ce.create,Te.createWithPreprocess,Ee.create,"2.0"),et=Be([Me(),qe().int()]),tt=Me(),rt=He({progressToken:Ye(et)}).passthrough(),st=He({_meta:Ye(rt)}).passthrough(),at=He({method:Me(),params:Ye(st)}),nt=He({_meta:Ye(He({}).passthrough())}).passthrough(),ot=He({method:Me(),params:Ye(nt)}),it=He({_meta:Ye(He({}).passthrough())}).passthrough(),dt=Be([Me(),qe().int()]),ct=He({jsonrpc:We(Xe),id:dt}).merge(at).strict(),ut=He({jsonrpc:We(Xe)}).merge(ot).strict(),lt=He({jsonrpc:We(Xe),id:dt,result:it}).strict();var pt;!function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"}(pt||(pt={}));const mt=Be([ct,ut,lt,He({jsonrpc:We(Xe),id:dt,error:He({code:qe().int(),message:Me(),data:Ye(Ve())})}).strict()]),ht=it.strict(),ft=ot.extend({method:We("notifications/cancelled"),params:nt.extend({requestId:dt,reason:Me().optional()})}),gt=He({name:Me(),title:Ye(Me())}).passthrough(),vt=gt.extend({version:Me()}),yt=He({experimental:Ye(He({}).passthrough()),sampling:Ye(He({}).passthrough()),elicitation:Ye(He({}).passthrough()),roots:Ye(He({listChanged:Ye(Ue())}).passthrough())}).passthrough(),_t=at.extend({method:We("initialize"),params:st.extend({protocolVersion:Me(),capabilities:yt,clientInfo:vt})}),bt=He({experimental:Ye(He({}).passthrough()),logging:Ye(He({}).passthrough()),completions:Ye(He({}).passthrough()),prompts:Ye(He({listChanged:Ye(Ue())}).passthrough()),resources:Ye(He({subscribe:Ye(Ue()),listChanged:Ye(Ue())}).passthrough()),tools:Ye(He({listChanged:Ye(Ue())}).passthrough())}).passthrough(),Pt=it.extend({protocolVersion:Me(),capabilities:bt,serverInfo:vt,instructions:Ye(Me())}),kt=ot.extend({method:We("notifications/initialized")}),xt=at.extend({method:We("ping")}),jt=He({progress:qe(),total:Ye(qe()),message:Ye(Me())}).passthrough(),wt=ot.extend({method:We("notifications/progress"),params:nt.merge(jt).extend({progressToken:et})}),St=at.extend({params:st.extend({cursor:Ye(tt)}).optional()}),Et=it.extend({nextCursor:Ye(tt)}),Tt=He({uri:Me(),mimeType:Ye(Me()),_meta:Ye(He({}).passthrough())}).passthrough(),Ct=Tt.extend({text:Me()}),Zt=Tt.extend({blob:Me().base64()}),Rt=gt.extend({uri:Me(),description:Ye(Me()),mimeType:Ye(Me()),_meta:Ye(He({}).passthrough())}),It=gt.extend({uriTemplate:Me(),description:Ye(Me()),mimeType:Ye(Me()),_meta:Ye(He({}).passthrough())}),At=St.extend({method:We("resources/list")}),Dt=Et.extend({resources:Ke(Rt)}),Ot=St.extend({method:We("resources/templates/list")}),Nt=Et.extend({resourceTemplates:Ke(It)}),$t=at.extend({method:We("resources/read"),params:st.extend({uri:Me()})}),zt=it.extend({contents:Ke(Be([Ct,Zt]))}),Ft=ot.extend({method:We("notifications/resources/list_changed")}),Lt=at.extend({method:We("resources/subscribe"),params:st.extend({uri:Me()})}),Mt=at.extend({method:We("resources/unsubscribe"),params:st.extend({uri:Me()})}),qt=ot.extend({method:We("notifications/resources/updated"),params:nt.extend({uri:Me()})}),Ut=He({name:Me(),description:Ye(Me()),required:Ye(Ue())}).passthrough(),Vt=gt.extend({description:Ye(Me()),arguments:Ye(Ke(Ut)),_meta:Ye(He({}).passthrough())}),Kt=St.extend({method:We("prompts/list")}),Ht=Et.extend({prompts:Ke(Vt)}),Bt=at.extend({method:We("prompts/get"),params:st.extend({name:Me(),arguments:Ye(Je(Me()))})}),Qt=He({type:We("text"),text:Me(),_meta:Ye(He({}).passthrough())}).passthrough(),Jt=He({type:We("image"),data:Me().base64(),mimeType:Me(),_meta:Ye(He({}).passthrough())}).passthrough(),Wt=He({type:We("audio"),data:Me().base64(),mimeType:Me(),_meta:Ye(He({}).passthrough())}).passthrough(),Gt=He({type:We("resource"),resource:Be([Ct,Zt]),_meta:Ye(He({}).passthrough())}).passthrough(),Yt=Be([Qt,Jt,Wt,Rt.extend({type:We("resource_link")}),Gt]),Xt=He({role:Ge(["user","assistant"]),content:Yt}).passthrough(),er=it.extend({description:Ye(Me()),messages:Ke(Xt)}),tr=ot.extend({method:We("notifications/prompts/list_changed")}),rr=He({title:Ye(Me()),readOnlyHint:Ye(Ue()),destructiveHint:Ye(Ue()),idempotentHint:Ye(Ue()),openWorldHint:Ye(Ue())}).passthrough(),sr=gt.extend({description:Ye(Me()),inputSchema:He({type:We("object"),properties:Ye(He({}).passthrough()),required:Ye(Ke(Me()))}).passthrough(),outputSchema:Ye(He({type:We("object"),properties:Ye(He({}).passthrough()),required:Ye(Ke(Me()))}).passthrough()),annotations:Ye(rr),_meta:Ye(He({}).passthrough())}),ar=St.extend({method:We("tools/list")}),nr=Et.extend({tools:Ke(sr)}),or=it.extend({content:Ke(Yt).default([]),structuredContent:He({}).passthrough().optional(),isError:Ye(Ue())}),ir=(or.or(it.extend({toolResult:Ve()})),at.extend({method:We("tools/call"),params:st.extend({name:Me(),arguments:Ye(Je(Ve()))})})),dr=ot.extend({method:We("notifications/tools/list_changed")}),cr=Ge(["debug","info","notice","warning","error","critical","alert","emergency"]),ur=at.extend({method:We("logging/setLevel"),params:st.extend({level:cr})}),lr=ot.extend({method:We("notifications/message"),params:nt.extend({level:cr,logger:Ye(Me()),data:Ve()})}),pr=He({name:Me().optional()}).passthrough(),mr=He({hints:Ye(Ke(pr)),costPriority:Ye(qe().min(0).max(1)),speedPriority:Ye(qe().min(0).max(1)),intelligencePriority:Ye(qe().min(0).max(1))}).passthrough(),hr=He({role:Ge(["user","assistant"]),content:Be([Qt,Jt,Wt])}).passthrough(),fr=at.extend({method:We("sampling/createMessage"),params:st.extend({messages:Ke(hr),systemPrompt:Ye(Me()),includeContext:Ye(Ge(["none","thisServer","allServers"])),temperature:Ye(qe()),maxTokens:qe().int(),stopSequences:Ye(Ke(Me())),metadata:Ye(He({}).passthrough()),modelPreferences:Ye(mr)})}),gr=it.extend({model:Me(),stopReason:Ye(Ge(["endTurn","stopSequence","maxTokens"]).or(Me())),role:Ge(["user","assistant"]),content:Qe("type",[Qt,Jt,Wt])}),vr=Be([He({type:We("boolean"),title:Ye(Me()),description:Ye(Me()),default:Ye(Ue())}).passthrough(),He({type:We("string"),title:Ye(Me()),description:Ye(Me()),minLength:Ye(qe()),maxLength:Ye(qe()),format:Ye(Ge(["email","uri","date","date-time"]))}).passthrough(),He({type:Ge(["number","integer"]),title:Ye(Me()),description:Ye(Me()),minimum:Ye(qe()),maximum:Ye(qe())}).passthrough(),He({type:We("string"),title:Ye(Me()),description:Ye(Me()),enum:Ke(Me()),enumNames:Ye(Ke(Me()))}).passthrough()]),yr=at.extend({method:We("elicitation/create"),params:st.extend({message:Me(),requestedSchema:He({type:We("object"),properties:Je(Me(),vr),required:Ye(Ke(Me()))}).passthrough()})}),_r=it.extend({action:Ge(["accept","reject","cancel"]),content:Ye(Je(Me(),Ve()))}),br=He({type:We("ref/resource"),uri:Me()}).passthrough(),Pr=He({type:We("ref/prompt"),name:Me()}).passthrough(),kr=at.extend({method:We("completion/complete"),params:st.extend({ref:Be([Pr,br]),argument:He({name:Me(),value:Me()}).passthrough(),context:Ye(He({arguments:Ye(Je(Me(),Me()))}))})}),xr=it.extend({completion:He({values:Ke(Me()).max(100),total:Ye(qe().int()),hasMore:Ye(Ue())}).passthrough()}),jr=He({uri:Me().startsWith("file://"),name:Ye(Me()),_meta:Ye(He({}).passthrough())}).passthrough(),wr=at.extend({method:We("roots/list")}),Sr=it.extend({roots:Ke(jr)}),Er=ot.extend({method:We("notifications/roots/list_changed")});Be([xt,_t,kr,ur,Bt,Kt,At,Ot,$t,Lt,Mt,ir,ar]),Be([ft,wt,kt,Er]),Be([ht,gr,_r,Sr]),Be([xt,fr,yr,wr]),Be([ft,wt,lr,qt,Ft,dr,tr]),Be([ht,Pt,xr,er,Ht,Dt,Nt,zt,or,nr]),Error;class bs{sessionId;onmessage;onerror;onclose;_port;_started=!1;_closed=!1;constructor(t,o){if(!t)throw new Error("MessagePort is required");this._port=t,this.sessionId=o||this.generateId(),this._port.onmessage=t=>{try{const o=mt.parse(t.data);this.onmessage?.(o)}catch(t){const o=new Error(`Failed to parse message: ${t}`);this.onerror?.(o)}},this._port.onmessageerror=t=>{const o=new Error(`MessagePort error: ${JSON.stringify(t)}`);this.onerror?.(o)}}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(t){if(this._closed)throw new Error("Cannot send on a closed BrowserContextTransport");return new Promise((o,c)=>{try{this._port.postMessage(t),o()}catch(t){const o=t instanceof Error?t:new Error(String(t));this.onerror?.(o),c(o)}})}async close(){this._closed||(this._closed=!0,this._port.close(),this.onclose?.())}generateId(){return bs.generateSessionId()}}class ws{angieDetector;registrationQueue;clientManager;isInitialized=!1;constructor(){this.angieDetector=new r,this.registrationQueue=new n,this.clientManager=new i,this.setupAngieReadyHandler(),this.setupServerInitHandler()}setupAngieReadyHandler(){this.angieDetector.waitForReady().then(t=>{t.isReady?this.handleAngieReady():console.warn("AngieMcpSdk: Angie not detected - servers will remain queued")}).catch(t=>{console.error("AngieMcpSdk: Error waiting for Angie:",t)})}async handleAngieReady(){console.log("AngieMcpSdk: Angie is ready, processing queued registrations");try{await this.registrationQueue.processQueue(async t=>{await this.processRegistration(t)}),this.isInitialized=!0,console.log("AngieMcpSdk: Initialization complete")}catch(t){console.error("AngieMcpSdk: Error processing registration queue:",t)}}async processRegistration(t){console.log(`AngieMcpSdk: Processing registration for server "${t.config.name}"`);try{await this.clientManager.requestClientCreation(t),console.log(`AngieMcpSdk: Successfully registered server "${t.config.name}"`)}catch(o){throw console.error(`AngieMcpSdk: Failed to register server "${t.config.name}":`,o),o}}async registerServer(t){if(!t.server)throw new Error("Server instance is required");if(!t.name)throw new Error("Server name is required");if(!t.description)throw new Error("Server description is required");console.log(`AngieMcpSdk: Registering server "${t.name}"`);const o=this.registrationQueue.add(t);if(this.angieDetector.isReady())try{await this.processRegistration(o),this.registrationQueue.updateStatus(o.id,"registered"),console.log(`AngieMcpSdk: Server "${t.name}" registered successfully`)}catch(t){const c=t instanceof Error?t.message:String(t);throw this.registrationQueue.updateStatus(o.id,"failed",c),t}else console.log(`AngieMcpSdk: Server "${t.name}" queued until Angie is ready`)}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(t=>setTimeout(t,100))}destroy(){this.registrationQueue.clear(),console.log("AngieMcpSdk: SDK destroyed")}setupServerInitHandler(){window.addEventListener("message",t=>{t.data?.type===g.SDK_REQUEST_INIT_SERVER&&this.handleServerInitRequest(t)})}handleServerInitRequest(t){const{clientId:o,serverId:c}=t.data.payload||{};if(o&&c){console.log(`AngieMcpSdk: Handling server init request for clientId: ${o}, serverId: ${c}`);try{const o=this.registrationQueue.getAll().find(t=>t.id===c);if(!o)return void console.error(`AngieMcpSdk: No registration found for serverId: ${c}`);const h=t.ports[0];if(!h)return void console.error("AngieMcpSdk: No port provided in server init request");const g=o.config.server,b=new bs(h);g.connect(b),console.log(`AngieMcpSdk: Server "${o.config.name}" initialized successfully`)}catch(t){console.error(`AngieMcpSdk: Error initializing server for clientId ${o}:`,t)}}else console.error("AngieMcpSdk: Invalid server init request - missing clientId or serverId")}}},"./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js":function(t,o,c){"use strict";c.r(o),c.d(o,{Completable:function(){return Completable},McpZodTypeKind:function(){return h},completable:function(){return completable}});var h,g=c("./packages/node_modules/zod/v3/types.js");!function(t){t.Completable="McpCompletable"}(h||(h={}));class Completable extends g.ZodType{_parse(t){const{ctx:o}=this._processInputParams(t),c=o.data;return this._def.type._parse({data:c,path:o.path,parent:o})}unwrap(){return this._def.type}}function completable(t,o){return Completable.create(t,{...t._def,complete:o})}function processCreateParams(t){if(!t)return{};const{errorMap:o,invalid_type_error:c,required_error:h,description:g}=t;if(o&&(c||h))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(o)return{errorMap:o,description:g};return{errorMap:(o,g)=>{var b,P;const{message:j}=t;return"invalid_enum_value"===o.code?{message:null!=j?j:g.defaultError}:void 0===g.data?{message:null!==(b=null!=j?j:h)&&void 0!==b?b:g.defaultError}:"invalid_type"!==o.code?{message:g.defaultError}:{message:null!==(P=null!=j?j:c)&&void 0!==P?P:g.defaultError}},description:g}}Completable.create=(t,o)=>new Completable({type:t,typeName:h.Completable,complete:o.complete,...processCreateParams(o)})},"./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js":function(t,o,c){"use strict";c.r(o),c.d(o,{Server:function(){return Server}});var h=c("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js"),g=c("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),b=c("./packages/node_modules/ajv/lib/ajv.js");class Server extends h.Protocol{constructor(t,o){var c;super(o),this._serverInfo=t,this._capabilities=null!==(c=null==o?void 0:o.capabilities)&&void 0!==c?c:{},this._instructions=null==o?void 0:o.instructions,this.setRequestHandler(g.InitializeRequestSchema,t=>this._oninitialize(t)),this.setNotificationHandler(g.InitializedNotificationSchema,()=>{var t;return null===(t=this.oninitialized)||void 0===t?void 0:t.call(this)})}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=(0,h.mergeCapabilities)(this._capabilities,t)}assertCapabilityForMethod(t){var o,c,h;switch(t){case"sampling/createMessage":if(!(null===(o=this._clientCapabilities)||void 0===o?void 0:o.sampling))throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!(null===(c=this._clientCapabilities)||void 0===c?void 0:c.elicitation))throw new Error(`Client does not support elicitation (required for ${t})`);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 ${t})`)}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`)}}assertRequestHandlerCapability(t){switch(t){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Server does not support sampling (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`)}}async _oninitialize(t){const o=t.params.protocolVersion;this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo;return{protocolVersion:g.SUPPORTED_PROTOCOL_VERSIONS.includes(o)?o: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(t,o){return this.request({method:"sampling/createMessage",params:t},g.CreateMessageResultSchema,o)}async elicitInput(t,o){const c=await this.request({method:"elicitation/create",params:t},g.ElicitResultSchema,o);if("accept"===c.action&&c.content)try{const o=new b,h=o.compile(t.requestedSchema);if(!h(c.content))throw new g.McpError(g.ErrorCode.InvalidParams,`Elicitation response content does not match requested schema: ${o.errorsText(h.errors)}`)}catch(t){if(t instanceof g.McpError)throw t;throw new g.McpError(g.ErrorCode.InternalError,`Error validating elicitation response: ${t}`)}return c}async listRoots(t,o){return this.request({method:"roots/list",params:t},g.ListRootsResultSchema,o)}async sendLoggingMessage(t){return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}},"./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js":function(t,o,c){"use strict";c.r(o),c.d(o,{McpServer:function(){return McpServer},ResourceTemplate:function(){return ResourceTemplate}});var h=c("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js"),g=c("./packages/node_modules/zod-to-json-schema/dist/esm/index.js"),b=c("./packages/node_modules/zod/v3/types.js"),P=c("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),j=c("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js"),E=c("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js");class McpServer{constructor(t,o){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(t,o)}async connect(t){return await this.server.connect(t)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(P.ListToolsRequestSchema.shape.method.value),this.server.assertCanSetRequestHandler(P.CallToolRequestSchema.shape.method.value),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(P.ListToolsRequestSchema,()=>({tools:Object.entries(this._registeredTools).filter(([,t])=>t.enabled).map(([t,o])=>{const c={name:t,title:o.title,description:o.description,inputSchema:o.inputSchema?(0,g.zodToJsonSchema)(o.inputSchema,{strictUnions:!0}):C,annotations:o.annotations};return o.outputSchema&&(c.outputSchema=(0,g.zodToJsonSchema)(o.outputSchema,{strictUnions:!0})),c})})),this.server.setRequestHandler(P.CallToolRequestSchema,async(t,o)=>{const c=this._registeredTools[t.params.name];if(!c)throw new P.McpError(P.ErrorCode.InvalidParams,`Tool ${t.params.name} not found`);if(!c.enabled)throw new P.McpError(P.ErrorCode.InvalidParams,`Tool ${t.params.name} disabled`);let h;if(c.inputSchema){const g=await c.inputSchema.safeParseAsync(t.params.arguments);if(!g.success)throw new P.McpError(P.ErrorCode.InvalidParams,`Invalid arguments for tool ${t.params.name}: ${g.error.message}`);const b=g.data,j=c.callback;try{h=await Promise.resolve(j(b,o))}catch(t){h={content:[{type:"text",text:t instanceof Error?t.message:String(t)}],isError:!0}}}else{const t=c.callback;try{h=await Promise.resolve(t(o))}catch(t){h={content:[{type:"text",text:t instanceof Error?t.message:String(t)}],isError:!0}}}if(c.outputSchema&&!h.isError){if(!h.structuredContent)throw new P.McpError(P.ErrorCode.InvalidParams,`Tool ${t.params.name} has an output schema but no structured content was provided`);const o=await c.outputSchema.safeParseAsync(h.structuredContent);if(!o.success)throw new P.McpError(P.ErrorCode.InvalidParams,`Invalid structured content for tool ${t.params.name}: ${o.error.message}`)}return h}),this._toolHandlersInitialized=!0)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(P.CompleteRequestSchema.shape.method.value),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(P.CompleteRequestSchema,async t=>{switch(t.params.ref.type){case"ref/prompt":return this.handlePromptCompletion(t,t.params.ref);case"ref/resource":return this.handleResourceCompletion(t,t.params.ref);default:throw new P.McpError(P.ErrorCode.InvalidParams,`Invalid completion reference: ${t.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(t,o){const c=this._registeredPrompts[o.name];if(!c)throw new P.McpError(P.ErrorCode.InvalidParams,`Prompt ${o.name} not found`);if(!c.enabled)throw new P.McpError(P.ErrorCode.InvalidParams,`Prompt ${o.name} disabled`);if(!c.argsSchema)return Z;const h=c.argsSchema.shape[t.params.argument.name];if(!(h instanceof j.Completable))return Z;const g=h._def;return createCompletionResult(await g.complete(t.params.argument.value,t.params.context))}async handleResourceCompletion(t,o){const c=Object.values(this._registeredResourceTemplates).find(t=>t.resourceTemplate.uriTemplate.toString()===o.uri);if(!c){if(this._registeredResources[o.uri])return Z;throw new P.McpError(P.ErrorCode.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}const h=c.resourceTemplate.completeCallback(t.params.argument.name);if(!h)return Z;return createCompletionResult(await h(t.params.argument.value,t.params.context))}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(P.ListResourcesRequestSchema.shape.method.value),this.server.assertCanSetRequestHandler(P.ListResourceTemplatesRequestSchema.shape.method.value),this.server.assertCanSetRequestHandler(P.ReadResourceRequestSchema.shape.method.value),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(P.ListResourcesRequestSchema,async(t,o)=>{const c=Object.entries(this._registeredResources).filter(([t,o])=>o.enabled).map(([t,o])=>({uri:t,name:o.name,...o.metadata})),h=[];for(const t of Object.values(this._registeredResourceTemplates)){if(!t.resourceTemplate.listCallback)continue;const c=await t.resourceTemplate.listCallback(o);for(const o of c.resources)h.push({...t.metadata,...o})}return{resources:[...c,...h]}}),this.server.setRequestHandler(P.ListResourceTemplatesRequestSchema,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([t,o])=>({name:t,uriTemplate:o.resourceTemplate.uriTemplate.toString(),...o.metadata}))})),this.server.setRequestHandler(P.ReadResourceRequestSchema,async(t,o)=>{const c=new URL(t.params.uri),h=this._registeredResources[c.toString()];if(h){if(!h.enabled)throw new P.McpError(P.ErrorCode.InvalidParams,`Resource ${c} disabled`);return h.readCallback(c,o)}for(const t of Object.values(this._registeredResourceTemplates)){const h=t.resourceTemplate.uriTemplate.match(c.toString());if(h)return t.readCallback(c,h,o)}throw new P.McpError(P.ErrorCode.InvalidParams,`Resource ${c} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(P.ListPromptsRequestSchema.shape.method.value),this.server.assertCanSetRequestHandler(P.GetPromptRequestSchema.shape.method.value),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(P.ListPromptsRequestSchema,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,o])=>{return{name:t,title:o.title,description:o.description,arguments:o.argsSchema?(c=o.argsSchema,Object.entries(c.shape).map(([t,o])=>({name:t,description:o.description,required:!o.isOptional()}))):void 0};var c})})),this.server.setRequestHandler(P.GetPromptRequestSchema,async(t,o)=>{const c=this._registeredPrompts[t.params.name];if(!c)throw new P.McpError(P.ErrorCode.InvalidParams,`Prompt ${t.params.name} not found`);if(!c.enabled)throw new P.McpError(P.ErrorCode.InvalidParams,`Prompt ${t.params.name} disabled`);if(c.argsSchema){const h=await c.argsSchema.safeParseAsync(t.params.arguments);if(!h.success)throw new P.McpError(P.ErrorCode.InvalidParams,`Invalid arguments for prompt ${t.params.name}: ${h.error.message}`);const g=h.data,b=c.callback;return await Promise.resolve(b(g,o))}{const t=c.callback;return await Promise.resolve(t(o))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0)}resource(t,o,...c){let h;"object"==typeof c[0]&&(h=c.shift());const g=c[0];if("string"==typeof o){if(this._registeredResources[o])throw new Error(`Resource ${o} is already registered`);const c=this._createRegisteredResource(t,void 0,o,h,g);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);const c=this._createRegisteredResourceTemplate(t,void 0,o,h,g);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}}registerResource(t,o,c,h){if("string"==typeof o){if(this._registeredResources[o])throw new Error(`Resource ${o} is already registered`);const g=this._createRegisteredResource(t,c.title,o,c,h);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),g}{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);const g=this._createRegisteredResourceTemplate(t,c.title,o,c,h);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),g}}_createRegisteredResource(t,o,c,h,g){const b={name:t,title:o,metadata:h,readCallback:g,enabled:!0,disable:()=>b.update({enabled:!1}),enable:()=>b.update({enabled:!0}),remove:()=>b.update({uri:null}),update:t=>{void 0!==t.uri&&t.uri!==c&&(delete this._registeredResources[c],t.uri&&(this._registeredResources[t.uri]=b)),void 0!==t.name&&(b.name=t.name),void 0!==t.title&&(b.title=t.title),void 0!==t.metadata&&(b.metadata=t.metadata),void 0!==t.callback&&(b.readCallback=t.callback),void 0!==t.enabled&&(b.enabled=t.enabled),this.sendResourceListChanged()}};return this._registeredResources[c]=b,b}_createRegisteredResourceTemplate(t,o,c,h,g){const b={resourceTemplate:c,title:o,metadata:h,readCallback:g,enabled:!0,disable:()=>b.update({enabled:!1}),enable:()=>b.update({enabled:!0}),remove:()=>b.update({name:null}),update:o=>{void 0!==o.name&&o.name!==t&&(delete this._registeredResourceTemplates[t],o.name&&(this._registeredResourceTemplates[o.name]=b)),void 0!==o.title&&(b.title=o.title),void 0!==o.template&&(b.resourceTemplate=o.template),void 0!==o.metadata&&(b.metadata=o.metadata),void 0!==o.callback&&(b.readCallback=o.callback),void 0!==o.enabled&&(b.enabled=o.enabled),this.sendResourceListChanged()}};return this._registeredResourceTemplates[t]=b,b}_createRegisteredPrompt(t,o,c,h,g){const P={title:o,description:c,argsSchema:void 0===h?void 0:b.object(h),callback:g,enabled:!0,disable:()=>P.update({enabled:!1}),enable:()=>P.update({enabled:!0}),remove:()=>P.update({name:null}),update:o=>{void 0!==o.name&&o.name!==t&&(delete this._registeredPrompts[t],o.name&&(this._registeredPrompts[o.name]=P)),void 0!==o.title&&(P.title=o.title),void 0!==o.description&&(P.description=o.description),void 0!==o.argsSchema&&(P.argsSchema=b.object(o.argsSchema)),void 0!==o.callback&&(P.callback=o.callback),void 0!==o.enabled&&(P.enabled=o.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[t]=P,P}_createRegisteredTool(t,o,c,h,g,P,j){const E={title:o,description:c,inputSchema:void 0===h?void 0:b.object(h),outputSchema:void 0===g?void 0:b.object(g),annotations:P,callback:j,enabled:!0,disable:()=>E.update({enabled:!1}),enable:()=>E.update({enabled:!0}),remove:()=>E.update({name:null}),update:o=>{void 0!==o.name&&o.name!==t&&(delete this._registeredTools[t],o.name&&(this._registeredTools[o.name]=E)),void 0!==o.title&&(E.title=o.title),void 0!==o.description&&(E.description=o.description),void 0!==o.paramsSchema&&(E.inputSchema=b.object(o.paramsSchema)),void 0!==o.callback&&(E.callback=o.callback),void 0!==o.annotations&&(E.annotations=o.annotations),void 0!==o.enabled&&(E.enabled=o.enabled),this.sendToolListChanged()}};return this._registeredTools[t]=E,this.setToolRequestHandlers(),this.sendToolListChanged(),E}tool(t,...o){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let c,h,g;if("string"==typeof o[0]&&(c=o.shift()),o.length>1){const t=o[0];isZodRawShape(t)?(h=o.shift(),o.length>1&&"object"==typeof o[0]&&null!==o[0]&&!isZodRawShape(o[0])&&(g=o.shift())):"object"==typeof t&&null!==t&&(g=o.shift())}const b=o[0];return this._createRegisteredTool(t,void 0,c,h,undefined,g,b)}registerTool(t,o,c){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);const{title:h,description:g,inputSchema:b,outputSchema:P,annotations:j}=o;return this._createRegisteredTool(t,h,g,b,P,j,c)}prompt(t,...o){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let c,h;"string"==typeof o[0]&&(c=o.shift()),o.length>1&&(h=o.shift());const g=o[0],b=this._createRegisteredPrompt(t,void 0,c,h,g);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),b}registerPrompt(t,o,c){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);const{title:h,description:g,argsSchema:b}=o,P=this._createRegisteredPrompt(t,h,g,b,c);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),P}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(t,o){this._callbacks=o,this._uriTemplate="string"==typeof t?new E.UriTemplate(t):t}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(t){var o;return null===(o=this._callbacks.complete)||void 0===o?void 0:o[t]}}const C={type:"object",properties:{}};function isZodRawShape(t){if("object"!=typeof t||null===t)return!1;return 0===Object.keys(t).length||Object.values(t).some(isZodTypeLike)}function isZodTypeLike(t){return null!==t&&"object"==typeof t&&"parse"in t&&"function"==typeof t.parse&&"safeParse"in t&&"function"==typeof t.safeParse}function createCompletionResult(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}const Z={completion:{values:[],hasMore:!1}}},"./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js":function(t,o,c){"use strict";c.r(o),c.d(o,{DEFAULT_REQUEST_TIMEOUT_MSEC:function(){return g},Protocol:function(){return Protocol},mergeCapabilities:function(){return mergeCapabilities}});var h=c("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");const g=6e4;class Protocol{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(h.CancelledNotificationSchema,t=>{const o=this._requestHandlerAbortControllers.get(t.params.requestId);null==o||o.abort(t.params.reason)}),this.setNotificationHandler(h.ProgressNotificationSchema,t=>{this._onprogress(t)}),this.setRequestHandler(h.PingRequestSchema,t=>({}))}_setupTimeout(t,o,c,h,g=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(h,o),startTime:Date.now(),timeout:o,maxTotalTimeout:c,resetTimeoutOnProgress:g,onTimeout:h})}_resetTimeout(t){const o=this._timeoutInfo.get(t);if(!o)return!1;const c=Date.now()-o.startTime;if(o.maxTotalTimeout&&c>=o.maxTotalTimeout)throw this._timeoutInfo.delete(t),new h.McpError(h.ErrorCode.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:o.maxTotalTimeout,totalElapsed:c});return clearTimeout(o.timeoutId),o.timeoutId=setTimeout(o.onTimeout,o.timeout),!0}_cleanupTimeout(t){const o=this._timeoutInfo.get(t);o&&(clearTimeout(o.timeoutId),this._timeoutInfo.delete(t))}async connect(t){var o,c,g;this._transport=t;const b=null===(o=this.transport)||void 0===o?void 0:o.onclose;this._transport.onclose=()=>{null==b||b(),this._onclose()};const P=null===(c=this.transport)||void 0===c?void 0:c.onerror;this._transport.onerror=t=>{null==P||P(t),this._onerror(t)};const j=null===(g=this._transport)||void 0===g?void 0:g.onmessage;this._transport.onmessage=(t,o)=>{null==j||j(t,o),(0,h.isJSONRPCResponse)(t)||(0,h.isJSONRPCError)(t)?this._onresponse(t):(0,h.isJSONRPCRequest)(t)?this._onrequest(t,o):(0,h.isJSONRPCNotification)(t)?this._onnotification(t):this._onerror(new Error(`Unknown message type: ${JSON.stringify(t)}`))},await this._transport.start()}_onclose(){var t;const o=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,null===(t=this.onclose)||void 0===t||t.call(this);const c=new h.McpError(h.ErrorCode.ConnectionClosed,"Connection closed");for(const t of o.values())t(c)}_onerror(t){var o;null===(o=this.onerror)||void 0===o||o.call(this,t)}_onnotification(t){var o;const c=null!==(o=this._notificationHandlers.get(t.method))&&void 0!==o?o:this.fallbackNotificationHandler;void 0!==c&&Promise.resolve().then(()=>c(t)).catch(t=>this._onerror(new Error(`Uncaught error in notification handler: ${t}`)))}_onrequest(t,o){var c,g;const b=null!==(c=this._requestHandlers.get(t.method))&&void 0!==c?c:this.fallbackRequestHandler,P=this._transport;if(void 0===b)return void(null==P||P.send({jsonrpc:"2.0",id:t.id,error:{code:h.ErrorCode.MethodNotFound,message:"Method not found"}}).catch(t=>this._onerror(new Error(`Failed to send an error response: ${t}`))));const j=new AbortController;this._requestHandlerAbortControllers.set(t.id,j);const E={signal:j.signal,sessionId:null==P?void 0:P.sessionId,_meta:null===(g=t.params)||void 0===g?void 0:g._meta,sendNotification:o=>this.notification(o,{relatedRequestId:t.id}),sendRequest:(o,c,h)=>this.request(o,c,{...h,relatedRequestId:t.id}),authInfo:null==o?void 0:o.authInfo,requestId:t.id,requestInfo:null==o?void 0:o.requestInfo};Promise.resolve().then(()=>b(t,E)).then(o=>{if(!j.signal.aborted)return null==P?void 0:P.send({result:o,jsonrpc:"2.0",id:t.id})},o=>{var c;if(!j.signal.aborted)return null==P?void 0:P.send({jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(o.code)?o.code:h.ErrorCode.InternalError,message:null!==(c=o.message)&&void 0!==c?c:"Internal error"}})}).catch(t=>this._onerror(new Error(`Failed to send response: ${t}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:o,...c}=t.params,h=Number(o),g=this._progressHandlers.get(h);if(!g)return void this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));const b=this._responseHandlers.get(h),P=this._timeoutInfo.get(h);if(P&&b&&P.resetTimeoutOnProgress)try{this._resetTimeout(h)}catch(t){return void b(t)}g(c)}_onresponse(t){const o=Number(t.id),c=this._responseHandlers.get(o);if(void 0!==c)if(this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),(0,h.isJSONRPCResponse)(t))c(t);else{c(new h.McpError(t.error.code,t.error.message,t.error.data))}else this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`))}get transport(){return this._transport}async close(){var t;await(null===(t=this._transport)||void 0===t?void 0:t.close())}request(t,o,c){const{relatedRequestId:b,resumptionToken:P,onresumptiontoken:j}=null!=c?c:{};return new Promise((E,C)=>{var Z,R,I,D,O,N;if(!this._transport)return void C(new Error("Not connected"));!0===(null===(Z=this._options)||void 0===Z?void 0:Z.enforceStrictCapabilities)&&this.assertCapabilityForMethod(t.method),null===(R=null==c?void 0:c.signal)||void 0===R||R.throwIfAborted();const $=this._requestMessageId++,z={...t,jsonrpc:"2.0",id:$};(null==c?void 0:c.onprogress)&&(this._progressHandlers.set($,c.onprogress),z.params={...t.params,_meta:{...(null===(I=t.params)||void 0===I?void 0:I._meta)||{},progressToken:$}});const cancel=t=>{var o;this._responseHandlers.delete($),this._progressHandlers.delete($),this._cleanupTimeout($),null===(o=this._transport)||void 0===o||o.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:$,reason:String(t)}},{relatedRequestId:b,resumptionToken:P,onresumptiontoken:j}).catch(t=>this._onerror(new Error(`Failed to send cancellation: ${t}`))),C(t)};this._responseHandlers.set($,t=>{var h;if(!(null===(h=null==c?void 0:c.signal)||void 0===h?void 0:h.aborted)){if(t instanceof Error)return C(t);try{const c=o.parse(t.result);E(c)}catch(t){C(t)}}}),null===(D=null==c?void 0:c.signal)||void 0===D||D.addEventListener("abort",()=>{var t;cancel(null===(t=null==c?void 0:c.signal)||void 0===t?void 0:t.reason)});const F=null!==(O=null==c?void 0:c.timeout)&&void 0!==O?O:g;this._setupTimeout($,F,null==c?void 0:c.maxTotalTimeout,()=>cancel(new h.McpError(h.ErrorCode.RequestTimeout,"Request timed out",{timeout:F})),null!==(N=null==c?void 0:c.resetTimeoutOnProgress)&&void 0!==N&&N),this._transport.send(z,{relatedRequestId:b,resumptionToken:P,onresumptiontoken:j}).catch(t=>{this._cleanupTimeout($),C(t)})})}async notification(t,o){var c,h;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);if((null!==(h=null===(c=this._options)||void 0===c?void 0:c.debouncedNotificationMethods)&&void 0!==h?h:[]).includes(t.method)&&!t.params&&!(null==o?void 0:o.relatedRequestId)){if(this._pendingDebouncedNotifications.has(t.method))return;return this._pendingDebouncedNotifications.add(t.method),void Promise.resolve().then(()=>{var c;if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;const h={...t,jsonrpc:"2.0"};null===(c=this._transport)||void 0===c||c.send(h,o).catch(t=>this._onerror(t))})}const g={...t,jsonrpc:"2.0"};await this._transport.send(g,o)}setRequestHandler(t,o){const c=t.shape.method.value;this.assertRequestHandlerCapability(c),this._requestHandlers.set(c,(c,h)=>Promise.resolve(o(t.parse(c),h)))}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,o){this._notificationHandlers.set(t.shape.method.value,c=>Promise.resolve(o(t.parse(c))))}removeNotificationHandler(t){this._notificationHandlers.delete(t)}}function mergeCapabilities(t,o){return Object.entries(o).reduce((t,[o,c])=>(t[o]=c&&"object"==typeof c&&t[o]?{...t[o],...c}:c,t),{...t})}},"./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js":function(t,o,c){"use strict";c.r(o),c.d(o,{UriTemplate:function(){return UriTemplate}});const h=1e6,g=1e6;class UriTemplate{static isTemplate(t){return/\{[^}\s]+\}/.test(t)}static validateLength(t,o,c){if(t.length>o)throw new Error(`${c} exceeds maximum length of ${o} characters (got ${t.length})`)}get variableNames(){return this.parts.flatMap(t=>"string"==typeof t?[]:t.names)}constructor(t){UriTemplate.validateLength(t,h,"Template"),this.template=t,this.parts=this.parse(t)}toString(){return this.template}parse(t){const o=[];let c="",h=0,b=0;for(;h1e4)throw new Error("Template contains too many expressions (max 10000)");const j=t.slice(h+1,P),E=this.getOperator(j),C=j.includes("*"),Z=this.getNames(j),R=Z[0];for(const t of Z)UriTemplate.validateLength(t,g,"Variable name");o.push({name:R,operator:E,names:Z,exploded:C}),h=P+1}else c+=t[h],h++;return c&&o.push(c),o}getOperator(t){return["+","#",".","/","?","&"].find(o=>t.startsWith(o))||""}getNames(t){const o=this.getOperator(t);return t.slice(o.length).split(",").map(t=>t.replace("*","").trim()).filter(t=>t.length>0)}encodeValue(t,o){return UriTemplate.validateLength(t,g,"Variable value"),"+"===o||"#"===o?encodeURI(t):encodeURIComponent(t)}expandPart(t,o){if("?"===t.operator||"&"===t.operator){const c=t.names.map(c=>{const h=o[c];if(void 0===h)return"";return`${c}=${Array.isArray(h)?h.map(o=>this.encodeValue(o,t.operator)).join(","):this.encodeValue(h.toString(),t.operator)}`}).filter(t=>t.length>0);if(0===c.length)return"";return("?"===t.operator?"?":"&")+c.join("&")}if(t.names.length>1){const c=t.names.map(t=>o[t]).filter(t=>void 0!==t);return 0===c.length?"":c.map(t=>Array.isArray(t)?t[0]:t).join(",")}const c=o[t.name];if(void 0===c)return"";const h=(Array.isArray(c)?c:[c]).map(o=>this.encodeValue(o,t.operator));switch(t.operator){case"":case"+":default:return h.join(",");case"#":return"#"+h.join(",");case".":return"."+h.join(".");case"/":return"/"+h.join("/")}}expand(t){let o="",c=!1;for(const h of this.parts){if("string"==typeof h){o+=h;continue}const g=this.expandPart(h,t);g&&("?"!==h.operator&&"&"!==h.operator||!c?o+=g:o+=g.replace("?","&"),"?"!==h.operator&&"&"!==h.operator||(c=!0))}return o}escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp(t){const o=[];for(const o of t.names)UriTemplate.validateLength(o,g,"Variable name");if("?"===t.operator||"&"===t.operator){for(let c=0;cz.safeParse(t).success,F=h.object({jsonrpc:h.literal(j)}).merge(O).strict(),isJSONRPCNotification=t=>F.safeParse(t).success,L=h.object({jsonrpc:h.literal(j),id:$,result:N}).strict(),isJSONRPCResponse=t=>L.safeParse(t).success;var M;!function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"}(M||(M={}));const q=h.object({jsonrpc:h.literal(j),id:$,error:h.object({code:h.number().int(),message:h.string(),data:h.optional(h.unknown())})}).strict(),isJSONRPCError=t=>q.safeParse(t).success,V=h.union([z,F,L,q]),Pe=N.strict(),je=O.extend({method:h.literal("notifications/cancelled"),params:D.extend({requestId:$,reason:h.string().optional()})}),De=h.object({name:h.string(),title:h.optional(h.string())}).passthrough(),$e=De.extend({version:h.string()}),ze=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(),Fe=I.extend({method:h.literal("initialize"),params:R.extend({protocolVersion:h.string(),capabilities:ze,clientInfo:$e})}),isInitializeRequest=t=>Fe.safeParse(t).success,Le=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(),Me=N.extend({protocolVersion:h.string(),capabilities:Le,serverInfo:$e,instructions:h.optional(h.string())}),qe=O.extend({method:h.literal("notifications/initialized")}),isInitializedNotification=t=>qe.safeParse(t).success,Ue=I.extend({method:h.literal("ping")}),Ve=h.object({progress:h.number(),total:h.optional(h.number()),message:h.optional(h.string())}).passthrough(),Ke=O.extend({method:h.literal("notifications/progress"),params:D.merge(Ve).extend({progressToken:E})}),He=I.extend({params:R.extend({cursor:h.optional(C)}).optional()}),Be=N.extend({nextCursor:h.optional(C)}),Qe=h.object({uri:h.string(),mimeType:h.optional(h.string()),_meta:h.optional(h.object({}).passthrough())}).passthrough(),Je=Qe.extend({text:h.string()}),We=h.string().refine(t=>{try{return atob(t),!0}catch(t){return!1}},{message:"Invalid Base64 string"}),Ge=Qe.extend({blob:We}),Ye=De.extend({uri:h.string(),description:h.optional(h.string()),mimeType:h.optional(h.string()),_meta:h.optional(h.object({}).passthrough())}),Xe=De.extend({uriTemplate:h.string(),description:h.optional(h.string()),mimeType:h.optional(h.string()),_meta:h.optional(h.object({}).passthrough())}),et=He.extend({method:h.literal("resources/list")}),tt=Be.extend({resources:h.array(Ye)}),rt=He.extend({method:h.literal("resources/templates/list")}),st=Be.extend({resourceTemplates:h.array(Xe)}),at=I.extend({method:h.literal("resources/read"),params:R.extend({uri:h.string()})}),nt=N.extend({contents:h.array(h.union([Je,Ge]))}),ot=O.extend({method:h.literal("notifications/resources/list_changed")}),it=I.extend({method:h.literal("resources/subscribe"),params:R.extend({uri:h.string()})}),dt=I.extend({method:h.literal("resources/unsubscribe"),params:R.extend({uri:h.string()})}),ct=O.extend({method:h.literal("notifications/resources/updated"),params:D.extend({uri:h.string()})}),ut=h.object({name:h.string(),description:h.optional(h.string()),required:h.optional(h.boolean())}).passthrough(),lt=De.extend({description:h.optional(h.string()),arguments:h.optional(h.array(ut)),_meta:h.optional(h.object({}).passthrough())}),pt=He.extend({method:h.literal("prompts/list")}),mt=Be.extend({prompts:h.array(lt)}),ht=I.extend({method:h.literal("prompts/get"),params:R.extend({name:h.string(),arguments:h.optional(h.record(h.string()))})}),ft=h.object({type:h.literal("text"),text:h.string(),_meta:h.optional(h.object({}).passthrough())}).passthrough(),gt=h.object({type:h.literal("image"),data:We,mimeType:h.string(),_meta:h.optional(h.object({}).passthrough())}).passthrough(),vt=h.object({type:h.literal("audio"),data:We,mimeType:h.string(),_meta:h.optional(h.object({}).passthrough())}).passthrough(),yt=h.object({type:h.literal("resource"),resource:h.union([Je,Ge]),_meta:h.optional(h.object({}).passthrough())}).passthrough(),_t=Ye.extend({type:h.literal("resource_link")}),bt=h.union([ft,gt,vt,_t,yt]),Pt=h.object({role:h.enum(["user","assistant"]),content:bt}).passthrough(),kt=N.extend({description:h.optional(h.string()),messages:h.array(Pt)}),xt=O.extend({method:h.literal("notifications/prompts/list_changed")}),jt=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(),wt=De.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(jt),_meta:h.optional(h.object({}).passthrough())}),St=He.extend({method:h.literal("tools/list")}),Et=Be.extend({tools:h.array(wt)}),Tt=N.extend({content:h.array(bt).default([]),structuredContent:h.object({}).passthrough().optional(),isError:h.optional(h.boolean())}),Ct=Tt.or(N.extend({toolResult:h.unknown()})),Zt=I.extend({method:h.literal("tools/call"),params:R.extend({name:h.string(),arguments:h.optional(h.record(h.unknown()))})}),Rt=O.extend({method:h.literal("notifications/tools/list_changed")}),It=h.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),At=I.extend({method:h.literal("logging/setLevel"),params:R.extend({level:It})}),Dt=O.extend({method:h.literal("notifications/message"),params:D.extend({level:It,logger:h.optional(h.string()),data:h.unknown()})}),Ot=h.object({name:h.string().optional()}).passthrough(),Nt=h.object({hints:h.optional(h.array(Ot)),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(),$t=h.object({role:h.enum(["user","assistant"]),content:h.union([ft,gt,vt])}).passthrough(),zt=I.extend({method:h.literal("sampling/createMessage"),params:R.extend({messages:h.array($t),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(Nt)})}),Ft=N.extend({model:h.string(),stopReason:h.optional(h.enum(["endTurn","stopSequence","maxTokens"]).or(h.string())),role:h.enum(["user","assistant"]),content:h.discriminatedUnion("type",[ft,gt,vt])}),Lt=h.object({type:h.literal("boolean"),title:h.optional(h.string()),description:h.optional(h.string()),default:h.optional(h.boolean())}).passthrough(),Mt=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(),qt=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(),Ut=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(),Vt=h.union([Lt,Mt,qt,Ut]),Kt=I.extend({method:h.literal("elicitation/create"),params:R.extend({message:h.string(),requestedSchema:h.object({type:h.literal("object"),properties:h.record(h.string(),Vt),required:h.optional(h.array(h.string()))}).passthrough()})}),Ht=N.extend({action:h.enum(["accept","decline","cancel"]),content:h.optional(h.record(h.string(),h.unknown()))}),Bt=h.object({type:h.literal("ref/resource"),uri:h.string()}).passthrough(),Qt=Bt,Jt=h.object({type:h.literal("ref/prompt"),name:h.string()}).passthrough(),Wt=I.extend({method:h.literal("completion/complete"),params:R.extend({ref:h.union([Jt,Bt]),argument:h.object({name:h.string(),value:h.string()}).passthrough(),context:h.optional(h.object({arguments:h.optional(h.record(h.string(),h.string()))}))})}),Gt=N.extend({completion:h.object({values:h.array(h.string()).max(100),total:h.optional(h.number().int()),hasMore:h.optional(h.boolean())}).passthrough()}),Yt=h.object({uri:h.string().startsWith("file://"),name:h.optional(h.string()),_meta:h.optional(h.object({}).passthrough())}).passthrough(),Xt=I.extend({method:h.literal("roots/list")}),er=N.extend({roots:h.array(Yt)}),tr=O.extend({method:h.literal("notifications/roots/list_changed")}),rr=h.union([Ue,Fe,Wt,At,ht,pt,et,rt,at,it,dt,Zt,St]),sr=h.union([je,Ke,qe,tr]),ar=h.union([Pe,Ft,Ht,er]),nr=h.union([Ue,zt,Kt,Xt]),or=h.union([je,Ke,Dt,ct,ot,Rt,xt]),ir=h.union([Pe,Me,Gt,kt,mt,tt,st,nt,Tt,Et]);class McpError extends Error{constructor(t,o,c){super(`MCP error ${t}: ${o}`),this.code=t,this.data=c,this.name="McpError"}}},"./packages/node_modules/ajv/lib/ajv.js":function(t,o,c){"use strict";var h=c("./packages/node_modules/ajv/lib/compile/index.js"),g=c("./packages/node_modules/ajv/lib/compile/resolve.js"),b=c("./packages/node_modules/ajv/lib/cache.js"),P=c("./packages/node_modules/ajv/lib/compile/schema_obj.js"),j=c("./packages/node_modules/fast-json-stable-stringify/index.js"),E=c("./packages/node_modules/ajv/lib/compile/formats.js"),C=c("./packages/node_modules/ajv/lib/compile/rules.js"),Z=c("./packages/node_modules/ajv/lib/data.js"),R=c("./packages/node_modules/ajv/lib/compile/util.js");t.exports=Ajv,Ajv.prototype.validate=function validate(t,o){var c;if("string"==typeof t){if(!(c=this.getSchema(t)))throw new Error('no schema with key or ref "'+t+'"')}else{var h=this._addSchema(t);c=h.validate||this._compile(h)}var g=c(o);!0!==c.$async&&(this.errors=c.errors);return g},Ajv.prototype.compile=function compile(t,o){var c=this._addSchema(t,void 0,o);return c.validate||this._compile(c)},Ajv.prototype.addSchema=function addSchema(t,o,c,h){if(Array.isArray(t)){for(var b=0;b%\\^`{|}]|%[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,R=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,I=/^(?:\/(?:[^~/]|~0|~1)*)*$/,D=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,O=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function formats(t){return t="full"==t?"full":"fast",h.copy(formats[t])}function date(t){var o=t.match(g);if(!o)return!1;var c=+o[1],h=+o[2],P=+o[3];return h>=1&&h<=12&&P>=1&&P<=(2==h&&function isLeapYear(t){return t%4==0&&(t%100!=0||t%400==0)}(c)?29:b[h])}function time(t,o){var c=t.match(P);if(!c)return!1;var h=c[1],g=c[2],b=c[3],j=c[5];return(h<=23&&g<=59&&b<=59||23==h&&59==g&&60==b)&&(!o||j)}t.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":C,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:j,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:R,"json-pointer":I,"json-pointer-uri-fragment":D,"relative-json-pointer":O},formats.full={date:date,time:time,"date-time":function date_time(t){var o=t.split(N);return 2==o.length&&date(o[0])&&time(o[1],!0)},uri:function uri(t){return $.test(t)&&E.test(t)},"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":C,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:j,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:R,"json-pointer":I,"json-pointer-uri-fragment":D,"relative-json-pointer":O};var N=/t|\s/i;var $=/\/|:/;var z=/[^\\]\\Z/;function regex(t){if(z.test(t))return!1;try{return new RegExp(t),!0}catch(t){return!1}}},"./packages/node_modules/ajv/lib/compile/index.js":function(t,o,c){"use strict";var h=c("./packages/node_modules/ajv/lib/compile/resolve.js"),g=c("./packages/node_modules/ajv/lib/compile/util.js"),b=c("./packages/node_modules/ajv/lib/compile/error_classes.js"),P=c("./packages/node_modules/fast-json-stable-stringify/index.js"),j=c("./packages/node_modules/ajv/lib/dotjs/validate.js"),E=g.ucs2length,C=c("./packages/node_modules/fast-deep-equal/index.js"),Z=b.Validation;function checkCompiling(t,o,c){var h=compIndex.call(this,t,o,c);return h>=0?{index:h,compiling:!0}:(h=this._compilations.length,this._compilations[h]={schema:t,root:o,baseId:c},{index:h,compiling:!1})}function endCompiling(t,o,c){var h=compIndex.call(this,t,o,c);h>=0&&this._compilations.splice(h,1)}function compIndex(t,o,c){for(var h=0;h=55296&&o<=56319&&g=o)throw new Error("Cannot access property/index "+h+" levels up, current level is "+o);return c[o-h]}if(h>o)throw new Error("Cannot access data "+h+" levels up, current level is "+o);if(b="data"+(o-h||""),!g)return b}for(var C=b,Z=g.split("/"),R=0;R",F=D?">":"<",L=void 0;if(!I&&"number"!=typeof j&&void 0!==j)throw new Error(o+" must be number");if(!$&&void 0!==N&&"number"!=typeof N&&"boolean"!=typeof N)throw new Error(O+" must be number or boolean");if($){var M=t.util.getData(N.$data,P,t.dataPathArr),q="exclusive"+b,V="exclType"+b,Pe="exclIsNumber"+b,je="' + "+(ze="op"+b)+" + '";g+=" var schemaExcl"+b+" = "+M+"; ",g+=" var "+q+"; var "+V+" = typeof "+(M="schemaExcl"+b)+"; if ("+V+" != 'boolean' && "+V+" != 'undefined' && "+V+" != 'number') { ";var De;L=O;(De=De||[]).push(g),g="",!1!==t.createErrors?(g+=" { keyword: '"+(L||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(C)+" , params: {} ",!1!==t.opts.messages&&(g+=" , message: '"+O+" should be boolean' "),t.opts.verbose&&(g+=" , schema: validate.schema"+E+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+R+" "),g+=" } "):g+=" {} ";var $e=g;g=De.pop(),!t.compositeRule&&Z?t.async?g+=" throw new ValidationError(["+$e+"]); ":g+=" validate.errors = ["+$e+"]; return false; ":g+=" var err = "+$e+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+=" } else if ( ",I&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),g+=" "+V+" == 'number' ? ( ("+q+" = "+h+" === undefined || "+M+" "+z+"= "+h+") ? "+R+" "+F+"= "+M+" : "+R+" "+F+" "+h+" ) : ( ("+q+" = "+M+" === true) ? "+R+" "+F+"= "+h+" : "+R+" "+F+" "+h+" ) || "+R+" !== "+R+") { var op"+b+" = "+q+" ? '"+z+"' : '"+z+"='; ",void 0===j&&(L=O,C=t.errSchemaPath+"/"+O,h=M,I=$)}else{je=z;if((Pe="number"==typeof N)&&I){var ze="'"+je+"'";g+=" if ( ",I&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),g+=" ( "+h+" === undefined || "+N+" "+z+"= "+h+" ? "+R+" "+F+"= "+N+" : "+R+" "+F+" "+h+" ) || "+R+" !== "+R+") { "}else{Pe&&void 0===j?(q=!0,L=O,C=t.errSchemaPath+"/"+O,h=N,F+="="):(Pe&&(h=Math[D?"min":"max"](N,j)),N===(!Pe||h)?(q=!0,L=O,C=t.errSchemaPath+"/"+O,F+="="):(q=!1,je+="="));ze="'"+je+"'";g+=" if ( ",I&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),g+=" "+R+" "+F+" "+h+" || "+R+" !== "+R+") { "}}L=L||o,(De=De||[]).push(g),g="",!1!==t.createErrors?(g+=" { keyword: '"+(L||"_limit")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(C)+" , params: { comparison: "+ze+", limit: "+h+", exclusive: "+q+" } ",!1!==t.opts.messages&&(g+=" , message: 'should be "+je+" ",g+=I?"' + "+h:h+"'"),t.opts.verbose&&(g+=" , schema: ",g+=I?"validate.schema"+E:""+j,g+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+R+" "),g+=" } "):g+=" {} ";$e=g;return g=De.pop(),!t.compositeRule&&Z?t.async?g+=" throw new ValidationError(["+$e+"]); ":g+=" validate.errors = ["+$e+"]; return false; ":g+=" var err = "+$e+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+=" } ",Z&&(g+=" else { "),g}},"./packages/node_modules/ajv/lib/dotjs/_limitItems.js":function(t){"use strict";t.exports=function generate__limitItems(t,o,c){var h,g=" ",b=t.level,P=t.dataLevel,j=t.schema[o],E=t.schemaPath+t.util.getProperty(o),C=t.errSchemaPath+"/"+o,Z=!t.opts.allErrors,R="data"+(P||""),I=t.opts.$data&&j&&j.$data;if(I?(g+=" var schema"+b+" = "+t.util.getData(j.$data,P,t.dataPathArr)+"; ",h="schema"+b):h=j,!I&&"number"!=typeof j)throw new Error(o+" must be number");g+="if ( ",I&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),g+=" "+R+".length "+("maxItems"==o?">":"<")+" "+h+") { ";var D=o,O=O||[];O.push(g),g="",!1!==t.createErrors?(g+=" { keyword: '"+(D||"_limitItems")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(C)+" , params: { limit: "+h+" } ",!1!==t.opts.messages&&(g+=" , message: 'should NOT have ",g+="maxItems"==o?"more":"fewer",g+=" than ",g+=I?"' + "+h+" + '":""+j,g+=" items' "),t.opts.verbose&&(g+=" , schema: ",g+=I?"validate.schema"+E:""+j,g+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+R+" "),g+=" } "):g+=" {} ";var N=g;return g=O.pop(),!t.compositeRule&&Z?t.async?g+=" throw new ValidationError(["+N+"]); ":g+=" validate.errors = ["+N+"]; return false; ":g+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+="} ",Z&&(g+=" else { "),g}},"./packages/node_modules/ajv/lib/dotjs/_limitLength.js":function(t){"use strict";t.exports=function generate__limitLength(t,o,c){var h,g=" ",b=t.level,P=t.dataLevel,j=t.schema[o],E=t.schemaPath+t.util.getProperty(o),C=t.errSchemaPath+"/"+o,Z=!t.opts.allErrors,R="data"+(P||""),I=t.opts.$data&&j&&j.$data;if(I?(g+=" var schema"+b+" = "+t.util.getData(j.$data,P,t.dataPathArr)+"; ",h="schema"+b):h=j,!I&&"number"!=typeof j)throw new Error(o+" must be number");var D="maxLength"==o?">":"<";g+="if ( ",I&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),!1===t.opts.unicode?g+=" "+R+".length ":g+=" ucs2length("+R+") ",g+=" "+D+" "+h+") { ";var O=o,N=N||[];N.push(g),g="",!1!==t.createErrors?(g+=" { keyword: '"+(O||"_limitLength")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(C)+" , params: { limit: "+h+" } ",!1!==t.opts.messages&&(g+=" , message: 'should NOT be ",g+="maxLength"==o?"longer":"shorter",g+=" than ",g+=I?"' + "+h+" + '":""+j,g+=" characters' "),t.opts.verbose&&(g+=" , schema: ",g+=I?"validate.schema"+E:""+j,g+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+R+" "),g+=" } "):g+=" {} ";var $=g;return g=N.pop(),!t.compositeRule&&Z?t.async?g+=" throw new ValidationError(["+$+"]); ":g+=" validate.errors = ["+$+"]; return false; ":g+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+="} ",Z&&(g+=" else { "),g}},"./packages/node_modules/ajv/lib/dotjs/_limitProperties.js":function(t){"use strict";t.exports=function generate__limitProperties(t,o,c){var h,g=" ",b=t.level,P=t.dataLevel,j=t.schema[o],E=t.schemaPath+t.util.getProperty(o),C=t.errSchemaPath+"/"+o,Z=!t.opts.allErrors,R="data"+(P||""),I=t.opts.$data&&j&&j.$data;if(I?(g+=" var schema"+b+" = "+t.util.getData(j.$data,P,t.dataPathArr)+"; ",h="schema"+b):h=j,!I&&"number"!=typeof j)throw new Error(o+" must be number");g+="if ( ",I&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),g+=" Object.keys("+R+").length "+("maxProperties"==o?">":"<")+" "+h+") { ";var D=o,O=O||[];O.push(g),g="",!1!==t.createErrors?(g+=" { keyword: '"+(D||"_limitProperties")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(C)+" , params: { limit: "+h+" } ",!1!==t.opts.messages&&(g+=" , message: 'should NOT have ",g+="maxProperties"==o?"more":"fewer",g+=" than ",g+=I?"' + "+h+" + '":""+j,g+=" properties' "),t.opts.verbose&&(g+=" , schema: ",g+=I?"validate.schema"+E:""+j,g+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+R+" "),g+=" } "):g+=" {} ";var N=g;return g=O.pop(),!t.compositeRule&&Z?t.async?g+=" throw new ValidationError(["+N+"]); ":g+=" validate.errors = ["+N+"]; return false; ":g+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+="} ",Z&&(g+=" else { "),g}},"./packages/node_modules/ajv/lib/dotjs/allOf.js":function(t){"use strict";t.exports=function generate_allOf(t,o,c){var h=" ",g=t.schema[o],b=t.schemaPath+t.util.getProperty(o),P=t.errSchemaPath+"/"+o,j=!t.opts.allErrors,E=t.util.copy(t),C="";E.level++;var Z="valid"+E.level,R=E.baseId,I=!0,D=g;if(D)for(var O,N=-1,$=D.length-1;N<$;)O=D[N+=1],(t.opts.strictKeywords?"object"==typeof O&&Object.keys(O).length>0||!1===O:t.util.schemaHasRules(O,t.RULES.all))&&(I=!1,E.schema=O,E.schemaPath=b+"["+N+"]",E.errSchemaPath=P+"/"+N,h+=" "+t.validate(E)+" ",E.baseId=R,j&&(h+=" if ("+Z+") { ",C+="}"));return j&&(h+=I?" if (true) { ":" "+C.slice(0,-1)+" "),h}},"./packages/node_modules/ajv/lib/dotjs/anyOf.js":function(t){"use strict";t.exports=function generate_anyOf(t,o,c){var h=" ",g=t.level,b=t.dataLevel,P=t.schema[o],j=t.schemaPath+t.util.getProperty(o),E=t.errSchemaPath+"/"+o,C=!t.opts.allErrors,Z="data"+(b||""),R="valid"+g,I="errs__"+g,D=t.util.copy(t),O="";D.level++;var N="valid"+D.level,$=P.every(function(o){return t.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:t.util.schemaHasRules(o,t.RULES.all)});if($){var z=D.baseId;h+=" var "+I+" = errors; var "+R+" = false; ";var F=t.compositeRule;t.compositeRule=D.compositeRule=!0;var L=P;if(L)for(var M,q=-1,V=L.length-1;q0||!1===P:t.util.schemaHasRules(P,t.RULES.all);if(h+="var "+I+" = errors;var "+R+";",L){var M=t.compositeRule;t.compositeRule=D.compositeRule=!0,D.schema=P,D.schemaPath=j,D.errSchemaPath=E,h+=" var "+O+" = false; for (var "+N+" = 0; "+N+" < "+Z+".length; "+N+"++) { ",D.errorPath=t.util.getPathExpr(t.errorPath,N,t.opts.jsonPointers,!0);var q=Z+"["+N+"]";D.dataPathArr[$]=N;var V=t.validate(D);D.baseId=F,t.util.varOccurences(V,z)<2?h+=" "+t.util.varReplace(V,z,q)+" ":h+=" var "+z+" = "+q+"; "+V+" ",h+=" if ("+O+") break; } ",t.compositeRule=D.compositeRule=M,h+=" if (!"+O+") {"}else h+=" if ("+Z+".length == 0) {";var Pe=Pe||[];Pe.push(h),h="",!1!==t.createErrors?(h+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(E)+" , params: {} ",!1!==t.opts.messages&&(h+=" , message: 'should contain a valid item' "),t.opts.verbose&&(h+=" , schema: validate.schema"+j+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var je=h;return h=Pe.pop(),!t.compositeRule&&C?t.async?h+=" throw new ValidationError(["+je+"]); ":h+=" validate.errors = ["+je+"]; return false; ":h+=" var err = "+je+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" } else { ",L&&(h+=" errors = "+I+"; if (vErrors !== null) { if ("+I+") vErrors.length = "+I+"; else vErrors = null; } "),t.opts.allErrors&&(h+=" } "),h}},"./packages/node_modules/ajv/lib/dotjs/custom.js":function(t){"use strict";t.exports=function generate_custom(t,o,c){var h,g,b=" ",P=t.level,j=t.dataLevel,E=t.schema[o],C=t.schemaPath+t.util.getProperty(o),Z=t.errSchemaPath+"/"+o,R=!t.opts.allErrors,I="data"+(j||""),D="valid"+P,O="errs__"+P,N=t.opts.$data&&E&&E.$data;N?(b+=" var schema"+P+" = "+t.util.getData(E.$data,j,t.dataPathArr)+"; ",g="schema"+P):g=E;var $,z,F,L,M,q=this,V="definition"+P,Pe=q.definition,je="";if(N&&Pe.$data){M="keywordValidate"+P;var De=Pe.validateSchema;b+=" var "+V+" = RULES.custom['"+o+"'].definition; var "+M+" = "+V+".validate;"}else{if(!(L=t.useCustomRule(q,E,t.schema,t)))return;g="validate.schema"+C,M=L.code,$=Pe.compile,z=Pe.inline,F=Pe.macro}var $e=M+".errors",ze="i"+P,Fe="ruleErr"+P,Le=Pe.async;if(Le&&!t.async)throw new Error("async keyword in sync schema");if(z||F||(b+=$e+" = null;"),b+="var "+O+" = errors;var "+D+";",N&&Pe.$data&&(je+="}",b+=" if ("+g+" === undefined) { "+D+" = true; } else { ",De&&(je+="}",b+=" "+D+" = "+V+".validateSchema("+g+"); if ("+D+") { ")),z)Pe.statements?b+=" "+L.validate+" ":b+=" "+D+" = "+L.validate+"; ";else if(F){var Me=t.util.copy(t);je="";Me.level++;var qe="valid"+Me.level;Me.schema=L.validate,Me.schemaPath="";var Ue=t.compositeRule;t.compositeRule=Me.compositeRule=!0;var Ve=t.validate(Me).replace(/validate\.schema/g,M);t.compositeRule=Me.compositeRule=Ue,b+=" "+Ve}else{(Qe=Qe||[]).push(b),b="",b+=" "+M+".call( ",t.opts.passContext?b+="this":b+="self",$||!1===Pe.schema?b+=" , "+I+" ":b+=" , "+g+" , "+I+" , validate.schema"+t.schemaPath+" ",b+=" , (dataPath || '')",'""'!=t.errorPath&&(b+=" + "+t.errorPath);var Ke=j?"data"+(j-1||""):"parentData",He=j?t.dataPathArr[j]:"parentDataProperty",Be=b+=" , "+Ke+" , "+He+" , rootData ) ";b=Qe.pop(),!1===Pe.errors?(b+=" "+D+" = ",Le&&(b+="await "),b+=Be+"; "):b+=Le?" var "+($e="customErrors"+P)+" = null; try { "+D+" = await "+Be+"; } catch (e) { "+D+" = false; if (e instanceof ValidationError) "+$e+" = e.errors; else throw e; } ":" "+$e+" = null; "+D+" = "+Be+"; "}if(Pe.modifying&&(b+=" if ("+Ke+") "+I+" = "+Ke+"["+He+"];"),b+=""+je,Pe.valid)R&&(b+=" if (true) { ");else{var Qe;b+=" if ( ",void 0===Pe.valid?(b+=" !",b+=F?""+qe:""+D):b+=" "+!Pe.valid+" ",b+=") { ",h=q.keyword,(Qe=Qe||[]).push(b),b="",(Qe=Qe||[]).push(b),b="",!1!==t.createErrors?(b+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(Z)+" , params: { keyword: '"+q.keyword+"' } ",!1!==t.opts.messages&&(b+=" , message: 'should pass \""+q.keyword+"\" keyword validation' "),t.opts.verbose&&(b+=" , schema: validate.schema"+C+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+I+" "),b+=" } "):b+=" {} ";var Je=b;b=Qe.pop(),!t.compositeRule&&R?t.async?b+=" throw new ValidationError(["+Je+"]); ":b+=" validate.errors = ["+Je+"]; return false; ":b+=" var err = "+Je+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var We=b;b=Qe.pop(),z?Pe.errors?"full"!=Pe.errors&&(b+=" for (var "+ze+"="+O+"; "+ze+"0||!1===F:t.util.schemaHasRules(F,t.RULES.all))&&(h+=" "+O+" = true; if ( "+Z+t.util.getProperty(q)+" !== undefined ",z&&(h+=" && Object.prototype.hasOwnProperty.call("+Z+", '"+t.util.escapeQuotes(q)+"') "),h+=") { ",I.schema=F,I.schemaPath=j+t.util.getProperty(q),I.errSchemaPath=E+"/"+t.util.escapeFragment(q),h+=" "+t.validate(I)+" ",I.baseId=He,h+=" } ",C&&(h+=" if ("+O+") { ",D+="}"))}return C&&(h+=" "+D+" if ("+R+" == errors) {"),h}},"./packages/node_modules/ajv/lib/dotjs/enum.js":function(t){"use strict";t.exports=function generate_enum(t,o,c){var h=" ",g=t.level,b=t.dataLevel,P=t.schema[o],j=t.schemaPath+t.util.getProperty(o),E=t.errSchemaPath+"/"+o,C=!t.opts.allErrors,Z="data"+(b||""),R="valid"+g,I=t.opts.$data&&P&&P.$data;I&&(h+=" var schema"+g+" = "+t.util.getData(P.$data,b,t.dataPathArr)+"; ");var D="i"+g,O="schema"+g;I||(h+=" var "+O+" = validate.schema"+j+";"),h+="var "+R+";",I&&(h+=" if (schema"+g+" === undefined) "+R+" = true; else if (!Array.isArray(schema"+g+")) "+R+" = false; else {"),h+=R+" = false;for (var "+D+"=0; "+D+"<"+O+".length; "+D+"++) if (equal("+Z+", "+O+"["+D+"])) { "+R+" = true; break; }",I&&(h+=" } "),h+=" if (!"+R+") { ";var N=N||[];N.push(h),h="",!1!==t.createErrors?(h+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(E)+" , params: { allowedValues: schema"+g+" } ",!1!==t.opts.messages&&(h+=" , message: 'should be equal to one of the allowed values' "),t.opts.verbose&&(h+=" , schema: validate.schema"+j+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var $=h;return h=N.pop(),!t.compositeRule&&C?t.async?h+=" throw new ValidationError(["+$+"]); ":h+=" validate.errors = ["+$+"]; return false; ":h+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" }",C&&(h+=" else { "),h}},"./packages/node_modules/ajv/lib/dotjs/format.js":function(t){"use strict";t.exports=function generate_format(t,o,c){var h=" ",g=t.level,b=t.dataLevel,P=t.schema[o],j=t.schemaPath+t.util.getProperty(o),E=t.errSchemaPath+"/"+o,C=!t.opts.allErrors,Z="data"+(b||"");if(!1===t.opts.format)return C&&(h+=" if (true) { "),h;var R,I=t.opts.$data&&P&&P.$data;I?(h+=" var schema"+g+" = "+t.util.getData(P.$data,b,t.dataPathArr)+"; ",R="schema"+g):R=P;var D=t.opts.unknownFormats,O=Array.isArray(D);if(I){h+=" var "+(N="format"+g)+" = formats["+R+"]; var "+($="isObject"+g)+" = typeof "+N+" == 'object' && !("+N+" instanceof RegExp) && "+N+".validate; var "+(z="formatType"+g)+" = "+$+" && "+N+".type || 'string'; if ("+$+") { ",t.async&&(h+=" var async"+g+" = "+N+".async; "),h+=" "+N+" = "+N+".validate; } if ( ",I&&(h+=" ("+R+" !== undefined && typeof "+R+" != 'string') || "),h+=" (","ignore"!=D&&(h+=" ("+R+" && !"+N+" ",O&&(h+=" && self._opts.unknownFormats.indexOf("+R+") == -1 "),h+=") || "),h+=" ("+N+" && "+z+" == '"+c+"' && !(typeof "+N+" == 'function' ? ",t.async?h+=" (async"+g+" ? await "+N+"("+Z+") : "+N+"("+Z+")) ":h+=" "+N+"("+Z+") ",h+=" : "+N+".test("+Z+"))))) {"}else{var N;if(!(N=t.formats[P])){if("ignore"==D)return t.logger.warn('unknown format "'+P+'" ignored in schema at path "'+t.errSchemaPath+'"'),C&&(h+=" if (true) { "),h;if(O&&D.indexOf(P)>=0)return C&&(h+=" if (true) { "),h;throw new Error('unknown format "'+P+'" is used in schema at path "'+t.errSchemaPath+'"')}var $,z=($="object"==typeof N&&!(N instanceof RegExp)&&N.validate)&&N.type||"string";if($){var F=!0===N.async;N=N.validate}if(z!=c)return C&&(h+=" if (true) { "),h;if(F){if(!t.async)throw new Error("async format in sync schema");h+=" if (!(await "+(L="formats"+t.util.getProperty(P)+".validate")+"("+Z+"))) { "}else{h+=" if (! ";var L="formats"+t.util.getProperty(P);$&&(L+=".validate"),h+="function"==typeof N?" "+L+"("+Z+") ":" "+L+".test("+Z+") ",h+=") { "}}var M=M||[];M.push(h),h="",!1!==t.createErrors?(h+=" { keyword: 'format' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(E)+" , params: { format: ",h+=I?""+R:""+t.util.toQuotedString(P),h+=" } ",!1!==t.opts.messages&&(h+=" , message: 'should match format \"",h+=I?"' + "+R+" + '":""+t.util.escapeQuotes(P),h+="\"' "),t.opts.verbose&&(h+=" , schema: ",h+=I?"validate.schema"+j:""+t.util.toQuotedString(P),h+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var q=h;return h=M.pop(),!t.compositeRule&&C?t.async?h+=" throw new ValidationError(["+q+"]); ":h+=" validate.errors = ["+q+"]; return false; ":h+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" } ",C&&(h+=" else { "),h}},"./packages/node_modules/ajv/lib/dotjs/if.js":function(t){"use strict";t.exports=function generate_if(t,o,c){var h=" ",g=t.level,b=t.dataLevel,P=t.schema[o],j=t.schemaPath+t.util.getProperty(o),E=t.errSchemaPath+"/"+o,C=!t.opts.allErrors,Z="data"+(b||""),R="valid"+g,I="errs__"+g,D=t.util.copy(t);D.level++;var O="valid"+D.level,N=t.schema.then,$=t.schema.else,z=void 0!==N&&(t.opts.strictKeywords?"object"==typeof N&&Object.keys(N).length>0||!1===N:t.util.schemaHasRules(N,t.RULES.all)),F=void 0!==$&&(t.opts.strictKeywords?"object"==typeof $&&Object.keys($).length>0||!1===$:t.util.schemaHasRules($,t.RULES.all)),L=D.baseId;if(z||F){var M;D.createErrors=!1,D.schema=P,D.schemaPath=j,D.errSchemaPath=E,h+=" var "+I+" = errors; var "+R+" = true; ";var q=t.compositeRule;t.compositeRule=D.compositeRule=!0,h+=" "+t.validate(D)+" ",D.baseId=L,D.createErrors=!0,h+=" errors = "+I+"; if (vErrors !== null) { if ("+I+") vErrors.length = "+I+"; else vErrors = null; } ",t.compositeRule=D.compositeRule=q,z?(h+=" if ("+O+") { ",D.schema=t.schema.then,D.schemaPath=t.schemaPath+".then",D.errSchemaPath=t.errSchemaPath+"/then",h+=" "+t.validate(D)+" ",D.baseId=L,h+=" "+R+" = "+O+"; ",z&&F?h+=" var "+(M="ifClause"+g)+" = 'then'; ":M="'then'",h+=" } ",F&&(h+=" else { ")):h+=" if (!"+O+") { ",F&&(D.schema=t.schema.else,D.schemaPath=t.schemaPath+".else",D.errSchemaPath=t.errSchemaPath+"/else",h+=" "+t.validate(D)+" ",D.baseId=L,h+=" "+R+" = "+O+"; ",z&&F?h+=" var "+(M="ifClause"+g)+" = 'else'; ":M="'else'",h+=" } "),h+=" if (!"+R+") { var err = ",!1!==t.createErrors?(h+=" { keyword: 'if' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(E)+" , params: { failingKeyword: "+M+" } ",!1!==t.opts.messages&&(h+=" , message: 'should match \"' + "+M+" + '\" schema' "),t.opts.verbose&&(h+=" , schema: validate.schema"+j+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ",h+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&C&&(t.async?h+=" throw new ValidationError(vErrors); ":h+=" validate.errors = vErrors; return false; "),h+=" } ",C&&(h+=" else { ")}else C&&(h+=" if (true) { ");return h}},"./packages/node_modules/ajv/lib/dotjs/index.js":function(t,o,c){"use strict";t.exports={$ref:c("./packages/node_modules/ajv/lib/dotjs/ref.js"),allOf:c("./packages/node_modules/ajv/lib/dotjs/allOf.js"),anyOf:c("./packages/node_modules/ajv/lib/dotjs/anyOf.js"),$comment:c("./packages/node_modules/ajv/lib/dotjs/comment.js"),const:c("./packages/node_modules/ajv/lib/dotjs/const.js"),contains:c("./packages/node_modules/ajv/lib/dotjs/contains.js"),dependencies:c("./packages/node_modules/ajv/lib/dotjs/dependencies.js"),enum:c("./packages/node_modules/ajv/lib/dotjs/enum.js"),format:c("./packages/node_modules/ajv/lib/dotjs/format.js"),if:c("./packages/node_modules/ajv/lib/dotjs/if.js"),items:c("./packages/node_modules/ajv/lib/dotjs/items.js"),maximum:c("./packages/node_modules/ajv/lib/dotjs/_limit.js"),minimum:c("./packages/node_modules/ajv/lib/dotjs/_limit.js"),maxItems:c("./packages/node_modules/ajv/lib/dotjs/_limitItems.js"),minItems:c("./packages/node_modules/ajv/lib/dotjs/_limitItems.js"),maxLength:c("./packages/node_modules/ajv/lib/dotjs/_limitLength.js"),minLength:c("./packages/node_modules/ajv/lib/dotjs/_limitLength.js"),maxProperties:c("./packages/node_modules/ajv/lib/dotjs/_limitProperties.js"),minProperties:c("./packages/node_modules/ajv/lib/dotjs/_limitProperties.js"),multipleOf:c("./packages/node_modules/ajv/lib/dotjs/multipleOf.js"),not:c("./packages/node_modules/ajv/lib/dotjs/not.js"),oneOf:c("./packages/node_modules/ajv/lib/dotjs/oneOf.js"),pattern:c("./packages/node_modules/ajv/lib/dotjs/pattern.js"),properties:c("./packages/node_modules/ajv/lib/dotjs/properties.js"),propertyNames:c("./packages/node_modules/ajv/lib/dotjs/propertyNames.js"),required:c("./packages/node_modules/ajv/lib/dotjs/required.js"),uniqueItems:c("./packages/node_modules/ajv/lib/dotjs/uniqueItems.js"),validate:c("./packages/node_modules/ajv/lib/dotjs/validate.js")}},"./packages/node_modules/ajv/lib/dotjs/items.js":function(t){"use strict";t.exports=function generate_items(t,o,c){var h=" ",g=t.level,b=t.dataLevel,P=t.schema[o],j=t.schemaPath+t.util.getProperty(o),E=t.errSchemaPath+"/"+o,C=!t.opts.allErrors,Z="data"+(b||""),R="valid"+g,I="errs__"+g,D=t.util.copy(t),O="";D.level++;var N="valid"+D.level,$="i"+g,z=D.dataLevel=t.dataLevel+1,F="data"+z,L=t.baseId;if(h+="var "+I+" = errors;var "+R+";",Array.isArray(P)){var M=t.schema.additionalItems;if(!1===M){h+=" "+R+" = "+Z+".length <= "+P.length+"; ";var q=E;E=t.errSchemaPath+"/additionalItems",h+=" if (!"+R+") { ";var V=V||[];V.push(h),h="",!1!==t.createErrors?(h+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(E)+" , params: { limit: "+P.length+" } ",!1!==t.opts.messages&&(h+=" , message: 'should NOT have more than "+P.length+" items' "),t.opts.verbose&&(h+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var Pe=h;h=V.pop(),!t.compositeRule&&C?t.async?h+=" throw new ValidationError(["+Pe+"]); ":h+=" validate.errors = ["+Pe+"]; return false; ":h+=" var err = "+Pe+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" } ",E=q,C&&(O+="}",h+=" else { ")}var je=P;if(je)for(var De,$e=-1,ze=je.length-1;$e0||!1===De:t.util.schemaHasRules(De,t.RULES.all)){h+=" "+N+" = true; if ("+Z+".length > "+$e+") { ";var Fe=Z+"["+$e+"]";D.schema=De,D.schemaPath=j+"["+$e+"]",D.errSchemaPath=E+"/"+$e,D.errorPath=t.util.getPathExpr(t.errorPath,$e,t.opts.jsonPointers,!0),D.dataPathArr[z]=$e;var Le=t.validate(D);D.baseId=L,t.util.varOccurences(Le,F)<2?h+=" "+t.util.varReplace(Le,F,Fe)+" ":h+=" var "+F+" = "+Fe+"; "+Le+" ",h+=" } ",C&&(h+=" if ("+N+") { ",O+="}")}if("object"==typeof M&&(t.opts.strictKeywords?"object"==typeof M&&Object.keys(M).length>0||!1===M:t.util.schemaHasRules(M,t.RULES.all))){D.schema=M,D.schemaPath=t.schemaPath+".additionalItems",D.errSchemaPath=t.errSchemaPath+"/additionalItems",h+=" "+N+" = true; if ("+Z+".length > "+P.length+") { for (var "+$+" = "+P.length+"; "+$+" < "+Z+".length; "+$+"++) { ",D.errorPath=t.util.getPathExpr(t.errorPath,$,t.opts.jsonPointers,!0);Fe=Z+"["+$+"]";D.dataPathArr[z]=$;Le=t.validate(D);D.baseId=L,t.util.varOccurences(Le,F)<2?h+=" "+t.util.varReplace(Le,F,Fe)+" ":h+=" var "+F+" = "+Fe+"; "+Le+" ",C&&(h+=" if (!"+N+") break; "),h+=" } } ",C&&(h+=" if ("+N+") { ",O+="}")}}else if(t.opts.strictKeywords?"object"==typeof P&&Object.keys(P).length>0||!1===P:t.util.schemaHasRules(P,t.RULES.all)){D.schema=P,D.schemaPath=j,D.errSchemaPath=E,h+=" for (var "+$+" = 0; "+$+" < "+Z+".length; "+$+"++) { ",D.errorPath=t.util.getPathExpr(t.errorPath,$,t.opts.jsonPointers,!0);Fe=Z+"["+$+"]";D.dataPathArr[z]=$;Le=t.validate(D);D.baseId=L,t.util.varOccurences(Le,F)<2?h+=" "+t.util.varReplace(Le,F,Fe)+" ":h+=" var "+F+" = "+Fe+"; "+Le+" ",C&&(h+=" if (!"+N+") break; "),h+=" }"}return C&&(h+=" "+O+" if ("+I+" == errors) {"),h}},"./packages/node_modules/ajv/lib/dotjs/multipleOf.js":function(t){"use strict";t.exports=function generate_multipleOf(t,o,c){var h,g=" ",b=t.level,P=t.dataLevel,j=t.schema[o],E=t.schemaPath+t.util.getProperty(o),C=t.errSchemaPath+"/"+o,Z=!t.opts.allErrors,R="data"+(P||""),I=t.opts.$data&&j&&j.$data;if(I?(g+=" var schema"+b+" = "+t.util.getData(j.$data,P,t.dataPathArr)+"; ",h="schema"+b):h=j,!I&&"number"!=typeof j)throw new Error(o+" must be number");g+="var division"+b+";if (",I&&(g+=" "+h+" !== undefined && ( typeof "+h+" != 'number' || "),g+=" (division"+b+" = "+R+" / "+h+", ",t.opts.multipleOfPrecision?g+=" Math.abs(Math.round(division"+b+") - division"+b+") > 1e-"+t.opts.multipleOfPrecision+" ":g+=" division"+b+" !== parseInt(division"+b+") ",g+=" ) ",I&&(g+=" ) "),g+=" ) { ";var D=D||[];D.push(g),g="",!1!==t.createErrors?(g+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(C)+" , params: { multipleOf: "+h+" } ",!1!==t.opts.messages&&(g+=" , message: 'should be multiple of ",g+=I?"' + "+h:h+"'"),t.opts.verbose&&(g+=" , schema: ",g+=I?"validate.schema"+E:""+j,g+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+R+" "),g+=" } "):g+=" {} ";var O=g;return g=D.pop(),!t.compositeRule&&Z?t.async?g+=" throw new ValidationError(["+O+"]); ":g+=" validate.errors = ["+O+"]; return false; ":g+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+="} ",Z&&(g+=" else { "),g}},"./packages/node_modules/ajv/lib/dotjs/not.js":function(t){"use strict";t.exports=function generate_not(t,o,c){var h=" ",g=t.level,b=t.dataLevel,P=t.schema[o],j=t.schemaPath+t.util.getProperty(o),E=t.errSchemaPath+"/"+o,C=!t.opts.allErrors,Z="data"+(b||""),R="errs__"+g,I=t.util.copy(t);I.level++;var D="valid"+I.level;if(t.opts.strictKeywords?"object"==typeof P&&Object.keys(P).length>0||!1===P:t.util.schemaHasRules(P,t.RULES.all)){I.schema=P,I.schemaPath=j,I.errSchemaPath=E,h+=" var "+R+" = errors; ";var O,N=t.compositeRule;t.compositeRule=I.compositeRule=!0,I.createErrors=!1,I.opts.allErrors&&(O=I.opts.allErrors,I.opts.allErrors=!1),h+=" "+t.validate(I)+" ",I.createErrors=!0,O&&(I.opts.allErrors=O),t.compositeRule=I.compositeRule=N,h+=" if ("+D+") { ";var $=$||[];$.push(h),h="",!1!==t.createErrors?(h+=" { keyword: 'not' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(E)+" , params: {} ",!1!==t.opts.messages&&(h+=" , message: 'should NOT be valid' "),t.opts.verbose&&(h+=" , schema: validate.schema"+j+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var z=h;h=$.pop(),!t.compositeRule&&C?t.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+=" } else { errors = "+R+"; if (vErrors !== null) { if ("+R+") vErrors.length = "+R+"; else vErrors = null; } ",t.opts.allErrors&&(h+=" } ")}else h+=" var err = ",!1!==t.createErrors?(h+=" { keyword: 'not' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(E)+" , params: {} ",!1!==t.opts.messages&&(h+=" , message: 'should NOT be valid' "),t.opts.verbose&&(h+=" , schema: validate.schema"+j+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ",h+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",C&&(h+=" if (false) { ");return h}},"./packages/node_modules/ajv/lib/dotjs/oneOf.js":function(t){"use strict";t.exports=function generate_oneOf(t,o,c){var h=" ",g=t.level,b=t.dataLevel,P=t.schema[o],j=t.schemaPath+t.util.getProperty(o),E=t.errSchemaPath+"/"+o,C=!t.opts.allErrors,Z="data"+(b||""),R="valid"+g,I="errs__"+g,D=t.util.copy(t),O="";D.level++;var N="valid"+D.level,$=D.baseId,z="prevValid"+g,F="passingSchemas"+g;h+="var "+I+" = errors , "+z+" = false , "+R+" = false , "+F+" = null; ";var L=t.compositeRule;t.compositeRule=D.compositeRule=!0;var M=P;if(M)for(var q,V=-1,Pe=M.length-1;V0||!1===q:t.util.schemaHasRules(q,t.RULES.all))?(D.schema=q,D.schemaPath=j+"["+V+"]",D.errSchemaPath=E+"/"+V,h+=" "+t.validate(D)+" ",D.baseId=$):h+=" var "+N+" = true; ",V&&(h+=" if ("+N+" && "+z+") { "+R+" = false; "+F+" = ["+F+", "+V+"]; } else { ",O+="}"),h+=" if ("+N+") { "+R+" = "+z+" = true; "+F+" = "+V+"; }";return t.compositeRule=D.compositeRule=L,h+=O+"if (!"+R+") { var err = ",!1!==t.createErrors?(h+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(E)+" , params: { passingSchemas: "+F+" } ",!1!==t.opts.messages&&(h+=" , message: 'should match exactly one schema in oneOf' "),t.opts.verbose&&(h+=" , schema: validate.schema"+j+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ",h+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&C&&(t.async?h+=" throw new ValidationError(vErrors); ":h+=" validate.errors = vErrors; return false; "),h+="} else { errors = "+I+"; if (vErrors !== null) { if ("+I+") vErrors.length = "+I+"; else vErrors = null; }",t.opts.allErrors&&(h+=" } "),h}},"./packages/node_modules/ajv/lib/dotjs/pattern.js":function(t){"use strict";t.exports=function generate_pattern(t,o,c){var h,g=" ",b=t.level,P=t.dataLevel,j=t.schema[o],E=t.schemaPath+t.util.getProperty(o),C=t.errSchemaPath+"/"+o,Z=!t.opts.allErrors,R="data"+(P||""),I=t.opts.$data&&j&&j.$data;I?(g+=" var schema"+b+" = "+t.util.getData(j.$data,P,t.dataPathArr)+"; ",h="schema"+b):h=j,g+="if ( ",I&&(g+=" ("+h+" !== undefined && typeof "+h+" != 'string') || "),g+=" !"+(I?"(new RegExp("+h+"))":t.usePattern(j))+".test("+R+") ) { ";var D=D||[];D.push(g),g="",!1!==t.createErrors?(g+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(C)+" , params: { pattern: ",g+=I?""+h:""+t.util.toQuotedString(j),g+=" } ",!1!==t.opts.messages&&(g+=" , message: 'should match pattern \"",g+=I?"' + "+h+" + '":""+t.util.escapeQuotes(j),g+="\"' "),t.opts.verbose&&(g+=" , schema: ",g+=I?"validate.schema"+E:""+t.util.toQuotedString(j),g+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+R+" "),g+=" } "):g+=" {} ";var O=g;return g=D.pop(),!t.compositeRule&&Z?t.async?g+=" throw new ValidationError(["+O+"]); ":g+=" validate.errors = ["+O+"]; return false; ":g+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+="} ",Z&&(g+=" else { "),g}},"./packages/node_modules/ajv/lib/dotjs/properties.js":function(t){"use strict";t.exports=function generate_properties(t,o,c){var h=" ",g=t.level,b=t.dataLevel,P=t.schema[o],j=t.schemaPath+t.util.getProperty(o),E=t.errSchemaPath+"/"+o,C=!t.opts.allErrors,Z="data"+(b||""),R="errs__"+g,I=t.util.copy(t),D="";I.level++;var O="valid"+I.level,N="key"+g,$="idx"+g,z=I.dataLevel=t.dataLevel+1,F="data"+z,L="dataProperties"+g,M=Object.keys(P||{}).filter(notProto),q=t.schema.patternProperties||{},V=Object.keys(q).filter(notProto),Pe=t.schema.additionalProperties,je=M.length||V.length,De=!1===Pe,$e="object"==typeof Pe&&Object.keys(Pe).length,ze=t.opts.removeAdditional,Fe=De||$e||ze,Le=t.opts.ownProperties,Me=t.baseId,qe=t.schema.required;if(qe&&(!t.opts.$data||!qe.$data)&&qe.length8)h+=" || validate.schema"+j+".hasOwnProperty("+N+") ";else{var Ve=M;if(Ve)for(var Ke=-1,He=Ve.length-1;Ke0||!1===dt:t.util.schemaHasRules(dt,t.RULES.all)){var ct=t.util.getProperty(nt),ut=(tt=Z+ct,st&&void 0!==dt.default);I.schema=dt,I.schemaPath=j+ct,I.errSchemaPath=E+"/"+t.util.escapeFragment(nt),I.errorPath=t.util.getPath(t.errorPath,nt,t.opts.jsonPointers),I.dataPathArr[z]=t.util.toQuotedString(nt);rt=t.validate(I);if(I.baseId=Me,t.util.varOccurences(rt,F)<2){rt=t.util.varReplace(rt,F,tt);var lt=tt}else{lt=F;h+=" var "+F+" = "+tt+"; "}if(ut)h+=" "+rt+" ";else{if(Ue&&Ue[nt]){h+=" if ( "+lt+" === undefined ",Le&&(h+=" || ! Object.prototype.hasOwnProperty.call("+Z+", '"+t.util.escapeQuotes(nt)+"') "),h+=") { "+O+" = false; ";We=t.errorPath,Ye=E;var pt,mt=t.util.escapeQuotes(nt);t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPath(We,nt,t.opts.jsonPointers)),E=t.errSchemaPath+"/required",(pt=pt||[]).push(h),h="",!1!==t.createErrors?(h+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(E)+" , params: { missingProperty: '"+mt+"' } ",!1!==t.opts.messages&&(h+=" , message: '",t.opts._errorDataPathProperty?h+="is a required property":h+="should have required property \\'"+mt+"\\'",h+="' "),t.opts.verbose&&(h+=" , schema: validate.schema"+j+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";Xe=h;h=pt.pop(),!t.compositeRule&&C?t.async?h+=" throw new ValidationError(["+Xe+"]); ":h+=" validate.errors = ["+Xe+"]; return false; ":h+=" var err = "+Xe+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",E=Ye,t.errorPath=We,h+=" } else { "}else C?(h+=" if ( "+lt+" === undefined ",Le&&(h+=" || ! Object.prototype.hasOwnProperty.call("+Z+", '"+t.util.escapeQuotes(nt)+"') "),h+=") { "+O+" = true; } else { "):(h+=" if ("+lt+" !== undefined ",Le&&(h+=" && Object.prototype.hasOwnProperty.call("+Z+", '"+t.util.escapeQuotes(nt)+"') "),h+=" ) { ");h+=" "+rt+" } "}}C&&(h+=" if ("+O+") { ",D+="}")}}if(V.length){var ht=V;if(ht)for(var ft,gt=-1,vt=ht.length-1;gt0||!1===dt:t.util.schemaHasRules(dt,t.RULES.all)){I.schema=dt,I.schemaPath=t.schemaPath+".patternProperties"+t.util.getProperty(ft),I.errSchemaPath=t.errSchemaPath+"/patternProperties/"+t.util.escapeFragment(ft),h+=Le?" "+L+" = "+L+" || Object.keys("+Z+"); for (var "+$+"=0; "+$+"<"+L+".length; "+$+"++) { var "+N+" = "+L+"["+$+"]; ":" for (var "+N+" in "+Z+") { ",h+=" if ("+t.usePattern(ft)+".test("+N+")) { ",I.errorPath=t.util.getPathExpr(t.errorPath,N,t.opts.jsonPointers);tt=Z+"["+N+"]";I.dataPathArr[z]=N;rt=t.validate(I);I.baseId=Me,t.util.varOccurences(rt,F)<2?h+=" "+t.util.varReplace(rt,F,tt)+" ":h+=" var "+F+" = "+tt+"; "+rt+" ",C&&(h+=" if (!"+O+") break; "),h+=" } ",C&&(h+=" else "+O+" = true; "),h+=" } ",C&&(h+=" if ("+O+") { ",D+="}")}}}return C&&(h+=" "+D+" if ("+R+" == errors) {"),h}},"./packages/node_modules/ajv/lib/dotjs/propertyNames.js":function(t){"use strict";t.exports=function generate_propertyNames(t,o,c){var h=" ",g=t.level,b=t.dataLevel,P=t.schema[o],j=t.schemaPath+t.util.getProperty(o),E=t.errSchemaPath+"/"+o,C=!t.opts.allErrors,Z="data"+(b||""),R="errs__"+g,I=t.util.copy(t);I.level++;var D="valid"+I.level;if(h+="var "+R+" = errors;",t.opts.strictKeywords?"object"==typeof P&&Object.keys(P).length>0||!1===P:t.util.schemaHasRules(P,t.RULES.all)){I.schema=P,I.schemaPath=j,I.errSchemaPath=E;var O="key"+g,N="idx"+g,$="i"+g,z="' + "+O+" + '",F="data"+(I.dataLevel=t.dataLevel+1),L="dataProperties"+g,M=t.opts.ownProperties,q=t.baseId;M&&(h+=" var "+L+" = undefined; "),h+=M?" "+L+" = "+L+" || Object.keys("+Z+"); for (var "+N+"=0; "+N+"<"+L+".length; "+N+"++) { var "+O+" = "+L+"["+N+"]; ":" for (var "+O+" in "+Z+") { ",h+=" var startErrs"+g+" = errors; ";var V=O,Pe=t.compositeRule;t.compositeRule=I.compositeRule=!0;var je=t.validate(I);I.baseId=q,t.util.varOccurences(je,F)<2?h+=" "+t.util.varReplace(je,F,V)+" ":h+=" var "+F+" = "+V+"; "+je+" ",t.compositeRule=I.compositeRule=Pe,h+=" if (!"+D+") { for (var "+$+"=startErrs"+g+"; "+$+"0||!1===L:t.util.schemaHasRules(L,t.RULES.all))||(O[O.length]=$)}}else O=P;if(I||O.length){var M=t.errorPath,q=I||O.length>=t.opts.loopRequired,V=t.opts.ownProperties;if(C)if(h+=" var missing"+g+"; ",q){I||(h+=" var "+D+" = validate.schema"+j+"; ");var Pe="' + "+(Le="schema"+g+"["+($e="i"+g)+"]")+" + '";t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPathExpr(M,Le,t.opts.jsonPointers)),h+=" var "+R+" = true; ",I&&(h+=" if (schema"+g+" === undefined) "+R+" = true; else if (!Array.isArray(schema"+g+")) "+R+" = false; else {"),h+=" for (var "+$e+" = 0; "+$e+" < "+D+".length; "+$e+"++) { "+R+" = "+Z+"["+D+"["+$e+"]] !== undefined ",V&&(h+=" && Object.prototype.hasOwnProperty.call("+Z+", "+D+"["+$e+"]) "),h+="; if (!"+R+") break; } ",I&&(h+=" } "),h+=" if (!"+R+") { ",(Fe=Fe||[]).push(h),h="",!1!==t.createErrors?(h+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(E)+" , params: { missingProperty: '"+Pe+"' } ",!1!==t.opts.messages&&(h+=" , message: '",t.opts._errorDataPathProperty?h+="is a required property":h+="should have required property \\'"+Pe+"\\'",h+="' "),t.opts.verbose&&(h+=" , schema: validate.schema"+j+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+Z+" "),h+=" } "):h+=" {} ";var je=h;h=Fe.pop(),!t.compositeRule&&C?t.async?h+=" throw new ValidationError(["+je+"]); ":h+=" validate.errors = ["+je+"]; return false; ":h+=" var err = "+je+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h+=" } else { "}else{h+=" if ( ";var De=O;if(De)for(var $e=-1,ze=De.length-1;$e 1) { ";var O=t.schema.items&&t.schema.items.type,N=Array.isArray(O);if(!O||"object"==O||"array"==O||N&&(O.indexOf("object")>=0||O.indexOf("array")>=0))g+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+R+"[i], "+R+"[j])) { "+I+" = false; break outer; } } } ";else{g+=" var itemIndices = {}, item; for (;i--;) { var item = "+R+"[i]; ";var $="checkDataType"+(N?"s":"");g+=" if ("+t.util[$](O,"item",t.opts.strictNumbers,!0)+") continue; ",N&&(g+=" if (typeof item == 'string') item = '\"' + item; "),g+=" if (typeof itemIndices[item] == 'number') { "+I+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}g+=" } ",D&&(g+=" } "),g+=" if (!"+I+") { ";var z=z||[];z.push(g),g="",!1!==t.createErrors?(g+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(C)+" , params: { i: i, j: j } ",!1!==t.opts.messages&&(g+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),t.opts.verbose&&(g+=" , schema: ",g+=D?"validate.schema"+E:""+j,g+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+R+" "),g+=" } "):g+=" {} ";var F=g;g=z.pop(),!t.compositeRule&&Z?t.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 { ")}else Z&&(g+=" if (true) { ");return g}},"./packages/node_modules/ajv/lib/dotjs/validate.js":function(t){"use strict";t.exports=function generate_validate(t,o,c){var h="",g=!0===t.schema.$async,b=t.util.schemaHasRulesExcept(t.schema,t.RULES.all,"$ref"),P=t.self._getId(t.schema);if(t.opts.strictKeywords){var j=t.util.schemaUnknownRules(t.schema,t.RULES.keywords);if(j){var E="unknown keyword: "+j;if("log"!==t.opts.strictKeywords)throw new Error(E);t.logger.warn(E)}}if(t.isTop&&(h+=" var validate = ",g&&(t.async=!0,h+="async "),h+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",P&&(t.opts.sourceCode||t.opts.processCode)&&(h+=" /*# sourceURL="+P+" */ ")),"boolean"==typeof t.schema||!b&&!t.schema.$ref){o="false schema";var C=t.level,Z=t.dataLevel,R=t.schema[o],I=t.schemaPath+t.util.getProperty(o),D=t.errSchemaPath+"/"+o,O=!t.opts.allErrors,N="data"+(Z||""),$="valid"+C;if(!1===t.schema){t.isTop?O=!0:h+=" var "+$+" = false; ",(it=it||[]).push(h),h="",!1!==t.createErrors?(h+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(D)+" , params: {} ",!1!==t.opts.messages&&(h+=" , message: 'boolean schema is false' "),t.opts.verbose&&(h+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+N+" "),h+=" } "):h+=" {} ";var z=h;h=it.pop(),!t.compositeRule&&O?t.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++; "}else t.isTop?h+=g?" return data; ":" validate.errors = null; return true; ":h+=" var "+$+" = true; ";return t.isTop&&(h+=" }; return validate; "),h}if(t.isTop){var F=t.isTop;C=t.level=0,Z=t.dataLevel=0,N="data";if(t.rootId=t.resolve.fullPath(t.self._getId(t.root.schema)),t.baseId=t.baseId||t.rootId,delete t.isTop,t.dataPathArr=[""],void 0!==t.schema.default&&t.opts.useDefaults&&t.opts.strictDefaults){var L="default is ignored in the schema root";if("log"!==t.opts.strictDefaults)throw new Error(L);t.logger.warn(L)}h+=" var vErrors = null; ",h+=" var errors = 0; ",h+=" if (rootData === undefined) rootData = data; "}else{C=t.level,N="data"+((Z=t.dataLevel)||"");if(P&&(t.baseId=t.resolve.url(t.baseId,P)),g&&!t.async)throw new Error("async schema in sync schema");h+=" var errs_"+C+" = errors;"}$="valid"+C,O=!t.opts.allErrors;var M="",q="",V=t.schema.type,Pe=Array.isArray(V);if(V&&t.opts.nullable&&!0===t.schema.nullable&&(Pe?-1==V.indexOf("null")&&(V=V.concat("null")):"null"!=V&&(V=[V,"null"],Pe=!0)),Pe&&1==V.length&&(V=V[0],Pe=!1),t.schema.$ref&&b){if("fail"==t.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+t.errSchemaPath+'" (see option extendRefs)');!0!==t.opts.extendRefs&&(b=!1,t.logger.warn('$ref: keywords ignored in schema at path "'+t.errSchemaPath+'"'))}if(t.schema.$comment&&t.opts.$comment&&(h+=" "+t.RULES.all.$comment.code(t,"$comment")),V){if(t.opts.coerceTypes)var je=t.util.coerceToTypes(t.opts.coerceTypes,V);var De=t.RULES.types[V];if(je||Pe||!0===De||De&&!$shouldUseGroup(De)){I=t.schemaPath+".type",D=t.errSchemaPath+"/type",I=t.schemaPath+".type",D=t.errSchemaPath+"/type";var $e=Pe?"checkDataTypes":"checkDataType";if(h+=" if ("+t.util[$e](V,N,t.opts.strictNumbers,!0)+") { ",je){var ze="dataType"+C,Fe="coerced"+C;h+=" var "+ze+" = typeof "+N+"; var "+Fe+" = undefined; ","array"==t.opts.coerceTypes&&(h+=" if ("+ze+" == 'object' && Array.isArray("+N+") && "+N+".length == 1) { "+N+" = "+N+"[0]; "+ze+" = typeof "+N+"; if ("+t.util.checkDataType(t.schema.type,N,t.opts.strictNumbers)+") "+Fe+" = "+N+"; } "),h+=" if ("+Fe+" !== undefined) ; ";var Le=je;if(Le)for(var Me,qe=-1,Ue=Le.length-1;qe1){o[0]=o[0].slice(0,-1);for(var h=o.length-1,g=1;g= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=b-P,F=Math.floor,L=String.fromCharCode;function error$1(t){throw new RangeError($[t])}function map(t,o){for(var c=[],h=t.length;h--;)c[h]=o(t[h]);return c}function mapDomain(t,o){var c=t.split("@"),h="";return c.length>1&&(h=c[0]+"@",t=c[1]),h+map((t=t.replace(N,".")).split("."),o).join(".")}function ucs2decode(t){for(var o=[],c=0,h=t.length;c=55296&&g<=56319&&c>1,t+=F(t/o);t>z*j>>1;h+=b)t=F(t/z);return F(h+(z+1)*t/(t+E))},Pe=function decode(t){var o=[],c=t.length,h=0,E=R,C=Z,D=t.lastIndexOf(I);D<0&&(D=0);for(var O=0;O=128&&error$1("not-basic"),o.push(t.charCodeAt(O));for(var N=D>0?D+1:0;N=c&&error$1("invalid-input");var q=M(t.charCodeAt(N++));(q>=b||q>F((g-h)/z))&&error$1("overflow"),h+=q*z;var Pe=L<=C?P:L>=C+j?j:L-C;if(qF(g/je)&&error$1("overflow"),z*=je}var De=o.length+1;C=V(h-$,De,0==$),F(h/De)>g-E&&error$1("overflow"),E+=F(h/De),h%=De,o.splice(h++,0,E)}return String.fromCodePoint.apply(String,o)},je=function encode(t){var o=[],c=(t=ucs2decode(t)).length,h=R,E=0,C=Z,D=!0,O=!1,N=void 0;try{for(var $,z=t[Symbol.iterator]();!(D=($=z.next()).done);D=!0){var M=$.value;M<128&&o.push(L(M))}}catch(t){O=!0,N=t}finally{try{!D&&z.return&&z.return()}finally{if(O)throw N}}var Pe=o.length,je=Pe;for(Pe&&o.push(I);je=h&&qeF((g-E)/Ue)&&error$1("overflow"),E+=(De-h)*Ue,h=De;var Ve=!0,Ke=!1,He=void 0;try{for(var Be,Qe=t[Symbol.iterator]();!(Ve=(Be=Qe.next()).done);Ve=!0){var Je=Be.value;if(Jeg&&error$1("overflow"),Je==h){for(var We=E,Ge=b;;Ge+=b){var Ye=Ge<=C?P:Ge>=C+j?j:Ge-C;if(We>6|192).toString(16).toUpperCase()+"%"+(63&o|128).toString(16).toUpperCase():"%"+(o>>12|224).toString(16).toUpperCase()+"%"+(o>>6&63|128).toString(16).toUpperCase()+"%"+(63&o|128).toString(16).toUpperCase()}function pctDecChars(t){for(var o="",c=0,h=t.length;c=194&&g<224){if(h-c>=6){var b=parseInt(t.substr(c+4,2),16);o+=String.fromCharCode((31&g)<<6|63&b)}else o+=t.substr(c,6);c+=6}else if(g>=224){if(h-c>=9){var P=parseInt(t.substr(c+4,2),16),j=parseInt(t.substr(c+7,2),16);o+=String.fromCharCode((15&g)<<12|(63&P)<<6|63&j)}else o+=t.substr(c,9);c+=9}else o+=t.substr(c,3),c+=3}return o}function _normalizeComponentEncoding(t,o){function decodeUnreserved(t){var c=pctDecChars(t);return c.match(o.UNRESERVED)?c:t}return t.scheme&&(t.scheme=String(t.scheme).replace(o.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(o.NOT_SCHEME,"")),void 0!==t.userinfo&&(t.userinfo=String(t.userinfo).replace(o.PCT_ENCODED,decodeUnreserved).replace(o.NOT_USERINFO,pctEncChar).replace(o.PCT_ENCODED,toUpperCase)),void 0!==t.host&&(t.host=String(t.host).replace(o.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(o.NOT_HOST,pctEncChar).replace(o.PCT_ENCODED,toUpperCase)),void 0!==t.path&&(t.path=String(t.path).replace(o.PCT_ENCODED,decodeUnreserved).replace(t.scheme?o.NOT_PATH:o.NOT_PATH_NOSCHEME,pctEncChar).replace(o.PCT_ENCODED,toUpperCase)),void 0!==t.query&&(t.query=String(t.query).replace(o.PCT_ENCODED,decodeUnreserved).replace(o.NOT_QUERY,pctEncChar).replace(o.PCT_ENCODED,toUpperCase)),void 0!==t.fragment&&(t.fragment=String(t.fragment).replace(o.PCT_ENCODED,decodeUnreserved).replace(o.NOT_FRAGMENT,pctEncChar).replace(o.PCT_ENCODED,toUpperCase)),t}function _stripLeadingZeros(t){return t.replace(/^0*(.*)/,"$1")||"0"}function _normalizeIPv4(t,o){var c=t.match(o.IPV4ADDRESS)||[],g=h(c,2)[1];return g?g.split(".").map(_stripLeadingZeros).join("."):t}function _normalizeIPv6(t,o){var c=t.match(o.IPV6ADDRESS)||[],g=h(c,3),b=g[1],P=g[2];if(b){for(var j=b.toLowerCase().split("::").reverse(),E=h(j,2),C=E[0],Z=E[1],R=Z?Z.split(":").map(_stripLeadingZeros):[],I=C.split(":").map(_stripLeadingZeros),D=o.IPV4ADDRESS.test(I[I.length-1]),O=D?7:8,N=I.length-O,$=Array(O),z=0;z1){var M=$.slice(0,F.index),q=$.slice(F.index+F.length);L=M.join(":")+"::"+q.join(":")}else L=$.join(":");return P&&(L+="%"+P),L}return t}var Le=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Me=void 0==="".match(/(){0}/)[1];function parse(t){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g={},b=!1!==h.iri?c:o;"suffix"===h.reference&&(t=(h.scheme?h.scheme+":":"")+"//"+t);var P=t.match(Le);if(P){Me?(g.scheme=P[1],g.userinfo=P[3],g.host=P[4],g.port=parseInt(P[5],10),g.path=P[6]||"",g.query=P[7],g.fragment=P[8],isNaN(g.port)&&(g.port=P[5])):(g.scheme=P[1]||void 0,g.userinfo=-1!==t.indexOf("@")?P[3]:void 0,g.host=-1!==t.indexOf("//")?P[4]:void 0,g.port=parseInt(P[5],10),g.path=P[6]||"",g.query=-1!==t.indexOf("?")?P[7]:void 0,g.fragment=-1!==t.indexOf("#")?P[8]:void 0,isNaN(g.port)&&(g.port=t.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?P[4]:void 0)),g.host&&(g.host=_normalizeIPv6(_normalizeIPv4(g.host,b),b)),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 j=Fe[(h.scheme||g.scheme||"").toLowerCase()];if(h.unicodeSupport||j&&j.unicodeSupport)_normalizeComponentEncoding(g,b);else{if(g.host&&(h.domainHost||j&&j.domainHost))try{g.host=ze.toASCII(g.host.replace(b.PCT_ENCODED,pctDecChars).toLowerCase())}catch(t){g.error=g.error||"Host's domain name can not be converted to ASCII via punycode: "+t}_normalizeComponentEncoding(g,o)}j&&j.parse&&j.parse(g,h)}else g.error=g.error||"URI can not be parsed.";return g}function _recomposeAuthority(t,h){var g=!1!==h.iri?c:o,b=[];return void 0!==t.userinfo&&(b.push(t.userinfo),b.push("@")),void 0!==t.host&&b.push(_normalizeIPv6(_normalizeIPv4(String(t.host),g),g).replace(g.IPV6ADDRESS,function(t,o,c){return"["+o+(c?"%25"+c:"")+"]"})),"number"!=typeof t.port&&"string"!=typeof t.port||(b.push(":"),b.push(String(t.port))),b.length?b.join(""):void 0}var qe=/^\.\.?\//,Ue=/^\/\.(\/|$)/,Ve=/^\/\.\.(\/|$)/,Ke=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(t){for(var o=[];t.length;)if(t.match(qe))t=t.replace(qe,"");else if(t.match(Ue))t=t.replace(Ue,"/");else if(t.match(Ve))t=t.replace(Ve,"/"),o.pop();else if("."===t||".."===t)t="";else{var c=t.match(Ke);if(!c)throw new Error("Unexpected dot segment condition");var h=c[0];t=t.slice(h.length),o.push(h)}return o.join("")}function serialize(t){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=h.iri?c:o,b=[],P=Fe[(h.scheme||t.scheme||"").toLowerCase()];if(P&&P.serialize&&P.serialize(t,h),t.host)if(g.IPV6ADDRESS.test(t.host));else if(h.domainHost||P&&P.domainHost)try{t.host=h.iri?ze.toUnicode(t.host):ze.toASCII(t.host.replace(g.PCT_ENCODED,pctDecChars).toLowerCase())}catch(o){t.error=t.error||"Host's domain name can not be converted to "+(h.iri?"Unicode":"ASCII")+" via punycode: "+o}_normalizeComponentEncoding(t,g),"suffix"!==h.reference&&t.scheme&&(b.push(t.scheme),b.push(":"));var j=_recomposeAuthority(t,h);if(void 0!==j&&("suffix"!==h.reference&&b.push("//"),b.push(j),t.path&&"/"!==t.path.charAt(0)&&b.push("/")),void 0!==t.path){var E=t.path;h.absolutePath||P&&P.absolutePath||(E=removeDotSegments(E)),void 0===j&&(E=E.replace(/^\/\//,"/%2F")),b.push(E)}return void 0!==t.query&&(b.push("?"),b.push(t.query)),void 0!==t.fragment&&(b.push("#"),b.push(t.fragment)),b.join("")}function resolveComponents(t,o){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},h={};return arguments[3]||(t=parse(serialize(t,c),c),o=parse(serialize(o,c),c)),!(c=c||{}).tolerant&&o.scheme?(h.scheme=o.scheme,h.userinfo=o.userinfo,h.host=o.host,h.port=o.port,h.path=removeDotSegments(o.path||""),h.query=o.query):(void 0!==o.userinfo||void 0!==o.host||void 0!==o.port?(h.userinfo=o.userinfo,h.host=o.host,h.port=o.port,h.path=removeDotSegments(o.path||""),h.query=o.query):(o.path?("/"===o.path.charAt(0)?h.path=removeDotSegments(o.path):(void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?h.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+o.path:h.path=o.path:h.path="/"+o.path,h.path=removeDotSegments(h.path)),h.query=o.query):(h.path=t.path,void 0!==o.query?h.query=o.query:h.query=t.query),h.userinfo=t.userinfo,h.host=t.host,h.port=t.port),h.scheme=t.scheme),h.fragment=o.fragment,h}function resolve(t,o,c){var h=assign({scheme:"null"},c);return serialize(resolveComponents(parse(t,h),parse(o,h),h,!0),h)}function normalize(t,o){return"string"==typeof t?t=serialize(parse(t,o),o):"object"===typeOf(t)&&(t=parse(serialize(t,o),o)),t}function equal(t,o,c){return"string"==typeof t?t=serialize(parse(t,c),c):"object"===typeOf(t)&&(t=serialize(t,c)),"string"==typeof o?o=serialize(parse(o,c),c):"object"===typeOf(o)&&(o=serialize(o,c)),t===o}function escapeComponent(t,h){return t&&t.toString().replace(h&&h.iri?c.ESCAPE:o.ESCAPE,pctEncChar)}function unescapeComponent(t,h){return t&&t.toString().replace(h&&h.iri?c.PCT_ENCODED:o.PCT_ENCODED,pctDecChars)}var He={scheme:"http",domainHost:!0,parse:function parse(t,o){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t},serialize:function serialize(t,o){var c="https"===String(t.scheme).toLowerCase();return t.port!==(c?443:80)&&""!==t.port||(t.port=void 0),t.path||(t.path="/"),t}},Be={scheme:"https",domainHost:He.domainHost,parse:He.parse,serialize:He.serialize};function isSecure(t){return"boolean"==typeof t.secure?t.secure:"wss"===String(t.scheme).toLowerCase()}var Qe={scheme:"ws",domainHost:!0,parse:function parse(t,o){var c=t;return c.secure=isSecure(c),c.resourceName=(c.path||"/")+(c.query?"?"+c.query:""),c.path=void 0,c.query=void 0,c},serialize:function serialize(t,o){if(t.port!==(isSecure(t)?443:80)&&""!==t.port||(t.port=void 0),"boolean"==typeof t.secure&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){var c=t.resourceName.split("?"),g=h(c,2),b=g[0],P=g[1];t.path=b&&"/"!==b?b:void 0,t.query=P,t.resourceName=void 0}return t.fragment=void 0,t}},Je={scheme:"wss",domainHost:Qe.domainHost,parse:Qe.parse,serialize:Qe.serialize},We={},Ge="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Ye="[0-9A-Fa-f]",Xe=subexp(subexp("%[EFef]"+Ye+"%"+Ye+Ye+"%"+Ye+Ye)+"|"+subexp("%[89A-Fa-f]"+Ye+"%"+Ye+Ye)+"|"+subexp("%"+Ye+Ye)),et="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",tt=merge("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),rt="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",st=new RegExp(Ge,"g"),at=new RegExp(Xe,"g"),nt=new RegExp(merge("[^]",et,"[\\.]",'[\\"]',tt),"g"),ot=new RegExp(merge("[^]",Ge,rt),"g"),it=ot;function decodeUnreserved(t){var o=pctDecChars(t);return o.match(st)?o:t}var dt={scheme:"mailto",parse:function parse$$1(t,o){var c=t,h=c.to=c.path?c.path.split(","):[];if(c.path=void 0,c.query){for(var g=!1,b={},P=c.query.split("&"),j=0,E=P.length;j{if(o.description)try{return{...t,...JSON.parse(o.description)}}catch{}return t},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=t=>"string"==typeof t?{...g,name:t}:{...g,...t}},"./packages/node_modules/zod-to-json-schema/dist/esm/Refs.js":function(t,o,c){"use strict";c.r(o),c.d(o,{getRefs:function(){return getRefs}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/Options.js");const getRefs=t=>{const o=(0,h.getDefaultOptions)(t),c=void 0!==o.name?[...o.basePath,o.definitionPath,o.name]:o.basePath;return{...o,flags:{hasReferencedOpenAiAnyType:!1},currentPath:c,propertyPath:void 0,seen:new Map(Object.entries(o.definitions).map(([t,c])=>[c._def,{def:c._def,path:[...o.basePath,o.definitionPath,t],jsonSchema:void 0}]))}}},"./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js":function(t,o,c){"use strict";function addErrorMessage(t,o,c,h){h?.errorMessages&&c&&(t.errorMessage={...t.errorMessage,[o]:c})}function setResponseValueAndErrors(t,o,c,h,g){t[o]=c,addErrorMessage(t,o,h,g)}c.r(o),c.d(o,{addErrorMessage:function(){return addErrorMessage},setResponseValueAndErrors:function(){return setResponseValueAndErrors}})},"./packages/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js":function(t,o,c){"use strict";c.r(o),c.d(o,{getRelativePath:function(){return getRelativePath}});const getRelativePath=(t,o)=>{let c=0;for(;c{switch(o.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:(0,b.getRelativePath)(o.currentPath,t.path)};case"none":case"seen":return t.path.lengtho.currentPath[c]===t)?(console.warn(`Recursive reference detected at ${o.currentPath.join("/")}! Defaulting to any`),(0,P.parseAnyDef)(o)):"seen"===o.$refStrategy?(0,P.parseAnyDef)(o):void 0}},addMeta=(t,o,c)=>(t.description&&(c.description=t.description,o.markdownDescription&&(c.markdownDescription=t.description)),c)},"./packages/node_modules/zod-to-json-schema/dist/esm/parseTypes.js":function(t,o,c){"use strict";c.r(o)},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseAnyDef:function(){return parseAnyDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js");function parseAnyDef(t){if("openAi"!==t.target)return{};const o=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===t.$refStrategy?(0,h.getRelativePath)(o,t.currentPath):o.join("/")}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/array.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseArrayDef:function(){return parseArrayDef}});var h=c("./packages/node_modules/zod/v3/types.js"),g=c("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),b=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseArrayDef(t,o){const c={type:"array"};return t.type?._def&&t.type?._def?.typeName!==h.ZodFirstPartyTypeKind.ZodAny&&(c.items=(0,b.parseDef)(t.type._def,{...o,currentPath:[...o.currentPath,"items"]})),t.minLength&&(0,g.setResponseValueAndErrors)(c,"minItems",t.minLength.value,t.minLength.message,o),t.maxLength&&(0,g.setResponseValueAndErrors)(c,"maxItems",t.maxLength.value,t.maxLength.message,o),t.exactLength&&((0,g.setResponseValueAndErrors)(c,"minItems",t.exactLength.value,t.exactLength.message,o),(0,g.setResponseValueAndErrors)(c,"maxItems",t.exactLength.value,t.exactLength.message,o)),c}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseBigintDef:function(){return parseBigintDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseBigintDef(t,o){const c={type:"integer",format:"int64"};if(!t.checks)return c;for(const g of t.checks)switch(g.kind){case"min":"jsonSchema7"===o.target?g.inclusive?(0,h.setResponseValueAndErrors)(c,"minimum",g.value,g.message,o):(0,h.setResponseValueAndErrors)(c,"exclusiveMinimum",g.value,g.message,o):(g.inclusive||(c.exclusiveMinimum=!0),(0,h.setResponseValueAndErrors)(c,"minimum",g.value,g.message,o));break;case"max":"jsonSchema7"===o.target?g.inclusive?(0,h.setResponseValueAndErrors)(c,"maximum",g.value,g.message,o):(0,h.setResponseValueAndErrors)(c,"exclusiveMaximum",g.value,g.message,o):(g.inclusive||(c.exclusiveMaximum=!0),(0,h.setResponseValueAndErrors)(c,"maximum",g.value,g.message,o));break;case"multipleOf":(0,h.setResponseValueAndErrors)(c,"multipleOf",g.value,g.message,o)}return c}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js":function(t,o,c){"use strict";function parseBooleanDef(){return{type:"boolean"}}c.r(o),c.d(o,{parseBooleanDef:function(){return parseBooleanDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseBrandedDef:function(){return parseBrandedDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseBrandedDef(t,o){return(0,h.parseDef)(t.type._def,o)}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseCatchDef:function(){return parseCatchDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parseCatchDef=(t,o)=>(0,h.parseDef)(t.innerType._def,o)},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/date.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseDateDef:function(){return parseDateDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseDateDef(t,o,c){const h=c??o.dateStrategy;if(Array.isArray(h))return{anyOf:h.map((c,h)=>parseDateDef(t,o,c))};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(t,o)}}const integerDateParser=(t,o)=>{const c={type:"integer",format:"unix-time"};if("openApi3"===o.target)return c;for(const g of t.checks)switch(g.kind){case"min":(0,h.setResponseValueAndErrors)(c,"minimum",g.value,g.message,o);break;case"max":(0,h.setResponseValueAndErrors)(c,"maximum",g.value,g.message,o)}return c}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/default.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseDefaultDef:function(){return parseDefaultDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseDefaultDef(t,o){return{...(0,h.parseDef)(t.innerType._def,o),default:t.defaultValue()}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseEffectsDef:function(){return parseEffectsDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseEffectsDef(t,o){return"input"===o.effectStrategy?(0,h.parseDef)(t.schema._def,o):(0,g.parseAnyDef)(o)}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js":function(t,o,c){"use strict";function parseEnumDef(t){return{type:"string",enum:Array.from(t.values)}}c.r(o),c.d(o,{parseEnumDef:function(){return parseEnumDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseIntersectionDef:function(){return parseIntersectionDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const isJsonSchema7AllOfType=t=>(!("type"in t)||"string"!==t.type)&&"allOf"in t;function parseIntersectionDef(t,o){const c=[(0,h.parseDef)(t.left._def,{...o,currentPath:[...o.currentPath,"allOf","0"]}),(0,h.parseDef)(t.right._def,{...o,currentPath:[...o.currentPath,"allOf","1"]})].filter(t=>!!t);let g="jsonSchema2019-09"===o.target?{unevaluatedProperties:!1}:void 0;const b=[];return c.forEach(t=>{if(isJsonSchema7AllOfType(t))b.push(...t.allOf),void 0===t.unevaluatedProperties&&(g=void 0);else{let o=t;if("additionalProperties"in t&&!1===t.additionalProperties){const{additionalProperties:c,...h}=t;o=h}else g=void 0;b.push(o)}}),b.length?{allOf:b,...g}:void 0}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js":function(t,o,c){"use strict";function parseLiteralDef(t,o){const c=typeof t.value;return"bigint"!==c&&"number"!==c&&"boolean"!==c&&"string"!==c?{type:Array.isArray(t.value)?"array":"object"}:"openApi3"===o.target?{type:"bigint"===c?"integer":c,enum:[t.value]}:{type:"bigint"===c?"integer":c,const:t.value}}c.r(o),c.d(o,{parseLiteralDef:function(){return parseLiteralDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/map.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseMapDef:function(){return parseMapDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),b=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseMapDef(t,o){if("record"===o.mapStrategy)return(0,g.parseRecordDef)(t,o);return{type:"array",maxItems:125,items:{type:"array",items:[(0,h.parseDef)(t.keyType._def,{...o,currentPath:[...o.currentPath,"items","items","0"]})||(0,b.parseAnyDef)(o),(0,h.parseDef)(t.valueType._def,{...o,currentPath:[...o.currentPath,"items","items","1"]})||(0,b.parseAnyDef)(o)],minItems:2,maxItems:2}}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js":function(t,o,c){"use strict";function parseNativeEnumDef(t){const o=t.values,c=Object.keys(t.values).filter(t=>"number"!=typeof o[o[t]]).map(t=>o[t]),h=Array.from(new Set(c.map(t=>typeof t)));return{type:1===h.length?"string"===h[0]?"string":"number":["string","number"],enum:c}}c.r(o),c.d(o,{parseNativeEnumDef:function(){return parseNativeEnumDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/never.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseNeverDef:function(){return parseNeverDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseNeverDef(t){return"openAi"===t.target?void 0:{not:(0,h.parseAnyDef)({...t,currentPath:[...t.currentPath,"not"]})}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/null.js":function(t,o,c){"use strict";function parseNullDef(t){return"openApi3"===t.target?{enum:["null"],nullable:!0}:{type:"null"}}c.r(o),c.d(o,{parseNullDef:function(){return parseNullDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseNullableDef:function(){return parseNullableDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/union.js");function parseNullableDef(t,o){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return"openApi3"===o.target?{type:g.primitiveMappings[t.innerType._def.typeName],nullable:!0}:{type:[g.primitiveMappings[t.innerType._def.typeName],"null"]};if("openApi3"===o.target){const c=(0,h.parseDef)(t.innerType._def,{...o,currentPath:[...o.currentPath]});return c&&"$ref"in c?{allOf:[c],nullable:!0}:c&&{...c,nullable:!0}}const c=(0,h.parseDef)(t.innerType._def,{...o,currentPath:[...o.currentPath,"anyOf","0"]});return c&&{anyOf:[c,{type:"null"}]}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/number.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseNumberDef:function(){return parseNumberDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseNumberDef(t,o){const c={type:"number"};if(!t.checks)return c;for(const g of t.checks)switch(g.kind){case"int":c.type="integer",(0,h.addErrorMessage)(c,"type",g.message,o);break;case"min":"jsonSchema7"===o.target?g.inclusive?(0,h.setResponseValueAndErrors)(c,"minimum",g.value,g.message,o):(0,h.setResponseValueAndErrors)(c,"exclusiveMinimum",g.value,g.message,o):(g.inclusive||(c.exclusiveMinimum=!0),(0,h.setResponseValueAndErrors)(c,"minimum",g.value,g.message,o));break;case"max":"jsonSchema7"===o.target?g.inclusive?(0,h.setResponseValueAndErrors)(c,"maximum",g.value,g.message,o):(0,h.setResponseValueAndErrors)(c,"exclusiveMaximum",g.value,g.message,o):(g.inclusive||(c.exclusiveMaximum=!0),(0,h.setResponseValueAndErrors)(c,"maximum",g.value,g.message,o));break;case"multipleOf":(0,h.setResponseValueAndErrors)(c,"multipleOf",g.value,g.message,o)}return c}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/object.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseObjectDef:function(){return parseObjectDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseObjectDef(t,o){const c="openAi"===o.target,g={type:"object",properties:{}},b=[],P=t.shape();for(const t in P){let j=P[t];if(void 0===j||void 0===j._def)continue;let E=safeIsOptional(j);E&&c&&("ZodOptional"===j._def.typeName&&(j=j._def.innerType),j.isNullable()||(j=j.nullable()),E=!1);const C=(0,h.parseDef)(j._def,{...o,currentPath:[...o.currentPath,"properties",t],propertyPath:[...o.currentPath,"properties",t]});void 0!==C&&(g.properties[t]=C,E||b.push(t))}b.length&&(g.required=b);const j=function decideAdditionalProperties(t,o){if("ZodNever"!==t.catchall._def.typeName)return(0,h.parseDef)(t.catchall._def,{...o,currentPath:[...o.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return o.allowedAdditionalProperties;case"strict":return o.rejectedAdditionalProperties;case"strip":return"strict"===o.removeAdditionalStrategy?o.allowedAdditionalProperties:o.rejectedAdditionalProperties}}(t,o);return void 0!==j&&(g.additionalProperties=j),g}function safeIsOptional(t){try{return t.isOptional()}catch{return!0}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseOptionalDef:function(){return parseOptionalDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");const parseOptionalDef=(t,o)=>{if(o.currentPath.toString()===o.propertyPath?.toString())return(0,h.parseDef)(t.innerType._def,o);const c=(0,h.parseDef)(t.innerType._def,{...o,currentPath:[...o.currentPath,"anyOf","1"]});return c?{anyOf:[{not:(0,g.parseAnyDef)(o)},c]}:(0,g.parseAnyDef)(o)}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parsePipelineDef:function(){return parsePipelineDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parsePipelineDef=(t,o)=>{if("input"===o.pipeStrategy)return(0,h.parseDef)(t.in._def,o);if("output"===o.pipeStrategy)return(0,h.parseDef)(t.out._def,o);const c=(0,h.parseDef)(t.in._def,{...o,currentPath:[...o.currentPath,"allOf","0"]});return{allOf:[c,(0,h.parseDef)(t.out._def,{...o,currentPath:[...o.currentPath,"allOf",c?"1":"0"]})].filter(t=>void 0!==t)}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parsePromiseDef:function(){return parsePromiseDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parsePromiseDef(t,o){return(0,h.parseDef)(t.type._def,o)}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseReadonlyDef:function(){return parseReadonlyDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parseReadonlyDef=(t,o)=>(0,h.parseDef)(t.innerType._def,o)},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/record.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseRecordDef:function(){return parseRecordDef}});var h=c("./packages/node_modules/zod/v3/types.js"),g=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),b=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),P=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),j=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseRecordDef(t,o){if("openAi"===o.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===o.target&&t.keyType?._def.typeName===h.ZodFirstPartyTypeKind.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((c,h)=>({...c,[h]:(0,g.parseDef)(t.valueType._def,{...o,currentPath:[...o.currentPath,"properties",h]})??(0,j.parseAnyDef)(o)}),{}),additionalProperties:o.rejectedAdditionalProperties};const c={type:"object",additionalProperties:(0,g.parseDef)(t.valueType._def,{...o,currentPath:[...o.currentPath,"additionalProperties"]})??o.allowedAdditionalProperties};if("openApi3"===o.target)return c;if(t.keyType?._def.typeName===h.ZodFirstPartyTypeKind.ZodString&&t.keyType._def.checks?.length){const{type:h,...g}=(0,b.parseStringDef)(t.keyType._def,o);return{...c,propertyNames:g}}if(t.keyType?._def.typeName===h.ZodFirstPartyTypeKind.ZodEnum)return{...c,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===h.ZodFirstPartyTypeKind.ZodBranded&&t.keyType._def.type._def.typeName===h.ZodFirstPartyTypeKind.ZodString&&t.keyType._def.type._def.checks?.length){const{type:h,...g}=(0,P.parseBrandedDef)(t.keyType._def,o);return{...c,propertyNames:g}}return c}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/set.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseSetDef:function(){return parseSetDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),g=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseSetDef(t,o){const c={type:"array",uniqueItems:!0,items:(0,g.parseDef)(t.valueType._def,{...o,currentPath:[...o.currentPath,"items"]})};return t.minSize&&(0,h.setResponseValueAndErrors)(c,"minItems",t.minSize.value,t.minSize.message,o),t.maxSize&&(0,h.setResponseValueAndErrors)(c,"maxItems",t.maxSize.value,t.maxSize.message,o),c}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/string.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseStringDef:function(){return parseStringDef},zodPatterns:function(){return b}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");let g;const b={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(t,o){const c={type:"string"};if(t.checks)for(const g of t.checks)switch(g.kind){case"min":(0,h.setResponseValueAndErrors)(c,"minLength","number"==typeof c.minLength?Math.max(c.minLength,g.value):g.value,g.message,o);break;case"max":(0,h.setResponseValueAndErrors)(c,"maxLength","number"==typeof c.maxLength?Math.min(c.maxLength,g.value):g.value,g.message,o);break;case"email":switch(o.emailStrategy){case"format:email":addFormat(c,"email",g.message,o);break;case"format:idn-email":addFormat(c,"idn-email",g.message,o);break;case"pattern:zod":addPattern(c,b.email,g.message,o)}break;case"url":addFormat(c,"uri",g.message,o);break;case"uuid":addFormat(c,"uuid",g.message,o);break;case"regex":addPattern(c,g.regex,g.message,o);break;case"cuid":addPattern(c,b.cuid,g.message,o);break;case"cuid2":addPattern(c,b.cuid2,g.message,o);break;case"startsWith":addPattern(c,RegExp(`^${escapeLiteralCheckValue(g.value,o)}`),g.message,o);break;case"endsWith":addPattern(c,RegExp(`${escapeLiteralCheckValue(g.value,o)}$`),g.message,o);break;case"datetime":addFormat(c,"date-time",g.message,o);break;case"date":addFormat(c,"date",g.message,o);break;case"time":addFormat(c,"time",g.message,o);break;case"duration":addFormat(c,"duration",g.message,o);break;case"length":(0,h.setResponseValueAndErrors)(c,"minLength","number"==typeof c.minLength?Math.max(c.minLength,g.value):g.value,g.message,o),(0,h.setResponseValueAndErrors)(c,"maxLength","number"==typeof c.maxLength?Math.min(c.maxLength,g.value):g.value,g.message,o);break;case"includes":addPattern(c,RegExp(escapeLiteralCheckValue(g.value,o)),g.message,o);break;case"ip":"v6"!==g.version&&addFormat(c,"ipv4",g.message,o),"v4"!==g.version&&addFormat(c,"ipv6",g.message,o);break;case"base64url":addPattern(c,b.base64url,g.message,o);break;case"jwt":addPattern(c,b.jwt,g.message,o);break;case"cidr":"v6"!==g.version&&addPattern(c,b.ipv4Cidr,g.message,o),"v4"!==g.version&&addPattern(c,b.ipv6Cidr,g.message,o);break;case"emoji":addPattern(c,b.emoji(),g.message,o);break;case"ulid":addPattern(c,b.ulid,g.message,o);break;case"base64":switch(o.base64Strategy){case"format:binary":addFormat(c,"binary",g.message,o);break;case"contentEncoding:base64":(0,h.setResponseValueAndErrors)(c,"contentEncoding","base64",g.message,o);break;case"pattern:zod":addPattern(c,b.base64,g.message,o)}break;case"nanoid":addPattern(c,b.nanoid,g.message,o);case"toLowerCase":case"toUpperCase":case"trim":break;default:(()=>{})()}return c}function escapeLiteralCheckValue(t,o){return"escape"===o.patternStrategy?function escapeNonAlphaNumeric(t){let o="";for(let c=0;ct.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&g.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,0===Object.keys(t.errorMessage).length&&delete t.errorMessage)),t.anyOf.push({format:o,...c&&g.errorMessages&&{errorMessage:{format:c}}})):(0,h.setResponseValueAndErrors)(t,"format",o,c,g)}function addPattern(t,o,c,g){t.pattern||t.allOf?.some(t=>t.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&g.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,0===Object.keys(t.errorMessage).length&&delete t.errorMessage)),t.allOf.push({pattern:stringifyRegExpWithFlags(o,g),...c&&g.errorMessages&&{errorMessage:{pattern:c}}})):(0,h.setResponseValueAndErrors)(t,"pattern",stringifyRegExpWithFlags(o,g),c,g)}function stringifyRegExpWithFlags(t,o){if(!o.applyRegexFlags||!t.flags)return t.source;const c=t.flags.includes("i"),h=t.flags.includes("m"),g=t.flags.includes("s"),b=c?t.source.toLowerCase():t.source;let P="",j=!1,E=!1,C=!1;for(let t=0;t(0,h.parseDef)(t._def,{...o,currentPath:[...o.currentPath,"items",`${c}`]})).reduce((t,o)=>void 0===o?t:[...t,o],[]),additionalItems:(0,h.parseDef)(t.rest._def,{...o,currentPath:[...o.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((t,c)=>(0,h.parseDef)(t._def,{...o,currentPath:[...o.currentPath,"items",`${c}`]})).reduce((t,o)=>void 0===o?t:[...t,o],[])}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseUndefinedDef:function(){return parseUndefinedDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseUndefinedDef(t){return{not:(0,h.parseAnyDef)(t)}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/union.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseUnionDef:function(){return parseUnionDef},primitiveMappings:function(){return g}});var h=c("./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(t,o){if("openApi3"===o.target)return asAnyOf(t,o);const c=t.options instanceof Map?Array.from(t.options.values()):t.options;if(c.every(t=>t._def.typeName in g&&(!t._def.checks||!t._def.checks.length))){const t=c.reduce((t,o)=>{const c=g[o._def.typeName];return c&&!t.includes(c)?[...t,c]:t},[]);return{type:t.length>1?t:t[0]}}if(c.every(t=>"ZodLiteral"===t._def.typeName&&!t.description)){const t=c.reduce((t,o)=>{const c=typeof o._def.value;switch(c){case"string":case"number":case"boolean":return[...t,c];case"bigint":return[...t,"integer"];case"object":if(null===o._def.value)return[...t,"null"];default:return t}},[]);if(t.length===c.length){const o=t.filter((t,o,c)=>c.indexOf(t)===o);return{type:o.length>1?o:o[0],enum:c.reduce((t,o)=>t.includes(o._def.value)?t:[...t,o._def.value],[])}}}else if(c.every(t=>"ZodEnum"===t._def.typeName))return{type:"string",enum:c.reduce((t,o)=>[...t,...o._def.values.filter(o=>!t.includes(o))],[])};return asAnyOf(t,o)}const asAnyOf=(t,o)=>{const c=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((t,c)=>(0,h.parseDef)(t._def,{...o,currentPath:[...o.currentPath,"anyOf",`${c}`]})).filter(t=>!!t&&(!o.strictUnions||"object"==typeof t&&Object.keys(t).length>0));return c.length?{anyOf:c}:void 0}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js":function(t,o,c){"use strict";c.r(o),c.d(o,{parseUnknownDef:function(){return parseUnknownDef}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseUnknownDef(t){return(0,h.parseAnyDef)(t)}},"./packages/node_modules/zod-to-json-schema/dist/esm/selectParser.js":function(t,o,c){"use strict";c.r(o),c.d(o,{selectParser:function(){return selectParser}});var h=c("./packages/node_modules/zod/v3/types.js"),g=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js"),b=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/array.js"),P=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js"),j=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js"),E=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),C=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js"),Z=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/date.js"),R=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/default.js"),I=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js"),D=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js"),O=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js"),N=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js"),$=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/map.js"),z=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js"),F=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/never.js"),L=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/null.js"),M=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js"),q=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/number.js"),V=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/object.js"),Pe=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js"),je=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js"),De=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js"),$e=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),ze=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/set.js"),Fe=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),Le=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js"),Me=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js"),qe=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/union.js"),Ue=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js"),Ve=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js");const selectParser=(t,o,c)=>{switch(o){case h.ZodFirstPartyTypeKind.ZodString:return(0,Fe.parseStringDef)(t,c);case h.ZodFirstPartyTypeKind.ZodNumber:return(0,q.parseNumberDef)(t,c);case h.ZodFirstPartyTypeKind.ZodObject:return(0,V.parseObjectDef)(t,c);case h.ZodFirstPartyTypeKind.ZodBigInt:return(0,P.parseBigintDef)(t,c);case h.ZodFirstPartyTypeKind.ZodBoolean:return(0,j.parseBooleanDef)();case h.ZodFirstPartyTypeKind.ZodDate:return(0,Z.parseDateDef)(t,c);case h.ZodFirstPartyTypeKind.ZodUndefined:return(0,Me.parseUndefinedDef)(c);case h.ZodFirstPartyTypeKind.ZodNull:return(0,L.parseNullDef)(c);case h.ZodFirstPartyTypeKind.ZodArray:return(0,b.parseArrayDef)(t,c);case h.ZodFirstPartyTypeKind.ZodUnion:case h.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return(0,qe.parseUnionDef)(t,c);case h.ZodFirstPartyTypeKind.ZodIntersection:return(0,O.parseIntersectionDef)(t,c);case h.ZodFirstPartyTypeKind.ZodTuple:return(0,Le.parseTupleDef)(t,c);case h.ZodFirstPartyTypeKind.ZodRecord:return(0,$e.parseRecordDef)(t,c);case h.ZodFirstPartyTypeKind.ZodLiteral:return(0,N.parseLiteralDef)(t,c);case h.ZodFirstPartyTypeKind.ZodEnum:return(0,D.parseEnumDef)(t);case h.ZodFirstPartyTypeKind.ZodNativeEnum:return(0,z.parseNativeEnumDef)(t);case h.ZodFirstPartyTypeKind.ZodNullable:return(0,M.parseNullableDef)(t,c);case h.ZodFirstPartyTypeKind.ZodOptional:return(0,Pe.parseOptionalDef)(t,c);case h.ZodFirstPartyTypeKind.ZodMap:return(0,$.parseMapDef)(t,c);case h.ZodFirstPartyTypeKind.ZodSet:return(0,ze.parseSetDef)(t,c);case h.ZodFirstPartyTypeKind.ZodLazy:return()=>t.getter()._def;case h.ZodFirstPartyTypeKind.ZodPromise:return(0,De.parsePromiseDef)(t,c);case h.ZodFirstPartyTypeKind.ZodNaN:case h.ZodFirstPartyTypeKind.ZodNever:return(0,F.parseNeverDef)(c);case h.ZodFirstPartyTypeKind.ZodEffects:return(0,I.parseEffectsDef)(t,c);case h.ZodFirstPartyTypeKind.ZodAny:return(0,g.parseAnyDef)(c);case h.ZodFirstPartyTypeKind.ZodUnknown:return(0,Ue.parseUnknownDef)(c);case h.ZodFirstPartyTypeKind.ZodDefault:return(0,R.parseDefaultDef)(t,c);case h.ZodFirstPartyTypeKind.ZodBranded:return(0,E.parseBrandedDef)(t,c);case h.ZodFirstPartyTypeKind.ZodReadonly:return(0,Ve.parseReadonlyDef)(t,c);case h.ZodFirstPartyTypeKind.ZodCatch:return(0,C.parseCatchDef)(t,c);case h.ZodFirstPartyTypeKind.ZodPipeline:return(0,je.parsePipelineDef)(t,c);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(t,o,c){"use strict";c.r(o),c.d(o,{zodToJsonSchema:function(){return zodToJsonSchema}});var h=c("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=c("./packages/node_modules/zod-to-json-schema/dist/esm/Refs.js"),b=c("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");const zodToJsonSchema=(t,o)=>{const c=(0,g.getRefs)(o);let P="object"==typeof o&&o.definitions?Object.entries(o.definitions).reduce((t,[o,g])=>({...t,[o]:(0,h.parseDef)(g._def,{...c,currentPath:[...c.basePath,c.definitionPath,o]},!0)??(0,b.parseAnyDef)(c)}),{}):void 0;const j="string"==typeof o?o:"title"===o?.nameStrategy?void 0:o?.name,E=(0,h.parseDef)(t._def,void 0===j?c:{...c,currentPath:[...c.basePath,c.definitionPath,j]},!1)??(0,b.parseAnyDef)(c),C="object"==typeof o&&void 0!==o.name&&"title"===o.nameStrategy?o.name:void 0;void 0!==C&&(E.title=C),c.flags.hasReferencedOpenAiAnyType&&(P||(P={}),P[c.openAiAnyTypeName]||(P[c.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===c.$refStrategy?"1":[...c.basePath,c.definitionPath,c.openAiAnyTypeName].join("/")}}));const Z=void 0===j?P?{...E,[c.definitionPath]:P}:E:{$ref:[..."relative"===c.$refStrategy?[]:c.basePath,c.definitionPath,j].join("/"),[c.definitionPath]:{...P,[j]:E}};return"jsonSchema7"===c.target?Z.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"!==c.target&&"openAi"!==c.target||(Z.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===c.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(t,o,c){"use strict";c.r(o),c.d(o,{ZodError:function(){return ZodError},ZodIssueCode:function(){return g},quotelessJson:function(){return quotelessJson}});var h=c("./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=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=t=>{this.issues=[...this.issues,t]},this.addIssues=(t=[])=>{this.issues=[...this.issues,...t]};const o=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,o):this.__proto__=o,this.name="ZodError",this.issues=t}format(t){const o=t||function(t){return t.message},c={_errors:[]},processError=t=>{for(const h of t.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)c._errors.push(o(h));else{let t=c,g=0;for(;gt.message){const o={},c=[];for(const h of this.issues)if(h.path.length>0){const c=h.path[0];o[c]=o[c]||[],o[c].push(t(h))}else c.push(t(h));return{formErrors:c,fieldErrors:o}}get formErrors(){return this.flatten()}}ZodError.create=t=>new ZodError(t)},"./packages/node_modules/zod/v3/errors.js":function(t,o,c){"use strict";c.r(o),c.d(o,{defaultErrorMap:function(){return h.default},getErrorMap:function(){return getErrorMap},setErrorMap:function(){return setErrorMap}});var h=c("./packages/node_modules/zod/v3/locales/en.js");let g=h.default;function setErrorMap(t){g=t}function getErrorMap(){return g}},"./packages/node_modules/zod/v3/helpers/errorUtil.js":function(t,o,c){"use strict";var h;c.r(o),c.d(o,{errorUtil:function(){return h}}),function(t){t.errToObj=t=>"string"==typeof t?{message:t}:t||{},t.toString=t=>"string"==typeof t?t:t?.message}(h||(h={}))},"./packages/node_modules/zod/v3/helpers/parseUtil.js":function(t,o,c){"use strict";c.r(o),c.d(o,{DIRTY:function(){return DIRTY},EMPTY_PATH:function(){return b},INVALID:function(){return P},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=c("./packages/node_modules/zod/v3/errors.js"),g=c("./packages/node_modules/zod/v3/locales/en.js");const makeIssue=t=>{const{data:o,path:c,errorMaps:h,issueData:g}=t,b=[...c,...g.path||[]],P={...g,path:b};if(void 0!==g.message)return{...g,path:b,message:g.message};let j="";const E=h.filter(t=>!!t).slice().reverse();for(const t of E)j=t(P,{data:o,defaultError:j}).message;return{...g,path:b,message:j}},b=[];function addIssueToContext(t,o){const c=(0,h.getErrorMap)(),b=makeIssue({issueData:o,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c,c===g.default?void 0:g.default].filter(t=>!!t)});t.common.issues.push(b)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,o){const c=[];for(const h of o){if("aborted"===h.status)return P;"dirty"===h.status&&t.dirty(),c.push(h.value)}return{status:t.value,value:c}}static async mergeObjectAsync(t,o){const c=[];for(const t of o){const o=await t.key,h=await t.value;c.push({key:o,value:h})}return ParseStatus.mergeObjectSync(t,c)}static mergeObjectSync(t,o){const c={};for(const h of o){const{key:o,value:g}=h;if("aborted"===o.status)return P;if("aborted"===g.status)return P;"dirty"===o.status&&t.dirty(),"dirty"===g.status&&t.dirty(),"__proto__"===o.value||void 0===g.value&&!h.alwaysSet||(c[o.value]=g.value)}return{status:t.value,value:c}}}const P=Object.freeze({status:"aborted"}),DIRTY=t=>({status:"dirty",value:t}),OK=t=>({status:"valid",value:t}),isAborted=t=>"aborted"===t.status,isDirty=t=>"dirty"===t.status,isValid=t=>"valid"===t.status,isAsync=t=>"undefined"!=typeof Promise&&t instanceof Promise},"./packages/node_modules/zod/v3/helpers/util.js":function(t,o,c){"use strict";var h,g;c.r(o),c.d(o,{ZodParsedType:function(){return b},getParsedType:function(){return getParsedType},objectUtil:function(){return g},util:function(){return h}}),function(t){t.assertEqual=t=>{},t.assertIs=function assertIs(t){},t.assertNever=function assertNever(t){throw new Error},t.arrayToEnum=t=>{const o={};for(const c of t)o[c]=c;return o},t.getValidEnumValues=o=>{const c=t.objectKeys(o).filter(t=>"number"!=typeof o[o[t]]),h={};for(const t of c)h[t]=o[t];return t.objectValues(h)},t.objectValues=o=>t.objectKeys(o).map(function(t){return o[t]}),t.objectKeys="function"==typeof Object.keys?t=>Object.keys(t):t=>{const o=[];for(const c in t)Object.prototype.hasOwnProperty.call(t,c)&&o.push(c);return o},t.find=(t,o)=>{for(const c of t)if(o(c))return c},t.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&Number.isFinite(t)&&Math.floor(t)===t,t.joinValues=function joinValues(t,o=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(o)},t.jsonStringifyReplacer=(t,o)=>"bigint"==typeof o?o.toString():o}(h||(h={})),function(t){t.mergeShapes=(t,o)=>({...t,...o})}(g||(g={}));const b=h.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=t=>{switch(typeof t){case"undefined":return b.undefined;case"string":return b.string;case"number":return Number.isNaN(t)?b.nan:b.number;case"boolean":return b.boolean;case"function":return b.function;case"bigint":return b.bigint;case"symbol":return b.symbol;case"object":return Array.isArray(t)?b.array:null===t?b.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?b.promise:"undefined"!=typeof Map&&t instanceof Map?b.map:"undefined"!=typeof Set&&t instanceof Set?b.set:"undefined"!=typeof Date&&t instanceof Date?b.date:b.object;default:return b.unknown}}},"./packages/node_modules/zod/v3/locales/en.js":function(t,o,c){"use strict";c.r(o);var h=c("./packages/node_modules/zod/v3/ZodError.js"),g=c("./packages/node_modules/zod/v3/helpers/util.js");o.default=(t,o)=>{let c;switch(t.code){case h.ZodIssueCode.invalid_type:c=t.received===g.ZodParsedType.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case h.ZodIssueCode.invalid_literal:c=`Invalid literal value, expected ${JSON.stringify(t.expected,g.util.jsonStringifyReplacer)}`;break;case h.ZodIssueCode.unrecognized_keys:c=`Unrecognized key(s) in object: ${g.util.joinValues(t.keys,", ")}`;break;case h.ZodIssueCode.invalid_union:c="Invalid input";break;case h.ZodIssueCode.invalid_union_discriminator:c=`Invalid discriminator value. Expected ${g.util.joinValues(t.options)}`;break;case h.ZodIssueCode.invalid_enum_value:c=`Invalid enum value. Expected ${g.util.joinValues(t.options)}, received '${t.received}'`;break;case h.ZodIssueCode.invalid_arguments:c="Invalid function arguments";break;case h.ZodIssueCode.invalid_return_type:c="Invalid function return type";break;case h.ZodIssueCode.invalid_date:c="Invalid date";break;case h.ZodIssueCode.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(c=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(c=`${c} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?c=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?c=`Invalid input: must end with "${t.validation.endsWith}"`:g.util.assertNever(t.validation):c="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case h.ZodIssueCode.too_small:c="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type||"bigint"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case h.ZodIssueCode.too_big:c="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case h.ZodIssueCode.custom:c="Invalid input";break;case h.ZodIssueCode.invalid_intersection_types:c="Intersection results could not be merged";break;case h.ZodIssueCode.not_multiple_of:c=`Number must be a multiple of ${t.multipleOf}`;break;case h.ZodIssueCode.not_finite:c="Number must be finite";break;default:c=o.defaultError,g.util.assertNever(t)}return{message:c}}},"./packages/node_modules/zod/v3/types.js":function(t,o,c){"use strict";c.r(o),c.d(o,{BRAND:function(){return $e},NEVER:function(){return Pt},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 Fe},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 Je},array:function(){return Xe},bigint:function(){return Ue},boolean:function(){return Ve},coerce:function(){return bt},custom:function(){return custom},date:function(){return Ke},datetimeRegex:function(){return datetimeRegex},discriminatedUnion:function(){return st},effect:function(){return ft},enum:function(){return pt},function:function(){return ct},instanceof:function(){return instanceOfType},intersection:function(){return at},late:function(){return ze},lazy:function(){return ut},literal:function(){return lt},map:function(){return it},nan:function(){return qe},nativeEnum:function(){return mt},never:function(){return Ge},null:function(){return Qe},nullable:function(){return vt},number:function(){return Me},object:function(){return et},oboolean:function(){return oboolean},onumber:function(){return onumber},optional:function(){return gt},ostring:function(){return ostring},pipeline:function(){return _t},preprocess:function(){return yt},promise:function(){return ht},record:function(){return ot},set:function(){return dt},strictObject:function(){return tt},string:function(){return Le},symbol:function(){return He},transformer:function(){return ft},tuple:function(){return nt},undefined:function(){return Be},union:function(){return rt},unknown:function(){return We},void:function(){return Ye}});var h=c("./packages/node_modules/zod/v3/ZodError.js"),g=c("./packages/node_modules/zod/v3/errors.js"),b=c("./packages/node_modules/zod/v3/locales/en.js"),P=c("./packages/node_modules/zod/v3/helpers/errorUtil.js"),j=c("./packages/node_modules/zod/v3/helpers/parseUtil.js"),E=c("./packages/node_modules/zod/v3/helpers/util.js");class ParseInputLazyPath{constructor(t,o,c,h){this._cachedPath=[],this.parent=t,this.data=o,this._path=c,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=(t,o)=>{if((0,j.isValid)(o))return{success:!0,data:o.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const o=new h.ZodError(t.common.issues);return this._error=o,this._error}}};function processCreateParams(t){if(!t)return{};const{errorMap:o,invalid_type_error:c,required_error:h,description:g}=t;if(o&&(c||h))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(o)return{errorMap:o,description:g};return{errorMap:(o,g)=>{const{message:b}=t;return"invalid_enum_value"===o.code?{message:b??g.defaultError}:void 0===g.data?{message:b??h??g.defaultError}:"invalid_type"!==o.code?{message:g.defaultError}:{message:b??c??g.defaultError}},description:g}}class ZodType{get description(){return this._def.description}_getType(t){return(0,E.getParsedType)(t.data)}_getOrReturnCtx(t,o){return o||{common:t.parent.common,data:t.data,parsedType:(0,E.getParsedType)(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new j.ParseStatus,ctx:{common:t.parent.common,data:t.data,parsedType:(0,E.getParsedType)(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const o=this._parse(t);if((0,j.isAsync)(o))throw new Error("Synchronous parse encountered promise.");return o}_parseAsync(t){const o=this._parse(t);return Promise.resolve(o)}parse(t,o){const c=this.safeParse(t,o);if(c.success)return c.data;throw c.error}safeParse(t,o){const c={common:{issues:[],async:o?.async??!1,contextualErrorMap:o?.errorMap},path:o?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:(0,E.getParsedType)(t)},h=this._parseSync({data:t,path:c.path,parent:c});return handleResult(c,h)}"~validate"(t){const o={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:(0,E.getParsedType)(t)};if(!this["~standard"].async)try{const c=this._parseSync({data:t,path:[],parent:o});return(0,j.isValid)(c)?{value:c.value}:{issues:o.common.issues}}catch(t){t?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),o.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:o}).then(t=>(0,j.isValid)(t)?{value:t.value}:{issues:o.common.issues})}async parseAsync(t,o){const c=await this.safeParseAsync(t,o);if(c.success)return c.data;throw c.error}async safeParseAsync(t,o){const c={common:{issues:[],contextualErrorMap:o?.errorMap,async:!0},path:o?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:(0,E.getParsedType)(t)},h=this._parse({data:t,path:c.path,parent:c}),g=await((0,j.isAsync)(h)?h:Promise.resolve(h));return handleResult(c,g)}refine(t,o){const getIssueProperties=t=>"string"==typeof o||void 0===o?{message:o}:"function"==typeof o?o(t):o;return this._refinement((o,c)=>{const g=t(o),setError=()=>c.addIssue({code:h.ZodIssueCode.custom,...getIssueProperties(o)});return"undefined"!=typeof Promise&&g instanceof Promise?g.then(t=>!!t||(setError(),!1)):!!g||(setError(),!1)})}refinement(t,o){return this._refinement((c,h)=>!!t(c)||(h.addIssue("function"==typeof o?o(c,h):o),!1))}_refinement(t){return new ZodEffects({schema:this,typeName:Fe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}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(t){return ZodUnion.create([this,t],this._def)}and(t){return ZodIntersection.create(this,t,this._def)}transform(t){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:Fe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const o="function"==typeof t?t:()=>t;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:o,typeName:Fe.ZodDefault})}brand(){return new ZodBranded({typeName:Fe.ZodBranded,type:this,...processCreateParams(this._def)})}catch(t){const o="function"==typeof t?t:()=>t;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:o,typeName:Fe.ZodCatch})}describe(t){return new(0,this.constructor)({...this._def,description:t})}pipe(t){return ZodPipeline.create(this,t)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const C=/^c[^\s-]{8,}$/i,Z=/^[0-9a-z]+$/,R=/^[0-9A-HJKMNP-TV-Z]{26}$/i,I=/^[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,D=/^[a-z0-9_-]{21}$/i,O=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,N=/^[-+]?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)?)??$/,$=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let z;const F=/^(?:(?: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])$/,L=/^(?:(?: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])$/,M=/^(([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]))$/,q=/^(([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])$/,V=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Pe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,je="((\\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])))",De=new RegExp(`^${je}$`);function timeRegexSource(t){let o="[0-5]\\d";t.precision?o=`${o}\\.\\d{${t.precision}}`:null==t.precision&&(o=`${o}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${o})${t.precision?"+":"?"}`}function timeRegex(t){return new RegExp(`^${timeRegexSource(t)}$`)}function datetimeRegex(t){let o=`${je}T${timeRegexSource(t)}`;const c=[];return c.push(t.local?"Z?":"Z"),t.offset&&c.push("([+-]\\d{2}:?\\d{2})"),o=`${o}(${c.join("|")})`,new RegExp(`^${o}$`)}function isValidIP(t,o){return!("v4"!==o&&o||!F.test(t))||!("v6"!==o&&o||!M.test(t))}function isValidJWT(t,o){if(!O.test(t))return!1;try{const[c]=t.split(".");if(!c)return!1;const h=c.replace(/-/g,"+").replace(/_/g,"/").padEnd(c.length+(4-c.length%4)%4,"="),g=JSON.parse(atob(h));return"object"==typeof g&&null!==g&&((!("typ"in g)||"JWT"===g?.typ)&&(!!g.alg&&(!o||g.alg===o)))}catch{return!1}}function isValidCidr(t,o){return!("v4"!==o&&o||!L.test(t))||!("v6"!==o&&o||!q.test(t))}class ZodString extends ZodType{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==E.ZodParsedType.string){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.string,received:o.parsedType}),j.INVALID}const o=new j.ParseStatus;let c;for(const g of this._def.checks)if("min"===g.kind)t.data.lengthg.value&&(c=this._getOrReturnCtx(t,c),(0,j.addIssueToContext)(c,{code:h.ZodIssueCode.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),o.dirty());else if("length"===g.kind){const b=t.data.length>g.value,P=t.data.lengtht.test(o),{validation:o,code:h.ZodIssueCode.invalid_string,...P.errorUtil.errToObj(c)})}_addCheck(t){return new ZodString({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...P.errorUtil.errToObj(t)})}url(t){return this._addCheck({kind:"url",...P.errorUtil.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...P.errorUtil.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...P.errorUtil.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...P.errorUtil.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...P.errorUtil.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...P.errorUtil.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...P.errorUtil.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...P.errorUtil.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...P.errorUtil.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...P.errorUtil.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...P.errorUtil.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...P.errorUtil.errToObj(t)})}datetime(t){return"string"==typeof t?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:void 0===t?.precision?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...P.errorUtil.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return"string"==typeof t?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:void 0===t?.precision?null:t?.precision,...P.errorUtil.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...P.errorUtil.errToObj(t)})}regex(t,o){return this._addCheck({kind:"regex",regex:t,...P.errorUtil.errToObj(o)})}includes(t,o){return this._addCheck({kind:"includes",value:t,position:o?.position,...P.errorUtil.errToObj(o?.message)})}startsWith(t,o){return this._addCheck({kind:"startsWith",value:t,...P.errorUtil.errToObj(o)})}endsWith(t,o){return this._addCheck({kind:"endsWith",value:t,...P.errorUtil.errToObj(o)})}min(t,o){return this._addCheck({kind:"min",value:t,...P.errorUtil.errToObj(o)})}max(t,o){return this._addCheck({kind:"max",value:t,...P.errorUtil.errToObj(o)})}length(t,o){return this._addCheck({kind:"length",value:t,...P.errorUtil.errToObj(o)})}nonempty(t){return this.min(1,P.errorUtil.errToObj(t))}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(t=>"datetime"===t.kind)}get isDate(){return!!this._def.checks.find(t=>"date"===t.kind)}get isTime(){return!!this._def.checks.find(t=>"time"===t.kind)}get isDuration(){return!!this._def.checks.find(t=>"duration"===t.kind)}get isEmail(){return!!this._def.checks.find(t=>"email"===t.kind)}get isURL(){return!!this._def.checks.find(t=>"url"===t.kind)}get isEmoji(){return!!this._def.checks.find(t=>"emoji"===t.kind)}get isUUID(){return!!this._def.checks.find(t=>"uuid"===t.kind)}get isNANOID(){return!!this._def.checks.find(t=>"nanoid"===t.kind)}get isCUID(){return!!this._def.checks.find(t=>"cuid"===t.kind)}get isCUID2(){return!!this._def.checks.find(t=>"cuid2"===t.kind)}get isULID(){return!!this._def.checks.find(t=>"ulid"===t.kind)}get isIP(){return!!this._def.checks.find(t=>"ip"===t.kind)}get isCIDR(){return!!this._def.checks.find(t=>"cidr"===t.kind)}get isBase64(){return!!this._def.checks.find(t=>"base64"===t.kind)}get isBase64url(){return!!this._def.checks.find(t=>"base64url"===t.kind)}get minLength(){let t=null;for(const o of this._def.checks)"min"===o.kind&&(null===t||o.value>t)&&(t=o.value);return t}get maxLength(){let t=null;for(const o of this._def.checks)"max"===o.kind&&(null===t||o.valueh?c:h;return Number.parseInt(t.toFixed(g).replace(".",""))%Number.parseInt(o.toFixed(g).replace(".",""))/10**g}ZodString.create=t=>new ZodString({checks:[],typeName:Fe.ZodString,coerce:t?.coerce??!1,...processCreateParams(t)});class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==E.ZodParsedType.number){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.number,received:o.parsedType}),j.INVALID}let o;const c=new j.ParseStatus;for(const g of this._def.checks)if("int"===g.kind)E.util.isInteger(t.data)||(o=this._getOrReturnCtx(t,o),(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:g.message}),c.dirty());else if("min"===g.kind){(g.inclusive?t.datag.value:t.data>=g.value)&&(o=this._getOrReturnCtx(t,o),(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.too_big,maximum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),c.dirty())}else"multipleOf"===g.kind?0!==floatSafeRemainder(t.data,g.value)&&(o=this._getOrReturnCtx(t,o),(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.not_multiple_of,multipleOf:g.value,message:g.message}),c.dirty()):"finite"===g.kind?Number.isFinite(t.data)||(o=this._getOrReturnCtx(t,o),(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.not_finite,message:g.message}),c.dirty()):E.util.assertNever(g);return{status:c.value,value:t.data}}gte(t,o){return this.setLimit("min",t,!0,P.errorUtil.toString(o))}gt(t,o){return this.setLimit("min",t,!1,P.errorUtil.toString(o))}lte(t,o){return this.setLimit("max",t,!0,P.errorUtil.toString(o))}lt(t,o){return this.setLimit("max",t,!1,P.errorUtil.toString(o))}setLimit(t,o,c,h){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:t,value:o,inclusive:c,message:P.errorUtil.toString(h)}]})}_addCheck(t){return new ZodNumber({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:P.errorUtil.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:P.errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:P.errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:P.errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:P.errorUtil.toString(t)})}multipleOf(t,o){return this._addCheck({kind:"multipleOf",value:t,message:P.errorUtil.toString(o)})}finite(t){return this._addCheck({kind:"finite",message:P.errorUtil.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:P.errorUtil.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:P.errorUtil.toString(t)})}get minValue(){let t=null;for(const o of this._def.checks)"min"===o.kind&&(null===t||o.value>t)&&(t=o.value);return t}get maxValue(){let t=null;for(const o of this._def.checks)"max"===o.kind&&(null===t||o.value"int"===t.kind||"multipleOf"===t.kind&&E.util.isInteger(t.value))}get isFinite(){let t=null,o=null;for(const c of this._def.checks){if("finite"===c.kind||"int"===c.kind||"multipleOf"===c.kind)return!0;"min"===c.kind?(null===o||c.value>o)&&(o=c.value):"max"===c.kind&&(null===t||c.valuenew ZodNumber({checks:[],typeName:Fe.ZodNumber,coerce:t?.coerce||!1,...processCreateParams(t)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==E.ZodParsedType.bigint)return this._getInvalidInput(t);let o;const c=new j.ParseStatus;for(const g of this._def.checks)if("min"===g.kind){(g.inclusive?t.datag.value:t.data>=g.value)&&(o=this._getOrReturnCtx(t,o),(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.too_big,type:"bigint",maximum:g.value,inclusive:g.inclusive,message:g.message}),c.dirty())}else"multipleOf"===g.kind?t.data%g.value!==BigInt(0)&&(o=this._getOrReturnCtx(t,o),(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.not_multiple_of,multipleOf:g.value,message:g.message}),c.dirty()):E.util.assertNever(g);return{status:c.value,value:t.data}}_getInvalidInput(t){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.bigint,received:o.parsedType}),j.INVALID}gte(t,o){return this.setLimit("min",t,!0,P.errorUtil.toString(o))}gt(t,o){return this.setLimit("min",t,!1,P.errorUtil.toString(o))}lte(t,o){return this.setLimit("max",t,!0,P.errorUtil.toString(o))}lt(t,o){return this.setLimit("max",t,!1,P.errorUtil.toString(o))}setLimit(t,o,c,h){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:t,value:o,inclusive:c,message:P.errorUtil.toString(h)}]})}_addCheck(t){return new ZodBigInt({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:P.errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:P.errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:P.errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:P.errorUtil.toString(t)})}multipleOf(t,o){return this._addCheck({kind:"multipleOf",value:t,message:P.errorUtil.toString(o)})}get minValue(){let t=null;for(const o of this._def.checks)"min"===o.kind&&(null===t||o.value>t)&&(t=o.value);return t}get maxValue(){let t=null;for(const o of this._def.checks)"max"===o.kind&&(null===t||o.valuenew ZodBigInt({checks:[],typeName:Fe.ZodBigInt,coerce:t?.coerce??!1,...processCreateParams(t)});class ZodBoolean extends ZodType{_parse(t){this._def.coerce&&(t.data=Boolean(t.data));if(this._getType(t)!==E.ZodParsedType.boolean){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.boolean,received:o.parsedType}),j.INVALID}return(0,j.OK)(t.data)}}ZodBoolean.create=t=>new ZodBoolean({typeName:Fe.ZodBoolean,coerce:t?.coerce||!1,...processCreateParams(t)});class ZodDate extends ZodType{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==E.ZodParsedType.date){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.date,received:o.parsedType}),j.INVALID}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_date}),j.INVALID}const o=new j.ParseStatus;let c;for(const g of this._def.checks)"min"===g.kind?t.data.getTime()g.value&&(c=this._getOrReturnCtx(t,c),(0,j.addIssueToContext)(c,{code:h.ZodIssueCode.too_big,message:g.message,inclusive:!0,exact:!1,maximum:g.value,type:"date"}),o.dirty()):E.util.assertNever(g);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ZodDate({...this._def,checks:[...this._def.checks,t]})}min(t,o){return this._addCheck({kind:"min",value:t.getTime(),message:P.errorUtil.toString(o)})}max(t,o){return this._addCheck({kind:"max",value:t.getTime(),message:P.errorUtil.toString(o)})}get minDate(){let t=null;for(const o of this._def.checks)"min"===o.kind&&(null===t||o.value>t)&&(t=o.value);return null!=t?new Date(t):null}get maxDate(){let t=null;for(const o of this._def.checks)"max"===o.kind&&(null===t||o.valuenew ZodDate({checks:[],coerce:t?.coerce||!1,typeName:Fe.ZodDate,...processCreateParams(t)});class ZodSymbol extends ZodType{_parse(t){if(this._getType(t)!==E.ZodParsedType.symbol){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.symbol,received:o.parsedType}),j.INVALID}return(0,j.OK)(t.data)}}ZodSymbol.create=t=>new ZodSymbol({typeName:Fe.ZodSymbol,...processCreateParams(t)});class ZodUndefined extends ZodType{_parse(t){if(this._getType(t)!==E.ZodParsedType.undefined){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.undefined,received:o.parsedType}),j.INVALID}return(0,j.OK)(t.data)}}ZodUndefined.create=t=>new ZodUndefined({typeName:Fe.ZodUndefined,...processCreateParams(t)});class ZodNull extends ZodType{_parse(t){if(this._getType(t)!==E.ZodParsedType.null){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.null,received:o.parsedType}),j.INVALID}return(0,j.OK)(t.data)}}ZodNull.create=t=>new ZodNull({typeName:Fe.ZodNull,...processCreateParams(t)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(t){return(0,j.OK)(t.data)}}ZodAny.create=t=>new ZodAny({typeName:Fe.ZodAny,...processCreateParams(t)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(t){return(0,j.OK)(t.data)}}ZodUnknown.create=t=>new ZodUnknown({typeName:Fe.ZodUnknown,...processCreateParams(t)});class ZodNever extends ZodType{_parse(t){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.never,received:o.parsedType}),j.INVALID}}ZodNever.create=t=>new ZodNever({typeName:Fe.ZodNever,...processCreateParams(t)});class ZodVoid extends ZodType{_parse(t){if(this._getType(t)!==E.ZodParsedType.undefined){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.void,received:o.parsedType}),j.INVALID}return(0,j.OK)(t.data)}}ZodVoid.create=t=>new ZodVoid({typeName:Fe.ZodVoid,...processCreateParams(t)});class ZodArray extends ZodType{_parse(t){const{ctx:o,status:c}=this._processInputParams(t),g=this._def;if(o.parsedType!==E.ZodParsedType.array)return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.array,received:o.parsedType}),j.INVALID;if(null!==g.exactLength){const t=o.data.length>g.exactLength.value,b=o.data.lengthg.maxLength.value&&((0,j.addIssueToContext)(o,{code:h.ZodIssueCode.too_big,maximum:g.maxLength.value,type:"array",inclusive:!0,exact:!1,message:g.maxLength.message}),c.dirty()),o.common.async)return Promise.all([...o.data].map((t,c)=>g.type._parseAsync(new ParseInputLazyPath(o,t,o.path,c)))).then(t=>j.ParseStatus.mergeArray(c,t));const b=[...o.data].map((t,c)=>g.type._parseSync(new ParseInputLazyPath(o,t,o.path,c)));return j.ParseStatus.mergeArray(c,b)}get element(){return this._def.type}min(t,o){return new ZodArray({...this._def,minLength:{value:t,message:P.errorUtil.toString(o)}})}max(t,o){return new ZodArray({...this._def,maxLength:{value:t,message:P.errorUtil.toString(o)}})}length(t,o){return new ZodArray({...this._def,exactLength:{value:t,message:P.errorUtil.toString(o)}})}nonempty(t){return this.min(1,t)}}function deepPartialify(t){if(t instanceof ZodObject){const o={};for(const c in t.shape){const h=t.shape[c];o[c]=ZodOptional.create(deepPartialify(h))}return new ZodObject({...t._def,shape:()=>o})}return t instanceof ZodArray?new ZodArray({...t._def,type:deepPartialify(t.element)}):t instanceof ZodOptional?ZodOptional.create(deepPartialify(t.unwrap())):t instanceof ZodNullable?ZodNullable.create(deepPartialify(t.unwrap())):t instanceof ZodTuple?ZodTuple.create(t.items.map(t=>deepPartialify(t))):t}ZodArray.create=(t,o)=>new ZodArray({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Fe.ZodArray,...processCreateParams(o)});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 t=this._def.shape(),o=E.util.objectKeys(t);return this._cached={shape:t,keys:o},this._cached}_parse(t){if(this._getType(t)!==E.ZodParsedType.object){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.object,received:o.parsedType}),j.INVALID}const{status:o,ctx:c}=this._processInputParams(t),{shape:g,keys:b}=this._getCached(),P=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const t in c.data)b.includes(t)||P.push(t);const C=[];for(const t of b){const o=g[t],h=c.data[t];C.push({key:{status:"valid",value:t},value:o._parse(new ParseInputLazyPath(c,h,c.path,t)),alwaysSet:t in c.data})}if(this._def.catchall instanceof ZodNever){const t=this._def.unknownKeys;if("passthrough"===t)for(const t of P)C.push({key:{status:"valid",value:t},value:{status:"valid",value:c.data[t]}});else if("strict"===t)P.length>0&&((0,j.addIssueToContext)(c,{code:h.ZodIssueCode.unrecognized_keys,keys:P}),o.dirty());else if("strip"!==t)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const t=this._def.catchall;for(const o of P){const h=c.data[o];C.push({key:{status:"valid",value:o},value:t._parse(new ParseInputLazyPath(c,h,c.path,o)),alwaysSet:o in c.data})}}return c.common.async?Promise.resolve().then(async()=>{const t=[];for(const o of C){const c=await o.key,h=await o.value;t.push({key:c,value:h,alwaysSet:o.alwaysSet})}return t}).then(t=>j.ParseStatus.mergeObjectSync(o,t)):j.ParseStatus.mergeObjectSync(o,C)}get shape(){return this._def.shape()}strict(t){return P.errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==t?{errorMap:(o,c)=>{const h=this._def.errorMap?.(o,c).message??c.defaultError;return"unrecognized_keys"===o.code?{message:P.errorUtil.errToObj(t).message??h}:{message:h}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(t){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ZodObject({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Fe.ZodObject})}setKey(t,o){return this.augment({[t]:o})}catchall(t){return new ZodObject({...this._def,catchall:t})}pick(t){const o={};for(const c of E.util.objectKeys(t))t[c]&&this.shape[c]&&(o[c]=this.shape[c]);return new ZodObject({...this._def,shape:()=>o})}omit(t){const o={};for(const c of E.util.objectKeys(this.shape))t[c]||(o[c]=this.shape[c]);return new ZodObject({...this._def,shape:()=>o})}deepPartial(){return deepPartialify(this)}partial(t){const o={};for(const c of E.util.objectKeys(this.shape)){const h=this.shape[c];t&&!t[c]?o[c]=h:o[c]=h.optional()}return new ZodObject({...this._def,shape:()=>o})}required(t){const o={};for(const c of E.util.objectKeys(this.shape))if(t&&!t[c])o[c]=this.shape[c];else{let t=this.shape[c];for(;t instanceof ZodOptional;)t=t._def.innerType;o[c]=t}return new ZodObject({...this._def,shape:()=>o})}keyof(){return createZodEnum(E.util.objectKeys(this.shape))}}ZodObject.create=(t,o)=>new ZodObject({shape:()=>t,unknownKeys:"strip",catchall:ZodNever.create(),typeName:Fe.ZodObject,...processCreateParams(o)}),ZodObject.strictCreate=(t,o)=>new ZodObject({shape:()=>t,unknownKeys:"strict",catchall:ZodNever.create(),typeName:Fe.ZodObject,...processCreateParams(o)}),ZodObject.lazycreate=(t,o)=>new ZodObject({shape:t,unknownKeys:"strip",catchall:ZodNever.create(),typeName:Fe.ZodObject,...processCreateParams(o)});class ZodUnion extends ZodType{_parse(t){const{ctx:o}=this._processInputParams(t),c=this._def.options;if(o.common.async)return Promise.all(c.map(async t=>{const c={...o,common:{...o.common,issues:[]},parent:null};return{result:await t._parseAsync({data:o.data,path:o.path,parent:c}),ctx:c}})).then(function handleResults(t){for(const o of t)if("valid"===o.result.status)return o.result;for(const c of t)if("dirty"===c.result.status)return o.common.issues.push(...c.ctx.common.issues),c.result;const c=t.map(t=>new h.ZodError(t.ctx.common.issues));return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_union,unionErrors:c}),j.INVALID});{let t;const g=[];for(const h of c){const c={...o,common:{...o.common,issues:[]},parent:null},b=h._parseSync({data:o.data,path:o.path,parent:c});if("valid"===b.status)return b;"dirty"!==b.status||t||(t={result:b,ctx:c}),c.common.issues.length&&g.push(c.common.issues)}if(t)return o.common.issues.push(...t.ctx.common.issues),t.result;const b=g.map(t=>new h.ZodError(t));return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_union,unionErrors:b}),j.INVALID}}get options(){return this._def.options}}ZodUnion.create=(t,o)=>new ZodUnion({options:t,typeName:Fe.ZodUnion,...processCreateParams(o)});const getDiscriminator=t=>t instanceof ZodLazy?getDiscriminator(t.schema):t instanceof ZodEffects?getDiscriminator(t.innerType()):t instanceof ZodLiteral?[t.value]:t instanceof ZodEnum?t.options:t instanceof ZodNativeEnum?E.util.objectValues(t.enum):t instanceof ZodDefault?getDiscriminator(t._def.innerType):t instanceof ZodUndefined?[void 0]:t instanceof ZodNull?[null]:t instanceof ZodOptional?[void 0,...getDiscriminator(t.unwrap())]:t instanceof ZodNullable?[null,...getDiscriminator(t.unwrap())]:t instanceof ZodBranded||t instanceof ZodReadonly?getDiscriminator(t.unwrap()):t instanceof ZodCatch?getDiscriminator(t._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(t){const{ctx:o}=this._processInputParams(t);if(o.parsedType!==E.ZodParsedType.object)return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.object,received:o.parsedType}),j.INVALID;const c=this.discriminator,g=o.data[c],b=this.optionsMap.get(g);return b?o.common.async?b._parseAsync({data:o.data,path:o.path,parent:o}):b._parseSync({data:o.data,path:o.path,parent:o}):((0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[c]}),j.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,o,c){const h=new Map;for(const c of o){const o=getDiscriminator(c.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const g of o){if(h.has(g))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(g)}`);h.set(g,c)}}return new ZodDiscriminatedUnion({typeName:Fe.ZodDiscriminatedUnion,discriminator:t,options:o,optionsMap:h,...processCreateParams(c)})}}function mergeValues(t,o){const c=(0,E.getParsedType)(t),h=(0,E.getParsedType)(o);if(t===o)return{valid:!0,data:t};if(c===E.ZodParsedType.object&&h===E.ZodParsedType.object){const c=E.util.objectKeys(o),h=E.util.objectKeys(t).filter(t=>-1!==c.indexOf(t)),g={...t,...o};for(const c of h){const h=mergeValues(t[c],o[c]);if(!h.valid)return{valid:!1};g[c]=h.data}return{valid:!0,data:g}}if(c===E.ZodParsedType.array&&h===E.ZodParsedType.array){if(t.length!==o.length)return{valid:!1};const c=[];for(let h=0;h{if((0,j.isAborted)(t)||(0,j.isAborted)(g))return j.INVALID;const b=mergeValues(t.value,g.value);return b.valid?(((0,j.isDirty)(t)||(0,j.isDirty)(g))&&o.dirty(),{status:o.value,value:b.data}):((0,j.addIssueToContext)(c,{code:h.ZodIssueCode.invalid_intersection_types}),j.INVALID)};return c.common.async?Promise.all([this._def.left._parseAsync({data:c.data,path:c.path,parent:c}),this._def.right._parseAsync({data:c.data,path:c.path,parent:c})]).then(([t,o])=>handleParsed(t,o)):handleParsed(this._def.left._parseSync({data:c.data,path:c.path,parent:c}),this._def.right._parseSync({data:c.data,path:c.path,parent:c}))}}ZodIntersection.create=(t,o,c)=>new ZodIntersection({left:t,right:o,typeName:Fe.ZodIntersection,...processCreateParams(c)});class ZodTuple extends ZodType{_parse(t){const{status:o,ctx:c}=this._processInputParams(t);if(c.parsedType!==E.ZodParsedType.array)return(0,j.addIssueToContext)(c,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.array,received:c.parsedType}),j.INVALID;if(c.data.lengththis._def.items.length&&((0,j.addIssueToContext)(c,{code:h.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),o.dirty());const g=[...c.data].map((t,o)=>{const h=this._def.items[o]||this._def.rest;return h?h._parse(new ParseInputLazyPath(c,t,c.path,o)):null}).filter(t=>!!t);return c.common.async?Promise.all(g).then(t=>j.ParseStatus.mergeArray(o,t)):j.ParseStatus.mergeArray(o,g)}get items(){return this._def.items}rest(t){return new ZodTuple({...this._def,rest:t})}}ZodTuple.create=(t,o)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:t,typeName:Fe.ZodTuple,rest:null,...processCreateParams(o)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:o,ctx:c}=this._processInputParams(t);if(c.parsedType!==E.ZodParsedType.object)return(0,j.addIssueToContext)(c,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.object,received:c.parsedType}),j.INVALID;const g=[],b=this._def.keyType,P=this._def.valueType;for(const t in c.data)g.push({key:b._parse(new ParseInputLazyPath(c,t,c.path,t)),value:P._parse(new ParseInputLazyPath(c,c.data[t],c.path,t)),alwaysSet:t in c.data});return c.common.async?j.ParseStatus.mergeObjectAsync(o,g):j.ParseStatus.mergeObjectSync(o,g)}get element(){return this._def.valueType}static create(t,o,c){return new ZodRecord(o instanceof ZodType?{keyType:t,valueType:o,typeName:Fe.ZodRecord,...processCreateParams(c)}:{keyType:ZodString.create(),valueType:t,typeName:Fe.ZodRecord,...processCreateParams(o)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:o,ctx:c}=this._processInputParams(t);if(c.parsedType!==E.ZodParsedType.map)return(0,j.addIssueToContext)(c,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.map,received:c.parsedType}),j.INVALID;const g=this._def.keyType,b=this._def.valueType,P=[...c.data.entries()].map(([t,o],h)=>({key:g._parse(new ParseInputLazyPath(c,t,c.path,[h,"key"])),value:b._parse(new ParseInputLazyPath(c,o,c.path,[h,"value"]))}));if(c.common.async){const t=new Map;return Promise.resolve().then(async()=>{for(const c of P){const h=await c.key,g=await c.value;if("aborted"===h.status||"aborted"===g.status)return j.INVALID;"dirty"!==h.status&&"dirty"!==g.status||o.dirty(),t.set(h.value,g.value)}return{status:o.value,value:t}})}{const t=new Map;for(const c of P){const h=c.key,g=c.value;if("aborted"===h.status||"aborted"===g.status)return j.INVALID;"dirty"!==h.status&&"dirty"!==g.status||o.dirty(),t.set(h.value,g.value)}return{status:o.value,value:t}}}}ZodMap.create=(t,o,c)=>new ZodMap({valueType:o,keyType:t,typeName:Fe.ZodMap,...processCreateParams(c)});class ZodSet extends ZodType{_parse(t){const{status:o,ctx:c}=this._processInputParams(t);if(c.parsedType!==E.ZodParsedType.set)return(0,j.addIssueToContext)(c,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.set,received:c.parsedType}),j.INVALID;const g=this._def;null!==g.minSize&&c.data.sizeg.maxSize.value&&((0,j.addIssueToContext)(c,{code:h.ZodIssueCode.too_big,maximum:g.maxSize.value,type:"set",inclusive:!0,exact:!1,message:g.maxSize.message}),o.dirty());const b=this._def.valueType;function finalizeSet(t){const c=new Set;for(const h of t){if("aborted"===h.status)return j.INVALID;"dirty"===h.status&&o.dirty(),c.add(h.value)}return{status:o.value,value:c}}const P=[...c.data.values()].map((t,o)=>b._parse(new ParseInputLazyPath(c,t,c.path,o)));return c.common.async?Promise.all(P).then(t=>finalizeSet(t)):finalizeSet(P)}min(t,o){return new ZodSet({...this._def,minSize:{value:t,message:P.errorUtil.toString(o)}})}max(t,o){return new ZodSet({...this._def,maxSize:{value:t,message:P.errorUtil.toString(o)}})}size(t,o){return this.min(t,o).max(t,o)}nonempty(t){return this.min(1,t)}}ZodSet.create=(t,o)=>new ZodSet({valueType:t,minSize:null,maxSize:null,typeName:Fe.ZodSet,...processCreateParams(o)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:o}=this._processInputParams(t);if(o.parsedType!==E.ZodParsedType.function)return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.function,received:o.parsedType}),j.INVALID;function makeArgsIssue(t,c){return(0,j.makeIssue)({data:t,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,(0,g.getErrorMap)(),b.default].filter(t=>!!t),issueData:{code:h.ZodIssueCode.invalid_arguments,argumentsError:c}})}function makeReturnsIssue(t,c){return(0,j.makeIssue)({data:t,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,(0,g.getErrorMap)(),b.default].filter(t=>!!t),issueData:{code:h.ZodIssueCode.invalid_return_type,returnTypeError:c}})}const c={errorMap:o.common.contextualErrorMap},P=o.data;if(this._def.returns instanceof ZodPromise){const t=this;return(0,j.OK)(async function(...o){const g=new h.ZodError([]),b=await t._def.args.parseAsync(o,c).catch(t=>{throw g.addIssue(makeArgsIssue(o,t)),g}),j=await Reflect.apply(P,this,b);return await t._def.returns._def.type.parseAsync(j,c).catch(t=>{throw g.addIssue(makeReturnsIssue(j,t)),g})})}{const t=this;return(0,j.OK)(function(...o){const g=t._def.args.safeParse(o,c);if(!g.success)throw new h.ZodError([makeArgsIssue(o,g.error)]);const b=Reflect.apply(P,this,g.data),j=t._def.returns.safeParse(b,c);if(!j.success)throw new h.ZodError([makeReturnsIssue(b,j.error)]);return j.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ZodFunction({...this._def,args:ZodTuple.create(t).rest(ZodUnknown.create())})}returns(t){return new ZodFunction({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,o,c){return new ZodFunction({args:t||ZodTuple.create([]).rest(ZodUnknown.create()),returns:o||ZodUnknown.create(),typeName:Fe.ZodFunction,...processCreateParams(c)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(t){const{ctx:o}=this._processInputParams(t);return this._def.getter()._parse({data:o.data,path:o.path,parent:o})}}ZodLazy.create=(t,o)=>new ZodLazy({getter:t,typeName:Fe.ZodLazy,...processCreateParams(o)});class ZodLiteral extends ZodType{_parse(t){if(t.data!==this._def.value){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{received:o.data,code:h.ZodIssueCode.invalid_literal,expected:this._def.value}),j.INVALID}return{status:"valid",value:t.data}}get value(){return this._def.value}}function createZodEnum(t,o){return new ZodEnum({values:t,typeName:Fe.ZodEnum,...processCreateParams(o)})}ZodLiteral.create=(t,o)=>new ZodLiteral({value:t,typeName:Fe.ZodLiteral,...processCreateParams(o)});class ZodEnum extends ZodType{_parse(t){if("string"!=typeof t.data){const o=this._getOrReturnCtx(t),c=this._def.values;return(0,j.addIssueToContext)(o,{expected:E.util.joinValues(c),received:o.parsedType,code:h.ZodIssueCode.invalid_type}),j.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const o=this._getOrReturnCtx(t),c=this._def.values;return(0,j.addIssueToContext)(o,{received:o.data,code:h.ZodIssueCode.invalid_enum_value,options:c}),j.INVALID}return(0,j.OK)(t.data)}get options(){return this._def.values}get enum(){const t={};for(const o of this._def.values)t[o]=o;return t}get Values(){const t={};for(const o of this._def.values)t[o]=o;return t}get Enum(){const t={};for(const o of this._def.values)t[o]=o;return t}extract(t,o=this._def){return ZodEnum.create(t,{...this._def,...o})}exclude(t,o=this._def){return ZodEnum.create(this.options.filter(o=>!t.includes(o)),{...this._def,...o})}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(t){const o=E.util.getValidEnumValues(this._def.values),c=this._getOrReturnCtx(t);if(c.parsedType!==E.ZodParsedType.string&&c.parsedType!==E.ZodParsedType.number){const t=E.util.objectValues(o);return(0,j.addIssueToContext)(c,{expected:E.util.joinValues(t),received:c.parsedType,code:h.ZodIssueCode.invalid_type}),j.INVALID}if(this._cache||(this._cache=new Set(E.util.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const t=E.util.objectValues(o);return(0,j.addIssueToContext)(c,{received:c.data,code:h.ZodIssueCode.invalid_enum_value,options:t}),j.INVALID}return(0,j.OK)(t.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(t,o)=>new ZodNativeEnum({values:t,typeName:Fe.ZodNativeEnum,...processCreateParams(o)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(t){const{ctx:o}=this._processInputParams(t);if(o.parsedType!==E.ZodParsedType.promise&&!1===o.common.async)return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.promise,received:o.parsedType}),j.INVALID;const c=o.parsedType===E.ZodParsedType.promise?o.data:Promise.resolve(o.data);return(0,j.OK)(c.then(t=>this._def.type.parseAsync(t,{path:o.path,errorMap:o.common.contextualErrorMap})))}}ZodPromise.create=(t,o)=>new ZodPromise({type:t,typeName:Fe.ZodPromise,...processCreateParams(o)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Fe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:o,ctx:c}=this._processInputParams(t),h=this._def.effect||null,g={addIssue:t=>{(0,j.addIssueToContext)(c,t),t.fatal?o.abort():o.dirty()},get path(){return c.path}};if(g.addIssue=g.addIssue.bind(g),"preprocess"===h.type){const t=h.transform(c.data,g);if(c.common.async)return Promise.resolve(t).then(async t=>{if("aborted"===o.value)return j.INVALID;const h=await this._def.schema._parseAsync({data:t,path:c.path,parent:c});return"aborted"===h.status?j.INVALID:"dirty"===h.status||"dirty"===o.value?(0,j.DIRTY)(h.value):h});{if("aborted"===o.value)return j.INVALID;const h=this._def.schema._parseSync({data:t,path:c.path,parent:c});return"aborted"===h.status?j.INVALID:"dirty"===h.status||"dirty"===o.value?(0,j.DIRTY)(h.value):h}}if("refinement"===h.type){const executeRefinement=t=>{const o=h.refinement(t,g);if(c.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(!1===c.common.async){const t=this._def.schema._parseSync({data:c.data,path:c.path,parent:c});return"aborted"===t.status?j.INVALID:("dirty"===t.status&&o.dirty(),executeRefinement(t.value),{status:o.value,value:t.value})}return this._def.schema._parseAsync({data:c.data,path:c.path,parent:c}).then(t=>"aborted"===t.status?j.INVALID:("dirty"===t.status&&o.dirty(),executeRefinement(t.value).then(()=>({status:o.value,value:t.value}))))}if("transform"===h.type){if(!1===c.common.async){const t=this._def.schema._parseSync({data:c.data,path:c.path,parent:c});if(!(0,j.isValid)(t))return j.INVALID;const b=h.transform(t.value,g);if(b instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:o.value,value:b}}return this._def.schema._parseAsync({data:c.data,path:c.path,parent:c}).then(t=>(0,j.isValid)(t)?Promise.resolve(h.transform(t.value,g)).then(t=>({status:o.value,value:t})):j.INVALID)}E.util.assertNever(h)}}ZodEffects.create=(t,o,c)=>new ZodEffects({schema:t,typeName:Fe.ZodEffects,effect:o,...processCreateParams(c)}),ZodEffects.createWithPreprocess=(t,o,c)=>new ZodEffects({schema:o,effect:{type:"preprocess",transform:t},typeName:Fe.ZodEffects,...processCreateParams(c)});class ZodOptional extends ZodType{_parse(t){return this._getType(t)===E.ZodParsedType.undefined?(0,j.OK)(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ZodOptional.create=(t,o)=>new ZodOptional({innerType:t,typeName:Fe.ZodOptional,...processCreateParams(o)});class ZodNullable extends ZodType{_parse(t){return this._getType(t)===E.ZodParsedType.null?(0,j.OK)(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ZodNullable.create=(t,o)=>new ZodNullable({innerType:t,typeName:Fe.ZodNullable,...processCreateParams(o)});class ZodDefault extends ZodType{_parse(t){const{ctx:o}=this._processInputParams(t);let c=o.data;return o.parsedType===E.ZodParsedType.undefined&&(c=this._def.defaultValue()),this._def.innerType._parse({data:c,path:o.path,parent:o})}removeDefault(){return this._def.innerType}}ZodDefault.create=(t,o)=>new ZodDefault({innerType:t,typeName:Fe.ZodDefault,defaultValue:"function"==typeof o.default?o.default:()=>o.default,...processCreateParams(o)});class ZodCatch extends ZodType{_parse(t){const{ctx:o}=this._processInputParams(t),c={...o,common:{...o.common,issues:[]}},g=this._def.innerType._parse({data:c.data,path:c.path,parent:{...c}});return(0,j.isAsync)(g)?g.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new h.ZodError(c.common.issues)},input:c.data})})):{status:"valid",value:"valid"===g.status?g.value:this._def.catchValue({get error(){return new h.ZodError(c.common.issues)},input:c.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(t,o)=>new ZodCatch({innerType:t,typeName:Fe.ZodCatch,catchValue:"function"==typeof o.catch?o.catch:()=>o.catch,...processCreateParams(o)});class ZodNaN extends ZodType{_parse(t){if(this._getType(t)!==E.ZodParsedType.nan){const o=this._getOrReturnCtx(t);return(0,j.addIssueToContext)(o,{code:h.ZodIssueCode.invalid_type,expected:E.ZodParsedType.nan,received:o.parsedType}),j.INVALID}return{status:"valid",value:t.data}}}ZodNaN.create=t=>new ZodNaN({typeName:Fe.ZodNaN,...processCreateParams(t)});const $e=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(t){const{ctx:o}=this._processInputParams(t),c=o.data;return this._def.type._parse({data:c,path:o.path,parent:o})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(t){const{status:o,ctx:c}=this._processInputParams(t);if(c.common.async){return(async()=>{const t=await this._def.in._parseAsync({data:c.data,path:c.path,parent:c});return"aborted"===t.status?j.INVALID:"dirty"===t.status?(o.dirty(),(0,j.DIRTY)(t.value)):this._def.out._parseAsync({data:t.value,path:c.path,parent:c})})()}{const t=this._def.in._parseSync({data:c.data,path:c.path,parent:c});return"aborted"===t.status?j.INVALID:"dirty"===t.status?(o.dirty(),{status:"dirty",value:t.value}):this._def.out._parseSync({data:t.value,path:c.path,parent:c})}}static create(t,o){return new ZodPipeline({in:t,out:o,typeName:Fe.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(t){const o=this._def.innerType._parse(t),freeze=t=>((0,j.isValid)(t)&&(t.value=Object.freeze(t.value)),t);return(0,j.isAsync)(o)?o.then(t=>freeze(t)):freeze(o)}unwrap(){return this._def.innerType}}function cleanParams(t,o){const c="function"==typeof t?t(o):"string"==typeof t?{message:t}:t;return"string"==typeof c?{message:c}:c}function custom(t,o={},c){return t?ZodAny.create().superRefine((h,g)=>{const b=t(h);if(b instanceof Promise)return b.then(t=>{if(!t){const t=cleanParams(o,h),b=t.fatal??c??!0;g.addIssue({code:"custom",...t,fatal:b})}});if(!b){const t=cleanParams(o,h),b=t.fatal??c??!0;g.addIssue({code:"custom",...t,fatal:b})}}):ZodAny.create()}ZodReadonly.create=(t,o)=>new ZodReadonly({innerType:t,typeName:Fe.ZodReadonly,...processCreateParams(o)});const ze={object:ZodObject.lazycreate};var Fe;!function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"}(Fe||(Fe={}));const instanceOfType=(t,o={message:`Input not instance of ${t.name}`})=>custom(o=>o instanceof t,o),Le=ZodString.create,Me=ZodNumber.create,qe=ZodNaN.create,Ue=ZodBigInt.create,Ve=ZodBoolean.create,Ke=ZodDate.create,He=ZodSymbol.create,Be=ZodUndefined.create,Qe=ZodNull.create,Je=ZodAny.create,We=ZodUnknown.create,Ge=ZodNever.create,Ye=ZodVoid.create,Xe=ZodArray.create,et=ZodObject.create,tt=ZodObject.strictCreate,rt=ZodUnion.create,st=ZodDiscriminatedUnion.create,at=ZodIntersection.create,nt=ZodTuple.create,ot=ZodRecord.create,it=ZodMap.create,dt=ZodSet.create,ct=ZodFunction.create,ut=ZodLazy.create,lt=ZodLiteral.create,pt=ZodEnum.create,mt=ZodNativeEnum.create,ht=ZodPromise.create,ft=ZodEffects.create,gt=ZodOptional.create,vt=ZodNullable.create,yt=ZodEffects.createWithPreprocess,_t=ZodPipeline.create,ostring=()=>Le().optional(),onumber=()=>Me().optional(),oboolean=()=>Ve().optional(),bt={string:t=>ZodString.create({...t,coerce:!0}),number:t=>ZodNumber.create({...t,coerce:!0}),boolean:t=>ZodBoolean.create({...t,coerce:!0}),bigint:t=>ZodBigInt.create({...t,coerce:!0}),date:t=>ZodDate.create({...t,coerce:!0})},Pt=j.INVALID},"./packages/packages/core/editor-mcp/src/init.ts":function(t,o,c){"use strict";c.r(o),c.d(o,{getSDK:function(){return getSDK},init:function(){return init},startMCPServer:function(){return startMCPServer}});var h=c("@elementor/editor-v1-adapters"),g=c("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js"),b=c("./packages/packages/core/editor-mcp/src/mcp-registry.ts");let P;const getSDK=()=>void 0!==globalThis.jest?{}:(P||(P=new g.AngieMcpSdk),P);function init(){return(0,h.isExperimentActive)("editor_mcp")?getSDK().waitForReady():Promise.resolve()}function startMCPServer(){return(0,h.isExperimentActive)("editor_mcp")?getSDK().waitForReady().then(()=>(0,b.activateMcpRegistration)(P)):Promise.resolve()}document.addEventListener("DOMContentLoaded",()=>{startMCPServer()},{once:!0})},"./packages/packages/core/editor-mcp/src/mcp-registry.ts":function(t,o,c){"use strict";c.r(o),c.d(o,{activateMcpRegistration:function(){return activateMcpRegistration},getMCPByDomain:function(){return getMCPByDomain},registerMcp:function(){return registerMcp}});var h=c("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js"),g=c("./packages/packages/core/editor-mcp/src/test-utils/mock-mcp-registry.ts");const b={},P={};let j=void 0!==globalThis.jest;const registerMcp=(t,o)=>{if(j)throw new Error("MCP Registration is already activated. Cannot register new MCP servers.");const c=isAlphabet(o);b[c]=t};async function activateMcpRegistration(t){if(j)return;j=!0;const o=Object.entries(b);for await(const c of o){const[o,h]=c;await t.registerServer({name:`editor-${o}`,server:h,version:"1.0.0",description:P[o]||o})}}const isAlphabet=t=>{if(!(!!t&&/^[a-z_]+$/.test(t)))throw new Error("Not alphabet");return t},getMCPByDomain=t=>{const o=`editor-${isAlphabet(t)}`;if(void 0!==globalThis.jest)return(0,g.mockMcpRegistry)();b[t]||(b[t]=new h.McpServer({name:o,version:"1.0.0"}));const c=b[t],{addTool:E}=function createToolRegistrator(t){function addTool(o){const c=o.schema?o.schema:{};if(j)throw new Error("MCP Registration is already activated. Cannot add new tools.");const toolCallback=async function(t,c){try{const h=await o.handler(o.schema?t:{},c);return{structuredContent:"string"==typeof h?void 0:h,content:[{type:"text",text:"string"==typeof h?h:JSON.stringify(h)}]}}catch(t){return{isError:!0,content:[{type:"text",text:t.message||"Unknown error"}]}}};t.registerTool(o.name,{description:o.description,inputSchema:c,outputSchema:o.outputSchema,title:o.name,annotations:{destructiveHint:o.isDestrcutive,readOnlyHint:!o.isDestrcutive&&void 0,title:o.name}},toolCallback)}return{addTool:addTool}}(c);return{addTool:E,setMCPDescription:o=>{P[t]=o}}}},"./packages/packages/core/editor-mcp/src/test-utils/mock-mcp-registry.ts":function(t,o,c){"use strict";c.r(o),c.d(o,{mockMcpRegistry:function(){return mockMcpRegistry}});const mockMcpRegistry=()=>({addTool:()=>{},setMCPDescription:()=>{}})},"@elementor/editor-v1-adapters":function(t){"use strict";t.exports=window.elementorV2.editorV1Adapters}},o={};function __webpack_require__(c){var h=o[c];if(void 0!==h)return h.exports;var g=o[c]={exports:{}};return t[c].call(g.exports,g,g.exports,__webpack_require__),g.exports}__webpack_require__.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return __webpack_require__.d(o,{a:o}),o},__webpack_require__.d=function(t,o){for(var c in o)__webpack_require__.o(o,c)&&!__webpack_require__.o(t,c)&&Object.defineProperty(t,c,{enumerable:!0,get:o[c]})},__webpack_require__.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},__webpack_require__.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var c={};!function(){"use strict";__webpack_require__.r(c),__webpack_require__.d(c,{McpServer:function(){return o.McpServer},activateMcpRegistration:function(){return h.activateMcpRegistration},getAngieSdk:function(){return getAngieSdk},getMCPByDomain:function(){return h.getMCPByDomain},init:function(){return t.init},registerMcp:function(){return h.registerMcp}});var t=__webpack_require__("./packages/packages/core/editor-mcp/src/init.ts"),o=__webpack_require__("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js"),h=__webpack_require__("./packages/packages/core/editor-mcp/src/mcp-registry.ts");const getAngieSdk=()=>(0,t.getSDK)()}(),(window.elementorV2=window.elementorV2||{}).editorMcp=c}(),window.elementorV2.editorMcp?.init?.(); //# sourceMappingURL=editor-mcp.js.map