@iflow-ai/iflow-cli 0.1.7 → 0.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/iflow.js +4 -4
- package/package.json +1 -1
package/bundle/iflow.js
CHANGED
|
@@ -541,7 +541,7 @@ ${JSON.stringify(a,null,2)}`),a.usage&&(this.lastUsageMetadata={total_tokens:a.u
|
|
|
541
541
|
\u8FD9\u4E2A\u662F\u9519\u8BEF\u7684json\u683C\u5F0F\uFF1A
|
|
542
542
|
${e}
|
|
543
543
|
|
|
544
|
-
\u8BF7\u76F4\u63A5\u8F93\u51FA\u4E00\u4E2A\u6B63\u786E\u7684json\u683C\u5F0F\uFF1A`;try{let r=await fetch("https://apis.iflow.cn/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({model:"QWen3-4B",messages:[{role:"user",content:n}],temperature:.1,max_tokens:1e3})});if(!r.ok)throw new Error(`QWen API error: ${r.status}`);let o=(await r.json()).choices[0].message.content.trim();return o.startsWith("```json")?o=o.replace(/^```json\s*/,"").replace(/\s*```$/,""):o.startsWith("```")&&(o=o.replace(/^```\s*/,"").replace(/\s*```$/,"")),JSON.parse(o)}catch(r){throw BC(r),console.error("QWen JSON fix failed:",r),r}}extractTextFromRequest(e){let n="";if(e.contents){let r=Array.isArray(e.contents)?e.contents:[e.contents];for(let i of r)if(i&&typeof i=="object"&&"parts"in i&&i.parts){let o=Array.isArray(i.parts)?i.parts:[i.parts];for(let s of o)if(s&&typeof s=="object"&&"text"in s&&s.text)n+=s.text+" ";else if(s.functionResponse&&s.functionResponse.response)for(let[a,l]of Object.entries(s.functionResponse.response))l!=null&&(n+=String(l)+" ")}}return n.trim()}extractTextFromEmbedRequest(e){if(e.contents){let n=Array.isArray(e.contents)?e.contents:[e.contents];for(let r of n)if(typeof r=="object"&&r!==null&&"parts"in r&&r.parts){let i=Array.isArray(r.parts)?r.parts:[r.parts];for(let o of i)if(typeof o=="object"&&o!==null&&"text"in o&&o.text)return o.text}else{if(typeof r=="string")return r;if(typeof r=="object"&&r!==null&&"text"in r&&r.text)return r.text}}return""}extractSystemInstruction(e){let n="";if(typeof e=="string")n=e;else if(Array.isArray(e)){for(let r of e)typeof r=="object"&&r!==null&&"text"in r&&r.text&&(n+=r.text+" ");n=n.trim()}else if(typeof e=="object"&&e!==null)if("parts"in e&&e.parts){let r=Array.isArray(e.parts)?e.parts:[e.parts];for(let i of r)typeof i=="object"&&i!==null&&"text"in i&&i.text&&(n+=i.text+" ");n=n.trim()}else"text"in e&&e.text&&(n=e.text);return n}convertToOpenAITools(e){if(!e||e.length===0)return[];let n=[];for(let r of e)if(r.functionDeclarations&&Array.isArray(r.functionDeclarations))for(let i of r.functionDeclarations)n.push({type:"function",function:{name:i.name||"",description:i.description,parameters:this.convertParameters(i.parameters||i.parametersJsonSchema)}});return n}convertParameters(e){if(!e)return;let n={STRING:"string",INTEGER:"integer",NUMBER:"number",BOOLEAN:"boolean",OBJECT:"object",ARRAY:"array"};if(typeof e=="object"&&e.type){if(typeof e.type=="string"&&(n[e.type]?e.type=n[e.type]:e.type=e.type.toLowerCase()),e.properties)for(let i in e.properties){let o=e.properties[i],s={};o.type&&(s.type=n[o.type]),o.description&&(s.description=o.description),e.properties[i]=s}return e.items&&(e.items=this.convertParameters(e.items)),e}let r=i=>{if(!i)return;let o={};if(i.type)switch(i.type){case"STRING":o.type="string";break;case"INTEGER":o.type="integer";break;case"NUMBER":o.type="number";break;case"BOOLEAN":o.type="boolean";break;case"OBJECT":o.type="object";break;case"ARRAY":o.type="array";break;default:o.type=i.type.toLowerCase()}if(o.type="object",i.description&&(o.description=i.description),i.enum&&(o.enum=i.enum),i.properties){o.properties={};for(let[s,a]of Object.entries(i.properties))o.properties[s]=r(a)}return i.items&&(o.items=r(i.items)),i.required&&(o.required=i.required),o};return r(e)}mapFinishReason(e){switch(e){case"stop":return qb.STOP;case"length":return qb.MAX_TOKENS;case"content_filter":return qb.SAFETY;case"tool_calls":return qb.MALFORMED_FUNCTION_CALL;default:return qb.OTHER}}convertResponseSchema(e){if(e)return e.type==="object"||e.type==="OBJECT"?{type:"json_schema",json_schema:{name:e.name||"",description:e.description||"",schema:this.convertSchemaToJsonSchema(e),strict:!0}}:{type:"json_schema",json_schema:{name:"response_schema",description:"Generated response schema",schema:this.convertSchemaToJsonSchema(e),strict:!0}}}convertSchemaToJsonSchema(e){if(!e)return{};let n={};if(e.type)switch(e.type){case"STRING":n.type="string";break;case"INTEGER":n.type="integer";break;case"NUMBER":n.type="number";break;case"BOOLEAN":n.type="boolean";break;case"OBJECT":n.type="object";break;case"ARRAY":n.type="array";break;default:n.type=typeof e.type=="string"?e.type.toLowerCase():e.type}if(e.description&&(n.description=e.description),e.enum&&(n.enum=e.enum),e.properties){n.properties={};for(let[r,i]of Object.entries(e.properties))n.properties[r]=this.convertSchemaToJsonSchema(i)}return e.items&&(n.items=this.convertSchemaToJsonSchema(e.items)),e.required&&(n.required=e.required),n.type==="object"&&!("additionalProperties"in n)&&(n.additionalProperties=!1),n}}});function DFn(t){return t.replace(/([a-z])([A-Z])/g,"$1_$2").toUpperCase()}function oS(t){let e=DFn(t),n=`IFLOW_${t}`;if(process.env[n])return process.env[n];let r=`IFLOW_${e}`;if(process.env[r])return process.env[r];let i=`iflow_${t}`;if(process.env[i])return process.env[i];let o=`iflow_${e}`;if(process.env[o])return process.env[o]}function oG(){return oS("apiKey")}function sG(){return oS("baseUrl")||oS("url")}function aG(){return oS("modelName")||oS("model")}function eat(t){let e=oS(t);if(e===void 0)return;let n=e.toLowerCase();if(n==="true"||n==="1"||n==="yes")return!0;if(n==="false"||n==="0"||n==="no")return!1}function tat(t){let e=oS(t);if(e===void 0)return;let n=Number(e);return isNaN(n)?void 0:n}function nat(t){let e=oS(t);if(e!==void 0)return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function OZ(){return!!(oG()||sG()||aG())}function MSe(){let t={},e=["theme","selectedAuthType","sandbox","toolDiscoveryCommand","toolCallCommand","mcpServerCommand","contextFileName","preferredEditor","apiKey","baseUrl","modelName","searchApiKey","multimodalModelName","memoryImportFormat"],n=["useExternalAuth","showMemoryUsage","usageStatisticsEnabled","autoConfigureMaxOldSpaceSize","hideWindowTitle","hideTips","hideBanner","vimMode","ideModeFeature","ideMode","disableAutoUpdate"],r=["maxSessionTurns","memoryDiscoveryMaxDirs"],i=["coreTools","excludeTools","allowMCPServers","excludeMCPServers"];return e.forEach(o=>{let s=oS(o);s!==void 0&&(t[o]=s)}),n.forEach(o=>{let s=eat(o);s!==void 0&&(t[o]=s)}),r.forEach(o=>{let s=tat(o);s!==void 0&&(t[o]=s)}),i.forEach(o=>{let s=nat(o);s!==void 0&&(t[o]=s)}),t}function SFn(){return{apiKey:oG(),baseUrl:sG(),model:aG()}}var FSe=Le(()=>{"use strict";});function LSe(t,e,n){let r=process.env.GEMINI_API_KEY,i=process.env.GOOGLE_API_KEY,o=process.env.GOOGLE_CLOUD_PROJECT,s=process.env.GOOGLE_CLOUD_LOCATION,a=oG(),l=sG(),u=aG(),c=n?.apiKey||a,d=n?.baseUrl||l||_Fn[e],h=t.getModel()||u||wh,m={model:h,authType:e,proxy:t?.getProxy(),multimodalModelName:n?.multimodalModelName,debugMode:t?.getDebugMode()};return e===Sn.LOGIN_WITH_GOOGLE||e===Sn.CLOUD_SHELL?m:e===Sn.USE_GEMINI&&r?(m.apiKey=r,m.vertexai=!1,Vst(m.apiKey,m.model,m.proxy),m):e===Sn.USE_VERTEX_AI&&(i||o&&s)?(m.apiKey=i,m.vertexai=!0,m):([...Vf,Sn.OPENAI_COMPATIBLE].includes(e)&&c&&(m.apiKey=c,m.baseUrl=d,m.model=h),m)}async function PSe(t,e,n){let i={headers:{"User-Agent":`iFlowCLI/0.1.7 (${process.platform}; ${process.arch})`}};if(t.authType&&[...Vf,Sn.IDEA_LAB].includes(t.authType)||t.authType===Sn.OPENAI_COMPATIBLE)return new NZ(t);if(t.authType===Sn.LOGIN_WITH_GOOGLE||t.authType===Sn.CLOUD_SHELL)return k1e(i,t.authType,e,n);if([...Vf,Sn.OPENAI_COMPATIBLE].includes(t.authType)||t.authType===Sn.USE_GEMINI||t.authType===Sn.USE_VERTEX_AI)return new cK({apiKey:t.apiKey===""?void 0:t.apiKey,vertexai:t.vertexai,httpOptions:i}).models;throw new Error(`Error creating contentGenerator: Unsupported authType: ${t.authType}`)}var Sn,Vf,_Fn,$I=Le(()=>{"use strict";nl();U1e();SC();$st();Zst();FSe();(function(t){t.LOGIN_WITH_GOOGLE="oauth-personal",t.USE_GEMINI="gemini-api-key",t.USE_VERTEX_AI="vertex-ai",t.CLOUD_SHELL="cloud-shell",t.IFLOW="iflow",t.IDEA_LAB="idealab",t.OPENAI_COMPATIBLE="openai-compatible"})(Sn||(Sn={}));Vf=[Sn.IFLOW,Sn.IDEA_LAB],_Fn={[Sn.IDEA_LAB]:"https://idealab.alibaba-inc.com/api/openai/v1",[Sn.IFLOW]:HXe}});var MZ,rat=Le(()=>{"use strict";MZ=class{prompts=new Map;registerPrompt(e){if(this.prompts.has(e.name)){let n=`${e.serverName}_${e.name}`;console.warn(`Prompt with name "${e.name}" is already registered. Renaming to "${n}".`),this.prompts.set(n,{...e,name:n})}else this.prompts.set(e.name,e)}getAllPrompts(){return Array.from(this.prompts.values()).sort((e,n)=>e.name.localeCompare(n.name))}getPrompt(e){return this.prompts.get(e)}getPromptsByServer(e){let n=[];for(let r of this.prompts.values())r.serverName===e&&n.push(r);return n.sort((r,i)=>r.name.localeCompare(i.name))}}});var Io,Rr,To,fc=Le(()=>{"use strict";Io=class{name;displayName;description;icon;parameterSchema;isOutputMarkdown;canUpdateOutput;aliases;constructor(e,n,r,i,o,s=!0,a=!1,l=[]){this.name=e,this.displayName=n,this.description=r,this.icon=i,this.parameterSchema=o,this.isOutputMarkdown=s,this.canUpdateOutput=a,this.aliases=l}get schema(){return{name:this.name,description:this.description,parameters:this.parameterSchema}}validateToolParams(e){return null}getDescription(e){return JSON.stringify(e)}shouldConfirmExecute(e,n){return Promise.resolve(!1)}toolLocations(e){return[]}};(function(t){t.ProceedOnce="proceed_once",t.ProceedAlways="proceed_always",t.ProceedAlwaysServer="proceed_always_server",t.ProceedAlwaysTool="proceed_always_tool",t.ModifyWithEditor="modify_with_editor",t.Cancel="cancel"})(Rr||(Rr={}));(function(t){t.FileSearch="fileSearch",t.Folder="folder",t.Globe="globe",t.Hammer="hammer",t.LightBulb="lightBulb",t.Pencil="pencil",t.Regex="regex",t.Terminal="terminal"})(To||(To={}))});var os,QSe,Gn,sS,lG=Le(()=>{(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(os||(os={}));(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(QSe||(QSe={}));Gn=os.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),sS=t=>{switch(typeof t){case"undefined":return Gn.undefined;case"string":return Gn.string;case"number":return Number.isNaN(t)?Gn.nan:Gn.number;case"boolean":return Gn.boolean;case"function":return Gn.function;case"bigint":return Gn.bigint;case"symbol":return Gn.symbol;case"object":return Array.isArray(t)?Gn.array:t===null?Gn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Gn.promise:typeof Map<"u"&&t instanceof Map?Gn.map:typeof Set<"u"&&t instanceof Set?Gn.set:typeof Date<"u"&&t instanceof Date?Gn.date:Gn.object;default:return Gn.unknown}}});var ln,IFn,sg,FZ=Le(()=>{lG();ln=os.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"]),IFn=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),sg=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){let u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return i(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,os.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];n[o]=n[o]||[],n[o].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};sg.create=t=>new sg(t)});var TFn,u2,kSe=Le(()=>{FZ();lG();TFn=(t,e)=>{let n;switch(t.code){case ln.invalid_type:t.received===Gn.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ln.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,os.jsonStringifyReplacer)}`;break;case ln.unrecognized_keys:n=`Unrecognized key(s) in object: ${os.joinValues(t.keys,", ")}`;break;case ln.invalid_union:n="Invalid input";break;case ln.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${os.joinValues(t.options)}`;break;case ln.invalid_enum_value:n=`Invalid enum value. Expected ${os.joinValues(t.options)}, received '${t.received}'`;break;case ln.invalid_arguments:n="Invalid function arguments";break;case ln.invalid_return_type:n="Invalid function return type";break;case ln.invalid_date:n="Invalid date";break;case ln.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:os.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ln.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ln.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ln.custom:n="Invalid input";break;case ln.invalid_intersection_types:n="Intersection results could not be merged";break;case ln.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ln.not_finite:n="Number must be finite";break;default:n=e.defaultError,os.assertNever(t)}return{message:n}},u2=TFn});function bFn(t){iat=t}function H8(){return iat}var iat,LZ=Le(()=>{kSe();iat=u2});function Nn(t,e){let n=H8(),r=uG({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===u2?void 0:u2].filter(i=>!!i)});t.common.issues.push(r)}var uG,xFn,Hp,pi,vN,Mh,PZ,QZ,sx,q8,USe=Le(()=>{LZ();kSe();uG=t=>{let{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",l=r.filter(u=>!!u).slice().reverse();for(let u of l)a=u(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},xFn=[];Hp=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let i of n){if(i.status==="aborted")return pi;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let i of n){let o=await i.key,s=await i.value;r.push({key:o,value:s})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let i of n){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return pi;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:e.value,value:r}}},pi=Object.freeze({status:"aborted"}),vN=t=>({status:"dirty",value:t}),Mh=t=>({status:"valid",value:t}),PZ=t=>t.status==="aborted",QZ=t=>t.status==="dirty",sx=t=>t.status==="valid",q8=t=>typeof Promise<"u"&&t instanceof Promise});var oat=Le(()=>{});var Dr,sat=Le(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Dr||(Dr={}))});function Co(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:i}}function cat(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function $Fn(t){return new RegExp(`^${cat(t)}$`)}function dat(t){let e=`${uat}T${cat(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function YFn(t,e){return!!((e==="v4"||!e)&&QFn.test(t)||(e==="v6"||!e)&&UFn.test(t))}function jFn(t,e){if(!MFn.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function WFn(t,e){return!!((e==="v4"||!e)&&kFn.test(t)||(e==="v6"||!e)&&GFn.test(t))}function zFn(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}function V8(t){if(t instanceof ag){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Sy.create(V8(r))}return new ag({...t._def,shape:()=>e})}else return t instanceof f2?new f2({...t._def,type:V8(t.element)}):t instanceof Sy?Sy.create(V8(t.unwrap())):t instanceof lS?lS.create(V8(t.unwrap())):t instanceof aS?aS.create(t.items.map(e=>V8(e))):t}function HSe(t,e){let n=sS(t),r=sS(e);if(t===e)return{valid:!0,data:t};if(n===Gn.object&&r===Gn.object){let i=os.objectKeys(e),o=os.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let l=HSe(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===Gn.array&&r===Gn.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],l=HSe(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Gn.date&&r===Gn.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function fat(t,e){return new NN({values:t,typeName:Si.ZodEnum,...Co(e)})}function lat(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function pat(t,e={},n){return t?lx.create().superRefine((r,i)=>{let o=t(r);if(o instanceof Promise)return o.then(s=>{if(!s){let a=lat(e,r),l=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:l})}});if(!o){let s=lat(e,r),a=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:a})}}):lx.create()}var _y,aat,Po,wFn,RFn,BFn,NFn,OFn,MFn,FFn,LFn,PFn,GSe,QFn,kFn,UFn,GFn,HFn,qFn,uat,VFn,ax,DN,SN,_N,IN,$8,TN,bN,lx,d2,NC,Y8,f2,ag,xN,c2,kZ,wN,aS,UZ,j8,W8,GZ,RN,BN,NN,ON,ux,Iy,Sy,lS,MN,FN,z8,JFn,cG,dG,LN,KFn,Si,XFn,hat,mat,ZFn,e8n,Aat,t8n,n8n,r8n,i8n,o8n,s8n,a8n,l8n,u8n,c8n,d8n,f8n,p8n,h8n,m8n,A8n,g8n,E8n,y8n,C8n,v8n,D8n,S8n,_8n,I8n,T8n,b8n,x8n,w8n,R8n,B8n,N8n,O8n,M8n,gat=Le(()=>{FZ();LZ();sat();USe();lG();_y=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}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}},aat=(t,e)=>{if(sx(e))return{success:!0,data:e.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;let n=new sg(t.common.issues);return this._error=n,this._error}}};Po=class{get description(){return this._def.description}_getType(e){return sS(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:sS(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Hp,ctx:{common:e.parent.common,data:e.data,parsedType:sS(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(q8(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sS(e)},i=this._parseSync({data:e,path:r.path,parent:r});return aat(r,i)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sS(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return sx(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>sx(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sS(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(q8(i)?i:Promise.resolve(i));return aat(r,o)}refine(e,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:ln.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Iy({schema:this,typeName:Si.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Sy.create(this,this._def)}nullable(){return lS.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return f2.create(this)}promise(){return ux.create(this,this._def)}or(e){return xN.create([this,e],this._def)}and(e){return wN.create(this,e,this._def)}transform(e){return new Iy({...Co(this._def),schema:this,typeName:Si.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new MN({...Co(this._def),innerType:this,defaultValue:n,typeName:Si.ZodDefault})}brand(){return new cG({typeName:Si.ZodBranded,type:this,...Co(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new FN({...Co(this._def),innerType:this,catchValue:n,typeName:Si.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return dG.create(this,e)}readonly(){return LN.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},wFn=/^c[^\s-]{8,}$/i,RFn=/^[0-9a-z]+$/,BFn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,NFn=/^[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,OFn=/^[a-z0-9_-]{21}$/i,MFn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,FFn=/^[-+]?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)?)??$/,LFn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PFn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",QFn=/^(?:(?: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])$/,kFn=/^(?:(?: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])$/,UFn=/^(([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]))$/,GFn=/^(([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])$/,HFn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qFn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,uat="((\\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])))",VFn=new RegExp(`^${uat}$`);ax=class t extends Po{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Gn.string){let o=this._getOrReturnCtx(e);return Nn(o,{code:ln.invalid_type,expected:Gn.string,received:o.parsedType}),pi}let r=new Hp,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?Nn(i,{code:ln.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Nn(i,{code:ln.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")LFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"email",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")GSe||(GSe=new RegExp(PFn,"u")),GSe.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"emoji",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")NFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"uuid",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")OFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"nanoid",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")wFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"cuid",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")RFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"cuid2",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")BFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"ulid",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Nn(i,{validation:"url",code:ln.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"regex",code:ln.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?dat(o).test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?VFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?$Fn(o).test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?FFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"duration",code:ln.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?YFn(e.data,o.version)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"ip",code:ln.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?jFn(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"jwt",code:ln.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?WFn(e.data,o.version)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"cidr",code:ln.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?HFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"base64",code:ln.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?qFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"base64url",code:ln.invalid_string,message:o.message}),r.dirty()):os.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:ln.invalid_string,...Dr.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Dr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Dr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Dr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Dr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Dr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Dr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Dr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Dr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Dr.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Dr.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Dr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Dr.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Dr.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Dr.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Dr.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Dr.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Dr.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Dr.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Dr.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Dr.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Dr.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Dr.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Dr.errToObj(n)})}nonempty(e){return this.min(1,Dr.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ax.create=t=>new ax({checks:[],typeName:Si.ZodString,coerce:t?.coerce??!1,...Co(t)});DN=class t extends Po{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Gn.number){let o=this._getOrReturnCtx(e);return Nn(o,{code:ln.invalid_type,expected:Gn.number,received:o.parsedType}),pi}let r,i=new Hp;for(let o of this._def.checks)o.kind==="int"?os.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?zFn(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.not_finite,message:o.message}),i.dirty()):os.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Dr.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Dr.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Dr.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Dr.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Dr.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Dr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Dr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Dr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Dr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Dr.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Dr.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Dr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Dr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Dr.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&os.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};DN.create=t=>new DN({checks:[],typeName:Si.ZodNumber,coerce:t?.coerce||!1,...Co(t)});SN=class t extends Po{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Gn.bigint)return this._getInvalidInput(e);let r,i=new Hp;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):os.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return Nn(n,{code:ln.invalid_type,expected:Gn.bigint,received:n.parsedType}),pi}gte(e,n){return this.setLimit("min",e,!0,Dr.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Dr.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Dr.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Dr.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Dr.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Dr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Dr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Dr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Dr.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Dr.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};SN.create=t=>new SN({checks:[],typeName:Si.ZodBigInt,coerce:t?.coerce??!1,...Co(t)});_N=class extends Po{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Gn.boolean){let r=this._getOrReturnCtx(e);return Nn(r,{code:ln.invalid_type,expected:Gn.boolean,received:r.parsedType}),pi}return Mh(e.data)}};_N.create=t=>new _N({typeName:Si.ZodBoolean,coerce:t?.coerce||!1,...Co(t)});IN=class t extends Po{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Gn.date){let o=this._getOrReturnCtx(e);return Nn(o,{code:ln.invalid_type,expected:Gn.date,received:o.parsedType}),pi}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return Nn(o,{code:ln.invalid_date}),pi}let r=new Hp,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):os.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Dr.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Dr.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};IN.create=t=>new IN({checks:[],coerce:t?.coerce||!1,typeName:Si.ZodDate,...Co(t)});$8=class extends Po{_parse(e){if(this._getType(e)!==Gn.symbol){let r=this._getOrReturnCtx(e);return Nn(r,{code:ln.invalid_type,expected:Gn.symbol,received:r.parsedType}),pi}return Mh(e.data)}};$8.create=t=>new $8({typeName:Si.ZodSymbol,...Co(t)});TN=class extends Po{_parse(e){if(this._getType(e)!==Gn.undefined){let r=this._getOrReturnCtx(e);return Nn(r,{code:ln.invalid_type,expected:Gn.undefined,received:r.parsedType}),pi}return Mh(e.data)}};TN.create=t=>new TN({typeName:Si.ZodUndefined,...Co(t)});bN=class extends Po{_parse(e){if(this._getType(e)!==Gn.null){let r=this._getOrReturnCtx(e);return Nn(r,{code:ln.invalid_type,expected:Gn.null,received:r.parsedType}),pi}return Mh(e.data)}};bN.create=t=>new bN({typeName:Si.ZodNull,...Co(t)});lx=class extends Po{constructor(){super(...arguments),this._any=!0}_parse(e){return Mh(e.data)}};lx.create=t=>new lx({typeName:Si.ZodAny,...Co(t)});d2=class extends Po{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Mh(e.data)}};d2.create=t=>new d2({typeName:Si.ZodUnknown,...Co(t)});NC=class extends Po{_parse(e){let n=this._getOrReturnCtx(e);return Nn(n,{code:ln.invalid_type,expected:Gn.never,received:n.parsedType}),pi}};NC.create=t=>new NC({typeName:Si.ZodNever,...Co(t)});Y8=class extends Po{_parse(e){if(this._getType(e)!==Gn.undefined){let r=this._getOrReturnCtx(e);return Nn(r,{code:ln.invalid_type,expected:Gn.void,received:r.parsedType}),pi}return Mh(e.data)}};Y8.create=t=>new Y8({typeName:Si.ZodVoid,...Co(t)});f2=class t extends Po{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Gn.array)return Nn(n,{code:ln.invalid_type,expected:Gn.array,received:n.parsedType}),pi;if(i.exactLength!==null){let s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Nn(n,{code:s?ln.too_big:ln.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Nn(n,{code:ln.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Nn(n,{code:ln.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new _y(n,s,n.path,a)))).then(s=>Hp.mergeArray(r,s));let o=[...n.data].map((s,a)=>i.type._parseSync(new _y(n,s,n.path,a)));return Hp.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:Dr.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:Dr.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:Dr.toString(n)}})}nonempty(e){return this.min(1,e)}};f2.create=(t,e)=>new f2({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Si.ZodArray,...Co(e)});ag=class t extends Po{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=os.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Gn.object){let u=this._getOrReturnCtx(e);return Nn(u,{code:ln.invalid_type,expected:Gn.object,received:u.parsedType}),pi}let{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof NC&&this._def.unknownKeys==="strip"))for(let u in i.data)s.includes(u)||a.push(u);let l=[];for(let u of s){let c=o[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new _y(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof NC){let u=this._def.unknownKeys;if(u==="passthrough")for(let c of a)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")a.length>0&&(Nn(i,{code:ln.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let c of a){let d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new _y(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let c of l){let d=await c.key,h=await c.value;u.push({key:d,value:h,alwaysSet:c.alwaysSet})}return u}).then(u=>Hp.mergeObjectSync(r,u)):Hp.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Dr.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Dr.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Si.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of os.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of os.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return V8(this)}partial(e){let n={};for(let r of os.objectKeys(this.shape)){let i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of os.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Sy;)o=o._def.innerType;n[r]=o}return new t({...this._def,shape:()=>n})}keyof(){return fat(os.objectKeys(this.shape))}};ag.create=(t,e)=>new ag({shape:()=>t,unknownKeys:"strip",catchall:NC.create(),typeName:Si.ZodObject,...Co(e)});ag.strictCreate=(t,e)=>new ag({shape:()=>t,unknownKeys:"strict",catchall:NC.create(),typeName:Si.ZodObject,...Co(e)});ag.lazycreate=(t,e)=>new ag({shape:t,unknownKeys:"strip",catchall:NC.create(),typeName:Si.ZodObject,...Co(e)});xN=class extends Po{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new sg(a.ctx.common.issues));return Nn(n,{code:ln.invalid_union,unionErrors:s}),pi}if(n.common.async)return Promise.all(r.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let l of r){let u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(l=>new sg(l));return Nn(n,{code:ln.invalid_union,unionErrors:a}),pi}}get options(){return this._def.options}};xN.create=(t,e)=>new xN({options:t,typeName:Si.ZodUnion,...Co(e)});c2=t=>t instanceof RN?c2(t.schema):t instanceof Iy?c2(t.innerType()):t instanceof BN?[t.value]:t instanceof NN?t.options:t instanceof ON?os.objectValues(t.enum):t instanceof MN?c2(t._def.innerType):t instanceof TN?[void 0]:t instanceof bN?[null]:t instanceof Sy?[void 0,...c2(t.unwrap())]:t instanceof lS?[null,...c2(t.unwrap())]:t instanceof cG||t instanceof LN?c2(t.unwrap()):t instanceof FN?c2(t._def.innerType):[],kZ=class t extends Po{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Gn.object)return Nn(n,{code:ln.invalid_type,expected:Gn.object,received:n.parsedType}),pi;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Nn(n,{code:ln.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),pi)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let i=new Map;for(let o of n){let s=c2(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:Si.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Co(r)})}};wN=class extends Po{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=(o,s)=>{if(PZ(o)||PZ(s))return pi;let a=HSe(o.value,s.value);return a.valid?((QZ(o)||QZ(s))&&n.dirty(),{status:n.value,value:a.data}):(Nn(r,{code:ln.invalid_intersection_types}),pi)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};wN.create=(t,e,n)=>new wN({left:t,right:e,typeName:Si.ZodIntersection,...Co(n)});aS=class t extends Po{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Gn.array)return Nn(r,{code:ln.invalid_type,expected:Gn.array,received:r.parsedType}),pi;if(r.data.length<this._def.items.length)return Nn(r,{code:ln.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pi;!this._def.rest&&r.data.length>this._def.items.length&&(Nn(r,{code:ln.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...r.data].map((s,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new _y(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Hp.mergeArray(n,s)):Hp.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};aS.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new aS({items:t,typeName:Si.ZodTuple,rest:null,...Co(e)})};UZ=class t extends Po{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Gn.object)return Nn(r,{code:ln.invalid_type,expected:Gn.object,received:r.parsedType}),pi;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in r.data)i.push({key:o._parse(new _y(r,a,r.path,a)),value:s._parse(new _y(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Hp.mergeObjectAsync(n,i):Hp.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Po?new t({keyType:e,valueType:n,typeName:Si.ZodRecord,...Co(r)}):new t({keyType:ax.create(),valueType:e,typeName:Si.ZodRecord,...Co(n)})}},j8=class extends Po{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Gn.map)return Nn(r,{code:ln.invalid_type,expected:Gn.map,received:r.parsedType}),pi;let i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],u)=>({key:i._parse(new _y(r,a,r.path,[u,"key"])),value:o._parse(new _y(r,l,r.path,[u,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return pi;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let l of s){let u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return pi;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}};j8.create=(t,e,n)=>new j8({valueType:e,keyType:t,typeName:Si.ZodMap,...Co(n)});W8=class t extends Po{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Gn.set)return Nn(r,{code:ln.invalid_type,expected:Gn.set,received:r.parsedType}),pi;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Nn(r,{code:ln.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Nn(r,{code:ln.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function s(l){let u=new Set;for(let c of l){if(c.status==="aborted")return pi;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}let a=[...r.data.values()].map((l,u)=>o._parse(new _y(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:Dr.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:Dr.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};W8.create=(t,e)=>new W8({valueType:t,minSize:null,maxSize:null,typeName:Si.ZodSet,...Co(e)});GZ=class t extends Po{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Gn.function)return Nn(n,{code:ln.invalid_type,expected:Gn.function,received:n.parsedType}),pi;function r(a,l){return uG({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,H8(),u2].filter(u=>!!u),issueData:{code:ln.invalid_arguments,argumentsError:l}})}function i(a,l){return uG({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,H8(),u2].filter(u=>!!u),issueData:{code:ln.invalid_return_type,returnTypeError:l}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof ux){let a=this;return Mh(async function(...l){let u=new sg([]),c=await a._def.args.parseAsync(l,o).catch(m=>{throw u.addIssue(r(l,m)),u}),d=await Reflect.apply(s,this,c);return await a._def.returns._def.type.parseAsync(d,o).catch(m=>{throw u.addIssue(i(d,m)),u})})}else{let a=this;return Mh(function(...l){let u=a._def.args.safeParse(l,o);if(!u.success)throw new sg([r(l,u.error)]);let c=Reflect.apply(s,this,u.data),d=a._def.returns.safeParse(c,o);if(!d.success)throw new sg([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:aS.create(e).rest(d2.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||aS.create([]).rest(d2.create()),returns:n||d2.create(),typeName:Si.ZodFunction,...Co(r)})}},RN=class extends Po{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};RN.create=(t,e)=>new RN({getter:t,typeName:Si.ZodLazy,...Co(e)});BN=class extends Po{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return Nn(n,{received:n.data,code:ln.invalid_literal,expected:this._def.value}),pi}return{status:"valid",value:e.data}}get value(){return this._def.value}};BN.create=(t,e)=>new BN({value:t,typeName:Si.ZodLiteral,...Co(e)});NN=class t extends Po{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return Nn(n,{expected:os.joinValues(r),received:n.parsedType,code:ln.invalid_type}),pi}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return Nn(n,{received:n.data,code:ln.invalid_enum_value,options:r}),pi}return Mh(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};NN.create=fat;ON=class extends Po{_parse(e){let n=os.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Gn.string&&r.parsedType!==Gn.number){let i=os.objectValues(n);return Nn(r,{expected:os.joinValues(i),received:r.parsedType,code:ln.invalid_type}),pi}if(this._cache||(this._cache=new Set(os.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=os.objectValues(n);return Nn(r,{received:r.data,code:ln.invalid_enum_value,options:i}),pi}return Mh(e.data)}get enum(){return this._def.values}};ON.create=(t,e)=>new ON({values:t,typeName:Si.ZodNativeEnum,...Co(e)});ux=class extends Po{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Gn.promise&&n.common.async===!1)return Nn(n,{code:ln.invalid_type,expected:Gn.promise,received:n.parsedType}),pi;let r=n.parsedType===Gn.promise?n.data:Promise.resolve(n.data);return Mh(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};ux.create=(t,e)=>new ux({type:t,typeName:Si.ZodPromise,...Co(e)});Iy=class extends Po{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Si.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{Nn(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return pi;let l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?pi:l.status==="dirty"?vN(l.value):n.value==="dirty"?vN(l.value):l});{if(n.value==="aborted")return pi;let a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?pi:a.status==="dirty"?vN(a.value):n.value==="dirty"?vN(a.value):a}}if(i.type==="refinement"){let s=a=>{let l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?pi:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?pi:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!sx(s))return pi;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>sx(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):pi);os.assertNever(i)}};Iy.create=(t,e,n)=>new Iy({schema:t,typeName:Si.ZodEffects,effect:e,...Co(n)});Iy.createWithPreprocess=(t,e,n)=>new Iy({schema:e,effect:{type:"preprocess",transform:t},typeName:Si.ZodEffects,...Co(n)});Sy=class extends Po{_parse(e){return this._getType(e)===Gn.undefined?Mh(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Sy.create=(t,e)=>new Sy({innerType:t,typeName:Si.ZodOptional,...Co(e)});lS=class extends Po{_parse(e){return this._getType(e)===Gn.null?Mh(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};lS.create=(t,e)=>new lS({innerType:t,typeName:Si.ZodNullable,...Co(e)});MN=class extends Po{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===Gn.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};MN.create=(t,e)=>new MN({innerType:t,typeName:Si.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Co(e)});FN=class extends Po{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return q8(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new sg(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new sg(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};FN.create=(t,e)=>new FN({innerType:t,typeName:Si.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Co(e)});z8=class extends Po{_parse(e){if(this._getType(e)!==Gn.nan){let r=this._getOrReturnCtx(e);return Nn(r,{code:ln.invalid_type,expected:Gn.nan,received:r.parsedType}),pi}return{status:"valid",value:e.data}}};z8.create=t=>new z8({typeName:Si.ZodNaN,...Co(t)});JFn=Symbol("zod_brand"),cG=class extends Po{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},dG=class t extends Po{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?pi:o.status==="dirty"?(n.dirty(),vN(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?pi:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:Si.ZodPipeline})}},LN=class extends Po{_parse(e){let n=this._def.innerType._parse(e),r=i=>(sx(i)&&(i.value=Object.freeze(i.value)),i);return q8(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};LN.create=(t,e)=>new LN({innerType:t,typeName:Si.ZodReadonly,...Co(e)});KFn={object:ag.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"})(Si||(Si={}));XFn=(t,e={message:`Input not instance of ${t.name}`})=>pat(n=>n instanceof t,e),hat=ax.create,mat=DN.create,ZFn=z8.create,e8n=SN.create,Aat=_N.create,t8n=IN.create,n8n=$8.create,r8n=TN.create,i8n=bN.create,o8n=lx.create,s8n=d2.create,a8n=NC.create,l8n=Y8.create,u8n=f2.create,c8n=ag.create,d8n=ag.strictCreate,f8n=xN.create,p8n=kZ.create,h8n=wN.create,m8n=aS.create,A8n=UZ.create,g8n=j8.create,E8n=W8.create,y8n=GZ.create,C8n=RN.create,v8n=BN.create,D8n=NN.create,S8n=ON.create,_8n=ux.create,I8n=Iy.create,T8n=Sy.create,b8n=lS.create,x8n=Iy.createWithPreprocess,w8n=dG.create,R8n=()=>hat().optional(),B8n=()=>mat().optional(),N8n=()=>Aat().optional(),O8n={string:t=>ax.create({...t,coerce:!0}),number:t=>DN.create({...t,coerce:!0}),boolean:t=>_N.create({...t,coerce:!0}),bigint:t=>SN.create({...t,coerce:!0}),date:t=>IN.create({...t,coerce:!0})},M8n=pi});var ve={};h0(ve,{BRAND:()=>JFn,DIRTY:()=>vN,EMPTY_PATH:()=>xFn,INVALID:()=>pi,NEVER:()=>M8n,OK:()=>Mh,ParseStatus:()=>Hp,Schema:()=>Po,ZodAny:()=>lx,ZodArray:()=>f2,ZodBigInt:()=>SN,ZodBoolean:()=>_N,ZodBranded:()=>cG,ZodCatch:()=>FN,ZodDate:()=>IN,ZodDefault:()=>MN,ZodDiscriminatedUnion:()=>kZ,ZodEffects:()=>Iy,ZodEnum:()=>NN,ZodError:()=>sg,ZodFirstPartyTypeKind:()=>Si,ZodFunction:()=>GZ,ZodIntersection:()=>wN,ZodIssueCode:()=>ln,ZodLazy:()=>RN,ZodLiteral:()=>BN,ZodMap:()=>j8,ZodNaN:()=>z8,ZodNativeEnum:()=>ON,ZodNever:()=>NC,ZodNull:()=>bN,ZodNullable:()=>lS,ZodNumber:()=>DN,ZodObject:()=>ag,ZodOptional:()=>Sy,ZodParsedType:()=>Gn,ZodPipeline:()=>dG,ZodPromise:()=>ux,ZodReadonly:()=>LN,ZodRecord:()=>UZ,ZodSchema:()=>Po,ZodSet:()=>W8,ZodString:()=>ax,ZodSymbol:()=>$8,ZodTransformer:()=>Iy,ZodTuple:()=>aS,ZodType:()=>Po,ZodUndefined:()=>TN,ZodUnion:()=>xN,ZodUnknown:()=>d2,ZodVoid:()=>Y8,addIssueToContext:()=>Nn,any:()=>o8n,array:()=>u8n,bigint:()=>e8n,boolean:()=>Aat,coerce:()=>O8n,custom:()=>pat,date:()=>t8n,datetimeRegex:()=>dat,defaultErrorMap:()=>u2,discriminatedUnion:()=>p8n,effect:()=>I8n,enum:()=>D8n,function:()=>y8n,getErrorMap:()=>H8,getParsedType:()=>sS,instanceof:()=>XFn,intersection:()=>h8n,isAborted:()=>PZ,isAsync:()=>q8,isDirty:()=>QZ,isValid:()=>sx,late:()=>KFn,lazy:()=>C8n,literal:()=>v8n,makeIssue:()=>uG,map:()=>g8n,nan:()=>ZFn,nativeEnum:()=>S8n,never:()=>a8n,null:()=>i8n,nullable:()=>b8n,number:()=>mat,object:()=>c8n,objectUtil:()=>QSe,oboolean:()=>N8n,onumber:()=>B8n,optional:()=>T8n,ostring:()=>R8n,pipeline:()=>w8n,preprocess:()=>x8n,promise:()=>_8n,quotelessJson:()=>IFn,record:()=>A8n,set:()=>E8n,setErrorMap:()=>bFn,strictObject:()=>d8n,string:()=>hat,symbol:()=>n8n,transformer:()=>I8n,tuple:()=>m8n,undefined:()=>r8n,union:()=>f8n,unknown:()=>s8n,util:()=>os,void:()=>l8n});var qSe=Le(()=>{LZ();USe();oat();lG();gat();FZ()});var fG=Le(()=>{qSe();qSe()});var J8,Eat,HZ,yat,Cat,F8n,xy,lg,pG,uS,wy,qZ,vat,VZ,Dat,Sat,_at,hG,Ty,Iat,Tat,cx,PN,$Z,mG,bat,L8n,P8n,Q8n,VSe,xat,wat,YZ,k8n,jZ,WZ,zZ,Rat,Bat,Nat,Oat,U8n,G8n,$Se,H8n,YSe,q8n,jSe,V8n,$8n,Y8n,j8n,W8n,z8n,J8n,AG,K8n,WSe,zSe,JSe,X8n,Z8n,Mat,eLn,gG,tLn,nLn,rLn,iLn,KSe,JZ,jKr,oLn,sLn,Fat,aLn,lLn,uLn,cLn,dLn,fLn,pLn,hLn,mLn,ALn,gLn,ELn,yLn,CLn,vLn,DLn,SLn,XSe,_Ln,ILn,TLn,bLn,WKr,zKr,JKr,KKr,XKr,ZKr,by,dx=Le(()=>{fG();J8="2025-06-18",Eat=[J8,"2025-03-26","2024-11-05","2024-10-07"],HZ="2.0",yat=ve.union([ve.string(),ve.number().int()]),Cat=ve.string(),F8n=ve.object({progressToken:ve.optional(yat)}).passthrough(),xy=ve.object({_meta:ve.optional(F8n)}).passthrough(),lg=ve.object({method:ve.string(),params:ve.optional(xy)}),pG=ve.object({_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),uS=ve.object({method:ve.string(),params:ve.optional(pG)}),wy=ve.object({_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),qZ=ve.union([ve.string(),ve.number().int()]),vat=ve.object({jsonrpc:ve.literal(HZ),id:qZ}).merge(lg).strict(),VZ=t=>vat.safeParse(t).success,Dat=ve.object({jsonrpc:ve.literal(HZ)}).merge(uS).strict(),Sat=t=>Dat.safeParse(t).success,_at=ve.object({jsonrpc:ve.literal(HZ),id:qZ,result:wy}).strict(),hG=t=>_at.safeParse(t).success;(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"})(Ty||(Ty={}));Iat=ve.object({jsonrpc:ve.literal(HZ),id:qZ,error:ve.object({code:ve.number().int(),message:ve.string(),data:ve.optional(ve.unknown())})}).strict(),Tat=t=>Iat.safeParse(t).success,cx=ve.union([vat,Dat,_at,Iat]),PN=wy.strict(),$Z=uS.extend({method:ve.literal("notifications/cancelled"),params:pG.extend({requestId:qZ,reason:ve.string().optional()})}),mG=ve.object({name:ve.string(),title:ve.optional(ve.string())}).passthrough(),bat=mG.extend({version:ve.string()}),L8n=ve.object({experimental:ve.optional(ve.object({}).passthrough()),sampling:ve.optional(ve.object({}).passthrough()),elicitation:ve.optional(ve.object({}).passthrough()),roots:ve.optional(ve.object({listChanged:ve.optional(ve.boolean())}).passthrough())}).passthrough(),P8n=lg.extend({method:ve.literal("initialize"),params:xy.extend({protocolVersion:ve.string(),capabilities:L8n,clientInfo:bat})}),Q8n=ve.object({experimental:ve.optional(ve.object({}).passthrough()),logging:ve.optional(ve.object({}).passthrough()),completions:ve.optional(ve.object({}).passthrough()),prompts:ve.optional(ve.object({listChanged:ve.optional(ve.boolean())}).passthrough()),resources:ve.optional(ve.object({subscribe:ve.optional(ve.boolean()),listChanged:ve.optional(ve.boolean())}).passthrough()),tools:ve.optional(ve.object({listChanged:ve.optional(ve.boolean())}).passthrough())}).passthrough(),VSe=wy.extend({protocolVersion:ve.string(),capabilities:Q8n,serverInfo:bat,instructions:ve.optional(ve.string())}),xat=uS.extend({method:ve.literal("notifications/initialized")}),wat=t=>xat.safeParse(t).success,YZ=lg.extend({method:ve.literal("ping")}),k8n=ve.object({progress:ve.number(),total:ve.optional(ve.number()),message:ve.optional(ve.string())}).passthrough(),jZ=uS.extend({method:ve.literal("notifications/progress"),params:pG.merge(k8n).extend({progressToken:yat})}),WZ=lg.extend({params:xy.extend({cursor:ve.optional(Cat)}).optional()}),zZ=wy.extend({nextCursor:ve.optional(Cat)}),Rat=ve.object({uri:ve.string(),mimeType:ve.optional(ve.string()),_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),Bat=Rat.extend({text:ve.string()}),Nat=Rat.extend({blob:ve.string().base64()}),Oat=mG.extend({uri:ve.string(),description:ve.optional(ve.string()),mimeType:ve.optional(ve.string()),_meta:ve.optional(ve.object({}).passthrough())}),U8n=mG.extend({uriTemplate:ve.string(),description:ve.optional(ve.string()),mimeType:ve.optional(ve.string()),_meta:ve.optional(ve.object({}).passthrough())}),G8n=WZ.extend({method:ve.literal("resources/list")}),$Se=zZ.extend({resources:ve.array(Oat)}),H8n=WZ.extend({method:ve.literal("resources/templates/list")}),YSe=zZ.extend({resourceTemplates:ve.array(U8n)}),q8n=lg.extend({method:ve.literal("resources/read"),params:xy.extend({uri:ve.string()})}),jSe=wy.extend({contents:ve.array(ve.union([Bat,Nat]))}),V8n=uS.extend({method:ve.literal("notifications/resources/list_changed")}),$8n=lg.extend({method:ve.literal("resources/subscribe"),params:xy.extend({uri:ve.string()})}),Y8n=lg.extend({method:ve.literal("resources/unsubscribe"),params:xy.extend({uri:ve.string()})}),j8n=uS.extend({method:ve.literal("notifications/resources/updated"),params:pG.extend({uri:ve.string()})}),W8n=ve.object({name:ve.string(),description:ve.optional(ve.string()),required:ve.optional(ve.boolean())}).passthrough(),z8n=mG.extend({description:ve.optional(ve.string()),arguments:ve.optional(ve.array(W8n)),_meta:ve.optional(ve.object({}).passthrough())}),J8n=WZ.extend({method:ve.literal("prompts/list")}),AG=zZ.extend({prompts:ve.array(z8n)}),K8n=lg.extend({method:ve.literal("prompts/get"),params:xy.extend({name:ve.string(),arguments:ve.optional(ve.record(ve.string()))})}),WSe=ve.object({type:ve.literal("text"),text:ve.string(),_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),zSe=ve.object({type:ve.literal("image"),data:ve.string().base64(),mimeType:ve.string(),_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),JSe=ve.object({type:ve.literal("audio"),data:ve.string().base64(),mimeType:ve.string(),_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),X8n=ve.object({type:ve.literal("resource"),resource:ve.union([Bat,Nat]),_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),Z8n=Oat.extend({type:ve.literal("resource_link")}),Mat=ve.union([WSe,zSe,JSe,Z8n,X8n]),eLn=ve.object({role:ve.enum(["user","assistant"]),content:Mat}).passthrough(),gG=wy.extend({description:ve.optional(ve.string()),messages:ve.array(eLn)}),tLn=uS.extend({method:ve.literal("notifications/prompts/list_changed")}),nLn=ve.object({title:ve.optional(ve.string()),readOnlyHint:ve.optional(ve.boolean()),destructiveHint:ve.optional(ve.boolean()),idempotentHint:ve.optional(ve.boolean()),openWorldHint:ve.optional(ve.boolean())}).passthrough(),rLn=mG.extend({description:ve.optional(ve.string()),inputSchema:ve.object({type:ve.literal("object"),properties:ve.optional(ve.object({}).passthrough()),required:ve.optional(ve.array(ve.string()))}).passthrough(),outputSchema:ve.optional(ve.object({type:ve.literal("object"),properties:ve.optional(ve.object({}).passthrough()),required:ve.optional(ve.array(ve.string()))}).passthrough()),annotations:ve.optional(nLn),_meta:ve.optional(ve.object({}).passthrough())}),iLn=WZ.extend({method:ve.literal("tools/list")}),KSe=zZ.extend({tools:ve.array(rLn)}),JZ=wy.extend({content:ve.array(Mat).default([]),structuredContent:ve.object({}).passthrough().optional(),isError:ve.optional(ve.boolean())}),jKr=JZ.or(wy.extend({toolResult:ve.unknown()})),oLn=lg.extend({method:ve.literal("tools/call"),params:xy.extend({name:ve.string(),arguments:ve.optional(ve.record(ve.unknown()))})}),sLn=uS.extend({method:ve.literal("notifications/tools/list_changed")}),Fat=ve.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),aLn=lg.extend({method:ve.literal("logging/setLevel"),params:xy.extend({level:Fat})}),lLn=uS.extend({method:ve.literal("notifications/message"),params:pG.extend({level:Fat,logger:ve.optional(ve.string()),data:ve.unknown()})}),uLn=ve.object({name:ve.string().optional()}).passthrough(),cLn=ve.object({hints:ve.optional(ve.array(uLn)),costPriority:ve.optional(ve.number().min(0).max(1)),speedPriority:ve.optional(ve.number().min(0).max(1)),intelligencePriority:ve.optional(ve.number().min(0).max(1))}).passthrough(),dLn=ve.object({role:ve.enum(["user","assistant"]),content:ve.union([WSe,zSe,JSe])}).passthrough(),fLn=lg.extend({method:ve.literal("sampling/createMessage"),params:xy.extend({messages:ve.array(dLn),systemPrompt:ve.optional(ve.string()),includeContext:ve.optional(ve.enum(["none","thisServer","allServers"])),temperature:ve.optional(ve.number()),maxTokens:ve.number().int(),stopSequences:ve.optional(ve.array(ve.string())),metadata:ve.optional(ve.object({}).passthrough()),modelPreferences:ve.optional(cLn)})}),pLn=wy.extend({model:ve.string(),stopReason:ve.optional(ve.enum(["endTurn","stopSequence","maxTokens"]).or(ve.string())),role:ve.enum(["user","assistant"]),content:ve.discriminatedUnion("type",[WSe,zSe,JSe])}),hLn=ve.object({type:ve.literal("boolean"),title:ve.optional(ve.string()),description:ve.optional(ve.string()),default:ve.optional(ve.boolean())}).passthrough(),mLn=ve.object({type:ve.literal("string"),title:ve.optional(ve.string()),description:ve.optional(ve.string()),minLength:ve.optional(ve.number()),maxLength:ve.optional(ve.number()),format:ve.optional(ve.enum(["email","uri","date","date-time"]))}).passthrough(),ALn=ve.object({type:ve.enum(["number","integer"]),title:ve.optional(ve.string()),description:ve.optional(ve.string()),minimum:ve.optional(ve.number()),maximum:ve.optional(ve.number())}).passthrough(),gLn=ve.object({type:ve.literal("string"),title:ve.optional(ve.string()),description:ve.optional(ve.string()),enum:ve.array(ve.string()),enumNames:ve.optional(ve.array(ve.string()))}).passthrough(),ELn=ve.union([hLn,mLn,ALn,gLn]),yLn=lg.extend({method:ve.literal("elicitation/create"),params:xy.extend({message:ve.string(),requestedSchema:ve.object({type:ve.literal("object"),properties:ve.record(ve.string(),ELn),required:ve.optional(ve.array(ve.string()))}).passthrough()})}),CLn=wy.extend({action:ve.enum(["accept","decline","cancel"]),content:ve.optional(ve.record(ve.string(),ve.unknown()))}),vLn=ve.object({type:ve.literal("ref/resource"),uri:ve.string()}).passthrough(),DLn=ve.object({type:ve.literal("ref/prompt"),name:ve.string()}).passthrough(),SLn=lg.extend({method:ve.literal("completion/complete"),params:xy.extend({ref:ve.union([DLn,vLn]),argument:ve.object({name:ve.string(),value:ve.string()}).passthrough(),context:ve.optional(ve.object({arguments:ve.optional(ve.record(ve.string(),ve.string()))}))})}),XSe=wy.extend({completion:ve.object({values:ve.array(ve.string()).max(100),total:ve.optional(ve.number().int()),hasMore:ve.optional(ve.boolean())}).passthrough()}),_Ln=ve.object({uri:ve.string().startsWith("file://"),name:ve.optional(ve.string()),_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),ILn=lg.extend({method:ve.literal("roots/list")}),TLn=wy.extend({roots:ve.array(_Ln)}),bLn=uS.extend({method:ve.literal("notifications/roots/list_changed")}),WKr=ve.union([YZ,P8n,SLn,aLn,K8n,J8n,G8n,H8n,q8n,$8n,Y8n,oLn,iLn]),zKr=ve.union([$Z,jZ,xat,bLn]),JKr=ve.union([PN,pLn,CLn,TLn]),KKr=ve.union([YZ,fLn,yLn,ILn]),XKr=ve.union([$Z,jZ,lLn,j8n,V8n,sLn,tLn]),ZKr=ve.union([PN,VSe,XSe,gG,AG,$Se,YSe,jSe,JZ,KSe]),by=class extends Error{constructor(e,n,r){super(`MCP error ${e}: ${n}`),this.code=e,this.data=r,this.name="McpError"}}});function Lat(t,e){return Object.entries(e).reduce((n,[r,i])=>(i&&typeof i=="object"?n[r]=n[r]?{...n[r],...i}:i:n[r]=i,n),{...t})}var xLn,KZ,Pat=Le(()=>{dx();xLn=6e4,KZ=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this.setNotificationHandler($Z,n=>{let r=this._requestHandlerAbortControllers.get(n.params.requestId);r?.abort(n.params.reason)}),this.setNotificationHandler(jZ,n=>{this._onprogress(n)}),this.setRequestHandler(YZ,n=>({}))}_setupTimeout(e,n,r,i,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,n),startTime:Date.now(),timeout:n,maxTotalTimeout:r,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(e){let n=this._timeoutInfo.get(e);if(!n)return!1;let r=Date.now()-n.startTime;if(n.maxTotalTimeout&&r>=n.maxTotalTimeout)throw this._timeoutInfo.delete(e),new by(Ty.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:r});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(e){let n=this._timeoutInfo.get(e);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var n,r,i;this._transport=e;let o=(n=this.transport)===null||n===void 0?void 0:n.onclose;this._transport.onclose=()=>{o?.(),this._onclose()};let s=(r=this.transport)===null||r===void 0?void 0:r.onerror;this._transport.onerror=l=>{s?.(l),this._onerror(l)};let a=(i=this._transport)===null||i===void 0?void 0:i.onmessage;this._transport.onmessage=(l,u)=>{a?.(l,u),hG(l)||Tat(l)?this._onresponse(l):VZ(l)?this._onrequest(l,u):Sat(l)?this._onnotification(l):this._onerror(new Error(`Unknown message type: ${JSON.stringify(l)}`))},await this._transport.start()}_onclose(){var e;let n=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);let r=new by(Ty.ConnectionClosed,"Connection closed");for(let i of n.values())i(r)}_onerror(e){var n;(n=this.onerror)===null||n===void 0||n.call(this,e)}_onnotification(e){var n;let r=(n=this._notificationHandlers.get(e.method))!==null&&n!==void 0?n:this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,n){var r,i,o,s;let a=(r=this._requestHandlers.get(e.method))!==null&&r!==void 0?r:this.fallbackRequestHandler;if(a===void 0){(i=this._transport)===null||i===void 0||i.send({jsonrpc:"2.0",id:e.id,error:{code:Ty.MethodNotFound,message:"Method not found"}}).catch(c=>this._onerror(new Error(`Failed to send an error response: ${c}`)));return}let l=new AbortController;this._requestHandlerAbortControllers.set(e.id,l);let u={signal:l.signal,sessionId:(o=this._transport)===null||o===void 0?void 0:o.sessionId,_meta:(s=e.params)===null||s===void 0?void 0:s._meta,sendNotification:c=>this.notification(c,{relatedRequestId:e.id}),sendRequest:(c,d,h)=>this.request(c,d,{...h,relatedRequestId:e.id}),authInfo:n?.authInfo,requestId:e.id,requestInfo:n?.requestInfo};Promise.resolve().then(()=>a(e,u)).then(c=>{var d;if(!l.signal.aborted)return(d=this._transport)===null||d===void 0?void 0:d.send({result:c,jsonrpc:"2.0",id:e.id})},c=>{var d,h;if(!l.signal.aborted)return(d=this._transport)===null||d===void 0?void 0:d.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(c.code)?c.code:Ty.InternalError,message:(h=c.message)!==null&&h!==void 0?h:"Internal error"}})}).catch(c=>this._onerror(new Error(`Failed to send response: ${c}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:n,...r}=e.params,i=Number(n),o=this._progressHandlers.get(i);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(l){s(l);return}o(r)}_onresponse(e){let n=Number(e.id),r=this._responseHandlers.get(n);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),hG(e))r(e);else{let i=new by(e.error.code,e.error.message,e.error.data);r(i)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,n,r){let{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}=r??{};return new Promise((a,l)=>{var u,c,d,h,m,E;if(!this._transport){l(new Error("Not connected"));return}((u=this._options)===null||u===void 0?void 0:u.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(c=r?.signal)===null||c===void 0||c.throwIfAborted();let y=this._requestMessageId++,C={...e,jsonrpc:"2.0",id:y};r?.onprogress&&(this._progressHandlers.set(y,r.onprogress),C.params={...e.params,_meta:{...((d=e.params)===null||d===void 0?void 0:d._meta)||{},progressToken:y}});let _=R=>{var F;this._responseHandlers.delete(y),this._progressHandlers.delete(y),this._cleanupTimeout(y),(F=this._transport)===null||F===void 0||F.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:y,reason:String(R)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(q=>this._onerror(new Error(`Failed to send cancellation: ${q}`))),l(R)};this._responseHandlers.set(y,R=>{var F;if(!(!((F=r?.signal)===null||F===void 0)&&F.aborted)){if(R instanceof Error)return l(R);try{let q=n.parse(R.result);a(q)}catch(q){l(q)}}}),(h=r?.signal)===null||h===void 0||h.addEventListener("abort",()=>{var R;_((R=r?.signal)===null||R===void 0?void 0:R.reason)});let w=(m=r?.timeout)!==null&&m!==void 0?m:xLn,B=()=>_(new by(Ty.RequestTimeout,"Request timed out",{timeout:w}));this._setupTimeout(y,w,r?.maxTotalTimeout,B,(E=r?.resetTimeoutOnProgress)!==null&&E!==void 0?E:!1),this._transport.send(C,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(R=>{this._cleanupTimeout(y),l(R)})})}async notification(e,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let r={...e,jsonrpc:"2.0"};await this._transport.send(r,n)}setRequestHandler(e,n){let r=e.shape.method.value;this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(i,o)=>Promise.resolve(n(e.parse(i),o)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,n){this._notificationHandlers.set(e.shape.method.value,r=>Promise.resolve(n(e.parse(r))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}});var kat=b((XZ,Qat)=>{(function(t,e){typeof XZ=="object"&&typeof Qat<"u"?e(XZ):typeof define=="function"&&define.amd?define(["exports"],e):e(t.URI=t.URI||{})})(XZ,function(t){"use strict";function e(){for(var Je=arguments.length,je=Array(Je),ut=0;ut<Je;ut++)je[ut]=arguments[ut];if(je.length>1){je[0]=je[0].slice(0,-1);for(var St=je.length-1,st=1;st<St;++st)je[st]=je[st].slice(1,-1);return je[St]=je[St].slice(1),je.join("")}else return je[0]}function n(Je){return"(?:"+Je+")"}function r(Je){return Je===void 0?"undefined":Je===null?"null":Object.prototype.toString.call(Je).split(" ").pop().split("]").shift().toLowerCase()}function i(Je){return Je.toUpperCase()}function o(Je){return Je!=null?Je instanceof Array?Je:typeof Je.length!="number"||Je.split||Je.setInterval||Je.call?[Je]:Array.prototype.slice.call(Je):[]}function s(Je,je){var ut=Je;if(je)for(var St in je)ut[St]=je[St];return ut}function a(Je){var je="[A-Za-z]",ut="[\\x0D]",St="[0-9]",st="[\\x22]",vn=e(St,"[A-Fa-f]"),Vn="[\\x0A]",li="[\\x20]",Ir=n(n("%[EFef]"+vn+"%"+vn+vn+"%"+vn+vn)+"|"+n("%[89A-Fa-f]"+vn+"%"+vn+vn)+"|"+n("%"+vn+vn)),As="[\\:\\/\\?\\#\\[\\]\\@]",Pi="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Bo=e(As,Pi),ks=Je?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",Cr=Je?"[\\uE000-\\uF8FF]":"[]",ni=e(je,St,"[\\-\\.\\_\\~]",ks),Do=n(je+e(je,St,"[\\+\\-\\.]")+"*"),No=n(n(Ir+"|"+e(ni,Pi,"[\\:]"))+"*"),Nu=n(n("25[0-5]")+"|"+n("2[0-4]"+St)+"|"+n("1"+St+St)+"|"+n("[1-9]"+St)+"|"+St),va=n(n("25[0-5]")+"|"+n("2[0-4]"+St)+"|"+n("1"+St+St)+"|"+n("0?[1-9]"+St)+"|0?0?"+St),Ks=n(va+"\\."+va+"\\."+va+"\\."+va),Ei=n(vn+"{1,4}"),fl=n(n(Ei+"\\:"+Ei)+"|"+Ks),ui=n(n(Ei+"\\:")+"{6}"+fl),ci=n("\\:\\:"+n(Ei+"\\:")+"{5}"+fl),Ou=n(n(Ei)+"?\\:\\:"+n(Ei+"\\:")+"{4}"+fl),Da=n(n(n(Ei+"\\:")+"{0,1}"+Ei)+"?\\:\\:"+n(Ei+"\\:")+"{3}"+fl),ho=n(n(n(Ei+"\\:")+"{0,2}"+Ei)+"?\\:\\:"+n(Ei+"\\:")+"{2}"+fl),Ic=n(n(n(Ei+"\\:")+"{0,3}"+Ei)+"?\\:\\:"+Ei+"\\:"+fl),ua=n(n(n(Ei+"\\:")+"{0,4}"+Ei)+"?\\:\\:"+fl),gs=n(n(n(Ei+"\\:")+"{0,5}"+Ei)+"?\\:\\:"+Ei),ja=n(n(n(Ei+"\\:")+"{0,6}"+Ei)+"?\\:\\:"),Be=n([ui,ci,Ou,Da,ho,Ic,ua,gs,ja].join("|")),Me=n(n(ni+"|"+Ir)+"+"),tt=n(Be+"\\%25"+Me),ct=n(Be+n("\\%25|\\%(?!"+vn+"{2})")+Me),Ct=n("[vV]"+vn+"+\\."+e(ni,Pi,"[\\:]")+"+"),Ft=n("\\["+n(ct+"|"+Be+"|"+Ct)+"\\]"),Jt=n(n(Ir+"|"+e(ni,Pi))+"*"),Vt=n(Ft+"|"+Ks+"(?!"+Jt+")|"+Jt),nn=n(St+"*"),en=n(n(No+"@")+"?"+Vt+n("\\:"+nn)+"?"),hn=n(Ir+"|"+e(ni,Pi,"[\\:\\@]")),sr=n(hn+"*"),Ii=n(hn+"+"),Us=n(n(Ir+"|"+e(ni,Pi,"[\\@]"))+"+"),hi=n(n("\\/"+sr)+"*"),La=n("\\/"+n(Ii+hi)+"?"),eu=n(Us+hi),ad=n(Ii+hi),Ts="(?!"+hn+")",hE=n(hi+"|"+La+"|"+eu+"|"+ad+"|"+Ts),Hd=n(n(hn+"|"+e("[\\/\\?]",Cr))+"*"),ld=n(n(hn+"|[\\/\\?]")+"*"),gm=n(n("\\/\\/"+en+hi)+"|"+La+"|"+ad+"|"+Ts),mE=n(Do+"\\:"+gm+n("\\?"+Hd)+"?"+n("\\#"+ld)+"?"),ph=n(n("\\/\\/"+en+hi)+"|"+La+"|"+eu+"|"+Ts),Wa=n(ph+n("\\?"+Hd)+"?"+n("\\#"+ld)+"?"),wA=n(mE+"|"+Wa),Ef=n(Do+"\\:"+gm+n("\\?"+Hd)+"?"),Em="^("+Do+")\\:"+n(n("\\/\\/("+n("("+No+")@")+"?("+Vt+")"+n("\\:("+nn+")")+"?)")+"?("+hi+"|"+La+"|"+ad+"|"+Ts+")")+n("\\?("+Hd+")")+"?"+n("\\#("+ld+")")+"?$",yf="^(){0}"+n(n("\\/\\/("+n("("+No+")@")+"?("+Vt+")"+n("\\:("+nn+")")+"?)")+"?("+hi+"|"+La+"|"+eu+"|"+Ts+")")+n("\\?("+Hd+")")+"?"+n("\\#("+ld+")")+"?$",ym="^("+Do+")\\:"+n(n("\\/\\/("+n("("+No+")@")+"?("+Vt+")"+n("\\:("+nn+")")+"?)")+"?("+hi+"|"+La+"|"+ad+"|"+Ts+")")+n("\\?("+Hd+")")+"?$",Mu="^"+n("\\#("+ld+")")+"?$",Vg="^"+n("("+No+")@")+"?("+Vt+")"+n("\\:("+nn+")")+"?$";return{NOT_SCHEME:new RegExp(e("[^]",je,St,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",ni,Pi),"g"),NOT_HOST:new RegExp(e("[^\\%\\[\\]\\:]",ni,Pi),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",ni,Pi),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",ni,Pi),"g"),NOT_QUERY:new RegExp(e("[^\\%]",ni,Pi,"[\\:\\@\\/\\?]",Cr),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",ni,Pi,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",ni,Pi),"g"),UNRESERVED:new RegExp(ni,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",ni,Bo),"g"),PCT_ENCODED:new RegExp(Ir,"g"),IPV4ADDRESS:new RegExp("^("+Ks+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Be+")"+n(n("\\%25|\\%(?!"+vn+"{2})")+"("+Me+")")+"?\\]?$")}}var l=a(!1),u=a(!0),c=function(){function Je(je,ut){var St=[],st=!0,vn=!1,Vn=void 0;try{for(var li=je[Symbol.iterator](),Ir;!(st=(Ir=li.next()).done)&&(St.push(Ir.value),!(ut&&St.length===ut));st=!0);}catch(As){vn=!0,Vn=As}finally{try{!st&&li.return&&li.return()}finally{if(vn)throw Vn}}return St}return function(je,ut){if(Array.isArray(je))return je;if(Symbol.iterator in Object(je))return Je(je,ut);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(Je){if(Array.isArray(Je)){for(var je=0,ut=Array(Je.length);je<Je.length;je++)ut[je]=Je[je];return ut}else return Array.from(Je)},h=2147483647,m=36,E=1,y=26,C=38,_=700,w=72,B=128,R="-",F=/^xn--/,q=/[^\0-\x7E]/,J=/[\x2E\u3002\uFF0E\uFF61]/g,j={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=m-E,K=Math.floor,U=String.fromCharCode;function se(Je){throw new RangeError(j[Je])}function V(Je,je){for(var ut=[],St=Je.length;St--;)ut[St]=je(Je[St]);return ut}function O(Je,je){var ut=Je.split("@"),St="";ut.length>1&&(St=ut[0]+"@",Je=ut[1]),Je=Je.replace(J,".");var st=Je.split("."),vn=V(st,je).join(".");return St+vn}function Y(Je){for(var je=[],ut=0,St=Je.length;ut<St;){var st=Je.charCodeAt(ut++);if(st>=55296&&st<=56319&&ut<St){var vn=Je.charCodeAt(ut++);(vn&64512)==56320?je.push(((st&1023)<<10)+(vn&1023)+65536):(je.push(st),ut--)}else je.push(st)}return je}var ee=function(je){return String.fromCodePoint.apply(String,d(je))},ne=function(je){return je-48<10?je-22:je-65<26?je-65:je-97<26?je-97:m},Ae=function(je,ut){return je+22+75*(je<26)-((ut!=0)<<5)},Ce=function(je,ut,St){var st=0;for(je=St?K(je/_):je>>1,je+=K(je/ut);je>L*y>>1;st+=m)je=K(je/L);return K(st+(L+1)*je/(je+C))},De=function(je){var ut=[],St=je.length,st=0,vn=B,Vn=w,li=je.lastIndexOf(R);li<0&&(li=0);for(var Ir=0;Ir<li;++Ir)je.charCodeAt(Ir)>=128&&se("not-basic"),ut.push(je.charCodeAt(Ir));for(var As=li>0?li+1:0;As<St;){for(var Pi=st,Bo=1,ks=m;;ks+=m){As>=St&&se("invalid-input");var Cr=ne(je.charCodeAt(As++));(Cr>=m||Cr>K((h-st)/Bo))&&se("overflow"),st+=Cr*Bo;var ni=ks<=Vn?E:ks>=Vn+y?y:ks-Vn;if(Cr<ni)break;var Do=m-ni;Bo>K(h/Do)&&se("overflow"),Bo*=Do}var No=ut.length+1;Vn=Ce(st-Pi,No,Pi==0),K(st/No)>h-vn&&se("overflow"),vn+=K(st/No),st%=No,ut.splice(st++,0,vn)}return String.fromCodePoint.apply(String,ut)},Ue=function(je){var ut=[];je=Y(je);var St=je.length,st=B,vn=0,Vn=w,li=!0,Ir=!1,As=void 0;try{for(var Pi=je[Symbol.iterator](),Bo;!(li=(Bo=Pi.next()).done);li=!0){var ks=Bo.value;ks<128&&ut.push(U(ks))}}catch(ct){Ir=!0,As=ct}finally{try{!li&&Pi.return&&Pi.return()}finally{if(Ir)throw As}}var Cr=ut.length,ni=Cr;for(Cr&&ut.push(R);ni<St;){var Do=h,No=!0,Nu=!1,va=void 0;try{for(var Ks=je[Symbol.iterator](),Ei;!(No=(Ei=Ks.next()).done);No=!0){var fl=Ei.value;fl>=st&&fl<Do&&(Do=fl)}}catch(ct){Nu=!0,va=ct}finally{try{!No&&Ks.return&&Ks.return()}finally{if(Nu)throw va}}var ui=ni+1;Do-st>K((h-vn)/ui)&&se("overflow"),vn+=(Do-st)*ui,st=Do;var ci=!0,Ou=!1,Da=void 0;try{for(var ho=je[Symbol.iterator](),Ic;!(ci=(Ic=ho.next()).done);ci=!0){var ua=Ic.value;if(ua<st&&++vn>h&&se("overflow"),ua==st){for(var gs=vn,ja=m;;ja+=m){var Be=ja<=Vn?E:ja>=Vn+y?y:ja-Vn;if(gs<Be)break;var Me=gs-Be,tt=m-Be;ut.push(U(Ae(Be+Me%tt,0))),gs=K(Me/tt)}ut.push(U(Ae(gs,0))),Vn=Ce(vn,ui,ni==Cr),vn=0,++ni}}}catch(ct){Ou=!0,Da=ct}finally{try{!ci&&ho.return&&ho.return()}finally{if(Ou)throw Da}}++vn,++st}return ut.join("")},qe=function(je){return O(je,function(ut){return F.test(ut)?De(ut.slice(4).toLowerCase()):ut})},Ie=function(je){return O(je,function(ut){return q.test(ut)?"xn--"+Ue(ut):ut})},xe={version:"2.1.0",ucs2:{decode:Y,encode:ee},decode:De,encode:Ue,toASCII:Ie,toUnicode:qe},Oe={};function le(Je){var je=Je.charCodeAt(0),ut=void 0;return je<16?ut="%0"+je.toString(16).toUpperCase():je<128?ut="%"+je.toString(16).toUpperCase():je<2048?ut="%"+(je>>6|192).toString(16).toUpperCase()+"%"+(je&63|128).toString(16).toUpperCase():ut="%"+(je>>12|224).toString(16).toUpperCase()+"%"+(je>>6&63|128).toString(16).toUpperCase()+"%"+(je&63|128).toString(16).toUpperCase(),ut}function re(Je){for(var je="",ut=0,St=Je.length;ut<St;){var st=parseInt(Je.substr(ut+1,2),16);if(st<128)je+=String.fromCharCode(st),ut+=3;else if(st>=194&&st<224){if(St-ut>=6){var vn=parseInt(Je.substr(ut+4,2),16);je+=String.fromCharCode((st&31)<<6|vn&63)}else je+=Je.substr(ut,6);ut+=6}else if(st>=224){if(St-ut>=9){var Vn=parseInt(Je.substr(ut+4,2),16),li=parseInt(Je.substr(ut+7,2),16);je+=String.fromCharCode((st&15)<<12|(Vn&63)<<6|li&63)}else je+=Je.substr(ut,9);ut+=9}else je+=Je.substr(ut,3),ut+=3}return je}function ye(Je,je){function ut(St){var st=re(St);return st.match(je.UNRESERVED)?st:St}return Je.scheme&&(Je.scheme=String(Je.scheme).replace(je.PCT_ENCODED,ut).toLowerCase().replace(je.NOT_SCHEME,"")),Je.userinfo!==void 0&&(Je.userinfo=String(Je.userinfo).replace(je.PCT_ENCODED,ut).replace(je.NOT_USERINFO,le).replace(je.PCT_ENCODED,i)),Je.host!==void 0&&(Je.host=String(Je.host).replace(je.PCT_ENCODED,ut).toLowerCase().replace(je.NOT_HOST,le).replace(je.PCT_ENCODED,i)),Je.path!==void 0&&(Je.path=String(Je.path).replace(je.PCT_ENCODED,ut).replace(Je.scheme?je.NOT_PATH:je.NOT_PATH_NOSCHEME,le).replace(je.PCT_ENCODED,i)),Je.query!==void 0&&(Je.query=String(Je.query).replace(je.PCT_ENCODED,ut).replace(je.NOT_QUERY,le).replace(je.PCT_ENCODED,i)),Je.fragment!==void 0&&(Je.fragment=String(Je.fragment).replace(je.PCT_ENCODED,ut).replace(je.NOT_FRAGMENT,le).replace(je.PCT_ENCODED,i)),Je}function X(Je){return Je.replace(/^0*(.*)/,"$1")||"0"}function he(Je,je){var ut=Je.match(je.IPV4ADDRESS)||[],St=c(ut,2),st=St[1];return st?st.split(".").map(X).join("."):Je}function ae(Je,je){var ut=Je.match(je.IPV6ADDRESS)||[],St=c(ut,3),st=St[1],vn=St[2];if(st){for(var Vn=st.toLowerCase().split("::").reverse(),li=c(Vn,2),Ir=li[0],As=li[1],Pi=As?As.split(":").map(X):[],Bo=Ir.split(":").map(X),ks=je.IPV4ADDRESS.test(Bo[Bo.length-1]),Cr=ks?7:8,ni=Bo.length-Cr,Do=Array(Cr),No=0;No<Cr;++No)Do[No]=Pi[No]||Bo[ni+No]||"";ks&&(Do[Cr-1]=he(Do[Cr-1],je));var Nu=Do.reduce(function(ui,ci,Ou){if(!ci||ci==="0"){var Da=ui[ui.length-1];Da&&Da.index+Da.length===Ou?Da.length++:ui.push({index:Ou,length:1})}return ui},[]),va=Nu.sort(function(ui,ci){return ci.length-ui.length})[0],Ks=void 0;if(va&&va.length>1){var Ei=Do.slice(0,va.index),fl=Do.slice(va.index+va.length);Ks=Ei.join(":")+"::"+fl.join(":")}else Ks=Do.join(":");return vn&&(Ks+="%"+vn),Ks}else return Je}var me=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Se="".match(/(){0}/)[1]===void 0;function ie(Je){var je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ut={},St=je.iri!==!1?u:l;je.reference==="suffix"&&(Je=(je.scheme?je.scheme+":":"")+"//"+Je);var st=Je.match(me);if(st){Se?(ut.scheme=st[1],ut.userinfo=st[3],ut.host=st[4],ut.port=parseInt(st[5],10),ut.path=st[6]||"",ut.query=st[7],ut.fragment=st[8],isNaN(ut.port)&&(ut.port=st[5])):(ut.scheme=st[1]||void 0,ut.userinfo=Je.indexOf("@")!==-1?st[3]:void 0,ut.host=Je.indexOf("//")!==-1?st[4]:void 0,ut.port=parseInt(st[5],10),ut.path=st[6]||"",ut.query=Je.indexOf("?")!==-1?st[7]:void 0,ut.fragment=Je.indexOf("#")!==-1?st[8]:void 0,isNaN(ut.port)&&(ut.port=Je.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?st[4]:void 0)),ut.host&&(ut.host=ae(he(ut.host,St),St)),ut.scheme===void 0&&ut.userinfo===void 0&&ut.host===void 0&&ut.port===void 0&&!ut.path&&ut.query===void 0?ut.reference="same-document":ut.scheme===void 0?ut.reference="relative":ut.fragment===void 0?ut.reference="absolute":ut.reference="uri",je.reference&&je.reference!=="suffix"&&je.reference!==ut.reference&&(ut.error=ut.error||"URI is not a "+je.reference+" reference.");var vn=Oe[(je.scheme||ut.scheme||"").toLowerCase()];if(!je.unicodeSupport&&(!vn||!vn.unicodeSupport)){if(ut.host&&(je.domainHost||vn&&vn.domainHost))try{ut.host=xe.toASCII(ut.host.replace(St.PCT_ENCODED,re).toLowerCase())}catch(Vn){ut.error=ut.error||"Host's domain name can not be converted to ASCII via punycode: "+Vn}ye(ut,l)}else ye(ut,St);vn&&vn.parse&&vn.parse(ut,je)}else ut.error=ut.error||"URI can not be parsed.";return ut}function k(Je,je){var ut=je.iri!==!1?u:l,St=[];return Je.userinfo!==void 0&&(St.push(Je.userinfo),St.push("@")),Je.host!==void 0&&St.push(ae(he(String(Je.host),ut),ut).replace(ut.IPV6ADDRESS,function(st,vn,Vn){return"["+vn+(Vn?"%25"+Vn:"")+"]"})),(typeof Je.port=="number"||typeof Je.port=="string")&&(St.push(":"),St.push(String(Je.port))),St.length?St.join(""):void 0}var W=/^\.\.?\//,pe=/^\/\.(\/|$)/,te=/^\/\.\.(\/|$)/,H=/^\/?(?:.|\n)*?(?=\/|$)/;function ge(Je){for(var je=[];Je.length;)if(Je.match(W))Je=Je.replace(W,"");else if(Je.match(pe))Je=Je.replace(pe,"/");else if(Je.match(te))Je=Je.replace(te,"/"),je.pop();else if(Je==="."||Je==="..")Je="";else{var ut=Je.match(H);if(ut){var St=ut[0];Je=Je.slice(St.length),je.push(St)}else throw new Error("Unexpected dot segment condition")}return je.join("")}function be(Je){var je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ut=je.iri?u:l,St=[],st=Oe[(je.scheme||Je.scheme||"").toLowerCase()];if(st&&st.serialize&&st.serialize(Je,je),Je.host&&!ut.IPV6ADDRESS.test(Je.host)){if(je.domainHost||st&&st.domainHost)try{Je.host=je.iri?xe.toUnicode(Je.host):xe.toASCII(Je.host.replace(ut.PCT_ENCODED,re).toLowerCase())}catch(li){Je.error=Je.error||"Host's domain name can not be converted to "+(je.iri?"Unicode":"ASCII")+" via punycode: "+li}}ye(Je,ut),je.reference!=="suffix"&&Je.scheme&&(St.push(Je.scheme),St.push(":"));var vn=k(Je,je);if(vn!==void 0&&(je.reference!=="suffix"&&St.push("//"),St.push(vn),Je.path&&Je.path.charAt(0)!=="/"&&St.push("/")),Je.path!==void 0){var Vn=Je.path;!je.absolutePath&&(!st||!st.absolutePath)&&(Vn=ge(Vn)),vn===void 0&&(Vn=Vn.replace(/^\/\//,"/%2F")),St.push(Vn)}return Je.query!==void 0&&(St.push("?"),St.push(Je.query)),Je.fragment!==void 0&&(St.push("#"),St.push(Je.fragment)),St.join("")}function Pe(Je,je){var ut=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},St=arguments[3],st={};return St||(Je=ie(be(Je,ut),ut),je=ie(be(je,ut),ut)),ut=ut||{},!ut.tolerant&&je.scheme?(st.scheme=je.scheme,st.userinfo=je.userinfo,st.host=je.host,st.port=je.port,st.path=ge(je.path||""),st.query=je.query):(je.userinfo!==void 0||je.host!==void 0||je.port!==void 0?(st.userinfo=je.userinfo,st.host=je.host,st.port=je.port,st.path=ge(je.path||""),st.query=je.query):(je.path?(je.path.charAt(0)==="/"?st.path=ge(je.path):((Je.userinfo!==void 0||Je.host!==void 0||Je.port!==void 0)&&!Je.path?st.path="/"+je.path:Je.path?st.path=Je.path.slice(0,Je.path.lastIndexOf("/")+1)+je.path:st.path=je.path,st.path=ge(st.path)),st.query=je.query):(st.path=Je.path,je.query!==void 0?st.query=je.query:st.query=Je.query),st.userinfo=Je.userinfo,st.host=Je.host,st.port=Je.port),st.scheme=Je.scheme),st.fragment=je.fragment,st}function pt(Je,je,ut){var St=s({scheme:"null"},ut);return be(Pe(ie(Je,St),ie(je,St),St,!0),St)}function Dt(Je,je){return typeof Je=="string"?Je=be(ie(Je,je),je):r(Je)==="object"&&(Je=ie(be(Je,je),je)),Je}function Qt(Je,je,ut){return typeof Je=="string"?Je=be(ie(Je,ut),ut):r(Je)==="object"&&(Je=be(Je,ut)),typeof je=="string"?je=be(ie(je,ut),ut):r(je)==="object"&&(je=be(je,ut)),Je===je}function dt(Je,je){return Je&&Je.toString().replace(!je||!je.iri?l.ESCAPE:u.ESCAPE,le)}function mt(Je,je){return Je&&Je.toString().replace(!je||!je.iri?l.PCT_ENCODED:u.PCT_ENCODED,re)}var kt={scheme:"http",domainHost:!0,parse:function(je,ut){return je.host||(je.error=je.error||"HTTP URIs must have a host."),je},serialize:function(je,ut){var St=String(je.scheme).toLowerCase()==="https";return(je.port===(St?443:80)||je.port==="")&&(je.port=void 0),je.path||(je.path="/"),je}},Ln={scheme:"https",domainHost:kt.domainHost,parse:kt.parse,serialize:kt.serialize};function si(Je){return typeof Je.secure=="boolean"?Je.secure:String(Je.scheme).toLowerCase()==="wss"}var Ni={scheme:"ws",domainHost:!0,parse:function(je,ut){var St=je;return St.secure=si(St),St.resourceName=(St.path||"/")+(St.query?"?"+St.query:""),St.path=void 0,St.query=void 0,St},serialize:function(je,ut){if((je.port===(si(je)?443:80)||je.port==="")&&(je.port=void 0),typeof je.secure=="boolean"&&(je.scheme=je.secure?"wss":"ws",je.secure=void 0),je.resourceName){var St=je.resourceName.split("?"),st=c(St,2),vn=st[0],Vn=st[1];je.path=vn&&vn!=="/"?vn:void 0,je.query=Vn,je.resourceName=void 0}return je.fragment=void 0,je}},Yi={scheme:"wss",domainHost:Ni.domainHost,parse:Ni.parse,serialize:Ni.serialize},Go={},to=!0,Re="[A-Za-z0-9\\-\\.\\_\\~"+(to?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",ot="[0-9A-Fa-f]",it=n(n("%[EFef]"+ot+"%"+ot+ot+"%"+ot+ot)+"|"+n("%[89A-Fa-f]"+ot+"%"+ot+ot)+"|"+n("%"+ot+ot)),Lt="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Cn="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",On=e(Cn,'[\\"\\\\]'),_n="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",ur=new RegExp(Re,"g"),Un=new RegExp(it,"g"),Fa=new RegExp(e("[^]",Lt,"[\\.]",'[\\"]',On),"g"),vl=new RegExp(e("[^]",Re,_n),"g"),Ud=vl;function sd(Je){var je=re(Je);return je.match(ur)?je:Je}var _c={scheme:"mailto",parse:function(je,ut){var St=je,st=St.to=St.path?St.path.split(","):[];if(St.path=void 0,St.query){for(var vn=!1,Vn={},li=St.query.split("&"),Ir=0,As=li.length;Ir<As;++Ir){var Pi=li[Ir].split("=");switch(Pi[0]){case"to":for(var Bo=Pi[1].split(","),ks=0,Cr=Bo.length;ks<Cr;++ks)st.push(Bo[ks]);break;case"subject":St.subject=mt(Pi[1],ut);break;case"body":St.body=mt(Pi[1],ut);break;default:vn=!0,Vn[mt(Pi[0],ut)]=mt(Pi[1],ut);break}}vn&&(St.headers=Vn)}St.query=void 0;for(var ni=0,Do=st.length;ni<Do;++ni){var No=st[ni].split("@");if(No[0]=mt(No[0]),ut.unicodeSupport)No[1]=mt(No[1],ut).toLowerCase();else try{No[1]=xe.toASCII(mt(No[1],ut).toLowerCase())}catch(Nu){St.error=St.error||"Email address's domain name can not be converted to ASCII via punycode: "+Nu}st[ni]=No.join("@")}return St},serialize:function(je,ut){var St=je,st=o(je.to);if(st){for(var vn=0,Vn=st.length;vn<Vn;++vn){var li=String(st[vn]),Ir=li.lastIndexOf("@"),As=li.slice(0,Ir).replace(Un,sd).replace(Un,i).replace(Fa,le),Pi=li.slice(Ir+1);try{Pi=ut.iri?xe.toUnicode(Pi):xe.toASCII(mt(Pi,ut).toLowerCase())}catch(ni){St.error=St.error||"Email address's domain name can not be converted to "+(ut.iri?"Unicode":"ASCII")+" via punycode: "+ni}st[vn]=As+"@"+Pi}St.path=st.join(",")}var Bo=je.headers=je.headers||{};je.subject&&(Bo.subject=je.subject),je.body&&(Bo.body=je.body);var ks=[];for(var Cr in Bo)Bo[Cr]!==Go[Cr]&&ks.push(Cr.replace(Un,sd).replace(Un,i).replace(vl,le)+"="+Bo[Cr].replace(Un,sd).replace(Un,i).replace(Ud,le));return ks.length&&(St.query=ks.join("&")),St}},Bu=/^([^\:]+)\:(.*)/,Ca={scheme:"urn",parse:function(je,ut){var St=je.path&&je.path.match(Bu),st=je;if(St){var vn=ut.scheme||st.scheme||"urn",Vn=St[1].toLowerCase(),li=St[2],Ir=vn+":"+(ut.nid||Vn),As=Oe[Ir];st.nid=Vn,st.nss=li,st.path=void 0,As&&(st=As.parse(st,ut))}else st.error=st.error||"URN can not be parsed.";return st},serialize:function(je,ut){var St=ut.scheme||je.scheme||"urn",st=je.nid,vn=St+":"+(ut.nid||st),Vn=Oe[vn];Vn&&(je=Vn.serialize(je,ut));var li=je,Ir=je.nss;return li.path=(st||ut.nid)+":"+Ir,li}},dl=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Gd={scheme:"urn:uuid",parse:function(je,ut){var St=je;return St.uuid=St.nss,St.nss=void 0,!ut.tolerant&&(!St.uuid||!St.uuid.match(dl))&&(St.error=St.error||"UUID is not valid."),St},serialize:function(je,ut){var St=je;return St.nss=(je.uuid||"").toLowerCase(),St}};Oe[kt.scheme]=kt,Oe[Ln.scheme]=Ln,Oe[Ni.scheme]=Ni,Oe[Yi.scheme]=Yi,Oe[_c.scheme]=_c,Oe[Ca.scheme]=Ca,Oe[Gd.scheme]=Gd,t.SCHEMES=Oe,t.pctEncChar=le,t.pctDecChars=re,t.parse=ie,t.removeDotSegments=ge,t.serialize=be,t.resolveComponents=Pe,t.resolve=pt,t.normalize=Dt,t.equal=Qt,t.escapeComponent=dt,t.unescapeComponent=mt,Object.defineProperty(t,"__esModule",{value:!0})})});var K8=b((rXr,Uat)=>{"use strict";Uat.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}});var Hat=b((iXr,Gat)=>{"use strict";Gat.exports=function(e){for(var n=0,r=e.length,i=0,o;i<r;)n++,o=e.charCodeAt(i++),o>=55296&&o<=56319&&i<r&&(o=e.charCodeAt(i),(o&64512)==56320&&i++);return n}});var QN=b((oXr,$at)=>{"use strict";$at.exports={copy:wLn,checkDataType:ZSe,checkDataTypes:RLn,coerceToTypes:BLn,toHash:t_e,getProperty:n_e,escapeQuotes:r_e,equal:K8(),ucs2length:Hat(),varOccurences:MLn,varReplace:FLn,schemaHasRules:LLn,schemaHasRulesExcept:PLn,schemaUnknownRules:QLn,toQuotedString:e_e,getPathExpr:kLn,getPath:ULn,getData:qLn,unescapeFragment:VLn,unescapeJsonPointer:o_e,escapeFragment:$Ln,escapeJsonPointer:i_e};function wLn(t,e){e=e||{};for(var n in t)e[n]=t[n];return e}function ZSe(t,e,n,r){var i=r?" !== ":" === ",o=r?" || ":" && ",s=r?"!":"",a=r?"":"!";switch(t){case"null":return e+i+"null";case"array":return s+"Array.isArray("+e+")";case"object":return"("+s+e+o+"typeof "+e+i+'"object"'+o+a+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+i+'"number"'+o+a+"("+e+" % 1)"+o+e+i+e+(n?o+s+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+i+'"'+t+'"'+(n?o+s+"isFinite("+e+")":"")+")";default:return"typeof "+e+i+'"'+t+'"'}}function RLn(t,e,n){switch(t.length){case 1:return ZSe(t[0],e,n,!0);default:var r="",i=t_e(t);i.array&&i.object&&(r=i.null?"(":"(!"+e+" || ",r+="typeof "+e+' !== "object")',delete i.null,delete i.array,delete i.object),i.number&&delete i.integer;for(var o in i)r+=(r?" && ":"")+ZSe(o,e,n,!0);return r}}var qat=t_e(["string","number","integer","boolean","null"]);function BLn(t,e){if(Array.isArray(e)){for(var n=[],r=0;r<e.length;r++){var i=e[r];(qat[i]||t==="array"&&i==="array")&&(n[n.length]=i)}if(n.length)return n}else{if(qat[e])return[e];if(t==="array"&&e==="array")return["array"]}}function t_e(t){for(var e={},n=0;n<t.length;n++)e[t[n]]=!0;return e}var NLn=/^[a-z$_][a-z$_0-9]*$/i,OLn=/'|\\/g;function n_e(t){return typeof t=="number"?"["+t+"]":NLn.test(t)?"."+t:"['"+r_e(t)+"']"}function r_e(t){return t.replace(OLn,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function MLn(t,e){e+="[^0-9]";var n=t.match(new RegExp(e,"g"));return n?n.length:0}function FLn(t,e,n){return e+="([^0-9])",n=n.replace(/\$/g,"$$$$"),t.replace(new RegExp(e,"g"),n+"$1")}function LLn(t,e){if(typeof t=="boolean")return!t;for(var n in t)if(e[n])return!0}function PLn(t,e,n){if(typeof t=="boolean")return!t&&n!="not";for(var r in t)if(r!=n&&e[r])return!0}function QLn(t,e){if(typeof t!="boolean"){for(var n in t)if(!e[n])return n}}function e_e(t){return"'"+r_e(t)+"'"}function kLn(t,e,n,r){var i=n?"'/' + "+e+(r?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):r?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'";return Vat(t,i)}function ULn(t,e,n){var r=e_e(n?"/"+i_e(e):n_e(e));return Vat(t,r)}var GLn=/^\/(?:[^~]|~0|~1)*$/,HLn=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function qLn(t,e,n){var r,i,o,s;if(t==="")return"rootData";if(t[0]=="/"){if(!GLn.test(t))throw new Error("Invalid JSON-pointer: "+t);i=t,o="rootData"}else{if(s=t.match(HLn),!s)throw new Error("Invalid JSON-pointer: "+t);if(r=+s[1],i=s[2],i=="#"){if(r>=e)throw new Error("Cannot access property/index "+r+" levels up, current level is "+e);return n[e-r]}if(r>e)throw new Error("Cannot access data "+r+" levels up, current level is "+e);if(o="data"+(e-r||""),!i)return o}for(var a=o,l=i.split("/"),u=0;u<l.length;u++){var c=l[u];c&&(o+=n_e(o_e(c)),a+=" && "+o)}return a}function Vat(t,e){return t=='""'?e:(t+" + "+e).replace(/([^\\])' \+ '/g,"$1")}function VLn(t){return o_e(decodeURIComponent(t))}function $Ln(t){return encodeURIComponent(i_e(t))}function i_e(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function o_e(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}});var s_e=b((sXr,Yat)=>{"use strict";var YLn=QN();Yat.exports=jLn;function jLn(t){YLn.copy(t,this)}});var Wat=b((aXr,jat)=>{"use strict";var fx=jat.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var r=typeof n=="function"?n:n.pre||function(){},i=n.post||function(){};ZZ(e,r,i,t,"",t)};fx.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};fx.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};fx.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};fx.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ZZ(t,e,n,r,i,o,s,a,l,u){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,i,o,s,a,l,u);for(var c in r){var d=r[c];if(Array.isArray(d)){if(c in fx.arrayKeywords)for(var h=0;h<d.length;h++)ZZ(t,e,n,d[h],i+"/"+c+"/"+h,o,i,c,r,h)}else if(c in fx.propsKeywords){if(d&&typeof d=="object")for(var m in d)ZZ(t,e,n,d[m],i+"/"+c+"/"+WLn(m),o,i,c,r,m)}else(c in fx.keywords||t.allKeys&&!(c in fx.skipKeywords))&&ZZ(t,e,n,d,i+"/"+c,o,i,c,r)}n(r,i,o,s,a,l,u)}}function WLn(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var oee=b((lXr,Xat)=>{"use strict";var EG=kat(),zat=K8(),ree=QN(),eee=s_e(),zLn=Wat();Xat.exports=hx;hx.normalizeId=px;hx.fullPath=tee;hx.url=nee;hx.ids=ePn;hx.inlineRef=a_e;hx.schema=iee;function hx(t,e,n){var r=this._refs[n];if(typeof r=="string")if(this._refs[r])r=this._refs[r];else return hx.call(this,t,e,r);if(r=r||this._schemas[n],r instanceof eee)return a_e(r.schema,this._opts.inlineRefs)?r.schema:r.validate||this._compile(r);var i=iee.call(this,e,n),o,s,a;return i&&(o=i.schema,e=i.root,a=i.baseId),o instanceof eee?s=o.validate||t.call(this,o.schema,e,void 0,a):o!==void 0&&(s=a_e(o,this._opts.inlineRefs)?o:t.call(this,o,e,void 0,a)),s}function iee(t,e){var n=EG.parse(e),r=Kat(n),i=tee(this._getId(t.schema));if(Object.keys(t.schema).length===0||r!==i){var o=px(r),s=this._refs[o];if(typeof s=="string")return JLn.call(this,t,s,n);if(s instanceof eee)s.validate||this._compile(s),t=s;else if(s=this._schemas[o],s instanceof eee){if(s.validate||this._compile(s),o==px(e))return{schema:s,root:t,baseId:i};t=s}else return;if(!t.schema)return;i=tee(this._getId(t.schema))}return Jat.call(this,n,i,t.schema,t)}function JLn(t,e,n){var r=iee.call(this,t,e);if(r){var i=r.schema,o=r.baseId;t=r.root;var s=this._getId(i);return s&&(o=nee(o,s)),Jat.call(this,n,o,i,t)}}var KLn=ree.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function Jat(t,e,n,r){if(t.fragment=t.fragment||"",t.fragment.slice(0,1)=="/"){for(var i=t.fragment.split("/"),o=1;o<i.length;o++){var s=i[o];if(s){if(s=ree.unescapeFragment(s),n=n[s],n===void 0)break;var a;if(!KLn[s]&&(a=this._getId(n),a&&(e=nee(e,a)),n.$ref)){var l=nee(e,n.$ref),u=iee.call(this,r,l);u&&(n=u.schema,r=u.root,e=u.baseId)}}}if(n!==void 0&&n!==r.schema)return{schema:n,root:r,baseId:e}}}var XLn=ree.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function a_e(t,e){if(e===!1)return!1;if(e===void 0||e===!0)return l_e(t);if(e)return u_e(t)<=e}function l_e(t){var e;if(Array.isArray(t)){for(var n=0;n<t.length;n++)if(e=t[n],typeof e=="object"&&!l_e(e))return!1}else for(var r in t)if(r=="$ref"||(e=t[r],typeof e=="object"&&!l_e(e)))return!1;return!0}function u_e(t){var e=0,n;if(Array.isArray(t)){for(var r=0;r<t.length;r++)if(n=t[r],typeof n=="object"&&(e+=u_e(n)),e==1/0)return 1/0}else for(var i in t){if(i=="$ref")return 1/0;if(XLn[i])e++;else if(n=t[i],typeof n=="object"&&(e+=u_e(n)+1),e==1/0)return 1/0}return e}function tee(t,e){e!==!1&&(t=px(t));var n=EG.parse(t);return Kat(n)}function Kat(t){return EG.serialize(t).split("#")[0]+"#"}var ZLn=/#\/?$/;function px(t){return t?t.replace(ZLn,""):""}function nee(t,e){return e=px(e),EG.resolve(t,e)}function ePn(t){var e=px(this._getId(t)),n={"":e},r={"":tee(e,!1)},i={},o=this;return zLn(t,{allKeys:!0},function(s,a,l,u,c,d,h){if(a!==""){var m=o._getId(s),E=n[u],y=r[u]+"/"+c;if(h!==void 0&&(y+="/"+(typeof h=="number"?h:ree.escapeFragment(h))),typeof m=="string"){m=E=px(E?EG.resolve(E,m):m);var C=o._refs[m];if(typeof C=="string"&&(C=o._refs[C]),C&&C.schema){if(!zat(s,C.schema))throw new Error('id "'+m+'" resolves to more than one schema')}else if(m!=px(y))if(m[0]=="#"){if(i[m]&&!zat(s,i[m]))throw new Error('id "'+m+'" resolves to more than one schema');i[m]=s}else o._refs[m]=y}n[a]=E,r[a]=y}}),i}});var see=b((uXr,elt)=>{"use strict";var c_e=oee();elt.exports={Validation:Zat(tPn),MissingRef:Zat(d_e)};function tPn(t){this.message="validation failed",this.errors=t,this.ajv=this.validation=!0}d_e.message=function(t,e){return"can't resolve reference "+e+" from id "+t};function d_e(t,e,n){this.message=n||d_e.message(t,e),this.missingRef=c_e.url(t,e),this.missingSchema=c_e.normalizeId(c_e.fullPath(this.missingRef))}function Zat(t){return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}});var f_e=b((cXr,tlt)=>{"use strict";tlt.exports=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var n=typeof e.cycles=="boolean"?e.cycles:!1,r=e.cmp&&function(o){return function(s){return function(a,l){var u={key:a,value:s[a]},c={key:l,value:s[l]};return o(u,c)}}}(e.cmp),i=[];return function o(s){if(s&&s.toJSON&&typeof s.toJSON=="function"&&(s=s.toJSON()),s!==void 0){if(typeof s=="number")return isFinite(s)?""+s:"null";if(typeof s!="object")return JSON.stringify(s);var a,l;if(Array.isArray(s)){for(l="[",a=0;a<s.length;a++)a&&(l+=","),l+=o(s[a])||"null";return l+"]"}if(s===null)return"null";if(i.indexOf(s)!==-1){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var u=i.push(s)-1,c=Object.keys(s).sort(r&&r(s));for(l="",a=0;a<c.length;a++){var d=c[a],h=o(s[d]);h&&(l&&(l+=","),l+=JSON.stringify(d)+":"+h)}return i.splice(u,1),"{"+l+"}"}}(t)}});var p_e=b((dXr,nlt)=>{"use strict";nlt.exports=function(e,n,r){var i="",o=e.schema.$async===!0,s=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),a=e.self._getId(e.schema);if(e.opts.strictKeywords){var l=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(l){var u="unknown keyword: "+l;if(e.opts.strictKeywords==="log")e.logger.warn(u);else throw new Error(u)}}if(e.isTop&&(i+=" var validate = ",o&&(e.async=!0,i+="async "),i+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",a&&(e.opts.sourceCode||e.opts.processCode)&&(i+=" "+("/*# sourceURL="+a+" */")+" ")),typeof e.schema=="boolean"||!(s||e.schema.$ref)){var n="false schema",c=e.level,d=e.dataLevel,h=e.schema[n],m=e.schemaPath+e.util.getProperty(n),E=e.errSchemaPath+"/"+n,F=!e.opts.allErrors,j,y="data"+(d||""),R="valid"+c;if(e.schema===!1){e.isTop?F=!0:i+=" var "+R+" = false; ";var C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(j||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(E)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'boolean schema is false' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),i+=" } "):i+=" {} ";var _=i;i=C.pop(),!e.compositeRule&&F?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?o?i+=" return data; ":i+=" validate.errors = null; return true; ":i+=" var "+R+" = true; ";return e.isTop&&(i+=" }; return validate; "),i}if(e.isTop){var w=e.isTop,c=e.level=0,d=e.dataLevel=0,y="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var B="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(B);else throw new Error(B)}i+=" var vErrors = null; ",i+=" var errors = 0; ",i+=" if (rootData === undefined) rootData = data; "}else{var c=e.level,d=e.dataLevel,y="data"+(d||"");if(a&&(e.baseId=e.resolve.url(e.baseId,a)),o&&!e.async)throw new Error("async schema in sync schema");i+=" var errs_"+c+" = errors;"}var R="valid"+c,F=!e.opts.allErrors,q="",J="",j,L=e.schema.type,K=Array.isArray(L);if(L&&e.opts.nullable&&e.schema.nullable===!0&&(K?L.indexOf("null")==-1&&(L=L.concat("null")):L!="null"&&(L=[L,"null"],K=!0)),K&&L.length==1&&(L=L[0],K=!1),e.schema.$ref&&s){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(s=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(i+=" "+e.RULES.all.$comment.code(e,"$comment")),L){if(e.opts.coerceTypes)var U=e.util.coerceToTypes(e.opts.coerceTypes,L);var se=e.RULES.types[L];if(U||K||se===!0||se&&!H(se)){var m=e.schemaPath+".type",E=e.errSchemaPath+"/type",m=e.schemaPath+".type",E=e.errSchemaPath+"/type",V=K?"checkDataTypes":"checkDataType";if(i+=" if ("+e.util[V](L,y,e.opts.strictNumbers,!0)+") { ",U){var O="dataType"+c,Y="coerced"+c;i+=" var "+O+" = typeof "+y+"; var "+Y+" = undefined; ",e.opts.coerceTypes=="array"&&(i+=" if ("+O+" == 'object' && Array.isArray("+y+") && "+y+".length == 1) { "+y+" = "+y+"[0]; "+O+" = typeof "+y+"; if ("+e.util.checkDataType(e.schema.type,y,e.opts.strictNumbers)+") "+Y+" = "+y+"; } "),i+=" if ("+Y+" !== undefined) ; ";var ee=U;if(ee)for(var ne,Ae=-1,Ce=ee.length-1;Ae<Ce;)ne=ee[Ae+=1],ne=="string"?i+=" else if ("+O+" == 'number' || "+O+" == 'boolean') "+Y+" = '' + "+y+"; else if ("+y+" === null) "+Y+" = ''; ":ne=="number"||ne=="integer"?(i+=" else if ("+O+" == 'boolean' || "+y+" === null || ("+O+" == 'string' && "+y+" && "+y+" == +"+y+" ",ne=="integer"&&(i+=" && !("+y+" % 1)"),i+=")) "+Y+" = +"+y+"; "):ne=="boolean"?i+=" else if ("+y+" === 'false' || "+y+" === 0 || "+y+" === null) "+Y+" = false; else if ("+y+" === 'true' || "+y+" === 1) "+Y+" = true; ":ne=="null"?i+=" else if ("+y+" === '' || "+y+" === 0 || "+y+" === false) "+Y+" = null; ":e.opts.coerceTypes=="array"&&ne=="array"&&(i+=" else if ("+O+" == 'string' || "+O+" == 'number' || "+O+" == 'boolean' || "+y+" == null) "+Y+" = ["+y+"]; ");i+=" else { ";var C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(j||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(E)+" , params: { type: '",K?i+=""+L.join(","):i+=""+L,i+="' } ",e.opts.messages!==!1&&(i+=" , message: 'should be ",K?i+=""+L.join(","):i+=""+L,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+m+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),i+=" } "):i+=" {} ";var _=i;i=C.pop(),!e.compositeRule&&F?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } if ("+Y+" !== undefined) { ";var De=d?"data"+(d-1||""):"parentData",Ue=d?e.dataPathArr[d]:"parentDataProperty";i+=" "+y+" = "+Y+"; ",d||(i+="if ("+De+" !== undefined)"),i+=" "+De+"["+Ue+"] = "+Y+"; } "}else{var C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(j||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(E)+" , params: { type: '",K?i+=""+L.join(","):i+=""+L,i+="' } ",e.opts.messages!==!1&&(i+=" , message: 'should be ",K?i+=""+L.join(","):i+=""+L,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+m+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),i+=" } "):i+=" {} ";var _=i;i=C.pop(),!e.compositeRule&&F?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}i+=" } "}}if(e.schema.$ref&&!s)i+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",F&&(i+=" } if (errors === ",w?i+="0":i+="errs_"+c,i+=") { ",J+="}");else{var qe=e.RULES;if(qe){for(var se,Ie=-1,xe=qe.length-1;Ie<xe;)if(se=qe[Ie+=1],H(se)){if(se.type&&(i+=" if ("+e.util.checkDataType(se.type,y,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(se.type=="object"&&e.schema.properties){var h=e.schema.properties,Oe=Object.keys(h),le=Oe;if(le)for(var re,ye=-1,X=le.length-1;ye<X;){re=le[ye+=1];var he=h[re];if(he.default!==void 0){var ae=y+e.util.getProperty(re);if(e.compositeRule){if(e.opts.strictDefaults){var B="default is ignored for: "+ae;if(e.opts.strictDefaults==="log")e.logger.warn(B);else throw new Error(B)}}else i+=" if ("+ae+" === undefined ",e.opts.useDefaults=="empty"&&(i+=" || "+ae+" === null || "+ae+" === '' "),i+=" ) "+ae+" = ",e.opts.useDefaults=="shared"?i+=" "+e.useDefault(he.default)+" ":i+=" "+JSON.stringify(he.default)+" ",i+="; "}}}else if(se.type=="array"&&Array.isArray(e.schema.items)){var me=e.schema.items;if(me){for(var he,Ae=-1,Se=me.length-1;Ae<Se;)if(he=me[Ae+=1],he.default!==void 0){var ae=y+"["+Ae+"]";if(e.compositeRule){if(e.opts.strictDefaults){var B="default is ignored for: "+ae;if(e.opts.strictDefaults==="log")e.logger.warn(B);else throw new Error(B)}}else i+=" if ("+ae+" === undefined ",e.opts.useDefaults=="empty"&&(i+=" || "+ae+" === null || "+ae+" === '' "),i+=" ) "+ae+" = ",e.opts.useDefaults=="shared"?i+=" "+e.useDefault(he.default)+" ":i+=" "+JSON.stringify(he.default)+" ",i+="; "}}}}var ie=se.rules;if(ie){for(var k,W=-1,pe=ie.length-1;W<pe;)if(k=ie[W+=1],ge(k)){var te=k.code(e,k.keyword,se.type);te&&(i+=" "+te+" ",F&&(q+="}"))}}if(F&&(i+=" "+q+" ",q=""),se.type&&(i+=" } ",L&&L===se.type&&!U)){i+=" else { ";var m=e.schemaPath+".type",E=e.errSchemaPath+"/type",C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(j||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(E)+" , params: { type: '",K?i+=""+L.join(","):i+=""+L,i+="' } ",e.opts.messages!==!1&&(i+=" , message: 'should be ",K?i+=""+L.join(","):i+=""+L,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+m+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),i+=" } "):i+=" {} ";var _=i;i=C.pop(),!e.compositeRule&&F?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } "}F&&(i+=" if (errors === ",w?i+="0":i+="errs_"+c,i+=") { ",J+="}")}}}F&&(i+=" "+J+" "),w?(o?(i+=" if (errors === 0) return data; ",i+=" else throw new ValidationError(vErrors); "):(i+=" validate.errors = vErrors; ",i+=" return errors === 0; "),i+=" }; return validate;"):i+=" var "+R+" = errors === errs_"+c+";";function H(Pe){for(var pt=Pe.rules,Dt=0;Dt<pt.length;Dt++)if(ge(pt[Dt]))return!0}function ge(Pe){return e.schema[Pe.keyword]!==void 0||Pe.implements&&be(Pe)}function be(Pe){for(var pt=Pe.implements,Dt=0;Dt<pt.length;Dt++)if(e.schema[pt[Dt]]!==void 0)return!0}return i}});var alt=b((fXr,slt)=>{"use strict";var aee=oee(),uee=QN(),ilt=see(),nPn=f_e(),rlt=p_e(),rPn=uee.ucs2length,iPn=K8(),oPn=ilt.Validation;slt.exports=h_e;function h_e(t,e,n,r){var i=this,o=this._opts,s=[void 0],a={},l=[],u={},c=[],d={},h=[];e=e||{schema:t,refVal:s,refs:a};var m=sPn.call(this,t,e,r),E=this._compilations[m.index];if(m.compiling)return E.callValidate=B;var y=this._formats,C=this.RULES;try{var _=R(t,e,n,r);E.validate=_;var w=E.callValidate;return w&&(w.schema=_.schema,w.errors=null,w.refs=_.refs,w.refVal=_.refVal,w.root=_.root,w.$async=_.$async,o.sourceCode&&(w.source=_.source)),_}finally{aPn.call(this,t,e,r)}function B(){var V=E.validate,O=V.apply(this,arguments);return B.errors=V.errors,O}function R(V,O,Y,ee){var ne=!O||O&&O.schema==V;if(O.schema!=e.schema)return h_e.call(i,V,O,Y,ee);var Ae=V.$async===!0,Ce=rlt({isTop:!0,schema:V,isRoot:ne,baseId:ee,root:O,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:ilt.MissingRef,RULES:C,validate:rlt,util:uee,resolve:aee,resolveRef:F,usePattern:K,useDefault:U,useCustomRule:se,opts:o,formats:y,logger:i.logger,self:i});Ce=lee(s,cPn)+lee(l,lPn)+lee(c,uPn)+lee(h,dPn)+Ce,o.processCode&&(Ce=o.processCode(Ce,V));var De;try{var Ue=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",Ce);De=Ue(i,C,y,e,s,c,h,iPn,rPn,oPn),s[0]=De}catch(qe){throw i.logger.error("Error compiling schema, function code:",Ce),qe}return De.schema=V,De.errors=null,De.refs=a,De.refVal=s,De.root=ne?De:O,Ae&&(De.$async=!0),o.sourceCode===!0&&(De.source={code:Ce,patterns:l,defaults:c}),De}function F(V,O,Y){O=aee.url(V,O);var ee=a[O],ne,Ae;if(ee!==void 0)return ne=s[ee],Ae="refVal["+ee+"]",L(ne,Ae);if(!Y&&e.refs){var Ce=e.refs[O];if(Ce!==void 0)return ne=e.refVal[Ce],Ae=q(O,ne),L(ne,Ae)}Ae=q(O);var De=aee.call(i,R,e,O);if(De===void 0){var Ue=n&&n[O];Ue&&(De=aee.inlineRef(Ue,o.inlineRefs)?Ue:h_e.call(i,Ue,e,n,V))}if(De===void 0)J(O);else return j(O,De),L(De,Ae)}function q(V,O){var Y=s.length;return s[Y]=O,a[V]=Y,"refVal"+Y}function J(V){delete a[V]}function j(V,O){var Y=a[V];s[Y]=O}function L(V,O){return typeof V=="object"||typeof V=="boolean"?{code:O,schema:V,inline:!0}:{code:O,$async:V&&!!V.$async}}function K(V){var O=u[V];return O===void 0&&(O=u[V]=l.length,l[O]=V),"pattern"+O}function U(V){switch(typeof V){case"boolean":case"number":return""+V;case"string":return uee.toQuotedString(V);case"object":if(V===null)return"null";var O=nPn(V),Y=d[O];return Y===void 0&&(Y=d[O]=c.length,c[Y]=V),"default"+Y}}function se(V,O,Y,ee){if(i._opts.validateSchema!==!1){var ne=V.definition.dependencies;if(ne&&!ne.every(function(le){return Object.prototype.hasOwnProperty.call(Y,le)}))throw new Error("parent schema must have all required keywords: "+ne.join(","));var Ae=V.definition.validateSchema;if(Ae){var Ce=Ae(O);if(!Ce){var De="keyword schema is invalid: "+i.errorsText(Ae.errors);if(i._opts.validateSchema=="log")i.logger.error(De);else throw new Error(De)}}}var Ue=V.definition.compile,qe=V.definition.inline,Ie=V.definition.macro,xe;if(Ue)xe=Ue.call(i,O,Y,ee);else if(Ie)xe=Ie.call(i,O,Y,ee),o.validateSchema!==!1&&i.validateSchema(xe,!0);else if(qe)xe=qe.call(i,ee,V.keyword,O,Y);else if(xe=V.definition.validate,!xe)return;if(xe===void 0)throw new Error('custom keyword "'+V.keyword+'"failed to compile');var Oe=h.length;return h[Oe]=xe,{code:"customRule"+Oe,validate:xe}}}function sPn(t,e,n){var r=olt.call(this,t,e,n);return r>=0?{index:r,compiling:!0}:(r=this._compilations.length,this._compilations[r]={schema:t,root:e,baseId:n},{index:r,compiling:!1})}function aPn(t,e,n){var r=olt.call(this,t,e,n);r>=0&&this._compilations.splice(r,1)}function olt(t,e,n){for(var r=0;r<this._compilations.length;r++){var i=this._compilations[r];if(i.schema==t&&i.root==e&&i.baseId==n)return r}return-1}function lPn(t,e){return"var pattern"+t+" = new RegExp("+uee.toQuotedString(e[t])+");"}function uPn(t){return"var default"+t+" = defaults["+t+"];"}function cPn(t,e){return e[t]===void 0?"":"var refVal"+t+" = refVal["+t+"];"}function dPn(t){return"var customRule"+t+" = customRules["+t+"];"}function lee(t,e){if(!t.length)return"";for(var n="",r=0;r<t.length;r++)n+=e(r,t);return n}});var ult=b((pXr,llt)=>{"use strict";var cee=llt.exports=function(){this._cache={}};cee.prototype.put=function(e,n){this._cache[e]=n};cee.prototype.get=function(e){return this._cache[e]};cee.prototype.del=function(e){delete this._cache[e]};cee.prototype.clear=function(){this._cache={}}});var vlt=b((hXr,Clt)=>{"use strict";var fPn=QN(),pPn=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,hPn=[0,31,28,31,30,31,30,31,31,30,31,30,31],mPn=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,clt=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,APn=/^(?:[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,gPn=/^(?:[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,dlt=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,flt=/^(?:(?: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,plt=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,hlt=/^(?:\/(?:[^~/]|~0|~1)*)*$/,mlt=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Alt=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;Clt.exports=dee;function dee(t){return t=t=="full"?"full":"fast",fPn.copy(dee[t])}dee.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":dlt,url:flt,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:clt,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:ylt,uuid:plt,"json-pointer":hlt,"json-pointer-uri-fragment":mlt,"relative-json-pointer":Alt};dee.full={date:glt,time:Elt,"date-time":CPn,uri:DPn,"uri-reference":gPn,"uri-template":dlt,url:flt,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:clt,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:ylt,uuid:plt,"json-pointer":hlt,"json-pointer-uri-fragment":mlt,"relative-json-pointer":Alt};function EPn(t){return t%4===0&&(t%100!==0||t%400===0)}function glt(t){var e=t.match(pPn);if(!e)return!1;var n=+e[1],r=+e[2],i=+e[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&EPn(n)?29:hPn[r])}function Elt(t,e){var n=t.match(mPn);if(!n)return!1;var r=n[1],i=n[2],o=n[3],s=n[5];return(r<=23&&i<=59&&o<=59||r==23&&i==59&&o==60)&&(!e||s)}var yPn=/t|\s/i;function CPn(t){var e=t.split(yPn);return e.length==2&&glt(e[0])&&Elt(e[1],!0)}var vPn=/\/|:/;function DPn(t){return vPn.test(t)&&APn.test(t)}var SPn=/[^\\]\\Z/;function ylt(t){if(SPn.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Slt=b((mXr,Dlt)=>{"use strict";Dlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.errSchemaPath+"/"+n,u=!e.opts.allErrors,c="data"+(s||""),d="valid"+o,h,m;if(a=="#"||a=="#/")e.isRoot?(h=e.async,m="validate"):(h=e.root.schema.$async===!0,m="root.refVal[0]");else{var E=e.resolveRef(e.baseId,a,e.isRoot);if(E===void 0){var y=e.MissingRefError.message(e.baseId,a);if(e.opts.missingRefs=="fail"){e.logger.error(y);var C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { ref: '"+e.util.escapeQuotes(a)+"' } ",e.opts.messages!==!1&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(a)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var _=i;i=C.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(y),u&&(i+=" if (true) { ");else throw new e.MissingRefError(e.baseId,a,y)}else if(E.inline){var w=e.util.copy(e);w.level++;var B="valid"+w.level;w.schema=E.schema,w.schemaPath="",w.errSchemaPath=a;var R=e.validate(w).replace(/validate\.schema/g,E.code);i+=" "+R+" ",u&&(i+=" if ("+B+") { ")}else h=E.$async===!0||e.async&&E.$async!==!1,m=E.code}if(m){var C=C||[];C.push(i),i="",e.opts.passContext?i+=" "+m+".call(this, ":i+=" "+m+"( ",i+=" "+c+", (dataPath || '')",e.errorPath!='""'&&(i+=" + "+e.errorPath);var F=s?"data"+(s-1||""):"parentData",q=s?e.dataPathArr[s]:"parentDataProperty";i+=" , "+F+" , "+q+", rootData) ";var J=i;if(i=C.pop(),h){if(!e.async)throw new Error("async schema referenced by sync schema");u&&(i+=" var "+d+"; "),i+=" try { await "+J+"; ",u&&(i+=" "+d+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",u&&(i+=" "+d+" = false; "),i+=" } ",u&&(i+=" if ("+d+") { ")}else i+=" if (!"+J+") { if (vErrors === null) vErrors = "+m+".errors; else vErrors = vErrors.concat("+m+".errors); errors = vErrors.length; } ",u&&(i+=" else { ")}return i}});var Ilt=b((AXr,_lt)=>{"use strict";_lt.exports=function(e,n,r){var i=" ",o=e.schema[n],s=e.schemaPath+e.util.getProperty(n),a=e.errSchemaPath+"/"+n,l=!e.opts.allErrors,u=e.util.copy(e),c="";u.level++;var d="valid"+u.level,h=u.baseId,m=!0,E=o;if(E)for(var y,C=-1,_=E.length-1;C<_;)y=E[C+=1],(e.opts.strictKeywords?typeof y=="object"&&Object.keys(y).length>0||y===!1:e.util.schemaHasRules(y,e.RULES.all))&&(m=!1,u.schema=y,u.schemaPath=s+"["+C+"]",u.errSchemaPath=a+"/"+C,i+=" "+e.validate(u)+" ",u.baseId=h,l&&(i+=" if ("+d+") { ",c+="}"));return l&&(m?i+=" if (true) { ":i+=" "+c.slice(0,-1)+" "),i}});var blt=b((gXr,Tlt)=>{"use strict";Tlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m="errs__"+o,E=e.util.copy(e),y="";E.level++;var C="valid"+E.level,_=a.every(function(j){return e.opts.strictKeywords?typeof j=="object"&&Object.keys(j).length>0||j===!1:e.util.schemaHasRules(j,e.RULES.all)});if(_){var w=E.baseId;i+=" var "+m+" = errors; var "+h+" = false; ";var B=e.compositeRule;e.compositeRule=E.compositeRule=!0;var R=a;if(R)for(var F,q=-1,J=R.length-1;q<J;)F=R[q+=1],E.schema=F,E.schemaPath=l+"["+q+"]",E.errSchemaPath=u+"/"+q,i+=" "+e.validate(E)+" ",E.baseId=w,i+=" "+h+" = "+h+" || "+C+"; if (!"+h+") { ",y+="}";e.compositeRule=E.compositeRule=B,i+=" "+y+" if (!"+h+") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } else { errors = "+m+"; if (vErrors !== null) { if ("+m+") vErrors.length = "+m+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else c&&(i+=" if (true) { ");return i}});var wlt=b((EXr,xlt)=>{"use strict";xlt.exports=function(e,n,r){var i=" ",o=e.schema[n],s=e.errSchemaPath+"/"+n,a=!e.opts.allErrors,l=e.util.toQuotedString(o);return e.opts.$comment===!0?i+=" console.log("+l+");":typeof e.opts.$comment=="function"&&(i+=" self._opts.$comment("+l+", "+e.util.toQuotedString(s)+", validate.root.schema);"),i}});var Blt=b((yXr,Rlt)=>{"use strict";Rlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m=e.opts.$data&&a&&a.$data,E;m?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",E="schema"+o):E=a,m||(i+=" var schema"+o+" = validate.schema"+l+";"),i+="var "+h+" = equal("+d+", schema"+o+"); if (!"+h+") { ";var y=y||[];y.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValue: schema"+o+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be equal to constant' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var C=i;return i=y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+C+"]); ":i+=" validate.errors = ["+C+"]; return false; ":i+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",c&&(i+=" else { "),i}});var Olt=b((CXr,Nlt)=>{"use strict";Nlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m="errs__"+o,E=e.util.copy(e),y="";E.level++;var C="valid"+E.level,_="i"+o,w=E.dataLevel=e.dataLevel+1,B="data"+w,R=e.baseId,F=e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all);if(i+="var "+m+" = errors;var "+h+";",F){var q=e.compositeRule;e.compositeRule=E.compositeRule=!0,E.schema=a,E.schemaPath=l,E.errSchemaPath=u,i+=" var "+C+" = false; for (var "+_+" = 0; "+_+" < "+d+".length; "+_+"++) { ",E.errorPath=e.util.getPathExpr(e.errorPath,_,e.opts.jsonPointers,!0);var J=d+"["+_+"]";E.dataPathArr[w]=_;var j=e.validate(E);E.baseId=R,e.util.varOccurences(j,B)<2?i+=" "+e.util.varReplace(j,B,J)+" ":i+=" var "+B+" = "+J+"; "+j+" ",i+=" if ("+C+") break; } ",e.compositeRule=E.compositeRule=q,i+=" "+y+" if (!"+C+") {"}else i+=" if ("+d+".length == 0) {";var L=L||[];L.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var K=i;return i=L.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+K+"]); ":i+=" validate.errors = ["+K+"]; return false; ":i+=" var err = "+K+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",F&&(i+=" errors = "+m+"; if (vErrors !== null) { if ("+m+") vErrors.length = "+m+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i}});var Flt=b((vXr,Mlt)=>{"use strict";Mlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="errs__"+o,m=e.util.copy(e),E="";m.level++;var y="valid"+m.level,C={},_={},w=e.opts.ownProperties;for(q in a)if(q!="__proto__"){var B=a[q],R=Array.isArray(B)?_:C;R[q]=B}i+="var "+h+" = errors;";var F=e.errorPath;i+="var missing"+o+";";for(var q in _)if(R=_[q],R.length){if(i+=" if ( "+d+e.util.getProperty(q)+" !== undefined ",w&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(q)+"') "),c){i+=" && ( ";var J=R;if(J)for(var j,L=-1,K=J.length-1;L<K;){j=J[L+=1],L&&(i+=" || ");var U=e.util.getProperty(j),se=d+U;i+=" ( ( "+se+" === undefined ",w&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(j)+"') "),i+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?j:U)+") ) "}i+=")) { ";var V="missing"+o,O="' + "+V+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(F,V,!0):F+" + "+V);var Y=Y||[];Y.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(q)+"', missingProperty: '"+O+"', depsCount: "+R.length+", deps: '"+e.util.escapeQuotes(R.length==1?R[0]:R.join(", "))+"' } ",e.opts.messages!==!1&&(i+=" , message: 'should have ",R.length==1?i+="property "+e.util.escapeQuotes(R[0]):i+="properties "+e.util.escapeQuotes(R.join(", ")),i+=" when property "+e.util.escapeQuotes(q)+" is present' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var ee=i;i=Y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+ee+"]); ":i+=" validate.errors = ["+ee+"]; return false; ":i+=" var err = "+ee+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{i+=" ) { ";var ne=R;if(ne)for(var j,Ae=-1,Ce=ne.length-1;Ae<Ce;){j=ne[Ae+=1];var U=e.util.getProperty(j),O=e.util.escapeQuotes(j),se=d+U;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(F,j,e.opts.jsonPointers)),i+=" if ( "+se+" === undefined ",w&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(j)+"') "),i+=") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(q)+"', missingProperty: '"+O+"', depsCount: "+R.length+", deps: '"+e.util.escapeQuotes(R.length==1?R[0]:R.join(", "))+"' } ",e.opts.messages!==!1&&(i+=" , message: 'should have ",R.length==1?i+="property "+e.util.escapeQuotes(R[0]):i+="properties "+e.util.escapeQuotes(R.join(", ")),i+=" when property "+e.util.escapeQuotes(q)+" is present' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}i+=" } ",c&&(E+="}",i+=" else { ")}e.errorPath=F;var De=m.baseId;for(var q in C){var B=C[q];(e.opts.strictKeywords?typeof B=="object"&&Object.keys(B).length>0||B===!1:e.util.schemaHasRules(B,e.RULES.all))&&(i+=" "+y+" = true; if ( "+d+e.util.getProperty(q)+" !== undefined ",w&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(q)+"') "),i+=") { ",m.schema=B,m.schemaPath=l+e.util.getProperty(q),m.errSchemaPath=u+"/"+e.util.escapeFragment(q),i+=" "+e.validate(m)+" ",m.baseId=De,i+=" } ",c&&(i+=" if ("+y+") { ",E+="}"))}return c&&(i+=" "+E+" if ("+h+" == errors) {"),i}});var Plt=b((DXr,Llt)=>{"use strict";Llt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m=e.opts.$data&&a&&a.$data,E;m?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",E="schema"+o):E=a;var y="i"+o,C="schema"+o;m||(i+=" var "+C+" = validate.schema"+l+";"),i+="var "+h+";",m&&(i+=" if (schema"+o+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+o+")) "+h+" = false; else {"),i+=""+h+" = false;for (var "+y+"=0; "+y+"<"+C+".length; "+y+"++) if (equal("+d+", "+C+"["+y+"])) { "+h+" = true; break; }",m&&(i+=" } "),i+=" if (!"+h+") { ";var _=_||[];_.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+o+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var w=i;return i=_.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+w+"]); ":i+=" validate.errors = ["+w+"]; return false; ":i+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",c&&(i+=" else { "),i}});var klt=b((SXr,Qlt)=>{"use strict";Qlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||"");if(e.opts.format===!1)return c&&(i+=" if (true) { "),i;var h=e.opts.$data&&a&&a.$data,m;h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a;var E=e.opts.unknownFormats,y=Array.isArray(E);if(h){var C="format"+o,_="isObject"+o,w="formatType"+o;i+=" var "+C+" = formats["+m+"]; var "+_+" = typeof "+C+" == 'object' && !("+C+" instanceof RegExp) && "+C+".validate; var "+w+" = "+_+" && "+C+".type || 'string'; if ("+_+") { ",e.async&&(i+=" var async"+o+" = "+C+".async; "),i+=" "+C+" = "+C+".validate; } if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'string') || "),i+=" (",E!="ignore"&&(i+=" ("+m+" && !"+C+" ",y&&(i+=" && self._opts.unknownFormats.indexOf("+m+") == -1 "),i+=") || "),i+=" ("+C+" && "+w+" == '"+r+"' && !(typeof "+C+" == 'function' ? ",e.async?i+=" (async"+o+" ? await "+C+"("+d+") : "+C+"("+d+")) ":i+=" "+C+"("+d+") ",i+=" : "+C+".test("+d+"))))) {"}else{var C=e.formats[a];if(!C){if(E=="ignore")return e.logger.warn('unknown format "'+a+'" ignored in schema at path "'+e.errSchemaPath+'"'),c&&(i+=" if (true) { "),i;if(y&&E.indexOf(a)>=0)return c&&(i+=" if (true) { "),i;throw new Error('unknown format "'+a+'" is used in schema at path "'+e.errSchemaPath+'"')}var _=typeof C=="object"&&!(C instanceof RegExp)&&C.validate,w=_&&C.type||"string";if(_){var B=C.async===!0;C=C.validate}if(w!=r)return c&&(i+=" if (true) { "),i;if(B){if(!e.async)throw new Error("async format in sync schema");var R="formats"+e.util.getProperty(a)+".validate";i+=" if (!(await "+R+"("+d+"))) { "}else{i+=" if (! ";var R="formats"+e.util.getProperty(a);_&&(R+=".validate"),typeof C=="function"?i+=" "+R+"("+d+") ":i+=" "+R+".test("+d+") ",i+=") { "}}var F=F||[];F.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format: ",h?i+=""+m:i+=""+e.util.toQuotedString(a),i+=" } ",e.opts.messages!==!1&&(i+=` , message: 'should match format "`,h?i+="' + "+m+" + '":i+=""+e.util.escapeQuotes(a),i+=`"' `),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+e.util.toQuotedString(a),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var q=i;return i=F.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+q+"]); ":i+=" validate.errors = ["+q+"]; return false; ":i+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c&&(i+=" else { "),i}});var Glt=b((_Xr,Ult)=>{"use strict";Ult.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m="errs__"+o,E=e.util.copy(e);E.level++;var y="valid"+E.level,C=e.schema.then,_=e.schema.else,w=C!==void 0&&(e.opts.strictKeywords?typeof C=="object"&&Object.keys(C).length>0||C===!1:e.util.schemaHasRules(C,e.RULES.all)),B=_!==void 0&&(e.opts.strictKeywords?typeof _=="object"&&Object.keys(_).length>0||_===!1:e.util.schemaHasRules(_,e.RULES.all)),R=E.baseId;if(w||B){var F;E.createErrors=!1,E.schema=a,E.schemaPath=l,E.errSchemaPath=u,i+=" var "+m+" = errors; var "+h+" = true; ";var q=e.compositeRule;e.compositeRule=E.compositeRule=!0,i+=" "+e.validate(E)+" ",E.baseId=R,E.createErrors=!0,i+=" errors = "+m+"; if (vErrors !== null) { if ("+m+") vErrors.length = "+m+"; else vErrors = null; } ",e.compositeRule=E.compositeRule=q,w?(i+=" if ("+y+") { ",E.schema=e.schema.then,E.schemaPath=e.schemaPath+".then",E.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(E)+" ",E.baseId=R,i+=" "+h+" = "+y+"; ",w&&B?(F="ifClause"+o,i+=" var "+F+" = 'then'; "):F="'then'",i+=" } ",B&&(i+=" else { ")):i+=" if (!"+y+") { ",B&&(E.schema=e.schema.else,E.schemaPath=e.schemaPath+".else",E.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(E)+" ",E.baseId=R,i+=" "+h+" = "+y+"; ",w&&B?(F="ifClause"+o,i+=" var "+F+" = 'else'; "):F="'else'",i+=" } "),i+=" if (!"+h+") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+F+" } ",e.opts.messages!==!1&&(i+=` , message: 'should match "' + `+F+` + '" schema' `),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",c&&(i+=" else { ")}else c&&(i+=" if (true) { ");return i}});var qlt=b((IXr,Hlt)=>{"use strict";Hlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m="errs__"+o,E=e.util.copy(e),y="";E.level++;var C="valid"+E.level,_="i"+o,w=E.dataLevel=e.dataLevel+1,B="data"+w,R=e.baseId;if(i+="var "+m+" = errors;var "+h+";",Array.isArray(a)){var F=e.schema.additionalItems;if(F===!1){i+=" "+h+" = "+d+".length <= "+a.length+"; ";var q=u;u=e.errSchemaPath+"/additionalItems",i+=" if (!"+h+") { ";var J=J||[];J.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a.length+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have more than "+a.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var j=i;i=J.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+j+"]); ":i+=" validate.errors = ["+j+"]; return false; ":i+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",u=q,c&&(y+="}",i+=" else { ")}var L=a;if(L){for(var K,U=-1,se=L.length-1;U<se;)if(K=L[U+=1],e.opts.strictKeywords?typeof K=="object"&&Object.keys(K).length>0||K===!1:e.util.schemaHasRules(K,e.RULES.all)){i+=" "+C+" = true; if ("+d+".length > "+U+") { ";var V=d+"["+U+"]";E.schema=K,E.schemaPath=l+"["+U+"]",E.errSchemaPath=u+"/"+U,E.errorPath=e.util.getPathExpr(e.errorPath,U,e.opts.jsonPointers,!0),E.dataPathArr[w]=U;var O=e.validate(E);E.baseId=R,e.util.varOccurences(O,B)<2?i+=" "+e.util.varReplace(O,B,V)+" ":i+=" var "+B+" = "+V+"; "+O+" ",i+=" } ",c&&(i+=" if ("+C+") { ",y+="}")}}if(typeof F=="object"&&(e.opts.strictKeywords?typeof F=="object"&&Object.keys(F).length>0||F===!1:e.util.schemaHasRules(F,e.RULES.all))){E.schema=F,E.schemaPath=e.schemaPath+".additionalItems",E.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+C+" = true; if ("+d+".length > "+a.length+") { for (var "+_+" = "+a.length+"; "+_+" < "+d+".length; "+_+"++) { ",E.errorPath=e.util.getPathExpr(e.errorPath,_,e.opts.jsonPointers,!0);var V=d+"["+_+"]";E.dataPathArr[w]=_;var O=e.validate(E);E.baseId=R,e.util.varOccurences(O,B)<2?i+=" "+e.util.varReplace(O,B,V)+" ":i+=" var "+B+" = "+V+"; "+O+" ",c&&(i+=" if (!"+C+") break; "),i+=" } } ",c&&(i+=" if ("+C+") { ",y+="}")}}else if(e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all)){E.schema=a,E.schemaPath=l,E.errSchemaPath=u,i+=" for (var "+_+" = 0; "+_+" < "+d+".length; "+_+"++) { ",E.errorPath=e.util.getPathExpr(e.errorPath,_,e.opts.jsonPointers,!0);var V=d+"["+_+"]";E.dataPathArr[w]=_;var O=e.validate(E);E.baseId=R,e.util.varOccurences(O,B)<2?i+=" "+e.util.varReplace(O,B,V)+" ":i+=" var "+B+" = "+V+"; "+O+" ",c&&(i+=" if (!"+C+") break; "),i+=" }"}return c&&(i+=" "+y+" if ("+m+" == errors) {"),i}});var m_e=b((TXr,Vlt)=>{"use strict";Vlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,R,d="data"+(s||""),h=e.opts.$data&&a&&a.$data,m;h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a;var E=n=="maximum",y=E?"exclusiveMaximum":"exclusiveMinimum",C=e.schema[y],_=e.opts.$data&&C&&C.$data,w=E?"<":">",B=E?">":"<",R=void 0;if(!(h||typeof a=="number"||a===void 0))throw new Error(n+" must be number");if(!(_||C===void 0||typeof C=="number"||typeof C=="boolean"))throw new Error(y+" must be number or boolean");if(_){var F=e.util.getData(C.$data,s,e.dataPathArr),q="exclusive"+o,J="exclType"+o,j="exclIsNumber"+o,L="op"+o,K="' + "+L+" + '";i+=" var schemaExcl"+o+" = "+F+"; ",F="schemaExcl"+o,i+=" var "+q+"; var "+J+" = typeof "+F+"; if ("+J+" != 'boolean' && "+J+" != 'undefined' && "+J+" != 'number') { ";var R=y,U=U||[];U.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(R||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: '"+y+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var se=i;i=U.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+se+"]); ":i+=" validate.errors = ["+se+"]; return false; ":i+=" var err = "+se+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'number') || "),i+=" "+J+" == 'number' ? ( ("+q+" = "+m+" === undefined || "+F+" "+w+"= "+m+") ? "+d+" "+B+"= "+F+" : "+d+" "+B+" "+m+" ) : ( ("+q+" = "+F+" === true) ? "+d+" "+B+"= "+m+" : "+d+" "+B+" "+m+" ) || "+d+" !== "+d+") { var op"+o+" = "+q+" ? '"+w+"' : '"+w+"='; ",a===void 0&&(R=y,u=e.errSchemaPath+"/"+y,m=F,h=_)}else{var j=typeof C=="number",K=w;if(j&&h){var L="'"+K+"'";i+=" if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'number') || "),i+=" ( "+m+" === undefined || "+C+" "+w+"= "+m+" ? "+d+" "+B+"= "+C+" : "+d+" "+B+" "+m+" ) || "+d+" !== "+d+") { "}else{j&&a===void 0?(q=!0,R=y,u=e.errSchemaPath+"/"+y,m=C,B+="="):(j&&(m=Math[E?"min":"max"](C,a)),C===(j?m:!0)?(q=!0,R=y,u=e.errSchemaPath+"/"+y,B+="="):(q=!1,K+="="));var L="'"+K+"'";i+=" if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'number') || "),i+=" "+d+" "+B+" "+m+" || "+d+" !== "+d+") { "}}R=R||n;var U=U||[];U.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(R||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+L+", limit: "+m+", exclusive: "+q+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be "+K+" ",h?i+="' + "+m:i+=""+m+"'"),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var se=i;return i=U.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+se+"]); ":i+=" validate.errors = ["+se+"]; return false; ":i+=" var err = "+se+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c&&(i+=" else { "),i}});var A_e=b((bXr,$lt)=>{"use strict";$lt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,y,d="data"+(s||""),h=e.opts.$data&&a&&a.$data,m;if(h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a,!(h||typeof a=="number"))throw new Error(n+" must be number");var E=n=="maxItems"?">":"<";i+="if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'number') || "),i+=" "+d+".length "+E+" "+m+") { ";var y=n,C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(y||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+m+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have ",n=="maxItems"?i+="more":i+="fewer",i+=" than ",h?i+="' + "+m+" + '":i+=""+a,i+=" items' "),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var _=i;return i=C.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}});var g_e=b((xXr,Ylt)=>{"use strict";Ylt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,y,d="data"+(s||""),h=e.opts.$data&&a&&a.$data,m;if(h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a,!(h||typeof a=="number"))throw new Error(n+" must be number");var E=n=="maxLength"?">":"<";i+="if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'number') || "),e.opts.unicode===!1?i+=" "+d+".length ":i+=" ucs2length("+d+") ",i+=" "+E+" "+m+") { ";var y=n,C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(y||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+m+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be ",n=="maxLength"?i+="longer":i+="shorter",i+=" than ",h?i+="' + "+m+" + '":i+=""+a,i+=" characters' "),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var _=i;return i=C.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}});var E_e=b((wXr,jlt)=>{"use strict";jlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,y,d="data"+(s||""),h=e.opts.$data&&a&&a.$data,m;if(h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a,!(h||typeof a=="number"))throw new Error(n+" must be number");var E=n=="maxProperties"?">":"<";i+="if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'number') || "),i+=" Object.keys("+d+").length "+E+" "+m+") { ";var y=n,C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(y||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+m+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have ",n=="maxProperties"?i+="more":i+="fewer",i+=" than ",h?i+="' + "+m+" + '":i+=""+a,i+=" properties' "),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var _=i;return i=C.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}});var zlt=b((RXr,Wlt)=>{"use strict";Wlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h=e.opts.$data&&a&&a.$data,m;if(h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a,!(h||typeof a=="number"))throw new Error(n+" must be number");i+="var division"+o+";if (",h&&(i+=" "+m+" !== undefined && ( typeof "+m+" != 'number' || "),i+=" (division"+o+" = "+d+" / "+m+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+o+" !== parseInt(division"+o+") ",i+=" ) ",h&&(i+=" ) "),i+=" ) { ";var E=E||[];E.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+m+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be multiple of ",h?i+="' + "+m:i+=""+m+"'"),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var y=i;return i=E.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}});var Klt=b((BXr,Jlt)=>{"use strict";Jlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="errs__"+o,m=e.util.copy(e);m.level++;var E="valid"+m.level;if(e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all)){m.schema=a,m.schemaPath=l,m.errSchemaPath=u,i+=" var "+h+" = errors; ";var y=e.compositeRule;e.compositeRule=m.compositeRule=!0,m.createErrors=!1;var C;m.opts.allErrors&&(C=m.opts.allErrors,m.opts.allErrors=!1),i+=" "+e.validate(m)+" ",m.createErrors=!0,C&&(m.opts.allErrors=C),e.compositeRule=m.compositeRule=y,i+=" if ("+E+") { ";var _=_||[];_.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var w=i;i=_.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+w+"]); ":i+=" validate.errors = ["+w+"]; return false; ":i+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",e.createErrors!==!1?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(i+=" if (false) { ");return i}});var Zlt=b((NXr,Xlt)=>{"use strict";Xlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m="errs__"+o,E=e.util.copy(e),y="";E.level++;var C="valid"+E.level,_=E.baseId,w="prevValid"+o,B="passingSchemas"+o;i+="var "+m+" = errors , "+w+" = false , "+h+" = false , "+B+" = null; ";var R=e.compositeRule;e.compositeRule=E.compositeRule=!0;var F=a;if(F)for(var q,J=-1,j=F.length-1;J<j;)q=F[J+=1],(e.opts.strictKeywords?typeof q=="object"&&Object.keys(q).length>0||q===!1:e.util.schemaHasRules(q,e.RULES.all))?(E.schema=q,E.schemaPath=l+"["+J+"]",E.errSchemaPath=u+"/"+J,i+=" "+e.validate(E)+" ",E.baseId=_):i+=" var "+C+" = true; ",J&&(i+=" if ("+C+" && "+w+") { "+h+" = false; "+B+" = ["+B+", "+J+"]; } else { ",y+="}"),i+=" if ("+C+") { "+h+" = "+w+" = true; "+B+" = "+J+"; }";return e.compositeRule=E.compositeRule=R,i+=""+y+"if (!"+h+") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+B+" } ",e.opts.messages!==!1&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+m+"; if (vErrors !== null) { if ("+m+") vErrors.length = "+m+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i}});var tut=b((OXr,eut)=>{"use strict";eut.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h=e.opts.$data&&a&&a.$data,m;h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a;var E=h?"(new RegExp("+m+"))":e.usePattern(a);i+="if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'string') || "),i+=" !"+E+".test("+d+") ) { ";var y=y||[];y.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",h?i+=""+m:i+=""+e.util.toQuotedString(a),i+=" } ",e.opts.messages!==!1&&(i+=` , message: 'should match pattern "`,h?i+="' + "+m+" + '":i+=""+e.util.escapeQuotes(a),i+=`"' `),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+e.util.toQuotedString(a),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var C=i;return i=y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+C+"]); ":i+=" validate.errors = ["+C+"]; return false; ":i+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}});var rut=b((MXr,nut)=>{"use strict";nut.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="errs__"+o,m=e.util.copy(e),E="";m.level++;var y="valid"+m.level,C="key"+o,_="idx"+o,w=m.dataLevel=e.dataLevel+1,B="data"+w,R="dataProperties"+o,F=Object.keys(a||{}).filter(Ae),q=e.schema.patternProperties||{},J=Object.keys(q).filter(Ae),j=e.schema.additionalProperties,L=F.length||J.length,K=j===!1,U=typeof j=="object"&&Object.keys(j).length,se=e.opts.removeAdditional,V=K||U||se,O=e.opts.ownProperties,Y=e.baseId,ee=e.schema.required;if(ee&&!(e.opts.$data&&ee.$data)&&ee.length<e.opts.loopRequired)var ne=e.util.toHash(ee);function Ae(mt){return mt!=="__proto__"}if(i+="var "+h+" = errors;var "+y+" = true;",O&&(i+=" var "+R+" = undefined;"),V){if(O?i+=" "+R+" = "+R+" || Object.keys("+d+"); for (var "+_+"=0; "+_+"<"+R+".length; "+_+"++) { var "+C+" = "+R+"["+_+"]; ":i+=" for (var "+C+" in "+d+") { ",L){if(i+=" var isAdditional"+o+" = !(false ",F.length)if(F.length>8)i+=" || validate.schema"+l+".hasOwnProperty("+C+") ";else{var Ce=F;if(Ce)for(var De,Ue=-1,qe=Ce.length-1;Ue<qe;)De=Ce[Ue+=1],i+=" || "+C+" == "+e.util.toQuotedString(De)+" "}if(J.length){var Ie=J;if(Ie)for(var xe,Oe=-1,le=Ie.length-1;Oe<le;)xe=Ie[Oe+=1],i+=" || "+e.usePattern(xe)+".test("+C+") "}i+=" ); if (isAdditional"+o+") { "}if(se=="all")i+=" delete "+d+"["+C+"]; ";else{var re=e.errorPath,ye="' + "+C+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,C,e.opts.jsonPointers)),K)if(se)i+=" delete "+d+"["+C+"]; ";else{i+=" "+y+" = false; ";var X=u;u=e.errSchemaPath+"/additionalProperties";var he=he||[];he.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { additionalProperty: '"+ye+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is an invalid additional property":i+="should NOT have additional properties",i+="' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var ae=i;i=he.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+ae+"]); ":i+=" validate.errors = ["+ae+"]; return false; ":i+=" var err = "+ae+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=X,c&&(i+=" break; ")}else if(U)if(se=="failing"){i+=" var "+h+" = errors; ";var me=e.compositeRule;e.compositeRule=m.compositeRule=!0,m.schema=j,m.schemaPath=e.schemaPath+".additionalProperties",m.errSchemaPath=e.errSchemaPath+"/additionalProperties",m.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,C,e.opts.jsonPointers);var Se=d+"["+C+"]";m.dataPathArr[w]=C;var ie=e.validate(m);m.baseId=Y,e.util.varOccurences(ie,B)<2?i+=" "+e.util.varReplace(ie,B,Se)+" ":i+=" var "+B+" = "+Se+"; "+ie+" ",i+=" if (!"+y+") { errors = "+h+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+d+"["+C+"]; } ",e.compositeRule=m.compositeRule=me}else{m.schema=j,m.schemaPath=e.schemaPath+".additionalProperties",m.errSchemaPath=e.errSchemaPath+"/additionalProperties",m.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,C,e.opts.jsonPointers);var Se=d+"["+C+"]";m.dataPathArr[w]=C;var ie=e.validate(m);m.baseId=Y,e.util.varOccurences(ie,B)<2?i+=" "+e.util.varReplace(ie,B,Se)+" ":i+=" var "+B+" = "+Se+"; "+ie+" ",c&&(i+=" if (!"+y+") break; ")}e.errorPath=re}L&&(i+=" } "),i+=" } ",c&&(i+=" if ("+y+") { ",E+="}")}var k=e.opts.useDefaults&&!e.compositeRule;if(F.length){var W=F;if(W)for(var De,pe=-1,te=W.length-1;pe<te;){De=W[pe+=1];var H=a[De];if(e.opts.strictKeywords?typeof H=="object"&&Object.keys(H).length>0||H===!1:e.util.schemaHasRules(H,e.RULES.all)){var ge=e.util.getProperty(De),Se=d+ge,be=k&&H.default!==void 0;m.schema=H,m.schemaPath=l+ge,m.errSchemaPath=u+"/"+e.util.escapeFragment(De),m.errorPath=e.util.getPath(e.errorPath,De,e.opts.jsonPointers),m.dataPathArr[w]=e.util.toQuotedString(De);var ie=e.validate(m);if(m.baseId=Y,e.util.varOccurences(ie,B)<2){ie=e.util.varReplace(ie,B,Se);var Pe=Se}else{var Pe=B;i+=" var "+B+" = "+Se+"; "}if(be)i+=" "+ie+" ";else{if(ne&&ne[De]){i+=" if ( "+Pe+" === undefined ",O&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(De)+"') "),i+=") { "+y+" = false; ";var re=e.errorPath,X=u,pt=e.util.escapeQuotes(De);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(re,De,e.opts.jsonPointers)),u=e.errSchemaPath+"/required";var he=he||[];he.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+pt+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+pt+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var ae=i;i=he.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+ae+"]); ":i+=" validate.errors = ["+ae+"]; return false; ":i+=" var err = "+ae+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=X,e.errorPath=re,i+=" } else { "}else c?(i+=" if ( "+Pe+" === undefined ",O&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(De)+"') "),i+=") { "+y+" = true; } else { "):(i+=" if ("+Pe+" !== undefined ",O&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(De)+"') "),i+=" ) { ");i+=" "+ie+" } "}}c&&(i+=" if ("+y+") { ",E+="}")}}if(J.length){var Dt=J;if(Dt)for(var xe,Qt=-1,dt=Dt.length-1;Qt<dt;){xe=Dt[Qt+=1];var H=q[xe];if(e.opts.strictKeywords?typeof H=="object"&&Object.keys(H).length>0||H===!1:e.util.schemaHasRules(H,e.RULES.all)){m.schema=H,m.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(xe),m.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(xe),O?i+=" "+R+" = "+R+" || Object.keys("+d+"); for (var "+_+"=0; "+_+"<"+R+".length; "+_+"++) { var "+C+" = "+R+"["+_+"]; ":i+=" for (var "+C+" in "+d+") { ",i+=" if ("+e.usePattern(xe)+".test("+C+")) { ",m.errorPath=e.util.getPathExpr(e.errorPath,C,e.opts.jsonPointers);var Se=d+"["+C+"]";m.dataPathArr[w]=C;var ie=e.validate(m);m.baseId=Y,e.util.varOccurences(ie,B)<2?i+=" "+e.util.varReplace(ie,B,Se)+" ":i+=" var "+B+" = "+Se+"; "+ie+" ",c&&(i+=" if (!"+y+") break; "),i+=" } ",c&&(i+=" else "+y+" = true; "),i+=" } ",c&&(i+=" if ("+y+") { ",E+="}")}}}return c&&(i+=" "+E+" if ("+h+" == errors) {"),i}});var out=b((FXr,iut)=>{"use strict";iut.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="errs__"+o,m=e.util.copy(e),E="";m.level++;var y="valid"+m.level;if(i+="var "+h+" = errors;",e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all)){m.schema=a,m.schemaPath=l,m.errSchemaPath=u;var C="key"+o,_="idx"+o,w="i"+o,B="' + "+C+" + '",R=m.dataLevel=e.dataLevel+1,F="data"+R,q="dataProperties"+o,J=e.opts.ownProperties,j=e.baseId;J&&(i+=" var "+q+" = undefined; "),J?i+=" "+q+" = "+q+" || Object.keys("+d+"); for (var "+_+"=0; "+_+"<"+q+".length; "+_+"++) { var "+C+" = "+q+"["+_+"]; ":i+=" for (var "+C+" in "+d+") { ",i+=" var startErrs"+o+" = errors; ";var L=C,K=e.compositeRule;e.compositeRule=m.compositeRule=!0;var U=e.validate(m);m.baseId=j,e.util.varOccurences(U,F)<2?i+=" "+e.util.varReplace(U,F,L)+" ":i+=" var "+F+" = "+L+"; "+U+" ",e.compositeRule=m.compositeRule=K,i+=" if (!"+y+") { for (var "+w+"=startErrs"+o+"; "+w+"<errors; "+w+"++) { vErrors["+w+"].propertyName = "+C+"; } var err = ",e.createErrors!==!1?(i+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { propertyName: '"+B+"' } ",e.opts.messages!==!1&&(i+=" , message: 'property name \\'"+B+"\\' is invalid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),c&&(i+=" break; "),i+=" } }"}return c&&(i+=" "+E+" if ("+h+" == errors) {"),i}});var aut=b((LXr,sut)=>{"use strict";sut.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m=e.opts.$data&&a&&a.$data,E;m?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",E="schema"+o):E=a;var y="schema"+o;if(!m)if(a.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var C=[],_=a;if(_)for(var w,B=-1,R=_.length-1;B<R;){w=_[B+=1];var F=e.schema.properties[w];F&&(e.opts.strictKeywords?typeof F=="object"&&Object.keys(F).length>0||F===!1:e.util.schemaHasRules(F,e.RULES.all))||(C[C.length]=w)}}else var C=a;if(m||C.length){var q=e.errorPath,J=m||C.length>=e.opts.loopRequired,j=e.opts.ownProperties;if(c)if(i+=" var missing"+o+"; ",J){m||(i+=" var "+y+" = validate.schema"+l+"; ");var L="i"+o,K="schema"+o+"["+L+"]",U="' + "+K+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(q,K,e.opts.jsonPointers)),i+=" var "+h+" = true; ",m&&(i+=" if (schema"+o+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+o+")) "+h+" = false; else {"),i+=" for (var "+L+" = 0; "+L+" < "+y+".length; "+L+"++) { "+h+" = "+d+"["+y+"["+L+"]] !== undefined ",j&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", "+y+"["+L+"]) "),i+="; if (!"+h+") break; } ",m&&(i+=" } "),i+=" if (!"+h+") { ";var se=se||[];se.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+U+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+U+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var V=i;i=se.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+V+"]); ":i+=" validate.errors = ["+V+"]; return false; ":i+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var O=C;if(O)for(var Y,L=-1,ee=O.length-1;L<ee;){Y=O[L+=1],L&&(i+=" || ");var ne=e.util.getProperty(Y),Ae=d+ne;i+=" ( ( "+Ae+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(Y)+"') "),i+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?Y:ne)+") ) "}i+=") { ";var K="missing"+o,U="' + "+K+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(q,K,!0):q+" + "+K);var se=se||[];se.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+U+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+U+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var V=i;i=se.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+V+"]); ":i+=" validate.errors = ["+V+"]; return false; ":i+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else if(J){m||(i+=" var "+y+" = validate.schema"+l+"; ");var L="i"+o,K="schema"+o+"["+L+"]",U="' + "+K+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(q,K,e.opts.jsonPointers)),m&&(i+=" if ("+y+" && !Array.isArray("+y+")) { var err = ",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+U+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+U+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+y+" !== undefined) { "),i+=" for (var "+L+" = 0; "+L+" < "+y+".length; "+L+"++) { if ("+d+"["+y+"["+L+"]] === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", "+y+"["+L+"]) "),i+=") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+U+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+U+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",m&&(i+=" } ")}else{var Ce=C;if(Ce)for(var Y,De=-1,Ue=Ce.length-1;De<Ue;){Y=Ce[De+=1];var ne=e.util.getProperty(Y),U=e.util.escapeQuotes(Y),Ae=d+ne;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(q,Y,e.opts.jsonPointers)),i+=" if ( "+Ae+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(Y)+"') "),i+=") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+U+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+U+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=q}else c&&(i+=" if (true) {");return i}});var uut=b((PXr,lut)=>{"use strict";lut.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m=e.opts.$data&&a&&a.$data,E;if(m?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",E="schema"+o):E=a,(a||m)&&e.opts.uniqueItems!==!1){m&&(i+=" var "+h+"; if ("+E+" === false || "+E+" === undefined) "+h+" = true; else if (typeof "+E+" != 'boolean') "+h+" = false; else { "),i+=" var i = "+d+".length , "+h+" = true , j; if (i > 1) { ";var y=e.schema.items&&e.schema.items.type,C=Array.isArray(y);if(!y||y=="object"||y=="array"||C&&(y.indexOf("object")>=0||y.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+d+"[i], "+d+"[j])) { "+h+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+d+"[i]; ";var _="checkDataType"+(C?"s":"");i+=" if ("+e.util[_](y,"item",e.opts.strictNumbers,!0)+") continue; ",C&&(i+=` if (typeof item == 'string') item = '"' + item; `),i+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",m&&(i+=" } "),i+=" if (!"+h+") { ";var w=w||[];w.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",m?i+="validate.schema"+l:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var B=i;i=w.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+B+"]); ":i+=" validate.errors = ["+B+"]; return false; ":i+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c&&(i+=" else { ")}else c&&(i+=" if (true) { ");return i}});var dut=b((QXr,cut)=>{"use strict";cut.exports={$ref:Slt(),allOf:Ilt(),anyOf:blt(),$comment:wlt(),const:Blt(),contains:Olt(),dependencies:Flt(),enum:Plt(),format:klt(),if:Glt(),items:qlt(),maximum:m_e(),minimum:m_e(),maxItems:A_e(),minItems:A_e(),maxLength:g_e(),minLength:g_e(),maxProperties:E_e(),minProperties:E_e(),multipleOf:zlt(),not:Klt(),oneOf:Zlt(),pattern:tut(),properties:rut(),propertyNames:out(),required:aut(),uniqueItems:uut(),validate:p_e()}});var hut=b((kXr,put)=>{"use strict";var fut=dut(),y_e=QN().toHash;put.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],n=["type","$comment"],r=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],i=["number","integer","string","array","object","boolean","null"];return e.all=y_e(n),e.types=y_e(i),e.forEach(function(o){o.rules=o.rules.map(function(s){var a;if(typeof s=="object"){var l=Object.keys(s)[0];a=s[l],s=l,a.forEach(function(c){n.push(c),e.all[c]=!0})}n.push(s);var u=e.all[s]={keyword:s,code:fut[s],implements:a};return u}),e.all.$comment={keyword:"$comment",code:fut.$comment},o.type&&(e.types[o.type]=o)}),e.keywords=y_e(n.concat(r)),e.custom={},e}});var gut=b((UXr,Aut)=>{"use strict";var mut=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];Aut.exports=function(t,e){for(var n=0;n<e.length;n++){t=JSON.parse(JSON.stringify(t));var r=e[n].split("/"),i=t,o;for(o=1;o<r.length;o++)i=i[r[o]];for(o=0;o<mut.length;o++){var s=mut[o],a=i[s];a&&(i[s]={anyOf:[a,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return t}});var Cut=b((GXr,yut)=>{"use strict";var _Pn=see().MissingRef;yut.exports=Eut;function Eut(t,e,n){var r=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof e=="function"&&(n=e,e=void 0);var i=o(t).then(function(){var a=r._addSchema(t,void 0,e);return a.validate||s(a)});return n&&i.then(function(a){n(null,a)},n),i;function o(a){var l=a.$schema;return l&&!r.getSchema(l)?Eut.call(r,{$ref:l},!0):Promise.resolve()}function s(a){try{return r._compile(a)}catch(u){if(u instanceof _Pn)return l(u);throw u}function l(u){var c=u.missingSchema;if(m(c))throw new Error("Schema "+c+" is loaded but "+u.missingRef+" cannot be resolved");var d=r._loadingSchemas[c];return d||(d=r._loadingSchemas[c]=r._opts.loadSchema(c),d.then(h,h)),d.then(function(E){if(!m(c))return o(E).then(function(){m(c)||r.addSchema(E,c,void 0,e)})}).then(function(){return s(a)});function h(){delete r._loadingSchemas[c]}function m(E){return r._refs[E]||r._schemas[E]}}}}});var Dut=b((HXr,vut)=>{"use strict";vut.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d,h="data"+(s||""),m="valid"+o,E="errs__"+o,y=e.opts.$data&&a&&a.$data,C;y?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",C="schema"+o):C=a;var _=this,w="definition"+o,B=_.definition,R="",F,q,J,j,L;if(y&&B.$data){L="keywordValidate"+o;var K=B.validateSchema;i+=" var "+w+" = RULES.custom['"+n+"'].definition; var "+L+" = "+w+".validate;"}else{if(j=e.useCustomRule(_,a,e.schema,e),!j)return;C="validate.schema"+l,L=j.code,F=B.compile,q=B.inline,J=B.macro}var U=L+".errors",se="i"+o,V="ruleErr"+o,O=B.async;if(O&&!e.async)throw new Error("async keyword in sync schema");if(q||J||(i+=""+U+" = null;"),i+="var "+E+" = errors;var "+m+";",y&&B.$data&&(R+="}",i+=" if ("+C+" === undefined) { "+m+" = true; } else { ",K&&(R+="}",i+=" "+m+" = "+w+".validateSchema("+C+"); if ("+m+") { ")),q)B.statements?i+=" "+j.validate+" ":i+=" "+m+" = "+j.validate+"; ";else if(J){var Y=e.util.copy(e),R="";Y.level++;var ee="valid"+Y.level;Y.schema=j.validate,Y.schemaPath="";var ne=e.compositeRule;e.compositeRule=Y.compositeRule=!0;var Ae=e.validate(Y).replace(/validate\.schema/g,L);e.compositeRule=Y.compositeRule=ne,i+=" "+Ae}else{var Ce=Ce||[];Ce.push(i),i="",i+=" "+L+".call( ",e.opts.passContext?i+="this":i+="self",F||B.schema===!1?i+=" , "+h+" ":i+=" , "+C+" , "+h+" , validate.schema"+e.schemaPath+" ",i+=" , (dataPath || '')",e.errorPath!='""'&&(i+=" + "+e.errorPath);var De=s?"data"+(s-1||""):"parentData",Ue=s?e.dataPathArr[s]:"parentDataProperty";i+=" , "+De+" , "+Ue+" , rootData ) ";var qe=i;i=Ce.pop(),B.errors===!1?(i+=" "+m+" = ",O&&(i+="await "),i+=""+qe+"; "):O?(U="customErrors"+o,i+=" var "+U+" = null; try { "+m+" = await "+qe+"; } catch (e) { "+m+" = false; if (e instanceof ValidationError) "+U+" = e.errors; else throw e; } "):i+=" "+U+" = null; "+m+" = "+qe+"; "}if(B.modifying&&(i+=" if ("+De+") "+h+" = "+De+"["+Ue+"];"),i+=""+R,B.valid)c&&(i+=" if (true) { ");else{i+=" if ( ",B.valid===void 0?(i+=" !",J?i+=""+ee:i+=""+m):i+=" "+!B.valid+" ",i+=") { ",d=_.keyword;var Ce=Ce||[];Ce.push(i),i="";var Ce=Ce||[];Ce.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(d||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+_.keyword+"' } ",e.opts.messages!==!1&&(i+=` , message: 'should pass "`+_.keyword+`" keyword validation' `),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var Ie=i;i=Ce.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+Ie+"]); ":i+=" validate.errors = ["+Ie+"]; return false; ":i+=" var err = "+Ie+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var xe=i;i=Ce.pop(),q?B.errors?B.errors!="full"&&(i+=" for (var "+se+"="+E+"; "+se+"<errors; "+se+"++) { var "+V+" = vErrors["+se+"]; if ("+V+".dataPath === undefined) "+V+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+V+".schemaPath === undefined) { "+V+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(i+=" "+V+".schema = "+C+"; "+V+".data = "+h+"; "),i+=" } "):B.errors===!1?i+=" "+xe+" ":(i+=" if ("+E+" == errors) { "+xe+" } else { for (var "+se+"="+E+"; "+se+"<errors; "+se+"++) { var "+V+" = vErrors["+se+"]; if ("+V+".dataPath === undefined) "+V+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+V+".schemaPath === undefined) { "+V+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(i+=" "+V+".schema = "+C+"; "+V+".data = "+h+"; "),i+=" } } "):J?(i+=" var err = ",e.createErrors!==!1?(i+=" { keyword: '"+(d||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+_.keyword+"' } ",e.opts.messages!==!1&&(i+=` , message: 'should pass "`+_.keyword+`" keyword validation' `),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; ")):B.errors===!1?i+=" "+xe+" ":(i+=" if (Array.isArray("+U+")) { if (vErrors === null) vErrors = "+U+"; else vErrors = vErrors.concat("+U+"); errors = vErrors.length; for (var "+se+"="+E+"; "+se+"<errors; "+se+"++) { var "+V+" = vErrors["+se+"]; if ("+V+".dataPath === undefined) "+V+".dataPath = (dataPath || '') + "+e.errorPath+"; "+V+'.schemaPath = "'+u+'"; ',e.opts.verbose&&(i+=" "+V+".schema = "+C+"; "+V+".data = "+h+"; "),i+=" } } else { "+xe+" } "),i+=" } ",c&&(i+=" else { ")}return i}});var C_e=b((qXr,IPn)=>{IPn.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Iut=b((VXr,_ut)=>{"use strict";var Sut=C_e();_ut.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:Sut.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:Sut.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var but=b(($Xr,Tut)=>{"use strict";var TPn=/^[a-z_$][a-z0-9_$-]*$/i,bPn=Dut(),xPn=Iut();Tut.exports={add:wPn,get:RPn,remove:BPn,validate:v_e};function wPn(t,e){var n=this.RULES;if(n.keywords[t])throw new Error("Keyword "+t+" is already defined");if(!TPn.test(t))throw new Error("Keyword "+t+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var r=e.type;if(Array.isArray(r))for(var i=0;i<r.length;i++)s(t,r[i],e);else s(t,r,e);var o=e.metaSchema;o&&(e.$data&&this._opts.$data&&(o={anyOf:[o,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),e.validateSchema=this.compile(o,!0))}n.keywords[t]=n.all[t]=!0;function s(a,l,u){for(var c,d=0;d<n.length;d++){var h=n[d];if(h.type==l){c=h;break}}c||(c={type:l,rules:[]},n.push(c));var m={keyword:a,definition:u,custom:!0,code:bPn,implements:u.implements};c.rules.push(m),n.custom[a]=m}return this}function RPn(t){var e=this.RULES.custom[t];return e?e.definition:this.RULES.keywords[t]||!1}function BPn(t){var e=this.RULES;delete e.keywords[t],delete e.all[t],delete e.custom[t];for(var n=0;n<e.length;n++)for(var r=e[n].rules,i=0;i<r.length;i++)if(r[i].keyword==t){r.splice(i,1);break}return this}function v_e(t,e){v_e.errors=null;var n=this._validateKeyword=this._validateKeyword||this.compile(xPn,!0);if(n(t))return!0;if(v_e.errors=n.errors,e)throw new Error("custom keyword definition is invalid: "+this.errorsText(n.errors));return!1}});var xut=b((YXr,NPn)=>{NPn.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Qut=b((jXr,Put)=>{"use strict";var Rut=alt(),kN=oee(),OPn=ult(),But=s_e(),MPn=f_e(),FPn=vlt(),LPn=hut(),Nut=gut(),Out=QN();Put.exports=pc;pc.prototype.validate=QPn;pc.prototype.compile=kPn;pc.prototype.addSchema=UPn;pc.prototype.addMetaSchema=GPn;pc.prototype.validateSchema=HPn;pc.prototype.getSchema=VPn;pc.prototype.removeSchema=YPn;pc.prototype.addFormat=e5n;pc.prototype.errorsText=ZPn;pc.prototype._addSchema=jPn;pc.prototype._compile=WPn;pc.prototype.compileAsync=Cut();var hee=but();pc.prototype.addKeyword=hee.add;pc.prototype.getKeyword=hee.get;pc.prototype.removeKeyword=hee.remove;pc.prototype.validateKeyword=hee.validate;var Mut=see();pc.ValidationError=Mut.Validation;pc.MissingRefError=Mut.MissingRef;pc.$dataMetaSchema=Nut;var pee="http://json-schema.org/draft-07/schema",wut=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],PPn=["/properties"];function pc(t){if(!(this instanceof pc))return new pc(t);t=this._opts=Out.copy(t)||{},s5n(this),this._schemas={},this._refs={},this._fragments={},this._formats=FPn(t.format),this._cache=t.cache||new OPn,this._loadingSchemas={},this._compilations=[],this.RULES=LPn(),this._getId=zPn(t),t.loopRequired=t.loopRequired||1/0,t.errorDataPath=="property"&&(t._errorDataPathProperty=!0),t.serialize===void 0&&(t.serialize=MPn),this._metaOpts=o5n(this),t.formats&&r5n(this),t.keywords&&i5n(this),t5n(this),typeof t.meta=="object"&&this.addMetaSchema(t.meta),t.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),n5n(this)}function QPn(t,e){var n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error('no schema with key or ref "'+t+'"')}else{var r=this._addSchema(t);n=r.validate||this._compile(r)}var i=n(e);return n.$async!==!0&&(this.errors=n.errors),i}function kPn(t,e){var n=this._addSchema(t,void 0,e);return n.validate||this._compile(n)}function UPn(t,e,n,r){if(Array.isArray(t)){for(var i=0;i<t.length;i++)this.addSchema(t[i],void 0,n,r);return this}var o=this._getId(t);if(o!==void 0&&typeof o!="string")throw new Error("schema id must be string");return e=kN.normalizeId(e||o),Lut(this,e),this._schemas[e]=this._addSchema(t,n,r,!0),this}function GPn(t,e,n){return this.addSchema(t,e,n,!0),this}function HPn(t,e){var n=t.$schema;if(n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this._opts.defaultMeta||qPn(this),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var r=this.validate(n,t);if(!r&&e){var i="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(i);else throw new Error(i)}return r}function qPn(t){var e=t._opts.meta;return t._opts.defaultMeta=typeof e=="object"?t._getId(e)||e:t.getSchema(pee)?pee:void 0,t._opts.defaultMeta}function VPn(t){var e=Fut(this,t);switch(typeof e){case"object":return e.validate||this._compile(e);case"string":return this.getSchema(e);case"undefined":return $Pn(this,t)}}function $Pn(t,e){var n=kN.schema.call(t,{schema:{}},e);if(n){var r=n.schema,i=n.root,o=n.baseId,s=Rut.call(t,r,i,void 0,o);return t._fragments[e]=new But({ref:e,fragment:!0,schema:r,root:i,baseId:o,validate:s}),s}}function Fut(t,e){return e=kN.normalizeId(e),t._schemas[e]||t._refs[e]||t._fragments[e]}function YPn(t){if(t instanceof RegExp)return fee(this,this._schemas,t),fee(this,this._refs,t),this;switch(typeof t){case"undefined":return fee(this,this._schemas),fee(this,this._refs),this._cache.clear(),this;case"string":var e=Fut(this,t);return e&&this._cache.del(e.cacheKey),delete this._schemas[t],delete this._refs[t],this;case"object":var n=this._opts.serialize,r=n?n(t):t;this._cache.del(r);var i=this._getId(t);i&&(i=kN.normalizeId(i),delete this._schemas[i],delete this._refs[i])}return this}function fee(t,e,n){for(var r in e){var i=e[r];!i.meta&&(!n||n.test(r))&&(t._cache.del(i.cacheKey),delete e[r])}}function jPn(t,e,n,r){if(typeof t!="object"&&typeof t!="boolean")throw new Error("schema should be object or boolean");var i=this._opts.serialize,o=i?i(t):t,s=this._cache.get(o);if(s)return s;r=r||this._opts.addUsedSchema!==!1;var a=kN.normalizeId(this._getId(t));a&&r&&Lut(this,a);var l=this._opts.validateSchema!==!1&&!e,u;l&&!(u=a&&a==kN.normalizeId(t.$schema))&&this.validateSchema(t,!0);var c=kN.ids.call(this,t),d=new But({id:a,schema:t,localRefs:c,cacheKey:o,meta:n});return a[0]!="#"&&r&&(this._refs[a]=d),this._cache.put(o,d),l&&u&&this.validateSchema(t,!0),d}function WPn(t,e){if(t.compiling)return t.validate=i,i.schema=t.schema,i.errors=null,i.root=e||i,t.schema.$async===!0&&(i.$async=!0),i;t.compiling=!0;var n;t.meta&&(n=this._opts,this._opts=this._metaOpts);var r;try{r=Rut.call(this,t.schema,e,t.localRefs)}catch(o){throw delete t.validate,o}finally{t.compiling=!1,t.meta&&(this._opts=n)}return t.validate=r,t.refs=r.refs,t.refVal=r.refVal,t.root=r.root,r;function i(){var o=t.validate,s=o.apply(this,arguments);return i.errors=o.errors,s}}function zPn(t){switch(t.schemaId){case"auto":return XPn;case"id":return JPn;default:return KPn}}function JPn(t){return t.$id&&this.logger.warn("schema $id ignored",t.$id),t.id}function KPn(t){return t.id&&this.logger.warn("schema id ignored",t.id),t.$id}function XPn(t){if(t.$id&&t.id&&t.$id!=t.id)throw new Error("schema $id is different from id");return t.$id||t.id}function ZPn(t,e){if(t=t||this.errors,!t)return"No errors";e=e||{};for(var n=e.separator===void 0?", ":e.separator,r=e.dataVar===void 0?"data":e.dataVar,i="",o=0;o<t.length;o++){var s=t[o];s&&(i+=r+s.dataPath+" "+s.message+n)}return i.slice(0,-n.length)}function e5n(t,e){return typeof e=="string"&&(e=new RegExp(e)),this._formats[t]=e,this}function t5n(t){var e;if(t._opts.$data&&(e=xut(),t.addMetaSchema(e,e.$id,!0)),t._opts.meta!==!1){var n=C_e();t._opts.$data&&(n=Nut(n,PPn)),t.addMetaSchema(n,pee,!0),t._refs["http://json-schema.org/schema"]=pee}}function n5n(t){var e=t._opts.schemas;if(e)if(Array.isArray(e))t.addSchema(e);else for(var n in e)t.addSchema(e[n],n)}function r5n(t){for(var e in t._opts.formats){var n=t._opts.formats[e];t.addFormat(e,n)}}function i5n(t){for(var e in t._opts.keywords){var n=t._opts.keywords[e];t.addKeyword(e,n)}}function Lut(t,e){if(t._schemas[e]||t._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function o5n(t){for(var e=Out.copy(t._opts),n=0;n<wut.length;n++)delete e[wut[n]];return e}function s5n(t){var e=t._opts.logger;if(e===!1)t.logger={log:D_e,warn:D_e,error:D_e};else{if(e===void 0&&(e=console),!(typeof e=="object"&&e.log&&e.warn&&e.error))throw new Error("logger must implement log, warn and error methods");t.logger=e}}function D_e(){}});var kut,mx,mee=Le(()=>{Pat();dx();kut=Qe(Qut(),1),mx=class extends KZ{constructor(e,n){var r;super(n),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(r=n?.capabilities)!==null&&r!==void 0?r:{},this._ajv=new kut.default}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Lat(this._capabilities,e)}assertCapability(e,n){var r;if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r[e]))throw new Error(`Server does not support ${e} (required for ${n})`)}async connect(e,n){if(await super.connect(e),e.sessionId===void 0)try{let r=await this.request({method:"initialize",params:{protocolVersion:J8,capabilities:this._capabilities,clientInfo:this._clientInfo}},VSe,n);if(r===void 0)throw new Error(`Server sent invalid initialize result: ${r}`);if(!Eat.includes(r.protocolVersion))throw new Error(`Server's protocol version is not supported: ${r.protocolVersion}`);this._serverCapabilities=r.capabilities,this._serverVersion=r.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(r.protocolVersion),this._instructions=r.instructions,await this.notification({method:"notifications/initialized"})}catch(r){throw this.close(),r}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var n,r,i,o,s;switch(e){case"logging/setLevel":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((i=this._serverCapabilities)===null||i===void 0)&&i.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((o=this._serverCapabilities)===null||o===void 0)&&o.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s.completions))throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){var n;switch(e){case"notifications/roots/list_changed":if(!(!((n=this._capabilities.roots)===null||n===void 0)&&n.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"ping":break}}async ping(e){return this.request({method:"ping"},PN,e)}async complete(e,n){return this.request({method:"completion/complete",params:e},XSe,n)}async setLoggingLevel(e,n){return this.request({method:"logging/setLevel",params:{level:e}},PN,n)}async getPrompt(e,n){return this.request({method:"prompts/get",params:e},gG,n)}async listPrompts(e,n){return this.request({method:"prompts/list",params:e},AG,n)}async listResources(e,n){return this.request({method:"resources/list",params:e},$Se,n)}async listResourceTemplates(e,n){return this.request({method:"resources/templates/list",params:e},YSe,n)}async readResource(e,n){return this.request({method:"resources/read",params:e},jSe,n)}async subscribeResource(e,n){return this.request({method:"resources/subscribe",params:e},PN,n)}async unsubscribeResource(e,n){return this.request({method:"resources/unsubscribe",params:e},PN,n)}async callTool(e,n=JZ,r){let i=await this.request({method:"tools/call",params:e},n,r),o=this.getToolOutputValidator(e.name);if(o){if(!i.structuredContent&&!i.isError)throw new by(Ty.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(i.structuredContent)try{if(!o(i.structuredContent))throw new by(Ty.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(o.errors)}`)}catch(s){throw s instanceof by?s:new by(Ty.InvalidParams,`Failed to validate structured content: ${s instanceof Error?s.message:String(s)}`)}}return i}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(let n of e)if(n.outputSchema)try{let r=this._ajv.compile(n.outputSchema);this._cachedToolOutputValidators.set(n.name,r)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,n){let r=await this.request({method:"tools/list",params:e},KSe,n);return this.cacheToolOutputSchemas(r.tools),r}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}});var Vut=b((KXr,qut)=>{qut.exports=Hut;Hut.sync=l5n;var Uut=we("fs");function a5n(t,e){var n=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function Gut(t,e,n){return!t.isSymbolicLink()&&!t.isFile()?!1:a5n(e,n)}function Hut(t,e,n){Uut.stat(t,function(r,i){n(r,r?!1:Gut(i,t,e))})}function l5n(t,e){return Gut(Uut.statSync(t),t,e)}});var zut=b((XXr,Wut)=>{Wut.exports=Yut;Yut.sync=u5n;var $ut=we("fs");function Yut(t,e,n){$ut.stat(t,function(r,i){n(r,r?!1:jut(i,e))})}function u5n(t,e){return jut($ut.statSync(t),e)}function jut(t,e){return t.isFile()&&c5n(t,e)}function c5n(t,e){var n=t.mode,r=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),u=parseInt("001",8),c=a|l,d=n&u||n&l&&i===s||n&a&&r===o||n&c&&o===0;return d}});var Kut=b((eZr,Jut)=>{var ZXr=we("fs"),Aee;process.platform==="win32"||global.TESTING_WINDOWS?Aee=Vut():Aee=zut();Jut.exports=S_e;S_e.sync=d5n;function S_e(t,e,n){if(typeof e=="function"&&(n=e,e={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,i){S_e(t,e||{},function(o,s){o?i(o):r(s)})})}Aee(t,e||{},function(r,i){r&&(r.code==="EACCES"||e&&e.ignoreErrors)&&(r=null,i=!1),n(r,i)})}function d5n(t,e){try{return Aee.sync(t,e||{})}catch(n){if(e&&e.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var ict=b((tZr,rct)=>{var X8=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Xut=we("path"),f5n=X8?";":":",Zut=Kut(),ect=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),tct=(t,e)=>{let n=e.colon||f5n,r=t.match(/\//)||X8&&t.match(/\\/)?[""]:[...X8?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(n)],i=X8?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=X8?i.split(n):[""];return X8&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:r,pathExt:o,pathExtExe:i}},nct=(t,e,n)=>{typeof e=="function"&&(n=e,e={}),e||(e={});let{pathEnv:r,pathExt:i,pathExtExe:o}=tct(t,e),s=[],a=u=>new Promise((c,d)=>{if(u===r.length)return e.all&&s.length?c(s):d(ect(t));let h=r[u],m=/^".*"$/.test(h)?h.slice(1,-1):h,E=Xut.join(m,t),y=!m&&/^\.[\\\/]/.test(t)?t.slice(0,2)+E:E;c(l(y,u,0))}),l=(u,c,d)=>new Promise((h,m)=>{if(d===i.length)return h(a(c+1));let E=i[d];Zut(u+E,{pathExt:o},(y,C)=>{if(!y&&C)if(e.all)s.push(u+E);else return h(u+E);return h(l(u,c,d+1))})});return n?a(0).then(u=>n(null,u),n):a(0)},p5n=(t,e)=>{e=e||{};let{pathEnv:n,pathExt:r,pathExtExe:i}=tct(t,e),o=[];for(let s=0;s<n.length;s++){let a=n[s],l=/^".*"$/.test(a)?a.slice(1,-1):a,u=Xut.join(l,t),c=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let d=0;d<r.length;d++){let h=c+r[d];try{if(Zut.sync(h,{pathExt:i}))if(e.all)o.push(h);else return h}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw ect(t)};rct.exports=nct;nct.sync=p5n});var sct=b((nZr,__e)=>{"use strict";var oct=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};__e.exports=oct;__e.exports.default=oct});var cct=b((rZr,uct)=>{"use strict";var act=we("path"),h5n=ict(),m5n=sct();function lct(t,e){let n=t.options.env||process.env,r=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=h5n.sync(t.command,{path:n[m5n({env:n})],pathExt:e?act.delimiter:void 0})}catch{}finally{o&&process.chdir(r)}return s&&(s=act.resolve(i?t.options.cwd:"",s)),s}function A5n(t){return lct(t)||lct(t,!0)}uct.exports=A5n});var dct=b((iZr,T_e)=>{"use strict";var I_e=/([()\][%!^"`<>&|;, *?])/g;function g5n(t){return t=t.replace(I_e,"^$1"),t}function E5n(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(I_e,"^$1"),e&&(t=t.replace(I_e,"^$1")),t}T_e.exports.command=g5n;T_e.exports.argument=E5n});var pct=b((oZr,fct)=>{"use strict";fct.exports=/^#!(.*)/});var mct=b((sZr,hct)=>{"use strict";var y5n=pct();hct.exports=(t="")=>{let e=t.match(y5n);if(!e)return null;let[n,r]=e[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return i==="env"?r:r?`${i} ${r}`:i}});var gct=b((aZr,Act)=>{"use strict";var b_e=we("fs"),C5n=mct();function v5n(t){let n=Buffer.alloc(150),r;try{r=b_e.openSync(t,"r"),b_e.readSync(r,n,0,150,0),b_e.closeSync(r)}catch{}return C5n(n.toString())}Act.exports=v5n});var vct=b((lZr,Cct)=>{"use strict";var D5n=we("path"),Ect=cct(),yct=dct(),S5n=gct(),_5n=process.platform==="win32",I5n=/\.(?:com|exe)$/i,T5n=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function b5n(t){t.file=Ect(t);let e=t.file&&S5n(t.file);return e?(t.args.unshift(t.file),t.command=e,Ect(t)):t.file}function x5n(t){if(!_5n)return t;let e=b5n(t),n=!I5n.test(e);if(t.options.forceShell||n){let r=T5n.test(e);t.command=D5n.normalize(t.command),t.command=yct.command(t.command),t.args=t.args.map(o=>yct.argument(o,r));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function w5n(t,e,n){e&&!Array.isArray(e)&&(n=e,e=null),e=e?e.slice(0):[],n=Object.assign({},n);let r={command:t,args:e,options:n,file:void 0,original:{command:t,args:e}};return n.shell?r:x5n(r)}Cct.exports=w5n});var _ct=b((uZr,Sct)=>{"use strict";var x_e=process.platform==="win32";function w_e(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function R5n(t,e){if(!x_e)return;let n=t.emit;t.emit=function(r,i){if(r==="exit"){let o=Dct(i,e);if(o)return n.call(t,"error",o)}return n.apply(t,arguments)}}function Dct(t,e){return x_e&&t===1&&!e.file?w_e(e.original,"spawn"):null}function B5n(t,e){return x_e&&t===1&&!e.file?w_e(e.original,"spawnSync"):null}Sct.exports={hookChildProcess:R5n,verifyENOENT:Dct,verifyENOENTSync:B5n,notFoundError:w_e}});var bct=b((cZr,Z8)=>{"use strict";var Ict=we("child_process"),R_e=vct(),B_e=_ct();function Tct(t,e,n){let r=R_e(t,e,n),i=Ict.spawn(r.command,r.args,r.options);return B_e.hookChildProcess(i,r),i}function N5n(t,e,n){let r=R_e(t,e,n),i=Ict.spawnSync(r.command,r.args,r.options);return i.error=i.error||B_e.verifyENOENTSync(i.status,r),i}Z8.exports=Tct;Z8.exports.spawn=Tct;Z8.exports.sync=N5n;Z8.exports._parse=R_e;Z8.exports._enoent=B_e});function O5n(t){return cx.parse(JSON.parse(t))}function xct(t){return JSON.stringify(t)+`
|
|
544
|
+
\u8BF7\u76F4\u63A5\u8F93\u51FA\u4E00\u4E2A\u6B63\u786E\u7684json\u683C\u5F0F\uFF1A`;try{let r=await fetch("https://apis.iflow.cn/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({model:"QWen3-4B",messages:[{role:"user",content:n}],temperature:.1,max_tokens:1e3})});if(!r.ok)throw new Error(`QWen API error: ${r.status}`);let o=(await r.json()).choices[0].message.content.trim();return o.startsWith("```json")?o=o.replace(/^```json\s*/,"").replace(/\s*```$/,""):o.startsWith("```")&&(o=o.replace(/^```\s*/,"").replace(/\s*```$/,"")),JSON.parse(o)}catch(r){throw BC(r),console.error("QWen JSON fix failed:",r),r}}extractTextFromRequest(e){let n="";if(e.contents){let r=Array.isArray(e.contents)?e.contents:[e.contents];for(let i of r)if(i&&typeof i=="object"&&"parts"in i&&i.parts){let o=Array.isArray(i.parts)?i.parts:[i.parts];for(let s of o)if(s&&typeof s=="object"&&"text"in s&&s.text)n+=s.text+" ";else if(s.functionResponse&&s.functionResponse.response)for(let[a,l]of Object.entries(s.functionResponse.response))l!=null&&(n+=String(l)+" ")}}return n.trim()}extractTextFromEmbedRequest(e){if(e.contents){let n=Array.isArray(e.contents)?e.contents:[e.contents];for(let r of n)if(typeof r=="object"&&r!==null&&"parts"in r&&r.parts){let i=Array.isArray(r.parts)?r.parts:[r.parts];for(let o of i)if(typeof o=="object"&&o!==null&&"text"in o&&o.text)return o.text}else{if(typeof r=="string")return r;if(typeof r=="object"&&r!==null&&"text"in r&&r.text)return r.text}}return""}extractSystemInstruction(e){let n="";if(typeof e=="string")n=e;else if(Array.isArray(e)){for(let r of e)typeof r=="object"&&r!==null&&"text"in r&&r.text&&(n+=r.text+" ");n=n.trim()}else if(typeof e=="object"&&e!==null)if("parts"in e&&e.parts){let r=Array.isArray(e.parts)?e.parts:[e.parts];for(let i of r)typeof i=="object"&&i!==null&&"text"in i&&i.text&&(n+=i.text+" ");n=n.trim()}else"text"in e&&e.text&&(n=e.text);return n}convertToOpenAITools(e){if(!e||e.length===0)return[];let n=[];for(let r of e)if(r.functionDeclarations&&Array.isArray(r.functionDeclarations))for(let i of r.functionDeclarations)n.push({type:"function",function:{name:i.name||"",description:i.description,parameters:this.convertParameters(i.parameters||i.parametersJsonSchema)}});return n}convertParameters(e){if(!e)return;let n={STRING:"string",INTEGER:"integer",NUMBER:"number",BOOLEAN:"boolean",OBJECT:"object",ARRAY:"array"};if(typeof e=="object"&&e.type){if(typeof e.type=="string"&&(n[e.type]?e.type=n[e.type]:e.type=e.type.toLowerCase()),e.properties)for(let i in e.properties){let o=e.properties[i],s={};o.type&&(s.type=n[o.type]),o.description&&(s.description=o.description),e.properties[i]=s}return e.items&&(e.items=this.convertParameters(e.items)),e}let r=i=>{if(!i)return;let o={};if(i.type)switch(i.type){case"STRING":o.type="string";break;case"INTEGER":o.type="integer";break;case"NUMBER":o.type="number";break;case"BOOLEAN":o.type="boolean";break;case"OBJECT":o.type="object";break;case"ARRAY":o.type="array";break;default:o.type=i.type.toLowerCase()}if(o.type="object",i.description&&(o.description=i.description),i.enum&&(o.enum=i.enum),i.properties){o.properties={};for(let[s,a]of Object.entries(i.properties))o.properties[s]=r(a)}return i.items&&(o.items=r(i.items)),i.required&&(o.required=i.required),o};return r(e)}mapFinishReason(e){switch(e){case"stop":return qb.STOP;case"length":return qb.MAX_TOKENS;case"content_filter":return qb.SAFETY;case"tool_calls":return qb.MALFORMED_FUNCTION_CALL;default:return qb.OTHER}}convertResponseSchema(e){if(e)return e.type==="object"||e.type==="OBJECT"?{type:"json_schema",json_schema:{name:e.name||"",description:e.description||"",schema:this.convertSchemaToJsonSchema(e),strict:!0}}:{type:"json_schema",json_schema:{name:"response_schema",description:"Generated response schema",schema:this.convertSchemaToJsonSchema(e),strict:!0}}}convertSchemaToJsonSchema(e){if(!e)return{};let n={};if(e.type)switch(e.type){case"STRING":n.type="string";break;case"INTEGER":n.type="integer";break;case"NUMBER":n.type="number";break;case"BOOLEAN":n.type="boolean";break;case"OBJECT":n.type="object";break;case"ARRAY":n.type="array";break;default:n.type=typeof e.type=="string"?e.type.toLowerCase():e.type}if(e.description&&(n.description=e.description),e.enum&&(n.enum=e.enum),e.properties){n.properties={};for(let[r,i]of Object.entries(e.properties))n.properties[r]=this.convertSchemaToJsonSchema(i)}return e.items&&(n.items=this.convertSchemaToJsonSchema(e.items)),e.required&&(n.required=e.required),n.type==="object"&&!("additionalProperties"in n)&&(n.additionalProperties=!1),n}}});function DFn(t){return t.replace(/([a-z])([A-Z])/g,"$1_$2").toUpperCase()}function oS(t){let e=DFn(t),n=`IFLOW_${t}`;if(process.env[n])return process.env[n];let r=`IFLOW_${e}`;if(process.env[r])return process.env[r];let i=`iflow_${t}`;if(process.env[i])return process.env[i];let o=`iflow_${e}`;if(process.env[o])return process.env[o]}function oG(){return oS("apiKey")}function sG(){return oS("baseUrl")||oS("url")}function aG(){return oS("modelName")||oS("model")}function eat(t){let e=oS(t);if(e===void 0)return;let n=e.toLowerCase();if(n==="true"||n==="1"||n==="yes")return!0;if(n==="false"||n==="0"||n==="no")return!1}function tat(t){let e=oS(t);if(e===void 0)return;let n=Number(e);return isNaN(n)?void 0:n}function nat(t){let e=oS(t);if(e!==void 0)return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function OZ(){return!!(oG()||sG()||aG())}function MSe(){let t={},e=["theme","selectedAuthType","sandbox","toolDiscoveryCommand","toolCallCommand","mcpServerCommand","contextFileName","preferredEditor","apiKey","baseUrl","modelName","searchApiKey","multimodalModelName","memoryImportFormat"],n=["useExternalAuth","showMemoryUsage","usageStatisticsEnabled","autoConfigureMaxOldSpaceSize","hideWindowTitle","hideTips","hideBanner","vimMode","ideModeFeature","ideMode","disableAutoUpdate"],r=["maxSessionTurns","memoryDiscoveryMaxDirs"],i=["coreTools","excludeTools","allowMCPServers","excludeMCPServers"];return e.forEach(o=>{let s=oS(o);s!==void 0&&(t[o]=s)}),n.forEach(o=>{let s=eat(o);s!==void 0&&(t[o]=s)}),r.forEach(o=>{let s=tat(o);s!==void 0&&(t[o]=s)}),i.forEach(o=>{let s=nat(o);s!==void 0&&(t[o]=s)}),t}function SFn(){return{apiKey:oG(),baseUrl:sG(),model:aG()}}var FSe=Le(()=>{"use strict";});function LSe(t,e,n){let r=process.env.GEMINI_API_KEY,i=process.env.GOOGLE_API_KEY,o=process.env.GOOGLE_CLOUD_PROJECT,s=process.env.GOOGLE_CLOUD_LOCATION,a=oG(),l=sG(),u=aG(),c=n?.apiKey||a,d=n?.baseUrl||l||_Fn[e],h=t.getModel()||u||wh,m={model:h,authType:e,proxy:t?.getProxy(),multimodalModelName:n?.multimodalModelName,debugMode:t?.getDebugMode()};return e===Sn.LOGIN_WITH_GOOGLE||e===Sn.CLOUD_SHELL?m:e===Sn.USE_GEMINI&&r?(m.apiKey=r,m.vertexai=!1,Vst(m.apiKey,m.model,m.proxy),m):e===Sn.USE_VERTEX_AI&&(i||o&&s)?(m.apiKey=i,m.vertexai=!0,m):([...Vf,Sn.OPENAI_COMPATIBLE].includes(e)&&c&&(m.apiKey=c,m.baseUrl=d,m.model=h),m)}async function PSe(t,e,n){let i={headers:{"User-Agent":`iFlowCLI/0.2.0-beta.0 (${process.platform}; ${process.arch})`}};if(t.authType&&[...Vf,Sn.IDEA_LAB].includes(t.authType)||t.authType===Sn.OPENAI_COMPATIBLE)return new NZ(t);if(t.authType===Sn.LOGIN_WITH_GOOGLE||t.authType===Sn.CLOUD_SHELL)return k1e(i,t.authType,e,n);if([...Vf,Sn.OPENAI_COMPATIBLE].includes(t.authType)||t.authType===Sn.USE_GEMINI||t.authType===Sn.USE_VERTEX_AI)return new cK({apiKey:t.apiKey===""?void 0:t.apiKey,vertexai:t.vertexai,httpOptions:i}).models;throw new Error(`Error creating contentGenerator: Unsupported authType: ${t.authType}`)}var Sn,Vf,_Fn,$I=Le(()=>{"use strict";nl();U1e();SC();$st();Zst();FSe();(function(t){t.LOGIN_WITH_GOOGLE="oauth-personal",t.USE_GEMINI="gemini-api-key",t.USE_VERTEX_AI="vertex-ai",t.CLOUD_SHELL="cloud-shell",t.IFLOW="iflow",t.IDEA_LAB="idealab",t.OPENAI_COMPATIBLE="openai-compatible"})(Sn||(Sn={}));Vf=[Sn.IFLOW,Sn.IDEA_LAB],_Fn={[Sn.IDEA_LAB]:"https://idealab.alibaba-inc.com/api/openai/v1",[Sn.IFLOW]:HXe}});var MZ,rat=Le(()=>{"use strict";MZ=class{prompts=new Map;registerPrompt(e){if(this.prompts.has(e.name)){let n=`${e.serverName}_${e.name}`;console.warn(`Prompt with name "${e.name}" is already registered. Renaming to "${n}".`),this.prompts.set(n,{...e,name:n})}else this.prompts.set(e.name,e)}getAllPrompts(){return Array.from(this.prompts.values()).sort((e,n)=>e.name.localeCompare(n.name))}getPrompt(e){return this.prompts.get(e)}getPromptsByServer(e){let n=[];for(let r of this.prompts.values())r.serverName===e&&n.push(r);return n.sort((r,i)=>r.name.localeCompare(i.name))}}});var Io,Rr,To,fc=Le(()=>{"use strict";Io=class{name;displayName;description;icon;parameterSchema;isOutputMarkdown;canUpdateOutput;aliases;constructor(e,n,r,i,o,s=!0,a=!1,l=[]){this.name=e,this.displayName=n,this.description=r,this.icon=i,this.parameterSchema=o,this.isOutputMarkdown=s,this.canUpdateOutput=a,this.aliases=l}get schema(){return{name:this.name,description:this.description,parameters:this.parameterSchema}}validateToolParams(e){return null}getDescription(e){return JSON.stringify(e)}shouldConfirmExecute(e,n){return Promise.resolve(!1)}toolLocations(e){return[]}};(function(t){t.ProceedOnce="proceed_once",t.ProceedAlways="proceed_always",t.ProceedAlwaysServer="proceed_always_server",t.ProceedAlwaysTool="proceed_always_tool",t.ModifyWithEditor="modify_with_editor",t.Cancel="cancel"})(Rr||(Rr={}));(function(t){t.FileSearch="fileSearch",t.Folder="folder",t.Globe="globe",t.Hammer="hammer",t.LightBulb="lightBulb",t.Pencil="pencil",t.Regex="regex",t.Terminal="terminal"})(To||(To={}))});var os,QSe,Gn,sS,lG=Le(()=>{(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(os||(os={}));(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(QSe||(QSe={}));Gn=os.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),sS=t=>{switch(typeof t){case"undefined":return Gn.undefined;case"string":return Gn.string;case"number":return Number.isNaN(t)?Gn.nan:Gn.number;case"boolean":return Gn.boolean;case"function":return Gn.function;case"bigint":return Gn.bigint;case"symbol":return Gn.symbol;case"object":return Array.isArray(t)?Gn.array:t===null?Gn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Gn.promise:typeof Map<"u"&&t instanceof Map?Gn.map:typeof Set<"u"&&t instanceof Set?Gn.set:typeof Date<"u"&&t instanceof Date?Gn.date:Gn.object;default:return Gn.unknown}}});var ln,IFn,sg,FZ=Le(()=>{lG();ln=os.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"]),IFn=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),sg=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){let u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return i(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,os.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];n[o]=n[o]||[],n[o].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};sg.create=t=>new sg(t)});var TFn,u2,kSe=Le(()=>{FZ();lG();TFn=(t,e)=>{let n;switch(t.code){case ln.invalid_type:t.received===Gn.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ln.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,os.jsonStringifyReplacer)}`;break;case ln.unrecognized_keys:n=`Unrecognized key(s) in object: ${os.joinValues(t.keys,", ")}`;break;case ln.invalid_union:n="Invalid input";break;case ln.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${os.joinValues(t.options)}`;break;case ln.invalid_enum_value:n=`Invalid enum value. Expected ${os.joinValues(t.options)}, received '${t.received}'`;break;case ln.invalid_arguments:n="Invalid function arguments";break;case ln.invalid_return_type:n="Invalid function return type";break;case ln.invalid_date:n="Invalid date";break;case ln.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:os.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ln.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ln.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ln.custom:n="Invalid input";break;case ln.invalid_intersection_types:n="Intersection results could not be merged";break;case ln.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ln.not_finite:n="Number must be finite";break;default:n=e.defaultError,os.assertNever(t)}return{message:n}},u2=TFn});function bFn(t){iat=t}function H8(){return iat}var iat,LZ=Le(()=>{kSe();iat=u2});function Nn(t,e){let n=H8(),r=uG({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===u2?void 0:u2].filter(i=>!!i)});t.common.issues.push(r)}var uG,xFn,Hp,pi,vN,Mh,PZ,QZ,sx,q8,USe=Le(()=>{LZ();kSe();uG=t=>{let{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",l=r.filter(u=>!!u).slice().reverse();for(let u of l)a=u(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},xFn=[];Hp=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let i of n){if(i.status==="aborted")return pi;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let i of n){let o=await i.key,s=await i.value;r.push({key:o,value:s})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let i of n){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return pi;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:e.value,value:r}}},pi=Object.freeze({status:"aborted"}),vN=t=>({status:"dirty",value:t}),Mh=t=>({status:"valid",value:t}),PZ=t=>t.status==="aborted",QZ=t=>t.status==="dirty",sx=t=>t.status==="valid",q8=t=>typeof Promise<"u"&&t instanceof Promise});var oat=Le(()=>{});var Dr,sat=Le(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Dr||(Dr={}))});function Co(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:i}}function cat(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function $Fn(t){return new RegExp(`^${cat(t)}$`)}function dat(t){let e=`${uat}T${cat(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function YFn(t,e){return!!((e==="v4"||!e)&&QFn.test(t)||(e==="v6"||!e)&&UFn.test(t))}function jFn(t,e){if(!MFn.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function WFn(t,e){return!!((e==="v4"||!e)&&kFn.test(t)||(e==="v6"||!e)&&GFn.test(t))}function zFn(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}function V8(t){if(t instanceof ag){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Sy.create(V8(r))}return new ag({...t._def,shape:()=>e})}else return t instanceof f2?new f2({...t._def,type:V8(t.element)}):t instanceof Sy?Sy.create(V8(t.unwrap())):t instanceof lS?lS.create(V8(t.unwrap())):t instanceof aS?aS.create(t.items.map(e=>V8(e))):t}function HSe(t,e){let n=sS(t),r=sS(e);if(t===e)return{valid:!0,data:t};if(n===Gn.object&&r===Gn.object){let i=os.objectKeys(e),o=os.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let l=HSe(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===Gn.array&&r===Gn.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],l=HSe(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Gn.date&&r===Gn.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function fat(t,e){return new NN({values:t,typeName:Si.ZodEnum,...Co(e)})}function lat(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function pat(t,e={},n){return t?lx.create().superRefine((r,i)=>{let o=t(r);if(o instanceof Promise)return o.then(s=>{if(!s){let a=lat(e,r),l=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:l})}});if(!o){let s=lat(e,r),a=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:a})}}):lx.create()}var _y,aat,Po,wFn,RFn,BFn,NFn,OFn,MFn,FFn,LFn,PFn,GSe,QFn,kFn,UFn,GFn,HFn,qFn,uat,VFn,ax,DN,SN,_N,IN,$8,TN,bN,lx,d2,NC,Y8,f2,ag,xN,c2,kZ,wN,aS,UZ,j8,W8,GZ,RN,BN,NN,ON,ux,Iy,Sy,lS,MN,FN,z8,JFn,cG,dG,LN,KFn,Si,XFn,hat,mat,ZFn,e8n,Aat,t8n,n8n,r8n,i8n,o8n,s8n,a8n,l8n,u8n,c8n,d8n,f8n,p8n,h8n,m8n,A8n,g8n,E8n,y8n,C8n,v8n,D8n,S8n,_8n,I8n,T8n,b8n,x8n,w8n,R8n,B8n,N8n,O8n,M8n,gat=Le(()=>{FZ();LZ();sat();USe();lG();_y=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}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}},aat=(t,e)=>{if(sx(e))return{success:!0,data:e.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;let n=new sg(t.common.issues);return this._error=n,this._error}}};Po=class{get description(){return this._def.description}_getType(e){return sS(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:sS(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Hp,ctx:{common:e.parent.common,data:e.data,parsedType:sS(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(q8(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sS(e)},i=this._parseSync({data:e,path:r.path,parent:r});return aat(r,i)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sS(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return sx(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>sx(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sS(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(q8(i)?i:Promise.resolve(i));return aat(r,o)}refine(e,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:ln.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Iy({schema:this,typeName:Si.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Sy.create(this,this._def)}nullable(){return lS.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return f2.create(this)}promise(){return ux.create(this,this._def)}or(e){return xN.create([this,e],this._def)}and(e){return wN.create(this,e,this._def)}transform(e){return new Iy({...Co(this._def),schema:this,typeName:Si.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new MN({...Co(this._def),innerType:this,defaultValue:n,typeName:Si.ZodDefault})}brand(){return new cG({typeName:Si.ZodBranded,type:this,...Co(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new FN({...Co(this._def),innerType:this,catchValue:n,typeName:Si.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return dG.create(this,e)}readonly(){return LN.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},wFn=/^c[^\s-]{8,}$/i,RFn=/^[0-9a-z]+$/,BFn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,NFn=/^[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,OFn=/^[a-z0-9_-]{21}$/i,MFn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,FFn=/^[-+]?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)?)??$/,LFn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PFn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",QFn=/^(?:(?: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])$/,kFn=/^(?:(?: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])$/,UFn=/^(([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]))$/,GFn=/^(([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])$/,HFn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qFn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,uat="((\\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])))",VFn=new RegExp(`^${uat}$`);ax=class t extends Po{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Gn.string){let o=this._getOrReturnCtx(e);return Nn(o,{code:ln.invalid_type,expected:Gn.string,received:o.parsedType}),pi}let r=new Hp,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?Nn(i,{code:ln.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Nn(i,{code:ln.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")LFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"email",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")GSe||(GSe=new RegExp(PFn,"u")),GSe.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"emoji",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")NFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"uuid",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")OFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"nanoid",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")wFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"cuid",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")RFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"cuid2",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")BFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"ulid",code:ln.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Nn(i,{validation:"url",code:ln.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"regex",code:ln.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?dat(o).test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?VFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?$Fn(o).test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?FFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"duration",code:ln.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?YFn(e.data,o.version)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"ip",code:ln.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?jFn(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"jwt",code:ln.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?WFn(e.data,o.version)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"cidr",code:ln.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?HFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"base64",code:ln.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?qFn.test(e.data)||(i=this._getOrReturnCtx(e,i),Nn(i,{validation:"base64url",code:ln.invalid_string,message:o.message}),r.dirty()):os.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:ln.invalid_string,...Dr.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Dr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Dr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Dr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Dr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Dr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Dr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Dr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Dr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Dr.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Dr.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Dr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Dr.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Dr.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Dr.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Dr.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Dr.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Dr.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Dr.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Dr.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Dr.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Dr.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Dr.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Dr.errToObj(n)})}nonempty(e){return this.min(1,Dr.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ax.create=t=>new ax({checks:[],typeName:Si.ZodString,coerce:t?.coerce??!1,...Co(t)});DN=class t extends Po{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Gn.number){let o=this._getOrReturnCtx(e);return Nn(o,{code:ln.invalid_type,expected:Gn.number,received:o.parsedType}),pi}let r,i=new Hp;for(let o of this._def.checks)o.kind==="int"?os.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?zFn(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.not_finite,message:o.message}),i.dirty()):os.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Dr.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Dr.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Dr.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Dr.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Dr.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Dr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Dr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Dr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Dr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Dr.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Dr.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Dr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Dr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Dr.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&os.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};DN.create=t=>new DN({checks:[],typeName:Si.ZodNumber,coerce:t?.coerce||!1,...Co(t)});SN=class t extends Po{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Gn.bigint)return this._getInvalidInput(e);let r,i=new Hp;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Nn(r,{code:ln.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):os.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return Nn(n,{code:ln.invalid_type,expected:Gn.bigint,received:n.parsedType}),pi}gte(e,n){return this.setLimit("min",e,!0,Dr.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Dr.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Dr.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Dr.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Dr.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Dr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Dr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Dr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Dr.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Dr.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};SN.create=t=>new SN({checks:[],typeName:Si.ZodBigInt,coerce:t?.coerce??!1,...Co(t)});_N=class extends Po{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Gn.boolean){let r=this._getOrReturnCtx(e);return Nn(r,{code:ln.invalid_type,expected:Gn.boolean,received:r.parsedType}),pi}return Mh(e.data)}};_N.create=t=>new _N({typeName:Si.ZodBoolean,coerce:t?.coerce||!1,...Co(t)});IN=class t extends Po{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Gn.date){let o=this._getOrReturnCtx(e);return Nn(o,{code:ln.invalid_type,expected:Gn.date,received:o.parsedType}),pi}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return Nn(o,{code:ln.invalid_date}),pi}let r=new Hp,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),Nn(i,{code:ln.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):os.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Dr.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Dr.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};IN.create=t=>new IN({checks:[],coerce:t?.coerce||!1,typeName:Si.ZodDate,...Co(t)});$8=class extends Po{_parse(e){if(this._getType(e)!==Gn.symbol){let r=this._getOrReturnCtx(e);return Nn(r,{code:ln.invalid_type,expected:Gn.symbol,received:r.parsedType}),pi}return Mh(e.data)}};$8.create=t=>new $8({typeName:Si.ZodSymbol,...Co(t)});TN=class extends Po{_parse(e){if(this._getType(e)!==Gn.undefined){let r=this._getOrReturnCtx(e);return Nn(r,{code:ln.invalid_type,expected:Gn.undefined,received:r.parsedType}),pi}return Mh(e.data)}};TN.create=t=>new TN({typeName:Si.ZodUndefined,...Co(t)});bN=class extends Po{_parse(e){if(this._getType(e)!==Gn.null){let r=this._getOrReturnCtx(e);return Nn(r,{code:ln.invalid_type,expected:Gn.null,received:r.parsedType}),pi}return Mh(e.data)}};bN.create=t=>new bN({typeName:Si.ZodNull,...Co(t)});lx=class extends Po{constructor(){super(...arguments),this._any=!0}_parse(e){return Mh(e.data)}};lx.create=t=>new lx({typeName:Si.ZodAny,...Co(t)});d2=class extends Po{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Mh(e.data)}};d2.create=t=>new d2({typeName:Si.ZodUnknown,...Co(t)});NC=class extends Po{_parse(e){let n=this._getOrReturnCtx(e);return Nn(n,{code:ln.invalid_type,expected:Gn.never,received:n.parsedType}),pi}};NC.create=t=>new NC({typeName:Si.ZodNever,...Co(t)});Y8=class extends Po{_parse(e){if(this._getType(e)!==Gn.undefined){let r=this._getOrReturnCtx(e);return Nn(r,{code:ln.invalid_type,expected:Gn.void,received:r.parsedType}),pi}return Mh(e.data)}};Y8.create=t=>new Y8({typeName:Si.ZodVoid,...Co(t)});f2=class t extends Po{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Gn.array)return Nn(n,{code:ln.invalid_type,expected:Gn.array,received:n.parsedType}),pi;if(i.exactLength!==null){let s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Nn(n,{code:s?ln.too_big:ln.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Nn(n,{code:ln.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Nn(n,{code:ln.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new _y(n,s,n.path,a)))).then(s=>Hp.mergeArray(r,s));let o=[...n.data].map((s,a)=>i.type._parseSync(new _y(n,s,n.path,a)));return Hp.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:Dr.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:Dr.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:Dr.toString(n)}})}nonempty(e){return this.min(1,e)}};f2.create=(t,e)=>new f2({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Si.ZodArray,...Co(e)});ag=class t extends Po{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=os.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Gn.object){let u=this._getOrReturnCtx(e);return Nn(u,{code:ln.invalid_type,expected:Gn.object,received:u.parsedType}),pi}let{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof NC&&this._def.unknownKeys==="strip"))for(let u in i.data)s.includes(u)||a.push(u);let l=[];for(let u of s){let c=o[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new _y(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof NC){let u=this._def.unknownKeys;if(u==="passthrough")for(let c of a)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")a.length>0&&(Nn(i,{code:ln.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let c of a){let d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new _y(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let c of l){let d=await c.key,h=await c.value;u.push({key:d,value:h,alwaysSet:c.alwaysSet})}return u}).then(u=>Hp.mergeObjectSync(r,u)):Hp.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Dr.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Dr.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Si.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of os.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of os.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return V8(this)}partial(e){let n={};for(let r of os.objectKeys(this.shape)){let i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of os.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Sy;)o=o._def.innerType;n[r]=o}return new t({...this._def,shape:()=>n})}keyof(){return fat(os.objectKeys(this.shape))}};ag.create=(t,e)=>new ag({shape:()=>t,unknownKeys:"strip",catchall:NC.create(),typeName:Si.ZodObject,...Co(e)});ag.strictCreate=(t,e)=>new ag({shape:()=>t,unknownKeys:"strict",catchall:NC.create(),typeName:Si.ZodObject,...Co(e)});ag.lazycreate=(t,e)=>new ag({shape:t,unknownKeys:"strip",catchall:NC.create(),typeName:Si.ZodObject,...Co(e)});xN=class extends Po{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new sg(a.ctx.common.issues));return Nn(n,{code:ln.invalid_union,unionErrors:s}),pi}if(n.common.async)return Promise.all(r.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let l of r){let u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(l=>new sg(l));return Nn(n,{code:ln.invalid_union,unionErrors:a}),pi}}get options(){return this._def.options}};xN.create=(t,e)=>new xN({options:t,typeName:Si.ZodUnion,...Co(e)});c2=t=>t instanceof RN?c2(t.schema):t instanceof Iy?c2(t.innerType()):t instanceof BN?[t.value]:t instanceof NN?t.options:t instanceof ON?os.objectValues(t.enum):t instanceof MN?c2(t._def.innerType):t instanceof TN?[void 0]:t instanceof bN?[null]:t instanceof Sy?[void 0,...c2(t.unwrap())]:t instanceof lS?[null,...c2(t.unwrap())]:t instanceof cG||t instanceof LN?c2(t.unwrap()):t instanceof FN?c2(t._def.innerType):[],kZ=class t extends Po{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Gn.object)return Nn(n,{code:ln.invalid_type,expected:Gn.object,received:n.parsedType}),pi;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Nn(n,{code:ln.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),pi)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let i=new Map;for(let o of n){let s=c2(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:Si.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Co(r)})}};wN=class extends Po{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=(o,s)=>{if(PZ(o)||PZ(s))return pi;let a=HSe(o.value,s.value);return a.valid?((QZ(o)||QZ(s))&&n.dirty(),{status:n.value,value:a.data}):(Nn(r,{code:ln.invalid_intersection_types}),pi)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};wN.create=(t,e,n)=>new wN({left:t,right:e,typeName:Si.ZodIntersection,...Co(n)});aS=class t extends Po{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Gn.array)return Nn(r,{code:ln.invalid_type,expected:Gn.array,received:r.parsedType}),pi;if(r.data.length<this._def.items.length)return Nn(r,{code:ln.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pi;!this._def.rest&&r.data.length>this._def.items.length&&(Nn(r,{code:ln.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...r.data].map((s,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new _y(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Hp.mergeArray(n,s)):Hp.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};aS.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new aS({items:t,typeName:Si.ZodTuple,rest:null,...Co(e)})};UZ=class t extends Po{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Gn.object)return Nn(r,{code:ln.invalid_type,expected:Gn.object,received:r.parsedType}),pi;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in r.data)i.push({key:o._parse(new _y(r,a,r.path,a)),value:s._parse(new _y(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Hp.mergeObjectAsync(n,i):Hp.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Po?new t({keyType:e,valueType:n,typeName:Si.ZodRecord,...Co(r)}):new t({keyType:ax.create(),valueType:e,typeName:Si.ZodRecord,...Co(n)})}},j8=class extends Po{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Gn.map)return Nn(r,{code:ln.invalid_type,expected:Gn.map,received:r.parsedType}),pi;let i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],u)=>({key:i._parse(new _y(r,a,r.path,[u,"key"])),value:o._parse(new _y(r,l,r.path,[u,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return pi;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let l of s){let u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return pi;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}};j8.create=(t,e,n)=>new j8({valueType:e,keyType:t,typeName:Si.ZodMap,...Co(n)});W8=class t extends Po{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Gn.set)return Nn(r,{code:ln.invalid_type,expected:Gn.set,received:r.parsedType}),pi;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Nn(r,{code:ln.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Nn(r,{code:ln.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function s(l){let u=new Set;for(let c of l){if(c.status==="aborted")return pi;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}let a=[...r.data.values()].map((l,u)=>o._parse(new _y(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:Dr.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:Dr.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};W8.create=(t,e)=>new W8({valueType:t,minSize:null,maxSize:null,typeName:Si.ZodSet,...Co(e)});GZ=class t extends Po{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Gn.function)return Nn(n,{code:ln.invalid_type,expected:Gn.function,received:n.parsedType}),pi;function r(a,l){return uG({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,H8(),u2].filter(u=>!!u),issueData:{code:ln.invalid_arguments,argumentsError:l}})}function i(a,l){return uG({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,H8(),u2].filter(u=>!!u),issueData:{code:ln.invalid_return_type,returnTypeError:l}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof ux){let a=this;return Mh(async function(...l){let u=new sg([]),c=await a._def.args.parseAsync(l,o).catch(m=>{throw u.addIssue(r(l,m)),u}),d=await Reflect.apply(s,this,c);return await a._def.returns._def.type.parseAsync(d,o).catch(m=>{throw u.addIssue(i(d,m)),u})})}else{let a=this;return Mh(function(...l){let u=a._def.args.safeParse(l,o);if(!u.success)throw new sg([r(l,u.error)]);let c=Reflect.apply(s,this,u.data),d=a._def.returns.safeParse(c,o);if(!d.success)throw new sg([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:aS.create(e).rest(d2.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||aS.create([]).rest(d2.create()),returns:n||d2.create(),typeName:Si.ZodFunction,...Co(r)})}},RN=class extends Po{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};RN.create=(t,e)=>new RN({getter:t,typeName:Si.ZodLazy,...Co(e)});BN=class extends Po{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return Nn(n,{received:n.data,code:ln.invalid_literal,expected:this._def.value}),pi}return{status:"valid",value:e.data}}get value(){return this._def.value}};BN.create=(t,e)=>new BN({value:t,typeName:Si.ZodLiteral,...Co(e)});NN=class t extends Po{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return Nn(n,{expected:os.joinValues(r),received:n.parsedType,code:ln.invalid_type}),pi}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return Nn(n,{received:n.data,code:ln.invalid_enum_value,options:r}),pi}return Mh(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};NN.create=fat;ON=class extends Po{_parse(e){let n=os.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Gn.string&&r.parsedType!==Gn.number){let i=os.objectValues(n);return Nn(r,{expected:os.joinValues(i),received:r.parsedType,code:ln.invalid_type}),pi}if(this._cache||(this._cache=new Set(os.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=os.objectValues(n);return Nn(r,{received:r.data,code:ln.invalid_enum_value,options:i}),pi}return Mh(e.data)}get enum(){return this._def.values}};ON.create=(t,e)=>new ON({values:t,typeName:Si.ZodNativeEnum,...Co(e)});ux=class extends Po{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Gn.promise&&n.common.async===!1)return Nn(n,{code:ln.invalid_type,expected:Gn.promise,received:n.parsedType}),pi;let r=n.parsedType===Gn.promise?n.data:Promise.resolve(n.data);return Mh(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};ux.create=(t,e)=>new ux({type:t,typeName:Si.ZodPromise,...Co(e)});Iy=class extends Po{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Si.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{Nn(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return pi;let l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?pi:l.status==="dirty"?vN(l.value):n.value==="dirty"?vN(l.value):l});{if(n.value==="aborted")return pi;let a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?pi:a.status==="dirty"?vN(a.value):n.value==="dirty"?vN(a.value):a}}if(i.type==="refinement"){let s=a=>{let l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?pi:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?pi:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!sx(s))return pi;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>sx(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):pi);os.assertNever(i)}};Iy.create=(t,e,n)=>new Iy({schema:t,typeName:Si.ZodEffects,effect:e,...Co(n)});Iy.createWithPreprocess=(t,e,n)=>new Iy({schema:e,effect:{type:"preprocess",transform:t},typeName:Si.ZodEffects,...Co(n)});Sy=class extends Po{_parse(e){return this._getType(e)===Gn.undefined?Mh(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Sy.create=(t,e)=>new Sy({innerType:t,typeName:Si.ZodOptional,...Co(e)});lS=class extends Po{_parse(e){return this._getType(e)===Gn.null?Mh(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};lS.create=(t,e)=>new lS({innerType:t,typeName:Si.ZodNullable,...Co(e)});MN=class extends Po{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===Gn.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};MN.create=(t,e)=>new MN({innerType:t,typeName:Si.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Co(e)});FN=class extends Po{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return q8(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new sg(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new sg(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};FN.create=(t,e)=>new FN({innerType:t,typeName:Si.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Co(e)});z8=class extends Po{_parse(e){if(this._getType(e)!==Gn.nan){let r=this._getOrReturnCtx(e);return Nn(r,{code:ln.invalid_type,expected:Gn.nan,received:r.parsedType}),pi}return{status:"valid",value:e.data}}};z8.create=t=>new z8({typeName:Si.ZodNaN,...Co(t)});JFn=Symbol("zod_brand"),cG=class extends Po{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},dG=class t extends Po{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?pi:o.status==="dirty"?(n.dirty(),vN(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?pi:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:Si.ZodPipeline})}},LN=class extends Po{_parse(e){let n=this._def.innerType._parse(e),r=i=>(sx(i)&&(i.value=Object.freeze(i.value)),i);return q8(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};LN.create=(t,e)=>new LN({innerType:t,typeName:Si.ZodReadonly,...Co(e)});KFn={object:ag.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"})(Si||(Si={}));XFn=(t,e={message:`Input not instance of ${t.name}`})=>pat(n=>n instanceof t,e),hat=ax.create,mat=DN.create,ZFn=z8.create,e8n=SN.create,Aat=_N.create,t8n=IN.create,n8n=$8.create,r8n=TN.create,i8n=bN.create,o8n=lx.create,s8n=d2.create,a8n=NC.create,l8n=Y8.create,u8n=f2.create,c8n=ag.create,d8n=ag.strictCreate,f8n=xN.create,p8n=kZ.create,h8n=wN.create,m8n=aS.create,A8n=UZ.create,g8n=j8.create,E8n=W8.create,y8n=GZ.create,C8n=RN.create,v8n=BN.create,D8n=NN.create,S8n=ON.create,_8n=ux.create,I8n=Iy.create,T8n=Sy.create,b8n=lS.create,x8n=Iy.createWithPreprocess,w8n=dG.create,R8n=()=>hat().optional(),B8n=()=>mat().optional(),N8n=()=>Aat().optional(),O8n={string:t=>ax.create({...t,coerce:!0}),number:t=>DN.create({...t,coerce:!0}),boolean:t=>_N.create({...t,coerce:!0}),bigint:t=>SN.create({...t,coerce:!0}),date:t=>IN.create({...t,coerce:!0})},M8n=pi});var ve={};h0(ve,{BRAND:()=>JFn,DIRTY:()=>vN,EMPTY_PATH:()=>xFn,INVALID:()=>pi,NEVER:()=>M8n,OK:()=>Mh,ParseStatus:()=>Hp,Schema:()=>Po,ZodAny:()=>lx,ZodArray:()=>f2,ZodBigInt:()=>SN,ZodBoolean:()=>_N,ZodBranded:()=>cG,ZodCatch:()=>FN,ZodDate:()=>IN,ZodDefault:()=>MN,ZodDiscriminatedUnion:()=>kZ,ZodEffects:()=>Iy,ZodEnum:()=>NN,ZodError:()=>sg,ZodFirstPartyTypeKind:()=>Si,ZodFunction:()=>GZ,ZodIntersection:()=>wN,ZodIssueCode:()=>ln,ZodLazy:()=>RN,ZodLiteral:()=>BN,ZodMap:()=>j8,ZodNaN:()=>z8,ZodNativeEnum:()=>ON,ZodNever:()=>NC,ZodNull:()=>bN,ZodNullable:()=>lS,ZodNumber:()=>DN,ZodObject:()=>ag,ZodOptional:()=>Sy,ZodParsedType:()=>Gn,ZodPipeline:()=>dG,ZodPromise:()=>ux,ZodReadonly:()=>LN,ZodRecord:()=>UZ,ZodSchema:()=>Po,ZodSet:()=>W8,ZodString:()=>ax,ZodSymbol:()=>$8,ZodTransformer:()=>Iy,ZodTuple:()=>aS,ZodType:()=>Po,ZodUndefined:()=>TN,ZodUnion:()=>xN,ZodUnknown:()=>d2,ZodVoid:()=>Y8,addIssueToContext:()=>Nn,any:()=>o8n,array:()=>u8n,bigint:()=>e8n,boolean:()=>Aat,coerce:()=>O8n,custom:()=>pat,date:()=>t8n,datetimeRegex:()=>dat,defaultErrorMap:()=>u2,discriminatedUnion:()=>p8n,effect:()=>I8n,enum:()=>D8n,function:()=>y8n,getErrorMap:()=>H8,getParsedType:()=>sS,instanceof:()=>XFn,intersection:()=>h8n,isAborted:()=>PZ,isAsync:()=>q8,isDirty:()=>QZ,isValid:()=>sx,late:()=>KFn,lazy:()=>C8n,literal:()=>v8n,makeIssue:()=>uG,map:()=>g8n,nan:()=>ZFn,nativeEnum:()=>S8n,never:()=>a8n,null:()=>i8n,nullable:()=>b8n,number:()=>mat,object:()=>c8n,objectUtil:()=>QSe,oboolean:()=>N8n,onumber:()=>B8n,optional:()=>T8n,ostring:()=>R8n,pipeline:()=>w8n,preprocess:()=>x8n,promise:()=>_8n,quotelessJson:()=>IFn,record:()=>A8n,set:()=>E8n,setErrorMap:()=>bFn,strictObject:()=>d8n,string:()=>hat,symbol:()=>n8n,transformer:()=>I8n,tuple:()=>m8n,undefined:()=>r8n,union:()=>f8n,unknown:()=>s8n,util:()=>os,void:()=>l8n});var qSe=Le(()=>{LZ();USe();oat();lG();gat();FZ()});var fG=Le(()=>{qSe();qSe()});var J8,Eat,HZ,yat,Cat,F8n,xy,lg,pG,uS,wy,qZ,vat,VZ,Dat,Sat,_at,hG,Ty,Iat,Tat,cx,PN,$Z,mG,bat,L8n,P8n,Q8n,VSe,xat,wat,YZ,k8n,jZ,WZ,zZ,Rat,Bat,Nat,Oat,U8n,G8n,$Se,H8n,YSe,q8n,jSe,V8n,$8n,Y8n,j8n,W8n,z8n,J8n,AG,K8n,WSe,zSe,JSe,X8n,Z8n,Mat,eLn,gG,tLn,nLn,rLn,iLn,KSe,JZ,jKr,oLn,sLn,Fat,aLn,lLn,uLn,cLn,dLn,fLn,pLn,hLn,mLn,ALn,gLn,ELn,yLn,CLn,vLn,DLn,SLn,XSe,_Ln,ILn,TLn,bLn,WKr,zKr,JKr,KKr,XKr,ZKr,by,dx=Le(()=>{fG();J8="2025-06-18",Eat=[J8,"2025-03-26","2024-11-05","2024-10-07"],HZ="2.0",yat=ve.union([ve.string(),ve.number().int()]),Cat=ve.string(),F8n=ve.object({progressToken:ve.optional(yat)}).passthrough(),xy=ve.object({_meta:ve.optional(F8n)}).passthrough(),lg=ve.object({method:ve.string(),params:ve.optional(xy)}),pG=ve.object({_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),uS=ve.object({method:ve.string(),params:ve.optional(pG)}),wy=ve.object({_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),qZ=ve.union([ve.string(),ve.number().int()]),vat=ve.object({jsonrpc:ve.literal(HZ),id:qZ}).merge(lg).strict(),VZ=t=>vat.safeParse(t).success,Dat=ve.object({jsonrpc:ve.literal(HZ)}).merge(uS).strict(),Sat=t=>Dat.safeParse(t).success,_at=ve.object({jsonrpc:ve.literal(HZ),id:qZ,result:wy}).strict(),hG=t=>_at.safeParse(t).success;(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"})(Ty||(Ty={}));Iat=ve.object({jsonrpc:ve.literal(HZ),id:qZ,error:ve.object({code:ve.number().int(),message:ve.string(),data:ve.optional(ve.unknown())})}).strict(),Tat=t=>Iat.safeParse(t).success,cx=ve.union([vat,Dat,_at,Iat]),PN=wy.strict(),$Z=uS.extend({method:ve.literal("notifications/cancelled"),params:pG.extend({requestId:qZ,reason:ve.string().optional()})}),mG=ve.object({name:ve.string(),title:ve.optional(ve.string())}).passthrough(),bat=mG.extend({version:ve.string()}),L8n=ve.object({experimental:ve.optional(ve.object({}).passthrough()),sampling:ve.optional(ve.object({}).passthrough()),elicitation:ve.optional(ve.object({}).passthrough()),roots:ve.optional(ve.object({listChanged:ve.optional(ve.boolean())}).passthrough())}).passthrough(),P8n=lg.extend({method:ve.literal("initialize"),params:xy.extend({protocolVersion:ve.string(),capabilities:L8n,clientInfo:bat})}),Q8n=ve.object({experimental:ve.optional(ve.object({}).passthrough()),logging:ve.optional(ve.object({}).passthrough()),completions:ve.optional(ve.object({}).passthrough()),prompts:ve.optional(ve.object({listChanged:ve.optional(ve.boolean())}).passthrough()),resources:ve.optional(ve.object({subscribe:ve.optional(ve.boolean()),listChanged:ve.optional(ve.boolean())}).passthrough()),tools:ve.optional(ve.object({listChanged:ve.optional(ve.boolean())}).passthrough())}).passthrough(),VSe=wy.extend({protocolVersion:ve.string(),capabilities:Q8n,serverInfo:bat,instructions:ve.optional(ve.string())}),xat=uS.extend({method:ve.literal("notifications/initialized")}),wat=t=>xat.safeParse(t).success,YZ=lg.extend({method:ve.literal("ping")}),k8n=ve.object({progress:ve.number(),total:ve.optional(ve.number()),message:ve.optional(ve.string())}).passthrough(),jZ=uS.extend({method:ve.literal("notifications/progress"),params:pG.merge(k8n).extend({progressToken:yat})}),WZ=lg.extend({params:xy.extend({cursor:ve.optional(Cat)}).optional()}),zZ=wy.extend({nextCursor:ve.optional(Cat)}),Rat=ve.object({uri:ve.string(),mimeType:ve.optional(ve.string()),_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),Bat=Rat.extend({text:ve.string()}),Nat=Rat.extend({blob:ve.string().base64()}),Oat=mG.extend({uri:ve.string(),description:ve.optional(ve.string()),mimeType:ve.optional(ve.string()),_meta:ve.optional(ve.object({}).passthrough())}),U8n=mG.extend({uriTemplate:ve.string(),description:ve.optional(ve.string()),mimeType:ve.optional(ve.string()),_meta:ve.optional(ve.object({}).passthrough())}),G8n=WZ.extend({method:ve.literal("resources/list")}),$Se=zZ.extend({resources:ve.array(Oat)}),H8n=WZ.extend({method:ve.literal("resources/templates/list")}),YSe=zZ.extend({resourceTemplates:ve.array(U8n)}),q8n=lg.extend({method:ve.literal("resources/read"),params:xy.extend({uri:ve.string()})}),jSe=wy.extend({contents:ve.array(ve.union([Bat,Nat]))}),V8n=uS.extend({method:ve.literal("notifications/resources/list_changed")}),$8n=lg.extend({method:ve.literal("resources/subscribe"),params:xy.extend({uri:ve.string()})}),Y8n=lg.extend({method:ve.literal("resources/unsubscribe"),params:xy.extend({uri:ve.string()})}),j8n=uS.extend({method:ve.literal("notifications/resources/updated"),params:pG.extend({uri:ve.string()})}),W8n=ve.object({name:ve.string(),description:ve.optional(ve.string()),required:ve.optional(ve.boolean())}).passthrough(),z8n=mG.extend({description:ve.optional(ve.string()),arguments:ve.optional(ve.array(W8n)),_meta:ve.optional(ve.object({}).passthrough())}),J8n=WZ.extend({method:ve.literal("prompts/list")}),AG=zZ.extend({prompts:ve.array(z8n)}),K8n=lg.extend({method:ve.literal("prompts/get"),params:xy.extend({name:ve.string(),arguments:ve.optional(ve.record(ve.string()))})}),WSe=ve.object({type:ve.literal("text"),text:ve.string(),_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),zSe=ve.object({type:ve.literal("image"),data:ve.string().base64(),mimeType:ve.string(),_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),JSe=ve.object({type:ve.literal("audio"),data:ve.string().base64(),mimeType:ve.string(),_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),X8n=ve.object({type:ve.literal("resource"),resource:ve.union([Bat,Nat]),_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),Z8n=Oat.extend({type:ve.literal("resource_link")}),Mat=ve.union([WSe,zSe,JSe,Z8n,X8n]),eLn=ve.object({role:ve.enum(["user","assistant"]),content:Mat}).passthrough(),gG=wy.extend({description:ve.optional(ve.string()),messages:ve.array(eLn)}),tLn=uS.extend({method:ve.literal("notifications/prompts/list_changed")}),nLn=ve.object({title:ve.optional(ve.string()),readOnlyHint:ve.optional(ve.boolean()),destructiveHint:ve.optional(ve.boolean()),idempotentHint:ve.optional(ve.boolean()),openWorldHint:ve.optional(ve.boolean())}).passthrough(),rLn=mG.extend({description:ve.optional(ve.string()),inputSchema:ve.object({type:ve.literal("object"),properties:ve.optional(ve.object({}).passthrough()),required:ve.optional(ve.array(ve.string()))}).passthrough(),outputSchema:ve.optional(ve.object({type:ve.literal("object"),properties:ve.optional(ve.object({}).passthrough()),required:ve.optional(ve.array(ve.string()))}).passthrough()),annotations:ve.optional(nLn),_meta:ve.optional(ve.object({}).passthrough())}),iLn=WZ.extend({method:ve.literal("tools/list")}),KSe=zZ.extend({tools:ve.array(rLn)}),JZ=wy.extend({content:ve.array(Mat).default([]),structuredContent:ve.object({}).passthrough().optional(),isError:ve.optional(ve.boolean())}),jKr=JZ.or(wy.extend({toolResult:ve.unknown()})),oLn=lg.extend({method:ve.literal("tools/call"),params:xy.extend({name:ve.string(),arguments:ve.optional(ve.record(ve.unknown()))})}),sLn=uS.extend({method:ve.literal("notifications/tools/list_changed")}),Fat=ve.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),aLn=lg.extend({method:ve.literal("logging/setLevel"),params:xy.extend({level:Fat})}),lLn=uS.extend({method:ve.literal("notifications/message"),params:pG.extend({level:Fat,logger:ve.optional(ve.string()),data:ve.unknown()})}),uLn=ve.object({name:ve.string().optional()}).passthrough(),cLn=ve.object({hints:ve.optional(ve.array(uLn)),costPriority:ve.optional(ve.number().min(0).max(1)),speedPriority:ve.optional(ve.number().min(0).max(1)),intelligencePriority:ve.optional(ve.number().min(0).max(1))}).passthrough(),dLn=ve.object({role:ve.enum(["user","assistant"]),content:ve.union([WSe,zSe,JSe])}).passthrough(),fLn=lg.extend({method:ve.literal("sampling/createMessage"),params:xy.extend({messages:ve.array(dLn),systemPrompt:ve.optional(ve.string()),includeContext:ve.optional(ve.enum(["none","thisServer","allServers"])),temperature:ve.optional(ve.number()),maxTokens:ve.number().int(),stopSequences:ve.optional(ve.array(ve.string())),metadata:ve.optional(ve.object({}).passthrough()),modelPreferences:ve.optional(cLn)})}),pLn=wy.extend({model:ve.string(),stopReason:ve.optional(ve.enum(["endTurn","stopSequence","maxTokens"]).or(ve.string())),role:ve.enum(["user","assistant"]),content:ve.discriminatedUnion("type",[WSe,zSe,JSe])}),hLn=ve.object({type:ve.literal("boolean"),title:ve.optional(ve.string()),description:ve.optional(ve.string()),default:ve.optional(ve.boolean())}).passthrough(),mLn=ve.object({type:ve.literal("string"),title:ve.optional(ve.string()),description:ve.optional(ve.string()),minLength:ve.optional(ve.number()),maxLength:ve.optional(ve.number()),format:ve.optional(ve.enum(["email","uri","date","date-time"]))}).passthrough(),ALn=ve.object({type:ve.enum(["number","integer"]),title:ve.optional(ve.string()),description:ve.optional(ve.string()),minimum:ve.optional(ve.number()),maximum:ve.optional(ve.number())}).passthrough(),gLn=ve.object({type:ve.literal("string"),title:ve.optional(ve.string()),description:ve.optional(ve.string()),enum:ve.array(ve.string()),enumNames:ve.optional(ve.array(ve.string()))}).passthrough(),ELn=ve.union([hLn,mLn,ALn,gLn]),yLn=lg.extend({method:ve.literal("elicitation/create"),params:xy.extend({message:ve.string(),requestedSchema:ve.object({type:ve.literal("object"),properties:ve.record(ve.string(),ELn),required:ve.optional(ve.array(ve.string()))}).passthrough()})}),CLn=wy.extend({action:ve.enum(["accept","decline","cancel"]),content:ve.optional(ve.record(ve.string(),ve.unknown()))}),vLn=ve.object({type:ve.literal("ref/resource"),uri:ve.string()}).passthrough(),DLn=ve.object({type:ve.literal("ref/prompt"),name:ve.string()}).passthrough(),SLn=lg.extend({method:ve.literal("completion/complete"),params:xy.extend({ref:ve.union([DLn,vLn]),argument:ve.object({name:ve.string(),value:ve.string()}).passthrough(),context:ve.optional(ve.object({arguments:ve.optional(ve.record(ve.string(),ve.string()))}))})}),XSe=wy.extend({completion:ve.object({values:ve.array(ve.string()).max(100),total:ve.optional(ve.number().int()),hasMore:ve.optional(ve.boolean())}).passthrough()}),_Ln=ve.object({uri:ve.string().startsWith("file://"),name:ve.optional(ve.string()),_meta:ve.optional(ve.object({}).passthrough())}).passthrough(),ILn=lg.extend({method:ve.literal("roots/list")}),TLn=wy.extend({roots:ve.array(_Ln)}),bLn=uS.extend({method:ve.literal("notifications/roots/list_changed")}),WKr=ve.union([YZ,P8n,SLn,aLn,K8n,J8n,G8n,H8n,q8n,$8n,Y8n,oLn,iLn]),zKr=ve.union([$Z,jZ,xat,bLn]),JKr=ve.union([PN,pLn,CLn,TLn]),KKr=ve.union([YZ,fLn,yLn,ILn]),XKr=ve.union([$Z,jZ,lLn,j8n,V8n,sLn,tLn]),ZKr=ve.union([PN,VSe,XSe,gG,AG,$Se,YSe,jSe,JZ,KSe]),by=class extends Error{constructor(e,n,r){super(`MCP error ${e}: ${n}`),this.code=e,this.data=r,this.name="McpError"}}});function Lat(t,e){return Object.entries(e).reduce((n,[r,i])=>(i&&typeof i=="object"?n[r]=n[r]?{...n[r],...i}:i:n[r]=i,n),{...t})}var xLn,KZ,Pat=Le(()=>{dx();xLn=6e4,KZ=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this.setNotificationHandler($Z,n=>{let r=this._requestHandlerAbortControllers.get(n.params.requestId);r?.abort(n.params.reason)}),this.setNotificationHandler(jZ,n=>{this._onprogress(n)}),this.setRequestHandler(YZ,n=>({}))}_setupTimeout(e,n,r,i,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,n),startTime:Date.now(),timeout:n,maxTotalTimeout:r,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(e){let n=this._timeoutInfo.get(e);if(!n)return!1;let r=Date.now()-n.startTime;if(n.maxTotalTimeout&&r>=n.maxTotalTimeout)throw this._timeoutInfo.delete(e),new by(Ty.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:r});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(e){let n=this._timeoutInfo.get(e);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var n,r,i;this._transport=e;let o=(n=this.transport)===null||n===void 0?void 0:n.onclose;this._transport.onclose=()=>{o?.(),this._onclose()};let s=(r=this.transport)===null||r===void 0?void 0:r.onerror;this._transport.onerror=l=>{s?.(l),this._onerror(l)};let a=(i=this._transport)===null||i===void 0?void 0:i.onmessage;this._transport.onmessage=(l,u)=>{a?.(l,u),hG(l)||Tat(l)?this._onresponse(l):VZ(l)?this._onrequest(l,u):Sat(l)?this._onnotification(l):this._onerror(new Error(`Unknown message type: ${JSON.stringify(l)}`))},await this._transport.start()}_onclose(){var e;let n=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);let r=new by(Ty.ConnectionClosed,"Connection closed");for(let i of n.values())i(r)}_onerror(e){var n;(n=this.onerror)===null||n===void 0||n.call(this,e)}_onnotification(e){var n;let r=(n=this._notificationHandlers.get(e.method))!==null&&n!==void 0?n:this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,n){var r,i,o,s;let a=(r=this._requestHandlers.get(e.method))!==null&&r!==void 0?r:this.fallbackRequestHandler;if(a===void 0){(i=this._transport)===null||i===void 0||i.send({jsonrpc:"2.0",id:e.id,error:{code:Ty.MethodNotFound,message:"Method not found"}}).catch(c=>this._onerror(new Error(`Failed to send an error response: ${c}`)));return}let l=new AbortController;this._requestHandlerAbortControllers.set(e.id,l);let u={signal:l.signal,sessionId:(o=this._transport)===null||o===void 0?void 0:o.sessionId,_meta:(s=e.params)===null||s===void 0?void 0:s._meta,sendNotification:c=>this.notification(c,{relatedRequestId:e.id}),sendRequest:(c,d,h)=>this.request(c,d,{...h,relatedRequestId:e.id}),authInfo:n?.authInfo,requestId:e.id,requestInfo:n?.requestInfo};Promise.resolve().then(()=>a(e,u)).then(c=>{var d;if(!l.signal.aborted)return(d=this._transport)===null||d===void 0?void 0:d.send({result:c,jsonrpc:"2.0",id:e.id})},c=>{var d,h;if(!l.signal.aborted)return(d=this._transport)===null||d===void 0?void 0:d.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(c.code)?c.code:Ty.InternalError,message:(h=c.message)!==null&&h!==void 0?h:"Internal error"}})}).catch(c=>this._onerror(new Error(`Failed to send response: ${c}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:n,...r}=e.params,i=Number(n),o=this._progressHandlers.get(i);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(l){s(l);return}o(r)}_onresponse(e){let n=Number(e.id),r=this._responseHandlers.get(n);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),hG(e))r(e);else{let i=new by(e.error.code,e.error.message,e.error.data);r(i)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,n,r){let{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}=r??{};return new Promise((a,l)=>{var u,c,d,h,m,E;if(!this._transport){l(new Error("Not connected"));return}((u=this._options)===null||u===void 0?void 0:u.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(c=r?.signal)===null||c===void 0||c.throwIfAborted();let y=this._requestMessageId++,C={...e,jsonrpc:"2.0",id:y};r?.onprogress&&(this._progressHandlers.set(y,r.onprogress),C.params={...e.params,_meta:{...((d=e.params)===null||d===void 0?void 0:d._meta)||{},progressToken:y}});let _=R=>{var F;this._responseHandlers.delete(y),this._progressHandlers.delete(y),this._cleanupTimeout(y),(F=this._transport)===null||F===void 0||F.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:y,reason:String(R)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(q=>this._onerror(new Error(`Failed to send cancellation: ${q}`))),l(R)};this._responseHandlers.set(y,R=>{var F;if(!(!((F=r?.signal)===null||F===void 0)&&F.aborted)){if(R instanceof Error)return l(R);try{let q=n.parse(R.result);a(q)}catch(q){l(q)}}}),(h=r?.signal)===null||h===void 0||h.addEventListener("abort",()=>{var R;_((R=r?.signal)===null||R===void 0?void 0:R.reason)});let w=(m=r?.timeout)!==null&&m!==void 0?m:xLn,B=()=>_(new by(Ty.RequestTimeout,"Request timed out",{timeout:w}));this._setupTimeout(y,w,r?.maxTotalTimeout,B,(E=r?.resetTimeoutOnProgress)!==null&&E!==void 0?E:!1),this._transport.send(C,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(R=>{this._cleanupTimeout(y),l(R)})})}async notification(e,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let r={...e,jsonrpc:"2.0"};await this._transport.send(r,n)}setRequestHandler(e,n){let r=e.shape.method.value;this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(i,o)=>Promise.resolve(n(e.parse(i),o)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,n){this._notificationHandlers.set(e.shape.method.value,r=>Promise.resolve(n(e.parse(r))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}});var kat=b((XZ,Qat)=>{(function(t,e){typeof XZ=="object"&&typeof Qat<"u"?e(XZ):typeof define=="function"&&define.amd?define(["exports"],e):e(t.URI=t.URI||{})})(XZ,function(t){"use strict";function e(){for(var Je=arguments.length,je=Array(Je),ut=0;ut<Je;ut++)je[ut]=arguments[ut];if(je.length>1){je[0]=je[0].slice(0,-1);for(var St=je.length-1,st=1;st<St;++st)je[st]=je[st].slice(1,-1);return je[St]=je[St].slice(1),je.join("")}else return je[0]}function n(Je){return"(?:"+Je+")"}function r(Je){return Je===void 0?"undefined":Je===null?"null":Object.prototype.toString.call(Je).split(" ").pop().split("]").shift().toLowerCase()}function i(Je){return Je.toUpperCase()}function o(Je){return Je!=null?Je instanceof Array?Je:typeof Je.length!="number"||Je.split||Je.setInterval||Je.call?[Je]:Array.prototype.slice.call(Je):[]}function s(Je,je){var ut=Je;if(je)for(var St in je)ut[St]=je[St];return ut}function a(Je){var je="[A-Za-z]",ut="[\\x0D]",St="[0-9]",st="[\\x22]",vn=e(St,"[A-Fa-f]"),Vn="[\\x0A]",li="[\\x20]",Ir=n(n("%[EFef]"+vn+"%"+vn+vn+"%"+vn+vn)+"|"+n("%[89A-Fa-f]"+vn+"%"+vn+vn)+"|"+n("%"+vn+vn)),As="[\\:\\/\\?\\#\\[\\]\\@]",Pi="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Bo=e(As,Pi),ks=Je?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",Cr=Je?"[\\uE000-\\uF8FF]":"[]",ni=e(je,St,"[\\-\\.\\_\\~]",ks),Do=n(je+e(je,St,"[\\+\\-\\.]")+"*"),No=n(n(Ir+"|"+e(ni,Pi,"[\\:]"))+"*"),Nu=n(n("25[0-5]")+"|"+n("2[0-4]"+St)+"|"+n("1"+St+St)+"|"+n("[1-9]"+St)+"|"+St),va=n(n("25[0-5]")+"|"+n("2[0-4]"+St)+"|"+n("1"+St+St)+"|"+n("0?[1-9]"+St)+"|0?0?"+St),Ks=n(va+"\\."+va+"\\."+va+"\\."+va),Ei=n(vn+"{1,4}"),fl=n(n(Ei+"\\:"+Ei)+"|"+Ks),ui=n(n(Ei+"\\:")+"{6}"+fl),ci=n("\\:\\:"+n(Ei+"\\:")+"{5}"+fl),Ou=n(n(Ei)+"?\\:\\:"+n(Ei+"\\:")+"{4}"+fl),Da=n(n(n(Ei+"\\:")+"{0,1}"+Ei)+"?\\:\\:"+n(Ei+"\\:")+"{3}"+fl),ho=n(n(n(Ei+"\\:")+"{0,2}"+Ei)+"?\\:\\:"+n(Ei+"\\:")+"{2}"+fl),Ic=n(n(n(Ei+"\\:")+"{0,3}"+Ei)+"?\\:\\:"+Ei+"\\:"+fl),ua=n(n(n(Ei+"\\:")+"{0,4}"+Ei)+"?\\:\\:"+fl),gs=n(n(n(Ei+"\\:")+"{0,5}"+Ei)+"?\\:\\:"+Ei),ja=n(n(n(Ei+"\\:")+"{0,6}"+Ei)+"?\\:\\:"),Be=n([ui,ci,Ou,Da,ho,Ic,ua,gs,ja].join("|")),Me=n(n(ni+"|"+Ir)+"+"),tt=n(Be+"\\%25"+Me),ct=n(Be+n("\\%25|\\%(?!"+vn+"{2})")+Me),Ct=n("[vV]"+vn+"+\\."+e(ni,Pi,"[\\:]")+"+"),Ft=n("\\["+n(ct+"|"+Be+"|"+Ct)+"\\]"),Jt=n(n(Ir+"|"+e(ni,Pi))+"*"),Vt=n(Ft+"|"+Ks+"(?!"+Jt+")|"+Jt),nn=n(St+"*"),en=n(n(No+"@")+"?"+Vt+n("\\:"+nn)+"?"),hn=n(Ir+"|"+e(ni,Pi,"[\\:\\@]")),sr=n(hn+"*"),Ii=n(hn+"+"),Us=n(n(Ir+"|"+e(ni,Pi,"[\\@]"))+"+"),hi=n(n("\\/"+sr)+"*"),La=n("\\/"+n(Ii+hi)+"?"),eu=n(Us+hi),ad=n(Ii+hi),Ts="(?!"+hn+")",hE=n(hi+"|"+La+"|"+eu+"|"+ad+"|"+Ts),Hd=n(n(hn+"|"+e("[\\/\\?]",Cr))+"*"),ld=n(n(hn+"|[\\/\\?]")+"*"),gm=n(n("\\/\\/"+en+hi)+"|"+La+"|"+ad+"|"+Ts),mE=n(Do+"\\:"+gm+n("\\?"+Hd)+"?"+n("\\#"+ld)+"?"),ph=n(n("\\/\\/"+en+hi)+"|"+La+"|"+eu+"|"+Ts),Wa=n(ph+n("\\?"+Hd)+"?"+n("\\#"+ld)+"?"),wA=n(mE+"|"+Wa),Ef=n(Do+"\\:"+gm+n("\\?"+Hd)+"?"),Em="^("+Do+")\\:"+n(n("\\/\\/("+n("("+No+")@")+"?("+Vt+")"+n("\\:("+nn+")")+"?)")+"?("+hi+"|"+La+"|"+ad+"|"+Ts+")")+n("\\?("+Hd+")")+"?"+n("\\#("+ld+")")+"?$",yf="^(){0}"+n(n("\\/\\/("+n("("+No+")@")+"?("+Vt+")"+n("\\:("+nn+")")+"?)")+"?("+hi+"|"+La+"|"+eu+"|"+Ts+")")+n("\\?("+Hd+")")+"?"+n("\\#("+ld+")")+"?$",ym="^("+Do+")\\:"+n(n("\\/\\/("+n("("+No+")@")+"?("+Vt+")"+n("\\:("+nn+")")+"?)")+"?("+hi+"|"+La+"|"+ad+"|"+Ts+")")+n("\\?("+Hd+")")+"?$",Mu="^"+n("\\#("+ld+")")+"?$",Vg="^"+n("("+No+")@")+"?("+Vt+")"+n("\\:("+nn+")")+"?$";return{NOT_SCHEME:new RegExp(e("[^]",je,St,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",ni,Pi),"g"),NOT_HOST:new RegExp(e("[^\\%\\[\\]\\:]",ni,Pi),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",ni,Pi),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",ni,Pi),"g"),NOT_QUERY:new RegExp(e("[^\\%]",ni,Pi,"[\\:\\@\\/\\?]",Cr),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",ni,Pi,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",ni,Pi),"g"),UNRESERVED:new RegExp(ni,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",ni,Bo),"g"),PCT_ENCODED:new RegExp(Ir,"g"),IPV4ADDRESS:new RegExp("^("+Ks+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Be+")"+n(n("\\%25|\\%(?!"+vn+"{2})")+"("+Me+")")+"?\\]?$")}}var l=a(!1),u=a(!0),c=function(){function Je(je,ut){var St=[],st=!0,vn=!1,Vn=void 0;try{for(var li=je[Symbol.iterator](),Ir;!(st=(Ir=li.next()).done)&&(St.push(Ir.value),!(ut&&St.length===ut));st=!0);}catch(As){vn=!0,Vn=As}finally{try{!st&&li.return&&li.return()}finally{if(vn)throw Vn}}return St}return function(je,ut){if(Array.isArray(je))return je;if(Symbol.iterator in Object(je))return Je(je,ut);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(Je){if(Array.isArray(Je)){for(var je=0,ut=Array(Je.length);je<Je.length;je++)ut[je]=Je[je];return ut}else return Array.from(Je)},h=2147483647,m=36,E=1,y=26,C=38,_=700,w=72,B=128,R="-",F=/^xn--/,q=/[^\0-\x7E]/,J=/[\x2E\u3002\uFF0E\uFF61]/g,j={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=m-E,K=Math.floor,U=String.fromCharCode;function se(Je){throw new RangeError(j[Je])}function V(Je,je){for(var ut=[],St=Je.length;St--;)ut[St]=je(Je[St]);return ut}function O(Je,je){var ut=Je.split("@"),St="";ut.length>1&&(St=ut[0]+"@",Je=ut[1]),Je=Je.replace(J,".");var st=Je.split("."),vn=V(st,je).join(".");return St+vn}function Y(Je){for(var je=[],ut=0,St=Je.length;ut<St;){var st=Je.charCodeAt(ut++);if(st>=55296&&st<=56319&&ut<St){var vn=Je.charCodeAt(ut++);(vn&64512)==56320?je.push(((st&1023)<<10)+(vn&1023)+65536):(je.push(st),ut--)}else je.push(st)}return je}var ee=function(je){return String.fromCodePoint.apply(String,d(je))},ne=function(je){return je-48<10?je-22:je-65<26?je-65:je-97<26?je-97:m},Ae=function(je,ut){return je+22+75*(je<26)-((ut!=0)<<5)},Ce=function(je,ut,St){var st=0;for(je=St?K(je/_):je>>1,je+=K(je/ut);je>L*y>>1;st+=m)je=K(je/L);return K(st+(L+1)*je/(je+C))},De=function(je){var ut=[],St=je.length,st=0,vn=B,Vn=w,li=je.lastIndexOf(R);li<0&&(li=0);for(var Ir=0;Ir<li;++Ir)je.charCodeAt(Ir)>=128&&se("not-basic"),ut.push(je.charCodeAt(Ir));for(var As=li>0?li+1:0;As<St;){for(var Pi=st,Bo=1,ks=m;;ks+=m){As>=St&&se("invalid-input");var Cr=ne(je.charCodeAt(As++));(Cr>=m||Cr>K((h-st)/Bo))&&se("overflow"),st+=Cr*Bo;var ni=ks<=Vn?E:ks>=Vn+y?y:ks-Vn;if(Cr<ni)break;var Do=m-ni;Bo>K(h/Do)&&se("overflow"),Bo*=Do}var No=ut.length+1;Vn=Ce(st-Pi,No,Pi==0),K(st/No)>h-vn&&se("overflow"),vn+=K(st/No),st%=No,ut.splice(st++,0,vn)}return String.fromCodePoint.apply(String,ut)},Ue=function(je){var ut=[];je=Y(je);var St=je.length,st=B,vn=0,Vn=w,li=!0,Ir=!1,As=void 0;try{for(var Pi=je[Symbol.iterator](),Bo;!(li=(Bo=Pi.next()).done);li=!0){var ks=Bo.value;ks<128&&ut.push(U(ks))}}catch(ct){Ir=!0,As=ct}finally{try{!li&&Pi.return&&Pi.return()}finally{if(Ir)throw As}}var Cr=ut.length,ni=Cr;for(Cr&&ut.push(R);ni<St;){var Do=h,No=!0,Nu=!1,va=void 0;try{for(var Ks=je[Symbol.iterator](),Ei;!(No=(Ei=Ks.next()).done);No=!0){var fl=Ei.value;fl>=st&&fl<Do&&(Do=fl)}}catch(ct){Nu=!0,va=ct}finally{try{!No&&Ks.return&&Ks.return()}finally{if(Nu)throw va}}var ui=ni+1;Do-st>K((h-vn)/ui)&&se("overflow"),vn+=(Do-st)*ui,st=Do;var ci=!0,Ou=!1,Da=void 0;try{for(var ho=je[Symbol.iterator](),Ic;!(ci=(Ic=ho.next()).done);ci=!0){var ua=Ic.value;if(ua<st&&++vn>h&&se("overflow"),ua==st){for(var gs=vn,ja=m;;ja+=m){var Be=ja<=Vn?E:ja>=Vn+y?y:ja-Vn;if(gs<Be)break;var Me=gs-Be,tt=m-Be;ut.push(U(Ae(Be+Me%tt,0))),gs=K(Me/tt)}ut.push(U(Ae(gs,0))),Vn=Ce(vn,ui,ni==Cr),vn=0,++ni}}}catch(ct){Ou=!0,Da=ct}finally{try{!ci&&ho.return&&ho.return()}finally{if(Ou)throw Da}}++vn,++st}return ut.join("")},qe=function(je){return O(je,function(ut){return F.test(ut)?De(ut.slice(4).toLowerCase()):ut})},Ie=function(je){return O(je,function(ut){return q.test(ut)?"xn--"+Ue(ut):ut})},xe={version:"2.1.0",ucs2:{decode:Y,encode:ee},decode:De,encode:Ue,toASCII:Ie,toUnicode:qe},Oe={};function le(Je){var je=Je.charCodeAt(0),ut=void 0;return je<16?ut="%0"+je.toString(16).toUpperCase():je<128?ut="%"+je.toString(16).toUpperCase():je<2048?ut="%"+(je>>6|192).toString(16).toUpperCase()+"%"+(je&63|128).toString(16).toUpperCase():ut="%"+(je>>12|224).toString(16).toUpperCase()+"%"+(je>>6&63|128).toString(16).toUpperCase()+"%"+(je&63|128).toString(16).toUpperCase(),ut}function re(Je){for(var je="",ut=0,St=Je.length;ut<St;){var st=parseInt(Je.substr(ut+1,2),16);if(st<128)je+=String.fromCharCode(st),ut+=3;else if(st>=194&&st<224){if(St-ut>=6){var vn=parseInt(Je.substr(ut+4,2),16);je+=String.fromCharCode((st&31)<<6|vn&63)}else je+=Je.substr(ut,6);ut+=6}else if(st>=224){if(St-ut>=9){var Vn=parseInt(Je.substr(ut+4,2),16),li=parseInt(Je.substr(ut+7,2),16);je+=String.fromCharCode((st&15)<<12|(Vn&63)<<6|li&63)}else je+=Je.substr(ut,9);ut+=9}else je+=Je.substr(ut,3),ut+=3}return je}function ye(Je,je){function ut(St){var st=re(St);return st.match(je.UNRESERVED)?st:St}return Je.scheme&&(Je.scheme=String(Je.scheme).replace(je.PCT_ENCODED,ut).toLowerCase().replace(je.NOT_SCHEME,"")),Je.userinfo!==void 0&&(Je.userinfo=String(Je.userinfo).replace(je.PCT_ENCODED,ut).replace(je.NOT_USERINFO,le).replace(je.PCT_ENCODED,i)),Je.host!==void 0&&(Je.host=String(Je.host).replace(je.PCT_ENCODED,ut).toLowerCase().replace(je.NOT_HOST,le).replace(je.PCT_ENCODED,i)),Je.path!==void 0&&(Je.path=String(Je.path).replace(je.PCT_ENCODED,ut).replace(Je.scheme?je.NOT_PATH:je.NOT_PATH_NOSCHEME,le).replace(je.PCT_ENCODED,i)),Je.query!==void 0&&(Je.query=String(Je.query).replace(je.PCT_ENCODED,ut).replace(je.NOT_QUERY,le).replace(je.PCT_ENCODED,i)),Je.fragment!==void 0&&(Je.fragment=String(Je.fragment).replace(je.PCT_ENCODED,ut).replace(je.NOT_FRAGMENT,le).replace(je.PCT_ENCODED,i)),Je}function X(Je){return Je.replace(/^0*(.*)/,"$1")||"0"}function he(Je,je){var ut=Je.match(je.IPV4ADDRESS)||[],St=c(ut,2),st=St[1];return st?st.split(".").map(X).join("."):Je}function ae(Je,je){var ut=Je.match(je.IPV6ADDRESS)||[],St=c(ut,3),st=St[1],vn=St[2];if(st){for(var Vn=st.toLowerCase().split("::").reverse(),li=c(Vn,2),Ir=li[0],As=li[1],Pi=As?As.split(":").map(X):[],Bo=Ir.split(":").map(X),ks=je.IPV4ADDRESS.test(Bo[Bo.length-1]),Cr=ks?7:8,ni=Bo.length-Cr,Do=Array(Cr),No=0;No<Cr;++No)Do[No]=Pi[No]||Bo[ni+No]||"";ks&&(Do[Cr-1]=he(Do[Cr-1],je));var Nu=Do.reduce(function(ui,ci,Ou){if(!ci||ci==="0"){var Da=ui[ui.length-1];Da&&Da.index+Da.length===Ou?Da.length++:ui.push({index:Ou,length:1})}return ui},[]),va=Nu.sort(function(ui,ci){return ci.length-ui.length})[0],Ks=void 0;if(va&&va.length>1){var Ei=Do.slice(0,va.index),fl=Do.slice(va.index+va.length);Ks=Ei.join(":")+"::"+fl.join(":")}else Ks=Do.join(":");return vn&&(Ks+="%"+vn),Ks}else return Je}var me=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Se="".match(/(){0}/)[1]===void 0;function ie(Je){var je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ut={},St=je.iri!==!1?u:l;je.reference==="suffix"&&(Je=(je.scheme?je.scheme+":":"")+"//"+Je);var st=Je.match(me);if(st){Se?(ut.scheme=st[1],ut.userinfo=st[3],ut.host=st[4],ut.port=parseInt(st[5],10),ut.path=st[6]||"",ut.query=st[7],ut.fragment=st[8],isNaN(ut.port)&&(ut.port=st[5])):(ut.scheme=st[1]||void 0,ut.userinfo=Je.indexOf("@")!==-1?st[3]:void 0,ut.host=Je.indexOf("//")!==-1?st[4]:void 0,ut.port=parseInt(st[5],10),ut.path=st[6]||"",ut.query=Je.indexOf("?")!==-1?st[7]:void 0,ut.fragment=Je.indexOf("#")!==-1?st[8]:void 0,isNaN(ut.port)&&(ut.port=Je.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?st[4]:void 0)),ut.host&&(ut.host=ae(he(ut.host,St),St)),ut.scheme===void 0&&ut.userinfo===void 0&&ut.host===void 0&&ut.port===void 0&&!ut.path&&ut.query===void 0?ut.reference="same-document":ut.scheme===void 0?ut.reference="relative":ut.fragment===void 0?ut.reference="absolute":ut.reference="uri",je.reference&&je.reference!=="suffix"&&je.reference!==ut.reference&&(ut.error=ut.error||"URI is not a "+je.reference+" reference.");var vn=Oe[(je.scheme||ut.scheme||"").toLowerCase()];if(!je.unicodeSupport&&(!vn||!vn.unicodeSupport)){if(ut.host&&(je.domainHost||vn&&vn.domainHost))try{ut.host=xe.toASCII(ut.host.replace(St.PCT_ENCODED,re).toLowerCase())}catch(Vn){ut.error=ut.error||"Host's domain name can not be converted to ASCII via punycode: "+Vn}ye(ut,l)}else ye(ut,St);vn&&vn.parse&&vn.parse(ut,je)}else ut.error=ut.error||"URI can not be parsed.";return ut}function k(Je,je){var ut=je.iri!==!1?u:l,St=[];return Je.userinfo!==void 0&&(St.push(Je.userinfo),St.push("@")),Je.host!==void 0&&St.push(ae(he(String(Je.host),ut),ut).replace(ut.IPV6ADDRESS,function(st,vn,Vn){return"["+vn+(Vn?"%25"+Vn:"")+"]"})),(typeof Je.port=="number"||typeof Je.port=="string")&&(St.push(":"),St.push(String(Je.port))),St.length?St.join(""):void 0}var W=/^\.\.?\//,pe=/^\/\.(\/|$)/,te=/^\/\.\.(\/|$)/,H=/^\/?(?:.|\n)*?(?=\/|$)/;function ge(Je){for(var je=[];Je.length;)if(Je.match(W))Je=Je.replace(W,"");else if(Je.match(pe))Je=Je.replace(pe,"/");else if(Je.match(te))Je=Je.replace(te,"/"),je.pop();else if(Je==="."||Je==="..")Je="";else{var ut=Je.match(H);if(ut){var St=ut[0];Je=Je.slice(St.length),je.push(St)}else throw new Error("Unexpected dot segment condition")}return je.join("")}function be(Je){var je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ut=je.iri?u:l,St=[],st=Oe[(je.scheme||Je.scheme||"").toLowerCase()];if(st&&st.serialize&&st.serialize(Je,je),Je.host&&!ut.IPV6ADDRESS.test(Je.host)){if(je.domainHost||st&&st.domainHost)try{Je.host=je.iri?xe.toUnicode(Je.host):xe.toASCII(Je.host.replace(ut.PCT_ENCODED,re).toLowerCase())}catch(li){Je.error=Je.error||"Host's domain name can not be converted to "+(je.iri?"Unicode":"ASCII")+" via punycode: "+li}}ye(Je,ut),je.reference!=="suffix"&&Je.scheme&&(St.push(Je.scheme),St.push(":"));var vn=k(Je,je);if(vn!==void 0&&(je.reference!=="suffix"&&St.push("//"),St.push(vn),Je.path&&Je.path.charAt(0)!=="/"&&St.push("/")),Je.path!==void 0){var Vn=Je.path;!je.absolutePath&&(!st||!st.absolutePath)&&(Vn=ge(Vn)),vn===void 0&&(Vn=Vn.replace(/^\/\//,"/%2F")),St.push(Vn)}return Je.query!==void 0&&(St.push("?"),St.push(Je.query)),Je.fragment!==void 0&&(St.push("#"),St.push(Je.fragment)),St.join("")}function Pe(Je,je){var ut=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},St=arguments[3],st={};return St||(Je=ie(be(Je,ut),ut),je=ie(be(je,ut),ut)),ut=ut||{},!ut.tolerant&&je.scheme?(st.scheme=je.scheme,st.userinfo=je.userinfo,st.host=je.host,st.port=je.port,st.path=ge(je.path||""),st.query=je.query):(je.userinfo!==void 0||je.host!==void 0||je.port!==void 0?(st.userinfo=je.userinfo,st.host=je.host,st.port=je.port,st.path=ge(je.path||""),st.query=je.query):(je.path?(je.path.charAt(0)==="/"?st.path=ge(je.path):((Je.userinfo!==void 0||Je.host!==void 0||Je.port!==void 0)&&!Je.path?st.path="/"+je.path:Je.path?st.path=Je.path.slice(0,Je.path.lastIndexOf("/")+1)+je.path:st.path=je.path,st.path=ge(st.path)),st.query=je.query):(st.path=Je.path,je.query!==void 0?st.query=je.query:st.query=Je.query),st.userinfo=Je.userinfo,st.host=Je.host,st.port=Je.port),st.scheme=Je.scheme),st.fragment=je.fragment,st}function pt(Je,je,ut){var St=s({scheme:"null"},ut);return be(Pe(ie(Je,St),ie(je,St),St,!0),St)}function Dt(Je,je){return typeof Je=="string"?Je=be(ie(Je,je),je):r(Je)==="object"&&(Je=ie(be(Je,je),je)),Je}function Qt(Je,je,ut){return typeof Je=="string"?Je=be(ie(Je,ut),ut):r(Je)==="object"&&(Je=be(Je,ut)),typeof je=="string"?je=be(ie(je,ut),ut):r(je)==="object"&&(je=be(je,ut)),Je===je}function dt(Je,je){return Je&&Je.toString().replace(!je||!je.iri?l.ESCAPE:u.ESCAPE,le)}function mt(Je,je){return Je&&Je.toString().replace(!je||!je.iri?l.PCT_ENCODED:u.PCT_ENCODED,re)}var kt={scheme:"http",domainHost:!0,parse:function(je,ut){return je.host||(je.error=je.error||"HTTP URIs must have a host."),je},serialize:function(je,ut){var St=String(je.scheme).toLowerCase()==="https";return(je.port===(St?443:80)||je.port==="")&&(je.port=void 0),je.path||(je.path="/"),je}},Ln={scheme:"https",domainHost:kt.domainHost,parse:kt.parse,serialize:kt.serialize};function si(Je){return typeof Je.secure=="boolean"?Je.secure:String(Je.scheme).toLowerCase()==="wss"}var Ni={scheme:"ws",domainHost:!0,parse:function(je,ut){var St=je;return St.secure=si(St),St.resourceName=(St.path||"/")+(St.query?"?"+St.query:""),St.path=void 0,St.query=void 0,St},serialize:function(je,ut){if((je.port===(si(je)?443:80)||je.port==="")&&(je.port=void 0),typeof je.secure=="boolean"&&(je.scheme=je.secure?"wss":"ws",je.secure=void 0),je.resourceName){var St=je.resourceName.split("?"),st=c(St,2),vn=st[0],Vn=st[1];je.path=vn&&vn!=="/"?vn:void 0,je.query=Vn,je.resourceName=void 0}return je.fragment=void 0,je}},Yi={scheme:"wss",domainHost:Ni.domainHost,parse:Ni.parse,serialize:Ni.serialize},Go={},to=!0,Re="[A-Za-z0-9\\-\\.\\_\\~"+(to?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",ot="[0-9A-Fa-f]",it=n(n("%[EFef]"+ot+"%"+ot+ot+"%"+ot+ot)+"|"+n("%[89A-Fa-f]"+ot+"%"+ot+ot)+"|"+n("%"+ot+ot)),Lt="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Cn="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",On=e(Cn,'[\\"\\\\]'),_n="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",ur=new RegExp(Re,"g"),Un=new RegExp(it,"g"),Fa=new RegExp(e("[^]",Lt,"[\\.]",'[\\"]',On),"g"),vl=new RegExp(e("[^]",Re,_n),"g"),Ud=vl;function sd(Je){var je=re(Je);return je.match(ur)?je:Je}var _c={scheme:"mailto",parse:function(je,ut){var St=je,st=St.to=St.path?St.path.split(","):[];if(St.path=void 0,St.query){for(var vn=!1,Vn={},li=St.query.split("&"),Ir=0,As=li.length;Ir<As;++Ir){var Pi=li[Ir].split("=");switch(Pi[0]){case"to":for(var Bo=Pi[1].split(","),ks=0,Cr=Bo.length;ks<Cr;++ks)st.push(Bo[ks]);break;case"subject":St.subject=mt(Pi[1],ut);break;case"body":St.body=mt(Pi[1],ut);break;default:vn=!0,Vn[mt(Pi[0],ut)]=mt(Pi[1],ut);break}}vn&&(St.headers=Vn)}St.query=void 0;for(var ni=0,Do=st.length;ni<Do;++ni){var No=st[ni].split("@");if(No[0]=mt(No[0]),ut.unicodeSupport)No[1]=mt(No[1],ut).toLowerCase();else try{No[1]=xe.toASCII(mt(No[1],ut).toLowerCase())}catch(Nu){St.error=St.error||"Email address's domain name can not be converted to ASCII via punycode: "+Nu}st[ni]=No.join("@")}return St},serialize:function(je,ut){var St=je,st=o(je.to);if(st){for(var vn=0,Vn=st.length;vn<Vn;++vn){var li=String(st[vn]),Ir=li.lastIndexOf("@"),As=li.slice(0,Ir).replace(Un,sd).replace(Un,i).replace(Fa,le),Pi=li.slice(Ir+1);try{Pi=ut.iri?xe.toUnicode(Pi):xe.toASCII(mt(Pi,ut).toLowerCase())}catch(ni){St.error=St.error||"Email address's domain name can not be converted to "+(ut.iri?"Unicode":"ASCII")+" via punycode: "+ni}st[vn]=As+"@"+Pi}St.path=st.join(",")}var Bo=je.headers=je.headers||{};je.subject&&(Bo.subject=je.subject),je.body&&(Bo.body=je.body);var ks=[];for(var Cr in Bo)Bo[Cr]!==Go[Cr]&&ks.push(Cr.replace(Un,sd).replace(Un,i).replace(vl,le)+"="+Bo[Cr].replace(Un,sd).replace(Un,i).replace(Ud,le));return ks.length&&(St.query=ks.join("&")),St}},Bu=/^([^\:]+)\:(.*)/,Ca={scheme:"urn",parse:function(je,ut){var St=je.path&&je.path.match(Bu),st=je;if(St){var vn=ut.scheme||st.scheme||"urn",Vn=St[1].toLowerCase(),li=St[2],Ir=vn+":"+(ut.nid||Vn),As=Oe[Ir];st.nid=Vn,st.nss=li,st.path=void 0,As&&(st=As.parse(st,ut))}else st.error=st.error||"URN can not be parsed.";return st},serialize:function(je,ut){var St=ut.scheme||je.scheme||"urn",st=je.nid,vn=St+":"+(ut.nid||st),Vn=Oe[vn];Vn&&(je=Vn.serialize(je,ut));var li=je,Ir=je.nss;return li.path=(st||ut.nid)+":"+Ir,li}},dl=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Gd={scheme:"urn:uuid",parse:function(je,ut){var St=je;return St.uuid=St.nss,St.nss=void 0,!ut.tolerant&&(!St.uuid||!St.uuid.match(dl))&&(St.error=St.error||"UUID is not valid."),St},serialize:function(je,ut){var St=je;return St.nss=(je.uuid||"").toLowerCase(),St}};Oe[kt.scheme]=kt,Oe[Ln.scheme]=Ln,Oe[Ni.scheme]=Ni,Oe[Yi.scheme]=Yi,Oe[_c.scheme]=_c,Oe[Ca.scheme]=Ca,Oe[Gd.scheme]=Gd,t.SCHEMES=Oe,t.pctEncChar=le,t.pctDecChars=re,t.parse=ie,t.removeDotSegments=ge,t.serialize=be,t.resolveComponents=Pe,t.resolve=pt,t.normalize=Dt,t.equal=Qt,t.escapeComponent=dt,t.unescapeComponent=mt,Object.defineProperty(t,"__esModule",{value:!0})})});var K8=b((rXr,Uat)=>{"use strict";Uat.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}});var Hat=b((iXr,Gat)=>{"use strict";Gat.exports=function(e){for(var n=0,r=e.length,i=0,o;i<r;)n++,o=e.charCodeAt(i++),o>=55296&&o<=56319&&i<r&&(o=e.charCodeAt(i),(o&64512)==56320&&i++);return n}});var QN=b((oXr,$at)=>{"use strict";$at.exports={copy:wLn,checkDataType:ZSe,checkDataTypes:RLn,coerceToTypes:BLn,toHash:t_e,getProperty:n_e,escapeQuotes:r_e,equal:K8(),ucs2length:Hat(),varOccurences:MLn,varReplace:FLn,schemaHasRules:LLn,schemaHasRulesExcept:PLn,schemaUnknownRules:QLn,toQuotedString:e_e,getPathExpr:kLn,getPath:ULn,getData:qLn,unescapeFragment:VLn,unescapeJsonPointer:o_e,escapeFragment:$Ln,escapeJsonPointer:i_e};function wLn(t,e){e=e||{};for(var n in t)e[n]=t[n];return e}function ZSe(t,e,n,r){var i=r?" !== ":" === ",o=r?" || ":" && ",s=r?"!":"",a=r?"":"!";switch(t){case"null":return e+i+"null";case"array":return s+"Array.isArray("+e+")";case"object":return"("+s+e+o+"typeof "+e+i+'"object"'+o+a+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+i+'"number"'+o+a+"("+e+" % 1)"+o+e+i+e+(n?o+s+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+i+'"'+t+'"'+(n?o+s+"isFinite("+e+")":"")+")";default:return"typeof "+e+i+'"'+t+'"'}}function RLn(t,e,n){switch(t.length){case 1:return ZSe(t[0],e,n,!0);default:var r="",i=t_e(t);i.array&&i.object&&(r=i.null?"(":"(!"+e+" || ",r+="typeof "+e+' !== "object")',delete i.null,delete i.array,delete i.object),i.number&&delete i.integer;for(var o in i)r+=(r?" && ":"")+ZSe(o,e,n,!0);return r}}var qat=t_e(["string","number","integer","boolean","null"]);function BLn(t,e){if(Array.isArray(e)){for(var n=[],r=0;r<e.length;r++){var i=e[r];(qat[i]||t==="array"&&i==="array")&&(n[n.length]=i)}if(n.length)return n}else{if(qat[e])return[e];if(t==="array"&&e==="array")return["array"]}}function t_e(t){for(var e={},n=0;n<t.length;n++)e[t[n]]=!0;return e}var NLn=/^[a-z$_][a-z$_0-9]*$/i,OLn=/'|\\/g;function n_e(t){return typeof t=="number"?"["+t+"]":NLn.test(t)?"."+t:"['"+r_e(t)+"']"}function r_e(t){return t.replace(OLn,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function MLn(t,e){e+="[^0-9]";var n=t.match(new RegExp(e,"g"));return n?n.length:0}function FLn(t,e,n){return e+="([^0-9])",n=n.replace(/\$/g,"$$$$"),t.replace(new RegExp(e,"g"),n+"$1")}function LLn(t,e){if(typeof t=="boolean")return!t;for(var n in t)if(e[n])return!0}function PLn(t,e,n){if(typeof t=="boolean")return!t&&n!="not";for(var r in t)if(r!=n&&e[r])return!0}function QLn(t,e){if(typeof t!="boolean"){for(var n in t)if(!e[n])return n}}function e_e(t){return"'"+r_e(t)+"'"}function kLn(t,e,n,r){var i=n?"'/' + "+e+(r?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):r?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'";return Vat(t,i)}function ULn(t,e,n){var r=e_e(n?"/"+i_e(e):n_e(e));return Vat(t,r)}var GLn=/^\/(?:[^~]|~0|~1)*$/,HLn=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function qLn(t,e,n){var r,i,o,s;if(t==="")return"rootData";if(t[0]=="/"){if(!GLn.test(t))throw new Error("Invalid JSON-pointer: "+t);i=t,o="rootData"}else{if(s=t.match(HLn),!s)throw new Error("Invalid JSON-pointer: "+t);if(r=+s[1],i=s[2],i=="#"){if(r>=e)throw new Error("Cannot access property/index "+r+" levels up, current level is "+e);return n[e-r]}if(r>e)throw new Error("Cannot access data "+r+" levels up, current level is "+e);if(o="data"+(e-r||""),!i)return o}for(var a=o,l=i.split("/"),u=0;u<l.length;u++){var c=l[u];c&&(o+=n_e(o_e(c)),a+=" && "+o)}return a}function Vat(t,e){return t=='""'?e:(t+" + "+e).replace(/([^\\])' \+ '/g,"$1")}function VLn(t){return o_e(decodeURIComponent(t))}function $Ln(t){return encodeURIComponent(i_e(t))}function i_e(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function o_e(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}});var s_e=b((sXr,Yat)=>{"use strict";var YLn=QN();Yat.exports=jLn;function jLn(t){YLn.copy(t,this)}});var Wat=b((aXr,jat)=>{"use strict";var fx=jat.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var r=typeof n=="function"?n:n.pre||function(){},i=n.post||function(){};ZZ(e,r,i,t,"",t)};fx.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};fx.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};fx.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};fx.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ZZ(t,e,n,r,i,o,s,a,l,u){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,i,o,s,a,l,u);for(var c in r){var d=r[c];if(Array.isArray(d)){if(c in fx.arrayKeywords)for(var h=0;h<d.length;h++)ZZ(t,e,n,d[h],i+"/"+c+"/"+h,o,i,c,r,h)}else if(c in fx.propsKeywords){if(d&&typeof d=="object")for(var m in d)ZZ(t,e,n,d[m],i+"/"+c+"/"+WLn(m),o,i,c,r,m)}else(c in fx.keywords||t.allKeys&&!(c in fx.skipKeywords))&&ZZ(t,e,n,d,i+"/"+c,o,i,c,r)}n(r,i,o,s,a,l,u)}}function WLn(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var oee=b((lXr,Xat)=>{"use strict";var EG=kat(),zat=K8(),ree=QN(),eee=s_e(),zLn=Wat();Xat.exports=hx;hx.normalizeId=px;hx.fullPath=tee;hx.url=nee;hx.ids=ePn;hx.inlineRef=a_e;hx.schema=iee;function hx(t,e,n){var r=this._refs[n];if(typeof r=="string")if(this._refs[r])r=this._refs[r];else return hx.call(this,t,e,r);if(r=r||this._schemas[n],r instanceof eee)return a_e(r.schema,this._opts.inlineRefs)?r.schema:r.validate||this._compile(r);var i=iee.call(this,e,n),o,s,a;return i&&(o=i.schema,e=i.root,a=i.baseId),o instanceof eee?s=o.validate||t.call(this,o.schema,e,void 0,a):o!==void 0&&(s=a_e(o,this._opts.inlineRefs)?o:t.call(this,o,e,void 0,a)),s}function iee(t,e){var n=EG.parse(e),r=Kat(n),i=tee(this._getId(t.schema));if(Object.keys(t.schema).length===0||r!==i){var o=px(r),s=this._refs[o];if(typeof s=="string")return JLn.call(this,t,s,n);if(s instanceof eee)s.validate||this._compile(s),t=s;else if(s=this._schemas[o],s instanceof eee){if(s.validate||this._compile(s),o==px(e))return{schema:s,root:t,baseId:i};t=s}else return;if(!t.schema)return;i=tee(this._getId(t.schema))}return Jat.call(this,n,i,t.schema,t)}function JLn(t,e,n){var r=iee.call(this,t,e);if(r){var i=r.schema,o=r.baseId;t=r.root;var s=this._getId(i);return s&&(o=nee(o,s)),Jat.call(this,n,o,i,t)}}var KLn=ree.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function Jat(t,e,n,r){if(t.fragment=t.fragment||"",t.fragment.slice(0,1)=="/"){for(var i=t.fragment.split("/"),o=1;o<i.length;o++){var s=i[o];if(s){if(s=ree.unescapeFragment(s),n=n[s],n===void 0)break;var a;if(!KLn[s]&&(a=this._getId(n),a&&(e=nee(e,a)),n.$ref)){var l=nee(e,n.$ref),u=iee.call(this,r,l);u&&(n=u.schema,r=u.root,e=u.baseId)}}}if(n!==void 0&&n!==r.schema)return{schema:n,root:r,baseId:e}}}var XLn=ree.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function a_e(t,e){if(e===!1)return!1;if(e===void 0||e===!0)return l_e(t);if(e)return u_e(t)<=e}function l_e(t){var e;if(Array.isArray(t)){for(var n=0;n<t.length;n++)if(e=t[n],typeof e=="object"&&!l_e(e))return!1}else for(var r in t)if(r=="$ref"||(e=t[r],typeof e=="object"&&!l_e(e)))return!1;return!0}function u_e(t){var e=0,n;if(Array.isArray(t)){for(var r=0;r<t.length;r++)if(n=t[r],typeof n=="object"&&(e+=u_e(n)),e==1/0)return 1/0}else for(var i in t){if(i=="$ref")return 1/0;if(XLn[i])e++;else if(n=t[i],typeof n=="object"&&(e+=u_e(n)+1),e==1/0)return 1/0}return e}function tee(t,e){e!==!1&&(t=px(t));var n=EG.parse(t);return Kat(n)}function Kat(t){return EG.serialize(t).split("#")[0]+"#"}var ZLn=/#\/?$/;function px(t){return t?t.replace(ZLn,""):""}function nee(t,e){return e=px(e),EG.resolve(t,e)}function ePn(t){var e=px(this._getId(t)),n={"":e},r={"":tee(e,!1)},i={},o=this;return zLn(t,{allKeys:!0},function(s,a,l,u,c,d,h){if(a!==""){var m=o._getId(s),E=n[u],y=r[u]+"/"+c;if(h!==void 0&&(y+="/"+(typeof h=="number"?h:ree.escapeFragment(h))),typeof m=="string"){m=E=px(E?EG.resolve(E,m):m);var C=o._refs[m];if(typeof C=="string"&&(C=o._refs[C]),C&&C.schema){if(!zat(s,C.schema))throw new Error('id "'+m+'" resolves to more than one schema')}else if(m!=px(y))if(m[0]=="#"){if(i[m]&&!zat(s,i[m]))throw new Error('id "'+m+'" resolves to more than one schema');i[m]=s}else o._refs[m]=y}n[a]=E,r[a]=y}}),i}});var see=b((uXr,elt)=>{"use strict";var c_e=oee();elt.exports={Validation:Zat(tPn),MissingRef:Zat(d_e)};function tPn(t){this.message="validation failed",this.errors=t,this.ajv=this.validation=!0}d_e.message=function(t,e){return"can't resolve reference "+e+" from id "+t};function d_e(t,e,n){this.message=n||d_e.message(t,e),this.missingRef=c_e.url(t,e),this.missingSchema=c_e.normalizeId(c_e.fullPath(this.missingRef))}function Zat(t){return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}});var f_e=b((cXr,tlt)=>{"use strict";tlt.exports=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var n=typeof e.cycles=="boolean"?e.cycles:!1,r=e.cmp&&function(o){return function(s){return function(a,l){var u={key:a,value:s[a]},c={key:l,value:s[l]};return o(u,c)}}}(e.cmp),i=[];return function o(s){if(s&&s.toJSON&&typeof s.toJSON=="function"&&(s=s.toJSON()),s!==void 0){if(typeof s=="number")return isFinite(s)?""+s:"null";if(typeof s!="object")return JSON.stringify(s);var a,l;if(Array.isArray(s)){for(l="[",a=0;a<s.length;a++)a&&(l+=","),l+=o(s[a])||"null";return l+"]"}if(s===null)return"null";if(i.indexOf(s)!==-1){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var u=i.push(s)-1,c=Object.keys(s).sort(r&&r(s));for(l="",a=0;a<c.length;a++){var d=c[a],h=o(s[d]);h&&(l&&(l+=","),l+=JSON.stringify(d)+":"+h)}return i.splice(u,1),"{"+l+"}"}}(t)}});var p_e=b((dXr,nlt)=>{"use strict";nlt.exports=function(e,n,r){var i="",o=e.schema.$async===!0,s=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),a=e.self._getId(e.schema);if(e.opts.strictKeywords){var l=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(l){var u="unknown keyword: "+l;if(e.opts.strictKeywords==="log")e.logger.warn(u);else throw new Error(u)}}if(e.isTop&&(i+=" var validate = ",o&&(e.async=!0,i+="async "),i+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",a&&(e.opts.sourceCode||e.opts.processCode)&&(i+=" "+("/*# sourceURL="+a+" */")+" ")),typeof e.schema=="boolean"||!(s||e.schema.$ref)){var n="false schema",c=e.level,d=e.dataLevel,h=e.schema[n],m=e.schemaPath+e.util.getProperty(n),E=e.errSchemaPath+"/"+n,F=!e.opts.allErrors,j,y="data"+(d||""),R="valid"+c;if(e.schema===!1){e.isTop?F=!0:i+=" var "+R+" = false; ";var C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(j||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(E)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'boolean schema is false' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),i+=" } "):i+=" {} ";var _=i;i=C.pop(),!e.compositeRule&&F?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?o?i+=" return data; ":i+=" validate.errors = null; return true; ":i+=" var "+R+" = true; ";return e.isTop&&(i+=" }; return validate; "),i}if(e.isTop){var w=e.isTop,c=e.level=0,d=e.dataLevel=0,y="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var B="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(B);else throw new Error(B)}i+=" var vErrors = null; ",i+=" var errors = 0; ",i+=" if (rootData === undefined) rootData = data; "}else{var c=e.level,d=e.dataLevel,y="data"+(d||"");if(a&&(e.baseId=e.resolve.url(e.baseId,a)),o&&!e.async)throw new Error("async schema in sync schema");i+=" var errs_"+c+" = errors;"}var R="valid"+c,F=!e.opts.allErrors,q="",J="",j,L=e.schema.type,K=Array.isArray(L);if(L&&e.opts.nullable&&e.schema.nullable===!0&&(K?L.indexOf("null")==-1&&(L=L.concat("null")):L!="null"&&(L=[L,"null"],K=!0)),K&&L.length==1&&(L=L[0],K=!1),e.schema.$ref&&s){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(s=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(i+=" "+e.RULES.all.$comment.code(e,"$comment")),L){if(e.opts.coerceTypes)var U=e.util.coerceToTypes(e.opts.coerceTypes,L);var se=e.RULES.types[L];if(U||K||se===!0||se&&!H(se)){var m=e.schemaPath+".type",E=e.errSchemaPath+"/type",m=e.schemaPath+".type",E=e.errSchemaPath+"/type",V=K?"checkDataTypes":"checkDataType";if(i+=" if ("+e.util[V](L,y,e.opts.strictNumbers,!0)+") { ",U){var O="dataType"+c,Y="coerced"+c;i+=" var "+O+" = typeof "+y+"; var "+Y+" = undefined; ",e.opts.coerceTypes=="array"&&(i+=" if ("+O+" == 'object' && Array.isArray("+y+") && "+y+".length == 1) { "+y+" = "+y+"[0]; "+O+" = typeof "+y+"; if ("+e.util.checkDataType(e.schema.type,y,e.opts.strictNumbers)+") "+Y+" = "+y+"; } "),i+=" if ("+Y+" !== undefined) ; ";var ee=U;if(ee)for(var ne,Ae=-1,Ce=ee.length-1;Ae<Ce;)ne=ee[Ae+=1],ne=="string"?i+=" else if ("+O+" == 'number' || "+O+" == 'boolean') "+Y+" = '' + "+y+"; else if ("+y+" === null) "+Y+" = ''; ":ne=="number"||ne=="integer"?(i+=" else if ("+O+" == 'boolean' || "+y+" === null || ("+O+" == 'string' && "+y+" && "+y+" == +"+y+" ",ne=="integer"&&(i+=" && !("+y+" % 1)"),i+=")) "+Y+" = +"+y+"; "):ne=="boolean"?i+=" else if ("+y+" === 'false' || "+y+" === 0 || "+y+" === null) "+Y+" = false; else if ("+y+" === 'true' || "+y+" === 1) "+Y+" = true; ":ne=="null"?i+=" else if ("+y+" === '' || "+y+" === 0 || "+y+" === false) "+Y+" = null; ":e.opts.coerceTypes=="array"&&ne=="array"&&(i+=" else if ("+O+" == 'string' || "+O+" == 'number' || "+O+" == 'boolean' || "+y+" == null) "+Y+" = ["+y+"]; ");i+=" else { ";var C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(j||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(E)+" , params: { type: '",K?i+=""+L.join(","):i+=""+L,i+="' } ",e.opts.messages!==!1&&(i+=" , message: 'should be ",K?i+=""+L.join(","):i+=""+L,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+m+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),i+=" } "):i+=" {} ";var _=i;i=C.pop(),!e.compositeRule&&F?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } if ("+Y+" !== undefined) { ";var De=d?"data"+(d-1||""):"parentData",Ue=d?e.dataPathArr[d]:"parentDataProperty";i+=" "+y+" = "+Y+"; ",d||(i+="if ("+De+" !== undefined)"),i+=" "+De+"["+Ue+"] = "+Y+"; } "}else{var C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(j||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(E)+" , params: { type: '",K?i+=""+L.join(","):i+=""+L,i+="' } ",e.opts.messages!==!1&&(i+=" , message: 'should be ",K?i+=""+L.join(","):i+=""+L,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+m+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),i+=" } "):i+=" {} ";var _=i;i=C.pop(),!e.compositeRule&&F?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}i+=" } "}}if(e.schema.$ref&&!s)i+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",F&&(i+=" } if (errors === ",w?i+="0":i+="errs_"+c,i+=") { ",J+="}");else{var qe=e.RULES;if(qe){for(var se,Ie=-1,xe=qe.length-1;Ie<xe;)if(se=qe[Ie+=1],H(se)){if(se.type&&(i+=" if ("+e.util.checkDataType(se.type,y,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(se.type=="object"&&e.schema.properties){var h=e.schema.properties,Oe=Object.keys(h),le=Oe;if(le)for(var re,ye=-1,X=le.length-1;ye<X;){re=le[ye+=1];var he=h[re];if(he.default!==void 0){var ae=y+e.util.getProperty(re);if(e.compositeRule){if(e.opts.strictDefaults){var B="default is ignored for: "+ae;if(e.opts.strictDefaults==="log")e.logger.warn(B);else throw new Error(B)}}else i+=" if ("+ae+" === undefined ",e.opts.useDefaults=="empty"&&(i+=" || "+ae+" === null || "+ae+" === '' "),i+=" ) "+ae+" = ",e.opts.useDefaults=="shared"?i+=" "+e.useDefault(he.default)+" ":i+=" "+JSON.stringify(he.default)+" ",i+="; "}}}else if(se.type=="array"&&Array.isArray(e.schema.items)){var me=e.schema.items;if(me){for(var he,Ae=-1,Se=me.length-1;Ae<Se;)if(he=me[Ae+=1],he.default!==void 0){var ae=y+"["+Ae+"]";if(e.compositeRule){if(e.opts.strictDefaults){var B="default is ignored for: "+ae;if(e.opts.strictDefaults==="log")e.logger.warn(B);else throw new Error(B)}}else i+=" if ("+ae+" === undefined ",e.opts.useDefaults=="empty"&&(i+=" || "+ae+" === null || "+ae+" === '' "),i+=" ) "+ae+" = ",e.opts.useDefaults=="shared"?i+=" "+e.useDefault(he.default)+" ":i+=" "+JSON.stringify(he.default)+" ",i+="; "}}}}var ie=se.rules;if(ie){for(var k,W=-1,pe=ie.length-1;W<pe;)if(k=ie[W+=1],ge(k)){var te=k.code(e,k.keyword,se.type);te&&(i+=" "+te+" ",F&&(q+="}"))}}if(F&&(i+=" "+q+" ",q=""),se.type&&(i+=" } ",L&&L===se.type&&!U)){i+=" else { ";var m=e.schemaPath+".type",E=e.errSchemaPath+"/type",C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(j||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(E)+" , params: { type: '",K?i+=""+L.join(","):i+=""+L,i+="' } ",e.opts.messages!==!1&&(i+=" , message: 'should be ",K?i+=""+L.join(","):i+=""+L,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+m+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),i+=" } "):i+=" {} ";var _=i;i=C.pop(),!e.compositeRule&&F?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } "}F&&(i+=" if (errors === ",w?i+="0":i+="errs_"+c,i+=") { ",J+="}")}}}F&&(i+=" "+J+" "),w?(o?(i+=" if (errors === 0) return data; ",i+=" else throw new ValidationError(vErrors); "):(i+=" validate.errors = vErrors; ",i+=" return errors === 0; "),i+=" }; return validate;"):i+=" var "+R+" = errors === errs_"+c+";";function H(Pe){for(var pt=Pe.rules,Dt=0;Dt<pt.length;Dt++)if(ge(pt[Dt]))return!0}function ge(Pe){return e.schema[Pe.keyword]!==void 0||Pe.implements&&be(Pe)}function be(Pe){for(var pt=Pe.implements,Dt=0;Dt<pt.length;Dt++)if(e.schema[pt[Dt]]!==void 0)return!0}return i}});var alt=b((fXr,slt)=>{"use strict";var aee=oee(),uee=QN(),ilt=see(),nPn=f_e(),rlt=p_e(),rPn=uee.ucs2length,iPn=K8(),oPn=ilt.Validation;slt.exports=h_e;function h_e(t,e,n,r){var i=this,o=this._opts,s=[void 0],a={},l=[],u={},c=[],d={},h=[];e=e||{schema:t,refVal:s,refs:a};var m=sPn.call(this,t,e,r),E=this._compilations[m.index];if(m.compiling)return E.callValidate=B;var y=this._formats,C=this.RULES;try{var _=R(t,e,n,r);E.validate=_;var w=E.callValidate;return w&&(w.schema=_.schema,w.errors=null,w.refs=_.refs,w.refVal=_.refVal,w.root=_.root,w.$async=_.$async,o.sourceCode&&(w.source=_.source)),_}finally{aPn.call(this,t,e,r)}function B(){var V=E.validate,O=V.apply(this,arguments);return B.errors=V.errors,O}function R(V,O,Y,ee){var ne=!O||O&&O.schema==V;if(O.schema!=e.schema)return h_e.call(i,V,O,Y,ee);var Ae=V.$async===!0,Ce=rlt({isTop:!0,schema:V,isRoot:ne,baseId:ee,root:O,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:ilt.MissingRef,RULES:C,validate:rlt,util:uee,resolve:aee,resolveRef:F,usePattern:K,useDefault:U,useCustomRule:se,opts:o,formats:y,logger:i.logger,self:i});Ce=lee(s,cPn)+lee(l,lPn)+lee(c,uPn)+lee(h,dPn)+Ce,o.processCode&&(Ce=o.processCode(Ce,V));var De;try{var Ue=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",Ce);De=Ue(i,C,y,e,s,c,h,iPn,rPn,oPn),s[0]=De}catch(qe){throw i.logger.error("Error compiling schema, function code:",Ce),qe}return De.schema=V,De.errors=null,De.refs=a,De.refVal=s,De.root=ne?De:O,Ae&&(De.$async=!0),o.sourceCode===!0&&(De.source={code:Ce,patterns:l,defaults:c}),De}function F(V,O,Y){O=aee.url(V,O);var ee=a[O],ne,Ae;if(ee!==void 0)return ne=s[ee],Ae="refVal["+ee+"]",L(ne,Ae);if(!Y&&e.refs){var Ce=e.refs[O];if(Ce!==void 0)return ne=e.refVal[Ce],Ae=q(O,ne),L(ne,Ae)}Ae=q(O);var De=aee.call(i,R,e,O);if(De===void 0){var Ue=n&&n[O];Ue&&(De=aee.inlineRef(Ue,o.inlineRefs)?Ue:h_e.call(i,Ue,e,n,V))}if(De===void 0)J(O);else return j(O,De),L(De,Ae)}function q(V,O){var Y=s.length;return s[Y]=O,a[V]=Y,"refVal"+Y}function J(V){delete a[V]}function j(V,O){var Y=a[V];s[Y]=O}function L(V,O){return typeof V=="object"||typeof V=="boolean"?{code:O,schema:V,inline:!0}:{code:O,$async:V&&!!V.$async}}function K(V){var O=u[V];return O===void 0&&(O=u[V]=l.length,l[O]=V),"pattern"+O}function U(V){switch(typeof V){case"boolean":case"number":return""+V;case"string":return uee.toQuotedString(V);case"object":if(V===null)return"null";var O=nPn(V),Y=d[O];return Y===void 0&&(Y=d[O]=c.length,c[Y]=V),"default"+Y}}function se(V,O,Y,ee){if(i._opts.validateSchema!==!1){var ne=V.definition.dependencies;if(ne&&!ne.every(function(le){return Object.prototype.hasOwnProperty.call(Y,le)}))throw new Error("parent schema must have all required keywords: "+ne.join(","));var Ae=V.definition.validateSchema;if(Ae){var Ce=Ae(O);if(!Ce){var De="keyword schema is invalid: "+i.errorsText(Ae.errors);if(i._opts.validateSchema=="log")i.logger.error(De);else throw new Error(De)}}}var Ue=V.definition.compile,qe=V.definition.inline,Ie=V.definition.macro,xe;if(Ue)xe=Ue.call(i,O,Y,ee);else if(Ie)xe=Ie.call(i,O,Y,ee),o.validateSchema!==!1&&i.validateSchema(xe,!0);else if(qe)xe=qe.call(i,ee,V.keyword,O,Y);else if(xe=V.definition.validate,!xe)return;if(xe===void 0)throw new Error('custom keyword "'+V.keyword+'"failed to compile');var Oe=h.length;return h[Oe]=xe,{code:"customRule"+Oe,validate:xe}}}function sPn(t,e,n){var r=olt.call(this,t,e,n);return r>=0?{index:r,compiling:!0}:(r=this._compilations.length,this._compilations[r]={schema:t,root:e,baseId:n},{index:r,compiling:!1})}function aPn(t,e,n){var r=olt.call(this,t,e,n);r>=0&&this._compilations.splice(r,1)}function olt(t,e,n){for(var r=0;r<this._compilations.length;r++){var i=this._compilations[r];if(i.schema==t&&i.root==e&&i.baseId==n)return r}return-1}function lPn(t,e){return"var pattern"+t+" = new RegExp("+uee.toQuotedString(e[t])+");"}function uPn(t){return"var default"+t+" = defaults["+t+"];"}function cPn(t,e){return e[t]===void 0?"":"var refVal"+t+" = refVal["+t+"];"}function dPn(t){return"var customRule"+t+" = customRules["+t+"];"}function lee(t,e){if(!t.length)return"";for(var n="",r=0;r<t.length;r++)n+=e(r,t);return n}});var ult=b((pXr,llt)=>{"use strict";var cee=llt.exports=function(){this._cache={}};cee.prototype.put=function(e,n){this._cache[e]=n};cee.prototype.get=function(e){return this._cache[e]};cee.prototype.del=function(e){delete this._cache[e]};cee.prototype.clear=function(){this._cache={}}});var vlt=b((hXr,Clt)=>{"use strict";var fPn=QN(),pPn=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,hPn=[0,31,28,31,30,31,30,31,31,30,31,30,31],mPn=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,clt=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,APn=/^(?:[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,gPn=/^(?:[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,dlt=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,flt=/^(?:(?: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,plt=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,hlt=/^(?:\/(?:[^~/]|~0|~1)*)*$/,mlt=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Alt=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;Clt.exports=dee;function dee(t){return t=t=="full"?"full":"fast",fPn.copy(dee[t])}dee.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":dlt,url:flt,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:clt,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:ylt,uuid:plt,"json-pointer":hlt,"json-pointer-uri-fragment":mlt,"relative-json-pointer":Alt};dee.full={date:glt,time:Elt,"date-time":CPn,uri:DPn,"uri-reference":gPn,"uri-template":dlt,url:flt,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:clt,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:ylt,uuid:plt,"json-pointer":hlt,"json-pointer-uri-fragment":mlt,"relative-json-pointer":Alt};function EPn(t){return t%4===0&&(t%100!==0||t%400===0)}function glt(t){var e=t.match(pPn);if(!e)return!1;var n=+e[1],r=+e[2],i=+e[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&EPn(n)?29:hPn[r])}function Elt(t,e){var n=t.match(mPn);if(!n)return!1;var r=n[1],i=n[2],o=n[3],s=n[5];return(r<=23&&i<=59&&o<=59||r==23&&i==59&&o==60)&&(!e||s)}var yPn=/t|\s/i;function CPn(t){var e=t.split(yPn);return e.length==2&&glt(e[0])&&Elt(e[1],!0)}var vPn=/\/|:/;function DPn(t){return vPn.test(t)&&APn.test(t)}var SPn=/[^\\]\\Z/;function ylt(t){if(SPn.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Slt=b((mXr,Dlt)=>{"use strict";Dlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.errSchemaPath+"/"+n,u=!e.opts.allErrors,c="data"+(s||""),d="valid"+o,h,m;if(a=="#"||a=="#/")e.isRoot?(h=e.async,m="validate"):(h=e.root.schema.$async===!0,m="root.refVal[0]");else{var E=e.resolveRef(e.baseId,a,e.isRoot);if(E===void 0){var y=e.MissingRefError.message(e.baseId,a);if(e.opts.missingRefs=="fail"){e.logger.error(y);var C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { ref: '"+e.util.escapeQuotes(a)+"' } ",e.opts.messages!==!1&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(a)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var _=i;i=C.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(y),u&&(i+=" if (true) { ");else throw new e.MissingRefError(e.baseId,a,y)}else if(E.inline){var w=e.util.copy(e);w.level++;var B="valid"+w.level;w.schema=E.schema,w.schemaPath="",w.errSchemaPath=a;var R=e.validate(w).replace(/validate\.schema/g,E.code);i+=" "+R+" ",u&&(i+=" if ("+B+") { ")}else h=E.$async===!0||e.async&&E.$async!==!1,m=E.code}if(m){var C=C||[];C.push(i),i="",e.opts.passContext?i+=" "+m+".call(this, ":i+=" "+m+"( ",i+=" "+c+", (dataPath || '')",e.errorPath!='""'&&(i+=" + "+e.errorPath);var F=s?"data"+(s-1||""):"parentData",q=s?e.dataPathArr[s]:"parentDataProperty";i+=" , "+F+" , "+q+", rootData) ";var J=i;if(i=C.pop(),h){if(!e.async)throw new Error("async schema referenced by sync schema");u&&(i+=" var "+d+"; "),i+=" try { await "+J+"; ",u&&(i+=" "+d+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",u&&(i+=" "+d+" = false; "),i+=" } ",u&&(i+=" if ("+d+") { ")}else i+=" if (!"+J+") { if (vErrors === null) vErrors = "+m+".errors; else vErrors = vErrors.concat("+m+".errors); errors = vErrors.length; } ",u&&(i+=" else { ")}return i}});var Ilt=b((AXr,_lt)=>{"use strict";_lt.exports=function(e,n,r){var i=" ",o=e.schema[n],s=e.schemaPath+e.util.getProperty(n),a=e.errSchemaPath+"/"+n,l=!e.opts.allErrors,u=e.util.copy(e),c="";u.level++;var d="valid"+u.level,h=u.baseId,m=!0,E=o;if(E)for(var y,C=-1,_=E.length-1;C<_;)y=E[C+=1],(e.opts.strictKeywords?typeof y=="object"&&Object.keys(y).length>0||y===!1:e.util.schemaHasRules(y,e.RULES.all))&&(m=!1,u.schema=y,u.schemaPath=s+"["+C+"]",u.errSchemaPath=a+"/"+C,i+=" "+e.validate(u)+" ",u.baseId=h,l&&(i+=" if ("+d+") { ",c+="}"));return l&&(m?i+=" if (true) { ":i+=" "+c.slice(0,-1)+" "),i}});var blt=b((gXr,Tlt)=>{"use strict";Tlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m="errs__"+o,E=e.util.copy(e),y="";E.level++;var C="valid"+E.level,_=a.every(function(j){return e.opts.strictKeywords?typeof j=="object"&&Object.keys(j).length>0||j===!1:e.util.schemaHasRules(j,e.RULES.all)});if(_){var w=E.baseId;i+=" var "+m+" = errors; var "+h+" = false; ";var B=e.compositeRule;e.compositeRule=E.compositeRule=!0;var R=a;if(R)for(var F,q=-1,J=R.length-1;q<J;)F=R[q+=1],E.schema=F,E.schemaPath=l+"["+q+"]",E.errSchemaPath=u+"/"+q,i+=" "+e.validate(E)+" ",E.baseId=w,i+=" "+h+" = "+h+" || "+C+"; if (!"+h+") { ",y+="}";e.compositeRule=E.compositeRule=B,i+=" "+y+" if (!"+h+") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } else { errors = "+m+"; if (vErrors !== null) { if ("+m+") vErrors.length = "+m+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else c&&(i+=" if (true) { ");return i}});var wlt=b((EXr,xlt)=>{"use strict";xlt.exports=function(e,n,r){var i=" ",o=e.schema[n],s=e.errSchemaPath+"/"+n,a=!e.opts.allErrors,l=e.util.toQuotedString(o);return e.opts.$comment===!0?i+=" console.log("+l+");":typeof e.opts.$comment=="function"&&(i+=" self._opts.$comment("+l+", "+e.util.toQuotedString(s)+", validate.root.schema);"),i}});var Blt=b((yXr,Rlt)=>{"use strict";Rlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m=e.opts.$data&&a&&a.$data,E;m?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",E="schema"+o):E=a,m||(i+=" var schema"+o+" = validate.schema"+l+";"),i+="var "+h+" = equal("+d+", schema"+o+"); if (!"+h+") { ";var y=y||[];y.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValue: schema"+o+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be equal to constant' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var C=i;return i=y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+C+"]); ":i+=" validate.errors = ["+C+"]; return false; ":i+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",c&&(i+=" else { "),i}});var Olt=b((CXr,Nlt)=>{"use strict";Nlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m="errs__"+o,E=e.util.copy(e),y="";E.level++;var C="valid"+E.level,_="i"+o,w=E.dataLevel=e.dataLevel+1,B="data"+w,R=e.baseId,F=e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all);if(i+="var "+m+" = errors;var "+h+";",F){var q=e.compositeRule;e.compositeRule=E.compositeRule=!0,E.schema=a,E.schemaPath=l,E.errSchemaPath=u,i+=" var "+C+" = false; for (var "+_+" = 0; "+_+" < "+d+".length; "+_+"++) { ",E.errorPath=e.util.getPathExpr(e.errorPath,_,e.opts.jsonPointers,!0);var J=d+"["+_+"]";E.dataPathArr[w]=_;var j=e.validate(E);E.baseId=R,e.util.varOccurences(j,B)<2?i+=" "+e.util.varReplace(j,B,J)+" ":i+=" var "+B+" = "+J+"; "+j+" ",i+=" if ("+C+") break; } ",e.compositeRule=E.compositeRule=q,i+=" "+y+" if (!"+C+") {"}else i+=" if ("+d+".length == 0) {";var L=L||[];L.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var K=i;return i=L.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+K+"]); ":i+=" validate.errors = ["+K+"]; return false; ":i+=" var err = "+K+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",F&&(i+=" errors = "+m+"; if (vErrors !== null) { if ("+m+") vErrors.length = "+m+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i}});var Flt=b((vXr,Mlt)=>{"use strict";Mlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="errs__"+o,m=e.util.copy(e),E="";m.level++;var y="valid"+m.level,C={},_={},w=e.opts.ownProperties;for(q in a)if(q!="__proto__"){var B=a[q],R=Array.isArray(B)?_:C;R[q]=B}i+="var "+h+" = errors;";var F=e.errorPath;i+="var missing"+o+";";for(var q in _)if(R=_[q],R.length){if(i+=" if ( "+d+e.util.getProperty(q)+" !== undefined ",w&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(q)+"') "),c){i+=" && ( ";var J=R;if(J)for(var j,L=-1,K=J.length-1;L<K;){j=J[L+=1],L&&(i+=" || ");var U=e.util.getProperty(j),se=d+U;i+=" ( ( "+se+" === undefined ",w&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(j)+"') "),i+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?j:U)+") ) "}i+=")) { ";var V="missing"+o,O="' + "+V+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(F,V,!0):F+" + "+V);var Y=Y||[];Y.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(q)+"', missingProperty: '"+O+"', depsCount: "+R.length+", deps: '"+e.util.escapeQuotes(R.length==1?R[0]:R.join(", "))+"' } ",e.opts.messages!==!1&&(i+=" , message: 'should have ",R.length==1?i+="property "+e.util.escapeQuotes(R[0]):i+="properties "+e.util.escapeQuotes(R.join(", ")),i+=" when property "+e.util.escapeQuotes(q)+" is present' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var ee=i;i=Y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+ee+"]); ":i+=" validate.errors = ["+ee+"]; return false; ":i+=" var err = "+ee+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{i+=" ) { ";var ne=R;if(ne)for(var j,Ae=-1,Ce=ne.length-1;Ae<Ce;){j=ne[Ae+=1];var U=e.util.getProperty(j),O=e.util.escapeQuotes(j),se=d+U;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(F,j,e.opts.jsonPointers)),i+=" if ( "+se+" === undefined ",w&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(j)+"') "),i+=") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(q)+"', missingProperty: '"+O+"', depsCount: "+R.length+", deps: '"+e.util.escapeQuotes(R.length==1?R[0]:R.join(", "))+"' } ",e.opts.messages!==!1&&(i+=" , message: 'should have ",R.length==1?i+="property "+e.util.escapeQuotes(R[0]):i+="properties "+e.util.escapeQuotes(R.join(", ")),i+=" when property "+e.util.escapeQuotes(q)+" is present' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}i+=" } ",c&&(E+="}",i+=" else { ")}e.errorPath=F;var De=m.baseId;for(var q in C){var B=C[q];(e.opts.strictKeywords?typeof B=="object"&&Object.keys(B).length>0||B===!1:e.util.schemaHasRules(B,e.RULES.all))&&(i+=" "+y+" = true; if ( "+d+e.util.getProperty(q)+" !== undefined ",w&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(q)+"') "),i+=") { ",m.schema=B,m.schemaPath=l+e.util.getProperty(q),m.errSchemaPath=u+"/"+e.util.escapeFragment(q),i+=" "+e.validate(m)+" ",m.baseId=De,i+=" } ",c&&(i+=" if ("+y+") { ",E+="}"))}return c&&(i+=" "+E+" if ("+h+" == errors) {"),i}});var Plt=b((DXr,Llt)=>{"use strict";Llt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m=e.opts.$data&&a&&a.$data,E;m?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",E="schema"+o):E=a;var y="i"+o,C="schema"+o;m||(i+=" var "+C+" = validate.schema"+l+";"),i+="var "+h+";",m&&(i+=" if (schema"+o+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+o+")) "+h+" = false; else {"),i+=""+h+" = false;for (var "+y+"=0; "+y+"<"+C+".length; "+y+"++) if (equal("+d+", "+C+"["+y+"])) { "+h+" = true; break; }",m&&(i+=" } "),i+=" if (!"+h+") { ";var _=_||[];_.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+o+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var w=i;return i=_.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+w+"]); ":i+=" validate.errors = ["+w+"]; return false; ":i+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",c&&(i+=" else { "),i}});var klt=b((SXr,Qlt)=>{"use strict";Qlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||"");if(e.opts.format===!1)return c&&(i+=" if (true) { "),i;var h=e.opts.$data&&a&&a.$data,m;h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a;var E=e.opts.unknownFormats,y=Array.isArray(E);if(h){var C="format"+o,_="isObject"+o,w="formatType"+o;i+=" var "+C+" = formats["+m+"]; var "+_+" = typeof "+C+" == 'object' && !("+C+" instanceof RegExp) && "+C+".validate; var "+w+" = "+_+" && "+C+".type || 'string'; if ("+_+") { ",e.async&&(i+=" var async"+o+" = "+C+".async; "),i+=" "+C+" = "+C+".validate; } if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'string') || "),i+=" (",E!="ignore"&&(i+=" ("+m+" && !"+C+" ",y&&(i+=" && self._opts.unknownFormats.indexOf("+m+") == -1 "),i+=") || "),i+=" ("+C+" && "+w+" == '"+r+"' && !(typeof "+C+" == 'function' ? ",e.async?i+=" (async"+o+" ? await "+C+"("+d+") : "+C+"("+d+")) ":i+=" "+C+"("+d+") ",i+=" : "+C+".test("+d+"))))) {"}else{var C=e.formats[a];if(!C){if(E=="ignore")return e.logger.warn('unknown format "'+a+'" ignored in schema at path "'+e.errSchemaPath+'"'),c&&(i+=" if (true) { "),i;if(y&&E.indexOf(a)>=0)return c&&(i+=" if (true) { "),i;throw new Error('unknown format "'+a+'" is used in schema at path "'+e.errSchemaPath+'"')}var _=typeof C=="object"&&!(C instanceof RegExp)&&C.validate,w=_&&C.type||"string";if(_){var B=C.async===!0;C=C.validate}if(w!=r)return c&&(i+=" if (true) { "),i;if(B){if(!e.async)throw new Error("async format in sync schema");var R="formats"+e.util.getProperty(a)+".validate";i+=" if (!(await "+R+"("+d+"))) { "}else{i+=" if (! ";var R="formats"+e.util.getProperty(a);_&&(R+=".validate"),typeof C=="function"?i+=" "+R+"("+d+") ":i+=" "+R+".test("+d+") ",i+=") { "}}var F=F||[];F.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format: ",h?i+=""+m:i+=""+e.util.toQuotedString(a),i+=" } ",e.opts.messages!==!1&&(i+=` , message: 'should match format "`,h?i+="' + "+m+" + '":i+=""+e.util.escapeQuotes(a),i+=`"' `),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+e.util.toQuotedString(a),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var q=i;return i=F.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+q+"]); ":i+=" validate.errors = ["+q+"]; return false; ":i+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c&&(i+=" else { "),i}});var Glt=b((_Xr,Ult)=>{"use strict";Ult.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m="errs__"+o,E=e.util.copy(e);E.level++;var y="valid"+E.level,C=e.schema.then,_=e.schema.else,w=C!==void 0&&(e.opts.strictKeywords?typeof C=="object"&&Object.keys(C).length>0||C===!1:e.util.schemaHasRules(C,e.RULES.all)),B=_!==void 0&&(e.opts.strictKeywords?typeof _=="object"&&Object.keys(_).length>0||_===!1:e.util.schemaHasRules(_,e.RULES.all)),R=E.baseId;if(w||B){var F;E.createErrors=!1,E.schema=a,E.schemaPath=l,E.errSchemaPath=u,i+=" var "+m+" = errors; var "+h+" = true; ";var q=e.compositeRule;e.compositeRule=E.compositeRule=!0,i+=" "+e.validate(E)+" ",E.baseId=R,E.createErrors=!0,i+=" errors = "+m+"; if (vErrors !== null) { if ("+m+") vErrors.length = "+m+"; else vErrors = null; } ",e.compositeRule=E.compositeRule=q,w?(i+=" if ("+y+") { ",E.schema=e.schema.then,E.schemaPath=e.schemaPath+".then",E.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(E)+" ",E.baseId=R,i+=" "+h+" = "+y+"; ",w&&B?(F="ifClause"+o,i+=" var "+F+" = 'then'; "):F="'then'",i+=" } ",B&&(i+=" else { ")):i+=" if (!"+y+") { ",B&&(E.schema=e.schema.else,E.schemaPath=e.schemaPath+".else",E.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(E)+" ",E.baseId=R,i+=" "+h+" = "+y+"; ",w&&B?(F="ifClause"+o,i+=" var "+F+" = 'else'; "):F="'else'",i+=" } "),i+=" if (!"+h+") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+F+" } ",e.opts.messages!==!1&&(i+=` , message: 'should match "' + `+F+` + '" schema' `),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",c&&(i+=" else { ")}else c&&(i+=" if (true) { ");return i}});var qlt=b((IXr,Hlt)=>{"use strict";Hlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m="errs__"+o,E=e.util.copy(e),y="";E.level++;var C="valid"+E.level,_="i"+o,w=E.dataLevel=e.dataLevel+1,B="data"+w,R=e.baseId;if(i+="var "+m+" = errors;var "+h+";",Array.isArray(a)){var F=e.schema.additionalItems;if(F===!1){i+=" "+h+" = "+d+".length <= "+a.length+"; ";var q=u;u=e.errSchemaPath+"/additionalItems",i+=" if (!"+h+") { ";var J=J||[];J.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a.length+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have more than "+a.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var j=i;i=J.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+j+"]); ":i+=" validate.errors = ["+j+"]; return false; ":i+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",u=q,c&&(y+="}",i+=" else { ")}var L=a;if(L){for(var K,U=-1,se=L.length-1;U<se;)if(K=L[U+=1],e.opts.strictKeywords?typeof K=="object"&&Object.keys(K).length>0||K===!1:e.util.schemaHasRules(K,e.RULES.all)){i+=" "+C+" = true; if ("+d+".length > "+U+") { ";var V=d+"["+U+"]";E.schema=K,E.schemaPath=l+"["+U+"]",E.errSchemaPath=u+"/"+U,E.errorPath=e.util.getPathExpr(e.errorPath,U,e.opts.jsonPointers,!0),E.dataPathArr[w]=U;var O=e.validate(E);E.baseId=R,e.util.varOccurences(O,B)<2?i+=" "+e.util.varReplace(O,B,V)+" ":i+=" var "+B+" = "+V+"; "+O+" ",i+=" } ",c&&(i+=" if ("+C+") { ",y+="}")}}if(typeof F=="object"&&(e.opts.strictKeywords?typeof F=="object"&&Object.keys(F).length>0||F===!1:e.util.schemaHasRules(F,e.RULES.all))){E.schema=F,E.schemaPath=e.schemaPath+".additionalItems",E.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+C+" = true; if ("+d+".length > "+a.length+") { for (var "+_+" = "+a.length+"; "+_+" < "+d+".length; "+_+"++) { ",E.errorPath=e.util.getPathExpr(e.errorPath,_,e.opts.jsonPointers,!0);var V=d+"["+_+"]";E.dataPathArr[w]=_;var O=e.validate(E);E.baseId=R,e.util.varOccurences(O,B)<2?i+=" "+e.util.varReplace(O,B,V)+" ":i+=" var "+B+" = "+V+"; "+O+" ",c&&(i+=" if (!"+C+") break; "),i+=" } } ",c&&(i+=" if ("+C+") { ",y+="}")}}else if(e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all)){E.schema=a,E.schemaPath=l,E.errSchemaPath=u,i+=" for (var "+_+" = 0; "+_+" < "+d+".length; "+_+"++) { ",E.errorPath=e.util.getPathExpr(e.errorPath,_,e.opts.jsonPointers,!0);var V=d+"["+_+"]";E.dataPathArr[w]=_;var O=e.validate(E);E.baseId=R,e.util.varOccurences(O,B)<2?i+=" "+e.util.varReplace(O,B,V)+" ":i+=" var "+B+" = "+V+"; "+O+" ",c&&(i+=" if (!"+C+") break; "),i+=" }"}return c&&(i+=" "+y+" if ("+m+" == errors) {"),i}});var m_e=b((TXr,Vlt)=>{"use strict";Vlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,R,d="data"+(s||""),h=e.opts.$data&&a&&a.$data,m;h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a;var E=n=="maximum",y=E?"exclusiveMaximum":"exclusiveMinimum",C=e.schema[y],_=e.opts.$data&&C&&C.$data,w=E?"<":">",B=E?">":"<",R=void 0;if(!(h||typeof a=="number"||a===void 0))throw new Error(n+" must be number");if(!(_||C===void 0||typeof C=="number"||typeof C=="boolean"))throw new Error(y+" must be number or boolean");if(_){var F=e.util.getData(C.$data,s,e.dataPathArr),q="exclusive"+o,J="exclType"+o,j="exclIsNumber"+o,L="op"+o,K="' + "+L+" + '";i+=" var schemaExcl"+o+" = "+F+"; ",F="schemaExcl"+o,i+=" var "+q+"; var "+J+" = typeof "+F+"; if ("+J+" != 'boolean' && "+J+" != 'undefined' && "+J+" != 'number') { ";var R=y,U=U||[];U.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(R||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: '"+y+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var se=i;i=U.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+se+"]); ":i+=" validate.errors = ["+se+"]; return false; ":i+=" var err = "+se+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'number') || "),i+=" "+J+" == 'number' ? ( ("+q+" = "+m+" === undefined || "+F+" "+w+"= "+m+") ? "+d+" "+B+"= "+F+" : "+d+" "+B+" "+m+" ) : ( ("+q+" = "+F+" === true) ? "+d+" "+B+"= "+m+" : "+d+" "+B+" "+m+" ) || "+d+" !== "+d+") { var op"+o+" = "+q+" ? '"+w+"' : '"+w+"='; ",a===void 0&&(R=y,u=e.errSchemaPath+"/"+y,m=F,h=_)}else{var j=typeof C=="number",K=w;if(j&&h){var L="'"+K+"'";i+=" if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'number') || "),i+=" ( "+m+" === undefined || "+C+" "+w+"= "+m+" ? "+d+" "+B+"= "+C+" : "+d+" "+B+" "+m+" ) || "+d+" !== "+d+") { "}else{j&&a===void 0?(q=!0,R=y,u=e.errSchemaPath+"/"+y,m=C,B+="="):(j&&(m=Math[E?"min":"max"](C,a)),C===(j?m:!0)?(q=!0,R=y,u=e.errSchemaPath+"/"+y,B+="="):(q=!1,K+="="));var L="'"+K+"'";i+=" if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'number') || "),i+=" "+d+" "+B+" "+m+" || "+d+" !== "+d+") { "}}R=R||n;var U=U||[];U.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(R||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+L+", limit: "+m+", exclusive: "+q+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be "+K+" ",h?i+="' + "+m:i+=""+m+"'"),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var se=i;return i=U.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+se+"]); ":i+=" validate.errors = ["+se+"]; return false; ":i+=" var err = "+se+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c&&(i+=" else { "),i}});var A_e=b((bXr,$lt)=>{"use strict";$lt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,y,d="data"+(s||""),h=e.opts.$data&&a&&a.$data,m;if(h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a,!(h||typeof a=="number"))throw new Error(n+" must be number");var E=n=="maxItems"?">":"<";i+="if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'number') || "),i+=" "+d+".length "+E+" "+m+") { ";var y=n,C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(y||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+m+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have ",n=="maxItems"?i+="more":i+="fewer",i+=" than ",h?i+="' + "+m+" + '":i+=""+a,i+=" items' "),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var _=i;return i=C.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}});var g_e=b((xXr,Ylt)=>{"use strict";Ylt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,y,d="data"+(s||""),h=e.opts.$data&&a&&a.$data,m;if(h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a,!(h||typeof a=="number"))throw new Error(n+" must be number");var E=n=="maxLength"?">":"<";i+="if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'number') || "),e.opts.unicode===!1?i+=" "+d+".length ":i+=" ucs2length("+d+") ",i+=" "+E+" "+m+") { ";var y=n,C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(y||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+m+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be ",n=="maxLength"?i+="longer":i+="shorter",i+=" than ",h?i+="' + "+m+" + '":i+=""+a,i+=" characters' "),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var _=i;return i=C.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}});var E_e=b((wXr,jlt)=>{"use strict";jlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,y,d="data"+(s||""),h=e.opts.$data&&a&&a.$data,m;if(h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a,!(h||typeof a=="number"))throw new Error(n+" must be number");var E=n=="maxProperties"?">":"<";i+="if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'number') || "),i+=" Object.keys("+d+").length "+E+" "+m+") { ";var y=n,C=C||[];C.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(y||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+m+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have ",n=="maxProperties"?i+="more":i+="fewer",i+=" than ",h?i+="' + "+m+" + '":i+=""+a,i+=" properties' "),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var _=i;return i=C.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}});var zlt=b((RXr,Wlt)=>{"use strict";Wlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h=e.opts.$data&&a&&a.$data,m;if(h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a,!(h||typeof a=="number"))throw new Error(n+" must be number");i+="var division"+o+";if (",h&&(i+=" "+m+" !== undefined && ( typeof "+m+" != 'number' || "),i+=" (division"+o+" = "+d+" / "+m+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+o+" !== parseInt(division"+o+") ",i+=" ) ",h&&(i+=" ) "),i+=" ) { ";var E=E||[];E.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+m+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be multiple of ",h?i+="' + "+m:i+=""+m+"'"),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var y=i;return i=E.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}});var Klt=b((BXr,Jlt)=>{"use strict";Jlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="errs__"+o,m=e.util.copy(e);m.level++;var E="valid"+m.level;if(e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all)){m.schema=a,m.schemaPath=l,m.errSchemaPath=u,i+=" var "+h+" = errors; ";var y=e.compositeRule;e.compositeRule=m.compositeRule=!0,m.createErrors=!1;var C;m.opts.allErrors&&(C=m.opts.allErrors,m.opts.allErrors=!1),i+=" "+e.validate(m)+" ",m.createErrors=!0,C&&(m.opts.allErrors=C),e.compositeRule=m.compositeRule=y,i+=" if ("+E+") { ";var _=_||[];_.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var w=i;i=_.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+w+"]); ":i+=" validate.errors = ["+w+"]; return false; ":i+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",e.createErrors!==!1?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(i+=" if (false) { ");return i}});var Zlt=b((NXr,Xlt)=>{"use strict";Xlt.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m="errs__"+o,E=e.util.copy(e),y="";E.level++;var C="valid"+E.level,_=E.baseId,w="prevValid"+o,B="passingSchemas"+o;i+="var "+m+" = errors , "+w+" = false , "+h+" = false , "+B+" = null; ";var R=e.compositeRule;e.compositeRule=E.compositeRule=!0;var F=a;if(F)for(var q,J=-1,j=F.length-1;J<j;)q=F[J+=1],(e.opts.strictKeywords?typeof q=="object"&&Object.keys(q).length>0||q===!1:e.util.schemaHasRules(q,e.RULES.all))?(E.schema=q,E.schemaPath=l+"["+J+"]",E.errSchemaPath=u+"/"+J,i+=" "+e.validate(E)+" ",E.baseId=_):i+=" var "+C+" = true; ",J&&(i+=" if ("+C+" && "+w+") { "+h+" = false; "+B+" = ["+B+", "+J+"]; } else { ",y+="}"),i+=" if ("+C+") { "+h+" = "+w+" = true; "+B+" = "+J+"; }";return e.compositeRule=E.compositeRule=R,i+=""+y+"if (!"+h+") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+B+" } ",e.opts.messages!==!1&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+m+"; if (vErrors !== null) { if ("+m+") vErrors.length = "+m+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i}});var tut=b((OXr,eut)=>{"use strict";eut.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h=e.opts.$data&&a&&a.$data,m;h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a;var E=h?"(new RegExp("+m+"))":e.usePattern(a);i+="if ( ",h&&(i+=" ("+m+" !== undefined && typeof "+m+" != 'string') || "),i+=" !"+E+".test("+d+") ) { ";var y=y||[];y.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",h?i+=""+m:i+=""+e.util.toQuotedString(a),i+=" } ",e.opts.messages!==!1&&(i+=` , message: 'should match pattern "`,h?i+="' + "+m+" + '":i+=""+e.util.escapeQuotes(a),i+=`"' `),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+l:i+=""+e.util.toQuotedString(a),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var C=i;return i=y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+C+"]); ":i+=" validate.errors = ["+C+"]; return false; ":i+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}});var rut=b((MXr,nut)=>{"use strict";nut.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="errs__"+o,m=e.util.copy(e),E="";m.level++;var y="valid"+m.level,C="key"+o,_="idx"+o,w=m.dataLevel=e.dataLevel+1,B="data"+w,R="dataProperties"+o,F=Object.keys(a||{}).filter(Ae),q=e.schema.patternProperties||{},J=Object.keys(q).filter(Ae),j=e.schema.additionalProperties,L=F.length||J.length,K=j===!1,U=typeof j=="object"&&Object.keys(j).length,se=e.opts.removeAdditional,V=K||U||se,O=e.opts.ownProperties,Y=e.baseId,ee=e.schema.required;if(ee&&!(e.opts.$data&&ee.$data)&&ee.length<e.opts.loopRequired)var ne=e.util.toHash(ee);function Ae(mt){return mt!=="__proto__"}if(i+="var "+h+" = errors;var "+y+" = true;",O&&(i+=" var "+R+" = undefined;"),V){if(O?i+=" "+R+" = "+R+" || Object.keys("+d+"); for (var "+_+"=0; "+_+"<"+R+".length; "+_+"++) { var "+C+" = "+R+"["+_+"]; ":i+=" for (var "+C+" in "+d+") { ",L){if(i+=" var isAdditional"+o+" = !(false ",F.length)if(F.length>8)i+=" || validate.schema"+l+".hasOwnProperty("+C+") ";else{var Ce=F;if(Ce)for(var De,Ue=-1,qe=Ce.length-1;Ue<qe;)De=Ce[Ue+=1],i+=" || "+C+" == "+e.util.toQuotedString(De)+" "}if(J.length){var Ie=J;if(Ie)for(var xe,Oe=-1,le=Ie.length-1;Oe<le;)xe=Ie[Oe+=1],i+=" || "+e.usePattern(xe)+".test("+C+") "}i+=" ); if (isAdditional"+o+") { "}if(se=="all")i+=" delete "+d+"["+C+"]; ";else{var re=e.errorPath,ye="' + "+C+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,C,e.opts.jsonPointers)),K)if(se)i+=" delete "+d+"["+C+"]; ";else{i+=" "+y+" = false; ";var X=u;u=e.errSchemaPath+"/additionalProperties";var he=he||[];he.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { additionalProperty: '"+ye+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is an invalid additional property":i+="should NOT have additional properties",i+="' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var ae=i;i=he.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+ae+"]); ":i+=" validate.errors = ["+ae+"]; return false; ":i+=" var err = "+ae+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=X,c&&(i+=" break; ")}else if(U)if(se=="failing"){i+=" var "+h+" = errors; ";var me=e.compositeRule;e.compositeRule=m.compositeRule=!0,m.schema=j,m.schemaPath=e.schemaPath+".additionalProperties",m.errSchemaPath=e.errSchemaPath+"/additionalProperties",m.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,C,e.opts.jsonPointers);var Se=d+"["+C+"]";m.dataPathArr[w]=C;var ie=e.validate(m);m.baseId=Y,e.util.varOccurences(ie,B)<2?i+=" "+e.util.varReplace(ie,B,Se)+" ":i+=" var "+B+" = "+Se+"; "+ie+" ",i+=" if (!"+y+") { errors = "+h+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+d+"["+C+"]; } ",e.compositeRule=m.compositeRule=me}else{m.schema=j,m.schemaPath=e.schemaPath+".additionalProperties",m.errSchemaPath=e.errSchemaPath+"/additionalProperties",m.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,C,e.opts.jsonPointers);var Se=d+"["+C+"]";m.dataPathArr[w]=C;var ie=e.validate(m);m.baseId=Y,e.util.varOccurences(ie,B)<2?i+=" "+e.util.varReplace(ie,B,Se)+" ":i+=" var "+B+" = "+Se+"; "+ie+" ",c&&(i+=" if (!"+y+") break; ")}e.errorPath=re}L&&(i+=" } "),i+=" } ",c&&(i+=" if ("+y+") { ",E+="}")}var k=e.opts.useDefaults&&!e.compositeRule;if(F.length){var W=F;if(W)for(var De,pe=-1,te=W.length-1;pe<te;){De=W[pe+=1];var H=a[De];if(e.opts.strictKeywords?typeof H=="object"&&Object.keys(H).length>0||H===!1:e.util.schemaHasRules(H,e.RULES.all)){var ge=e.util.getProperty(De),Se=d+ge,be=k&&H.default!==void 0;m.schema=H,m.schemaPath=l+ge,m.errSchemaPath=u+"/"+e.util.escapeFragment(De),m.errorPath=e.util.getPath(e.errorPath,De,e.opts.jsonPointers),m.dataPathArr[w]=e.util.toQuotedString(De);var ie=e.validate(m);if(m.baseId=Y,e.util.varOccurences(ie,B)<2){ie=e.util.varReplace(ie,B,Se);var Pe=Se}else{var Pe=B;i+=" var "+B+" = "+Se+"; "}if(be)i+=" "+ie+" ";else{if(ne&&ne[De]){i+=" if ( "+Pe+" === undefined ",O&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(De)+"') "),i+=") { "+y+" = false; ";var re=e.errorPath,X=u,pt=e.util.escapeQuotes(De);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(re,De,e.opts.jsonPointers)),u=e.errSchemaPath+"/required";var he=he||[];he.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+pt+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+pt+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var ae=i;i=he.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+ae+"]); ":i+=" validate.errors = ["+ae+"]; return false; ":i+=" var err = "+ae+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=X,e.errorPath=re,i+=" } else { "}else c?(i+=" if ( "+Pe+" === undefined ",O&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(De)+"') "),i+=") { "+y+" = true; } else { "):(i+=" if ("+Pe+" !== undefined ",O&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(De)+"') "),i+=" ) { ");i+=" "+ie+" } "}}c&&(i+=" if ("+y+") { ",E+="}")}}if(J.length){var Dt=J;if(Dt)for(var xe,Qt=-1,dt=Dt.length-1;Qt<dt;){xe=Dt[Qt+=1];var H=q[xe];if(e.opts.strictKeywords?typeof H=="object"&&Object.keys(H).length>0||H===!1:e.util.schemaHasRules(H,e.RULES.all)){m.schema=H,m.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(xe),m.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(xe),O?i+=" "+R+" = "+R+" || Object.keys("+d+"); for (var "+_+"=0; "+_+"<"+R+".length; "+_+"++) { var "+C+" = "+R+"["+_+"]; ":i+=" for (var "+C+" in "+d+") { ",i+=" if ("+e.usePattern(xe)+".test("+C+")) { ",m.errorPath=e.util.getPathExpr(e.errorPath,C,e.opts.jsonPointers);var Se=d+"["+C+"]";m.dataPathArr[w]=C;var ie=e.validate(m);m.baseId=Y,e.util.varOccurences(ie,B)<2?i+=" "+e.util.varReplace(ie,B,Se)+" ":i+=" var "+B+" = "+Se+"; "+ie+" ",c&&(i+=" if (!"+y+") break; "),i+=" } ",c&&(i+=" else "+y+" = true; "),i+=" } ",c&&(i+=" if ("+y+") { ",E+="}")}}}return c&&(i+=" "+E+" if ("+h+" == errors) {"),i}});var out=b((FXr,iut)=>{"use strict";iut.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="errs__"+o,m=e.util.copy(e),E="";m.level++;var y="valid"+m.level;if(i+="var "+h+" = errors;",e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all)){m.schema=a,m.schemaPath=l,m.errSchemaPath=u;var C="key"+o,_="idx"+o,w="i"+o,B="' + "+C+" + '",R=m.dataLevel=e.dataLevel+1,F="data"+R,q="dataProperties"+o,J=e.opts.ownProperties,j=e.baseId;J&&(i+=" var "+q+" = undefined; "),J?i+=" "+q+" = "+q+" || Object.keys("+d+"); for (var "+_+"=0; "+_+"<"+q+".length; "+_+"++) { var "+C+" = "+q+"["+_+"]; ":i+=" for (var "+C+" in "+d+") { ",i+=" var startErrs"+o+" = errors; ";var L=C,K=e.compositeRule;e.compositeRule=m.compositeRule=!0;var U=e.validate(m);m.baseId=j,e.util.varOccurences(U,F)<2?i+=" "+e.util.varReplace(U,F,L)+" ":i+=" var "+F+" = "+L+"; "+U+" ",e.compositeRule=m.compositeRule=K,i+=" if (!"+y+") { for (var "+w+"=startErrs"+o+"; "+w+"<errors; "+w+"++) { vErrors["+w+"].propertyName = "+C+"; } var err = ",e.createErrors!==!1?(i+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { propertyName: '"+B+"' } ",e.opts.messages!==!1&&(i+=" , message: 'property name \\'"+B+"\\' is invalid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),c&&(i+=" break; "),i+=" } }"}return c&&(i+=" "+E+" if ("+h+" == errors) {"),i}});var aut=b((LXr,sut)=>{"use strict";sut.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m=e.opts.$data&&a&&a.$data,E;m?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",E="schema"+o):E=a;var y="schema"+o;if(!m)if(a.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var C=[],_=a;if(_)for(var w,B=-1,R=_.length-1;B<R;){w=_[B+=1];var F=e.schema.properties[w];F&&(e.opts.strictKeywords?typeof F=="object"&&Object.keys(F).length>0||F===!1:e.util.schemaHasRules(F,e.RULES.all))||(C[C.length]=w)}}else var C=a;if(m||C.length){var q=e.errorPath,J=m||C.length>=e.opts.loopRequired,j=e.opts.ownProperties;if(c)if(i+=" var missing"+o+"; ",J){m||(i+=" var "+y+" = validate.schema"+l+"; ");var L="i"+o,K="schema"+o+"["+L+"]",U="' + "+K+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(q,K,e.opts.jsonPointers)),i+=" var "+h+" = true; ",m&&(i+=" if (schema"+o+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+o+")) "+h+" = false; else {"),i+=" for (var "+L+" = 0; "+L+" < "+y+".length; "+L+"++) { "+h+" = "+d+"["+y+"["+L+"]] !== undefined ",j&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", "+y+"["+L+"]) "),i+="; if (!"+h+") break; } ",m&&(i+=" } "),i+=" if (!"+h+") { ";var se=se||[];se.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+U+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+U+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var V=i;i=se.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+V+"]); ":i+=" validate.errors = ["+V+"]; return false; ":i+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var O=C;if(O)for(var Y,L=-1,ee=O.length-1;L<ee;){Y=O[L+=1],L&&(i+=" || ");var ne=e.util.getProperty(Y),Ae=d+ne;i+=" ( ( "+Ae+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(Y)+"') "),i+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?Y:ne)+") ) "}i+=") { ";var K="missing"+o,U="' + "+K+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(q,K,!0):q+" + "+K);var se=se||[];se.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+U+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+U+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var V=i;i=se.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+V+"]); ":i+=" validate.errors = ["+V+"]; return false; ":i+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else if(J){m||(i+=" var "+y+" = validate.schema"+l+"; ");var L="i"+o,K="schema"+o+"["+L+"]",U="' + "+K+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(q,K,e.opts.jsonPointers)),m&&(i+=" if ("+y+" && !Array.isArray("+y+")) { var err = ",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+U+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+U+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+y+" !== undefined) { "),i+=" for (var "+L+" = 0; "+L+" < "+y+".length; "+L+"++) { if ("+d+"["+y+"["+L+"]] === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", "+y+"["+L+"]) "),i+=") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+U+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+U+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",m&&(i+=" } ")}else{var Ce=C;if(Ce)for(var Y,De=-1,Ue=Ce.length-1;De<Ue;){Y=Ce[De+=1];var ne=e.util.getProperty(Y),U=e.util.escapeQuotes(Y),Ae=d+ne;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(q,Y,e.opts.jsonPointers)),i+=" if ( "+Ae+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(Y)+"') "),i+=") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+U+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+U+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=q}else c&&(i+=" if (true) {");return i}});var uut=b((PXr,lut)=>{"use strict";lut.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d="data"+(s||""),h="valid"+o,m=e.opts.$data&&a&&a.$data,E;if(m?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",E="schema"+o):E=a,(a||m)&&e.opts.uniqueItems!==!1){m&&(i+=" var "+h+"; if ("+E+" === false || "+E+" === undefined) "+h+" = true; else if (typeof "+E+" != 'boolean') "+h+" = false; else { "),i+=" var i = "+d+".length , "+h+" = true , j; if (i > 1) { ";var y=e.schema.items&&e.schema.items.type,C=Array.isArray(y);if(!y||y=="object"||y=="array"||C&&(y.indexOf("object")>=0||y.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+d+"[i], "+d+"[j])) { "+h+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+d+"[i]; ";var _="checkDataType"+(C?"s":"");i+=" if ("+e.util[_](y,"item",e.opts.strictNumbers,!0)+") continue; ",C&&(i+=` if (typeof item == 'string') item = '"' + item; `),i+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",m&&(i+=" } "),i+=" if (!"+h+") { ";var w=w||[];w.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",m?i+="validate.schema"+l:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var B=i;i=w.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+B+"]); ":i+=" validate.errors = ["+B+"]; return false; ":i+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c&&(i+=" else { ")}else c&&(i+=" if (true) { ");return i}});var dut=b((QXr,cut)=>{"use strict";cut.exports={$ref:Slt(),allOf:Ilt(),anyOf:blt(),$comment:wlt(),const:Blt(),contains:Olt(),dependencies:Flt(),enum:Plt(),format:klt(),if:Glt(),items:qlt(),maximum:m_e(),minimum:m_e(),maxItems:A_e(),minItems:A_e(),maxLength:g_e(),minLength:g_e(),maxProperties:E_e(),minProperties:E_e(),multipleOf:zlt(),not:Klt(),oneOf:Zlt(),pattern:tut(),properties:rut(),propertyNames:out(),required:aut(),uniqueItems:uut(),validate:p_e()}});var hut=b((kXr,put)=>{"use strict";var fut=dut(),y_e=QN().toHash;put.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],n=["type","$comment"],r=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],i=["number","integer","string","array","object","boolean","null"];return e.all=y_e(n),e.types=y_e(i),e.forEach(function(o){o.rules=o.rules.map(function(s){var a;if(typeof s=="object"){var l=Object.keys(s)[0];a=s[l],s=l,a.forEach(function(c){n.push(c),e.all[c]=!0})}n.push(s);var u=e.all[s]={keyword:s,code:fut[s],implements:a};return u}),e.all.$comment={keyword:"$comment",code:fut.$comment},o.type&&(e.types[o.type]=o)}),e.keywords=y_e(n.concat(r)),e.custom={},e}});var gut=b((UXr,Aut)=>{"use strict";var mut=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];Aut.exports=function(t,e){for(var n=0;n<e.length;n++){t=JSON.parse(JSON.stringify(t));var r=e[n].split("/"),i=t,o;for(o=1;o<r.length;o++)i=i[r[o]];for(o=0;o<mut.length;o++){var s=mut[o],a=i[s];a&&(i[s]={anyOf:[a,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return t}});var Cut=b((GXr,yut)=>{"use strict";var _Pn=see().MissingRef;yut.exports=Eut;function Eut(t,e,n){var r=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof e=="function"&&(n=e,e=void 0);var i=o(t).then(function(){var a=r._addSchema(t,void 0,e);return a.validate||s(a)});return n&&i.then(function(a){n(null,a)},n),i;function o(a){var l=a.$schema;return l&&!r.getSchema(l)?Eut.call(r,{$ref:l},!0):Promise.resolve()}function s(a){try{return r._compile(a)}catch(u){if(u instanceof _Pn)return l(u);throw u}function l(u){var c=u.missingSchema;if(m(c))throw new Error("Schema "+c+" is loaded but "+u.missingRef+" cannot be resolved");var d=r._loadingSchemas[c];return d||(d=r._loadingSchemas[c]=r._opts.loadSchema(c),d.then(h,h)),d.then(function(E){if(!m(c))return o(E).then(function(){m(c)||r.addSchema(E,c,void 0,e)})}).then(function(){return s(a)});function h(){delete r._loadingSchemas[c]}function m(E){return r._refs[E]||r._schemas[E]}}}}});var Dut=b((HXr,vut)=>{"use strict";vut.exports=function(e,n,r){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[n],l=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,d,h="data"+(s||""),m="valid"+o,E="errs__"+o,y=e.opts.$data&&a&&a.$data,C;y?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",C="schema"+o):C=a;var _=this,w="definition"+o,B=_.definition,R="",F,q,J,j,L;if(y&&B.$data){L="keywordValidate"+o;var K=B.validateSchema;i+=" var "+w+" = RULES.custom['"+n+"'].definition; var "+L+" = "+w+".validate;"}else{if(j=e.useCustomRule(_,a,e.schema,e),!j)return;C="validate.schema"+l,L=j.code,F=B.compile,q=B.inline,J=B.macro}var U=L+".errors",se="i"+o,V="ruleErr"+o,O=B.async;if(O&&!e.async)throw new Error("async keyword in sync schema");if(q||J||(i+=""+U+" = null;"),i+="var "+E+" = errors;var "+m+";",y&&B.$data&&(R+="}",i+=" if ("+C+" === undefined) { "+m+" = true; } else { ",K&&(R+="}",i+=" "+m+" = "+w+".validateSchema("+C+"); if ("+m+") { ")),q)B.statements?i+=" "+j.validate+" ":i+=" "+m+" = "+j.validate+"; ";else if(J){var Y=e.util.copy(e),R="";Y.level++;var ee="valid"+Y.level;Y.schema=j.validate,Y.schemaPath="";var ne=e.compositeRule;e.compositeRule=Y.compositeRule=!0;var Ae=e.validate(Y).replace(/validate\.schema/g,L);e.compositeRule=Y.compositeRule=ne,i+=" "+Ae}else{var Ce=Ce||[];Ce.push(i),i="",i+=" "+L+".call( ",e.opts.passContext?i+="this":i+="self",F||B.schema===!1?i+=" , "+h+" ":i+=" , "+C+" , "+h+" , validate.schema"+e.schemaPath+" ",i+=" , (dataPath || '')",e.errorPath!='""'&&(i+=" + "+e.errorPath);var De=s?"data"+(s-1||""):"parentData",Ue=s?e.dataPathArr[s]:"parentDataProperty";i+=" , "+De+" , "+Ue+" , rootData ) ";var qe=i;i=Ce.pop(),B.errors===!1?(i+=" "+m+" = ",O&&(i+="await "),i+=""+qe+"; "):O?(U="customErrors"+o,i+=" var "+U+" = null; try { "+m+" = await "+qe+"; } catch (e) { "+m+" = false; if (e instanceof ValidationError) "+U+" = e.errors; else throw e; } "):i+=" "+U+" = null; "+m+" = "+qe+"; "}if(B.modifying&&(i+=" if ("+De+") "+h+" = "+De+"["+Ue+"];"),i+=""+R,B.valid)c&&(i+=" if (true) { ");else{i+=" if ( ",B.valid===void 0?(i+=" !",J?i+=""+ee:i+=""+m):i+=" "+!B.valid+" ",i+=") { ",d=_.keyword;var Ce=Ce||[];Ce.push(i),i="";var Ce=Ce||[];Ce.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(d||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+_.keyword+"' } ",e.opts.messages!==!1&&(i+=` , message: 'should pass "`+_.keyword+`" keyword validation' `),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var Ie=i;i=Ce.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+Ie+"]); ":i+=" validate.errors = ["+Ie+"]; return false; ":i+=" var err = "+Ie+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var xe=i;i=Ce.pop(),q?B.errors?B.errors!="full"&&(i+=" for (var "+se+"="+E+"; "+se+"<errors; "+se+"++) { var "+V+" = vErrors["+se+"]; if ("+V+".dataPath === undefined) "+V+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+V+".schemaPath === undefined) { "+V+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(i+=" "+V+".schema = "+C+"; "+V+".data = "+h+"; "),i+=" } "):B.errors===!1?i+=" "+xe+" ":(i+=" if ("+E+" == errors) { "+xe+" } else { for (var "+se+"="+E+"; "+se+"<errors; "+se+"++) { var "+V+" = vErrors["+se+"]; if ("+V+".dataPath === undefined) "+V+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+V+".schemaPath === undefined) { "+V+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(i+=" "+V+".schema = "+C+"; "+V+".data = "+h+"; "),i+=" } } "):J?(i+=" var err = ",e.createErrors!==!1?(i+=" { keyword: '"+(d||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+_.keyword+"' } ",e.opts.messages!==!1&&(i+=` , message: 'should pass "`+_.keyword+`" keyword validation' `),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; ")):B.errors===!1?i+=" "+xe+" ":(i+=" if (Array.isArray("+U+")) { if (vErrors === null) vErrors = "+U+"; else vErrors = vErrors.concat("+U+"); errors = vErrors.length; for (var "+se+"="+E+"; "+se+"<errors; "+se+"++) { var "+V+" = vErrors["+se+"]; if ("+V+".dataPath === undefined) "+V+".dataPath = (dataPath || '') + "+e.errorPath+"; "+V+'.schemaPath = "'+u+'"; ',e.opts.verbose&&(i+=" "+V+".schema = "+C+"; "+V+".data = "+h+"; "),i+=" } } else { "+xe+" } "),i+=" } ",c&&(i+=" else { ")}return i}});var C_e=b((qXr,IPn)=>{IPn.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Iut=b((VXr,_ut)=>{"use strict";var Sut=C_e();_ut.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:Sut.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:Sut.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var but=b(($Xr,Tut)=>{"use strict";var TPn=/^[a-z_$][a-z0-9_$-]*$/i,bPn=Dut(),xPn=Iut();Tut.exports={add:wPn,get:RPn,remove:BPn,validate:v_e};function wPn(t,e){var n=this.RULES;if(n.keywords[t])throw new Error("Keyword "+t+" is already defined");if(!TPn.test(t))throw new Error("Keyword "+t+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var r=e.type;if(Array.isArray(r))for(var i=0;i<r.length;i++)s(t,r[i],e);else s(t,r,e);var o=e.metaSchema;o&&(e.$data&&this._opts.$data&&(o={anyOf:[o,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),e.validateSchema=this.compile(o,!0))}n.keywords[t]=n.all[t]=!0;function s(a,l,u){for(var c,d=0;d<n.length;d++){var h=n[d];if(h.type==l){c=h;break}}c||(c={type:l,rules:[]},n.push(c));var m={keyword:a,definition:u,custom:!0,code:bPn,implements:u.implements};c.rules.push(m),n.custom[a]=m}return this}function RPn(t){var e=this.RULES.custom[t];return e?e.definition:this.RULES.keywords[t]||!1}function BPn(t){var e=this.RULES;delete e.keywords[t],delete e.all[t],delete e.custom[t];for(var n=0;n<e.length;n++)for(var r=e[n].rules,i=0;i<r.length;i++)if(r[i].keyword==t){r.splice(i,1);break}return this}function v_e(t,e){v_e.errors=null;var n=this._validateKeyword=this._validateKeyword||this.compile(xPn,!0);if(n(t))return!0;if(v_e.errors=n.errors,e)throw new Error("custom keyword definition is invalid: "+this.errorsText(n.errors));return!1}});var xut=b((YXr,NPn)=>{NPn.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Qut=b((jXr,Put)=>{"use strict";var Rut=alt(),kN=oee(),OPn=ult(),But=s_e(),MPn=f_e(),FPn=vlt(),LPn=hut(),Nut=gut(),Out=QN();Put.exports=pc;pc.prototype.validate=QPn;pc.prototype.compile=kPn;pc.prototype.addSchema=UPn;pc.prototype.addMetaSchema=GPn;pc.prototype.validateSchema=HPn;pc.prototype.getSchema=VPn;pc.prototype.removeSchema=YPn;pc.prototype.addFormat=e5n;pc.prototype.errorsText=ZPn;pc.prototype._addSchema=jPn;pc.prototype._compile=WPn;pc.prototype.compileAsync=Cut();var hee=but();pc.prototype.addKeyword=hee.add;pc.prototype.getKeyword=hee.get;pc.prototype.removeKeyword=hee.remove;pc.prototype.validateKeyword=hee.validate;var Mut=see();pc.ValidationError=Mut.Validation;pc.MissingRefError=Mut.MissingRef;pc.$dataMetaSchema=Nut;var pee="http://json-schema.org/draft-07/schema",wut=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],PPn=["/properties"];function pc(t){if(!(this instanceof pc))return new pc(t);t=this._opts=Out.copy(t)||{},s5n(this),this._schemas={},this._refs={},this._fragments={},this._formats=FPn(t.format),this._cache=t.cache||new OPn,this._loadingSchemas={},this._compilations=[],this.RULES=LPn(),this._getId=zPn(t),t.loopRequired=t.loopRequired||1/0,t.errorDataPath=="property"&&(t._errorDataPathProperty=!0),t.serialize===void 0&&(t.serialize=MPn),this._metaOpts=o5n(this),t.formats&&r5n(this),t.keywords&&i5n(this),t5n(this),typeof t.meta=="object"&&this.addMetaSchema(t.meta),t.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),n5n(this)}function QPn(t,e){var n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error('no schema with key or ref "'+t+'"')}else{var r=this._addSchema(t);n=r.validate||this._compile(r)}var i=n(e);return n.$async!==!0&&(this.errors=n.errors),i}function kPn(t,e){var n=this._addSchema(t,void 0,e);return n.validate||this._compile(n)}function UPn(t,e,n,r){if(Array.isArray(t)){for(var i=0;i<t.length;i++)this.addSchema(t[i],void 0,n,r);return this}var o=this._getId(t);if(o!==void 0&&typeof o!="string")throw new Error("schema id must be string");return e=kN.normalizeId(e||o),Lut(this,e),this._schemas[e]=this._addSchema(t,n,r,!0),this}function GPn(t,e,n){return this.addSchema(t,e,n,!0),this}function HPn(t,e){var n=t.$schema;if(n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this._opts.defaultMeta||qPn(this),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var r=this.validate(n,t);if(!r&&e){var i="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(i);else throw new Error(i)}return r}function qPn(t){var e=t._opts.meta;return t._opts.defaultMeta=typeof e=="object"?t._getId(e)||e:t.getSchema(pee)?pee:void 0,t._opts.defaultMeta}function VPn(t){var e=Fut(this,t);switch(typeof e){case"object":return e.validate||this._compile(e);case"string":return this.getSchema(e);case"undefined":return $Pn(this,t)}}function $Pn(t,e){var n=kN.schema.call(t,{schema:{}},e);if(n){var r=n.schema,i=n.root,o=n.baseId,s=Rut.call(t,r,i,void 0,o);return t._fragments[e]=new But({ref:e,fragment:!0,schema:r,root:i,baseId:o,validate:s}),s}}function Fut(t,e){return e=kN.normalizeId(e),t._schemas[e]||t._refs[e]||t._fragments[e]}function YPn(t){if(t instanceof RegExp)return fee(this,this._schemas,t),fee(this,this._refs,t),this;switch(typeof t){case"undefined":return fee(this,this._schemas),fee(this,this._refs),this._cache.clear(),this;case"string":var e=Fut(this,t);return e&&this._cache.del(e.cacheKey),delete this._schemas[t],delete this._refs[t],this;case"object":var n=this._opts.serialize,r=n?n(t):t;this._cache.del(r);var i=this._getId(t);i&&(i=kN.normalizeId(i),delete this._schemas[i],delete this._refs[i])}return this}function fee(t,e,n){for(var r in e){var i=e[r];!i.meta&&(!n||n.test(r))&&(t._cache.del(i.cacheKey),delete e[r])}}function jPn(t,e,n,r){if(typeof t!="object"&&typeof t!="boolean")throw new Error("schema should be object or boolean");var i=this._opts.serialize,o=i?i(t):t,s=this._cache.get(o);if(s)return s;r=r||this._opts.addUsedSchema!==!1;var a=kN.normalizeId(this._getId(t));a&&r&&Lut(this,a);var l=this._opts.validateSchema!==!1&&!e,u;l&&!(u=a&&a==kN.normalizeId(t.$schema))&&this.validateSchema(t,!0);var c=kN.ids.call(this,t),d=new But({id:a,schema:t,localRefs:c,cacheKey:o,meta:n});return a[0]!="#"&&r&&(this._refs[a]=d),this._cache.put(o,d),l&&u&&this.validateSchema(t,!0),d}function WPn(t,e){if(t.compiling)return t.validate=i,i.schema=t.schema,i.errors=null,i.root=e||i,t.schema.$async===!0&&(i.$async=!0),i;t.compiling=!0;var n;t.meta&&(n=this._opts,this._opts=this._metaOpts);var r;try{r=Rut.call(this,t.schema,e,t.localRefs)}catch(o){throw delete t.validate,o}finally{t.compiling=!1,t.meta&&(this._opts=n)}return t.validate=r,t.refs=r.refs,t.refVal=r.refVal,t.root=r.root,r;function i(){var o=t.validate,s=o.apply(this,arguments);return i.errors=o.errors,s}}function zPn(t){switch(t.schemaId){case"auto":return XPn;case"id":return JPn;default:return KPn}}function JPn(t){return t.$id&&this.logger.warn("schema $id ignored",t.$id),t.id}function KPn(t){return t.id&&this.logger.warn("schema id ignored",t.id),t.$id}function XPn(t){if(t.$id&&t.id&&t.$id!=t.id)throw new Error("schema $id is different from id");return t.$id||t.id}function ZPn(t,e){if(t=t||this.errors,!t)return"No errors";e=e||{};for(var n=e.separator===void 0?", ":e.separator,r=e.dataVar===void 0?"data":e.dataVar,i="",o=0;o<t.length;o++){var s=t[o];s&&(i+=r+s.dataPath+" "+s.message+n)}return i.slice(0,-n.length)}function e5n(t,e){return typeof e=="string"&&(e=new RegExp(e)),this._formats[t]=e,this}function t5n(t){var e;if(t._opts.$data&&(e=xut(),t.addMetaSchema(e,e.$id,!0)),t._opts.meta!==!1){var n=C_e();t._opts.$data&&(n=Nut(n,PPn)),t.addMetaSchema(n,pee,!0),t._refs["http://json-schema.org/schema"]=pee}}function n5n(t){var e=t._opts.schemas;if(e)if(Array.isArray(e))t.addSchema(e);else for(var n in e)t.addSchema(e[n],n)}function r5n(t){for(var e in t._opts.formats){var n=t._opts.formats[e];t.addFormat(e,n)}}function i5n(t){for(var e in t._opts.keywords){var n=t._opts.keywords[e];t.addKeyword(e,n)}}function Lut(t,e){if(t._schemas[e]||t._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function o5n(t){for(var e=Out.copy(t._opts),n=0;n<wut.length;n++)delete e[wut[n]];return e}function s5n(t){var e=t._opts.logger;if(e===!1)t.logger={log:D_e,warn:D_e,error:D_e};else{if(e===void 0&&(e=console),!(typeof e=="object"&&e.log&&e.warn&&e.error))throw new Error("logger must implement log, warn and error methods");t.logger=e}}function D_e(){}});var kut,mx,mee=Le(()=>{Pat();dx();kut=Qe(Qut(),1),mx=class extends KZ{constructor(e,n){var r;super(n),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(r=n?.capabilities)!==null&&r!==void 0?r:{},this._ajv=new kut.default}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Lat(this._capabilities,e)}assertCapability(e,n){var r;if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r[e]))throw new Error(`Server does not support ${e} (required for ${n})`)}async connect(e,n){if(await super.connect(e),e.sessionId===void 0)try{let r=await this.request({method:"initialize",params:{protocolVersion:J8,capabilities:this._capabilities,clientInfo:this._clientInfo}},VSe,n);if(r===void 0)throw new Error(`Server sent invalid initialize result: ${r}`);if(!Eat.includes(r.protocolVersion))throw new Error(`Server's protocol version is not supported: ${r.protocolVersion}`);this._serverCapabilities=r.capabilities,this._serverVersion=r.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(r.protocolVersion),this._instructions=r.instructions,await this.notification({method:"notifications/initialized"})}catch(r){throw this.close(),r}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var n,r,i,o,s;switch(e){case"logging/setLevel":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((i=this._serverCapabilities)===null||i===void 0)&&i.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((o=this._serverCapabilities)===null||o===void 0)&&o.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s.completions))throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){var n;switch(e){case"notifications/roots/list_changed":if(!(!((n=this._capabilities.roots)===null||n===void 0)&&n.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"ping":break}}async ping(e){return this.request({method:"ping"},PN,e)}async complete(e,n){return this.request({method:"completion/complete",params:e},XSe,n)}async setLoggingLevel(e,n){return this.request({method:"logging/setLevel",params:{level:e}},PN,n)}async getPrompt(e,n){return this.request({method:"prompts/get",params:e},gG,n)}async listPrompts(e,n){return this.request({method:"prompts/list",params:e},AG,n)}async listResources(e,n){return this.request({method:"resources/list",params:e},$Se,n)}async listResourceTemplates(e,n){return this.request({method:"resources/templates/list",params:e},YSe,n)}async readResource(e,n){return this.request({method:"resources/read",params:e},jSe,n)}async subscribeResource(e,n){return this.request({method:"resources/subscribe",params:e},PN,n)}async unsubscribeResource(e,n){return this.request({method:"resources/unsubscribe",params:e},PN,n)}async callTool(e,n=JZ,r){let i=await this.request({method:"tools/call",params:e},n,r),o=this.getToolOutputValidator(e.name);if(o){if(!i.structuredContent&&!i.isError)throw new by(Ty.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(i.structuredContent)try{if(!o(i.structuredContent))throw new by(Ty.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(o.errors)}`)}catch(s){throw s instanceof by?s:new by(Ty.InvalidParams,`Failed to validate structured content: ${s instanceof Error?s.message:String(s)}`)}}return i}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(let n of e)if(n.outputSchema)try{let r=this._ajv.compile(n.outputSchema);this._cachedToolOutputValidators.set(n.name,r)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,n){let r=await this.request({method:"tools/list",params:e},KSe,n);return this.cacheToolOutputSchemas(r.tools),r}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}});var Vut=b((KXr,qut)=>{qut.exports=Hut;Hut.sync=l5n;var Uut=we("fs");function a5n(t,e){var n=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function Gut(t,e,n){return!t.isSymbolicLink()&&!t.isFile()?!1:a5n(e,n)}function Hut(t,e,n){Uut.stat(t,function(r,i){n(r,r?!1:Gut(i,t,e))})}function l5n(t,e){return Gut(Uut.statSync(t),t,e)}});var zut=b((XXr,Wut)=>{Wut.exports=Yut;Yut.sync=u5n;var $ut=we("fs");function Yut(t,e,n){$ut.stat(t,function(r,i){n(r,r?!1:jut(i,e))})}function u5n(t,e){return jut($ut.statSync(t),e)}function jut(t,e){return t.isFile()&&c5n(t,e)}function c5n(t,e){var n=t.mode,r=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),u=parseInt("001",8),c=a|l,d=n&u||n&l&&i===s||n&a&&r===o||n&c&&o===0;return d}});var Kut=b((eZr,Jut)=>{var ZXr=we("fs"),Aee;process.platform==="win32"||global.TESTING_WINDOWS?Aee=Vut():Aee=zut();Jut.exports=S_e;S_e.sync=d5n;function S_e(t,e,n){if(typeof e=="function"&&(n=e,e={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,i){S_e(t,e||{},function(o,s){o?i(o):r(s)})})}Aee(t,e||{},function(r,i){r&&(r.code==="EACCES"||e&&e.ignoreErrors)&&(r=null,i=!1),n(r,i)})}function d5n(t,e){try{return Aee.sync(t,e||{})}catch(n){if(e&&e.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var ict=b((tZr,rct)=>{var X8=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Xut=we("path"),f5n=X8?";":":",Zut=Kut(),ect=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),tct=(t,e)=>{let n=e.colon||f5n,r=t.match(/\//)||X8&&t.match(/\\/)?[""]:[...X8?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(n)],i=X8?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=X8?i.split(n):[""];return X8&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:r,pathExt:o,pathExtExe:i}},nct=(t,e,n)=>{typeof e=="function"&&(n=e,e={}),e||(e={});let{pathEnv:r,pathExt:i,pathExtExe:o}=tct(t,e),s=[],a=u=>new Promise((c,d)=>{if(u===r.length)return e.all&&s.length?c(s):d(ect(t));let h=r[u],m=/^".*"$/.test(h)?h.slice(1,-1):h,E=Xut.join(m,t),y=!m&&/^\.[\\\/]/.test(t)?t.slice(0,2)+E:E;c(l(y,u,0))}),l=(u,c,d)=>new Promise((h,m)=>{if(d===i.length)return h(a(c+1));let E=i[d];Zut(u+E,{pathExt:o},(y,C)=>{if(!y&&C)if(e.all)s.push(u+E);else return h(u+E);return h(l(u,c,d+1))})});return n?a(0).then(u=>n(null,u),n):a(0)},p5n=(t,e)=>{e=e||{};let{pathEnv:n,pathExt:r,pathExtExe:i}=tct(t,e),o=[];for(let s=0;s<n.length;s++){let a=n[s],l=/^".*"$/.test(a)?a.slice(1,-1):a,u=Xut.join(l,t),c=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let d=0;d<r.length;d++){let h=c+r[d];try{if(Zut.sync(h,{pathExt:i}))if(e.all)o.push(h);else return h}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw ect(t)};rct.exports=nct;nct.sync=p5n});var sct=b((nZr,__e)=>{"use strict";var oct=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};__e.exports=oct;__e.exports.default=oct});var cct=b((rZr,uct)=>{"use strict";var act=we("path"),h5n=ict(),m5n=sct();function lct(t,e){let n=t.options.env||process.env,r=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=h5n.sync(t.command,{path:n[m5n({env:n})],pathExt:e?act.delimiter:void 0})}catch{}finally{o&&process.chdir(r)}return s&&(s=act.resolve(i?t.options.cwd:"",s)),s}function A5n(t){return lct(t)||lct(t,!0)}uct.exports=A5n});var dct=b((iZr,T_e)=>{"use strict";var I_e=/([()\][%!^"`<>&|;, *?])/g;function g5n(t){return t=t.replace(I_e,"^$1"),t}function E5n(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(I_e,"^$1"),e&&(t=t.replace(I_e,"^$1")),t}T_e.exports.command=g5n;T_e.exports.argument=E5n});var pct=b((oZr,fct)=>{"use strict";fct.exports=/^#!(.*)/});var mct=b((sZr,hct)=>{"use strict";var y5n=pct();hct.exports=(t="")=>{let e=t.match(y5n);if(!e)return null;let[n,r]=e[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return i==="env"?r:r?`${i} ${r}`:i}});var gct=b((aZr,Act)=>{"use strict";var b_e=we("fs"),C5n=mct();function v5n(t){let n=Buffer.alloc(150),r;try{r=b_e.openSync(t,"r"),b_e.readSync(r,n,0,150,0),b_e.closeSync(r)}catch{}return C5n(n.toString())}Act.exports=v5n});var vct=b((lZr,Cct)=>{"use strict";var D5n=we("path"),Ect=cct(),yct=dct(),S5n=gct(),_5n=process.platform==="win32",I5n=/\.(?:com|exe)$/i,T5n=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function b5n(t){t.file=Ect(t);let e=t.file&&S5n(t.file);return e?(t.args.unshift(t.file),t.command=e,Ect(t)):t.file}function x5n(t){if(!_5n)return t;let e=b5n(t),n=!I5n.test(e);if(t.options.forceShell||n){let r=T5n.test(e);t.command=D5n.normalize(t.command),t.command=yct.command(t.command),t.args=t.args.map(o=>yct.argument(o,r));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function w5n(t,e,n){e&&!Array.isArray(e)&&(n=e,e=null),e=e?e.slice(0):[],n=Object.assign({},n);let r={command:t,args:e,options:n,file:void 0,original:{command:t,args:e}};return n.shell?r:x5n(r)}Cct.exports=w5n});var _ct=b((uZr,Sct)=>{"use strict";var x_e=process.platform==="win32";function w_e(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function R5n(t,e){if(!x_e)return;let n=t.emit;t.emit=function(r,i){if(r==="exit"){let o=Dct(i,e);if(o)return n.call(t,"error",o)}return n.apply(t,arguments)}}function Dct(t,e){return x_e&&t===1&&!e.file?w_e(e.original,"spawn"):null}function B5n(t,e){return x_e&&t===1&&!e.file?w_e(e.original,"spawnSync"):null}Sct.exports={hookChildProcess:R5n,verifyENOENT:Dct,verifyENOENTSync:B5n,notFoundError:w_e}});var bct=b((cZr,Z8)=>{"use strict";var Ict=we("child_process"),R_e=vct(),B_e=_ct();function Tct(t,e,n){let r=R_e(t,e,n),i=Ict.spawn(r.command,r.args,r.options);return B_e.hookChildProcess(i,r),i}function N5n(t,e,n){let r=R_e(t,e,n),i=Ict.spawnSync(r.command,r.args,r.options);return i.error=i.error||B_e.verifyENOENTSync(i.status,r),i}Z8.exports=Tct;Z8.exports.spawn=Tct;Z8.exports.sync=N5n;Z8.exports._parse=R_e;Z8.exports._enoent=B_e});function O5n(t){return cx.parse(JSON.parse(t))}function xct(t){return JSON.stringify(t)+`
|
|
545
545
|
`}var gee,wct=Le(()=>{dx();gee=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
546
546
|
`);if(e===-1)return null;let n=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),O5n(n)}clear(){this._buffer=void 0}}});import yee from"node:process";import{PassThrough as M5n}from"node:stream";function L5n(){let t={};for(let e of F5n){let n=yee.env[e];n!==void 0&&(n.startsWith("()")||(t[e]=n))}return t}function P5n(){return"type"in yee}var Rct,F5n,Eee,Bct=Le(()=>{Rct=Qe(bct(),1);wct();F5n=yee.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];Eee=class{constructor(e){this._abortController=new AbortController,this._readBuffer=new gee,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new M5n)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,n)=>{var r,i,o,s,a;this._process=(0,Rct.default)(this._serverParams.command,(r=this._serverParams.args)!==null&&r!==void 0?r:[],{env:{...L5n(),...this._serverParams.env},stdio:["pipe","pipe",(i=this._serverParams.stderr)!==null&&i!==void 0?i:"inherit"],shell:!1,signal:this._abortController.signal,windowsHide:yee.platform==="win32"&&P5n(),cwd:this._serverParams.cwd}),this._process.on("error",l=>{var u,c;if(l.name==="AbortError"){(u=this.onclose)===null||u===void 0||u.call(this);return}n(l),(c=this.onerror)===null||c===void 0||c.call(this,l)}),this._process.on("spawn",()=>{e()}),this._process.on("close",l=>{var u;this._process=void 0,(u=this.onclose)===null||u===void 0||u.call(this)}),(o=this._process.stdin)===null||o===void 0||o.on("error",l=>{var u;(u=this.onerror)===null||u===void 0||u.call(this,l)}),(s=this._process.stdout)===null||s===void 0||s.on("data",l=>{this._readBuffer.append(l),this.processReadBuffer()}),(a=this._process.stdout)===null||a===void 0||a.on("error",l=>{var u;(u=this.onerror)===null||u===void 0||u.call(this,l)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){var e,n;return this._stderrStream?this._stderrStream:(n=(e=this._process)===null||e===void 0?void 0:e.stderr)!==null&&n!==void 0?n:null}get pid(){var e,n;return(n=(e=this._process)===null||e===void 0?void 0:e.pid)!==null&&n!==void 0?n:null}processReadBuffer(){for(var e,n;;)try{let r=this._readBuffer.readMessage();if(r===null)break;(e=this.onmessage)===null||e===void 0||e.call(this,r)}catch(r){(n=this.onerror)===null||n===void 0||n.call(this,r)}}async close(){this._abortController.abort(),this._process=void 0,this._readBuffer.clear()}send(e){return new Promise(n=>{var r;if(!(!((r=this._process)===null||r===void 0)&&r.stdin))throw new Error("Not connected");let i=xct(e);this._process.stdin.write(i)?n():this._process.stdin.once("drain",n)})}}});function N_e(t){}function vee(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=N_e,onError:n=N_e,onRetry:r=N_e,onComment:i}=t,o="",s=!0,a,l="",u="";function c(y){let C=s?y.replace(/^\xEF\xBB\xBF/,""):y,[_,w]=Q5n(`${o}${C}`);for(let B of _)d(B);o=w,s=!1}function d(y){if(y===""){m();return}if(y.startsWith(":")){i&&i(y.slice(y.startsWith(": ")?2:1));return}let C=y.indexOf(":");if(C!==-1){let _=y.slice(0,C),w=y[C+1]===" "?2:1,B=y.slice(C+w);h(_,B,y);return}h(y,"",y)}function h(y,C,_){switch(y){case"event":u=C;break;case"data":l=`${l}${C}
|
|
547
547
|
`;break;case"id":a=C.includes("\0")?void 0:C;break;case"retry":/^\d+$/.test(C)?r(parseInt(C,10)):n(new Cee(`Invalid \`retry\` value: "${C}"`,{type:"invalid-retry",value:C,line:_}));break;default:n(new Cee(`Unknown field "${y.length>20?`${y.slice(0,20)}\u2026`:y}"`,{type:"unknown-field",field:y,value:C,line:_}));break}}function m(){l.length>0&&e({id:a,event:u||void 0,data:l.endsWith(`
|
|
@@ -2084,7 +2084,7 @@ Error: ${i}`}}};AKt={command:"add <name-or-id>",describe:"Add an agent from onli
|
|
|
2084
2084
|
`);let r=n.filter(o=>o.location==="project"),i=n.filter(o=>o.location==="global");if(r.length>0){console.log(`${m4r}Project agents:${qpe}`);for(let o of r){if(console.log(`\u2022 ${EKt}${o.name}${qpe} (${o.agentType})`),o.description&&console.log(` Description: ${o.description}`),o.model&&console.log(` Model: ${o.model}`),o.allowedTools&&o.allowedTools.length>0){let s=o.allowedTools.includes("*")?"All tools":o.allowedTools.join(", "),a=o.isInheritTools===!1?" (no inherit)":"";console.log(` Tools: ${s}${a}`)}else o.isInheritTools===!1&&console.log(" Tools: None (no inherit)");o.allowedMcps&&o.allowedMcps.length>0?console.log(` MCPs: ${o.allowedMcps.join(", ")}`):o.isInheritMcps===!1&&console.log(" MCPs: None (no inherit)"),console.log(` Location: ${o.filePath||"unknown"}`),console.log()}}if(i.length>0){console.log(`${h4r}Global agents:${qpe}`);for(let o of i){if(console.log(`\u2022 ${EKt}${o.name}${qpe} (${o.agentType})`),o.description&&console.log(` Description: ${o.description}`),o.model&&console.log(` Model: ${o.model}`),o.allowedTools&&o.allowedTools.length>0){let s=o.allowedTools.includes("*")?"All tools":o.allowedTools.join(", "),a=o.isInheritTools===!1?" (no inherit)":"";console.log(` Tools: ${s}${a}`)}else o.isInheritTools===!1&&console.log(" Tools: None (no inherit)");o.allowedMcps&&o.allowedMcps.length>0?console.log(` MCPs: ${o.allowedMcps.join(", ")}`):o.isInheritMcps===!1&&console.log(" MCPs: None (no inherit)"),console.log(` Location: ${o.filePath||"unknown"}`),console.log()}}console.log(`Total: ${n.length} agent(s) configured`)}catch(n){console.error("Error loading agents:",n),process.exit(1)}}var EKt,h4r,m4r,qpe,yKt,CKt=Le(()=>{"use strict";qn();EKt="\x1B[32m",h4r="\x1B[33m",m4r="\x1B[34m",qpe="\x1B[0m";yKt={command:"list",describe:"List configured agents",builder:t=>t.usage("Usage: iflow agent list"),handler:async()=>{await A4r()}}});import*as Vpe from"fs";async function g4r(t,e){let{scope:n}=e,r=process.cwd(),i=om(r);try{let s=(await i.getAgents()).filter(a=>a.name===t||a.agentType===t);if(n&&n!=="all"&&(s=s.filter(a=>a.location===n)),s.length===0){let a=n&&n!=="all"?` in ${n} scope`:"";console.error(`Error: Agent '${t}' not found${a}`),process.exit(1)}if(s.length>1&&!n){console.error(`Error: Multiple agents found with name '${t}'. Please specify scope:`);for(let a of s)console.error(` - ${a.name} (${a.location}): ${a.filePath}`);console.error("Use --scope to specify which one to remove."),process.exit(1)}for(let a of s)try{a.filePath&&Vpe.existsSync(a.filePath)?(Vpe.unlinkSync(a.filePath),console.log(`Successfully removed agent '${a.name}' from ${a.location} scope`),console.log(`Deleted: ${a.filePath}`)):console.warn(`Warning: Agent file not found: ${a.filePath}`)}catch(l){console.error(`Error removing agent file ${a.filePath}:`,l),process.exit(1)}await i.refresh()}catch(o){console.error("Error removing agent:",o),process.exit(1)}}var vKt,DKt=Le(()=>{"use strict";qn();vKt={command:"remove <name>",describe:"Remove an agent",builder:t=>t.usage("Usage: iflow agent remove <name> [--scope project|global|all]").positional("name",{describe:"Name or type of the agent to remove",type:"string",demandOption:!0}).option("scope",{alias:"s",describe:"Scope to remove from (project, global, or all)",type:"string",choices:["project","global","all"]}),handler:async t=>{await g4r(t.name,{scope:t.scope})}}});import*as $pe from"fs";async function v4r(t){let e=process.cwd(),n=om(e);try{let i=(await n.getAgents()).filter(o=>o.name===t||o.agentType===t);i.length===0&&(console.error(`Error: Agent '${t}' not found`),process.exit(1));for(let o of i){if(console.log(`${E4r}Agent: ${o.name}${pm}`),console.log(`${oE}Type:${pm} ${o.agentType}`),console.log(`${oE}Location:${pm} ${o.location}`),console.log(`${oE}File:${pm} ${o.filePath}`),o.description&&console.log(`${oE}Description:${pm} ${o.description}`),o.whenToUse&&console.log(`${oE}When to use:${pm} ${o.whenToUse}`),o.model&&console.log(`${oE}Model:${pm} ${o.model}`),o.allowedTools&&o.allowedTools.length>0){let s=o.allowedTools.includes("*")?"All tools":o.allowedTools.join(", "),a=o.isInheritTools===!1?" (no inherit)":"";console.log(`${oE}Allowed Tools:${pm} ${s}${a}`)}else o.isInheritTools===!1?console.log(`${oE}Allowed Tools:${pm} None (no inherit)`):console.log(`${oE}Allowed Tools:${pm} All tools (inherit)`);if(o.allowedMcps&&o.allowedMcps.length>0?console.log(`${oE}Allowed MCP Servers:${pm} ${o.allowedMcps.join(", ")}`):o.isInheritMcps===!1?console.log(`${oE}Allowed MCP Servers:${pm} None (no inherit)`):console.log(`${oE}Allowed MCP Servers:${pm} All MCP servers (inherit)`),o.systemPrompt&&(console.log(`${oE}System Prompt:${pm}`),console.log(o.systemPrompt)),o.filePath&&$pe.existsSync(o.filePath))try{let s=$pe.readFileSync(o.filePath,"utf8");console.log(`
|
|
2085
2085
|
${C4r}File Content:${pm}`),console.log("\u2500".repeat(50)),console.log(s),console.log("\u2500".repeat(50))}catch(s){console.warn(`Warning: Could not read file content: ${s}`)}else console.warn(`${y4r}Warning:${pm} Agent file not found at ${o.filePath||"unknown path"}`);i.length>1&&console.log(`
|
|
2086
2086
|
`+"=".repeat(60)+`
|
|
2087
|
-
`)}}catch(r){console.error("Error getting agent details:",r),process.exit(1)}}var E4r,y4r,oE,C4r,pm,SKt,_Kt=Le(()=>{"use strict";qn();E4r="\x1B[32m",y4r="\x1B[33m",oE="\x1B[34m",C4r="\x1B[36m",pm="\x1B[0m";SKt={command:"get <name>",describe:"Get details about an agent",builder:t=>t.usage("Usage: iflow agent get <name>").positional("name",{describe:"Name or type of the agent",type:"string",demandOption:!0}),handler:async t=>{await v4r(t.name)}}});async function I4r(t={}){let{page:e=1,size:n=20,search:r}=t,o=qa(process.cwd()).merged.apiKey;o||(console.error("Error: API key not found."),console.error("Please authenticate first by running the auth command."),process.exit(1)),console.log("Loading online agents...");try{let s=await _4r(o,e,n);s.success||(console.error(`Error: ${s.message}`),process.exit(1));let a=s.agents||[];if(r&&(a=a.filter(l=>l.name.toLowerCase().includes(r.toLowerCase())||l.description.toLowerCase().includes(r.toLowerCase())||l.category.toLowerCase().includes(r.toLowerCase()))),a.length===0){let l=r?` matching "${r}"`:"";console.log(`No agents found${l}`);return}console.log(`\\n${S4r}Online Agents${r?` (filtered by "${r}")`:""}:${__}\\n`);for(let l of a)console.log(`${D4r}\u2022 ${l.name}${__} (ID: ${l.id})`),console.log(` ${VQ}Description:${__} ${l.description}`),console.log(` ${VQ}Category:${__} ${l.category}`),console.log(` ${VQ}Model:${__} ${l.modelName}`),l.tags&&console.log(` ${VQ}Tags:${__} ${l.tags}`),console.log(` ${VQ}Author:${__} ${l.authorId}`),console.log(` ${VQ}Version:${__} ${l.version}`),console.log();console.log(`${IKt}Total: ${a.length} agent(s) shown${s.total?` (${s.total} total available)`:""}${__}`),console.log(`${IKt}To install an agent, use: iflow agent add <name-or-id>${__}`)}catch(s){console.error("Error browsing online agents:",s),process.exit(1)}}var D4r,IKt,S4r,VQ,__,_4r,TKt,bKt=Le(()=>{"use strict";Yu();D4r="\x1B[32m",IKt="\x1B[33m",S4r="\x1B[34m",VQ="\x1B[36m",__="\x1B[0m",_4r=async(t,e=1,n=20)=>{try{if(!t)return{success:!1,message:"Please authenticate first by running the auth command"};let i=await fetch("https://apis.iflow.cn/v1/agents/list",{method:"POST",headers:{Authorization:`Bearer ${t}`,"User-Agent":"iFlow-Cli","Content-Type":"application/json"},body:JSON.stringify({page:e,size:n})});if(!i.ok){let a="Unable to load agents. Please try again later";return i.status===401?a="Authentication failed. Please check your API key or re-authenticate":i.status===403?a="Access denied. Please check your permissions":i.status===404?a="Agents service not found. Please try again later":i.status>=500&&(a="Server error. Please try again later"),{success:!1,message:a}}let o=await i.json();return o.success?{success:!0,agents:Array.isArray(o.data.data)?o.data.data:[],total:o.data.total||0}:{success:!1,message:o.message||"Failed to load agents from server"}}catch(r){let i="Unable to load agents. Please check your connection and try again";return r instanceof Error&&r.message.includes("Failed to fetch")&&(i="Network error. Please check your internet connection"),{success:!1,message:i}}};TKt={command:"online",describe:"Browse online agent repository",builder:t=>t.usage("Usage: iflow agent online [options]").option("page",{alias:"p",describe:"Page number (default: 1)",type:"number",default:1}).option("size",{alias:"s",describe:"Number of agents per page (default: 20)",type:"number",default:20}).option("search",{describe:"Search term to filter agents",type:"string"}),handler:async t=>{await I4r({page:t.page,size:t.size,search:t.search})}}});var xKt={};h0(xKt,{agentCommand:()=>SQe});var SQe,_Qe=Le(()=>{"use strict";gKt();CKt();DKt();_Kt();bKt();SQe={command:"agent",describe:"Manage agents",builder:t=>t.command(AKt).command(yKt).command(vKt).command(SKt).command(TKt).demandCommand(1,"You need at least one command before continuing.").version(!1),handler:()=>{}}});var lXt=b((TGi,aXt)=>{"use strict";var oFr=we("os"),sXt=we("tty"),y1=L7(),{env:Ap}=process,cR;y1("no-color")||y1("no-colors")||y1("color=false")||y1("color=never")?cR=0:(y1("color")||y1("colors")||y1("color=true")||y1("color=always"))&&(cR=1);"FORCE_COLOR"in Ap&&(Ap.FORCE_COLOR==="true"?cR=1:Ap.FORCE_COLOR==="false"?cR=0:cR=Ap.FORCE_COLOR.length===0?1:Math.min(parseInt(Ap.FORCE_COLOR,10),3));function LQe(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function PQe(t,e){if(cR===0)return 0;if(y1("color=16m")||y1("color=full")||y1("color=truecolor"))return 3;if(y1("color=256"))return 2;if(t&&!e&&cR===void 0)return 0;let n=cR||0;if(Ap.TERM==="dumb")return n;if(process.platform==="win32"){let r=oFr.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Ap)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Ap)||Ap.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Ap)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ap.TEAMCITY_VERSION)?1:0;if(Ap.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ap){let r=parseInt((Ap.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ap.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ap.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ap.TERM)||"COLORTERM"in Ap?1:n}function sFr(t){let e=PQe(t,t&&t.isTTY);return LQe(e)}aXt.exports={supportsColor:sFr,stdout:LQe(PQe(!0,sXt.isatty(1))),stderr:LQe(PQe(!0,sXt.isatty(2)))}});var dXt=b((bGi,cXt)=>{"use strict";var aFr=lXt(),WQ=L7();function uXt(t){if(/^\d{3,4}$/.test(t)){let n=/(\d{1,2})(\d{2})/.exec(t);return{major:0,minor:parseInt(n[1],10),patch:parseInt(n[2],10)}}let e=(t||"").split(".").map(n=>parseInt(n,10));return{major:e[0],minor:e[1],patch:e[2]}}function QQe(t){let{env:e}=process;if("FORCE_HYPERLINK"in e)return!(e.FORCE_HYPERLINK.length>0&&parseInt(e.FORCE_HYPERLINK,10)===0);if(WQ("no-hyperlink")||WQ("no-hyperlinks")||WQ("hyperlink=false")||WQ("hyperlink=never"))return!1;if(WQ("hyperlink=true")||WQ("hyperlink=always")||"NETLIFY"in e)return!0;if(!aFr.supportsColor(t)||t&&!t.isTTY||process.platform==="win32"||"CI"in e||"TEAMCITY_VERSION"in e)return!1;if("TERM_PROGRAM"in e){let n=uXt(e.TERM_PROGRAM_VERSION);switch(e.TERM_PROGRAM){case"iTerm.app":return n.major===3?n.minor>=1:n.major>3;case"WezTerm":return n.major>=20200620;case"vscode":return n.major>1||n.major===1&&n.minor>=72}}if("VTE_VERSION"in e){if(e.VTE_VERSION==="0.50.0")return!1;let n=uXt(e.VTE_VERSION);return n.major>0||n.minor>=50}return!1}cXt.exports={supportsHyperlink:QQe,stdout:QQe(process.stdout),stderr:QQe(process.stderr)}});var YQe={};h0(YQe,{AuthHandler:()=>$Qe});var $Qe,jQe=Le(()=>{"use strict";$Qe=class{logger;constructor(e={}){this.logger=console}validateToken(e){return e.authToken?e.authToken.length<16?(console.error("Auth token appears to be invalid (too short)"),!1):!0:(console.error("No auth token found in server config"),!1)}buildAuthenticatedUrl(e){if(!this.validateToken(e))throw new Error("Invalid authentication token");return`${e.serverUrl.replace(/^http/,"ws")}/ws?token=${encodeURIComponent(e.authToken)}`}buildAuthHeaders(e){if(!this.validateToken(e))throw new Error("Invalid authentication token");return{Auttion:`Bearer ${e.authToken}`,"X-Auth-Token":e.authToken}}isTokenExpired(e,n=24*60*60*1e3){let i=Date.now()-e.timestamp;return i>n?(console.warn(`Token is ${Math.floor(i/1e3/60)} minutes old`),!0):!1}}});var zQe={};h0(zQe,{WebSocketClientImpl:()=>WQe});import{EventEmitter as LFr}from"events";var WQe,JQe=Le(()=>{"use strict";V4();Cde();WQe=class extends LFr{ws;config;isConnectedFlag=!1;heartbeatInterval;reconnectTimer;reconnectAttempts=0;pendingResponses=new Map;options;constructor(e={}){super(),this.options={reconnectAttempts:e.reconnectAttempts??3,reconnectDelay:e.reconnectDelay??1e3,heartbeatInterval:e.heartbeatInterval??3e4,connectionTimeout:e.connectionTimeout??5e3,logger:console}}async connect(e){return this.config=e,this.reconnectAttempts=0,new Promise((n,r)=>{let i=setTimeout(()=>{r(new Error("Connection timeout")),this.disconnect()},this.options.connectionTimeout);try{let o=`${e.serverUrl}?token=${e.authToken}`;this.ws=new q4(o),this.ws.on("open",()=>{clearTimeout(i),this.isConnectedFlag=!0,console.debug("WebSocket connected"),this.sendConnectMessage(),this.startHeartbeat(),n()}),this.ws.on("message",s=>{try{let a=JSON.parse(s.toString());this.handleMessage(a)}catch(a){console.log("error","Failed to parse WebSocket message:",a)}}),this.ws.on("error",s=>{clearTimeout(i),console.log("error","WebSocket error:",s),this.emit("error",s),this.isConnectedFlag||r(s)}),this.ws.on("close",()=>{clearTimeout(i),this.isConnectedFlag=!1,this.stopHeartbeat(),this.emit("close"),this.reconnectAttempts<this.options.reconnectAttempts&&this.scheduleReconnect()})}catch(o){clearTimeout(i),r(o)}})}async disconnect(){this.isConnectedFlag=!1,this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=void 0);for(let[e,n]of this.pendingResponses)clearTimeout(n.timeout),n.reject(new Error("Connection closed"));return this.pendingResponses.clear(),new Promise(e=>{this.ws&&this.ws.readyState===q4.OPEN?(this.ws.once("close",()=>e()),this.ws.close()):e()})}isConnected(){return this.isConnectedFlag&&this.ws?.readyState===q4.OPEN}async send(e){if(!this.isConnected())throw new Error("WebSocket is not connected");return new Promise((n,r)=>{try{let i=JSON.stringify(e);this.ws.send(i,o=>{o?r(o):n()})}catch(i){r(i)}})}async sendRequest(e,n=3e4){return e.id||(e.id=this.generateId()),new Promise((r,i)=>{let o=setTimeout(()=>{this.pendingResponses.delete(e.id),i(new Error(`Timeout for message ${e.id}`))},n);this.pendingResponses.set(e.id,{resolve:r,reject:i,timeout:o}),this.send(e).catch(s=>{this.pendingResponses.delete(e.id),clearTimeout(o),i(s)})})}onMessage(e){this.on("message",e)}onError(e){this.on("error",e)}onClose(e){this.on("close",e)}handleMessage(e){if(e.type==="response"&&e.id){let n=this.pendingResponses.get(e.id);if(n){clearTimeout(n.timeout),this.pendingResponses.delete(e.id);let r=e.payload;r.success?n.resolve(r.data):n.reject(new Error(r.error||"Request failed"));return}}if(e.type!=="pong"){if(e.type==="active_file_changed"){this.emit("activeFileChanged",e.payload);return}if(e.type==="selection_changed"){this.emit("selectionChanged",e.payload);return}this.emit("message",e)}}sendConnectMessage(){let e={clientInfo:{version:"0.1.7",platform:process.platform,workingDirectory:process.cwd()}},n={type:"cli_connect",timestamp:Date.now(),payload:e};this.send(n).catch(r=>{console.log("error","Failed to send connect message:",r)})}startHeartbeat(){this.heartbeatInterval=setInterval(()=>{if(this.isConnected()){let e={type:"ping",timestamp:Date.now()};this.send(e).catch(n=>{console.log("error","Failed to send ping:",n)})}},this.options.heartbeatInterval)}stopHeartbeat(){this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=void 0)}scheduleReconnect(){this.reconnectAttempts++;let e=this.options.reconnectDelay*Math.pow(2,this.reconnectAttempts-1);console.info(`Scheduling reconnect attempt ${this.reconnectAttempts} in ${e}ms`),this.reconnectTimer=setTimeout(()=>{this.config&&this.connect(this.config).catch(n=>{console.log("error","Reconnect failed:",n)})},e)}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,11)}`}}});var CZt=b((lji,yZt)=>{var fR=we("constants"),e8r=process.cwd,yhe=null,t8r=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return yhe||(yhe=e8r.call(process)),yhe};try{process.cwd()}catch{}typeof process.chdir=="function"&&(nke=process.chdir,process.chdir=function(t){yhe=null,nke.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,nke));var nke;yZt.exports=n8r;function n8r(t){fR.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||n(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=r(t.chmod),t.fchmod=r(t.fchmod),t.lchmod=r(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=l(t.statSync),t.fstatSync=l(t.fstatSync),t.lstatSync=l(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(c,d,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(c,d,h,m){m&&process.nextTick(m)},t.lchownSync=function(){}),t8r==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(c){function d(h,m,E){var y=Date.now(),C=0;c(h,m,function _(w){if(w&&(w.code==="EACCES"||w.code==="EPERM"||w.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(m,function(B,R){B&&B.code==="ENOENT"?c(h,m,_):E(w)})},C),C<100&&(C+=10);return}E&&E(w)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,c),d}(t.rename)),t.read=typeof t.read!="function"?t.read:function(c){function d(h,m,E,y,C,_){var w;if(_&&typeof _=="function"){var B=0;w=function(R,F,q){if(R&&R.code==="EAGAIN"&&B<10)return B++,c.call(t,h,m,E,y,C,w);_.apply(this,arguments)}}return c.call(t,h,m,E,y,C,w)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,c),d}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(c){return function(d,h,m,E,y){for(var C=0;;)try{return c.call(t,d,h,m,E,y)}catch(_){if(_.code==="EAGAIN"&&C<10){C++;continue}throw _}}}(t.readSync);function e(c){c.lchmod=function(d,h,m){c.open(d,fR.O_WRONLY|fR.O_SYMLINK,h,function(E,y){if(E){m&&m(E);return}c.fchmod(y,h,function(C){c.close(y,function(_){m&&m(C||_)})})})},c.lchmodSync=function(d,h){var m=c.openSync(d,fR.O_WRONLY|fR.O_SYMLINK,h),E=!0,y;try{y=c.fchmodSync(m,h),E=!1}finally{if(E)try{c.closeSync(m)}catch{}else c.closeSync(m)}return y}}function n(c){fR.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(d,h,m,E){c.open(d,fR.O_SYMLINK,function(y,C){if(y){E&&E(y);return}c.futimes(C,h,m,function(_){c.close(C,function(w){E&&E(_||w)})})})},c.lutimesSync=function(d,h,m){var E=c.openSync(d,fR.O_SYMLINK),y,C=!0;try{y=c.futimesSync(E,h,m),C=!1}finally{if(C)try{c.closeSync(E)}catch{}else c.closeSync(E)}return y}):c.futimes&&(c.lutimes=function(d,h,m,E){E&&process.nextTick(E)},c.lutimesSync=function(){})}function r(c){return c&&function(d,h,m){return c.call(t,d,h,function(E){u(E)&&(E=null),m&&m.apply(this,arguments)})}}function i(c){return c&&function(d,h){try{return c.call(t,d,h)}catch(m){if(!u(m))throw m}}}function o(c){return c&&function(d,h,m,E){return c.call(t,d,h,m,function(y){u(y)&&(y=null),E&&E.apply(this,arguments)})}}function s(c){return c&&function(d,h,m){try{return c.call(t,d,h,m)}catch(E){if(!u(E))throw E}}}function a(c){return c&&function(d,h,m){typeof h=="function"&&(m=h,h=null);function E(y,C){C&&(C.uid<0&&(C.uid+=4294967296),C.gid<0&&(C.gid+=4294967296)),m&&m.apply(this,arguments)}return h?c.call(t,d,h,E):c.call(t,d,E)}}function l(c){return c&&function(d,h){var m=h?c.call(t,d,h):c.call(t,d);return m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),m}}function u(c){if(!c||c.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(c.code==="EINVAL"||c.code==="EPERM"))}}});var SZt=b((uji,DZt)=>{var vZt=we("stream").Stream;DZt.exports=r8r;function r8r(t){return{ReadStream:e,WriteStream:n};function e(r,i){if(!(this instanceof e))return new e(r,i);vZt.call(this);var o=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,l=s.length;a<l;a++){var u=s[a];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(c,d){if(c){o.emit("error",c),o.readable=!1;return}o.fd=d,o.emit("open",d),o._read()})}function n(r,i){if(!(this instanceof n))return new n(r,i);vZt.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var l=o[s];this[l]=i[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var IZt=b((cji,_Zt)=>{"use strict";_Zt.exports=o8r;var i8r=Object.getPrototypeOf||function(t){return t.__proto__};function o8r(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:i8r(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}});var wZt=b((dji,oke)=>{var ju=we("fs"),s8r=CZt(),a8r=SZt(),l8r=IZt(),Che=we("util"),dh,Dhe;typeof Symbol=="function"&&typeof Symbol.for=="function"?(dh=Symbol.for("graceful-fs.queue"),Dhe=Symbol.for("graceful-fs.previous")):(dh="___graceful-fs.queue",Dhe="___graceful-fs.previous");function u8r(){}function xZt(t,e){Object.defineProperty(t,dh,{get:function(){return e}})}var ZO=u8r;Che.debuglog?ZO=Che.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(ZO=function(){var t=Che.format.apply(Che,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
2087
|
+
`)}}catch(r){console.error("Error getting agent details:",r),process.exit(1)}}var E4r,y4r,oE,C4r,pm,SKt,_Kt=Le(()=>{"use strict";qn();E4r="\x1B[32m",y4r="\x1B[33m",oE="\x1B[34m",C4r="\x1B[36m",pm="\x1B[0m";SKt={command:"get <name>",describe:"Get details about an agent",builder:t=>t.usage("Usage: iflow agent get <name>").positional("name",{describe:"Name or type of the agent",type:"string",demandOption:!0}),handler:async t=>{await v4r(t.name)}}});async function I4r(t={}){let{page:e=1,size:n=20,search:r}=t,o=qa(process.cwd()).merged.apiKey;o||(console.error("Error: API key not found."),console.error("Please authenticate first by running the auth command."),process.exit(1)),console.log("Loading online agents...");try{let s=await _4r(o,e,n);s.success||(console.error(`Error: ${s.message}`),process.exit(1));let a=s.agents||[];if(r&&(a=a.filter(l=>l.name.toLowerCase().includes(r.toLowerCase())||l.description.toLowerCase().includes(r.toLowerCase())||l.category.toLowerCase().includes(r.toLowerCase()))),a.length===0){let l=r?` matching "${r}"`:"";console.log(`No agents found${l}`);return}console.log(`\\n${S4r}Online Agents${r?` (filtered by "${r}")`:""}:${__}\\n`);for(let l of a)console.log(`${D4r}\u2022 ${l.name}${__} (ID: ${l.id})`),console.log(` ${VQ}Description:${__} ${l.description}`),console.log(` ${VQ}Category:${__} ${l.category}`),console.log(` ${VQ}Model:${__} ${l.modelName}`),l.tags&&console.log(` ${VQ}Tags:${__} ${l.tags}`),console.log(` ${VQ}Author:${__} ${l.authorId}`),console.log(` ${VQ}Version:${__} ${l.version}`),console.log();console.log(`${IKt}Total: ${a.length} agent(s) shown${s.total?` (${s.total} total available)`:""}${__}`),console.log(`${IKt}To install an agent, use: iflow agent add <name-or-id>${__}`)}catch(s){console.error("Error browsing online agents:",s),process.exit(1)}}var D4r,IKt,S4r,VQ,__,_4r,TKt,bKt=Le(()=>{"use strict";Yu();D4r="\x1B[32m",IKt="\x1B[33m",S4r="\x1B[34m",VQ="\x1B[36m",__="\x1B[0m",_4r=async(t,e=1,n=20)=>{try{if(!t)return{success:!1,message:"Please authenticate first by running the auth command"};let i=await fetch("https://apis.iflow.cn/v1/agents/list",{method:"POST",headers:{Authorization:`Bearer ${t}`,"User-Agent":"iFlow-Cli","Content-Type":"application/json"},body:JSON.stringify({page:e,size:n})});if(!i.ok){let a="Unable to load agents. Please try again later";return i.status===401?a="Authentication failed. Please check your API key or re-authenticate":i.status===403?a="Access denied. Please check your permissions":i.status===404?a="Agents service not found. Please try again later":i.status>=500&&(a="Server error. Please try again later"),{success:!1,message:a}}let o=await i.json();return o.success?{success:!0,agents:Array.isArray(o.data.data)?o.data.data:[],total:o.data.total||0}:{success:!1,message:o.message||"Failed to load agents from server"}}catch(r){let i="Unable to load agents. Please check your connection and try again";return r instanceof Error&&r.message.includes("Failed to fetch")&&(i="Network error. Please check your internet connection"),{success:!1,message:i}}};TKt={command:"online",describe:"Browse online agent repository",builder:t=>t.usage("Usage: iflow agent online [options]").option("page",{alias:"p",describe:"Page number (default: 1)",type:"number",default:1}).option("size",{alias:"s",describe:"Number of agents per page (default: 20)",type:"number",default:20}).option("search",{describe:"Search term to filter agents",type:"string"}),handler:async t=>{await I4r({page:t.page,size:t.size,search:t.search})}}});var xKt={};h0(xKt,{agentCommand:()=>SQe});var SQe,_Qe=Le(()=>{"use strict";gKt();CKt();DKt();_Kt();bKt();SQe={command:"agent",describe:"Manage agents",builder:t=>t.command(AKt).command(yKt).command(vKt).command(SKt).command(TKt).demandCommand(1,"You need at least one command before continuing.").version(!1),handler:()=>{}}});var lXt=b((TGi,aXt)=>{"use strict";var oFr=we("os"),sXt=we("tty"),y1=L7(),{env:Ap}=process,cR;y1("no-color")||y1("no-colors")||y1("color=false")||y1("color=never")?cR=0:(y1("color")||y1("colors")||y1("color=true")||y1("color=always"))&&(cR=1);"FORCE_COLOR"in Ap&&(Ap.FORCE_COLOR==="true"?cR=1:Ap.FORCE_COLOR==="false"?cR=0:cR=Ap.FORCE_COLOR.length===0?1:Math.min(parseInt(Ap.FORCE_COLOR,10),3));function LQe(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function PQe(t,e){if(cR===0)return 0;if(y1("color=16m")||y1("color=full")||y1("color=truecolor"))return 3;if(y1("color=256"))return 2;if(t&&!e&&cR===void 0)return 0;let n=cR||0;if(Ap.TERM==="dumb")return n;if(process.platform==="win32"){let r=oFr.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Ap)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Ap)||Ap.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Ap)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ap.TEAMCITY_VERSION)?1:0;if(Ap.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ap){let r=parseInt((Ap.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ap.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ap.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ap.TERM)||"COLORTERM"in Ap?1:n}function sFr(t){let e=PQe(t,t&&t.isTTY);return LQe(e)}aXt.exports={supportsColor:sFr,stdout:LQe(PQe(!0,sXt.isatty(1))),stderr:LQe(PQe(!0,sXt.isatty(2)))}});var dXt=b((bGi,cXt)=>{"use strict";var aFr=lXt(),WQ=L7();function uXt(t){if(/^\d{3,4}$/.test(t)){let n=/(\d{1,2})(\d{2})/.exec(t);return{major:0,minor:parseInt(n[1],10),patch:parseInt(n[2],10)}}let e=(t||"").split(".").map(n=>parseInt(n,10));return{major:e[0],minor:e[1],patch:e[2]}}function QQe(t){let{env:e}=process;if("FORCE_HYPERLINK"in e)return!(e.FORCE_HYPERLINK.length>0&&parseInt(e.FORCE_HYPERLINK,10)===0);if(WQ("no-hyperlink")||WQ("no-hyperlinks")||WQ("hyperlink=false")||WQ("hyperlink=never"))return!1;if(WQ("hyperlink=true")||WQ("hyperlink=always")||"NETLIFY"in e)return!0;if(!aFr.supportsColor(t)||t&&!t.isTTY||process.platform==="win32"||"CI"in e||"TEAMCITY_VERSION"in e)return!1;if("TERM_PROGRAM"in e){let n=uXt(e.TERM_PROGRAM_VERSION);switch(e.TERM_PROGRAM){case"iTerm.app":return n.major===3?n.minor>=1:n.major>3;case"WezTerm":return n.major>=20200620;case"vscode":return n.major>1||n.major===1&&n.minor>=72}}if("VTE_VERSION"in e){if(e.VTE_VERSION==="0.50.0")return!1;let n=uXt(e.VTE_VERSION);return n.major>0||n.minor>=50}return!1}cXt.exports={supportsHyperlink:QQe,stdout:QQe(process.stdout),stderr:QQe(process.stderr)}});var YQe={};h0(YQe,{AuthHandler:()=>$Qe});var $Qe,jQe=Le(()=>{"use strict";$Qe=class{logger;constructor(e={}){this.logger=console}validateToken(e){return e.authToken?e.authToken.length<16?(console.error("Auth token appears to be invalid (too short)"),!1):!0:(console.error("No auth token found in server config"),!1)}buildAuthenticatedUrl(e){if(!this.validateToken(e))throw new Error("Invalid authentication token");return`${e.serverUrl.replace(/^http/,"ws")}/ws?token=${encodeURIComponent(e.authToken)}`}buildAuthHeaders(e){if(!this.validateToken(e))throw new Error("Invalid authentication token");return{Auttion:`Bearer ${e.authToken}`,"X-Auth-Token":e.authToken}}isTokenExpired(e,n=24*60*60*1e3){let i=Date.now()-e.timestamp;return i>n?(console.warn(`Token is ${Math.floor(i/1e3/60)} minutes old`),!0):!1}}});var zQe={};h0(zQe,{WebSocketClientImpl:()=>WQe});import{EventEmitter as LFr}from"events";var WQe,JQe=Le(()=>{"use strict";V4();Cde();WQe=class extends LFr{ws;config;isConnectedFlag=!1;heartbeatInterval;reconnectTimer;reconnectAttempts=0;pendingResponses=new Map;options;constructor(e={}){super(),this.options={reconnectAttempts:e.reconnectAttempts??3,reconnectDelay:e.reconnectDelay??1e3,heartbeatInterval:e.heartbeatInterval??3e4,connectionTimeout:e.connectionTimeout??5e3,logger:console}}async connect(e){return this.config=e,this.reconnectAttempts=0,new Promise((n,r)=>{let i=setTimeout(()=>{r(new Error("Connection timeout")),this.disconnect()},this.options.connectionTimeout);try{let o=`${e.serverUrl}?token=${e.authToken}`;this.ws=new q4(o),this.ws.on("open",()=>{clearTimeout(i),this.isConnectedFlag=!0,console.debug("WebSocket connected"),this.sendConnectMessage(),this.startHeartbeat(),n()}),this.ws.on("message",s=>{try{let a=JSON.parse(s.toString());this.handleMessage(a)}catch(a){console.log("error","Failed to parse WebSocket message:",a)}}),this.ws.on("error",s=>{clearTimeout(i),console.log("error","WebSocket error:",s),this.emit("error",s),this.isConnectedFlag||r(s)}),this.ws.on("close",()=>{clearTimeout(i),this.isConnectedFlag=!1,this.stopHeartbeat(),this.emit("close"),this.reconnectAttempts<this.options.reconnectAttempts&&this.scheduleReconnect()})}catch(o){clearTimeout(i),r(o)}})}async disconnect(){this.isConnectedFlag=!1,this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=void 0);for(let[e,n]of this.pendingResponses)clearTimeout(n.timeout),n.reject(new Error("Connection closed"));return this.pendingResponses.clear(),new Promise(e=>{this.ws&&this.ws.readyState===q4.OPEN?(this.ws.once("close",()=>e()),this.ws.close()):e()})}isConnected(){return this.isConnectedFlag&&this.ws?.readyState===q4.OPEN}async send(e){if(!this.isConnected())throw new Error("WebSocket is not connected");return new Promise((n,r)=>{try{let i=JSON.stringify(e);this.ws.send(i,o=>{o?r(o):n()})}catch(i){r(i)}})}async sendRequest(e,n=3e4){return e.id||(e.id=this.generateId()),new Promise((r,i)=>{let o=setTimeout(()=>{this.pendingResponses.delete(e.id),i(new Error(`Timeout for message ${e.id}`))},n);this.pendingResponses.set(e.id,{resolve:r,reject:i,timeout:o}),this.send(e).catch(s=>{this.pendingResponses.delete(e.id),clearTimeout(o),i(s)})})}onMessage(e){this.on("message",e)}onError(e){this.on("error",e)}onClose(e){this.on("close",e)}handleMessage(e){if(e.type==="response"&&e.id){let n=this.pendingResponses.get(e.id);if(n){clearTimeout(n.timeout),this.pendingResponses.delete(e.id);let r=e.payload;r.success?n.resolve(r.data):n.reject(new Error(r.error||"Request failed"));return}}if(e.type!=="pong"){if(e.type==="active_file_changed"){this.emit("activeFileChanged",e.payload);return}if(e.type==="selection_changed"){this.emit("selectionChanged",e.payload);return}this.emit("message",e)}}sendConnectMessage(){let e={clientInfo:{version:"0.2.0-beta.0",platform:process.platform,workingDirectory:process.cwd()}},n={type:"cli_connect",timestamp:Date.now(),payload:e};this.send(n).catch(r=>{console.log("error","Failed to send connect message:",r)})}startHeartbeat(){this.heartbeatInterval=setInterval(()=>{if(this.isConnected()){let e={type:"ping",timestamp:Date.now()};this.send(e).catch(n=>{console.log("error","Failed to send ping:",n)})}},this.options.heartbeatInterval)}stopHeartbeat(){this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=void 0)}scheduleReconnect(){this.reconnectAttempts++;let e=this.options.reconnectDelay*Math.pow(2,this.reconnectAttempts-1);console.info(`Scheduling reconnect attempt ${this.reconnectAttempts} in ${e}ms`),this.reconnectTimer=setTimeout(()=>{this.config&&this.connect(this.config).catch(n=>{console.log("error","Reconnect failed:",n)})},e)}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,11)}`}}});var CZt=b((lji,yZt)=>{var fR=we("constants"),e8r=process.cwd,yhe=null,t8r=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return yhe||(yhe=e8r.call(process)),yhe};try{process.cwd()}catch{}typeof process.chdir=="function"&&(nke=process.chdir,process.chdir=function(t){yhe=null,nke.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,nke));var nke;yZt.exports=n8r;function n8r(t){fR.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||n(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=r(t.chmod),t.fchmod=r(t.fchmod),t.lchmod=r(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=l(t.statSync),t.fstatSync=l(t.fstatSync),t.lstatSync=l(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(c,d,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(c,d,h,m){m&&process.nextTick(m)},t.lchownSync=function(){}),t8r==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(c){function d(h,m,E){var y=Date.now(),C=0;c(h,m,function _(w){if(w&&(w.code==="EACCES"||w.code==="EPERM"||w.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(m,function(B,R){B&&B.code==="ENOENT"?c(h,m,_):E(w)})},C),C<100&&(C+=10);return}E&&E(w)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,c),d}(t.rename)),t.read=typeof t.read!="function"?t.read:function(c){function d(h,m,E,y,C,_){var w;if(_&&typeof _=="function"){var B=0;w=function(R,F,q){if(R&&R.code==="EAGAIN"&&B<10)return B++,c.call(t,h,m,E,y,C,w);_.apply(this,arguments)}}return c.call(t,h,m,E,y,C,w)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,c),d}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(c){return function(d,h,m,E,y){for(var C=0;;)try{return c.call(t,d,h,m,E,y)}catch(_){if(_.code==="EAGAIN"&&C<10){C++;continue}throw _}}}(t.readSync);function e(c){c.lchmod=function(d,h,m){c.open(d,fR.O_WRONLY|fR.O_SYMLINK,h,function(E,y){if(E){m&&m(E);return}c.fchmod(y,h,function(C){c.close(y,function(_){m&&m(C||_)})})})},c.lchmodSync=function(d,h){var m=c.openSync(d,fR.O_WRONLY|fR.O_SYMLINK,h),E=!0,y;try{y=c.fchmodSync(m,h),E=!1}finally{if(E)try{c.closeSync(m)}catch{}else c.closeSync(m)}return y}}function n(c){fR.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(d,h,m,E){c.open(d,fR.O_SYMLINK,function(y,C){if(y){E&&E(y);return}c.futimes(C,h,m,function(_){c.close(C,function(w){E&&E(_||w)})})})},c.lutimesSync=function(d,h,m){var E=c.openSync(d,fR.O_SYMLINK),y,C=!0;try{y=c.futimesSync(E,h,m),C=!1}finally{if(C)try{c.closeSync(E)}catch{}else c.closeSync(E)}return y}):c.futimes&&(c.lutimes=function(d,h,m,E){E&&process.nextTick(E)},c.lutimesSync=function(){})}function r(c){return c&&function(d,h,m){return c.call(t,d,h,function(E){u(E)&&(E=null),m&&m.apply(this,arguments)})}}function i(c){return c&&function(d,h){try{return c.call(t,d,h)}catch(m){if(!u(m))throw m}}}function o(c){return c&&function(d,h,m,E){return c.call(t,d,h,m,function(y){u(y)&&(y=null),E&&E.apply(this,arguments)})}}function s(c){return c&&function(d,h,m){try{return c.call(t,d,h,m)}catch(E){if(!u(E))throw E}}}function a(c){return c&&function(d,h,m){typeof h=="function"&&(m=h,h=null);function E(y,C){C&&(C.uid<0&&(C.uid+=4294967296),C.gid<0&&(C.gid+=4294967296)),m&&m.apply(this,arguments)}return h?c.call(t,d,h,E):c.call(t,d,E)}}function l(c){return c&&function(d,h){var m=h?c.call(t,d,h):c.call(t,d);return m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),m}}function u(c){if(!c||c.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(c.code==="EINVAL"||c.code==="EPERM"))}}});var SZt=b((uji,DZt)=>{var vZt=we("stream").Stream;DZt.exports=r8r;function r8r(t){return{ReadStream:e,WriteStream:n};function e(r,i){if(!(this instanceof e))return new e(r,i);vZt.call(this);var o=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,l=s.length;a<l;a++){var u=s[a];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(c,d){if(c){o.emit("error",c),o.readable=!1;return}o.fd=d,o.emit("open",d),o._read()})}function n(r,i){if(!(this instanceof n))return new n(r,i);vZt.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var l=o[s];this[l]=i[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var IZt=b((cji,_Zt)=>{"use strict";_Zt.exports=o8r;var i8r=Object.getPrototypeOf||function(t){return t.__proto__};function o8r(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:i8r(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}});var wZt=b((dji,oke)=>{var ju=we("fs"),s8r=CZt(),a8r=SZt(),l8r=IZt(),Che=we("util"),dh,Dhe;typeof Symbol=="function"&&typeof Symbol.for=="function"?(dh=Symbol.for("graceful-fs.queue"),Dhe=Symbol.for("graceful-fs.previous")):(dh="___graceful-fs.queue",Dhe="___graceful-fs.previous");function u8r(){}function xZt(t,e){Object.defineProperty(t,dh,{get:function(){return e}})}var ZO=u8r;Che.debuglog?ZO=Che.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(ZO=function(){var t=Che.format.apply(Che,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
2088
2088
|
GFS4: `),console.error(t)});ju[dh]||(TZt=global[dh]||[],xZt(ju,TZt),ju.close=function(t){function e(n,r){return t.call(ju,n,function(i){i||bZt(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(e,Dhe,{value:t}),e}(ju.close),ju.closeSync=function(t){function e(n){t.apply(ju,arguments),bZt()}return Object.defineProperty(e,Dhe,{value:t}),e}(ju.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){ZO(ju[dh]),we("assert").equal(ju[dh].length,0)}));var TZt;global[dh]||xZt(global,ju[dh]);oke.exports=rke(l8r(ju));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ju.__patched&&(oke.exports=rke(ju),ju.__patched=!0);function rke(t){s8r(t),t.gracefulify=rke,t.createReadStream=F,t.createWriteStream=q;var e=t.readFile;t.readFile=n;function n(L,K,U){return typeof K=="function"&&(U=K,K=null),se(L,K,U);function se(V,O,Y,ee){return e(V,O,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?nk([se,[V,O,Y],ne,ee||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var r=t.writeFile;t.writeFile=i;function i(L,K,U,se){return typeof U=="function"&&(se=U,U=null),V(L,K,U,se);function V(O,Y,ee,ne,Ae){return r(O,Y,ee,function(Ce){Ce&&(Ce.code==="EMFILE"||Ce.code==="ENFILE")?nk([V,[O,Y,ee,ne],Ce,Ae||Date.now(),Date.now()]):typeof ne=="function"&&ne.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(L,K,U,se){return typeof U=="function"&&(se=U,U=null),V(L,K,U,se);function V(O,Y,ee,ne,Ae){return o(O,Y,ee,function(Ce){Ce&&(Ce.code==="EMFILE"||Ce.code==="ENFILE")?nk([V,[O,Y,ee,ne],Ce,Ae||Date.now(),Date.now()]):typeof ne=="function"&&ne.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=l);function l(L,K,U,se){return typeof U=="function"&&(se=U,U=0),V(L,K,U,se);function V(O,Y,ee,ne,Ae){return a(O,Y,ee,function(Ce){Ce&&(Ce.code==="EMFILE"||Ce.code==="ENFILE")?nk([V,[O,Y,ee,ne],Ce,Ae||Date.now(),Date.now()]):typeof ne=="function"&&ne.apply(this,arguments)})}}var u=t.readdir;t.readdir=d;var c=/^v[0-5]\./;function d(L,K,U){typeof K=="function"&&(U=K,K=null);var se=c.test(process.version)?function(Y,ee,ne,Ae){return u(Y,V(Y,ee,ne,Ae))}:function(Y,ee,ne,Ae){return u(Y,ee,V(Y,ee,ne,Ae))};return se(L,K,U);function V(O,Y,ee,ne){return function(Ae,Ce){Ae&&(Ae.code==="EMFILE"||Ae.code==="ENFILE")?nk([se,[O,Y,ee],Ae,ne||Date.now(),Date.now()]):(Ce&&Ce.sort&&Ce.sort(),typeof ee=="function"&&ee.call(this,Ae,Ce))}}}if(process.version.substr(0,4)==="v0.8"){var h=a8r(t);_=h.ReadStream,B=h.WriteStream}var m=t.ReadStream;m&&(_.prototype=Object.create(m.prototype),_.prototype.open=w);var E=t.WriteStream;E&&(B.prototype=Object.create(E.prototype),B.prototype.open=R),Object.defineProperty(t,"ReadStream",{get:function(){return _},set:function(L){_=L},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return B},set:function(L){B=L},enumerable:!0,configurable:!0});var y=_;Object.defineProperty(t,"FileReadStream",{get:function(){return y},set:function(L){y=L},enumerable:!0,configurable:!0});var C=B;Object.defineProperty(t,"FileWriteStream",{get:function(){return C},set:function(L){C=L},enumerable:!0,configurable:!0});function _(L,K){return this instanceof _?(m.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function w(){var L=this;j(L.path,L.flags,L.mode,function(K,U){K?(L.autoClose&&L.destroy(),L.emit("error",K)):(L.fd=U,L.emit("open",U),L.read())})}function B(L,K){return this instanceof B?(E.apply(this,arguments),this):B.apply(Object.create(B.prototype),arguments)}function R(){var L=this;j(L.path,L.flags,L.mode,function(K,U){K?(L.destroy(),L.emit("error",K)):(L.fd=U,L.emit("open",U))})}function F(L,K){return new t.ReadStream(L,K)}function q(L,K){return new t.WriteStream(L,K)}var J=t.open;t.open=j;function j(L,K,U,se){return typeof U=="function"&&(se=U,U=null),V(L,K,U,se);function V(O,Y,ee,ne,Ae){return J(O,Y,ee,function(Ce,De){Ce&&(Ce.code==="EMFILE"||Ce.code==="ENFILE")?nk([V,[O,Y,ee,ne],Ce,Ae||Date.now(),Date.now()]):typeof ne=="function"&&ne.apply(this,arguments)})}}return t}function nk(t){ZO("ENQUEUE",t[0].name,t[1]),ju[dh].push(t),ike()}var vhe;function bZt(){for(var t=Date.now(),e=0;e<ju[dh].length;++e)ju[dh][e].length>2&&(ju[dh][e][3]=t,ju[dh][e][4]=t);ike()}function ike(){if(clearTimeout(vhe),vhe=void 0,ju[dh].length!==0){var t=ju[dh].shift(),e=t[0],n=t[1],r=t[2],i=t[3],o=t[4];if(i===void 0)ZO("RETRY",e.name,n),e.apply(null,n);else if(Date.now()-i>=6e4){ZO("TIMEOUT",e.name,n);var s=n.pop();typeof s=="function"&&s.call(null,r)}else{var a=Date.now()-o,l=Math.max(o-i,1),u=Math.min(l*1.2,100);a>=u?(ZO("RETRY",e.name,n),e.apply(null,n.concat([i]))):ju[dh].push(t)}vhe===void 0&&(vhe=setTimeout(ike,0))}}});var Cke=b((NWi,fen)=>{"use strict";var L8r=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};fen.exports=L8r});var vke=b((OWi,pen)=>{"use strict";var P8r="2.0.0",Q8r=Number.MAX_SAFE_INTEGER||9007199254740991,k8r=16,U8r=250,G8r=["major","premajor","minor","preminor","patch","prepatch","prerelease"];pen.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:k8r,MAX_SAFE_BUILD_LENGTH:U8r,MAX_SAFE_INTEGER:Q8r,RELEASE_TYPES:G8r,SEMVER_SPEC_VERSION:P8r,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var men=b((w_,hen)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Dke,MAX_SAFE_BUILD_LENGTH:H8r,MAX_LENGTH:q8r}=vke(),V8r=Cke();w_=hen.exports={};var $8r=w_.re=[],Y8r=w_.safeRe=[],Zn=w_.src=[],j8r=w_.safeSrc=[],er=w_.t={},W8r=0,Ske="[a-zA-Z0-9-]",z8r=[["\\s",1],["\\d",q8r],[Ske,H8r]],J8r=t=>{for(let[e,n]of z8r)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},fo=(t,e,n)=>{let r=J8r(e),i=W8r++;V8r(t,i,e),er[t]=i,Zn[i]=e,j8r[i]=r,$8r[i]=new RegExp(e,n?"g":void 0),Y8r[i]=new RegExp(r,n?"g":void 0)};fo("NUMERICIDENTIFIER","0|[1-9]\\d*");fo("NUMERICIDENTIFIERLOOSE","\\d+");fo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ske}*`);fo("MAINVERSION",`(${Zn[er.NUMERICIDENTIFIER]})\\.(${Zn[er.NUMERICIDENTIFIER]})\\.(${Zn[er.NUMERICIDENTIFIER]})`);fo("MAINVERSIONLOOSE",`(${Zn[er.NUMERICIDENTIFIERLOOSE]})\\.(${Zn[er.NUMERICIDENTIFIERLOOSE]})\\.(${Zn[er.NUMERICIDENTIFIERLOOSE]})`);fo("PRERELEASEIDENTIFIER",`(?:${Zn[er.NONNUMERICIDENTIFIER]}|${Zn[er.NUMERICIDENTIFIER]})`);fo("PRERELEASEIDENTIFIERLOOSE",`(?:${Zn[er.NONNUMERICIDENTIFIER]}|${Zn[er.NUMERICIDENTIFIERLOOSE]})`);fo("PRERELEASE",`(?:-(${Zn[er.PRERELEASEIDENTIFIER]}(?:\\.${Zn[er.PRERELEASEIDENTIFIER]})*))`);fo("PRERELEASELOOSE",`(?:-?(${Zn[er.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Zn[er.PRERELEASEIDENTIFIERLOOSE]})*))`);fo("BUILDIDENTIFIER",`${Ske}+`);fo("BUILD",`(?:\\+(${Zn[er.BUILDIDENTIFIER]}(?:\\.${Zn[er.BUILDIDENTIFIER]})*))`);fo("FULLPLAIN",`v?${Zn[er.MAINVERSION]}${Zn[er.PRERELEASE]}?${Zn[er.BUILD]}?`);fo("FULL",`^${Zn[er.FULLPLAIN]}$`);fo("LOOSEPLAIN",`[v=\\s]*${Zn[er.MAINVERSIONLOOSE]}${Zn[er.PRERELEASELOOSE]}?${Zn[er.BUILD]}?`);fo("LOOSE",`^${Zn[er.LOOSEPLAIN]}$`);fo("GTLT","((?:<|>)?=?)");fo("XRANGEIDENTIFIERLOOSE",`${Zn[er.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);fo("XRANGEIDENTIFIER",`${Zn[er.NUMERICIDENTIFIER]}|x|X|\\*`);fo("XRANGEPLAIN",`[v=\\s]*(${Zn[er.XRANGEIDENTIFIER]})(?:\\.(${Zn[er.XRANGEIDENTIFIER]})(?:\\.(${Zn[er.XRANGEIDENTIFIER]})(?:${Zn[er.PRERELEASE]})?${Zn[er.BUILD]}?)?)?`);fo("XRANGEPLAINLOOSE",`[v=\\s]*(${Zn[er.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Zn[er.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Zn[er.XRANGEIDENTIFIERLOOSE]})(?:${Zn[er.PRERELEASELOOSE]})?${Zn[er.BUILD]}?)?)?`);fo("XRANGE",`^${Zn[er.GTLT]}\\s*${Zn[er.XRANGEPLAIN]}$`);fo("XRANGELOOSE",`^${Zn[er.GTLT]}\\s*${Zn[er.XRANGEPLAINLOOSE]}$`);fo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Dke}})(?:\\.(\\d{1,${Dke}}))?(?:\\.(\\d{1,${Dke}}))?`);fo("COERCE",`${Zn[er.COERCEPLAIN]}(?:$|[^\\d])`);fo("COERCEFULL",Zn[er.COERCEPLAIN]+`(?:${Zn[er.PRERELEASE]})?(?:${Zn[er.BUILD]})?(?:$|[^\\d])`);fo("COERCERTL",Zn[er.COERCE],!0);fo("COERCERTLFULL",Zn[er.COERCEFULL],!0);fo("LONETILDE","(?:~>?)");fo("TILDETRIM",`(\\s*)${Zn[er.LONETILDE]}\\s+`,!0);w_.tildeTrimReplace="$1~";fo("TILDE",`^${Zn[er.LONETILDE]}${Zn[er.XRANGEPLAIN]}$`);fo("TILDELOOSE",`^${Zn[er.LONETILDE]}${Zn[er.XRANGEPLAINLOOSE]}$`);fo("LONECARET","(?:\\^)");fo("CARETTRIM",`(\\s*)${Zn[er.LONECARET]}\\s+`,!0);w_.caretTrimReplace="$1^";fo("CARET",`^${Zn[er.LONECARET]}${Zn[er.XRANGEPLAIN]}$`);fo("CARETLOOSE",`^${Zn[er.LONECARET]}${Zn[er.XRANGEPLAINLOOSE]}$`);fo("COMPARATORLOOSE",`^${Zn[er.GTLT]}\\s*(${Zn[er.LOOSEPLAIN]})$|^$`);fo("COMPARATOR",`^${Zn[er.GTLT]}\\s*(${Zn[er.FULLPLAIN]})$|^$`);fo("COMPARATORTRIM",`(\\s*)${Zn[er.GTLT]}\\s*(${Zn[er.LOOSEPLAIN]}|${Zn[er.XRANGEPLAIN]})`,!0);w_.comparatorTrimReplace="$1$2$3";fo("HYPHENRANGE",`^\\s*(${Zn[er.XRANGEPLAIN]})\\s+-\\s+(${Zn[er.XRANGEPLAIN]})\\s*$`);fo("HYPHENRANGELOOSE",`^\\s*(${Zn[er.XRANGEPLAINLOOSE]})\\s+-\\s+(${Zn[er.XRANGEPLAINLOOSE]})\\s*$`);fo("STAR","(<|>)?=?\\s*\\*");fo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");fo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var gen=b((MWi,Aen)=>{"use strict";var K8r=Object.freeze({loose:!0}),X8r=Object.freeze({}),Z8r=t=>t?typeof t!="object"?K8r:t:X8r;Aen.exports=Z8r});var ven=b((FWi,Cen)=>{"use strict";var Een=/^[0-9]+$/,yen=(t,e)=>{let n=Een.test(t),r=Een.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},eLr=(t,e)=>yen(e,t);Cen.exports={compareIdentifiers:yen,rcompareIdentifiers:eLr}});var Ike=b((LWi,Sen)=>{"use strict";var Rhe=Cke(),{MAX_LENGTH:Den,MAX_SAFE_INTEGER:Bhe}=vke(),{safeRe:Nhe,t:Ohe}=men(),tLr=gen(),{compareIdentifiers:ak}=ven(),_ke=class t{constructor(e,n){if(n=tLr(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Den)throw new TypeError(`version is longer than ${Den} characters`);Rhe("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=e.trim().match(n.loose?Nhe[Ohe.LOOSE]:Nhe[Ohe.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Bhe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Bhe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Bhe||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<Bhe)return o}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Rhe("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),ak(this.major,e.major)||ak(this.minor,e.minor)||ak(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],i=e.prerelease[n];if(Rhe("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return ak(r,i)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let r=this.build[n],i=e.build[n];if(Rhe("build compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return ak(r,i)}while(++n)}inc(e,n,r){if(e.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let i=`-${n}`.match(this.options.loose?Nhe[Ohe.PRERELEASELOOSE]:Nhe[Ohe.PRERELEASE]);if(!i||i[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let o=[n,i];r===!1&&(o=[n]),ak(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Sen.exports=_ke});var Ten=b((PWi,Ien)=>{"use strict";var _en=Ike(),nLr=(t,e,n=!1)=>{if(t instanceof _en)return t;try{return new _en(t,e)}catch(r){if(!n)return null;throw r}};Ien.exports=nLr});var wen=b((QWi,xen)=>{"use strict";var ben=Ten(),rLr=(t,e)=>{let n=ben(t,null,!0),r=ben(e,null,!0),i=n.compare(r);if(i===0)return null;let o=i>0,s=o?n:r,a=o?r:n,l=!!s.prerelease.length;if(!!a.prerelease.length&&!l){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let c=l?"pre":"";return n.major!==r.major?c+"major":n.minor!==r.minor?c+"minor":n.patch!==r.patch?c+"patch":"prerelease"};xen.exports=rLr});var Nen=b((kWi,Ben)=>{"use strict";var Ren=Ike(),iLr=(t,e,n)=>new Ren(t,n).compare(new Ren(e,n));Ben.exports=iLr});var Men=b((UWi,Oen)=>{"use strict";var oLr=Nen(),sLr=(t,e,n)=>oLr(t,e,n)>0;Oen.exports=sLr});var Xen=b(nM=>{nM.parse=nM.decode=pLr;nM.stringify=nM.encode=zen;nM.safe=ck;nM.unsafe=Qhe;var Oke=typeof process<"u"&&process.platform==="win32"?`\r
|
|
2089
2089
|
`:`
|
|
2090
2090
|
`;function zen(t,e){var n=[],r="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var l=t[o];l&&Array.isArray(l)?l.forEach(function(u){r+=ck(o+"[]")+i+ck(u)+`
|
|
@@ -2295,7 +2295,7 @@ Logging in with Google... Please restart iFlow CLI to continue.
|
|
|
2295
2295
|
`,e-1);return{line:n===-1?0:t.slice(0,n+1).match(/\n/g).length,column:e-n-1}}function hPe(t,e,{oneBased:n=!1}={}){if(typeof t!="string")throw new TypeError("Text parameter should be a string");if(!Number.isInteger(e))throw new TypeError("Index parameter should be an integer");if(e<0||e>t.length)throw new RangeError("Index out of bounds");let r=dxr(t,e);return n?{line:r.line+1,column:r.column+1}:r}var fxr=t=>`\\u{${t.codePointAt(0).toString(16)}}`,mPe=class t extends Error{name="JSONError";fileName;#e;#t;#n;#r;#o;constructor(e){if(typeof e=="string")super(),this.#n=e;else{let{jsonParseError:n,fileName:r,input:i}=e;super(void 0,{cause:n}),this.#e=i,this.#t=n,this.fileName=r}Error.captureStackTrace?.(this,t)}get message(){this.#n??=`${hxr(this.#t.message)}${this.#e===""?" while parsing empty string":""}`;let{codeFrame:e}=this;return`${this.#n}${this.fileName?` in ${this.fileName}`:""}${e?`
|
|
2296
2296
|
|
|
2297
2297
|
${e}
|
|
2298
|
-
`:""}`}set message(e){this.#n=e}#i(e){if(!this.#t)return;let n=this.#e,r=pxr(n,this.#t.message);if(r)return(0,QGt.codeFrameColumns)(n,{start:r},{highlightCode:e})}get codeFrame(){return this.#r??=this.#i(!0),this.#r}get rawCodeFrame(){return this.#o??=this.#i(!1),this.#o}},pxr=(t,e)=>{let n=e.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!n)return;let{index:r,line:i,column:o}=n.groups;return i&&o?{line:Number(i),column:Number(o)}:hPe(t,Number(r),{oneBased:!0})},hxr=t=>t.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,n,r)=>`"${r}"(${fxr(r)})`);function APe(t,e,n){typeof e=="string"&&(n=e,e=void 0);try{return JSON.parse(t,e)}catch(r){throw new mPe({jsonParseError:r,fileName:n,input:t})}}var eqt=Qe(XHt(),1);import{fileURLToPath as Pwr}from"node:url";function ZHt(t){return t instanceof URL?Pwr(t):t}var Uwr=t=>kwr.resolve(ZHt(t)??".","package.json"),Gwr=(t,e)=>{let n=typeof t=="string"?APe(t):t;return e&&(0,eqt.default)(n),n};async function tqt({cwd:t,normalize:e=!0}={}){let n=await Qwr.readFile(Uwr(t),"utf8");return Gwr(n,e)}async function nqt(t){let e=await pGt("package.json",t);if(e)return{packageJson:await tqt({...t,cwd:Hwr.dirname(e)}),path:e}}import{fileURLToPath as qwr}from"url";import Vwr from"path";var $wr=qwr(import.meta.url),Ywr=Vwr.dirname($wr),Wde;async function cQ(){if(Wde)return Wde;let t=await nqt({cwd:Ywr});if(t)return Wde=t.packageJson,Wde}async function jw(){let t=await cQ();return"0.
|
|
2298
|
+
`:""}`}set message(e){this.#n=e}#i(e){if(!this.#t)return;let n=this.#e,r=pxr(n,this.#t.message);if(r)return(0,QGt.codeFrameColumns)(n,{start:r},{highlightCode:e})}get codeFrame(){return this.#r??=this.#i(!0),this.#r}get rawCodeFrame(){return this.#o??=this.#i(!1),this.#o}},pxr=(t,e)=>{let n=e.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!n)return;let{index:r,line:i,column:o}=n.groups;return i&&o?{line:Number(i),column:Number(o)}:hPe(t,Number(r),{oneBased:!0})},hxr=t=>t.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,n,r)=>`"${r}"(${fxr(r)})`);function APe(t,e,n){typeof e=="string"&&(n=e,e=void 0);try{return JSON.parse(t,e)}catch(r){throw new mPe({jsonParseError:r,fileName:n,input:t})}}var eqt=Qe(XHt(),1);import{fileURLToPath as Pwr}from"node:url";function ZHt(t){return t instanceof URL?Pwr(t):t}var Uwr=t=>kwr.resolve(ZHt(t)??".","package.json"),Gwr=(t,e)=>{let n=typeof t=="string"?APe(t):t;return e&&(0,eqt.default)(n),n};async function tqt({cwd:t,normalize:e=!0}={}){let n=await Qwr.readFile(Uwr(t),"utf8");return Gwr(n,e)}async function nqt(t){let e=await pGt("package.json",t);if(e)return{packageJson:await tqt({...t,cwd:Hwr.dirname(e)}),path:e}}import{fileURLToPath as qwr}from"url";import Vwr from"path";var $wr=qwr(import.meta.url),Ywr=Vwr.dirname($wr),Wde;async function cQ(){if(Wde)return Wde;let t=await nqt({cwd:Ywr});if(t)return Wde=t.packageJson,Wde}async function jw(){let t=await cQ();return"0.2.0-beta.0"}js();import gO from"node:process";var rqt={name:"about",description:"show version info",kind:"built-in",action:async t=>{let e=gO.platform,n="no sandbox";gO.env.SANDBOX&&gO.env.SANDBOX!=="sandbox-exec"?n=gO.env.SANDBOX:gO.env.SANDBOX==="sandbox-exec"&&(n=`sandbox-exec (${gO.env.SEATBELT_PROFILE||"unknown"})`);let r=t.services.config?.getModel()||"Unknown",i=await jw(),o=t.services.settings.merged.selectedAuthType||"",s=gO.env.GOOGLE_CLOUD_PROJECT||"",a={type:"about",cliVersion:i,osVersion:e,sandboxEnv:n,modelVersion:r,selectedAuthType:o,gcpProject:s};t.ui.addItem(a,Date.now())}};qn();js();var Jde="\x1B[32m";var oqt="\x1B[31m",vv="\x1B[36m",ih="\x1B[90m";var Ls="\x1B[0m";function zde(t,e,n,r=!1){let i="";if(t.length===0)return i="\u{1F534} ",`${i}${e}
|
|
2299
2299
|
${oqt}No agents found${Ls}
|
|
2300
2300
|
`;i="\u{1F7E2} ";let o=`${i}${e}
|
|
2301
2301
|
`;for(let s of t)r?o+=jwr(s):o+=`${Jde}- ${s.agentType}${Ls}
|
|
@@ -2338,7 +2338,7 @@ ${ih}Built-in agents (always available)${Ls}
|
|
|
2338
2338
|
${ih}- general-purpose
|
|
2339
2339
|
${Ls}`;let l=r.length+i.length;t.ui.addItem({type:"info",text:`${Jde}Agents refreshed successfully. Found ${l} agents.${Ls}
|
|
2340
2340
|
|
|
2341
|
-
${Jde}${a.trim()}${Ls}`},Date.now())}catch(e){let n=sn(e);t.ui.addItem({type:"error",text:`${oqt}Error refreshing agents: ${n}${Ls}`},Date.now())}}},{name:"online",description:"Browse and install agents from online repository",kind:"built-in",action:(t,e)=>({type:"dialog",dialog:"agents-online"})}]};js();var aqt={name:"auth",description:"change the auth method",kind:"built-in",action:(t,e)=>({type:"dialog",dialog:"auth"})};zF();js();import hT from"node:process";import Wwr from"node:os";var dQ="
|
|
2341
|
+
${Jde}${a.trim()}${Ls}`},Date.now())}catch(e){let n=sn(e);t.ui.addItem({type:"error",text:`${oqt}Error refreshing agents: ${n}${Ls}`},Date.now())}}},{name:"online",description:"Browse and install agents from online repository",kind:"built-in",action:(t,e)=>({type:"dialog",dialog:"agents-online"})}]};js();var aqt={name:"auth",description:"change the auth method",kind:"built-in",action:(t,e)=>({type:"dialog",dialog:"auth"})};zF();js();import hT from"node:process";import Wwr from"node:os";var dQ="7589ae06 (local modifications)";qn();var lqt={name:"bug",description:"submit a bug report",kind:"built-in",action:async(t,e)=>{let n=(e||"").trim(),{config:r}=t.services,i=CN(),o=`${hT.platform} ${hT.version}`,s="no sandbox";hT.env.SANDBOX&&hT.env.SANDBOX!=="sandbox-exec"?s=hT.env.SANDBOX.replace(/^iflow-(?:code-)?/,""):hT.env.SANDBOX==="sandbox-exec"&&(s=`sandbox-exec (${hT.env.SEATBELT_PROFILE||"unknown"})`);let a=r?.getModel()||"Unknown",l=await jw(),u=K9(hT.memoryUsage().rss),c=i.getInMemoryErrors(),d="No recent errors";c.length>0&&(d=c.slice(-3).map(F=>`Error (${F.timestamp}):
|
|
2342
2342
|
${F.error}`).join(`
|
|
2343
2343
|
|
|
2344
2344
|
`));let h=Wwr.userInfo().username,m=R=>{if(!h)return R;let F=new RegExp(`/${h}/`,"g");return R.replace(F,"/user/")},E=`CLI Version: ${l}
|