@ripla/godd-mcp 1.0.1 → 1.0.2-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/godd.cjs +116 -111
- package/dist/godd.js +114 -17
- package/dist/index.js +1 -1
- package/notes-api/app/config.py +24 -3
- package/notes-api/app/database.py +10 -4
- package/notes-api/app/routers/comments.py +1 -0
- package/notes-api/app/routers/files.py +0 -1
- package/notes-api/app/routers/settings.py +4 -2
- package/notes-api/app/routers/tree.py +10 -2
- package/notes-api/app/services/github_issues.py +1 -1
- package/notes-api/tests/test_config_ssl.py +28 -0
- package/notes-api/tests/test_issues.py +15 -4
- package/notes-api/tests/test_pr.py +0 -1
- package/notes-api/tests/test_pr_chain.py +2 -2
- package/notes-api/tests/test_tree.py +15 -3
- package/notes-app/src/components/IssueList.tsx +36 -16
- package/notes-app/vitest.config.ts +1 -0
- package/package.json +1 -1
- package/templates/agents/architect.hbs +4 -4
- package/templates/agents/auto-documenter.hbs +4 -4
- package/templates/agents/backend-developer.hbs +3 -3
- package/templates/agents/code-reviewer.hbs +2 -2
- package/templates/agents/database-developer.hbs +4 -4
- package/templates/agents/debug-specialist.hbs +2 -2
- package/templates/agents/environment-setup.hbs +1 -1
- package/templates/agents/frontend-developer.hbs +5 -5
- package/templates/agents/integration-qa.hbs +1 -1
- package/templates/agents/pr-writer.hbs +1 -1
- package/templates/agents/quality-lead.hbs +3 -3
- package/templates/agents/requirements-analyst.hbs +2 -2
- package/templates/agents/security-analyst.hbs +1 -1
- package/templates/agents/ssot-updater.hbs +3 -3
- package/templates/agents/technical-writer.hbs +3 -3
- package/templates/agents/unit-test-engineer.hbs +1 -1
- package/templates/prompts/agent-dev-workflow.hbs +1 -1
- package/templates/prompts/docs-init.hbs +41 -59
- package/templates/prompts/docs-update.hbs +10 -10
- package/templates/prompts/notes-deploy.hbs +2 -1
- package/templates/prompts/pr-create.hbs +2 -2
- package/templates/prompts/push-execute.hbs +2 -2
- package/templates/prompts/push.hbs +1 -1
- package/templates/prompts/requirements-to-business-flow.hbs +1 -1
- package/templates/prompts/specification-to-tickets.hbs +1 -1
- package/templates/prompts/submit.hbs +2 -2
- package/templates/prompts/sync.hbs +1 -1
package/dist/godd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var uP=Object.create;var Uu=Object.defineProperty;var lP=Object.getOwnPropertyDescriptor;var pP=Object.getOwnPropertyNames;var dP=Object.getPrototypeOf,fP=Object.prototype.hasOwnProperty;var _=(e,t)=>()=>(e&&(t=e(e=0)),t);var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Br=(e,t)=>{for(var r in t)Uu(e,r,{get:t[r],enumerable:!0})},hP=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of pP(t))!fP.call(e,o)&&o!==r&&Uu(e,o,{get:()=>t[o],enumerable:!(n=lP(t,o))||n.enumerable});return e};var st=(e,t,r)=>(r=e!=null?uP(dP(e)):{},hP(t||!e||!e.__esModule?Uu(r,"default",{value:e,enumerable:!0}):r,e));var ee,Bu,I,cr,pi=_(()=>{(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(ee||(ee={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Bu||(Bu={}));I=ee.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cr=e=>{switch(typeof e){case"undefined":return I.undefined;case"string":return I.string;case"number":return Number.isNaN(e)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":return Array.isArray(e)?I.array:e===null?I.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?I.promise:typeof Map<"u"&&e instanceof Map?I.map:typeof Set<"u"&&e instanceof Set?I.set:typeof Date<"u"&&e instanceof Date?I.date:I.object;default:return I.unknown}}});var $,mP,mt,qs=_(()=>{pi();$=ee.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"]),mP=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),mt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ee.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};mt.create=e=>new mt(e)});var gP,kr,Vu=_(()=>{qs();pi();gP=(e,t)=>{let r;switch(e.code){case $.invalid_type:e.received===I.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case $.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ee.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:r=`Unrecognized key(s) in object: ${ee.joinValues(e.keys,", ")}`;break;case $.invalid_union:r="Invalid input";break;case $.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ee.joinValues(e.options)}`;break;case $.invalid_enum_value:r=`Invalid enum value. Expected ${ee.joinValues(e.options)}, received '${e.received}'`;break;case $.invalid_arguments:r="Invalid function arguments";break;case $.invalid_return_type:r="Invalid function return type";break;case $.invalid_date:r="Invalid date";break;case $.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:ee.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case $.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case $.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case $.custom:r="Invalid input";break;case $.invalid_intersection_types:r="Intersection results could not be merged";break;case $.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case $.not_finite:r="Number must be finite";break;default:r=t.defaultError,ee.assertNever(e)}return{message:r}},kr=gP});function yP(e){Vg=e}function lo(){return Vg}var Vg,Fs=_(()=>{Vu();Vg=kr});function E(e,t){let r=lo(),n=di({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===kr?void 0:kr].filter(o=>!!o)});e.common.issues.push(n)}var di,_P,Fe,Z,vn,Xe,Us,Bs,Vr,po,Hu=_(()=>{Fs();Vu();di=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},_P=[];Fe=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Z;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Z;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},Z=Object.freeze({status:"aborted"}),vn=e=>({status:"dirty",value:e}),Xe=e=>({status:"valid",value:e}),Us=e=>e.status==="aborted",Bs=e=>e.status==="dirty",Vr=e=>e.status==="valid",po=e=>typeof Promise<"u"&&e instanceof Promise});var Hg=_(()=>{});var A,Gg=_(()=>{(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(A||(A={}))});function V(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,a)=>{let{message:c}=e;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:o}}function Yg(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function NP(e){return new RegExp(`^${Yg(e)}$`)}function Qg(e){let t=`${Jg}T${Yg(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function DP(e,t){return!!((t==="v4"||!t)&&CP.test(e)||(t==="v6"||!t)&&IP.test(e))}function jP(e,t){if(!SP.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function MP(e,t){return!!((t==="v4"||!t)&&EP.test(e)||(t==="v6"||!t)&&zP.test(e))}function LP(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function fo(e){if(e instanceof yt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=gt.create(fo(n))}return new yt({...e._def,shape:()=>t})}else return e instanceof Tr?new Tr({...e._def,type:fo(e.element)}):e instanceof gt?gt.create(fo(e.unwrap())):e instanceof lr?lr.create(fo(e.unwrap())):e instanceof ur?ur.create(e.items.map(t=>fo(t))):e}function Wu(e,t){let r=cr(e),n=cr(t);if(e===t)return{valid:!0,data:e};if(r===I.object&&n===I.object){let o=ee.objectKeys(t),i=ee.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=Wu(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===I.array&&n===I.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],c=Wu(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===I.date&&n===I.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function Xg(e,t){return new In({values:e,typeName:P.ZodEnum,...V(t)})}function Kg(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function ey(e,t={},r){return e?Gr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=Kg(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=Kg(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):Gr.create()}var At,Wg,W,vP,bP,xP,wP,kP,SP,$P,TP,PP,Gu,CP,EP,IP,zP,RP,AP,Jg,OP,Hr,bn,xn,wn,kn,ho,Sn,$n,Gr,$r,Wt,mo,Tr,yt,Tn,Sr,Vs,Pn,ur,Hs,go,yo,Gs,Cn,En,In,zn,Wr,Ot,gt,lr,Rn,An,_o,ZP,fi,hi,On,qP,P,FP,ty,ry,UP,BP,ny,VP,HP,GP,WP,KP,JP,YP,QP,XP,Ku,eC,tC,rC,nC,oC,iC,sC,aC,cC,uC,lC,pC,dC,fC,hC,mC,gC,yC,_C,vC,bC,xC,wC,kC,oy=_(()=>{qs();Fs();Gg();Hu();pi();At=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}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}},Wg=(e,t)=>{if(Vr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new mt(e.common.issues);return this._error=r,this._error}}};W=class{get description(){return this._def.description}_getType(t){return cr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:cr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Fe,ctx:{common:t.parent.common,data:t.data,parsedType:cr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(po(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cr(t)},o=this._parseSync({data:t,path:n.path,parent:n});return Wg(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cr(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Vr(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Vr(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cr(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(po(o)?o:Promise.resolve(o));return Wg(n,i)}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=t(o),a=()=>i.addIssue({code:$.custom,...n(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Ot({schema:this,typeName:P.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return gt.create(this,this._def)}nullable(){return lr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Tr.create(this)}promise(){return Wr.create(this,this._def)}or(t){return Tn.create([this,t],this._def)}and(t){return Pn.create(this,t,this._def)}transform(t){return new Ot({...V(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Rn({...V(this._def),innerType:this,defaultValue:r,typeName:P.ZodDefault})}brand(){return new fi({typeName:P.ZodBranded,type:this,...V(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new An({...V(this._def),innerType:this,catchValue:r,typeName:P.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return hi.create(this,t)}readonly(){return On.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},vP=/^c[^\s-]{8,}$/i,bP=/^[0-9a-z]+$/,xP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,wP=/^[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,kP=/^[a-z0-9_-]{21}$/i,SP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$P=/^[-+]?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)?)??$/,TP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",CP=/^(?:(?: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])$/,EP=/^(?:(?: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])$/,IP=/^(([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]))$/,zP=/^(([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])$/,RP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,AP=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jg="((\\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])))",OP=new RegExp(`^${Jg}$`);Hr=class e extends W{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==I.string){let i=this._getOrReturnCtx(t);return E(i,{code:$.invalid_type,expected:I.string,received:i.parsedType}),Z}let n=new Fe,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),E(o,{code:$.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),E(o,{code:$.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,a=t.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(t,o),s?E(o,{code:$.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&E(o,{code:$.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")TP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"email",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Gu||(Gu=new RegExp(PP,"u")),Gu.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"emoji",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")wP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"uuid",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")kP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"nanoid",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")vP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"cuid",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")bP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"cuid2",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")xP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"ulid",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),E(o,{validation:"url",code:$.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"regex",code:$.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),E(o,{code:$.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),E(o,{code:$.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),E(o,{code:$.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Qg(i).test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{code:$.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?OP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{code:$.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?NP(i).test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{code:$.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?$P.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"duration",code:$.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?DP(t.data,i.version)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"ip",code:$.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?jP(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"jwt",code:$.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?MP(t.data,i.version)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"cidr",code:$.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?RP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"base64",code:$.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?AP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"base64url",code:$.invalid_string,message:i.message}),n.dirty()):ee.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:$.invalid_string,...A.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...A.errToObj(t)})}url(t){return this._addCheck({kind:"url",...A.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...A.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...A.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...A.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...A.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...A.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...A.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...A.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...A.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...A.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...A.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...A.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...A.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...A.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...A.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...A.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...A.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...A.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...A.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...A.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...A.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...A.errToObj(r)})}nonempty(t){return this.min(1,A.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Hr.create=e=>new Hr({checks:[],typeName:P.ZodString,coerce:e?.coerce??!1,...V(e)});bn=class e extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==I.number){let i=this._getOrReturnCtx(t);return E(i,{code:$.invalid_type,expected:I.number,received:i.parsedType}),Z}let n,o=new Fe;for(let i of this._def.checks)i.kind==="int"?ee.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),E(n,{code:$.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),E(n,{code:$.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),E(n,{code:$.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?LP(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),E(n,{code:$.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),E(n,{code:$.not_finite,message:i.message}),o.dirty()):ee.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,A.toString(r))}gt(t,r){return this.setLimit("min",t,!1,A.toString(r))}lte(t,r){return this.setLimit("max",t,!0,A.toString(r))}lt(t,r){return this.setLimit("max",t,!1,A.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:A.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:A.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:A.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:A.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:A.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:A.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:A.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:A.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:A.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:A.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ee.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};bn.create=e=>new bn({checks:[],typeName:P.ZodNumber,coerce:e?.coerce||!1,...V(e)});xn=class e extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==I.bigint)return this._getInvalidInput(t);let n,o=new Fe;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),E(n,{code:$.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),E(n,{code:$.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),E(n,{code:$.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):ee.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return E(r,{code:$.invalid_type,expected:I.bigint,received:r.parsedType}),Z}gte(t,r){return this.setLimit("min",t,!0,A.toString(r))}gt(t,r){return this.setLimit("min",t,!1,A.toString(r))}lte(t,r){return this.setLimit("max",t,!0,A.toString(r))}lt(t,r){return this.setLimit("max",t,!1,A.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:A.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:A.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:A.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:A.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:A.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:A.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};xn.create=e=>new xn({checks:[],typeName:P.ZodBigInt,coerce:e?.coerce??!1,...V(e)});wn=class extends W{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==I.boolean){let n=this._getOrReturnCtx(t);return E(n,{code:$.invalid_type,expected:I.boolean,received:n.parsedType}),Z}return Xe(t.data)}};wn.create=e=>new wn({typeName:P.ZodBoolean,coerce:e?.coerce||!1,...V(e)});kn=class e extends W{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==I.date){let i=this._getOrReturnCtx(t);return E(i,{code:$.invalid_type,expected:I.date,received:i.parsedType}),Z}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return E(i,{code:$.invalid_date}),Z}let n=new Fe,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),E(o,{code:$.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),E(o,{code:$.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):ee.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:A.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:A.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};kn.create=e=>new kn({checks:[],coerce:e?.coerce||!1,typeName:P.ZodDate,...V(e)});ho=class extends W{_parse(t){if(this._getType(t)!==I.symbol){let n=this._getOrReturnCtx(t);return E(n,{code:$.invalid_type,expected:I.symbol,received:n.parsedType}),Z}return Xe(t.data)}};ho.create=e=>new ho({typeName:P.ZodSymbol,...V(e)});Sn=class extends W{_parse(t){if(this._getType(t)!==I.undefined){let n=this._getOrReturnCtx(t);return E(n,{code:$.invalid_type,expected:I.undefined,received:n.parsedType}),Z}return Xe(t.data)}};Sn.create=e=>new Sn({typeName:P.ZodUndefined,...V(e)});$n=class extends W{_parse(t){if(this._getType(t)!==I.null){let n=this._getOrReturnCtx(t);return E(n,{code:$.invalid_type,expected:I.null,received:n.parsedType}),Z}return Xe(t.data)}};$n.create=e=>new $n({typeName:P.ZodNull,...V(e)});Gr=class extends W{constructor(){super(...arguments),this._any=!0}_parse(t){return Xe(t.data)}};Gr.create=e=>new Gr({typeName:P.ZodAny,...V(e)});$r=class extends W{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xe(t.data)}};$r.create=e=>new $r({typeName:P.ZodUnknown,...V(e)});Wt=class extends W{_parse(t){let r=this._getOrReturnCtx(t);return E(r,{code:$.invalid_type,expected:I.never,received:r.parsedType}),Z}};Wt.create=e=>new Wt({typeName:P.ZodNever,...V(e)});mo=class extends W{_parse(t){if(this._getType(t)!==I.undefined){let n=this._getOrReturnCtx(t);return E(n,{code:$.invalid_type,expected:I.void,received:n.parsedType}),Z}return Xe(t.data)}};mo.create=e=>new mo({typeName:P.ZodVoid,...V(e)});Tr=class e extends W{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==I.array)return E(r,{code:$.invalid_type,expected:I.array,received:r.parsedType}),Z;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(E(r,{code:s?$.too_big:$.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(E(r,{code:$.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(E(r,{code:$.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new At(r,s,r.path,a)))).then(s=>Fe.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new At(r,s,r.path,a)));return Fe.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:A.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:A.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:A.toString(r)}})}nonempty(t){return this.min(1,t)}};Tr.create=(e,t)=>new Tr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...V(t)});yt=class e extends W{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=ee.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==I.object){let u=this._getOrReturnCtx(t);return E(u,{code:$.invalid_type,expected:I.object,received:u.parsedType}),Z}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Wt&&this._def.unknownKeys==="strip"))for(let u in o.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let p=i[u],l=o.data[u];c.push({key:{status:"valid",value:u},value:p._parse(new At(o,l,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Wt){let u=this._def.unknownKeys;if(u==="passthrough")for(let p of a)c.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(u==="strict")a.length>0&&(E(o,{code:$.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let p of a){let l=o.data[p];c.push({key:{status:"valid",value:p},value:u._parse(new At(o,l,o.path,p)),alwaysSet:p in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let p of c){let l=await p.key,d=await p.value;u.push({key:l,value:d,alwaysSet:p.alwaysSet})}return u}).then(u=>Fe.mergeObjectSync(n,u)):Fe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return A.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:A.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:P.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of ee.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of ee.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return fo(this)}partial(t){let r={};for(let n of ee.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of ee.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof gt;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return Xg(ee.objectKeys(this.shape))}};yt.create=(e,t)=>new yt({shape:()=>e,unknownKeys:"strip",catchall:Wt.create(),typeName:P.ZodObject,...V(t)});yt.strictCreate=(e,t)=>new yt({shape:()=>e,unknownKeys:"strict",catchall:Wt.create(),typeName:P.ZodObject,...V(t)});yt.lazycreate=(e,t)=>new yt({shape:e,unknownKeys:"strip",catchall:Wt.create(),typeName:P.ZodObject,...V(t)});Tn=class extends W{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new mt(a.ctx.common.issues));return E(r,{code:$.invalid_union,unionErrors:s}),Z}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},p=c._parseSync({data:r.data,path:r.path,parent:u});if(p.status==="valid")return p;p.status==="dirty"&&!i&&(i={result:p,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(c=>new mt(c));return E(r,{code:$.invalid_union,unionErrors:a}),Z}}get options(){return this._def.options}};Tn.create=(e,t)=>new Tn({options:e,typeName:P.ZodUnion,...V(t)});Sr=e=>e instanceof Cn?Sr(e.schema):e instanceof Ot?Sr(e.innerType()):e instanceof En?[e.value]:e instanceof In?e.options:e instanceof zn?ee.objectValues(e.enum):e instanceof Rn?Sr(e._def.innerType):e instanceof Sn?[void 0]:e instanceof $n?[null]:e instanceof gt?[void 0,...Sr(e.unwrap())]:e instanceof lr?[null,...Sr(e.unwrap())]:e instanceof fi||e instanceof On?Sr(e.unwrap()):e instanceof An?Sr(e._def.innerType):[],Vs=class e extends W{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.object)return E(r,{code:$.invalid_type,expected:I.object,received:r.parsedType}),Z;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(E(r,{code:$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Z)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let s=Sr(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new e({typeName:P.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...V(n)})}};Pn=class extends W{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(Us(i)||Us(s))return Z;let a=Wu(i.value,s.value);return a.valid?((Bs(i)||Bs(s))&&r.dirty(),{status:r.value,value:a.data}):(E(n,{code:$.invalid_intersection_types}),Z)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Pn.create=(e,t,r)=>new Pn({left:e,right:t,typeName:P.ZodIntersection,...V(r)});ur=class e extends W{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.array)return E(n,{code:$.invalid_type,expected:I.array,received:n.parsedType}),Z;if(n.data.length<this._def.items.length)return E(n,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Z;!this._def.rest&&n.data.length>this._def.items.length&&(E(n,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new At(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>Fe.mergeArray(r,s)):Fe.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ur.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ur({items:e,typeName:P.ZodTuple,rest:null,...V(t)})};Hs=class e extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.object)return E(n,{code:$.invalid_type,expected:I.object,received:n.parsedType}),Z;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new At(n,a,n.path,a)),value:s._parse(new At(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Fe.mergeObjectAsync(r,o):Fe.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof W?new e({keyType:t,valueType:r,typeName:P.ZodRecord,...V(n)}):new e({keyType:Hr.create(),valueType:t,typeName:P.ZodRecord,...V(r)})}},go=class extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.map)return E(n,{code:$.invalid_type,expected:I.map,received:n.parsedType}),Z;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new At(n,a,n.path,[u,"key"])),value:i._parse(new At(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,p=await c.value;if(u.status==="aborted"||p.status==="aborted")return Z;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(u.value,p.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,p=c.value;if(u.status==="aborted"||p.status==="aborted")return Z;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(u.value,p.value)}return{status:r.value,value:a}}}};go.create=(e,t,r)=>new go({valueType:t,keyType:e,typeName:P.ZodMap,...V(r)});yo=class e extends W{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.set)return E(n,{code:$.invalid_type,expected:I.set,received:n.parsedType}),Z;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(E(n,{code:$.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(E(n,{code:$.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(c){let u=new Set;for(let p of c){if(p.status==="aborted")return Z;p.status==="dirty"&&r.dirty(),u.add(p.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>i._parse(new At(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:A.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:A.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};yo.create=(e,t)=>new yo({valueType:e,minSize:null,maxSize:null,typeName:P.ZodSet,...V(t)});Gs=class e extends W{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.function)return E(r,{code:$.invalid_type,expected:I.function,received:r.parsedType}),Z;function n(a,c){return di({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,lo(),kr].filter(u=>!!u),issueData:{code:$.invalid_arguments,argumentsError:c}})}function o(a,c){return di({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,lo(),kr].filter(u=>!!u),issueData:{code:$.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Wr){let a=this;return Xe(async function(...c){let u=new mt([]),p=await a._def.args.parseAsync(c,i).catch(f=>{throw u.addIssue(n(c,f)),u}),l=await Reflect.apply(s,this,p);return await a._def.returns._def.type.parseAsync(l,i).catch(f=>{throw u.addIssue(o(l,f)),u})})}else{let a=this;return Xe(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new mt([n(c,u.error)]);let p=Reflect.apply(s,this,u.data),l=a._def.returns.safeParse(p,i);if(!l.success)throw new mt([o(p,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ur.create(t).rest($r.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ur.create([]).rest($r.create()),returns:r||$r.create(),typeName:P.ZodFunction,...V(n)})}},Cn=class extends W{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Cn.create=(e,t)=>new Cn({getter:e,typeName:P.ZodLazy,...V(t)});En=class extends W{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return E(r,{received:r.data,code:$.invalid_literal,expected:this._def.value}),Z}return{status:"valid",value:t.data}}get value(){return this._def.value}};En.create=(e,t)=>new En({value:e,typeName:P.ZodLiteral,...V(t)});In=class e extends W{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return E(r,{expected:ee.joinValues(n),received:r.parsedType,code:$.invalid_type}),Z}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return E(r,{received:r.data,code:$.invalid_enum_value,options:n}),Z}return Xe(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};In.create=Xg;zn=class extends W{_parse(t){let r=ee.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==I.string&&n.parsedType!==I.number){let o=ee.objectValues(r);return E(n,{expected:ee.joinValues(o),received:n.parsedType,code:$.invalid_type}),Z}if(this._cache||(this._cache=new Set(ee.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=ee.objectValues(r);return E(n,{received:n.data,code:$.invalid_enum_value,options:o}),Z}return Xe(t.data)}get enum(){return this._def.values}};zn.create=(e,t)=>new zn({values:e,typeName:P.ZodNativeEnum,...V(t)});Wr=class extends W{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.promise&&r.common.async===!1)return E(r,{code:$.invalid_type,expected:I.promise,received:r.parsedType}),Z;let n=r.parsedType===I.promise?r.data:Promise.resolve(r.data);return Xe(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Wr.create=(e,t)=>new Wr({type:e,typeName:P.ZodPromise,...V(t)});Ot=class extends W{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{E(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return Z;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?Z:c.status==="dirty"?vn(c.value):r.value==="dirty"?vn(c.value):c});{if(r.value==="aborted")return Z;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?Z:a.status==="dirty"?vn(a.value):r.value==="dirty"?vn(a.value):a}}if(o.type==="refinement"){let s=a=>{let c=o.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Z:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Z:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Vr(s))return Z;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Vr(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):Z);ee.assertNever(o)}};Ot.create=(e,t,r)=>new Ot({schema:e,typeName:P.ZodEffects,effect:t,...V(r)});Ot.createWithPreprocess=(e,t,r)=>new Ot({schema:t,effect:{type:"preprocess",transform:e},typeName:P.ZodEffects,...V(r)});gt=class extends W{_parse(t){return this._getType(t)===I.undefined?Xe(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};gt.create=(e,t)=>new gt({innerType:e,typeName:P.ZodOptional,...V(t)});lr=class extends W{_parse(t){return this._getType(t)===I.null?Xe(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};lr.create=(e,t)=>new lr({innerType:e,typeName:P.ZodNullable,...V(t)});Rn=class extends W{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===I.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Rn.create=(e,t)=>new Rn({innerType:e,typeName:P.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...V(t)});An=class extends W{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return po(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new mt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new mt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};An.create=(e,t)=>new An({innerType:e,typeName:P.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...V(t)});_o=class extends W{_parse(t){if(this._getType(t)!==I.nan){let n=this._getOrReturnCtx(t);return E(n,{code:$.invalid_type,expected:I.nan,received:n.parsedType}),Z}return{status:"valid",value:t.data}}};_o.create=e=>new _o({typeName:P.ZodNaN,...V(e)});ZP=Symbol("zod_brand"),fi=class extends W{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},hi=class e extends W{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Z:i.status==="dirty"?(r.dirty(),vn(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Z:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:P.ZodPipeline})}},On=class extends W{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Vr(o)&&(o.value=Object.freeze(o.value)),o);return po(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};On.create=(e,t)=>new On({innerType:e,typeName:P.ZodReadonly,...V(t)});qP={object:yt.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(P||(P={}));FP=(e,t={message:`Input not instance of ${e.name}`})=>ey(r=>r instanceof e,t),ty=Hr.create,ry=bn.create,UP=_o.create,BP=xn.create,ny=wn.create,VP=kn.create,HP=ho.create,GP=Sn.create,WP=$n.create,KP=Gr.create,JP=$r.create,YP=Wt.create,QP=mo.create,XP=Tr.create,Ku=yt.create,eC=yt.strictCreate,tC=Tn.create,rC=Vs.create,nC=Pn.create,oC=ur.create,iC=Hs.create,sC=go.create,aC=yo.create,cC=Gs.create,uC=Cn.create,lC=En.create,pC=In.create,dC=zn.create,fC=Wr.create,hC=Ot.create,mC=gt.create,gC=lr.create,yC=Ot.createWithPreprocess,_C=hi.create,vC=()=>ty().optional(),bC=()=>ry().optional(),xC=()=>ny().optional(),wC={string:(e=>Hr.create({...e,coerce:!0})),number:(e=>bn.create({...e,coerce:!0})),boolean:(e=>wn.create({...e,coerce:!0})),bigint:(e=>xn.create({...e,coerce:!0})),date:(e=>kn.create({...e,coerce:!0}))},kC=Z});var m={};Br(m,{BRAND:()=>ZP,DIRTY:()=>vn,EMPTY_PATH:()=>_P,INVALID:()=>Z,NEVER:()=>kC,OK:()=>Xe,ParseStatus:()=>Fe,Schema:()=>W,ZodAny:()=>Gr,ZodArray:()=>Tr,ZodBigInt:()=>xn,ZodBoolean:()=>wn,ZodBranded:()=>fi,ZodCatch:()=>An,ZodDate:()=>kn,ZodDefault:()=>Rn,ZodDiscriminatedUnion:()=>Vs,ZodEffects:()=>Ot,ZodEnum:()=>In,ZodError:()=>mt,ZodFirstPartyTypeKind:()=>P,ZodFunction:()=>Gs,ZodIntersection:()=>Pn,ZodIssueCode:()=>$,ZodLazy:()=>Cn,ZodLiteral:()=>En,ZodMap:()=>go,ZodNaN:()=>_o,ZodNativeEnum:()=>zn,ZodNever:()=>Wt,ZodNull:()=>$n,ZodNullable:()=>lr,ZodNumber:()=>bn,ZodObject:()=>yt,ZodOptional:()=>gt,ZodParsedType:()=>I,ZodPipeline:()=>hi,ZodPromise:()=>Wr,ZodReadonly:()=>On,ZodRecord:()=>Hs,ZodSchema:()=>W,ZodSet:()=>yo,ZodString:()=>Hr,ZodSymbol:()=>ho,ZodTransformer:()=>Ot,ZodTuple:()=>ur,ZodType:()=>W,ZodUndefined:()=>Sn,ZodUnion:()=>Tn,ZodUnknown:()=>$r,ZodVoid:()=>mo,addIssueToContext:()=>E,any:()=>KP,array:()=>XP,bigint:()=>BP,boolean:()=>ny,coerce:()=>wC,custom:()=>ey,date:()=>VP,datetimeRegex:()=>Qg,defaultErrorMap:()=>kr,discriminatedUnion:()=>rC,effect:()=>hC,enum:()=>pC,function:()=>cC,getErrorMap:()=>lo,getParsedType:()=>cr,instanceof:()=>FP,intersection:()=>nC,isAborted:()=>Us,isAsync:()=>po,isDirty:()=>Bs,isValid:()=>Vr,late:()=>qP,lazy:()=>uC,literal:()=>lC,makeIssue:()=>di,map:()=>sC,nan:()=>UP,nativeEnum:()=>dC,never:()=>YP,null:()=>WP,nullable:()=>gC,number:()=>ry,object:()=>Ku,objectUtil:()=>Bu,oboolean:()=>xC,onumber:()=>bC,optional:()=>mC,ostring:()=>vC,pipeline:()=>_C,preprocess:()=>yC,promise:()=>fC,quotelessJson:()=>mP,record:()=>iC,set:()=>aC,setErrorMap:()=>yP,strictObject:()=>eC,string:()=>ty,symbol:()=>HP,transformer:()=>hC,tuple:()=>oC,undefined:()=>GP,union:()=>tC,unknown:()=>JP,util:()=>ee,void:()=>QP});var Ws=_(()=>{Fs();Hu();Hg();pi();oy();qs()});var mi=_(()=>{Ws()});function w(e,t,r){function n(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,c);for(let p in s.prototype)p in a||Object.defineProperty(a,p,{value:s.prototype[p].bind(a)});a._zod.constr=s,a._zod.def=c}let o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var c;let u=r?.Parent?new i:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function Tt(e){return e&&Object.assign(Ks,e),Ks}var $C,TC,Pr,Ks,vo=_(()=>{$C=Object.freeze({status:"aborted"});TC=Symbol("zod_brand"),Pr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ks={}});var ne={};Br(ne,{BIGINT_FORMAT_RANGES:()=>sy,Class:()=>Yu,NUMBER_FORMAT_RANGES:()=>ol,aborted:()=>Dn,allowsEval:()=>tl,assert:()=>zC,assertEqual:()=>PC,assertIs:()=>EC,assertNever:()=>IC,assertNotEqual:()=>CC,assignProp:()=>el,cached:()=>_i,captureStackTrace:()=>Ys,cleanEnum:()=>BC,cleanRegex:()=>bi,clone:()=>Pt,createTransparentProxy:()=>jC,defineLazy:()=>ve,esc:()=>Nn,escapeRegex:()=>Kr,extend:()=>ZC,finalizeIssue:()=>Kt,floatSafeRemainder:()=>Xu,getElementAtPath:()=>RC,getEnumValues:()=>yi,getLengthableOrigin:()=>xi,getParsedType:()=>DC,getSizableOrigin:()=>ay,isObject:()=>bo,isPlainObject:()=>xo,issue:()=>il,joinValues:()=>Js,jsonStringifyReplacer:()=>Qu,merge:()=>qC,normalizeParams:()=>q,nullish:()=>vi,numKeys:()=>NC,omit:()=>LC,optionalKeys:()=>nl,partial:()=>FC,pick:()=>MC,prefixIssues:()=>pr,primitiveTypes:()=>iy,promiseAllObject:()=>AC,propertyKeyTypes:()=>rl,randomString:()=>OC,required:()=>UC,stringifyPrimitive:()=>Qs,unwrapMessage:()=>gi});function PC(e){return e}function CC(e){return e}function EC(e){}function IC(e){throw new Error}function zC(e){}function yi(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Js(e,t="|"){return e.map(r=>Qs(r)).join(t)}function Qu(e,t){return typeof t=="bigint"?t.toString():t}function _i(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function vi(e){return e==null}function bi(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Xu(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function ve(e,t,r){Object.defineProperty(e,t,{get(){{let o=r();return e[t]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function el(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function RC(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function AC(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function OC(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function Nn(e){return JSON.stringify(e)}function bo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xo(e){if(bo(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(bo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function NC(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function Kr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function jC(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Qs(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function nl(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function MC(e,t){let r={},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(r[o]=n.shape[o])}return Pt(e,{...e._zod.def,shape:r,checks:[]})}function LC(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete r[o]}return Pt(e,{...e._zod.def,shape:r,checks:[]})}function ZC(e,t){if(!xo(t))throw new Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return el(this,"shape",n),n},checks:[]};return Pt(e,r)}function qC(e,t){return Pt(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return el(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function FC(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in n))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=e?new e({type:"optional",innerType:n[i]}):n[i])}else for(let i in n)o[i]=e?new e({type:"optional",innerType:n[i]}):n[i];return Pt(t,{...t._zod.def,shape:o,checks:[]})}function UC(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)o[i]=new e({type:"nonoptional",innerType:n[i]});return Pt(t,{...t._zod.def,shape:o,checks:[]})}function Dn(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function pr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function gi(e){return typeof e=="string"?e:e?.message}function Kt(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=gi(e.inst?._zod.def?.error?.(e))??gi(t?.error?.(e))??gi(r.customError?.(e))??gi(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ay(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function xi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function il(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function BC(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var Ys,tl,DC,rl,iy,ol,sy,Yu,dr=_(()=>{Ys=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};tl=_i(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});DC=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},rl=new Set(["string","number","symbol"]),iy=new Set(["string","number","bigint","boolean","symbol","undefined"]);ol={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},sy={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Yu=class{constructor(...t){}}});function sl(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function al(e,t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(e),n}var cy,Xs,wi,cl=_(()=>{vo();dr();cy=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Qu,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xs=w("$ZodError",cy),wi=w("$ZodError",cy,{Parent:Error})});var ul,ll,pl,dl,fl,jn,hl,Mn,ml=_(()=>{vo();cl();dr();ul=e=>(t,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Pr;if(s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>Kt(c,i,Tt())));throw Ys(a,o?.callee),a}return s.value},ll=ul(wi),pl=e=>async(t,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>Kt(c,i,Tt())));throw Ys(a,o?.callee),a}return s.value},dl=pl(wi),fl=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Pr;return i.issues.length?{success:!1,error:new(e??Xs)(i.issues.map(s=>Kt(s,o,Tt())))}:{success:!0,data:i.value}},jn=fl(wi),hl=e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Kt(s,o,Tt())))}:{success:!0,data:i.value}},Mn=hl(wi)});function _y(){return new RegExp(HC,"u")}function Cy(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ey(e){return new RegExp(`^${Cy(e)}$`)}function Iy(e){let t=Cy({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Ty}T(?:${n})$`)}var uy,ly,py,dy,fy,hy,my,gy,gl,yy,HC,vy,by,xy,wy,ky,yl,Sy,$y,Ty,Py,zy,Ry,Ay,Oy,Ny,Dy,jy,ta=_(()=>{uy=/^[cC][^\s-]{8,}$/,ly=/^[0-9a-z]+$/,py=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,dy=/^[0-9a-vA-V]{20}$/,fy=/^[A-Za-z0-9]{27}$/,hy=/^[a-zA-Z0-9_-]{21}$/,my=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gy=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,gl=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,yy=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,HC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";vy=/^(?:(?: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])$/,by=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,xy=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,wy=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ky=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,yl=/^[A-Za-z0-9_-]*$/,Sy=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,$y=/^\+(?:[0-9]){6,14}[0-9]$/,Ty="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Py=new RegExp(`^${Ty}$`);zy=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ry=/^\d+$/,Ay=/^-?\d+(?:\.\d+)?/i,Oy=/true|false/i,Ny=/null/i,Dy=/^[^A-Z]*$/,jy=/^[^a-z]*$/});var Ue,My,_l,vl,Ly,Zy,qy,Fy,Uy,ki,By,Vy,Hy,Gy,Wy,Ky,Jy,ra=_(()=>{vo();ta();dr();Ue=w("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),My={number:"number",bigint:"bigint",object:"date"},_l=w("$ZodCheckLessThan",(e,t)=>{Ue.init(e,t);let r=My[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vl=w("$ZodCheckGreaterThan",(e,t)=>{Ue.init(e,t);let r=My[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ly=w("$ZodCheckMultipleOf",(e,t)=>{Ue.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Xu(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Zy=w("$ZodCheckNumberFormat",(e,t)=>{Ue.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=ol[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=o,a.maximum=i,r&&(a.pattern=Ry)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}}),qy=w("$ZodCheckMaxLength",(e,t)=>{var r;Ue.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!vi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let o=n.value;if(o.length<=t.maximum)return;let s=xi(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Fy=w("$ZodCheckMinLength",(e,t)=>{var r;Ue.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!vi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let s=xi(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Uy=w("$ZodCheckLengthEquals",(e,t)=>{var r;Ue.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!vi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{let o=n.value,i=o.length;if(i===t.length)return;let s=xi(o),a=i>t.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ki=w("$ZodCheckStringFormat",(e,t)=>{var r,n;Ue.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),By=w("$ZodCheckRegex",(e,t)=>{ki.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Vy=w("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Dy),ki.init(e,t)}),Hy=w("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=jy),ki.init(e,t)}),Gy=w("$ZodCheckIncludes",(e,t)=>{Ue.init(e,t);let r=Kr(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Wy=w("$ZodCheckStartsWith",(e,t)=>{Ue.init(e,t);let r=new RegExp(`^${Kr(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ky=w("$ZodCheckEndsWith",(e,t)=>{Ue.init(e,t);let r=new RegExp(`.*${Kr(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Jy=w("$ZodCheckOverwrite",(e,t)=>{Ue.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var na,bl=_(()=>{na=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
1
|
+
"use strict";var hP=Object.create;var Uu=Object.defineProperty;var mP=Object.getOwnPropertyDescriptor;var gP=Object.getOwnPropertyNames;var yP=Object.getPrototypeOf,_P=Object.prototype.hasOwnProperty;var _=(e,t)=>()=>(e&&(t=e(e=0)),t);var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Br=(e,t)=>{for(var r in t)Uu(e,r,{get:t[r],enumerable:!0})},vP=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of gP(t))!_P.call(e,o)&&o!==r&&Uu(e,o,{get:()=>t[o],enumerable:!(n=mP(t,o))||n.enumerable});return e};var st=(e,t,r)=>(r=e!=null?hP(yP(e)):{},vP(t||!e||!e.__esModule?Uu(r,"default",{value:e,enumerable:!0}):r,e));var te,Bu,I,cr,pi=_(()=>{(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(te||(te={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Bu||(Bu={}));I=te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cr=e=>{switch(typeof e){case"undefined":return I.undefined;case"string":return I.string;case"number":return Number.isNaN(e)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":return Array.isArray(e)?I.array:e===null?I.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?I.promise:typeof Map<"u"&&e instanceof Map?I.map:typeof Set<"u"&&e instanceof Set?I.set:typeof Date<"u"&&e instanceof Date?I.date:I.object;default:return I.unknown}}});var $,bP,mt,qs=_(()=>{pi();$=te.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"]),bP=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),mt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};mt.create=e=>new mt(e)});var xP,kr,Vu=_(()=>{qs();pi();xP=(e,t)=>{let r;switch(e.code){case $.invalid_type:e.received===I.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case $.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,te.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:r=`Unrecognized key(s) in object: ${te.joinValues(e.keys,", ")}`;break;case $.invalid_union:r="Invalid input";break;case $.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${te.joinValues(e.options)}`;break;case $.invalid_enum_value:r=`Invalid enum value. Expected ${te.joinValues(e.options)}, received '${e.received}'`;break;case $.invalid_arguments:r="Invalid function arguments";break;case $.invalid_return_type:r="Invalid function return type";break;case $.invalid_date:r="Invalid date";break;case $.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:te.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case $.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case $.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case $.custom:r="Invalid input";break;case $.invalid_intersection_types:r="Intersection results could not be merged";break;case $.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case $.not_finite:r="Number must be finite";break;default:r=t.defaultError,te.assertNever(e)}return{message:r}},kr=xP});function wP(e){Vg=e}function lo(){return Vg}var Vg,Fs=_(()=>{Vu();Vg=kr});function E(e,t){let r=lo(),n=di({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===kr?void 0:kr].filter(o=>!!o)});e.common.issues.push(n)}var di,kP,Fe,Z,vn,Xe,Us,Bs,Vr,po,Hu=_(()=>{Fs();Vu();di=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},kP=[];Fe=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Z;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Z;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},Z=Object.freeze({status:"aborted"}),vn=e=>({status:"dirty",value:e}),Xe=e=>({status:"valid",value:e}),Us=e=>e.status==="aborted",Bs=e=>e.status==="dirty",Vr=e=>e.status==="valid",po=e=>typeof Promise<"u"&&e instanceof Promise});var Hg=_(()=>{});var A,Gg=_(()=>{(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(A||(A={}))});function G(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,a)=>{let{message:c}=e;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:o}}function Yg(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function ZP(e){return new RegExp(`^${Yg(e)}$`)}function Qg(e){let t=`${Jg}T${Yg(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function qP(e,t){return!!((t==="v4"||!t)&&AP.test(e)||(t==="v6"||!t)&&NP.test(e))}function FP(e,t){if(!EP.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function UP(e,t){return!!((t==="v4"||!t)&&OP.test(e)||(t==="v6"||!t)&&DP.test(e))}function BP(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function fo(e){if(e instanceof yt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=gt.create(fo(n))}return new yt({...e._def,shape:()=>t})}else return e instanceof Tr?new Tr({...e._def,type:fo(e.element)}):e instanceof gt?gt.create(fo(e.unwrap())):e instanceof lr?lr.create(fo(e.unwrap())):e instanceof ur?ur.create(e.items.map(t=>fo(t))):e}function Wu(e,t){let r=cr(e),n=cr(t);if(e===t)return{valid:!0,data:e};if(r===I.object&&n===I.object){let o=te.objectKeys(t),i=te.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=Wu(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===I.array&&n===I.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],c=Wu(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===I.date&&n===I.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function Xg(e,t){return new In({values:e,typeName:P.ZodEnum,...G(t)})}function Kg(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function ey(e,t={},r){return e?Gr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=Kg(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=Kg(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):Gr.create()}var At,Wg,J,SP,$P,TP,PP,CP,EP,IP,zP,RP,Gu,AP,OP,NP,DP,jP,MP,Jg,LP,Hr,bn,xn,wn,kn,ho,Sn,$n,Gr,$r,Wt,mo,Tr,yt,Tn,Sr,Vs,Pn,ur,Hs,go,yo,Gs,Cn,En,In,zn,Wr,Ot,gt,lr,Rn,An,_o,VP,fi,hi,On,HP,P,GP,ty,ry,WP,KP,ny,JP,YP,QP,XP,eC,tC,rC,nC,oC,Ku,iC,sC,aC,cC,uC,lC,pC,dC,fC,hC,mC,gC,yC,_C,vC,bC,xC,wC,kC,SC,$C,TC,PC,CC,oy=_(()=>{qs();Fs();Gg();Hu();pi();At=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}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}},Wg=(e,t)=>{if(Vr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new mt(e.common.issues);return this._error=r,this._error}}};J=class{get description(){return this._def.description}_getType(t){return cr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:cr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Fe,ctx:{common:t.parent.common,data:t.data,parsedType:cr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(po(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cr(t)},o=this._parseSync({data:t,path:n.path,parent:n});return Wg(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cr(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Vr(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Vr(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cr(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(po(o)?o:Promise.resolve(o));return Wg(n,i)}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=t(o),a=()=>i.addIssue({code:$.custom,...n(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Ot({schema:this,typeName:P.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return gt.create(this,this._def)}nullable(){return lr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Tr.create(this)}promise(){return Wr.create(this,this._def)}or(t){return Tn.create([this,t],this._def)}and(t){return Pn.create(this,t,this._def)}transform(t){return new Ot({...G(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Rn({...G(this._def),innerType:this,defaultValue:r,typeName:P.ZodDefault})}brand(){return new fi({typeName:P.ZodBranded,type:this,...G(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new An({...G(this._def),innerType:this,catchValue:r,typeName:P.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return hi.create(this,t)}readonly(){return On.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},SP=/^c[^\s-]{8,}$/i,$P=/^[0-9a-z]+$/,TP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,PP=/^[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,CP=/^[a-z0-9_-]{21}$/i,EP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,IP=/^[-+]?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)?)??$/,zP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,RP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",AP=/^(?:(?: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])$/,OP=/^(?:(?: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])$/,NP=/^(([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]))$/,DP=/^(([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])$/,jP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,MP=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jg="((\\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])))",LP=new RegExp(`^${Jg}$`);Hr=class e extends J{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==I.string){let i=this._getOrReturnCtx(t);return E(i,{code:$.invalid_type,expected:I.string,received:i.parsedType}),Z}let n=new Fe,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),E(o,{code:$.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),E(o,{code:$.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,a=t.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(t,o),s?E(o,{code:$.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&E(o,{code:$.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")zP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"email",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Gu||(Gu=new RegExp(RP,"u")),Gu.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"emoji",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")PP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"uuid",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")CP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"nanoid",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")SP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"cuid",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")$P.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"cuid2",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")TP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"ulid",code:$.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),E(o,{validation:"url",code:$.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"regex",code:$.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),E(o,{code:$.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),E(o,{code:$.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),E(o,{code:$.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Qg(i).test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{code:$.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?LP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{code:$.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?ZP(i).test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{code:$.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?IP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"duration",code:$.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?qP(t.data,i.version)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"ip",code:$.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?FP(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"jwt",code:$.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?UP(t.data,i.version)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"cidr",code:$.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?jP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"base64",code:$.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?MP.test(t.data)||(o=this._getOrReturnCtx(t,o),E(o,{validation:"base64url",code:$.invalid_string,message:i.message}),n.dirty()):te.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:$.invalid_string,...A.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...A.errToObj(t)})}url(t){return this._addCheck({kind:"url",...A.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...A.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...A.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...A.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...A.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...A.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...A.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...A.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...A.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...A.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...A.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...A.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...A.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...A.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...A.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...A.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...A.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...A.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...A.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...A.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...A.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...A.errToObj(r)})}nonempty(t){return this.min(1,A.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Hr.create=e=>new Hr({checks:[],typeName:P.ZodString,coerce:e?.coerce??!1,...G(e)});bn=class e extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==I.number){let i=this._getOrReturnCtx(t);return E(i,{code:$.invalid_type,expected:I.number,received:i.parsedType}),Z}let n,o=new Fe;for(let i of this._def.checks)i.kind==="int"?te.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),E(n,{code:$.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),E(n,{code:$.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),E(n,{code:$.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?BP(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),E(n,{code:$.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),E(n,{code:$.not_finite,message:i.message}),o.dirty()):te.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,A.toString(r))}gt(t,r){return this.setLimit("min",t,!1,A.toString(r))}lte(t,r){return this.setLimit("max",t,!0,A.toString(r))}lt(t,r){return this.setLimit("max",t,!1,A.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:A.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:A.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:A.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:A.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:A.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:A.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:A.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:A.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:A.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:A.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&te.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};bn.create=e=>new bn({checks:[],typeName:P.ZodNumber,coerce:e?.coerce||!1,...G(e)});xn=class e extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==I.bigint)return this._getInvalidInput(t);let n,o=new Fe;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),E(n,{code:$.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),E(n,{code:$.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),E(n,{code:$.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):te.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return E(r,{code:$.invalid_type,expected:I.bigint,received:r.parsedType}),Z}gte(t,r){return this.setLimit("min",t,!0,A.toString(r))}gt(t,r){return this.setLimit("min",t,!1,A.toString(r))}lte(t,r){return this.setLimit("max",t,!0,A.toString(r))}lt(t,r){return this.setLimit("max",t,!1,A.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:A.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:A.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:A.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:A.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:A.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:A.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};xn.create=e=>new xn({checks:[],typeName:P.ZodBigInt,coerce:e?.coerce??!1,...G(e)});wn=class extends J{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==I.boolean){let n=this._getOrReturnCtx(t);return E(n,{code:$.invalid_type,expected:I.boolean,received:n.parsedType}),Z}return Xe(t.data)}};wn.create=e=>new wn({typeName:P.ZodBoolean,coerce:e?.coerce||!1,...G(e)});kn=class e extends J{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==I.date){let i=this._getOrReturnCtx(t);return E(i,{code:$.invalid_type,expected:I.date,received:i.parsedType}),Z}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return E(i,{code:$.invalid_date}),Z}let n=new Fe,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),E(o,{code:$.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),E(o,{code:$.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):te.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:A.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:A.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};kn.create=e=>new kn({checks:[],coerce:e?.coerce||!1,typeName:P.ZodDate,...G(e)});ho=class extends J{_parse(t){if(this._getType(t)!==I.symbol){let n=this._getOrReturnCtx(t);return E(n,{code:$.invalid_type,expected:I.symbol,received:n.parsedType}),Z}return Xe(t.data)}};ho.create=e=>new ho({typeName:P.ZodSymbol,...G(e)});Sn=class extends J{_parse(t){if(this._getType(t)!==I.undefined){let n=this._getOrReturnCtx(t);return E(n,{code:$.invalid_type,expected:I.undefined,received:n.parsedType}),Z}return Xe(t.data)}};Sn.create=e=>new Sn({typeName:P.ZodUndefined,...G(e)});$n=class extends J{_parse(t){if(this._getType(t)!==I.null){let n=this._getOrReturnCtx(t);return E(n,{code:$.invalid_type,expected:I.null,received:n.parsedType}),Z}return Xe(t.data)}};$n.create=e=>new $n({typeName:P.ZodNull,...G(e)});Gr=class extends J{constructor(){super(...arguments),this._any=!0}_parse(t){return Xe(t.data)}};Gr.create=e=>new Gr({typeName:P.ZodAny,...G(e)});$r=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xe(t.data)}};$r.create=e=>new $r({typeName:P.ZodUnknown,...G(e)});Wt=class extends J{_parse(t){let r=this._getOrReturnCtx(t);return E(r,{code:$.invalid_type,expected:I.never,received:r.parsedType}),Z}};Wt.create=e=>new Wt({typeName:P.ZodNever,...G(e)});mo=class extends J{_parse(t){if(this._getType(t)!==I.undefined){let n=this._getOrReturnCtx(t);return E(n,{code:$.invalid_type,expected:I.void,received:n.parsedType}),Z}return Xe(t.data)}};mo.create=e=>new mo({typeName:P.ZodVoid,...G(e)});Tr=class e extends J{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==I.array)return E(r,{code:$.invalid_type,expected:I.array,received:r.parsedType}),Z;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(E(r,{code:s?$.too_big:$.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(E(r,{code:$.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(E(r,{code:$.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new At(r,s,r.path,a)))).then(s=>Fe.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new At(r,s,r.path,a)));return Fe.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:A.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:A.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:A.toString(r)}})}nonempty(t){return this.min(1,t)}};Tr.create=(e,t)=>new Tr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...G(t)});yt=class e extends J{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=te.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==I.object){let u=this._getOrReturnCtx(t);return E(u,{code:$.invalid_type,expected:I.object,received:u.parsedType}),Z}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Wt&&this._def.unknownKeys==="strip"))for(let u in o.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let p=i[u],l=o.data[u];c.push({key:{status:"valid",value:u},value:p._parse(new At(o,l,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Wt){let u=this._def.unknownKeys;if(u==="passthrough")for(let p of a)c.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(u==="strict")a.length>0&&(E(o,{code:$.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let p of a){let l=o.data[p];c.push({key:{status:"valid",value:p},value:u._parse(new At(o,l,o.path,p)),alwaysSet:p in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let p of c){let l=await p.key,d=await p.value;u.push({key:l,value:d,alwaysSet:p.alwaysSet})}return u}).then(u=>Fe.mergeObjectSync(n,u)):Fe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return A.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:A.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:P.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of te.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of te.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return fo(this)}partial(t){let r={};for(let n of te.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of te.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof gt;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return Xg(te.objectKeys(this.shape))}};yt.create=(e,t)=>new yt({shape:()=>e,unknownKeys:"strip",catchall:Wt.create(),typeName:P.ZodObject,...G(t)});yt.strictCreate=(e,t)=>new yt({shape:()=>e,unknownKeys:"strict",catchall:Wt.create(),typeName:P.ZodObject,...G(t)});yt.lazycreate=(e,t)=>new yt({shape:e,unknownKeys:"strip",catchall:Wt.create(),typeName:P.ZodObject,...G(t)});Tn=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new mt(a.ctx.common.issues));return E(r,{code:$.invalid_union,unionErrors:s}),Z}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},p=c._parseSync({data:r.data,path:r.path,parent:u});if(p.status==="valid")return p;p.status==="dirty"&&!i&&(i={result:p,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(c=>new mt(c));return E(r,{code:$.invalid_union,unionErrors:a}),Z}}get options(){return this._def.options}};Tn.create=(e,t)=>new Tn({options:e,typeName:P.ZodUnion,...G(t)});Sr=e=>e instanceof Cn?Sr(e.schema):e instanceof Ot?Sr(e.innerType()):e instanceof En?[e.value]:e instanceof In?e.options:e instanceof zn?te.objectValues(e.enum):e instanceof Rn?Sr(e._def.innerType):e instanceof Sn?[void 0]:e instanceof $n?[null]:e instanceof gt?[void 0,...Sr(e.unwrap())]:e instanceof lr?[null,...Sr(e.unwrap())]:e instanceof fi||e instanceof On?Sr(e.unwrap()):e instanceof An?Sr(e._def.innerType):[],Vs=class e extends J{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.object)return E(r,{code:$.invalid_type,expected:I.object,received:r.parsedType}),Z;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(E(r,{code:$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Z)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let s=Sr(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new e({typeName:P.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...G(n)})}};Pn=class extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(Us(i)||Us(s))return Z;let a=Wu(i.value,s.value);return a.valid?((Bs(i)||Bs(s))&&r.dirty(),{status:r.value,value:a.data}):(E(n,{code:$.invalid_intersection_types}),Z)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Pn.create=(e,t,r)=>new Pn({left:e,right:t,typeName:P.ZodIntersection,...G(r)});ur=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.array)return E(n,{code:$.invalid_type,expected:I.array,received:n.parsedType}),Z;if(n.data.length<this._def.items.length)return E(n,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Z;!this._def.rest&&n.data.length>this._def.items.length&&(E(n,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new At(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>Fe.mergeArray(r,s)):Fe.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ur.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ur({items:e,typeName:P.ZodTuple,rest:null,...G(t)})};Hs=class e extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.object)return E(n,{code:$.invalid_type,expected:I.object,received:n.parsedType}),Z;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new At(n,a,n.path,a)),value:s._parse(new At(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Fe.mergeObjectAsync(r,o):Fe.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof J?new e({keyType:t,valueType:r,typeName:P.ZodRecord,...G(n)}):new e({keyType:Hr.create(),valueType:t,typeName:P.ZodRecord,...G(r)})}},go=class extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.map)return E(n,{code:$.invalid_type,expected:I.map,received:n.parsedType}),Z;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new At(n,a,n.path,[u,"key"])),value:i._parse(new At(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,p=await c.value;if(u.status==="aborted"||p.status==="aborted")return Z;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(u.value,p.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,p=c.value;if(u.status==="aborted"||p.status==="aborted")return Z;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(u.value,p.value)}return{status:r.value,value:a}}}};go.create=(e,t,r)=>new go({valueType:t,keyType:e,typeName:P.ZodMap,...G(r)});yo=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.set)return E(n,{code:$.invalid_type,expected:I.set,received:n.parsedType}),Z;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(E(n,{code:$.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(E(n,{code:$.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(c){let u=new Set;for(let p of c){if(p.status==="aborted")return Z;p.status==="dirty"&&r.dirty(),u.add(p.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>i._parse(new At(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:A.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:A.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};yo.create=(e,t)=>new yo({valueType:e,minSize:null,maxSize:null,typeName:P.ZodSet,...G(t)});Gs=class e extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.function)return E(r,{code:$.invalid_type,expected:I.function,received:r.parsedType}),Z;function n(a,c){return di({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,lo(),kr].filter(u=>!!u),issueData:{code:$.invalid_arguments,argumentsError:c}})}function o(a,c){return di({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,lo(),kr].filter(u=>!!u),issueData:{code:$.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Wr){let a=this;return Xe(async function(...c){let u=new mt([]),p=await a._def.args.parseAsync(c,i).catch(f=>{throw u.addIssue(n(c,f)),u}),l=await Reflect.apply(s,this,p);return await a._def.returns._def.type.parseAsync(l,i).catch(f=>{throw u.addIssue(o(l,f)),u})})}else{let a=this;return Xe(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new mt([n(c,u.error)]);let p=Reflect.apply(s,this,u.data),l=a._def.returns.safeParse(p,i);if(!l.success)throw new mt([o(p,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ur.create(t).rest($r.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ur.create([]).rest($r.create()),returns:r||$r.create(),typeName:P.ZodFunction,...G(n)})}},Cn=class extends J{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Cn.create=(e,t)=>new Cn({getter:e,typeName:P.ZodLazy,...G(t)});En=class extends J{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return E(r,{received:r.data,code:$.invalid_literal,expected:this._def.value}),Z}return{status:"valid",value:t.data}}get value(){return this._def.value}};En.create=(e,t)=>new En({value:e,typeName:P.ZodLiteral,...G(t)});In=class e extends J{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return E(r,{expected:te.joinValues(n),received:r.parsedType,code:$.invalid_type}),Z}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return E(r,{received:r.data,code:$.invalid_enum_value,options:n}),Z}return Xe(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};In.create=Xg;zn=class extends J{_parse(t){let r=te.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==I.string&&n.parsedType!==I.number){let o=te.objectValues(r);return E(n,{expected:te.joinValues(o),received:n.parsedType,code:$.invalid_type}),Z}if(this._cache||(this._cache=new Set(te.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=te.objectValues(r);return E(n,{received:n.data,code:$.invalid_enum_value,options:o}),Z}return Xe(t.data)}get enum(){return this._def.values}};zn.create=(e,t)=>new zn({values:e,typeName:P.ZodNativeEnum,...G(t)});Wr=class extends J{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.promise&&r.common.async===!1)return E(r,{code:$.invalid_type,expected:I.promise,received:r.parsedType}),Z;let n=r.parsedType===I.promise?r.data:Promise.resolve(r.data);return Xe(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Wr.create=(e,t)=>new Wr({type:e,typeName:P.ZodPromise,...G(t)});Ot=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{E(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return Z;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?Z:c.status==="dirty"?vn(c.value):r.value==="dirty"?vn(c.value):c});{if(r.value==="aborted")return Z;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?Z:a.status==="dirty"?vn(a.value):r.value==="dirty"?vn(a.value):a}}if(o.type==="refinement"){let s=a=>{let c=o.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Z:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Z:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Vr(s))return Z;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Vr(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):Z);te.assertNever(o)}};Ot.create=(e,t,r)=>new Ot({schema:e,typeName:P.ZodEffects,effect:t,...G(r)});Ot.createWithPreprocess=(e,t,r)=>new Ot({schema:t,effect:{type:"preprocess",transform:e},typeName:P.ZodEffects,...G(r)});gt=class extends J{_parse(t){return this._getType(t)===I.undefined?Xe(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};gt.create=(e,t)=>new gt({innerType:e,typeName:P.ZodOptional,...G(t)});lr=class extends J{_parse(t){return this._getType(t)===I.null?Xe(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};lr.create=(e,t)=>new lr({innerType:e,typeName:P.ZodNullable,...G(t)});Rn=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===I.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Rn.create=(e,t)=>new Rn({innerType:e,typeName:P.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...G(t)});An=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return po(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new mt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new mt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};An.create=(e,t)=>new An({innerType:e,typeName:P.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...G(t)});_o=class extends J{_parse(t){if(this._getType(t)!==I.nan){let n=this._getOrReturnCtx(t);return E(n,{code:$.invalid_type,expected:I.nan,received:n.parsedType}),Z}return{status:"valid",value:t.data}}};_o.create=e=>new _o({typeName:P.ZodNaN,...G(e)});VP=Symbol("zod_brand"),fi=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},hi=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Z:i.status==="dirty"?(r.dirty(),vn(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Z:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:P.ZodPipeline})}},On=class extends J{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Vr(o)&&(o.value=Object.freeze(o.value)),o);return po(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};On.create=(e,t)=>new On({innerType:e,typeName:P.ZodReadonly,...G(t)});HP={object:yt.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(P||(P={}));GP=(e,t={message:`Input not instance of ${e.name}`})=>ey(r=>r instanceof e,t),ty=Hr.create,ry=bn.create,WP=_o.create,KP=xn.create,ny=wn.create,JP=kn.create,YP=ho.create,QP=Sn.create,XP=$n.create,eC=Gr.create,tC=$r.create,rC=Wt.create,nC=mo.create,oC=Tr.create,Ku=yt.create,iC=yt.strictCreate,sC=Tn.create,aC=Vs.create,cC=Pn.create,uC=ur.create,lC=Hs.create,pC=go.create,dC=yo.create,fC=Gs.create,hC=Cn.create,mC=En.create,gC=In.create,yC=zn.create,_C=Wr.create,vC=Ot.create,bC=gt.create,xC=lr.create,wC=Ot.createWithPreprocess,kC=hi.create,SC=()=>ty().optional(),$C=()=>ry().optional(),TC=()=>ny().optional(),PC={string:(e=>Hr.create({...e,coerce:!0})),number:(e=>bn.create({...e,coerce:!0})),boolean:(e=>wn.create({...e,coerce:!0})),bigint:(e=>xn.create({...e,coerce:!0})),date:(e=>kn.create({...e,coerce:!0}))},CC=Z});var m={};Br(m,{BRAND:()=>VP,DIRTY:()=>vn,EMPTY_PATH:()=>kP,INVALID:()=>Z,NEVER:()=>CC,OK:()=>Xe,ParseStatus:()=>Fe,Schema:()=>J,ZodAny:()=>Gr,ZodArray:()=>Tr,ZodBigInt:()=>xn,ZodBoolean:()=>wn,ZodBranded:()=>fi,ZodCatch:()=>An,ZodDate:()=>kn,ZodDefault:()=>Rn,ZodDiscriminatedUnion:()=>Vs,ZodEffects:()=>Ot,ZodEnum:()=>In,ZodError:()=>mt,ZodFirstPartyTypeKind:()=>P,ZodFunction:()=>Gs,ZodIntersection:()=>Pn,ZodIssueCode:()=>$,ZodLazy:()=>Cn,ZodLiteral:()=>En,ZodMap:()=>go,ZodNaN:()=>_o,ZodNativeEnum:()=>zn,ZodNever:()=>Wt,ZodNull:()=>$n,ZodNullable:()=>lr,ZodNumber:()=>bn,ZodObject:()=>yt,ZodOptional:()=>gt,ZodParsedType:()=>I,ZodPipeline:()=>hi,ZodPromise:()=>Wr,ZodReadonly:()=>On,ZodRecord:()=>Hs,ZodSchema:()=>J,ZodSet:()=>yo,ZodString:()=>Hr,ZodSymbol:()=>ho,ZodTransformer:()=>Ot,ZodTuple:()=>ur,ZodType:()=>J,ZodUndefined:()=>Sn,ZodUnion:()=>Tn,ZodUnknown:()=>$r,ZodVoid:()=>mo,addIssueToContext:()=>E,any:()=>eC,array:()=>oC,bigint:()=>KP,boolean:()=>ny,coerce:()=>PC,custom:()=>ey,date:()=>JP,datetimeRegex:()=>Qg,defaultErrorMap:()=>kr,discriminatedUnion:()=>aC,effect:()=>vC,enum:()=>gC,function:()=>fC,getErrorMap:()=>lo,getParsedType:()=>cr,instanceof:()=>GP,intersection:()=>cC,isAborted:()=>Us,isAsync:()=>po,isDirty:()=>Bs,isValid:()=>Vr,late:()=>HP,lazy:()=>hC,literal:()=>mC,makeIssue:()=>di,map:()=>pC,nan:()=>WP,nativeEnum:()=>yC,never:()=>rC,null:()=>XP,nullable:()=>xC,number:()=>ry,object:()=>Ku,objectUtil:()=>Bu,oboolean:()=>TC,onumber:()=>$C,optional:()=>bC,ostring:()=>SC,pipeline:()=>kC,preprocess:()=>wC,promise:()=>_C,quotelessJson:()=>bP,record:()=>lC,set:()=>dC,setErrorMap:()=>wP,strictObject:()=>iC,string:()=>ty,symbol:()=>YP,transformer:()=>vC,tuple:()=>uC,undefined:()=>QP,union:()=>sC,unknown:()=>tC,util:()=>te,void:()=>nC});var Ws=_(()=>{Fs();Hu();Hg();pi();oy();qs()});var mi=_(()=>{Ws()});function w(e,t,r){function n(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,c);for(let p in s.prototype)p in a||Object.defineProperty(a,p,{value:s.prototype[p].bind(a)});a._zod.constr=s,a._zod.def=c}let o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var c;let u=r?.Parent?new i:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function Tt(e){return e&&Object.assign(Ks,e),Ks}var IC,zC,Pr,Ks,vo=_(()=>{IC=Object.freeze({status:"aborted"});zC=Symbol("zod_brand"),Pr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ks={}});var oe={};Br(oe,{BIGINT_FORMAT_RANGES:()=>sy,Class:()=>Yu,NUMBER_FORMAT_RANGES:()=>ol,aborted:()=>Dn,allowsEval:()=>tl,assert:()=>DC,assertEqual:()=>RC,assertIs:()=>OC,assertNever:()=>NC,assertNotEqual:()=>AC,assignProp:()=>el,cached:()=>_i,captureStackTrace:()=>Ys,cleanEnum:()=>KC,cleanRegex:()=>bi,clone:()=>Pt,createTransparentProxy:()=>FC,defineLazy:()=>ve,esc:()=>Nn,escapeRegex:()=>Kr,extend:()=>VC,finalizeIssue:()=>Kt,floatSafeRemainder:()=>Xu,getElementAtPath:()=>jC,getEnumValues:()=>yi,getLengthableOrigin:()=>xi,getParsedType:()=>qC,getSizableOrigin:()=>ay,isObject:()=>bo,isPlainObject:()=>xo,issue:()=>il,joinValues:()=>Js,jsonStringifyReplacer:()=>Qu,merge:()=>HC,normalizeParams:()=>q,nullish:()=>vi,numKeys:()=>ZC,omit:()=>BC,optionalKeys:()=>nl,partial:()=>GC,pick:()=>UC,prefixIssues:()=>pr,primitiveTypes:()=>iy,promiseAllObject:()=>MC,propertyKeyTypes:()=>rl,randomString:()=>LC,required:()=>WC,stringifyPrimitive:()=>Qs,unwrapMessage:()=>gi});function RC(e){return e}function AC(e){return e}function OC(e){}function NC(e){throw new Error}function DC(e){}function yi(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Js(e,t="|"){return e.map(r=>Qs(r)).join(t)}function Qu(e,t){return typeof t=="bigint"?t.toString():t}function _i(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function vi(e){return e==null}function bi(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Xu(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function ve(e,t,r){Object.defineProperty(e,t,{get(){{let o=r();return e[t]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function el(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function jC(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function MC(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function LC(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function Nn(e){return JSON.stringify(e)}function bo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xo(e){if(bo(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(bo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function ZC(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function Kr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function FC(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Qs(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function nl(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function UC(e,t){let r={},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(r[o]=n.shape[o])}return Pt(e,{...e._zod.def,shape:r,checks:[]})}function BC(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete r[o]}return Pt(e,{...e._zod.def,shape:r,checks:[]})}function VC(e,t){if(!xo(t))throw new Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return el(this,"shape",n),n},checks:[]};return Pt(e,r)}function HC(e,t){return Pt(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return el(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function GC(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in n))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=e?new e({type:"optional",innerType:n[i]}):n[i])}else for(let i in n)o[i]=e?new e({type:"optional",innerType:n[i]}):n[i];return Pt(t,{...t._zod.def,shape:o,checks:[]})}function WC(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)o[i]=new e({type:"nonoptional",innerType:n[i]});return Pt(t,{...t._zod.def,shape:o,checks:[]})}function Dn(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function pr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function gi(e){return typeof e=="string"?e:e?.message}function Kt(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=gi(e.inst?._zod.def?.error?.(e))??gi(t?.error?.(e))??gi(r.customError?.(e))??gi(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ay(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function xi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function il(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function KC(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var Ys,tl,qC,rl,iy,ol,sy,Yu,dr=_(()=>{Ys=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};tl=_i(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});qC=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},rl=new Set(["string","number","symbol"]),iy=new Set(["string","number","bigint","boolean","symbol","undefined"]);ol={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},sy={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Yu=class{constructor(...t){}}});function sl(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function al(e,t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(e),n}var cy,Xs,wi,cl=_(()=>{vo();dr();cy=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Qu,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xs=w("$ZodError",cy),wi=w("$ZodError",cy,{Parent:Error})});var ul,ll,pl,dl,fl,jn,hl,Mn,ml=_(()=>{vo();cl();dr();ul=e=>(t,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Pr;if(s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>Kt(c,i,Tt())));throw Ys(a,o?.callee),a}return s.value},ll=ul(wi),pl=e=>async(t,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>Kt(c,i,Tt())));throw Ys(a,o?.callee),a}return s.value},dl=pl(wi),fl=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Pr;return i.issues.length?{success:!1,error:new(e??Xs)(i.issues.map(s=>Kt(s,o,Tt())))}:{success:!0,data:i.value}},jn=fl(wi),hl=e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Kt(s,o,Tt())))}:{success:!0,data:i.value}},Mn=hl(wi)});function _y(){return new RegExp(YC,"u")}function Cy(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ey(e){return new RegExp(`^${Cy(e)}$`)}function Iy(e){let t=Cy({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Ty}T(?:${n})$`)}var uy,ly,py,dy,fy,hy,my,gy,gl,yy,YC,vy,by,xy,wy,ky,yl,Sy,$y,Ty,Py,zy,Ry,Ay,Oy,Ny,Dy,jy,ta=_(()=>{uy=/^[cC][^\s-]{8,}$/,ly=/^[0-9a-z]+$/,py=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,dy=/^[0-9a-vA-V]{20}$/,fy=/^[A-Za-z0-9]{27}$/,hy=/^[a-zA-Z0-9_-]{21}$/,my=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gy=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,gl=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,yy=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,YC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";vy=/^(?:(?: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])$/,by=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,xy=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,wy=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ky=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,yl=/^[A-Za-z0-9_-]*$/,Sy=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,$y=/^\+(?:[0-9]){6,14}[0-9]$/,Ty="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Py=new RegExp(`^${Ty}$`);zy=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ry=/^\d+$/,Ay=/^-?\d+(?:\.\d+)?/i,Oy=/true|false/i,Ny=/null/i,Dy=/^[^A-Z]*$/,jy=/^[^a-z]*$/});var Ue,My,_l,vl,Ly,Zy,qy,Fy,Uy,ki,By,Vy,Hy,Gy,Wy,Ky,Jy,ra=_(()=>{vo();ta();dr();Ue=w("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),My={number:"number",bigint:"bigint",object:"date"},_l=w("$ZodCheckLessThan",(e,t)=>{Ue.init(e,t);let r=My[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vl=w("$ZodCheckGreaterThan",(e,t)=>{Ue.init(e,t);let r=My[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ly=w("$ZodCheckMultipleOf",(e,t)=>{Ue.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Xu(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Zy=w("$ZodCheckNumberFormat",(e,t)=>{Ue.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=ol[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=o,a.maximum=i,r&&(a.pattern=Ry)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}}),qy=w("$ZodCheckMaxLength",(e,t)=>{var r;Ue.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!vi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let o=n.value;if(o.length<=t.maximum)return;let s=xi(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Fy=w("$ZodCheckMinLength",(e,t)=>{var r;Ue.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!vi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let s=xi(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Uy=w("$ZodCheckLengthEquals",(e,t)=>{var r;Ue.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!vi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{let o=n.value,i=o.length;if(i===t.length)return;let s=xi(o),a=i>t.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ki=w("$ZodCheckStringFormat",(e,t)=>{var r,n;Ue.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),By=w("$ZodCheckRegex",(e,t)=>{ki.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Vy=w("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Dy),ki.init(e,t)}),Hy=w("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=jy),ki.init(e,t)}),Gy=w("$ZodCheckIncludes",(e,t)=>{Ue.init(e,t);let r=Kr(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Wy=w("$ZodCheckStartsWith",(e,t)=>{Ue.init(e,t);let r=new RegExp(`^${Kr(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ky=w("$ZodCheckEndsWith",(e,t)=>{Ue.init(e,t);let r=new RegExp(`.*${Kr(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Jy=w("$ZodCheckOverwrite",(e,t)=>{Ue.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var na,bl=_(()=>{na=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
2
2
|
`).filter(s=>s),o=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,o.join(`
|
|
3
|
-
`))}}});var Qy,xl=_(()=>{Qy={major:4,minor:0,patch:0}});function d_(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function
|
|
3
|
+
`))}}});var Qy,xl=_(()=>{Qy={major:4,minor:0,patch:0}});function d_(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function QC(e){if(!yl.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return d_(r)}function XC(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}function Xy(e,t,r){e.issues.length&&t.issues.push(...pr(r,e.issues)),t.value[r]=e.value}function oa(e,t,r){e.issues.length&&t.issues.push(...pr(r,e.issues)),t.value[r]=e.value}function e_(e,t,r,n){e.issues.length?n[r]===void 0?r in n?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...pr(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function t_(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(i=>Kt(i,n,Tt())))}),t}function wl(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(xo(e)&&xo(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};for(let i of n){let s=wl(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=wl(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function r_(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Dn(e))return e;let n=wl(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}function n_(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function o_(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function i_(e,t,r){return Dn(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}function s_(e){return e.value=Object.freeze(e.value),e}function a_(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(il(o))}}var me,Si,be,kl,Sl,$l,Tl,Pl,Cl,El,Il,zl,Rl,Al,c_,u_,l_,p_,Ol,Nl,Dl,jl,Ml,Ll,Zl,ql,ia,Fl,Ul,Bl,Vl,Hl,Gl,sa,aa,Wl,Kl,Jl,Yl,Ql,Xl,ep,tp,rp,np,op,ip,sp,ap,cp,f_=_(()=>{ra();vo();bl();ml();ta();dr();xl();dr();me=w("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Qy;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(i,s,a)=>{let c=Dn(i),u;for(let p of s){if(p._zod.def.when){if(!p._zod.def.when(i))continue}else if(c)continue;let l=i.issues.length,d=p._zod.check(i);if(d instanceof Promise&&a?.async===!1)throw new Pr;if(u||d instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await d,i.issues.length!==l&&(c||(c=Dn(i,l)))});else{if(i.issues.length===l)continue;c||(c=Dn(i,l))}}return u?u.then(()=>i):i};e._zod.run=(i,s)=>{let a=e._zod.parse(i,s);if(a instanceof Promise){if(s.async===!1)throw new Pr;return a.then(c=>o(c,n,s))}return o(a,n,s)}}e["~standard"]={validate:o=>{try{let i=jn(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Mn(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),Si=w("$ZodString",(e,t)=>{me.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??zy(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),be=w("$ZodStringFormat",(e,t)=>{ki.init(e,t),Si.init(e,t)}),kl=w("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=gy),be.init(e,t)}),Sl=w("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=gl(n))}else t.pattern??(t.pattern=gl());be.init(e,t)}),$l=w("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=yy),be.init(e,t)}),Tl=w("$ZodURL",(e,t)=>{be.init(e,t),e._zod.check=r=>{try{let n=r.value,o=new URL(n),i=o.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Sy.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),!n.endsWith("/")&&i.endsWith("/")?r.value=i.slice(0,-1):r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Pl=w("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=_y()),be.init(e,t)}),Cl=w("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=hy),be.init(e,t)}),El=w("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=uy),be.init(e,t)}),Il=w("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ly),be.init(e,t)}),zl=w("$ZodULID",(e,t)=>{t.pattern??(t.pattern=py),be.init(e,t)}),Rl=w("$ZodXID",(e,t)=>{t.pattern??(t.pattern=dy),be.init(e,t)}),Al=w("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fy),be.init(e,t)}),c_=w("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Iy(t)),be.init(e,t)}),u_=w("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Py),be.init(e,t)}),l_=w("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ey(t)),be.init(e,t)}),p_=w("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=my),be.init(e,t)}),Ol=w("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=vy),be.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Nl=w("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=by),be.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Dl=w("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=xy),be.init(e,t)}),jl=w("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=wy),be.init(e,t),e._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});Ml=w("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ky),be.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{d_(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});Ll=w("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=yl),be.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{QC(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Zl=w("$ZodE164",(e,t)=>{t.pattern??(t.pattern=$y),be.init(e,t)});ql=w("$ZodJWT",(e,t)=>{be.init(e,t),e._zod.check=r=>{XC(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),ia=w("$ZodNumber",(e,t)=>{me.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ay,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),Fl=w("$ZodNumber",(e,t)=>{Zy.init(e,t),ia.init(e,t)}),Ul=w("$ZodBoolean",(e,t)=>{me.init(e,t),e._zod.pattern=Oy,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Bl=w("$ZodNull",(e,t)=>{me.init(e,t),e._zod.pattern=Ny,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),Vl=w("$ZodUnknown",(e,t)=>{me.init(e,t),e._zod.parse=r=>r}),Hl=w("$ZodNever",(e,t)=>{me.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});Gl=w("$ZodArray",(e,t)=>{me.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let i=[];for(let s=0;s<o.length;s++){let a=o[s],c=t.element._zod.run({value:a,issues:[]},n);c instanceof Promise?i.push(c.then(u=>Xy(u,r,s))):Xy(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});sa=w("$ZodObject",(e,t)=>{me.init(e,t);let r=_i(()=>{let l=Object.keys(t.shape);for(let f of l)if(!(t.shape[f]instanceof me))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);let d=nl(t.shape);return{shape:t.shape,keys:l,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(d)}});ve(e._zod,"propValues",()=>{let l=t.shape,d={};for(let f in l){let h=l[f]._zod;if(h.values){d[f]??(d[f]=new Set);for(let g of h.values)d[f].add(g)}}return d});let n=l=>{let d=new na(["shape","payload","ctx"]),f=r.value,h=v=>{let k=Nn(v);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};d.write("const input = payload.value;");let g=Object.create(null),y=0;for(let v of f.keys)g[v]=`key_${y++}`;d.write("const newResult = {}");for(let v of f.keys)if(f.optionalKeys.has(v)){let k=g[v];d.write(`const ${k} = ${h(v)};`);let C=Nn(v);d.write(`
|
|
4
4
|
if (${k}.issues.length) {
|
|
5
5
|
if (input[${C}] === undefined) {
|
|
6
6
|
if (${C} in input) {
|
|
@@ -23,63 +23,63 @@
|
|
|
23
23
|
if (${k}.issues.length) payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
|
|
24
24
|
...iss,
|
|
25
25
|
path: iss.path ? [${Nn(v)}, ...iss.path] : [${Nn(v)}]
|
|
26
|
-
})));`),d.write(`newResult[${Nn(v)}] = ${k}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");let b=d.compile();return(v,k)=>b(l,v,k)},o,i=bo,s=!Ks.jitless,c=s&&tl.value,u=t.catchall,p;e._zod.parse=(l,d)=>{p??(p=r.value);let f=l.value;if(!i(f))return l.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),l;let h=[];if(s&&c&&d?.async===!1&&d.jitless!==!0)o||(o=n(t.shape)),l=o(l,d);else{l.value={};let k=p.shape;for(let C of p.keys){let T=k[C],F=T._zod.run({value:f[C],issues:[]},d),Y=T._zod.optin==="optional"&&T._zod.optout==="optional";F instanceof Promise?h.push(F.then(Ie=>Y?e_(Ie,l,C,f):oa(Ie,l,C))):Y?e_(F,l,C,f):oa(F,l,C)}}if(!u)return h.length?Promise.all(h).then(()=>l):l;let g=[],y=p.keySet,b=u._zod,v=b.def.type;for(let k of Object.keys(f)){if(y.has(k))continue;if(v==="never"){g.push(k);continue}let C=b.run({value:f[k],issues:[]},d);C instanceof Promise?h.push(C.then(T=>oa(T,l,k))):oa(C,l,k)}return g.length&&l.issues.push({code:"unrecognized_keys",keys:g,input:f,inst:e}),h.length?Promise.all(h).then(()=>l):l}});aa=w("$ZodUnion",(e,t)=>{me.init(e,t),ve(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ve(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ve(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),ve(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>bi(n.source)).join("|")})$`)}}),e._zod.parse=(r,n)=>{let o=!1,i=[];for(let s of t.options){let a=s._zod.run({value:r.value,issues:[]},n);if(a instanceof Promise)i.push(a),o=!0;else{if(a.issues.length===0)return a;i.push(a)}}return o?Promise.all(i).then(s=>t_(s,r,e,n)):t_(i,r,e,n)}}),Wl=w("$ZodDiscriminatedUnion",(e,t)=>{aa.init(e,t);let r=e._zod.parse;ve(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,c]of Object.entries(s)){o[a]||(o[a]=new Set);for(let u of c)o[a].add(u)}}return o});let n=_i(()=>{let o=t.options,i=new Map;for(let s of o){let a=s._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!bo(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=n.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),o)}}),Kl=w("$ZodIntersection",(e,t)=>{me.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>r_(r,c,u)):r_(r,i,s)}});Jl=w("$ZodRecord",(e,t)=>{me.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!xo(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;r.value={};for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){let u=t.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?i.push(u.then(p=>{p.issues.length&&r.issues.push(...pr(c,p.issues)),r.value[c]=p.value})):(u.issues.length&&r.issues.push(...pr(c,u.issues)),r.value[c]=u.value)}let a;for(let c in o)s.has(c)||(a=a??[],a.push(c));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(let s of Reflect.ownKeys(o)){if(s==="__proto__")continue;let a=t.keyType._zod.run({value:s,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>Kt(u,n,Tt())),input:s,path:[s],inst:e}),r.value[a.value]=a.value;continue}let c=t.valueType._zod.run({value:o[s],issues:[]},n);c instanceof Promise?i.push(c.then(u=>{u.issues.length&&r.issues.push(...pr(s,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...pr(s,c.issues)),r.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>r):r}}),Yl=w("$ZodEnum",(e,t)=>{me.init(e,t);let r=yi(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>rl.has(typeof n)).map(n=>typeof n=="string"?Kr(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),Ql=w("$ZodLiteral",(e,t)=>{me.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Kr(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),Xl=w("$ZodTransform",(e,t)=>{me.init(e,t),e._zod.parse=(r,n)=>{let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new Pr;return r.value=o,r}}),ep=w("$ZodOptional",(e,t)=>{me.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ve(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ve(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${bi(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(r,n):r.value===void 0?r:t.innerType._zod.run(r,n)}),tp=w("$ZodNullable",(e,t)=>{me.init(e,t),ve(e._zod,"optin",()=>t.innerType._zod.optin),ve(e._zod,"optout",()=>t.innerType._zod.optout),ve(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${bi(r.source)}|null)$`):void 0}),ve(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),rp=w("$ZodDefault",(e,t)=>{me.init(e,t),e._zod.optin="optional",ve(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>n_(i,t)):n_(o,t)}});np=w("$ZodPrefault",(e,t)=>{me.init(e,t),e._zod.optin="optional",ve(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),op=w("$ZodNonOptional",(e,t)=>{me.init(e,t),ve(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>o_(i,e)):o_(o,e)}});ip=w("$ZodCatch",(e,t)=>{me.init(e,t),e._zod.optin="optional",ve(e._zod,"optout",()=>t.innerType._zod.optout),ve(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>Kt(s,n,Tt()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>Kt(i,n,Tt()))},input:r.value}),r.issues=[]),r)}}),sp=w("$ZodPipe",(e,t)=>{me.init(e,t),ve(e._zod,"values",()=>t.in._zod.values),ve(e._zod,"optin",()=>t.in._zod.optin),ve(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,n)=>{let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>i_(i,t,n)):i_(o,t,n)}});ap=w("$ZodReadonly",(e,t)=>{me.init(e,t),ve(e._zod,"propValues",()=>t.innerType._zod.propValues),ve(e._zod,"values",()=>t.innerType._zod.values),ve(e._zod,"optin",()=>t.innerType._zod.optin),ve(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s_):s_(o)}});cp=w("$ZodCustom",(e,t)=>{Ue.init(e,t),me.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>a_(i,r,n,e));a_(o,r,n,e)}})});function h_(){return{localeError:JC()}}var KC,JC,m_=_(()=>{dr();KC=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},JC=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${KC(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qs(n.values[0])}`:`Invalid option: expected one of ${Js(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",i=t(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",i=t(n.origin);return i?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Js(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});var ca=_(()=>{});function g_(){return new $i}var YC,QC,$i,Jr,lp=_(()=>{YC=Symbol("ZodOutput"),QC=Symbol("ZodInput"),$i=class{constructor(){this._map=new Map,this._idmap=new Map}add(t,...r){let n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};Jr=g_()});function pp(e,t){return new e({type:"string",...q(t)})}function dp(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...q(t)})}function ua(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...q(t)})}function fp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...q(t)})}function hp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...q(t)})}function mp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...q(t)})}function gp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...q(t)})}function yp(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...q(t)})}function _p(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...q(t)})}function vp(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...q(t)})}function bp(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...q(t)})}function xp(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...q(t)})}function wp(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...q(t)})}function kp(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...q(t)})}function Sp(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...q(t)})}function $p(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...q(t)})}function Tp(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...q(t)})}function Pp(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...q(t)})}function Cp(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...q(t)})}function Ep(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...q(t)})}function Ip(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...q(t)})}function zp(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...q(t)})}function Rp(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...q(t)})}function y_(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...q(t)})}function __(e,t){return new e({type:"string",format:"date",check:"string_format",...q(t)})}function v_(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...q(t)})}function b_(e,t){return new e({type:"string",format:"duration",check:"string_format",...q(t)})}function Ap(e,t){return new e({type:"number",checks:[],...q(t)})}function Op(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...q(t)})}function Np(e,t){return new e({type:"boolean",...q(t)})}function Dp(e,t){return new e({type:"null",...q(t)})}function jp(e){return new e({type:"unknown"})}function Mp(e,t){return new e({type:"never",...q(t)})}function la(e,t){return new _l({check:"less_than",...q(t),value:e,inclusive:!1})}function Ti(e,t){return new _l({check:"less_than",...q(t),value:e,inclusive:!0})}function pa(e,t){return new vl({check:"greater_than",...q(t),value:e,inclusive:!1})}function Pi(e,t){return new vl({check:"greater_than",...q(t),value:e,inclusive:!0})}function da(e,t){return new Ly({check:"multiple_of",...q(t),value:e})}function fa(e,t){return new qy({check:"max_length",...q(t),maximum:e})}function wo(e,t){return new Fy({check:"min_length",...q(t),minimum:e})}function ha(e,t){return new Uy({check:"length_equals",...q(t),length:e})}function Lp(e,t){return new By({check:"string_format",format:"regex",...q(t),pattern:e})}function Zp(e){return new Vy({check:"string_format",format:"lowercase",...q(e)})}function qp(e){return new Hy({check:"string_format",format:"uppercase",...q(e)})}function Fp(e,t){return new Gy({check:"string_format",format:"includes",...q(t),includes:e})}function Up(e,t){return new Wy({check:"string_format",format:"starts_with",...q(t),prefix:e})}function Bp(e,t){return new Ky({check:"string_format",format:"ends_with",...q(t),suffix:e})}function Ln(e){return new Jy({check:"overwrite",tx:e})}function Vp(e){return Ln(t=>t.normalize(e))}function Hp(){return Ln(e=>e.trim())}function Gp(){return Ln(e=>e.toLowerCase())}function Wp(){return Ln(e=>e.toUpperCase())}function x_(e,t,r){return new e({type:"array",element:t,...q(r)})}function Kp(e,t,r){let n=q(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Jp(e,t,r){return new e({type:"custom",check:"custom",fn:t,...q(r)})}var w_=_(()=>{ra();dr()});var k_=_(()=>{});function Yp(e,t){if(e instanceof $i){let n=new ma(t),o={};for(let a of e._idmap.entries()){let[c,u]=a;n.process(u)}let i={},s={registry:e,uri:t?.uri,defs:o};for(let a of e._idmap.entries()){let[c,u]=a;i[c]=n.emit(u,{...t,external:s})}if(Object.keys(o).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:o}}return{schemas:i}}let r=new ma(t);return r.process(e),r.emit(e,t)}function Le(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Le(o.element,r);case"object":{for(let i in o.shape)if(Le(o.shape[i],r))return!0;return!1}case"union":{for(let i of o.options)if(Le(i,r))return!0;return!1}case"intersection":return Le(o.left,r)||Le(o.right,r);case"tuple":{for(let i of o.items)if(Le(i,r))return!0;return!!(o.rest&&Le(o.rest,r))}case"record":return Le(o.keyType,r)||Le(o.valueType,r);case"map":return Le(o.keyType,r)||Le(o.valueType,r);case"set":return Le(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Le(o.innerType,r);case"lazy":return Le(o.getter(),r);case"default":return Le(o.innerType,r);case"prefault":return Le(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Le(o.in,r)||Le(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}var ma,S_=_(()=>{lp();dr();ma=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??Jr,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(t,a);let c=t._zod.toJSONSchema?.();if(c)a.schema=c;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path},d=t._zod.parent;if(d)a.ref=d,this.process(d,l),this.seen.get(d).isParent=!0;else{let f=a.schema;switch(o.type){case"string":{let h=f;h.type="string";let{minimum:g,maximum:y,format:b,patterns:v,contentEncoding:k}=t._zod.bag;if(typeof g=="number"&&(h.minLength=g),typeof y=="number"&&(h.maxLength=y),b&&(h.format=i[b]??b,h.format===""&&delete h.format),k&&(h.contentEncoding=k),v&&v.size>0){let C=[...v];C.length===1?h.pattern=C[0].source:C.length>1&&(a.schema.allOf=[...C.map(T=>({...this.target==="draft-7"?{type:"string"}:{},pattern:T.source}))])}break}case"number":{let h=f,{minimum:g,maximum:y,format:b,multipleOf:v,exclusiveMaximum:k,exclusiveMinimum:C}=t._zod.bag;typeof b=="string"&&b.includes("int")?h.type="integer":h.type="number",typeof C=="number"&&(h.exclusiveMinimum=C),typeof g=="number"&&(h.minimum=g,typeof C=="number"&&(C>=g?delete h.minimum:delete h.exclusiveMinimum)),typeof k=="number"&&(h.exclusiveMaximum=k),typeof y=="number"&&(h.maximum=y,typeof k=="number"&&(k<=y?delete h.maximum:delete h.exclusiveMaximum)),typeof v=="number"&&(h.multipleOf=v);break}case"boolean":{let h=f;h.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{f.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{f.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let h=f,{minimum:g,maximum:y}=t._zod.bag;typeof g=="number"&&(h.minItems=g),typeof y=="number"&&(h.maxItems=y),h.type="array",h.items=this.process(o.element,{...l,path:[...l.path,"items"]});break}case"object":{let h=f;h.type="object",h.properties={};let g=o.shape;for(let v in g)h.properties[v]=this.process(g[v],{...l,path:[...l.path,"properties",v]});let y=new Set(Object.keys(g)),b=new Set([...y].filter(v=>{let k=o.shape[v]._zod;return this.io==="input"?k.optin===void 0:k.optout===void 0}));b.size>0&&(h.required=Array.from(b)),o.catchall?._zod.def.type==="never"?h.additionalProperties=!1:o.catchall?o.catchall&&(h.additionalProperties=this.process(o.catchall,{...l,path:[...l.path,"additionalProperties"]})):this.io==="output"&&(h.additionalProperties=!1);break}case"union":{let h=f;h.anyOf=o.options.map((g,y)=>this.process(g,{...l,path:[...l.path,"anyOf",y]}));break}case"intersection":{let h=f,g=this.process(o.left,{...l,path:[...l.path,"allOf",0]}),y=this.process(o.right,{...l,path:[...l.path,"allOf",1]}),b=k=>"allOf"in k&&Object.keys(k).length===1,v=[...b(g)?g.allOf:[g],...b(y)?y.allOf:[y]];h.allOf=v;break}case"tuple":{let h=f;h.type="array";let g=o.items.map((v,k)=>this.process(v,{...l,path:[...l.path,"prefixItems",k]}));if(this.target==="draft-2020-12"?h.prefixItems=g:h.items=g,o.rest){let v=this.process(o.rest,{...l,path:[...l.path,"items"]});this.target==="draft-2020-12"?h.items=v:h.additionalItems=v}o.rest&&(h.items=this.process(o.rest,{...l,path:[...l.path,"items"]}));let{minimum:y,maximum:b}=t._zod.bag;typeof y=="number"&&(h.minItems=y),typeof b=="number"&&(h.maxItems=b);break}case"record":{let h=f;h.type="object",h.propertyNames=this.process(o.keyType,{...l,path:[...l.path,"propertyNames"]}),h.additionalProperties=this.process(o.valueType,{...l,path:[...l.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let h=f,g=yi(o.entries);g.every(y=>typeof y=="number")&&(h.type="number"),g.every(y=>typeof y=="string")&&(h.type="string"),h.enum=g;break}case"literal":{let h=f,g=[];for(let y of o.values)if(y===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof y=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");g.push(Number(y))}else g.push(y);if(g.length!==0)if(g.length===1){let y=g[0];h.type=y===null?"null":typeof y,h.const=y}else g.every(y=>typeof y=="number")&&(h.type="number"),g.every(y=>typeof y=="string")&&(h.type="string"),g.every(y=>typeof y=="boolean")&&(h.type="string"),g.every(y=>y===null)&&(h.type="null"),h.enum=g;break}case"file":{let h=f,g={type:"string",format:"binary",contentEncoding:"binary"},{minimum:y,maximum:b,mime:v}=t._zod.bag;y!==void 0&&(g.minLength=y),b!==void 0&&(g.maxLength=b),v?v.length===1?(g.contentMediaType=v[0],Object.assign(h,g)):h.anyOf=v.map(k=>({...g,contentMediaType:k})):Object.assign(h,g);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let h=this.process(o.innerType,l);f.anyOf=[h,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,l),a.ref=o.innerType;break}case"success":{let h=f;h.type="boolean";break}case"default":{this.process(o.innerType,l),a.ref=o.innerType,f.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,l),a.ref=o.innerType,this.io==="input"&&(f._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,l),a.ref=o.innerType;let h;try{h=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}f.default=h;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let h=f,g=t._zod.pattern;if(!g)throw new Error("Pattern not found in template literal");h.type="string",h.pattern=g.source;break}case"pipe":{let h=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(h,l),a.ref=h;break}case"readonly":{this.process(o.innerType,l),a.ref=o.innerType,f.readOnly=!0;break}case"promise":{this.process(o.innerType,l),a.ref=o.innerType;break}case"optional":{this.process(o.innerType,l),a.ref=o.innerType;break}case"lazy":{let h=t._zod.innerType;this.process(h,l),a.ref=h;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let u=this.metadataRegistry.get(t);return u&&Object.assign(a.schema,u),this.io==="input"&&Le(t)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(t).schema}emit(t,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=p=>{let l=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let g=n.external.registry.get(p[0])?.id,y=n.external.uri??(v=>v);if(g)return{ref:y(g)};let b=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=b,{defId:b,ref:`${y("__shared")}#/${l}/${b}`}}if(p[1]===o)return{ref:"#"};let f=`#/${l}/`,h=p[1].schema.id??`__schema${this.counter++}`;return{defId:h,ref:f+h}},s=p=>{if(p[1].schema.$ref)return;let l=p[1],{ref:d,defId:f}=i(p);l.def={...l.schema},f&&(l.defId=f);let h=l.schema;for(let g in h)delete h[g];h.$ref=d};if(n.cycles==="throw")for(let p of this.seen.entries()){let l=p[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
|
|
26
|
+
})));`),d.write(`newResult[${Nn(v)}] = ${k}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");let b=d.compile();return(v,k)=>b(l,v,k)},o,i=bo,s=!Ks.jitless,c=s&&tl.value,u=t.catchall,p;e._zod.parse=(l,d)=>{p??(p=r.value);let f=l.value;if(!i(f))return l.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),l;let h=[];if(s&&c&&d?.async===!1&&d.jitless!==!0)o||(o=n(t.shape)),l=o(l,d);else{l.value={};let k=p.shape;for(let C of p.keys){let T=k[C],U=T._zod.run({value:f[C],issues:[]},d),Q=T._zod.optin==="optional"&&T._zod.optout==="optional";U instanceof Promise?h.push(U.then(Ie=>Q?e_(Ie,l,C,f):oa(Ie,l,C))):Q?e_(U,l,C,f):oa(U,l,C)}}if(!u)return h.length?Promise.all(h).then(()=>l):l;let g=[],y=p.keySet,b=u._zod,v=b.def.type;for(let k of Object.keys(f)){if(y.has(k))continue;if(v==="never"){g.push(k);continue}let C=b.run({value:f[k],issues:[]},d);C instanceof Promise?h.push(C.then(T=>oa(T,l,k))):oa(C,l,k)}return g.length&&l.issues.push({code:"unrecognized_keys",keys:g,input:f,inst:e}),h.length?Promise.all(h).then(()=>l):l}});aa=w("$ZodUnion",(e,t)=>{me.init(e,t),ve(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ve(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ve(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),ve(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>bi(n.source)).join("|")})$`)}}),e._zod.parse=(r,n)=>{let o=!1,i=[];for(let s of t.options){let a=s._zod.run({value:r.value,issues:[]},n);if(a instanceof Promise)i.push(a),o=!0;else{if(a.issues.length===0)return a;i.push(a)}}return o?Promise.all(i).then(s=>t_(s,r,e,n)):t_(i,r,e,n)}}),Wl=w("$ZodDiscriminatedUnion",(e,t)=>{aa.init(e,t);let r=e._zod.parse;ve(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,c]of Object.entries(s)){o[a]||(o[a]=new Set);for(let u of c)o[a].add(u)}}return o});let n=_i(()=>{let o=t.options,i=new Map;for(let s of o){let a=s._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!bo(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=n.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),o)}}),Kl=w("$ZodIntersection",(e,t)=>{me.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>r_(r,c,u)):r_(r,i,s)}});Jl=w("$ZodRecord",(e,t)=>{me.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!xo(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;r.value={};for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){let u=t.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?i.push(u.then(p=>{p.issues.length&&r.issues.push(...pr(c,p.issues)),r.value[c]=p.value})):(u.issues.length&&r.issues.push(...pr(c,u.issues)),r.value[c]=u.value)}let a;for(let c in o)s.has(c)||(a=a??[],a.push(c));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(let s of Reflect.ownKeys(o)){if(s==="__proto__")continue;let a=t.keyType._zod.run({value:s,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>Kt(u,n,Tt())),input:s,path:[s],inst:e}),r.value[a.value]=a.value;continue}let c=t.valueType._zod.run({value:o[s],issues:[]},n);c instanceof Promise?i.push(c.then(u=>{u.issues.length&&r.issues.push(...pr(s,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...pr(s,c.issues)),r.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>r):r}}),Yl=w("$ZodEnum",(e,t)=>{me.init(e,t);let r=yi(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>rl.has(typeof n)).map(n=>typeof n=="string"?Kr(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),Ql=w("$ZodLiteral",(e,t)=>{me.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Kr(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),Xl=w("$ZodTransform",(e,t)=>{me.init(e,t),e._zod.parse=(r,n)=>{let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new Pr;return r.value=o,r}}),ep=w("$ZodOptional",(e,t)=>{me.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ve(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ve(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${bi(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(r,n):r.value===void 0?r:t.innerType._zod.run(r,n)}),tp=w("$ZodNullable",(e,t)=>{me.init(e,t),ve(e._zod,"optin",()=>t.innerType._zod.optin),ve(e._zod,"optout",()=>t.innerType._zod.optout),ve(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${bi(r.source)}|null)$`):void 0}),ve(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),rp=w("$ZodDefault",(e,t)=>{me.init(e,t),e._zod.optin="optional",ve(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>n_(i,t)):n_(o,t)}});np=w("$ZodPrefault",(e,t)=>{me.init(e,t),e._zod.optin="optional",ve(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),op=w("$ZodNonOptional",(e,t)=>{me.init(e,t),ve(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>o_(i,e)):o_(o,e)}});ip=w("$ZodCatch",(e,t)=>{me.init(e,t),e._zod.optin="optional",ve(e._zod,"optout",()=>t.innerType._zod.optout),ve(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>Kt(s,n,Tt()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>Kt(i,n,Tt()))},input:r.value}),r.issues=[]),r)}}),sp=w("$ZodPipe",(e,t)=>{me.init(e,t),ve(e._zod,"values",()=>t.in._zod.values),ve(e._zod,"optin",()=>t.in._zod.optin),ve(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,n)=>{let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>i_(i,t,n)):i_(o,t,n)}});ap=w("$ZodReadonly",(e,t)=>{me.init(e,t),ve(e._zod,"propValues",()=>t.innerType._zod.propValues),ve(e._zod,"values",()=>t.innerType._zod.values),ve(e._zod,"optin",()=>t.innerType._zod.optin),ve(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s_):s_(o)}});cp=w("$ZodCustom",(e,t)=>{Ue.init(e,t),me.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>a_(i,r,n,e));a_(o,r,n,e)}})});function h_(){return{localeError:tE()}}var eE,tE,m_=_(()=>{dr();eE=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},tE=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${eE(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qs(n.values[0])}`:`Invalid option: expected one of ${Js(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",i=t(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",i=t(n.origin);return i?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Js(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});var ca=_(()=>{});function g_(){return new $i}var rE,nE,$i,Jr,lp=_(()=>{rE=Symbol("ZodOutput"),nE=Symbol("ZodInput"),$i=class{constructor(){this._map=new Map,this._idmap=new Map}add(t,...r){let n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};Jr=g_()});function pp(e,t){return new e({type:"string",...q(t)})}function dp(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...q(t)})}function ua(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...q(t)})}function fp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...q(t)})}function hp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...q(t)})}function mp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...q(t)})}function gp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...q(t)})}function yp(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...q(t)})}function _p(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...q(t)})}function vp(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...q(t)})}function bp(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...q(t)})}function xp(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...q(t)})}function wp(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...q(t)})}function kp(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...q(t)})}function Sp(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...q(t)})}function $p(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...q(t)})}function Tp(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...q(t)})}function Pp(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...q(t)})}function Cp(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...q(t)})}function Ep(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...q(t)})}function Ip(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...q(t)})}function zp(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...q(t)})}function Rp(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...q(t)})}function y_(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...q(t)})}function __(e,t){return new e({type:"string",format:"date",check:"string_format",...q(t)})}function v_(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...q(t)})}function b_(e,t){return new e({type:"string",format:"duration",check:"string_format",...q(t)})}function Ap(e,t){return new e({type:"number",checks:[],...q(t)})}function Op(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...q(t)})}function Np(e,t){return new e({type:"boolean",...q(t)})}function Dp(e,t){return new e({type:"null",...q(t)})}function jp(e){return new e({type:"unknown"})}function Mp(e,t){return new e({type:"never",...q(t)})}function la(e,t){return new _l({check:"less_than",...q(t),value:e,inclusive:!1})}function Ti(e,t){return new _l({check:"less_than",...q(t),value:e,inclusive:!0})}function pa(e,t){return new vl({check:"greater_than",...q(t),value:e,inclusive:!1})}function Pi(e,t){return new vl({check:"greater_than",...q(t),value:e,inclusive:!0})}function da(e,t){return new Ly({check:"multiple_of",...q(t),value:e})}function fa(e,t){return new qy({check:"max_length",...q(t),maximum:e})}function wo(e,t){return new Fy({check:"min_length",...q(t),minimum:e})}function ha(e,t){return new Uy({check:"length_equals",...q(t),length:e})}function Lp(e,t){return new By({check:"string_format",format:"regex",...q(t),pattern:e})}function Zp(e){return new Vy({check:"string_format",format:"lowercase",...q(e)})}function qp(e){return new Hy({check:"string_format",format:"uppercase",...q(e)})}function Fp(e,t){return new Gy({check:"string_format",format:"includes",...q(t),includes:e})}function Up(e,t){return new Wy({check:"string_format",format:"starts_with",...q(t),prefix:e})}function Bp(e,t){return new Ky({check:"string_format",format:"ends_with",...q(t),suffix:e})}function Ln(e){return new Jy({check:"overwrite",tx:e})}function Vp(e){return Ln(t=>t.normalize(e))}function Hp(){return Ln(e=>e.trim())}function Gp(){return Ln(e=>e.toLowerCase())}function Wp(){return Ln(e=>e.toUpperCase())}function x_(e,t,r){return new e({type:"array",element:t,...q(r)})}function Kp(e,t,r){let n=q(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Jp(e,t,r){return new e({type:"custom",check:"custom",fn:t,...q(r)})}var w_=_(()=>{ra();dr()});var k_=_(()=>{});function Yp(e,t){if(e instanceof $i){let n=new ma(t),o={};for(let a of e._idmap.entries()){let[c,u]=a;n.process(u)}let i={},s={registry:e,uri:t?.uri,defs:o};for(let a of e._idmap.entries()){let[c,u]=a;i[c]=n.emit(u,{...t,external:s})}if(Object.keys(o).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:o}}return{schemas:i}}let r=new ma(t);return r.process(e),r.emit(e,t)}function Le(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Le(o.element,r);case"object":{for(let i in o.shape)if(Le(o.shape[i],r))return!0;return!1}case"union":{for(let i of o.options)if(Le(i,r))return!0;return!1}case"intersection":return Le(o.left,r)||Le(o.right,r);case"tuple":{for(let i of o.items)if(Le(i,r))return!0;return!!(o.rest&&Le(o.rest,r))}case"record":return Le(o.keyType,r)||Le(o.valueType,r);case"map":return Le(o.keyType,r)||Le(o.valueType,r);case"set":return Le(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Le(o.innerType,r);case"lazy":return Le(o.getter(),r);case"default":return Le(o.innerType,r);case"prefault":return Le(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Le(o.in,r)||Le(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}var ma,S_=_(()=>{lp();dr();ma=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??Jr,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(t,a);let c=t._zod.toJSONSchema?.();if(c)a.schema=c;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path},d=t._zod.parent;if(d)a.ref=d,this.process(d,l),this.seen.get(d).isParent=!0;else{let f=a.schema;switch(o.type){case"string":{let h=f;h.type="string";let{minimum:g,maximum:y,format:b,patterns:v,contentEncoding:k}=t._zod.bag;if(typeof g=="number"&&(h.minLength=g),typeof y=="number"&&(h.maxLength=y),b&&(h.format=i[b]??b,h.format===""&&delete h.format),k&&(h.contentEncoding=k),v&&v.size>0){let C=[...v];C.length===1?h.pattern=C[0].source:C.length>1&&(a.schema.allOf=[...C.map(T=>({...this.target==="draft-7"?{type:"string"}:{},pattern:T.source}))])}break}case"number":{let h=f,{minimum:g,maximum:y,format:b,multipleOf:v,exclusiveMaximum:k,exclusiveMinimum:C}=t._zod.bag;typeof b=="string"&&b.includes("int")?h.type="integer":h.type="number",typeof C=="number"&&(h.exclusiveMinimum=C),typeof g=="number"&&(h.minimum=g,typeof C=="number"&&(C>=g?delete h.minimum:delete h.exclusiveMinimum)),typeof k=="number"&&(h.exclusiveMaximum=k),typeof y=="number"&&(h.maximum=y,typeof k=="number"&&(k<=y?delete h.maximum:delete h.exclusiveMaximum)),typeof v=="number"&&(h.multipleOf=v);break}case"boolean":{let h=f;h.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{f.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{f.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let h=f,{minimum:g,maximum:y}=t._zod.bag;typeof g=="number"&&(h.minItems=g),typeof y=="number"&&(h.maxItems=y),h.type="array",h.items=this.process(o.element,{...l,path:[...l.path,"items"]});break}case"object":{let h=f;h.type="object",h.properties={};let g=o.shape;for(let v in g)h.properties[v]=this.process(g[v],{...l,path:[...l.path,"properties",v]});let y=new Set(Object.keys(g)),b=new Set([...y].filter(v=>{let k=o.shape[v]._zod;return this.io==="input"?k.optin===void 0:k.optout===void 0}));b.size>0&&(h.required=Array.from(b)),o.catchall?._zod.def.type==="never"?h.additionalProperties=!1:o.catchall?o.catchall&&(h.additionalProperties=this.process(o.catchall,{...l,path:[...l.path,"additionalProperties"]})):this.io==="output"&&(h.additionalProperties=!1);break}case"union":{let h=f;h.anyOf=o.options.map((g,y)=>this.process(g,{...l,path:[...l.path,"anyOf",y]}));break}case"intersection":{let h=f,g=this.process(o.left,{...l,path:[...l.path,"allOf",0]}),y=this.process(o.right,{...l,path:[...l.path,"allOf",1]}),b=k=>"allOf"in k&&Object.keys(k).length===1,v=[...b(g)?g.allOf:[g],...b(y)?y.allOf:[y]];h.allOf=v;break}case"tuple":{let h=f;h.type="array";let g=o.items.map((v,k)=>this.process(v,{...l,path:[...l.path,"prefixItems",k]}));if(this.target==="draft-2020-12"?h.prefixItems=g:h.items=g,o.rest){let v=this.process(o.rest,{...l,path:[...l.path,"items"]});this.target==="draft-2020-12"?h.items=v:h.additionalItems=v}o.rest&&(h.items=this.process(o.rest,{...l,path:[...l.path,"items"]}));let{minimum:y,maximum:b}=t._zod.bag;typeof y=="number"&&(h.minItems=y),typeof b=="number"&&(h.maxItems=b);break}case"record":{let h=f;h.type="object",h.propertyNames=this.process(o.keyType,{...l,path:[...l.path,"propertyNames"]}),h.additionalProperties=this.process(o.valueType,{...l,path:[...l.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let h=f,g=yi(o.entries);g.every(y=>typeof y=="number")&&(h.type="number"),g.every(y=>typeof y=="string")&&(h.type="string"),h.enum=g;break}case"literal":{let h=f,g=[];for(let y of o.values)if(y===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof y=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");g.push(Number(y))}else g.push(y);if(g.length!==0)if(g.length===1){let y=g[0];h.type=y===null?"null":typeof y,h.const=y}else g.every(y=>typeof y=="number")&&(h.type="number"),g.every(y=>typeof y=="string")&&(h.type="string"),g.every(y=>typeof y=="boolean")&&(h.type="string"),g.every(y=>y===null)&&(h.type="null"),h.enum=g;break}case"file":{let h=f,g={type:"string",format:"binary",contentEncoding:"binary"},{minimum:y,maximum:b,mime:v}=t._zod.bag;y!==void 0&&(g.minLength=y),b!==void 0&&(g.maxLength=b),v?v.length===1?(g.contentMediaType=v[0],Object.assign(h,g)):h.anyOf=v.map(k=>({...g,contentMediaType:k})):Object.assign(h,g);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let h=this.process(o.innerType,l);f.anyOf=[h,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,l),a.ref=o.innerType;break}case"success":{let h=f;h.type="boolean";break}case"default":{this.process(o.innerType,l),a.ref=o.innerType,f.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,l),a.ref=o.innerType,this.io==="input"&&(f._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,l),a.ref=o.innerType;let h;try{h=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}f.default=h;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let h=f,g=t._zod.pattern;if(!g)throw new Error("Pattern not found in template literal");h.type="string",h.pattern=g.source;break}case"pipe":{let h=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(h,l),a.ref=h;break}case"readonly":{this.process(o.innerType,l),a.ref=o.innerType,f.readOnly=!0;break}case"promise":{this.process(o.innerType,l),a.ref=o.innerType;break}case"optional":{this.process(o.innerType,l),a.ref=o.innerType;break}case"lazy":{let h=t._zod.innerType;this.process(h,l),a.ref=h;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let u=this.metadataRegistry.get(t);return u&&Object.assign(a.schema,u),this.io==="input"&&Le(t)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(t).schema}emit(t,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=p=>{let l=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let g=n.external.registry.get(p[0])?.id,y=n.external.uri??(v=>v);if(g)return{ref:y(g)};let b=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=b,{defId:b,ref:`${y("__shared")}#/${l}/${b}`}}if(p[1]===o)return{ref:"#"};let f=`#/${l}/`,h=p[1].schema.id??`__schema${this.counter++}`;return{defId:h,ref:f+h}},s=p=>{if(p[1].schema.$ref)return;let l=p[1],{ref:d,defId:f}=i(p);l.def={...l.schema},f&&(l.defId=f);let h=l.schema;for(let g in h)delete h[g];h.$ref=d};if(n.cycles==="throw")for(let p of this.seen.entries()){let l=p[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
|
|
27
27
|
|
|
28
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let p of this.seen.entries()){let l=p[1];if(t===p[0]){s(p);continue}if(n.external){let f=n.external.registry.get(p[0])?.id;if(t!==p[0]&&f){s(p);continue}}if(this.metadataRegistry.get(p[0])?.id){s(p);continue}if(l.cycle){s(p);continue}if(l.count>1&&n.reused==="ref"){s(p);continue}}let a=(p,l)=>{let d=this.seen.get(p),f=d.def??d.schema,h={...f};if(d.ref===null)return;let g=d.ref;if(d.ref=null,g){a(g,l);let y=this.seen.get(g).schema;y.$ref&&l.target==="draft-7"?(f.allOf=f.allOf??[],f.allOf.push(y)):(Object.assign(f,y),Object.assign(f,h))}d.isParent||this.override({zodSchema:p,jsonSchema:f,path:d.path??[]})};for(let p of[...this.seen.entries()].reverse())a(p[0],{target:this.target});let c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let p=n.external.registry.get(t)?.id;if(!p)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(p)}Object.assign(c,o.def);let u=n.external?.defs??{};for(let p of this.seen.entries()){let l=p[1];l.def&&l.defId&&(u[l.defId]=l.def)}n.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}}});var $_=_(()=>{});var at=_(()=>{vo();ml();cl();f_();ra();xl();dr();ta();ca();lp();bl();k_();w_();S_();$_()});var Qp=_(()=>{at()});function Xp(e,t){let r={type:"object",get shape(){return ne.assignProp(this,"shape",{...e}),this.shape},...ne.normalizeParams(t)};return new OE(r)}var AE,OE,T_=_(()=>{at();at();Qp();AE=w("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");me.init(e,t),e.def=t,e.parse=(r,n)=>ll(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>jn(e,r,n),e.parseAsync=async(r,n)=>dl(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Mn(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>Pt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e))}),OE=w("ZodMiniObject",(e,t)=>{sa.init(e,t),AE.init(e,t),ne.defineLazy(e,"shape",()=>t.shape)})});var P_=_(()=>{});var C_=_(()=>{});var E_=_(()=>{});var I_=_(()=>{at();Qp();T_();P_();at();ca();C_();E_()});var z_=_(()=>{I_()});var ed=_(()=>{z_()});function Nt(e){return!!e._zod}function qn(e){let t=Object.values(e);if(t.length===0)return Xp({});let r=t.every(Nt),n=t.every(o=>!Nt(o));if(r)return Xp(e);if(n)return Ku(e);throw new Error("Mixed Zod versions detected in object shape.")}function Yr(e,t){return Nt(e)?jn(e,t):e.safeParse(t)}async function ga(e,t){return Nt(e)?await Mn(e,t):await e.safeParseAsync(t)}function Qr(e){if(!e)return;let t;if(Nt(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function ko(e){if(e){if(typeof e=="object"){let t=e,r=e;if(!t._def&&!r._zod){let n=Object.values(e);if(n.length>0&&n.every(o=>typeof o=="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse=="function")))return qn(e)}}if(Nt(e)){let r=e._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return e}else if(e.shape!==void 0)return e}}function ya(e){if(e&&typeof e=="object"){if("message"in e&&typeof e.message=="string")return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){let t=e.issues[0];if(t&&typeof t=="object"&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function A_(e){return e.description}function O_(e){if(Nt(e))return e._zod?.def?.type==="optional";let t=e;return typeof e.isOptional=="function"?e.isOptional():t._def?.typeName==="ZodOptional"}function _a(e){if(Nt(e)){let i=e._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=e.value;if(n!==void 0)return n}var Ci=_(()=>{mi();ed()});var td=_(()=>{at()});var Ei={};Br(Ei,{ZodISODate:()=>D_,ZodISODateTime:()=>N_,ZodISODuration:()=>M_,ZodISOTime:()=>j_,date:()=>nd,datetime:()=>rd,duration:()=>id,time:()=>od});function rd(e){return y_(N_,e)}function nd(e){return __(D_,e)}function od(e){return v_(j_,e)}function id(e){return b_(M_,e)}var N_,D_,j_,M_,sd=_(()=>{at();ad();N_=w("ZodISODateTime",(e,t)=>{c_.init(e,t),Te.init(e,t)});D_=w("ZodISODate",(e,t)=>{u_.init(e,t),Te.init(e,t)});j_=w("ZodISOTime",(e,t)=>{l_.init(e,t),Te.init(e,t)});M_=w("ZodISODuration",(e,t)=>{p_.init(e,t),Te.init(e,t)})});var L_,L6,Ii,cd=_(()=>{at();at();L_=(e,t)=>{Xs.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>al(e,r)},flatten:{value:r=>sl(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},L6=w("ZodError",L_),Ii=w("ZodError",L_,{Parent:Error})});var Z_,q_,F_,U_,ud=_(()=>{at();cd();Z_=ul(Ii),q_=pl(Ii),F_=fl(Ii),U_=hl(Ii)});function x(e){return pp(BE,e)}function fe(e){return Ap(W_,e)}function V_(e){return Op(cI,e)}function qe(e){return Np(uI,e)}function dd(e){return Dp(lI,e)}function Pe(){return jp(pI)}function fI(e){return Mp(dI,e)}function ie(e,t){return x_(hI,e,t)}function z(e,t){let r={type:"object",get shape(){return ne.assignProp(this,"shape",{...e}),this.shape},...ne.normalizeParams(t)};return new K_(r)}function ct(e,t){return new K_({type:"object",get shape(){return ne.assignProp(this,"shape",{...e}),this.shape},catchall:Pe(),...ne.normalizeParams(t)})}function xe(e,t){return new J_({type:"union",options:e,...ne.normalizeParams(t)})}function fd(e,t,r){return new mI({type:"union",options:t,discriminator:e,...ne.normalizeParams(r)})}function ba(e,t){return new gI({type:"intersection",left:e,right:t})}function Ce(e,t,r){return new yI({type:"record",keyType:e,valueType:t,...ne.normalizeParams(r)})}function _t(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ld({type:"enum",entries:r,...ne.normalizeParams(t)})}function N(e,t){return new _I({type:"literal",values:Array.isArray(e)?e:[e],...ne.normalizeParams(t)})}function Y_(e){return new vI({type:"transform",transform:e})}function ze(e){return new Q_({type:"optional",innerType:e})}function H_(e){return new bI({type:"nullable",innerType:e})}function wI(e,t){return new xI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function SI(e,t){return new kI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function $I(e,t){return new X_({type:"nonoptional",innerType:e,...ne.normalizeParams(t)})}function PI(e,t){return new TI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function pd(e,t){return new CI({type:"pipe",in:e,out:t})}function II(e){return new EI({type:"readonly",innerType:e})}function zI(e){let t=new Ue({check:"custom"});return t._zod.check=e,t}function tv(e,t){return Kp(ev,e??(()=>!0),t)}function RI(e,t={}){return Jp(ev,e,t)}function AI(e){let t=zI(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(ne.issue(n,r.value,t._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(ne.issue(o))}},e(r.value,r)));return t}function hd(e,t){return pd(Y_(e),t)}var Re,G_,BE,Te,VE,B_,va,HE,GE,WE,KE,JE,YE,QE,XE,eI,tI,rI,nI,oI,iI,sI,aI,W_,cI,uI,lI,pI,dI,hI,K_,J_,mI,gI,yI,ld,_I,vI,Q_,bI,xI,kI,X_,TI,CI,EI,ev,ad=_(()=>{at();at();td();sd();ud();Re=w("ZodType",(e,t)=>(me.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>Pt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Z_(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>F_(e,r,n),e.parseAsync=async(r,n)=>q_(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>U_(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(RI(r,n)),e.superRefine=r=>e.check(AI(r)),e.overwrite=r=>e.check(Ln(r)),e.optional=()=>ze(e),e.nullable=()=>H_(e),e.nullish=()=>ze(H_(e)),e.nonoptional=r=>$I(e,r),e.array=()=>ie(e),e.or=r=>xe([e,r]),e.and=r=>ba(e,r),e.transform=r=>pd(e,Y_(r)),e.default=r=>wI(e,r),e.prefault=r=>SI(e,r),e.catch=r=>PI(e,r),e.pipe=r=>pd(e,r),e.readonly=()=>II(e),e.describe=r=>{let n=e.clone();return Jr.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Jr.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Jr.get(e);let n=e.clone();return Jr.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),G_=w("_ZodString",(e,t)=>{Si.init(e,t),Re.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Lp(...n)),e.includes=(...n)=>e.check(Fp(...n)),e.startsWith=(...n)=>e.check(Up(...n)),e.endsWith=(...n)=>e.check(Bp(...n)),e.min=(...n)=>e.check(wo(...n)),e.max=(...n)=>e.check(fa(...n)),e.length=(...n)=>e.check(ha(...n)),e.nonempty=(...n)=>e.check(wo(1,...n)),e.lowercase=n=>e.check(Zp(n)),e.uppercase=n=>e.check(qp(n)),e.trim=()=>e.check(Hp()),e.normalize=(...n)=>e.check(Vp(...n)),e.toLowerCase=()=>e.check(Gp()),e.toUpperCase=()=>e.check(Wp())}),BE=w("ZodString",(e,t)=>{Si.init(e,t),G_.init(e,t),e.email=r=>e.check(dp(VE,r)),e.url=r=>e.check(yp(HE,r)),e.jwt=r=>e.check(Rp(aI,r)),e.emoji=r=>e.check(_p(GE,r)),e.guid=r=>e.check(ua(B_,r)),e.uuid=r=>e.check(fp(va,r)),e.uuidv4=r=>e.check(hp(va,r)),e.uuidv6=r=>e.check(mp(va,r)),e.uuidv7=r=>e.check(gp(va,r)),e.nanoid=r=>e.check(vp(WE,r)),e.guid=r=>e.check(ua(B_,r)),e.cuid=r=>e.check(bp(KE,r)),e.cuid2=r=>e.check(xp(JE,r)),e.ulid=r=>e.check(wp(YE,r)),e.base64=r=>e.check(Ep(oI,r)),e.base64url=r=>e.check(Ip(iI,r)),e.xid=r=>e.check(kp(QE,r)),e.ksuid=r=>e.check(Sp(XE,r)),e.ipv4=r=>e.check($p(eI,r)),e.ipv6=r=>e.check(Tp(tI,r)),e.cidrv4=r=>e.check(Pp(rI,r)),e.cidrv6=r=>e.check(Cp(nI,r)),e.e164=r=>e.check(zp(sI,r)),e.datetime=r=>e.check(rd(r)),e.date=r=>e.check(nd(r)),e.time=r=>e.check(od(r)),e.duration=r=>e.check(id(r))});Te=w("ZodStringFormat",(e,t)=>{be.init(e,t),G_.init(e,t)}),VE=w("ZodEmail",(e,t)=>{$l.init(e,t),Te.init(e,t)}),B_=w("ZodGUID",(e,t)=>{kl.init(e,t),Te.init(e,t)}),va=w("ZodUUID",(e,t)=>{Sl.init(e,t),Te.init(e,t)}),HE=w("ZodURL",(e,t)=>{Tl.init(e,t),Te.init(e,t)}),GE=w("ZodEmoji",(e,t)=>{Pl.init(e,t),Te.init(e,t)}),WE=w("ZodNanoID",(e,t)=>{Cl.init(e,t),Te.init(e,t)}),KE=w("ZodCUID",(e,t)=>{El.init(e,t),Te.init(e,t)}),JE=w("ZodCUID2",(e,t)=>{Il.init(e,t),Te.init(e,t)}),YE=w("ZodULID",(e,t)=>{zl.init(e,t),Te.init(e,t)}),QE=w("ZodXID",(e,t)=>{Rl.init(e,t),Te.init(e,t)}),XE=w("ZodKSUID",(e,t)=>{Al.init(e,t),Te.init(e,t)}),eI=w("ZodIPv4",(e,t)=>{Ol.init(e,t),Te.init(e,t)}),tI=w("ZodIPv6",(e,t)=>{Nl.init(e,t),Te.init(e,t)}),rI=w("ZodCIDRv4",(e,t)=>{Dl.init(e,t),Te.init(e,t)}),nI=w("ZodCIDRv6",(e,t)=>{jl.init(e,t),Te.init(e,t)}),oI=w("ZodBase64",(e,t)=>{Ml.init(e,t),Te.init(e,t)}),iI=w("ZodBase64URL",(e,t)=>{Ll.init(e,t),Te.init(e,t)}),sI=w("ZodE164",(e,t)=>{Zl.init(e,t),Te.init(e,t)}),aI=w("ZodJWT",(e,t)=>{ql.init(e,t),Te.init(e,t)}),W_=w("ZodNumber",(e,t)=>{ia.init(e,t),Re.init(e,t),e.gt=(n,o)=>e.check(pa(n,o)),e.gte=(n,o)=>e.check(Pi(n,o)),e.min=(n,o)=>e.check(Pi(n,o)),e.lt=(n,o)=>e.check(la(n,o)),e.lte=(n,o)=>e.check(Ti(n,o)),e.max=(n,o)=>e.check(Ti(n,o)),e.int=n=>e.check(V_(n)),e.safe=n=>e.check(V_(n)),e.positive=n=>e.check(pa(0,n)),e.nonnegative=n=>e.check(Pi(0,n)),e.negative=n=>e.check(la(0,n)),e.nonpositive=n=>e.check(Ti(0,n)),e.multipleOf=(n,o)=>e.check(da(n,o)),e.step=(n,o)=>e.check(da(n,o)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});cI=w("ZodNumberFormat",(e,t)=>{Fl.init(e,t),W_.init(e,t)});uI=w("ZodBoolean",(e,t)=>{Ul.init(e,t),Re.init(e,t)});lI=w("ZodNull",(e,t)=>{Bl.init(e,t),Re.init(e,t)});pI=w("ZodUnknown",(e,t)=>{Vl.init(e,t),Re.init(e,t)});dI=w("ZodNever",(e,t)=>{Hl.init(e,t),Re.init(e,t)});hI=w("ZodArray",(e,t)=>{Gl.init(e,t),Re.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(wo(r,n)),e.nonempty=r=>e.check(wo(1,r)),e.max=(r,n)=>e.check(fa(r,n)),e.length=(r,n)=>e.check(ha(r,n)),e.unwrap=()=>e.element});K_=w("ZodObject",(e,t)=>{sa.init(e,t),Re.init(e,t),ne.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>_t(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Pe()}),e.loose=()=>e.clone({...e._zod.def,catchall:Pe()}),e.strict=()=>e.clone({...e._zod.def,catchall:fI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>ne.extend(e,r),e.merge=r=>ne.merge(e,r),e.pick=r=>ne.pick(e,r),e.omit=r=>ne.omit(e,r),e.partial=(...r)=>ne.partial(Q_,e,r[0]),e.required=(...r)=>ne.required(X_,e,r[0])});J_=w("ZodUnion",(e,t)=>{aa.init(e,t),Re.init(e,t),e.options=t.options});mI=w("ZodDiscriminatedUnion",(e,t)=>{J_.init(e,t),Wl.init(e,t)});gI=w("ZodIntersection",(e,t)=>{Kl.init(e,t),Re.init(e,t)});yI=w("ZodRecord",(e,t)=>{Jl.init(e,t),Re.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});ld=w("ZodEnum",(e,t)=>{Yl.init(e,t),Re.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ld({...t,checks:[],...ne.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new ld({...t,checks:[],...ne.normalizeParams(o),entries:i})}});_I=w("ZodLiteral",(e,t)=>{Ql.init(e,t),Re.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});vI=w("ZodTransform",(e,t)=>{Xl.init(e,t),Re.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=i=>{if(typeof i=="string")r.issues.push(ne.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(ne.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});Q_=w("ZodOptional",(e,t)=>{ep.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});bI=w("ZodNullable",(e,t)=>{tp.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});xI=w("ZodDefault",(e,t)=>{rp.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});kI=w("ZodPrefault",(e,t)=>{np.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});X_=w("ZodNonOptional",(e,t)=>{op.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});TI=w("ZodCatch",(e,t)=>{ip.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});CI=w("ZodPipe",(e,t)=>{sp.init(e,t),Re.init(e,t),e.in=t.in,e.out=t.out});EI=w("ZodReadonly",(e,t)=>{ap.init(e,t),Re.init(e,t)});ev=w("ZodCustom",(e,t)=>{cp.init(e,t),Re.init(e,t)})});var rv=_(()=>{});var nv=_(()=>{});var ov=_(()=>{at();ad();td();cd();ud();rv();at();m_();ca();sd();nv();Tt(h_())});var iv=_(()=>{ov()});var sv=_(()=>{iv()});function kv(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Sv(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var gd,av,Xr,wa,Be,cv,uv,tq,DI,jI,yd,Ct,zi,lv,Ve,Dt,jt,He,ka,pv,_d,dv,fv,vd,Ri,L,bd,hv,mv,rq,Sa,MI,$a,LI,Ai,So,gv,ZI,qI,FI,UI,BI,VI,xd,HI,GI,wd,Ta,WI,KI,Pa,JI,Oi,Ni,YI,Di,$o,QI,ji,Ca,Ea,Ia,nq,za,Ra,Aa,yv,_v,vv,kd,bv,Mi,To,xv,XI,Oa,ez,Na,tz,Sd,rz,Da,nz,oz,iz,sz,az,cz,uz,lz,pz,dz,ja,fz,hz,Ma,$d,Td,Pd,mz,gz,yz,Cd,_z,vz,bz,xz,wz,wv,La,kz,Za,oq,Sz,Po,$z,iq,Li,Tz,Ed,Pz,Cz,Ez,Iz,zz,Rz,Az,xa,Oz,Nz,Dz,Id,zd,jz,Mz,Lz,Zz,qz,Fz,Uz,Bz,Vz,Hz,Gz,Wz,Kz,Jz,Yz,Qz,Xz,eR,qa,tR,rR,nR,Fa,oR,iR,sR,Rd,aR,sq,aq,cq,uq,lq,pq,O,md,Zi=_(()=>{sv();gd="2025-11-25",av=[gd,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Xr="io.modelcontextprotocol/related-task",wa="2.0",Be=tv(e=>e!==null&&(typeof e=="object"||typeof e=="function")),cv=xe([x(),fe().int()]),uv=x(),tq=ct({ttl:xe([fe(),dd()]).optional(),pollInterval:fe().optional()}),DI=z({ttl:fe().optional()}),jI=z({taskId:x()}),yd=ct({progressToken:cv.optional(),[Xr]:jI.optional()}),Ct=z({_meta:yd.optional()}),zi=Ct.extend({task:DI.optional()}),lv=e=>zi.safeParse(e).success,Ve=z({method:x(),params:Ct.loose().optional()}),Dt=z({_meta:yd.optional()}),jt=z({method:x(),params:Dt.loose().optional()}),He=ct({_meta:yd.optional()}),ka=xe([x(),fe().int()]),pv=z({jsonrpc:N(wa),id:ka,...Ve.shape}).strict(),_d=e=>pv.safeParse(e).success,dv=z({jsonrpc:N(wa),...jt.shape}).strict(),fv=e=>dv.safeParse(e).success,vd=z({jsonrpc:N(wa),id:ka,result:He}).strict(),Ri=e=>vd.safeParse(e).success;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(L||(L={}));bd=z({jsonrpc:N(wa),id:ka.optional(),error:z({code:fe().int(),message:x(),data:Pe().optional()})}).strict(),hv=e=>bd.safeParse(e).success,mv=xe([pv,dv,vd,bd]),rq=xe([vd,bd]),Sa=He.strict(),MI=Dt.extend({requestId:ka.optional(),reason:x().optional()}),$a=jt.extend({method:N("notifications/cancelled"),params:MI}),LI=z({src:x(),mimeType:x().optional(),sizes:ie(x()).optional(),theme:_t(["light","dark"]).optional()}),Ai=z({icons:ie(LI).optional()}),So=z({name:x(),title:x().optional()}),gv=So.extend({...So.shape,...Ai.shape,version:x(),websiteUrl:x().optional(),description:x().optional()}),ZI=ba(z({applyDefaults:qe().optional()}),Ce(x(),Pe())),qI=hd(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ba(z({form:ZI.optional(),url:Be.optional()}),Ce(x(),Pe()).optional())),FI=ct({list:Be.optional(),cancel:Be.optional(),requests:ct({sampling:ct({createMessage:Be.optional()}).optional(),elicitation:ct({create:Be.optional()}).optional()}).optional()}),UI=ct({list:Be.optional(),cancel:Be.optional(),requests:ct({tools:ct({call:Be.optional()}).optional()}).optional()}),BI=z({experimental:Ce(x(),Be).optional(),sampling:z({context:Be.optional(),tools:Be.optional()}).optional(),elicitation:qI.optional(),roots:z({listChanged:qe().optional()}).optional(),tasks:FI.optional()}),VI=Ct.extend({protocolVersion:x(),capabilities:BI,clientInfo:gv}),xd=Ve.extend({method:N("initialize"),params:VI}),HI=z({experimental:Ce(x(),Be).optional(),logging:Be.optional(),completions:Be.optional(),prompts:z({listChanged:qe().optional()}).optional(),resources:z({subscribe:qe().optional(),listChanged:qe().optional()}).optional(),tools:z({listChanged:qe().optional()}).optional(),tasks:UI.optional()}),GI=He.extend({protocolVersion:x(),capabilities:HI,serverInfo:gv,instructions:x().optional()}),wd=jt.extend({method:N("notifications/initialized"),params:Dt.optional()}),Ta=Ve.extend({method:N("ping"),params:Ct.optional()}),WI=z({progress:fe(),total:ze(fe()),message:ze(x())}),KI=z({...Dt.shape,...WI.shape,progressToken:cv}),Pa=jt.extend({method:N("notifications/progress"),params:KI}),JI=Ct.extend({cursor:uv.optional()}),Oi=Ve.extend({params:JI.optional()}),Ni=He.extend({nextCursor:uv.optional()}),YI=_t(["working","input_required","completed","failed","cancelled"]),Di=z({taskId:x(),status:YI,ttl:xe([fe(),dd()]),createdAt:x(),lastUpdatedAt:x(),pollInterval:ze(fe()),statusMessage:ze(x())}),$o=He.extend({task:Di}),QI=Dt.merge(Di),ji=jt.extend({method:N("notifications/tasks/status"),params:QI}),Ca=Ve.extend({method:N("tasks/get"),params:Ct.extend({taskId:x()})}),Ea=He.merge(Di),Ia=Ve.extend({method:N("tasks/result"),params:Ct.extend({taskId:x()})}),nq=He.loose(),za=Oi.extend({method:N("tasks/list")}),Ra=Ni.extend({tasks:ie(Di)}),Aa=Ve.extend({method:N("tasks/cancel"),params:Ct.extend({taskId:x()})}),yv=He.merge(Di),_v=z({uri:x(),mimeType:ze(x()),_meta:Ce(x(),Pe()).optional()}),vv=_v.extend({text:x()}),kd=x().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),bv=_v.extend({blob:kd}),Mi=_t(["user","assistant"]),To=z({audience:ie(Mi).optional(),priority:fe().min(0).max(1).optional(),lastModified:Ei.datetime({offset:!0}).optional()}),xv=z({...So.shape,...Ai.shape,uri:x(),description:ze(x()),mimeType:ze(x()),annotations:To.optional(),_meta:ze(ct({}))}),XI=z({...So.shape,...Ai.shape,uriTemplate:x(),description:ze(x()),mimeType:ze(x()),annotations:To.optional(),_meta:ze(ct({}))}),Oa=Oi.extend({method:N("resources/list")}),ez=Ni.extend({resources:ie(xv)}),Na=Oi.extend({method:N("resources/templates/list")}),tz=Ni.extend({resourceTemplates:ie(XI)}),Sd=Ct.extend({uri:x()}),rz=Sd,Da=Ve.extend({method:N("resources/read"),params:rz}),nz=He.extend({contents:ie(xe([vv,bv]))}),oz=jt.extend({method:N("notifications/resources/list_changed"),params:Dt.optional()}),iz=Sd,sz=Ve.extend({method:N("resources/subscribe"),params:iz}),az=Sd,cz=Ve.extend({method:N("resources/unsubscribe"),params:az}),uz=Dt.extend({uri:x()}),lz=jt.extend({method:N("notifications/resources/updated"),params:uz}),pz=z({name:x(),description:ze(x()),required:ze(qe())}),dz=z({...So.shape,...Ai.shape,description:ze(x()),arguments:ze(ie(pz)),_meta:ze(ct({}))}),ja=Oi.extend({method:N("prompts/list")}),fz=Ni.extend({prompts:ie(dz)}),hz=Ct.extend({name:x(),arguments:Ce(x(),x()).optional()}),Ma=Ve.extend({method:N("prompts/get"),params:hz}),$d=z({type:N("text"),text:x(),annotations:To.optional(),_meta:Ce(x(),Pe()).optional()}),Td=z({type:N("image"),data:kd,mimeType:x(),annotations:To.optional(),_meta:Ce(x(),Pe()).optional()}),Pd=z({type:N("audio"),data:kd,mimeType:x(),annotations:To.optional(),_meta:Ce(x(),Pe()).optional()}),mz=z({type:N("tool_use"),name:x(),id:x(),input:Ce(x(),Pe()),_meta:Ce(x(),Pe()).optional()}),gz=z({type:N("resource"),resource:xe([vv,bv]),annotations:To.optional(),_meta:Ce(x(),Pe()).optional()}),yz=xv.extend({type:N("resource_link")}),Cd=xe([$d,Td,Pd,yz,gz]),_z=z({role:Mi,content:Cd}),vz=He.extend({description:x().optional(),messages:ie(_z)}),bz=jt.extend({method:N("notifications/prompts/list_changed"),params:Dt.optional()}),xz=z({title:x().optional(),readOnlyHint:qe().optional(),destructiveHint:qe().optional(),idempotentHint:qe().optional(),openWorldHint:qe().optional()}),wz=z({taskSupport:_t(["required","optional","forbidden"]).optional()}),wv=z({...So.shape,...Ai.shape,description:x().optional(),inputSchema:z({type:N("object"),properties:Ce(x(),Be).optional(),required:ie(x()).optional()}).catchall(Pe()),outputSchema:z({type:N("object"),properties:Ce(x(),Be).optional(),required:ie(x()).optional()}).catchall(Pe()).optional(),annotations:xz.optional(),execution:wz.optional(),_meta:Ce(x(),Pe()).optional()}),La=Oi.extend({method:N("tools/list")}),kz=Ni.extend({tools:ie(wv)}),Za=He.extend({content:ie(Cd).default([]),structuredContent:Ce(x(),Pe()).optional(),isError:qe().optional()}),oq=Za.or(He.extend({toolResult:Pe()})),Sz=zi.extend({name:x(),arguments:Ce(x(),Pe()).optional()}),Po=Ve.extend({method:N("tools/call"),params:Sz}),$z=jt.extend({method:N("notifications/tools/list_changed"),params:Dt.optional()}),iq=z({autoRefresh:qe().default(!0),debounceMs:fe().int().nonnegative().default(300)}),Li=_t(["debug","info","notice","warning","error","critical","alert","emergency"]),Tz=Ct.extend({level:Li}),Ed=Ve.extend({method:N("logging/setLevel"),params:Tz}),Pz=Dt.extend({level:Li,logger:x().optional(),data:Pe()}),Cz=jt.extend({method:N("notifications/message"),params:Pz}),Ez=z({name:x().optional()}),Iz=z({hints:ie(Ez).optional(),costPriority:fe().min(0).max(1).optional(),speedPriority:fe().min(0).max(1).optional(),intelligencePriority:fe().min(0).max(1).optional()}),zz=z({mode:_t(["auto","required","none"]).optional()}),Rz=z({type:N("tool_result"),toolUseId:x().describe("The unique identifier for the corresponding tool call."),content:ie(Cd).default([]),structuredContent:z({}).loose().optional(),isError:qe().optional(),_meta:Ce(x(),Pe()).optional()}),Az=fd("type",[$d,Td,Pd]),xa=fd("type",[$d,Td,Pd,mz,Rz]),Oz=z({role:Mi,content:xe([xa,ie(xa)]),_meta:Ce(x(),Pe()).optional()}),Nz=zi.extend({messages:ie(Oz),modelPreferences:Iz.optional(),systemPrompt:x().optional(),includeContext:_t(["none","thisServer","allServers"]).optional(),temperature:fe().optional(),maxTokens:fe().int(),stopSequences:ie(x()).optional(),metadata:Be.optional(),tools:ie(wv).optional(),toolChoice:zz.optional()}),Dz=Ve.extend({method:N("sampling/createMessage"),params:Nz}),Id=He.extend({model:x(),stopReason:ze(_t(["endTurn","stopSequence","maxTokens"]).or(x())),role:Mi,content:Az}),zd=He.extend({model:x(),stopReason:ze(_t(["endTurn","stopSequence","maxTokens","toolUse"]).or(x())),role:Mi,content:xe([xa,ie(xa)])}),jz=z({type:N("boolean"),title:x().optional(),description:x().optional(),default:qe().optional()}),Mz=z({type:N("string"),title:x().optional(),description:x().optional(),minLength:fe().optional(),maxLength:fe().optional(),format:_t(["email","uri","date","date-time"]).optional(),default:x().optional()}),Lz=z({type:_t(["number","integer"]),title:x().optional(),description:x().optional(),minimum:fe().optional(),maximum:fe().optional(),default:fe().optional()}),Zz=z({type:N("string"),title:x().optional(),description:x().optional(),enum:ie(x()),default:x().optional()}),qz=z({type:N("string"),title:x().optional(),description:x().optional(),oneOf:ie(z({const:x(),title:x()})),default:x().optional()}),Fz=z({type:N("string"),title:x().optional(),description:x().optional(),enum:ie(x()),enumNames:ie(x()).optional(),default:x().optional()}),Uz=xe([Zz,qz]),Bz=z({type:N("array"),title:x().optional(),description:x().optional(),minItems:fe().optional(),maxItems:fe().optional(),items:z({type:N("string"),enum:ie(x())}),default:ie(x()).optional()}),Vz=z({type:N("array"),title:x().optional(),description:x().optional(),minItems:fe().optional(),maxItems:fe().optional(),items:z({anyOf:ie(z({const:x(),title:x()}))}),default:ie(x()).optional()}),Hz=xe([Bz,Vz]),Gz=xe([Fz,Uz,Hz]),Wz=xe([Gz,jz,Mz,Lz]),Kz=zi.extend({mode:N("form").optional(),message:x(),requestedSchema:z({type:N("object"),properties:Ce(x(),Wz),required:ie(x()).optional()})}),Jz=zi.extend({mode:N("url"),message:x(),elicitationId:x(),url:x().url()}),Yz=xe([Kz,Jz]),Qz=Ve.extend({method:N("elicitation/create"),params:Yz}),Xz=Dt.extend({elicitationId:x()}),eR=jt.extend({method:N("notifications/elicitation/complete"),params:Xz}),qa=He.extend({action:_t(["accept","decline","cancel"]),content:hd(e=>e===null?void 0:e,Ce(x(),xe([x(),fe(),qe(),ie(x())])).optional())}),tR=z({type:N("ref/resource"),uri:x()}),rR=z({type:N("ref/prompt"),name:x()}),nR=Ct.extend({ref:xe([rR,tR]),argument:z({name:x(),value:x()}),context:z({arguments:Ce(x(),x()).optional()}).optional()}),Fa=Ve.extend({method:N("completion/complete"),params:nR});oR=He.extend({completion:ct({values:ie(x()).max(100),total:ze(fe().int()),hasMore:ze(qe())})}),iR=z({uri:x().startsWith("file://"),name:x().optional(),_meta:Ce(x(),Pe()).optional()}),sR=Ve.extend({method:N("roots/list"),params:Ct.optional()}),Rd=He.extend({roots:ie(iR)}),aR=jt.extend({method:N("notifications/roots/list_changed"),params:Dt.optional()}),sq=xe([Ta,xd,Fa,Ed,Ma,ja,Oa,Na,Da,sz,cz,Po,La,Ca,Ia,za,Aa]),aq=xe([$a,Pa,wd,aR,ji]),cq=xe([Sa,Id,zd,qa,Rd,Ea,Ra,$o]),uq=xe([Ta,Dz,Qz,sR,Ca,Ia,za,Aa]),lq=xe([$a,Pa,Cz,lz,oz,$z,bz,ji,eR]),pq=xe([Sa,GI,oR,vz,fz,ez,tz,nz,Za,kz,Ea,Ra,$o]),O=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===L.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new md(o.elicitations,r)}return new e(t,r,n)}},md=class extends O{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(L.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}});function en(e){return e==="completed"||e==="failed"||e==="cancelled"}var $v=_(()=>{});var Pv,Tv,Cv,Ua=_(()=>{Pv=Symbol("Let zodToJsonSchema decide on which parser to use"),Tv={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Cv=e=>typeof e=="string"?{...Tv,name:e}:{...Tv,...e}});var Ev,Ad=_(()=>{Ua();Ev=e=>{let t=Cv(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}}});function Od(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function se(e,t,r,n,o){e[t]=r,Od(e,t,n,o)}var tn=_(()=>{});var Ba,Va=_(()=>{Ba=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")}});function Ee(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?Ba(t,e.currentPath):t.join("/")}}var Mt=_(()=>{Va()});function Iv(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==P.ZodAny&&(r.items=U(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&se(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&se(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(se(r,"minItems",e.exactLength.value,e.exactLength.message,t),se(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}var Nd=_(()=>{mi();tn();De()});function zv(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?se(r,"minimum",n.value,n.message,t):se(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),se(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?se(r,"maximum",n.value,n.message,t):se(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),se(r,"maximum",n.value,n.message,t));break;case"multipleOf":se(r,"multipleOf",n.value,n.message,t);break}return r}var Dd=_(()=>{tn()});function Rv(){return{type:"boolean"}}var jd=_(()=>{});function Ha(e,t){return U(e.type._def,t)}var Ga=_(()=>{De()});var Av,Md=_(()=>{De();Av=(e,t)=>U(e.innerType._def,t)});function Ld(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,i)=>Ld(e,t,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return cR(e,t)}}var cR,Zd=_(()=>{tn();cR=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let n of e.checks)switch(n.kind){case"min":se(r,"minimum",n.value,n.message,t);break;case"max":se(r,"maximum",n.value,n.message,t);break}return r}});function Ov(e,t){return{...U(e.innerType._def,t),default:e.defaultValue()}}var qd=_(()=>{De()});function Nv(e,t){return t.effectStrategy==="input"?U(e.schema._def,t):Ee(t)}var Fd=_(()=>{De();Mt()});function Dv(e){return{type:"string",enum:Array.from(e.values)}}var Ud=_(()=>{});function jv(e,t){let r=[U(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),U(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(i=>{if(uR(i))o.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:a,...c}=i;s=c}else n=void 0;o.push(s)}}),o.length?{allOf:o,...n}:void 0}var uR,Bd=_(()=>{De();uR=e=>"type"in e&&e.type==="string"?!1:"allOf"in e});function Mv(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var Vd=_(()=>{});function Wa(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":se(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":se(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Yt(r,"email",n.message,t);break;case"format:idn-email":Yt(r,"idn-email",n.message,t);break;case"pattern:zod":ut(r,Jt.email,n.message,t);break}break;case"url":Yt(r,"uri",n.message,t);break;case"uuid":Yt(r,"uuid",n.message,t);break;case"regex":ut(r,n.regex,n.message,t);break;case"cuid":ut(r,Jt.cuid,n.message,t);break;case"cuid2":ut(r,Jt.cuid2,n.message,t);break;case"startsWith":ut(r,RegExp(`^${Gd(n.value,t)}`),n.message,t);break;case"endsWith":ut(r,RegExp(`${Gd(n.value,t)}$`),n.message,t);break;case"datetime":Yt(r,"date-time",n.message,t);break;case"date":Yt(r,"date",n.message,t);break;case"time":Yt(r,"time",n.message,t);break;case"duration":Yt(r,"duration",n.message,t);break;case"length":se(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),se(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":{ut(r,RegExp(Gd(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&Yt(r,"ipv4",n.message,t),n.version!=="v4"&&Yt(r,"ipv6",n.message,t);break}case"base64url":ut(r,Jt.base64url,n.message,t);break;case"jwt":ut(r,Jt.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&ut(r,Jt.ipv4Cidr,n.message,t),n.version!=="v4"&&ut(r,Jt.ipv6Cidr,n.message,t);break}case"emoji":ut(r,Jt.emoji(),n.message,t);break;case"ulid":{ut(r,Jt.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Yt(r,"binary",n.message,t);break}case"contentEncoding:base64":{se(r,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{ut(r,Jt.base64,n.message,t);break}}break}case"nanoid":ut(r,Jt.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Gd(e,t){return t.patternStrategy==="escape"?pR(e):e}function pR(e){let t="";for(let r=0;r<e.length;r++)lR.has(e[r])||(t+="\\"),t+=e[r];return t}function Yt(e,t,r,n){e.format||e.anyOf?.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):se(e,"format",t,r,n)}function ut(e,t,r,n){e.pattern||e.allOf?.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:Lv(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):se(e,"pattern",Lv(t,n),r,n)}function Lv(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,o="",i=!1,s=!1,a=!1;for(let c=0;c<n.length;c++){if(i){o+=n[c],i=!1;continue}if(r.i){if(s){if(n[c].match(/[a-z]/)){a?(o+=n[c],o+=`${n[c-2]}-${n[c]}`.toUpperCase(),a=!1):n[c+1]==="-"&&n[c+2]?.match(/[a-z]/)?(o+=n[c],a=!0):o+=`${n[c]}${n[c].toUpperCase()}`;continue}}else if(n[c].match(/[a-z]/)){o+=`[${n[c]}${n[c].toUpperCase()}]`;continue}}if(r.m){if(n[c]==="^"){o+=`(^|(?<=[\r
|
|
28
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let p of this.seen.entries()){let l=p[1];if(t===p[0]){s(p);continue}if(n.external){let f=n.external.registry.get(p[0])?.id;if(t!==p[0]&&f){s(p);continue}}if(this.metadataRegistry.get(p[0])?.id){s(p);continue}if(l.cycle){s(p);continue}if(l.count>1&&n.reused==="ref"){s(p);continue}}let a=(p,l)=>{let d=this.seen.get(p),f=d.def??d.schema,h={...f};if(d.ref===null)return;let g=d.ref;if(d.ref=null,g){a(g,l);let y=this.seen.get(g).schema;y.$ref&&l.target==="draft-7"?(f.allOf=f.allOf??[],f.allOf.push(y)):(Object.assign(f,y),Object.assign(f,h))}d.isParent||this.override({zodSchema:p,jsonSchema:f,path:d.path??[]})};for(let p of[...this.seen.entries()].reverse())a(p[0],{target:this.target});let c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let p=n.external.registry.get(t)?.id;if(!p)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(p)}Object.assign(c,o.def);let u=n.external?.defs??{};for(let p of this.seen.entries()){let l=p[1];l.def&&l.defId&&(u[l.defId]=l.def)}n.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}}});var $_=_(()=>{});var at=_(()=>{vo();ml();cl();f_();ra();xl();dr();ta();ca();lp();bl();k_();w_();S_();$_()});var Qp=_(()=>{at()});function Xp(e,t){let r={type:"object",get shape(){return oe.assignProp(this,"shape",{...e}),this.shape},...oe.normalizeParams(t)};return new LE(r)}var ME,LE,T_=_(()=>{at();at();Qp();ME=w("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");me.init(e,t),e.def=t,e.parse=(r,n)=>ll(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>jn(e,r,n),e.parseAsync=async(r,n)=>dl(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Mn(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>Pt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e))}),LE=w("ZodMiniObject",(e,t)=>{sa.init(e,t),ME.init(e,t),oe.defineLazy(e,"shape",()=>t.shape)})});var P_=_(()=>{});var C_=_(()=>{});var E_=_(()=>{});var I_=_(()=>{at();Qp();T_();P_();at();ca();C_();E_()});var z_=_(()=>{I_()});var ed=_(()=>{z_()});function Nt(e){return!!e._zod}function qn(e){let t=Object.values(e);if(t.length===0)return Xp({});let r=t.every(Nt),n=t.every(o=>!Nt(o));if(r)return Xp(e);if(n)return Ku(e);throw new Error("Mixed Zod versions detected in object shape.")}function Yr(e,t){return Nt(e)?jn(e,t):e.safeParse(t)}async function ga(e,t){return Nt(e)?await Mn(e,t):await e.safeParseAsync(t)}function Qr(e){if(!e)return;let t;if(Nt(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function ko(e){if(e){if(typeof e=="object"){let t=e,r=e;if(!t._def&&!r._zod){let n=Object.values(e);if(n.length>0&&n.every(o=>typeof o=="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse=="function")))return qn(e)}}if(Nt(e)){let r=e._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return e}else if(e.shape!==void 0)return e}}function ya(e){if(e&&typeof e=="object"){if("message"in e&&typeof e.message=="string")return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){let t=e.issues[0];if(t&&typeof t=="object"&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function A_(e){return e.description}function O_(e){if(Nt(e))return e._zod?.def?.type==="optional";let t=e;return typeof e.isOptional=="function"?e.isOptional():t._def?.typeName==="ZodOptional"}function _a(e){if(Nt(e)){let i=e._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=e.value;if(n!==void 0)return n}var Ci=_(()=>{mi();ed()});var td=_(()=>{at()});var Ei={};Br(Ei,{ZodISODate:()=>D_,ZodISODateTime:()=>N_,ZodISODuration:()=>M_,ZodISOTime:()=>j_,date:()=>nd,datetime:()=>rd,duration:()=>id,time:()=>od});function rd(e){return y_(N_,e)}function nd(e){return __(D_,e)}function od(e){return v_(j_,e)}function id(e){return b_(M_,e)}var N_,D_,j_,M_,sd=_(()=>{at();ad();N_=w("ZodISODateTime",(e,t)=>{c_.init(e,t),Te.init(e,t)});D_=w("ZodISODate",(e,t)=>{u_.init(e,t),Te.init(e,t)});j_=w("ZodISOTime",(e,t)=>{l_.init(e,t),Te.init(e,t)});M_=w("ZodISODuration",(e,t)=>{p_.init(e,t),Te.init(e,t)})});var L_,G6,Ii,cd=_(()=>{at();at();L_=(e,t)=>{Xs.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>al(e,r)},flatten:{value:r=>sl(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},G6=w("ZodError",L_),Ii=w("ZodError",L_,{Parent:Error})});var Z_,q_,F_,U_,ud=_(()=>{at();cd();Z_=ul(Ii),q_=pl(Ii),F_=fl(Ii),U_=hl(Ii)});function x(e){return pp(KE,e)}function fe(e){return Ap(W_,e)}function V_(e){return Op(fI,e)}function qe(e){return Np(hI,e)}function dd(e){return Dp(mI,e)}function Pe(){return jp(gI)}function _I(e){return Mp(yI,e)}function ie(e,t){return x_(vI,e,t)}function z(e,t){let r={type:"object",get shape(){return oe.assignProp(this,"shape",{...e}),this.shape},...oe.normalizeParams(t)};return new K_(r)}function ct(e,t){return new K_({type:"object",get shape(){return oe.assignProp(this,"shape",{...e}),this.shape},catchall:Pe(),...oe.normalizeParams(t)})}function xe(e,t){return new J_({type:"union",options:e,...oe.normalizeParams(t)})}function fd(e,t,r){return new bI({type:"union",options:t,discriminator:e,...oe.normalizeParams(r)})}function ba(e,t){return new xI({type:"intersection",left:e,right:t})}function Ce(e,t,r){return new wI({type:"record",keyType:e,valueType:t,...oe.normalizeParams(r)})}function _t(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ld({type:"enum",entries:r,...oe.normalizeParams(t)})}function N(e,t){return new kI({type:"literal",values:Array.isArray(e)?e:[e],...oe.normalizeParams(t)})}function Y_(e){return new SI({type:"transform",transform:e})}function ze(e){return new Q_({type:"optional",innerType:e})}function H_(e){return new $I({type:"nullable",innerType:e})}function PI(e,t){return new TI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function EI(e,t){return new CI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function II(e,t){return new X_({type:"nonoptional",innerType:e,...oe.normalizeParams(t)})}function RI(e,t){return new zI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function pd(e,t){return new AI({type:"pipe",in:e,out:t})}function NI(e){return new OI({type:"readonly",innerType:e})}function DI(e){let t=new Ue({check:"custom"});return t._zod.check=e,t}function tv(e,t){return Kp(ev,e??(()=>!0),t)}function jI(e,t={}){return Jp(ev,e,t)}function MI(e){let t=DI(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(oe.issue(n,r.value,t._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(oe.issue(o))}},e(r.value,r)));return t}function hd(e,t){return pd(Y_(e),t)}var Re,G_,KE,Te,JE,B_,va,YE,QE,XE,eI,tI,rI,nI,oI,iI,sI,aI,cI,uI,lI,pI,dI,W_,fI,hI,mI,gI,yI,vI,K_,J_,bI,xI,wI,ld,kI,SI,Q_,$I,TI,CI,X_,zI,AI,OI,ev,ad=_(()=>{at();at();td();sd();ud();Re=w("ZodType",(e,t)=>(me.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>Pt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Z_(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>F_(e,r,n),e.parseAsync=async(r,n)=>q_(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>U_(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(jI(r,n)),e.superRefine=r=>e.check(MI(r)),e.overwrite=r=>e.check(Ln(r)),e.optional=()=>ze(e),e.nullable=()=>H_(e),e.nullish=()=>ze(H_(e)),e.nonoptional=r=>II(e,r),e.array=()=>ie(e),e.or=r=>xe([e,r]),e.and=r=>ba(e,r),e.transform=r=>pd(e,Y_(r)),e.default=r=>PI(e,r),e.prefault=r=>EI(e,r),e.catch=r=>RI(e,r),e.pipe=r=>pd(e,r),e.readonly=()=>NI(e),e.describe=r=>{let n=e.clone();return Jr.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Jr.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Jr.get(e);let n=e.clone();return Jr.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),G_=w("_ZodString",(e,t)=>{Si.init(e,t),Re.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Lp(...n)),e.includes=(...n)=>e.check(Fp(...n)),e.startsWith=(...n)=>e.check(Up(...n)),e.endsWith=(...n)=>e.check(Bp(...n)),e.min=(...n)=>e.check(wo(...n)),e.max=(...n)=>e.check(fa(...n)),e.length=(...n)=>e.check(ha(...n)),e.nonempty=(...n)=>e.check(wo(1,...n)),e.lowercase=n=>e.check(Zp(n)),e.uppercase=n=>e.check(qp(n)),e.trim=()=>e.check(Hp()),e.normalize=(...n)=>e.check(Vp(...n)),e.toLowerCase=()=>e.check(Gp()),e.toUpperCase=()=>e.check(Wp())}),KE=w("ZodString",(e,t)=>{Si.init(e,t),G_.init(e,t),e.email=r=>e.check(dp(JE,r)),e.url=r=>e.check(yp(YE,r)),e.jwt=r=>e.check(Rp(dI,r)),e.emoji=r=>e.check(_p(QE,r)),e.guid=r=>e.check(ua(B_,r)),e.uuid=r=>e.check(fp(va,r)),e.uuidv4=r=>e.check(hp(va,r)),e.uuidv6=r=>e.check(mp(va,r)),e.uuidv7=r=>e.check(gp(va,r)),e.nanoid=r=>e.check(vp(XE,r)),e.guid=r=>e.check(ua(B_,r)),e.cuid=r=>e.check(bp(eI,r)),e.cuid2=r=>e.check(xp(tI,r)),e.ulid=r=>e.check(wp(rI,r)),e.base64=r=>e.check(Ep(uI,r)),e.base64url=r=>e.check(Ip(lI,r)),e.xid=r=>e.check(kp(nI,r)),e.ksuid=r=>e.check(Sp(oI,r)),e.ipv4=r=>e.check($p(iI,r)),e.ipv6=r=>e.check(Tp(sI,r)),e.cidrv4=r=>e.check(Pp(aI,r)),e.cidrv6=r=>e.check(Cp(cI,r)),e.e164=r=>e.check(zp(pI,r)),e.datetime=r=>e.check(rd(r)),e.date=r=>e.check(nd(r)),e.time=r=>e.check(od(r)),e.duration=r=>e.check(id(r))});Te=w("ZodStringFormat",(e,t)=>{be.init(e,t),G_.init(e,t)}),JE=w("ZodEmail",(e,t)=>{$l.init(e,t),Te.init(e,t)}),B_=w("ZodGUID",(e,t)=>{kl.init(e,t),Te.init(e,t)}),va=w("ZodUUID",(e,t)=>{Sl.init(e,t),Te.init(e,t)}),YE=w("ZodURL",(e,t)=>{Tl.init(e,t),Te.init(e,t)}),QE=w("ZodEmoji",(e,t)=>{Pl.init(e,t),Te.init(e,t)}),XE=w("ZodNanoID",(e,t)=>{Cl.init(e,t),Te.init(e,t)}),eI=w("ZodCUID",(e,t)=>{El.init(e,t),Te.init(e,t)}),tI=w("ZodCUID2",(e,t)=>{Il.init(e,t),Te.init(e,t)}),rI=w("ZodULID",(e,t)=>{zl.init(e,t),Te.init(e,t)}),nI=w("ZodXID",(e,t)=>{Rl.init(e,t),Te.init(e,t)}),oI=w("ZodKSUID",(e,t)=>{Al.init(e,t),Te.init(e,t)}),iI=w("ZodIPv4",(e,t)=>{Ol.init(e,t),Te.init(e,t)}),sI=w("ZodIPv6",(e,t)=>{Nl.init(e,t),Te.init(e,t)}),aI=w("ZodCIDRv4",(e,t)=>{Dl.init(e,t),Te.init(e,t)}),cI=w("ZodCIDRv6",(e,t)=>{jl.init(e,t),Te.init(e,t)}),uI=w("ZodBase64",(e,t)=>{Ml.init(e,t),Te.init(e,t)}),lI=w("ZodBase64URL",(e,t)=>{Ll.init(e,t),Te.init(e,t)}),pI=w("ZodE164",(e,t)=>{Zl.init(e,t),Te.init(e,t)}),dI=w("ZodJWT",(e,t)=>{ql.init(e,t),Te.init(e,t)}),W_=w("ZodNumber",(e,t)=>{ia.init(e,t),Re.init(e,t),e.gt=(n,o)=>e.check(pa(n,o)),e.gte=(n,o)=>e.check(Pi(n,o)),e.min=(n,o)=>e.check(Pi(n,o)),e.lt=(n,o)=>e.check(la(n,o)),e.lte=(n,o)=>e.check(Ti(n,o)),e.max=(n,o)=>e.check(Ti(n,o)),e.int=n=>e.check(V_(n)),e.safe=n=>e.check(V_(n)),e.positive=n=>e.check(pa(0,n)),e.nonnegative=n=>e.check(Pi(0,n)),e.negative=n=>e.check(la(0,n)),e.nonpositive=n=>e.check(Ti(0,n)),e.multipleOf=(n,o)=>e.check(da(n,o)),e.step=(n,o)=>e.check(da(n,o)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});fI=w("ZodNumberFormat",(e,t)=>{Fl.init(e,t),W_.init(e,t)});hI=w("ZodBoolean",(e,t)=>{Ul.init(e,t),Re.init(e,t)});mI=w("ZodNull",(e,t)=>{Bl.init(e,t),Re.init(e,t)});gI=w("ZodUnknown",(e,t)=>{Vl.init(e,t),Re.init(e,t)});yI=w("ZodNever",(e,t)=>{Hl.init(e,t),Re.init(e,t)});vI=w("ZodArray",(e,t)=>{Gl.init(e,t),Re.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(wo(r,n)),e.nonempty=r=>e.check(wo(1,r)),e.max=(r,n)=>e.check(fa(r,n)),e.length=(r,n)=>e.check(ha(r,n)),e.unwrap=()=>e.element});K_=w("ZodObject",(e,t)=>{sa.init(e,t),Re.init(e,t),oe.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>_t(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Pe()}),e.loose=()=>e.clone({...e._zod.def,catchall:Pe()}),e.strict=()=>e.clone({...e._zod.def,catchall:_I()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>oe.extend(e,r),e.merge=r=>oe.merge(e,r),e.pick=r=>oe.pick(e,r),e.omit=r=>oe.omit(e,r),e.partial=(...r)=>oe.partial(Q_,e,r[0]),e.required=(...r)=>oe.required(X_,e,r[0])});J_=w("ZodUnion",(e,t)=>{aa.init(e,t),Re.init(e,t),e.options=t.options});bI=w("ZodDiscriminatedUnion",(e,t)=>{J_.init(e,t),Wl.init(e,t)});xI=w("ZodIntersection",(e,t)=>{Kl.init(e,t),Re.init(e,t)});wI=w("ZodRecord",(e,t)=>{Jl.init(e,t),Re.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});ld=w("ZodEnum",(e,t)=>{Yl.init(e,t),Re.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ld({...t,checks:[],...oe.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new ld({...t,checks:[],...oe.normalizeParams(o),entries:i})}});kI=w("ZodLiteral",(e,t)=>{Ql.init(e,t),Re.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});SI=w("ZodTransform",(e,t)=>{Xl.init(e,t),Re.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=i=>{if(typeof i=="string")r.issues.push(oe.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(oe.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});Q_=w("ZodOptional",(e,t)=>{ep.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});$I=w("ZodNullable",(e,t)=>{tp.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});TI=w("ZodDefault",(e,t)=>{rp.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});CI=w("ZodPrefault",(e,t)=>{np.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});X_=w("ZodNonOptional",(e,t)=>{op.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});zI=w("ZodCatch",(e,t)=>{ip.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});AI=w("ZodPipe",(e,t)=>{sp.init(e,t),Re.init(e,t),e.in=t.in,e.out=t.out});OI=w("ZodReadonly",(e,t)=>{ap.init(e,t),Re.init(e,t)});ev=w("ZodCustom",(e,t)=>{cp.init(e,t),Re.init(e,t)})});var rv=_(()=>{});var nv=_(()=>{});var ov=_(()=>{at();ad();td();cd();ud();rv();at();m_();ca();sd();nv();Tt(h_())});var iv=_(()=>{ov()});var sv=_(()=>{iv()});function kv(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Sv(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var gd,av,Xr,wa,Be,cv,uv,uq,qI,FI,yd,Ct,zi,lv,Ve,Dt,jt,He,ka,pv,_d,dv,fv,vd,Ri,L,bd,hv,mv,lq,Sa,UI,$a,BI,Ai,So,gv,VI,HI,GI,WI,KI,JI,xd,YI,QI,wd,Ta,XI,ez,Pa,tz,Oi,Ni,rz,Di,$o,nz,ji,Ca,Ea,Ia,pq,za,Ra,Aa,yv,_v,vv,kd,bv,Mi,To,xv,oz,Oa,iz,Na,sz,Sd,az,Da,cz,uz,lz,pz,dz,fz,hz,mz,gz,yz,ja,_z,vz,Ma,$d,Td,Pd,bz,xz,wz,Cd,kz,Sz,$z,Tz,Pz,wv,La,Cz,Za,dq,Ez,Po,Iz,fq,Li,zz,Ed,Rz,Az,Oz,Nz,Dz,jz,Mz,xa,Lz,Zz,qz,Id,zd,Fz,Uz,Bz,Vz,Hz,Gz,Wz,Kz,Jz,Yz,Qz,Xz,eR,tR,rR,nR,oR,iR,qa,sR,aR,cR,Fa,uR,lR,pR,Rd,dR,hq,mq,gq,yq,_q,vq,O,md,Zi=_(()=>{sv();gd="2025-11-25",av=[gd,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Xr="io.modelcontextprotocol/related-task",wa="2.0",Be=tv(e=>e!==null&&(typeof e=="object"||typeof e=="function")),cv=xe([x(),fe().int()]),uv=x(),uq=ct({ttl:xe([fe(),dd()]).optional(),pollInterval:fe().optional()}),qI=z({ttl:fe().optional()}),FI=z({taskId:x()}),yd=ct({progressToken:cv.optional(),[Xr]:FI.optional()}),Ct=z({_meta:yd.optional()}),zi=Ct.extend({task:qI.optional()}),lv=e=>zi.safeParse(e).success,Ve=z({method:x(),params:Ct.loose().optional()}),Dt=z({_meta:yd.optional()}),jt=z({method:x(),params:Dt.loose().optional()}),He=ct({_meta:yd.optional()}),ka=xe([x(),fe().int()]),pv=z({jsonrpc:N(wa),id:ka,...Ve.shape}).strict(),_d=e=>pv.safeParse(e).success,dv=z({jsonrpc:N(wa),...jt.shape}).strict(),fv=e=>dv.safeParse(e).success,vd=z({jsonrpc:N(wa),id:ka,result:He}).strict(),Ri=e=>vd.safeParse(e).success;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(L||(L={}));bd=z({jsonrpc:N(wa),id:ka.optional(),error:z({code:fe().int(),message:x(),data:Pe().optional()})}).strict(),hv=e=>bd.safeParse(e).success,mv=xe([pv,dv,vd,bd]),lq=xe([vd,bd]),Sa=He.strict(),UI=Dt.extend({requestId:ka.optional(),reason:x().optional()}),$a=jt.extend({method:N("notifications/cancelled"),params:UI}),BI=z({src:x(),mimeType:x().optional(),sizes:ie(x()).optional(),theme:_t(["light","dark"]).optional()}),Ai=z({icons:ie(BI).optional()}),So=z({name:x(),title:x().optional()}),gv=So.extend({...So.shape,...Ai.shape,version:x(),websiteUrl:x().optional(),description:x().optional()}),VI=ba(z({applyDefaults:qe().optional()}),Ce(x(),Pe())),HI=hd(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ba(z({form:VI.optional(),url:Be.optional()}),Ce(x(),Pe()).optional())),GI=ct({list:Be.optional(),cancel:Be.optional(),requests:ct({sampling:ct({createMessage:Be.optional()}).optional(),elicitation:ct({create:Be.optional()}).optional()}).optional()}),WI=ct({list:Be.optional(),cancel:Be.optional(),requests:ct({tools:ct({call:Be.optional()}).optional()}).optional()}),KI=z({experimental:Ce(x(),Be).optional(),sampling:z({context:Be.optional(),tools:Be.optional()}).optional(),elicitation:HI.optional(),roots:z({listChanged:qe().optional()}).optional(),tasks:GI.optional()}),JI=Ct.extend({protocolVersion:x(),capabilities:KI,clientInfo:gv}),xd=Ve.extend({method:N("initialize"),params:JI}),YI=z({experimental:Ce(x(),Be).optional(),logging:Be.optional(),completions:Be.optional(),prompts:z({listChanged:qe().optional()}).optional(),resources:z({subscribe:qe().optional(),listChanged:qe().optional()}).optional(),tools:z({listChanged:qe().optional()}).optional(),tasks:WI.optional()}),QI=He.extend({protocolVersion:x(),capabilities:YI,serverInfo:gv,instructions:x().optional()}),wd=jt.extend({method:N("notifications/initialized"),params:Dt.optional()}),Ta=Ve.extend({method:N("ping"),params:Ct.optional()}),XI=z({progress:fe(),total:ze(fe()),message:ze(x())}),ez=z({...Dt.shape,...XI.shape,progressToken:cv}),Pa=jt.extend({method:N("notifications/progress"),params:ez}),tz=Ct.extend({cursor:uv.optional()}),Oi=Ve.extend({params:tz.optional()}),Ni=He.extend({nextCursor:uv.optional()}),rz=_t(["working","input_required","completed","failed","cancelled"]),Di=z({taskId:x(),status:rz,ttl:xe([fe(),dd()]),createdAt:x(),lastUpdatedAt:x(),pollInterval:ze(fe()),statusMessage:ze(x())}),$o=He.extend({task:Di}),nz=Dt.merge(Di),ji=jt.extend({method:N("notifications/tasks/status"),params:nz}),Ca=Ve.extend({method:N("tasks/get"),params:Ct.extend({taskId:x()})}),Ea=He.merge(Di),Ia=Ve.extend({method:N("tasks/result"),params:Ct.extend({taskId:x()})}),pq=He.loose(),za=Oi.extend({method:N("tasks/list")}),Ra=Ni.extend({tasks:ie(Di)}),Aa=Ve.extend({method:N("tasks/cancel"),params:Ct.extend({taskId:x()})}),yv=He.merge(Di),_v=z({uri:x(),mimeType:ze(x()),_meta:Ce(x(),Pe()).optional()}),vv=_v.extend({text:x()}),kd=x().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),bv=_v.extend({blob:kd}),Mi=_t(["user","assistant"]),To=z({audience:ie(Mi).optional(),priority:fe().min(0).max(1).optional(),lastModified:Ei.datetime({offset:!0}).optional()}),xv=z({...So.shape,...Ai.shape,uri:x(),description:ze(x()),mimeType:ze(x()),annotations:To.optional(),_meta:ze(ct({}))}),oz=z({...So.shape,...Ai.shape,uriTemplate:x(),description:ze(x()),mimeType:ze(x()),annotations:To.optional(),_meta:ze(ct({}))}),Oa=Oi.extend({method:N("resources/list")}),iz=Ni.extend({resources:ie(xv)}),Na=Oi.extend({method:N("resources/templates/list")}),sz=Ni.extend({resourceTemplates:ie(oz)}),Sd=Ct.extend({uri:x()}),az=Sd,Da=Ve.extend({method:N("resources/read"),params:az}),cz=He.extend({contents:ie(xe([vv,bv]))}),uz=jt.extend({method:N("notifications/resources/list_changed"),params:Dt.optional()}),lz=Sd,pz=Ve.extend({method:N("resources/subscribe"),params:lz}),dz=Sd,fz=Ve.extend({method:N("resources/unsubscribe"),params:dz}),hz=Dt.extend({uri:x()}),mz=jt.extend({method:N("notifications/resources/updated"),params:hz}),gz=z({name:x(),description:ze(x()),required:ze(qe())}),yz=z({...So.shape,...Ai.shape,description:ze(x()),arguments:ze(ie(gz)),_meta:ze(ct({}))}),ja=Oi.extend({method:N("prompts/list")}),_z=Ni.extend({prompts:ie(yz)}),vz=Ct.extend({name:x(),arguments:Ce(x(),x()).optional()}),Ma=Ve.extend({method:N("prompts/get"),params:vz}),$d=z({type:N("text"),text:x(),annotations:To.optional(),_meta:Ce(x(),Pe()).optional()}),Td=z({type:N("image"),data:kd,mimeType:x(),annotations:To.optional(),_meta:Ce(x(),Pe()).optional()}),Pd=z({type:N("audio"),data:kd,mimeType:x(),annotations:To.optional(),_meta:Ce(x(),Pe()).optional()}),bz=z({type:N("tool_use"),name:x(),id:x(),input:Ce(x(),Pe()),_meta:Ce(x(),Pe()).optional()}),xz=z({type:N("resource"),resource:xe([vv,bv]),annotations:To.optional(),_meta:Ce(x(),Pe()).optional()}),wz=xv.extend({type:N("resource_link")}),Cd=xe([$d,Td,Pd,wz,xz]),kz=z({role:Mi,content:Cd}),Sz=He.extend({description:x().optional(),messages:ie(kz)}),$z=jt.extend({method:N("notifications/prompts/list_changed"),params:Dt.optional()}),Tz=z({title:x().optional(),readOnlyHint:qe().optional(),destructiveHint:qe().optional(),idempotentHint:qe().optional(),openWorldHint:qe().optional()}),Pz=z({taskSupport:_t(["required","optional","forbidden"]).optional()}),wv=z({...So.shape,...Ai.shape,description:x().optional(),inputSchema:z({type:N("object"),properties:Ce(x(),Be).optional(),required:ie(x()).optional()}).catchall(Pe()),outputSchema:z({type:N("object"),properties:Ce(x(),Be).optional(),required:ie(x()).optional()}).catchall(Pe()).optional(),annotations:Tz.optional(),execution:Pz.optional(),_meta:Ce(x(),Pe()).optional()}),La=Oi.extend({method:N("tools/list")}),Cz=Ni.extend({tools:ie(wv)}),Za=He.extend({content:ie(Cd).default([]),structuredContent:Ce(x(),Pe()).optional(),isError:qe().optional()}),dq=Za.or(He.extend({toolResult:Pe()})),Ez=zi.extend({name:x(),arguments:Ce(x(),Pe()).optional()}),Po=Ve.extend({method:N("tools/call"),params:Ez}),Iz=jt.extend({method:N("notifications/tools/list_changed"),params:Dt.optional()}),fq=z({autoRefresh:qe().default(!0),debounceMs:fe().int().nonnegative().default(300)}),Li=_t(["debug","info","notice","warning","error","critical","alert","emergency"]),zz=Ct.extend({level:Li}),Ed=Ve.extend({method:N("logging/setLevel"),params:zz}),Rz=Dt.extend({level:Li,logger:x().optional(),data:Pe()}),Az=jt.extend({method:N("notifications/message"),params:Rz}),Oz=z({name:x().optional()}),Nz=z({hints:ie(Oz).optional(),costPriority:fe().min(0).max(1).optional(),speedPriority:fe().min(0).max(1).optional(),intelligencePriority:fe().min(0).max(1).optional()}),Dz=z({mode:_t(["auto","required","none"]).optional()}),jz=z({type:N("tool_result"),toolUseId:x().describe("The unique identifier for the corresponding tool call."),content:ie(Cd).default([]),structuredContent:z({}).loose().optional(),isError:qe().optional(),_meta:Ce(x(),Pe()).optional()}),Mz=fd("type",[$d,Td,Pd]),xa=fd("type",[$d,Td,Pd,bz,jz]),Lz=z({role:Mi,content:xe([xa,ie(xa)]),_meta:Ce(x(),Pe()).optional()}),Zz=zi.extend({messages:ie(Lz),modelPreferences:Nz.optional(),systemPrompt:x().optional(),includeContext:_t(["none","thisServer","allServers"]).optional(),temperature:fe().optional(),maxTokens:fe().int(),stopSequences:ie(x()).optional(),metadata:Be.optional(),tools:ie(wv).optional(),toolChoice:Dz.optional()}),qz=Ve.extend({method:N("sampling/createMessage"),params:Zz}),Id=He.extend({model:x(),stopReason:ze(_t(["endTurn","stopSequence","maxTokens"]).or(x())),role:Mi,content:Mz}),zd=He.extend({model:x(),stopReason:ze(_t(["endTurn","stopSequence","maxTokens","toolUse"]).or(x())),role:Mi,content:xe([xa,ie(xa)])}),Fz=z({type:N("boolean"),title:x().optional(),description:x().optional(),default:qe().optional()}),Uz=z({type:N("string"),title:x().optional(),description:x().optional(),minLength:fe().optional(),maxLength:fe().optional(),format:_t(["email","uri","date","date-time"]).optional(),default:x().optional()}),Bz=z({type:_t(["number","integer"]),title:x().optional(),description:x().optional(),minimum:fe().optional(),maximum:fe().optional(),default:fe().optional()}),Vz=z({type:N("string"),title:x().optional(),description:x().optional(),enum:ie(x()),default:x().optional()}),Hz=z({type:N("string"),title:x().optional(),description:x().optional(),oneOf:ie(z({const:x(),title:x()})),default:x().optional()}),Gz=z({type:N("string"),title:x().optional(),description:x().optional(),enum:ie(x()),enumNames:ie(x()).optional(),default:x().optional()}),Wz=xe([Vz,Hz]),Kz=z({type:N("array"),title:x().optional(),description:x().optional(),minItems:fe().optional(),maxItems:fe().optional(),items:z({type:N("string"),enum:ie(x())}),default:ie(x()).optional()}),Jz=z({type:N("array"),title:x().optional(),description:x().optional(),minItems:fe().optional(),maxItems:fe().optional(),items:z({anyOf:ie(z({const:x(),title:x()}))}),default:ie(x()).optional()}),Yz=xe([Kz,Jz]),Qz=xe([Gz,Wz,Yz]),Xz=xe([Qz,Fz,Uz,Bz]),eR=zi.extend({mode:N("form").optional(),message:x(),requestedSchema:z({type:N("object"),properties:Ce(x(),Xz),required:ie(x()).optional()})}),tR=zi.extend({mode:N("url"),message:x(),elicitationId:x(),url:x().url()}),rR=xe([eR,tR]),nR=Ve.extend({method:N("elicitation/create"),params:rR}),oR=Dt.extend({elicitationId:x()}),iR=jt.extend({method:N("notifications/elicitation/complete"),params:oR}),qa=He.extend({action:_t(["accept","decline","cancel"]),content:hd(e=>e===null?void 0:e,Ce(x(),xe([x(),fe(),qe(),ie(x())])).optional())}),sR=z({type:N("ref/resource"),uri:x()}),aR=z({type:N("ref/prompt"),name:x()}),cR=Ct.extend({ref:xe([aR,sR]),argument:z({name:x(),value:x()}),context:z({arguments:Ce(x(),x()).optional()}).optional()}),Fa=Ve.extend({method:N("completion/complete"),params:cR});uR=He.extend({completion:ct({values:ie(x()).max(100),total:ze(fe().int()),hasMore:ze(qe())})}),lR=z({uri:x().startsWith("file://"),name:x().optional(),_meta:Ce(x(),Pe()).optional()}),pR=Ve.extend({method:N("roots/list"),params:Ct.optional()}),Rd=He.extend({roots:ie(lR)}),dR=jt.extend({method:N("notifications/roots/list_changed"),params:Dt.optional()}),hq=xe([Ta,xd,Fa,Ed,Ma,ja,Oa,Na,Da,pz,fz,Po,La,Ca,Ia,za,Aa]),mq=xe([$a,Pa,wd,dR,ji]),gq=xe([Sa,Id,zd,qa,Rd,Ea,Ra,$o]),yq=xe([Ta,qz,nR,pR,Ca,Ia,za,Aa]),_q=xe([$a,Pa,Az,mz,uz,Iz,$z,ji,iR]),vq=xe([Sa,QI,uR,Sz,_z,iz,sz,cz,Za,Cz,Ea,Ra,$o]),O=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===L.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new md(o.elicitations,r)}return new e(t,r,n)}},md=class extends O{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(L.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}});function en(e){return e==="completed"||e==="failed"||e==="cancelled"}var $v=_(()=>{});var Pv,Tv,Cv,Ua=_(()=>{Pv=Symbol("Let zodToJsonSchema decide on which parser to use"),Tv={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Cv=e=>typeof e=="string"?{...Tv,name:e}:{...Tv,...e}});var Ev,Ad=_(()=>{Ua();Ev=e=>{let t=Cv(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}}});function Od(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function se(e,t,r,n,o){e[t]=r,Od(e,t,n,o)}var tn=_(()=>{});var Ba,Va=_(()=>{Ba=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")}});function Ee(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?Ba(t,e.currentPath):t.join("/")}}var Mt=_(()=>{Va()});function Iv(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==P.ZodAny&&(r.items=B(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&se(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&se(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(se(r,"minItems",e.exactLength.value,e.exactLength.message,t),se(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}var Nd=_(()=>{mi();tn();De()});function zv(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?se(r,"minimum",n.value,n.message,t):se(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),se(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?se(r,"maximum",n.value,n.message,t):se(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),se(r,"maximum",n.value,n.message,t));break;case"multipleOf":se(r,"multipleOf",n.value,n.message,t);break}return r}var Dd=_(()=>{tn()});function Rv(){return{type:"boolean"}}var jd=_(()=>{});function Ha(e,t){return B(e.type._def,t)}var Ga=_(()=>{De()});var Av,Md=_(()=>{De();Av=(e,t)=>B(e.innerType._def,t)});function Ld(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,i)=>Ld(e,t,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return fR(e,t)}}var fR,Zd=_(()=>{tn();fR=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let n of e.checks)switch(n.kind){case"min":se(r,"minimum",n.value,n.message,t);break;case"max":se(r,"maximum",n.value,n.message,t);break}return r}});function Ov(e,t){return{...B(e.innerType._def,t),default:e.defaultValue()}}var qd=_(()=>{De()});function Nv(e,t){return t.effectStrategy==="input"?B(e.schema._def,t):Ee(t)}var Fd=_(()=>{De();Mt()});function Dv(e){return{type:"string",enum:Array.from(e.values)}}var Ud=_(()=>{});function jv(e,t){let r=[B(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),B(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(i=>{if(hR(i))o.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:a,...c}=i;s=c}else n=void 0;o.push(s)}}),o.length?{allOf:o,...n}:void 0}var hR,Bd=_(()=>{De();hR=e=>"type"in e&&e.type==="string"?!1:"allOf"in e});function Mv(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var Vd=_(()=>{});function Wa(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":se(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":se(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Yt(r,"email",n.message,t);break;case"format:idn-email":Yt(r,"idn-email",n.message,t);break;case"pattern:zod":ut(r,Jt.email,n.message,t);break}break;case"url":Yt(r,"uri",n.message,t);break;case"uuid":Yt(r,"uuid",n.message,t);break;case"regex":ut(r,n.regex,n.message,t);break;case"cuid":ut(r,Jt.cuid,n.message,t);break;case"cuid2":ut(r,Jt.cuid2,n.message,t);break;case"startsWith":ut(r,RegExp(`^${Gd(n.value,t)}`),n.message,t);break;case"endsWith":ut(r,RegExp(`${Gd(n.value,t)}$`),n.message,t);break;case"datetime":Yt(r,"date-time",n.message,t);break;case"date":Yt(r,"date",n.message,t);break;case"time":Yt(r,"time",n.message,t);break;case"duration":Yt(r,"duration",n.message,t);break;case"length":se(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),se(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":{ut(r,RegExp(Gd(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&Yt(r,"ipv4",n.message,t),n.version!=="v4"&&Yt(r,"ipv6",n.message,t);break}case"base64url":ut(r,Jt.base64url,n.message,t);break;case"jwt":ut(r,Jt.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&ut(r,Jt.ipv4Cidr,n.message,t),n.version!=="v4"&&ut(r,Jt.ipv6Cidr,n.message,t);break}case"emoji":ut(r,Jt.emoji(),n.message,t);break;case"ulid":{ut(r,Jt.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Yt(r,"binary",n.message,t);break}case"contentEncoding:base64":{se(r,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{ut(r,Jt.base64,n.message,t);break}}break}case"nanoid":ut(r,Jt.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Gd(e,t){return t.patternStrategy==="escape"?gR(e):e}function gR(e){let t="";for(let r=0;r<e.length;r++)mR.has(e[r])||(t+="\\"),t+=e[r];return t}function Yt(e,t,r,n){e.format||e.anyOf?.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):se(e,"format",t,r,n)}function ut(e,t,r,n){e.pattern||e.allOf?.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:Lv(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):se(e,"pattern",Lv(t,n),r,n)}function Lv(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,o="",i=!1,s=!1,a=!1;for(let c=0;c<n.length;c++){if(i){o+=n[c],i=!1;continue}if(r.i){if(s){if(n[c].match(/[a-z]/)){a?(o+=n[c],o+=`${n[c-2]}-${n[c]}`.toUpperCase(),a=!1):n[c+1]==="-"&&n[c+2]?.match(/[a-z]/)?(o+=n[c],a=!0):o+=`${n[c]}${n[c].toUpperCase()}`;continue}}else if(n[c].match(/[a-z]/)){o+=`[${n[c]}${n[c].toUpperCase()}]`;continue}}if(r.m){if(n[c]==="^"){o+=`(^|(?<=[\r
|
|
29
29
|
]))`;continue}else if(n[c]==="$"){o+=`($|(?=[\r
|
|
30
30
|
]))`;continue}}if(r.s&&n[c]==="."){o+=s?`${n[c]}\r
|
|
31
31
|
`:`[${n[c]}\r
|
|
32
|
-
]`;continue}o+=n[c],n[c]==="\\"?i=!0:s&&n[c]==="]"?s=!1:!s&&n[c]==="["&&(s=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}var Hd,Jt,lR,Ka=_(()=>{tn();Jt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Hd===void 0&&(Hd=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Hd),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};lR=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function Ja(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===P.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,o)=>({...n,[o]:U(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",o]})??Ee(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:U(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===P.ZodString&&e.keyType._def.checks?.length){let{type:n,...o}=Wa(e.keyType._def,t);return{...r,propertyNames:o}}else{if(e.keyType?._def.typeName===P.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===P.ZodBranded&&e.keyType._def.type._def.typeName===P.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...o}=Ha(e.keyType._def,t);return{...r,propertyNames:o}}}return r}var Ya=_(()=>{mi();De();Ka();Ga();Mt()});function Zv(e,t){if(t.mapStrategy==="record")return Ja(e,t);let r=U(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Ee(t),n=U(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Ee(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var Wd=_(()=>{De();Ya();Mt()});function qv(e){let t=e.values,n=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),o=Array.from(new Set(n.map(i=>typeof i)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:n}}var Kd=_(()=>{});function Fv(e){return e.target==="openAi"?void 0:{not:Ee({...e,currentPath:[...e.currentPath,"not"]})}}var Jd=_(()=>{Mt()});function Uv(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Yd=_(()=>{});function Vv(e,t){if(t.target==="openApi3")return Bv(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in qi&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,i)=>{let s=qi[i._def.typeName];return s&&!o.includes(s)?[...o,s]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,i)=>{let s=typeof i._def.value;switch(s){case"string":case"number":case"boolean":return[...o,s];case"bigint":return[...o,"integer"];case"object":if(i._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(n.length===r.length){let o=n.filter((i,s,a)=>a.indexOf(i)===s);return{type:o.length>1?o:o[0],enum:r.reduce((i,s)=>i.includes(s._def.value)?i:[...i,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(i=>!n.includes(i))],[])};return Bv(e,t)}var qi,Bv,Qa=_(()=>{De();qi={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};Bv=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,o)=>U(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0}});function Hv(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:qi[e.innerType._def.typeName],nullable:!0}:{type:[qi[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let n=U(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=U(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var Qd=_(()=>{De();Qa()});function Gv(e,t){let r={type:"number"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"int":r.type="integer",Od(r,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?se(r,"minimum",n.value,n.message,t):se(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),se(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?se(r,"maximum",n.value,n.message,t):se(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),se(r,"maximum",n.value,n.message,t));break;case"multipleOf":se(r,"multipleOf",n.value,n.message,t);break}return r}var Xd=_(()=>{tn()});function Wv(e,t){let r=t.target==="openAi",n={type:"object",properties:{}},o=[],i=e.shape();for(let a in i){let c=i[a];if(c===void 0||c._def===void 0)continue;let u=fR(c);u&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);let p=U(c._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});p!==void 0&&(n.properties[a]=p,u||o.push(a))}o.length&&(n.required=o);let s=dR(e,t);return s!==void 0&&(n.additionalProperties=s),n}function dR(e,t){if(e.catchall._def.typeName!=="ZodNever")return U(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function fR(e){try{return e.isOptional()}catch{return!0}}var ef=_(()=>{De()});var Kv,tf=_(()=>{De();Mt();Kv=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return U(e.innerType._def,t);let r=U(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Ee(t)},r]}:Ee(t)}});var Jv,rf=_(()=>{De();Jv=(e,t)=>{if(t.pipeStrategy==="input")return U(e.in._def,t);if(t.pipeStrategy==="output")return U(e.out._def,t);let r=U(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=U(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}}});function Yv(e,t){return U(e.type._def,t)}var nf=_(()=>{De()});function Qv(e,t){let n={type:"array",uniqueItems:!0,items:U(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&se(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&se(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}var of=_(()=>{tn();De()});function Xv(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>U(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:U(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>U(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}var sf=_(()=>{De()});function e0(e){return{not:Ee(e)}}var af=_(()=>{Mt()});function t0(e){return Ee(e)}var cf=_(()=>{Mt()});var r0,uf=_(()=>{De();r0=(e,t)=>U(e.innerType._def,t)});var n0,lf=_(()=>{mi();Mt();Nd();Dd();jd();Ga();Md();Zd();qd();Fd();Ud();Bd();Vd();Wd();Kd();Jd();Yd();Qd();Xd();ef();tf();rf();nf();Ya();of();Ka();sf();af();Qa();cf();uf();n0=(e,t,r)=>{switch(t){case P.ZodString:return Wa(e,r);case P.ZodNumber:return Gv(e,r);case P.ZodObject:return Wv(e,r);case P.ZodBigInt:return zv(e,r);case P.ZodBoolean:return Rv();case P.ZodDate:return Ld(e,r);case P.ZodUndefined:return e0(r);case P.ZodNull:return Uv(r);case P.ZodArray:return Iv(e,r);case P.ZodUnion:case P.ZodDiscriminatedUnion:return Vv(e,r);case P.ZodIntersection:return jv(e,r);case P.ZodTuple:return Xv(e,r);case P.ZodRecord:return Ja(e,r);case P.ZodLiteral:return Mv(e,r);case P.ZodEnum:return Dv(e);case P.ZodNativeEnum:return qv(e);case P.ZodNullable:return Hv(e,r);case P.ZodOptional:return Kv(e,r);case P.ZodMap:return Zv(e,r);case P.ZodSet:return Qv(e,r);case P.ZodLazy:return()=>e.getter()._def;case P.ZodPromise:return Yv(e,r);case P.ZodNaN:case P.ZodNever:return Fv(r);case P.ZodEffects:return Nv(e,r);case P.ZodAny:return Ee(r);case P.ZodUnknown:return t0(r);case P.ZodDefault:return Ov(e,r);case P.ZodBranded:return Ha(e,r);case P.ZodReadonly:return r0(e,r);case P.ZodCatch:return Av(e,r);case P.ZodPipeline:return Jv(e,r);case P.ZodFunction:case P.ZodVoid:case P.ZodSymbol:return;default:return(n=>{})(t)}}});function U(e,t,r=!1){let n=t.seen.get(e);if(t.override){let a=t.override?.(e,t,n,r);if(a!==Pv)return a}if(n&&!r){let a=hR(n,t);if(a!==void 0)return a}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=n0(e,e.typeName,t),s=typeof i=="function"?U(i(),t):i;if(s&&mR(e,t,s),t.postProcess){let a=t.postProcess(s,e,t);return o.jsonSchema=s,a}return o.jsonSchema=s,s}var hR,mR,De=_(()=>{Ua();lf();Va();Mt();hR=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Ba(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Ee(t)):t.$refStrategy==="seen"?Ee(t):void 0}},mR=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r)});var o0=_(()=>{});var pf,df=_(()=>{De();Ad();Mt();pf=(e,t)=>{let r=Ev(t),n=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[u,p])=>({...c,[u]:U(p._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??Ee(r)}),{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=U(e._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??Ee(r),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(i.title=s),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=o===void 0?n?{...i,[r.definitionPath]:n}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:i}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a}});var i0=_(()=>{Ua();Ad();tn();Va();De();o0();Mt();Nd();Dd();jd();Ga();Md();Zd();qd();Fd();Ud();Bd();Vd();Wd();Kd();Jd();Yd();Qd();Xd();ef();tf();rf();nf();uf();Ya();of();Ka();sf();af();Qa();cf();lf();df();df()});function gR(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function ff(e,t){return Nt(e)?Yp(e,{target:gR(t?.target),io:t?.pipeStrategy??"input"}):pf(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function hf(e){let r=Qr(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=_a(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function mf(e,t){let r=Yr(e,t);if(!r.success)throw r.error;return r.data}var gf=_(()=>{ed();Ci();i0()});function s0(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function a0(e,t){let r={...e};for(let n in t){let o=n,i=t[o];if(i===void 0)continue;let s=r[o];s0(s)&&s0(i)?r[o]={...s,...i}:r[o]=i}return r}var yR,Xa,c0=_(()=>{Ci();Zi();$v();gf();yR=6e4,Xa=class{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler($a,r=>{this._oncancel(r)}),this.setNotificationHandler(Pa,r=>{this._onprogress(r)}),this.setRequestHandler(Ta,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Ca,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new O(L.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Ia,async(r,n)=>{let o=async()=>{let i=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(i,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,p=this._requestResolvers.get(u);if(p)if(this._requestResolvers.delete(u),a.type==="response")p(c);else{let l=c,d=new O(l.error.code,l.error.message,l.error.data);p(d)}else{let l=a.type==="response"?"Response":"Error";this._onerror(new Error(`${l} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(i,n.sessionId);if(!s)throw new O(L.InvalidParams,`Task not found: ${i}`);if(!en(s.status))return await this._waitForTaskUpdate(i,n.signal),await o();if(en(s.status)){let a=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...a,_meta:{...a._meta,[Xr]:{taskId:i}}}}return await o()};return await o()}),this.setRequestHandler(za,async(r,n)=>{try{let{tasks:o,nextCursor:i}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:i,_meta:{}}}catch(o){throw new O(L.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Aa,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new O(L.InvalidParams,`Task not found: ${r.params.taskId}`);if(en(o.status))throw new O(L.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new O(L.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(o){throw o instanceof O?o:new O(L.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,n,o,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:o})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),O.fromError(L.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=i=>{n?.(i),this._onerror(i)};let o=this._transport?.onmessage;this._transport.onmessage=(i,s)=>{o?.(i,s),Ri(i)||hv(i)?this._onresponse(i):_d(i)?this._onrequest(i,s):fv(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=O.fromError(L.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of t.values())n(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){let r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,r){let n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,o=this._transport,i=t.params?._meta?.[Xr]?.taskId;if(n===void 0){let p={jsonrpc:"2.0",id:t.id,error:{code:L.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:p,timestamp:Date.now()},o?.sessionId).catch(l=>this._onerror(new Error(`Failed to enqueue error response: ${l}`))):o?.send(p).catch(l=>this._onerror(new Error(`Failed to send an error response: ${l}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(t.id,s);let a=lv(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,o?.sessionId):void 0,u={signal:s.signal,sessionId:o?.sessionId,_meta:t.params?._meta,sendNotification:async p=>{if(s.signal.aborted)return;let l={relatedRequestId:t.id};i&&(l.relatedTask={taskId:i}),await this.notification(p,l)},sendRequest:async(p,l,d)=>{if(s.signal.aborted)throw new O(L.ConnectionClosed,"Request was cancelled");let f={...d,relatedRequestId:t.id};i&&!f.relatedTask&&(f.relatedTask={taskId:i});let h=f.relatedTask?.taskId??i;return h&&c&&await c.updateTaskStatus(h,"input_required"),await this.request(p,l,f)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:i,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,u)).then(async p=>{if(s.signal.aborted)return;let l={result:p,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:l,timestamp:Date.now()},o?.sessionId):await o?.send(l)},async p=>{if(s.signal.aborted)return;let l={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(p.code)?p.code:L.InternalError,message:p.message??"Internal error",...p.data!==void 0&&{data:p.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:l,timestamp:Date.now()},o?.sessionId):await o?.send(l)}).catch(p=>this._onerror(new Error(`Failed to send response: ${p}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,o=Number(r),i=this._progressHandlers.get(o);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let s=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(c);return}i(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Ri(t))n(t);else{let s=new O(t.error.code,t.error.message,t.error.data);n(s)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let i=!1;if(Ri(t)&&t.result&&typeof t.result=="object"){let s=t.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(i=!0,this._taskProgressTokens.set(a.taskId,r))}}if(i||this._progressHandlers.delete(r),Ri(t))o(t);else{let s=O.fromError(t.error.code,t.error.message,t.error.data);o(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(t,r,n)}}catch(s){yield{type:"error",error:s instanceof O?s:new O(L.InternalError,String(s))}}return}let i;try{let s=await this.request(t,$o,n);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new O(L.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:a},en(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)}:a.status==="failed"?yield{type:"error",error:new O(L.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new O(L.InternalError,`Task ${i} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof O?s:new O(L.InternalError,String(s))}}}request(t,r,n){let{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s,task:a,relatedTask:c}=n??{};return new Promise((u,p)=>{let l=v=>{p(v)};if(!this._transport){l(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(v){l(v);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...t,jsonrpc:"2.0",id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...t.params,_meta:{...t.params?._meta||{},progressToken:d}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Xr]:c}});let h=v=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(v)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(C=>this._onerror(new Error(`Failed to send cancellation: ${C}`)));let k=v instanceof O?v:new O(L.RequestTimeout,String(v));p(k)};this._responseHandlers.set(d,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return p(v);try{let k=Yr(r,v.result);k.success?u(k.data):p(k.error)}catch(k){p(k)}}}),n?.signal?.addEventListener("abort",()=>{h(n?.signal?.reason)});let g=n?.timeout??yR,y=()=>h(O.fromError(L.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(d,g,n?.maxTotalTimeout,y,n?.resetTimeoutOnProgress??!1);let b=c?.taskId;if(b){let v=k=>{let C=this._responseHandlers.get(d);C?C(k):this._onerror(new Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,v),this._enqueueTaskMessage(b,{type:"request",message:f,timestamp:Date.now()}).catch(k=>{this._cleanupTimeout(d),p(k)})}else this._transport.send(f,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(v=>{this._cleanupTimeout(d),p(v)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},Ea,r)}async getTaskResult(t,r,n){return this.request({method:"tasks/result",params:t},r,n)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},Ra,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},yv,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let n=r?.relatedTask?.taskId;if(n){let a={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[Xr]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Xr]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Xr]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(t,r){let n=hf(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,i)=>{let s=mf(t,o);return Promise.resolve(r(s,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let n=hf(t);this._notificationHandlers.set(n,o=>{let i=mf(t,o);return Promise.resolve(r(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n,o)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let o of n)if(o.type==="request"&&_d(o.message)){let i=o.message.id,s=this._requestResolvers.get(i);s?(s(new O(L.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(t);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,i)=>{if(r.aborted){i(new O(L.InvalidRequest,"Request cancelled"));return}let s=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(s),i(new O(L.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!t)throw new Error("No request provided");return await n.createTask(o,t.id,{method:t.method,params:t.params},r)},getTask:async o=>{let i=await n.getTask(o,r);if(!i)throw new O(L.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(o,i,s)=>{await n.storeTaskResult(o,i,s,r);let a=await n.getTask(o,r);if(a){let c=ji.parse({method:"notifications/tasks/status",params:a});await this.notification(c),en(a.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,i,s)=>{let a=await n.getTask(o,r);if(!a)throw new O(L.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(en(a.status))throw new O(L.InvalidParams,`Cannot update task "${o}" from terminal status "${a.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,i,s,r);let c=await n.getTask(o,r);if(c){let u=ji.parse({method:"notifications/tasks/status",params:c});await this.notification(u),en(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}}});var Bi=S(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.regexpCode=ue.getEsmExportName=ue.getProperty=ue.safeStringify=ue.stringify=ue.strConcat=ue.addCodeArg=ue.str=ue._=ue.nil=ue._Code=ue.Name=ue.IDENTIFIER=ue._CodeOrName=void 0;var Fi=class{};ue._CodeOrName=Fi;ue.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Fn=class extends Fi{constructor(t){if(super(),!ue.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ue.Name=Fn;var Lt=class extends Fi{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof Fn&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ue._Code=Lt;ue.nil=new Lt("");function u0(e,...t){let r=[e[0]],n=0;for(;n<t.length;)_f(r,t[n]),r.push(e[++n]);return new Lt(r)}ue._=u0;var yf=new Lt("+");function l0(e,...t){let r=[Ui(e[0])],n=0;for(;n<t.length;)r.push(yf),_f(r,t[n]),r.push(yf,Ui(e[++n]));return _R(r),new Lt(r)}ue.str=l0;function _f(e,t){t instanceof Lt?e.push(...t._items):t instanceof Fn?e.push(t):e.push(xR(t))}ue.addCodeArg=_f;function _R(e){let t=1;for(;t<e.length-1;){if(e[t]===yf){let r=vR(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function vR(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Fn||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Fn))return`"${e}${t.slice(1)}`}function bR(e,t){return t.emptyStr()?e:e.emptyStr()?t:l0`${e}${t}`}ue.strConcat=bR;function xR(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ui(Array.isArray(e)?e.join(","):e)}function wR(e){return new Lt(Ui(e))}ue.stringify=wR;function Ui(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ue.safeStringify=Ui;function kR(e){return typeof e=="string"&&ue.IDENTIFIER.test(e)?new Lt(`.${e}`):u0`[${e}]`}ue.getProperty=kR;function SR(e){if(typeof e=="string"&&ue.IDENTIFIER.test(e))return new Lt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}ue.getEsmExportName=SR;function $R(e){return new Lt(e.toString())}ue.regexpCode=$R});var xf=S(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.ValueScope=bt.ValueScopeName=bt.Scope=bt.varKinds=bt.UsedValueState=void 0;var vt=Bi(),vf=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},ec;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(ec||(bt.UsedValueState=ec={}));bt.varKinds={const:new vt.Name("const"),let:new vt.Name("let"),var:new vt.Name("var")};var tc=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof vt.Name?t:this.name(t)}name(t){return new vt.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};bt.Scope=tc;var rc=class extends vt.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,vt._)`.${new vt.Name(r)}[${n}]`}};bt.ValueScopeName=rc;var TR=(0,vt._)`\n`,bf=class extends tc{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?TR:vt.nil}}get(){return this._scope}name(t){return new rc(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:i}=o,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let p=a.get(s);if(p)return p}else a=this._values[i]=new Map;a.set(s,o);let c=this._scope[i]||(this._scope[i]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:i,itemIndex:u}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,vt._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let i=vt.nil;for(let s in t){let a=t[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,ec.Started);let p=r(u);if(p){let l=this.opts.es5?bt.varKinds.var:bt.varKinds.const;i=(0,vt._)`${i}${l} ${u} = ${p};${this.opts._n}`}else if(p=o?.(u))i=(0,vt._)`${i}${p}${this.opts._n}`;else throw new vf(u);c.set(u,ec.Completed)})}return i}};bt.ValueScope=bf});var K=S(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.or=Q.and=Q.not=Q.CodeGen=Q.operators=Q.varKinds=Q.ValueScopeName=Q.ValueScope=Q.Scope=Q.Name=Q.regexpCode=Q.stringify=Q.getProperty=Q.nil=Q.strConcat=Q.str=Q._=void 0;var ae=Bi(),Qt=xf(),rn=Bi();Object.defineProperty(Q,"_",{enumerable:!0,get:function(){return rn._}});Object.defineProperty(Q,"str",{enumerable:!0,get:function(){return rn.str}});Object.defineProperty(Q,"strConcat",{enumerable:!0,get:function(){return rn.strConcat}});Object.defineProperty(Q,"nil",{enumerable:!0,get:function(){return rn.nil}});Object.defineProperty(Q,"getProperty",{enumerable:!0,get:function(){return rn.getProperty}});Object.defineProperty(Q,"stringify",{enumerable:!0,get:function(){return rn.stringify}});Object.defineProperty(Q,"regexpCode",{enumerable:!0,get:function(){return rn.regexpCode}});Object.defineProperty(Q,"Name",{enumerable:!0,get:function(){return rn.Name}});var sc=xf();Object.defineProperty(Q,"Scope",{enumerable:!0,get:function(){return sc.Scope}});Object.defineProperty(Q,"ValueScope",{enumerable:!0,get:function(){return sc.ValueScope}});Object.defineProperty(Q,"ValueScopeName",{enumerable:!0,get:function(){return sc.ValueScopeName}});Object.defineProperty(Q,"varKinds",{enumerable:!0,get:function(){return sc.varKinds}});Q.operators={GT:new ae._Code(">"),GTE:new ae._Code(">="),LT:new ae._Code("<"),LTE:new ae._Code("<="),EQ:new ae._Code("==="),NEQ:new ae._Code("!=="),NOT:new ae._Code("!"),OR:new ae._Code("||"),AND:new ae._Code("&&"),ADD:new ae._Code("+")};var Cr=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},wf=class extends Cr{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Qt.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Eo(this.rhs,t,r)),this}get names(){return this.rhs instanceof ae._CodeOrName?this.rhs.names:{}}},nc=class extends Cr{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof ae.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Eo(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ae.Name?{}:{...this.lhs.names};return ic(t,this.rhs)}},kf=class extends nc{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},Sf=class extends Cr{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},$f=class extends Cr{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Tf=class extends Cr{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Pf=class extends Cr{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Eo(this.code,t,r),this}get names(){return this.code instanceof ae._CodeOrName?this.code.names:{}}},Vi=class extends Cr{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let i=n[o];i.optimizeNames(t,r)||(PR(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Vn(t,r.names),{})}},Er=class extends Vi{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Cf=class extends Vi{},Co=class extends Er{};Co.kind="else";var Un=class e extends Er{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Co(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(p0(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Eo(this.condition,t,r),this}get names(){let t=super.names;return ic(t,this.condition),this.else&&Vn(t,this.else.names),t}};Un.kind="if";var Bn=class extends Er{};Bn.kind="for";var Ef=class extends Bn{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Eo(this.iteration,t,r),this}get names(){return Vn(super.names,this.iteration.names)}},If=class extends Bn{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Qt.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return`for(${r} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=ic(super.names,this.from);return ic(t,this.to)}},oc=class extends Bn{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Eo(this.iterable,t,r),this}get names(){return Vn(super.names,this.iterable.names)}},Hi=class extends Er{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Hi.kind="func";var Gi=class extends Vi{render(t){return"return "+super.render(t)}};Gi.kind="return";var zf=class extends Er{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Vn(t,this.catch.names),this.finally&&Vn(t,this.finally.names),t}},Wi=class extends Er{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Wi.kind="catch";var Ki=class extends Er{render(t){return"finally"+super.render(t)}};Ki.kind="finally";var Rf=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
33
|
-
`:""},this._extScope=t,this._scope=new Qt.Scope({parent:t}),this._nodes=[new Cf]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new wf(t,i,n)),i}const(t,r,n){return this._def(Qt.varKinds.const,t,r,n)}let(t,r,n){return this._def(Qt.varKinds.let,t,r,n)}var(t,r,n){return this._def(Qt.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new nc(t,r,n))}add(t,r){return this._leafNode(new kf(t,Q.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ae.nil&&this._leafNode(new Pf(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,ae.addCodeArg)(r,o));return r.push("}"),new ae._Code(r)}if(t,r,n){if(this._blockNode(new Un(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Un(t))}else(){return this._elseNode(new Co)}endIf(){return this._endBlockNode(Un,Co)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Ef(t),r)}forRange(t,r,n,o,i=this.opts.es5?Qt.varKinds.var:Qt.varKinds.let){let s=this._scope.toName(t);return this._for(new If(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Qt.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof ae.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ae._)`${s}.length`,a=>{this.var(i,(0,ae._)`${s}[${a}]`),n(i)})}return this._for(new oc("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Qt.varKinds.var:Qt.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ae._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new oc("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(Bn)}label(t){return this._leafNode(new Sf(t))}break(t){return this._leafNode(new $f(t))}return(t){let r=new Gi;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Gi)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new zf;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Wi(i),r(i)}return n&&(this._currNode=o.finally=new Ki,this.code(n)),this._endBlockNode(Wi,Ki)}throw(t){return this._leafNode(new Tf(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=ae.nil,n,o){return this._blockNode(new Hi(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Hi)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof Un))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};Q.CodeGen=Rf;function Vn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function ic(e,t){return t instanceof ae._CodeOrName?Vn(e,t.names):e}function Eo(e,t,r){if(e instanceof ae.Name)return n(e);if(!o(e))return e;return new ae._Code(e._items.reduce((i,s)=>(s instanceof ae.Name&&(s=n(s)),s instanceof ae._Code?i.push(...s._items):i.push(s),i),[]));function n(i){let s=r[i.str];return s===void 0||t[i.str]!==1?i:(delete t[i.str],s)}function o(i){return i instanceof ae._Code&&i._items.some(s=>s instanceof ae.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function PR(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function p0(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ae._)`!${Af(e)}`}Q.not=p0;var CR=d0(Q.operators.AND);function ER(...e){return e.reduce(CR)}Q.and=ER;var IR=d0(Q.operators.OR);function zR(...e){return e.reduce(IR)}Q.or=zR;function d0(e){return(t,r)=>t===ae.nil?r:r===ae.nil?t:(0,ae._)`${Af(t)} ${e} ${Af(r)}`}function Af(e){return e instanceof ae.Name?e:(0,ae._)`(${e})`}});var le=S(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.checkStrictMode=X.getErrorPath=X.Type=X.useFunc=X.setEvaluated=X.evaluatedPropsToName=X.mergeEvaluated=X.eachItem=X.unescapeJsonPointer=X.escapeJsonPointer=X.escapeFragment=X.unescapeFragment=X.schemaRefOrVal=X.schemaHasRulesButRef=X.schemaHasRules=X.checkUnknownRules=X.alwaysValidSchema=X.toHash=void 0;var _e=K(),RR=Bi();function AR(e){let t={};for(let r of e)t[r]=!0;return t}X.toHash=AR;function OR(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(m0(e,t),!g0(t,e.self.RULES.all))}X.alwaysValidSchema=OR;function m0(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let i in t)o[i]||v0(e,`unknown keyword: "${i}"`)}X.checkUnknownRules=m0;function g0(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}X.schemaHasRules=g0;function NR(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}X.schemaHasRulesButRef=NR;function DR({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,_e._)`${r}`}return(0,_e._)`${e}${t}${(0,_e.getProperty)(n)}`}X.schemaRefOrVal=DR;function jR(e){return y0(decodeURIComponent(e))}X.unescapeFragment=jR;function MR(e){return encodeURIComponent(Nf(e))}X.escapeFragment=MR;function Nf(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}X.escapeJsonPointer=Nf;function y0(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}X.unescapeJsonPointer=y0;function LR(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}X.eachItem=LR;function f0({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof _e.Name?(i instanceof _e.Name?e(o,i,s):t(o,i,s),s):i instanceof _e.Name?(t(o,s,i),i):r(i,s);return a===_e.Name&&!(c instanceof _e.Name)?n(o,c):c}}X.mergeEvaluated={props:f0({mergeNames:(e,t,r)=>e.if((0,_e._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,_e._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,_e._)`${r} || {}`).code((0,_e._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,_e._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,_e._)`${r} || {}`),Df(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:_0}),items:f0({mergeNames:(e,t,r)=>e.if((0,_e._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,_e._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,_e._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,_e._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function _0(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,_e._)`{}`);return t!==void 0&&Df(e,r,t),r}X.evaluatedPropsToName=_0;function Df(e,t,r){Object.keys(r).forEach(n=>e.assign((0,_e._)`${t}${(0,_e.getProperty)(n)}`,!0))}X.setEvaluated=Df;var h0={};function ZR(e,t){return e.scopeValue("func",{ref:t,code:h0[t.code]||(h0[t.code]=new RR._Code(t.code))})}X.useFunc=ZR;var Of;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Of||(X.Type=Of={}));function qR(e,t,r){if(e instanceof _e.Name){let n=t===Of.Num;return r?n?(0,_e._)`"[" + ${e} + "]"`:(0,_e._)`"['" + ${e} + "']"`:n?(0,_e._)`"/" + ${e}`:(0,_e._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,_e.getProperty)(e).toString():"/"+Nf(e)}X.getErrorPath=qR;function v0(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}X.checkStrictMode=v0});var Ir=S(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});var et=K(),FR={data:new et.Name("data"),valCxt:new et.Name("valCxt"),instancePath:new et.Name("instancePath"),parentData:new et.Name("parentData"),parentDataProperty:new et.Name("parentDataProperty"),rootData:new et.Name("rootData"),dynamicAnchors:new et.Name("dynamicAnchors"),vErrors:new et.Name("vErrors"),errors:new et.Name("errors"),this:new et.Name("this"),self:new et.Name("self"),scope:new et.Name("scope"),json:new et.Name("json"),jsonPos:new et.Name("jsonPos"),jsonLen:new et.Name("jsonLen"),jsonPart:new et.Name("jsonPart")};jf.default=FR});var Ji=S(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.extendErrors=tt.resetErrorsCount=tt.reportExtraError=tt.reportError=tt.keyword$DataError=tt.keywordError=void 0;var ce=K(),ac=le(),lt=Ir();tt.keywordError={message:({keyword:e})=>(0,ce.str)`must pass "${e}" keyword validation`};tt.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ce.str)`"${e}" keyword must be ${t} ($data)`:(0,ce.str)`"${e}" keyword is invalid ($data)`};function UR(e,t=tt.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=w0(e,t,r);n??(s||a)?b0(i,c):x0(o,(0,ce._)`[${c}]`)}tt.reportError=UR;function BR(e,t=tt.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=w0(e,t,r);b0(o,a),i||s||x0(n,lt.default.vErrors)}tt.reportExtraError=BR;function VR(e,t){e.assign(lt.default.errors,t),e.if((0,ce._)`${lt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ce._)`${lt.default.vErrors}.length`,t),()=>e.assign(lt.default.vErrors,null)))}tt.resetErrorsCount=VR;function HR({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",o,lt.default.errors,a=>{e.const(s,(0,ce._)`${lt.default.vErrors}[${a}]`),e.if((0,ce._)`${s}.instancePath === undefined`,()=>e.assign((0,ce._)`${s}.instancePath`,(0,ce.strConcat)(lt.default.instancePath,i.errorPath))),e.assign((0,ce._)`${s}.schemaPath`,(0,ce.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,ce._)`${s}.schema`,r),e.assign((0,ce._)`${s}.data`,n))})}tt.extendErrors=HR;function b0(e,t){let r=e.const("err",t);e.if((0,ce._)`${lt.default.vErrors} === null`,()=>e.assign(lt.default.vErrors,(0,ce._)`[${r}]`),(0,ce._)`${lt.default.vErrors}.push(${r})`),e.code((0,ce._)`${lt.default.errors}++`)}function x0(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,ce._)`new ${e.ValidationError}(${t})`):(r.assign((0,ce._)`${n}.errors`,t),r.return(!1))}var Hn={keyword:new ce.Name("keyword"),schemaPath:new ce.Name("schemaPath"),params:new ce.Name("params"),propertyName:new ce.Name("propertyName"),message:new ce.Name("message"),schema:new ce.Name("schema"),parentSchema:new ce.Name("parentSchema")};function w0(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ce._)`{}`:GR(e,t,r)}function GR(e,t,r={}){let{gen:n,it:o}=e,i=[WR(o,r),KR(e,r)];return JR(e,t,i),n.object(...i)}function WR({errorPath:e},{instancePath:t}){let r=t?(0,ce.str)`${e}${(0,ac.getErrorPath)(t,ac.Type.Str)}`:e;return[lt.default.instancePath,(0,ce.strConcat)(lt.default.instancePath,r)]}function KR({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,ce.str)`${t}/${e}`;return r&&(o=(0,ce.str)`${o}${(0,ac.getErrorPath)(r,ac.Type.Str)}`),[Hn.schemaPath,o]}function JR(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:c,propertyName:u,topSchemaRef:p,schemaPath:l}=a;n.push([Hn.keyword,o],[Hn.params,typeof t=="function"?t(e):t||(0,ce._)`{}`]),c.messages&&n.push([Hn.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Hn.schema,s],[Hn.parentSchema,(0,ce._)`${p}${l}`],[lt.default.data,i]),u&&n.push([Hn.propertyName,u])}});var S0=S(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.boolOrEmptySchema=Io.topBoolOrEmptySchema=void 0;var YR=Ji(),QR=K(),XR=Ir(),eA={message:"boolean schema is false"};function tA(e){let{gen:t,schema:r,validateName:n}=e;r===!1?k0(e,!1):typeof r=="object"&&r.$async===!0?t.return(XR.default.data):(t.assign((0,QR._)`${n}.errors`,null),t.return(!0))}Io.topBoolOrEmptySchema=tA;function rA(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),k0(e)):r.var(t,!0)}Io.boolOrEmptySchema=rA;function k0(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,YR.reportError)(o,eA,void 0,t)}});var Mf=S(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.getRules=zo.isJSONType=void 0;var nA=["string","number","integer","boolean","null","object","array"],oA=new Set(nA);function iA(e){return typeof e=="string"&&oA.has(e)}zo.isJSONType=iA;function sA(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}zo.getRules=sA});var Lf=S(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.shouldUseRule=nn.shouldUseGroup=nn.schemaHasRulesForType=void 0;function aA({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&$0(e,n)}nn.schemaHasRulesForType=aA;function $0(e,t){return t.rules.some(r=>T0(e,r))}nn.shouldUseGroup=$0;function T0(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}nn.shouldUseRule=T0});var Yi=S(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.reportTypeError=rt.checkDataTypes=rt.checkDataType=rt.coerceAndCheckDataType=rt.getJSONTypes=rt.getSchemaTypes=rt.DataType=void 0;var cA=Mf(),uA=Lf(),lA=Ji(),G=K(),P0=le(),Ro;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ro||(rt.DataType=Ro={}));function pA(e){let t=C0(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}rt.getSchemaTypes=pA;function C0(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(cA.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}rt.getJSONTypes=C0;function dA(e,t){let{gen:r,data:n,opts:o}=e,i=fA(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,uA.schemaHasRulesForType)(e,t[0]));if(s){let a=qf(t,n,o.strictNumbers,Ro.Wrong);r.if(a,()=>{i.length?hA(e,t,i):Ff(e)})}return s}rt.coerceAndCheckDataType=dA;var E0=new Set(["string","number","integer","boolean","null"]);function fA(e,t){return t?e.filter(r=>E0.has(r)||t==="array"&&r==="array"):[]}function hA(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,G._)`typeof ${o}`),a=n.let("coerced",(0,G._)`undefined`);i.coerceTypes==="array"&&n.if((0,G._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,G._)`${o}[0]`).assign(s,(0,G._)`typeof ${o}`).if(qf(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,G._)`${a} !== undefined`);for(let u of r)(E0.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);n.else(),Ff(e),n.endIf(),n.if((0,G._)`${a} !== undefined`,()=>{n.assign(o,a),mA(e,a)});function c(u){switch(u){case"string":n.elseIf((0,G._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,G._)`"" + ${o}`).elseIf((0,G._)`${o} === null`).assign(a,(0,G._)`""`);return;case"number":n.elseIf((0,G._)`${s} == "boolean" || ${o} === null
|
|
34
|
-
|| (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,
|
|
35
|
-
|| (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,
|
|
36
|
-
|| ${s} === "boolean" || ${o} === null`).assign(a,(0,G._)`[${o}]`)}}}function mA({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,G._)`${t} !== undefined`,()=>e.assign((0,G._)`${t}[${r}]`,n))}function Zf(e,t,r,n=Ro.Correct){let o=n===Ro.Correct?G.operators.EQ:G.operators.NEQ,i;switch(e){case"null":return(0,G._)`${t} ${o} null`;case"array":i=(0,G._)`Array.isArray(${t})`;break;case"object":i=(0,G._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,G._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,G._)`typeof ${t} ${o} ${e}`}return n===Ro.Correct?i:(0,G.not)(i);function s(a=G.nil){return(0,G.and)((0,G._)`typeof ${t} == "number"`,a,r?(0,G._)`isFinite(${t})`:G.nil)}}rt.checkDataType=Zf;function qf(e,t,r,n){if(e.length===1)return Zf(e[0],t,r,n);let o,i=(0,P0.toHash)(e);if(i.array&&i.object){let s=(0,G._)`typeof ${t} != "object"`;o=i.null?s:(0,G._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=G.nil;i.number&&delete i.integer;for(let s in i)o=(0,G.and)(o,Zf(s,t,r,n));return o}rt.checkDataTypes=qf;var gA={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,G._)`{type: ${e}}`:(0,G._)`{type: ${t}}`};function Ff(e){let t=yA(e);(0,lA.reportError)(t,gA)}rt.reportTypeError=Ff;function yA(e){let{gen:t,data:r,schema:n}=e,o=(0,P0.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var z0=S(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.assignDefaults=void 0;var Ao=K(),_A=le();function vA(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)I0(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>I0(e,i,o.default))}cc.assignDefaults=vA;function I0(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,Ao._)`${i}${(0,Ao.getProperty)(t)}`;if(o){(0,_A.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,Ao._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Ao._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Ao._)`${a} = ${(0,Ao.stringify)(r)}`)}});var Zt=S(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.validateUnion=ge.validateArray=ge.usePattern=ge.callValidateCode=ge.schemaProperties=ge.allSchemaProperties=ge.noPropertyInData=ge.propertyInData=ge.isOwnProperty=ge.hasPropFunc=ge.reportMissingProp=ge.checkMissingProp=ge.checkReportMissingProp=void 0;var ke=K(),Uf=le(),on=Ir(),bA=le();function xA(e,t){let{gen:r,data:n,it:o}=e;r.if(Vf(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,ke._)`${t}`},!0),e.error()})}ge.checkReportMissingProp=xA;function wA({gen:e,data:t,it:{opts:r}},n,o){return(0,ke.or)(...n.map(i=>(0,ke.and)(Vf(e,t,i,r.ownProperties),(0,ke._)`${o} = ${i}`)))}ge.checkMissingProp=wA;function kA(e,t){e.setParams({missingProperty:t},!0),e.error()}ge.reportMissingProp=kA;function R0(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ke._)`Object.prototype.hasOwnProperty`})}ge.hasPropFunc=R0;function Bf(e,t,r){return(0,ke._)`${R0(e)}.call(${t}, ${r})`}ge.isOwnProperty=Bf;function SA(e,t,r,n){let o=(0,ke._)`${t}${(0,ke.getProperty)(r)} !== undefined`;return n?(0,ke._)`${o} && ${Bf(e,t,r)}`:o}ge.propertyInData=SA;function Vf(e,t,r,n){let o=(0,ke._)`${t}${(0,ke.getProperty)(r)} === undefined`;return n?(0,ke.or)(o,(0,ke.not)(Bf(e,t,r))):o}ge.noPropertyInData=Vf;function A0(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ge.allSchemaProperties=A0;function $A(e,t){return A0(t).filter(r=>!(0,Uf.alwaysValidSchema)(e,t[r]))}ge.schemaProperties=$A;function TA({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){let p=u?(0,ke._)`${e}, ${t}, ${n}${o}`:t,l=[[on.default.instancePath,(0,ke.strConcat)(on.default.instancePath,i)],[on.default.parentData,s.parentData],[on.default.parentDataProperty,s.parentDataProperty],[on.default.rootData,on.default.rootData]];s.opts.dynamicRef&&l.push([on.default.dynamicAnchors,on.default.dynamicAnchors]);let d=(0,ke._)`${p}, ${r.object(...l)}`;return c!==ke.nil?(0,ke._)`${a}.call(${c}, ${d})`:(0,ke._)`${a}(${d})`}ge.callValidateCode=TA;var PA=(0,ke._)`new RegExp`;function CA({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ke._)`${o.code==="new RegExp"?PA:(0,bA.useFunc)(e,o)}(${r}, ${n})`})}ge.usePattern=CA;function EA(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){let c=t.const("len",(0,ke._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Uf.Type.Num},i),t.if((0,ke.not)(i),a)})}}ge.validateArray=EA;function IA(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Uf.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let p=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);t.assign(s,(0,ke._)`${s} || ${a}`),e.mergeValidEvaluated(p,a)||t.if((0,ke.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ge.validateUnion=IA});var D0=S(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.validateKeywordUsage=fr.validSchemaType=fr.funcKeywordCode=fr.macroKeywordCode=void 0;var pt=K(),Gn=Ir(),zA=Zt(),RA=Ji();function AA(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=N0(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:pt.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}fr.macroKeywordCode=AA;function OA(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;DA(c,t);let u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,p=N0(n,o,u),l=n.let("valid");e.block$data(l,d),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function d(){if(t.errors===!1)g(),t.modifying&&O0(e),y(()=>e.error());else{let b=t.async?f():h();t.modifying&&O0(e),y(()=>NA(e,b))}}function f(){let b=n.let("ruleErrs",null);return n.try(()=>g((0,pt._)`await `),v=>n.assign(l,!1).if((0,pt._)`${v} instanceof ${c.ValidationError}`,()=>n.assign(b,(0,pt._)`${v}.errors`),()=>n.throw(v))),b}function h(){let b=(0,pt._)`${p}.errors`;return n.assign(b,null),g(pt.nil),b}function g(b=t.async?(0,pt._)`await `:pt.nil){let v=c.opts.passContext?Gn.default.this:Gn.default.self,k=!("compile"in t&&!a||t.schema===!1);n.assign(l,(0,pt._)`${b}${(0,zA.callValidateCode)(e,p,v,k)}`,t.modifying)}function y(b){var v;n.if((0,pt.not)((v=t.valid)!==null&&v!==void 0?v:l),b)}}fr.funcKeywordCode=OA;function O0(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,pt._)`${n.parentData}[${n.parentDataProperty}]`))}function NA(e,t){let{gen:r}=e;r.if((0,pt._)`Array.isArray(${t})`,()=>{r.assign(Gn.default.vErrors,(0,pt._)`${Gn.default.vErrors} === null ? ${t} : ${Gn.default.vErrors}.concat(${t})`).assign(Gn.default.errors,(0,pt._)`${Gn.default.vErrors}.length`),(0,RA.extendErrors)(e)},()=>e.error())}function DA({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function N0(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,pt.stringify)(r)})}function jA(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}fr.validSchemaType=jA;function MA({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let s=o.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}fr.validateKeywordUsage=MA});var M0=S(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.extendSubschemaMode=sn.extendSubschemaData=sn.getSubschema=void 0;var hr=K(),j0=le();function LA(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,hr._)`${e.schemaPath}${(0,hr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,hr._)`${e.schemaPath}${(0,hr.getProperty)(t)}${(0,hr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,j0.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}sn.getSubschema=LA;function ZA(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:p,opts:l}=t,d=a.let("data",(0,hr._)`${t.data}${(0,hr.getProperty)(r)}`,!0);c(d),e.errorPath=(0,hr.str)`${u}${(0,j0.getErrorPath)(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=(0,hr._)`${r}`,e.dataPathArr=[...p,e.parentDataProperty]}if(o!==void 0){let u=o instanceof hr.Name?o:a.let("data",o,!0);c(u),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}sn.extendSubschemaData=ZA;function qA(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}sn.extendSubschemaMode=qA});var Hf=S((PU,L0)=>{"use strict";L0.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var q0=S((CU,Z0)=>{"use strict";var an=Z0.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};uc(t,n,o,e,"",e)};an.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};an.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};an.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};an.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 uc(e,t,r,n,o,i,s,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,c,u);for(var p in n){var l=n[p];if(Array.isArray(l)){if(p in an.arrayKeywords)for(var d=0;d<l.length;d++)uc(e,t,r,l[d],o+"/"+p+"/"+d,i,o,p,n,d)}else if(p in an.propsKeywords){if(l&&typeof l=="object")for(var f in l)uc(e,t,r,l[f],o+"/"+p+"/"+FA(f),i,o,p,n,f)}else(p in an.keywords||e.allKeys&&!(p in an.skipKeywords))&&uc(e,t,r,l,o+"/"+p,i,o,p,n)}r(n,o,i,s,a,c,u)}}function FA(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Qi=S(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.getSchemaRefs=xt.resolveUrl=xt.normalizeId=xt._getFullPath=xt.getFullPath=xt.inlineRef=void 0;var UA=le(),BA=Hf(),VA=q0(),HA=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function GA(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Gf(e):t?F0(e)<=t:!1}xt.inlineRef=GA;var WA=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Gf(e){for(let t in e){if(WA.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Gf)||typeof r=="object"&&Gf(r))return!0}return!1}function F0(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!HA.has(r)&&(typeof e[r]=="object"&&(0,UA.eachItem)(e[r],n=>t+=F0(n)),t===1/0))return 1/0}return t}function U0(e,t="",r){r!==!1&&(t=Oo(t));let n=e.parse(t);return B0(e,n)}xt.getFullPath=U0;function B0(e,t){return e.serialize(t).split("#")[0]+"#"}xt._getFullPath=B0;var KA=/#\/?$/;function Oo(e){return e?e.replace(KA,""):""}xt.normalizeId=Oo;function JA(e,t,r){return r=Oo(r),e.resolve(t,r)}xt.resolveUrl=JA;var YA=/^[a-z_][-a-z0-9._]*$/i;function QA(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Oo(e[r]||t),i={"":o},s=U0(n,o,!1),a={},c=new Set;return VA(e,{allKeys:!0},(l,d,f,h)=>{if(h===void 0)return;let g=s+d,y=i[h];typeof l[r]=="string"&&(y=b.call(this,l[r])),v.call(this,l.$anchor),v.call(this,l.$dynamicAnchor),i[d]=y;function b(k){let C=this.opts.uriResolver.resolve;if(k=Oo(y?C(y,k):k),c.has(k))throw p(k);c.add(k);let T=this.refs[k];return typeof T=="string"&&(T=this.refs[T]),typeof T=="object"?u(l,T.schema,k):k!==Oo(g)&&(k[0]==="#"?(u(l,a[k],k),a[k]=l):this.refs[k]=g),k}function v(k){if(typeof k=="string"){if(!YA.test(k))throw new Error(`invalid anchor "${k}"`);b.call(this,`#${k}`)}}}),a;function u(l,d,f){if(d!==void 0&&!BA(l,d))throw p(f)}function p(l){return new Error(`reference "${l}" resolves to more than one schema`)}}xt.getSchemaRefs=QA});var ts=S(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.getData=cn.KeywordCxt=cn.validateFunctionCode=void 0;var K0=S0(),V0=Yi(),Kf=Lf(),lc=Yi(),XA=z0(),es=D0(),Wf=M0(),D=K(),B=Ir(),eO=Qi(),zr=le(),Xi=Ji();function tO(e){if(Q0(e)&&(X0(e),Y0(e))){oO(e);return}J0(e,()=>(0,K0.topBoolOrEmptySchema)(e))}cn.validateFunctionCode=tO;function J0({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,D._)`${B.default.data}, ${B.default.valCxt}`,n.$async,()=>{e.code((0,D._)`"use strict"; ${H0(r,o)}`),nO(e,o),e.code(i)}):e.func(t,(0,D._)`${B.default.data}, ${rO(o)}`,n.$async,()=>e.code(H0(r,o)).code(i))}function rO(e){return(0,D._)`{${B.default.instancePath}="", ${B.default.parentData}, ${B.default.parentDataProperty}, ${B.default.rootData}=${B.default.data}${e.dynamicRef?(0,D._)`, ${B.default.dynamicAnchors}={}`:D.nil}}={}`}function nO(e,t){e.if(B.default.valCxt,()=>{e.var(B.default.instancePath,(0,D._)`${B.default.valCxt}.${B.default.instancePath}`),e.var(B.default.parentData,(0,D._)`${B.default.valCxt}.${B.default.parentData}`),e.var(B.default.parentDataProperty,(0,D._)`${B.default.valCxt}.${B.default.parentDataProperty}`),e.var(B.default.rootData,(0,D._)`${B.default.valCxt}.${B.default.rootData}`),t.dynamicRef&&e.var(B.default.dynamicAnchors,(0,D._)`${B.default.valCxt}.${B.default.dynamicAnchors}`)},()=>{e.var(B.default.instancePath,(0,D._)`""`),e.var(B.default.parentData,(0,D._)`undefined`),e.var(B.default.parentDataProperty,(0,D._)`undefined`),e.var(B.default.rootData,B.default.data),t.dynamicRef&&e.var(B.default.dynamicAnchors,(0,D._)`{}`)})}function oO(e){let{schema:t,opts:r,gen:n}=e;J0(e,()=>{r.$comment&&t.$comment&&tb(e),uO(e),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated&&iO(e),eb(e),dO(e)})}function iO(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,D._)`${r}.evaluated`),t.if((0,D._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,D._)`${e.evaluated}.props`,(0,D._)`undefined`)),t.if((0,D._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,D._)`${e.evaluated}.items`,(0,D._)`undefined`))}function H0(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,D._)`/*# sourceURL=${r} */`:D.nil}function sO(e,t){if(Q0(e)&&(X0(e),Y0(e))){aO(e,t);return}(0,K0.boolOrEmptySchema)(e,t)}function Y0({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Q0(e){return typeof e.schema!="boolean"}function aO(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&tb(e),lO(e),pO(e);let i=n.const("_errs",B.default.errors);eb(e,i),n.var(t,(0,D._)`${i} === ${B.default.errors}`)}function X0(e){(0,zr.checkUnknownRules)(e),cO(e)}function eb(e,t){if(e.opts.jtd)return G0(e,[],!1,t);let r=(0,V0.getSchemaTypes)(e.schema),n=(0,V0.coerceAndCheckDataType)(e,r);G0(e,r,!n,t)}function cO(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,zr.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function uO(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,zr.checkStrictMode)(e,"default is ignored in the schema root")}function lO(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,eO.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function pO(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function tb({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,D._)`${B.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=(0,D.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,D._)`${B.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function dO(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,D._)`${B.default.errors} === 0`,()=>t.return(B.default.data),()=>t.throw((0,D._)`new ${o}(${B.default.vErrors})`)):(t.assign((0,D._)`${n}.errors`,B.default.vErrors),i.unevaluated&&fO(e),t.return((0,D._)`${B.default.errors} === 0`))}function fO({gen:e,evaluated:t,props:r,items:n}){r instanceof D.Name&&e.assign((0,D._)`${t}.props`,r),n instanceof D.Name&&e.assign((0,D._)`${t}.items`,n)}function G0(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:c,self:u}=e,{RULES:p}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,zr.schemaHasRulesButRef)(i,p))){o.block(()=>nb(e,"$ref",p.all.$ref.definition));return}c.jtd||hO(e,t),o.block(()=>{for(let d of p.rules)l(d);l(p.post)});function l(d){(0,Kf.shouldUseGroup)(i,d)&&(d.type?(o.if((0,lc.checkDataType)(d.type,s,c.strictNumbers)),W0(e,d),t.length===1&&t[0]===d.type&&r&&(o.else(),(0,lc.reportTypeError)(e)),o.endIf()):W0(e,d),a||o.if((0,D._)`${B.default.errors} === ${n||0}`))}}function W0(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,XA.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,Kf.shouldUseRule)(n,i)&&nb(e,i.keyword,i.definition,t.type)})}function hO(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(mO(e,t),e.opts.allowUnionTypes||gO(e,t),yO(e,e.dataTypes))}function mO(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{rb(e.dataTypes,r)||Jf(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),vO(e,t)}}function gO(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Jf(e,"use allowUnionTypes to allow union type keyword")}function yO(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Kf.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>_O(t,s))&&Jf(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function _O(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function rb(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function vO(e,t){let r=[];for(let n of e.dataTypes)rb(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Jf(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,zr.checkStrictMode)(e,t,e.opts.strictTypes)}var pc=class{constructor(t,r,n){if((0,es.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,zr.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",ob(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,es.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",B.default.errors))}result(t,r,n){this.failResult((0,D.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,D.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,D._)`${r} !== undefined && (${(0,D.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Xi.reportExtraError:Xi.reportError)(this,this.def.error,r)}$dataError(){(0,Xi.reportError)(this,this.def.$dataError||Xi.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Xi.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=D.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=D.nil,r=D.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,D.or)((0,D._)`${o} === undefined`,r)),t!==D.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==D.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,D.or)(s(),a());function s(){if(n.length){if(!(r instanceof D.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,D._)`${(0,lc.checkDataTypes)(c,r,i.opts.strictNumbers,lc.DataType.Wrong)}`}return D.nil}function a(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,D._)`!${c}(${r})`}return D.nil}}subschema(t,r){let n=(0,Wf.getSubschema)(this.it,t);(0,Wf.extendSubschemaData)(n,this.it,t),(0,Wf.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return sO(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=zr.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=zr.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,D.Name)),!0}};cn.KeywordCxt=pc;function nb(e,t,r,n){let o=new pc(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,es.funcKeywordCode)(o,r):"macro"in r?(0,es.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,es.funcKeywordCode)(o,r)}var bO=/^\/(?:[^~]|~0|~1)*$/,xO=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ob(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return B.default.rootData;if(e[0]==="/"){if(!bO.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=B.default.rootData}else{let u=xO.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let p=+u[1];if(o=u[2],o==="#"){if(p>=t)throw new Error(c("property/index",p));return n[t-p]}if(p>t)throw new Error(c("data",p));if(i=r[t-p],!o)return i}let s=i,a=o.split("/");for(let u of a)u&&(i=(0,D._)`${i}${(0,D.getProperty)((0,zr.unescapeJsonPointer)(u))}`,s=(0,D._)`${s} && ${i}`);return s;function c(u,p){return`Cannot access ${u} ${p} levels up, current level is ${t}`}}cn.getData=ob});var dc=S(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});var Yf=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Qf.default=Yf});var rs=S(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});var Xf=Qi(),eh=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Xf.resolveUrl)(t,r,n),this.missingSchema=(0,Xf.normalizeId)((0,Xf.getFullPath)(t,this.missingRef))}};th.default=eh});var hc=S(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.resolveSchema=qt.getCompilingSchema=qt.resolveRef=qt.compileSchema=qt.SchemaEnv=void 0;var Xt=K(),wO=dc(),Wn=Ir(),er=Qi(),ib=le(),kO=ts(),No=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,er.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};qt.SchemaEnv=No;function nh(e){let t=sb.call(this,e);if(t)return t;let r=(0,er.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new Xt.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:wO.default,code:(0,Xt._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");e.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:Wn.default.data,parentData:Wn.default.parentData,parentDataProperty:Wn.default.parentDataProperty,dataNames:[Wn.default.data],dataPathArr:[Xt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Xt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Xt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Xt._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(e),(0,kO.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let l=s.toString();p=`${s.scopeRefs(Wn.default.scope)}return ${l}`,this.opts.code.process&&(p=this.opts.code.process(p,e));let f=new Function(`${Wn.default.self}`,`${Wn.default.scope}`,p)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:l,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:g}=u;f.evaluated={props:h instanceof Xt.Name?void 0:h,items:g instanceof Xt.Name?void 0:g,dynamicProps:h instanceof Xt.Name,dynamicItems:g instanceof Xt.Name},f.source&&(f.source.evaluated=(0,Xt.stringify)(f.evaluated))}return e.validate=f,e}catch(l){throw delete e.validate,delete e.validateName,p&&this.logger.error("Error compiling schema, function code:",p),l}finally{this._compilations.delete(e)}}qt.compileSchema=nh;function SO(e,t,r){var n;r=(0,er.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=PO.call(this,e,r);if(i===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(i=new No({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=$O.call(this,i)}qt.resolveRef=SO;function $O(e){return(0,er.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:nh.call(this,e)}function sb(e){for(let t of this._compilations)if(TO(t,e))return t}qt.getCompilingSchema=sb;function TO(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function PO(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||fc.call(this,e,t)}function fc(e,t){let r=this.opts.uriResolver.parse(t),n=(0,er._getFullPath)(this.opts.uriResolver,r),o=(0,er.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return rh.call(this,r,e);let i=(0,er.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=fc.call(this,e,s);return typeof a?.schema!="object"?void 0:rh.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||nh.call(this,s),i===(0,er.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,er.resolveUrl)(this.opts.uriResolver,o,u)),new No({schema:a,schemaId:c,root:e,baseId:o})}return rh.call(this,r,s)}}qt.resolveSchema=fc;var CO=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function rh(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,ib.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!CO.has(a)&&u&&(t=(0,er.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,ib.schemaHasRulesButRef)(r,this.RULES)){let a=(0,er.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=fc.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new No({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var ab=S((OU,EO)=>{EO.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var ih=S((NU,pb)=>{"use strict";var IO=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),ub=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function oh(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var zO=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function cb(e){return e.length=0,!0}function RO(e,t,r){if(e.length){let n=oh(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function AO(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=RO;for(let c=0;c<e.length;c++){let u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(s=!0),!a(o,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(i=!0),n.push(":");continue}else if(u==="%"){if(!a(o,n,r))break;a=cb}else{o.push(u);continue}}return o.length&&(a===cb?r.zone=o.join(""):s?n.push(o.join("")):n.push(oh(o))),r.address=n.join(""),r}function lb(e){if(OO(e,":")<2)return{host:e,isIPV6:!1};let t=AO(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function OO(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function NO(e){let t=e,r=[],n=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(o===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function DO(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function jO(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!ub(r)){let n=lb(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}pb.exports={nonSimpleDomain:zO,recomposeAuthority:jO,normalizeComponentEncoding:DO,removeDotSegments:NO,isIPv4:ub,isUUID:IO,normalizeIPv6:lb,stringArrayToHexStripped:oh}});var gb=S((DU,mb)=>{"use strict";var{isUUID:MO}=ih(),LO=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,ZO=["http","https","ws","wss","urn","urn:uuid"];function qO(e){return ZO.indexOf(e)!==-1}function sh(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function db(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function fb(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function FO(e){return e.secure=sh(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function UO(e){if((e.port===(sh(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function BO(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(LO);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,i=ah(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function VO(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=ah(o);i&&(e=i.serialize(e,t));let s=e,a=e.nss;return s.path=`${n||t.nid}:${a}`,t.skipEscape=!0,s}function HO(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!MO(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function GO(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var hb={scheme:"http",domainHost:!0,parse:db,serialize:fb},WO={scheme:"https",domainHost:hb.domainHost,parse:db,serialize:fb},mc={scheme:"ws",domainHost:!0,parse:FO,serialize:UO},KO={scheme:"wss",domainHost:mc.domainHost,parse:mc.parse,serialize:mc.serialize},JO={scheme:"urn",parse:BO,serialize:VO,skipNormalize:!0},YO={scheme:"urn:uuid",parse:HO,serialize:GO,skipNormalize:!0},gc={http:hb,https:WO,ws:mc,wss:KO,urn:JO,"urn:uuid":YO};Object.setPrototypeOf(gc,null);function ah(e){return e&&(gc[e]||gc[e.toLowerCase()])||void 0}mb.exports={wsIsSecure:sh,SCHEMES:gc,isValidSchemeName:qO,getSchemeHandler:ah}});var vb=S((jU,_c)=>{"use strict";var{normalizeIPv6:QO,removeDotSegments:ns,recomposeAuthority:XO,normalizeComponentEncoding:yc,isIPv4:eN,nonSimpleDomain:tN}=ih(),{SCHEMES:rN,getSchemeHandler:yb}=gb();function nN(e,t){return typeof e=="string"?e=mr(Rr(e,t),t):typeof e=="object"&&(e=Rr(mr(e,t),t)),e}function oN(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=_b(Rr(e,n),Rr(t,n),n,!0);return n.skipEscape=!0,mr(o,n)}function _b(e,t,r,n){let o={};return n||(e=Rr(mr(e,r),r),t=Rr(mr(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=ns(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=ns(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=ns(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=ns(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function iN(e,t,r){return typeof e=="string"?(e=unescape(e),e=mr(yc(Rr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=mr(yc(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=mr(yc(Rr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=mr(yc(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function mr(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=yb(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let s=XO(r);if(s!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(s),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=ns(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var sN=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Rr(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let i=e.match(sN);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(eN(n.host)===!1){let c=QO(n.host);n.host=c.host.toLowerCase(),o=c.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let s=yb(r.scheme||n.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&n.host&&(r.domainHost||s&&s.domainHost)&&o===!1&&tN(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!s||s&&!s.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),s&&s.parse&&s.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var ch={SCHEMES:rN,normalize:nN,resolve:oN,resolveComponent:_b,equal:iN,serialize:mr,parse:Rr};_c.exports=ch;_c.exports.default=ch;_c.exports.fastUri=ch});var xb=S(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});var bb=vb();bb.code='require("ajv/dist/runtime/uri").default';uh.default=bb});var Eb=S(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.CodeGen=Ge.Name=Ge.nil=Ge.stringify=Ge.str=Ge._=Ge.KeywordCxt=void 0;var aN=ts();Object.defineProperty(Ge,"KeywordCxt",{enumerable:!0,get:function(){return aN.KeywordCxt}});var Do=K();Object.defineProperty(Ge,"_",{enumerable:!0,get:function(){return Do._}});Object.defineProperty(Ge,"str",{enumerable:!0,get:function(){return Do.str}});Object.defineProperty(Ge,"stringify",{enumerable:!0,get:function(){return Do.stringify}});Object.defineProperty(Ge,"nil",{enumerable:!0,get:function(){return Do.nil}});Object.defineProperty(Ge,"Name",{enumerable:!0,get:function(){return Do.Name}});Object.defineProperty(Ge,"CodeGen",{enumerable:!0,get:function(){return Do.CodeGen}});var cN=dc(),Tb=rs(),uN=Mf(),os=hc(),lN=K(),is=Qi(),vc=Yi(),ph=le(),wb=ab(),pN=xb(),Pb=(e,t)=>new RegExp(e,t);Pb.code="new RegExp";var dN=["removeAdditional","useDefaults","coerceTypes"],fN=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),hN={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},mN={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},kb=200;function gN(e){var t,r,n,o,i,s,a,c,u,p,l,d,f,h,g,y,b,v,k,C,T,F,Y,Ie,ht;let we=e.strict,Qe=(t=e.code)===null||t===void 0?void 0:t.optimize,Rt=Qe===!0||Qe===void 0?1:Qe||0,li=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Pb,uo=(o=e.uriResolver)!==null&&o!==void 0?o:pN.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:we)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:we)!==null&&c!==void 0?c:!0,strictTypes:(p=(u=e.strictTypes)!==null&&u!==void 0?u:we)!==null&&p!==void 0?p:"log",strictTuples:(d=(l=e.strictTuples)!==null&&l!==void 0?l:we)!==null&&d!==void 0?d:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:we)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Rt,regExp:li}:{optimize:Rt,regExp:li},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:kb,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:kb,meta:(b=e.meta)!==null&&b!==void 0?b:!0,messages:(v=e.messages)!==null&&v!==void 0?v:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(C=e.schemaId)!==null&&C!==void 0?C:"$id",addUsedSchema:(T=e.addUsedSchema)!==null&&T!==void 0?T:!0,validateSchema:(F=e.validateSchema)!==null&&F!==void 0?F:!0,validateFormats:(Y=e.validateFormats)!==null&&Y!==void 0?Y:!0,unicodeRegExp:(Ie=e.unicodeRegExp)!==null&&Ie!==void 0?Ie:!0,int32range:(ht=e.int32range)!==null&&ht!==void 0?ht:!0,uriResolver:uo}}var ss=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...gN(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new lN.ValueScope({scope:{},prefixes:fN,es5:r,lines:n}),this.logger=wN(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,uN.getRules)(),Sb.call(this,hN,t,"NOT SUPPORTED"),Sb.call(this,mN,t,"DEPRECATED","warn"),this._metaOpts=bN.call(this),t.formats&&_N.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&vN.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),yN.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=wb;n==="id"&&(o={...wb},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(p,l){await i.call(this,p.$schema);let d=this._addSchema(p,l);return d.validate||s.call(this,d)}async function i(p){p&&!this.getSchema(p)&&await o.call(this,{$ref:p},!0)}async function s(p){try{return this._compileSchemaEnv(p)}catch(l){if(!(l instanceof Tb.default))throw l;return a.call(this,l),await c.call(this,l.missingSchema),s.call(this,p)}}function a({missingSchema:p,missingRef:l}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${l} cannot be resolved`)}async function c(p){let l=await u.call(this,p);this.refs[p]||await i.call(this,l.$schema),this.refs[p]||this.addSchema(l,p,r)}async function u(p){let l=this._loading[p];if(l)return l;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:s}=this.opts;if(i=t[s],i!==void 0&&typeof i!="string")throw new Error(`schema ${s} must be string`)}return r=(0,is.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=$b.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new os.SchemaEnv({schema:{},schemaId:n});if(r=os.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=$b.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,is.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(SN.call(this,n,r),!r)return(0,ph.eachItem)(n,i=>lh.call(this,i)),this;TN.call(this,r);let o={...r,type:(0,vc.getJSONTypes)(r.type),schemaType:(0,vc.getJSONTypes)(r.schemaType)};return(0,ph.eachItem)(n,o.type.length===0?i=>lh.call(this,i,o):i=>o.type.forEach(s=>lh.call(this,i,o,s))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),s=t;for(let a of i)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,p=s[a];u&&p&&(s[a]=Cb(p))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof t=="object")s=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,is.normalizeId)(s||n);let u=is.getSchemaRefs.call(this,t,n);return c=new os.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):os.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{os.compileSchema.call(this,t)}finally{this.opts=r}}};ss.ValidationError=cN.default;ss.MissingRefError=Tb.default;Ge.default=ss;function Sb(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function $b(e){return e=(0,is.normalizeId)(e),this.schemas[e]||this.refs[e]}function yN(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function _N(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function vN(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function bN(){let e={...this.opts};for(let t of dN)delete e[t];return e}var xN={log(){},warn(){},error(){}};function wN(e){if(e===!1)return xN;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var kN=/^[a-z_$][a-z0-9_$:-]*$/i;function SN(e,t){let{RULES:r}=this;if((0,ph.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!kN.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function lh(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=o?i.post:i.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,vc.getJSONTypes)(t.type),schemaType:(0,vc.getJSONTypes)(t.schemaType)}};t.before?$N.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function $N(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function TN(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=Cb(t)),e.validateSchema=this.compile(t,!0))}var PN={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Cb(e){return{anyOf:[e,PN]}}});var Ib=S(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var CN={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};dh.default=CN});var Ob=S(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.callRef=Kn.getValidate=void 0;var EN=rs(),zb=Zt(),wt=K(),jo=Ir(),Rb=hc(),bc=le(),IN={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:c}=n,{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return l();let p=Rb.resolveRef.call(c,u,o,r);if(p===void 0)throw new EN.default(n.opts.uriResolver,o,r);if(p instanceof Rb.SchemaEnv)return d(p);return f(p);function l(){if(i===u)return xc(e,s,i,i.$async);let h=t.scopeValue("root",{ref:u});return xc(e,(0,wt._)`${h}.validate`,u,u.$async)}function d(h){let g=Ab(e,h);xc(e,g,h,h.$async)}function f(h){let g=t.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,wt.stringify)(h)}:{ref:h}),y=t.name("valid"),b=e.subschema({schema:h,dataTypes:[],schemaPath:wt.nil,topSchemaRef:g,errSchemaPath:r},y);e.mergeEvaluated(b),e.ok(y)}}};function Ab(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,wt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Kn.getValidate=Ab;function xc(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?jo.default.this:wt.nil;n?p():l();function p(){if(!a.$async)throw new Error("async schema referenced by sync schema");let h=o.let("valid");o.try(()=>{o.code((0,wt._)`await ${(0,zb.callValidateCode)(e,t,u)}`),f(t),s||o.assign(h,!0)},g=>{o.if((0,wt._)`!(${g} instanceof ${i.ValidationError})`,()=>o.throw(g)),d(g),s||o.assign(h,!1)}),e.ok(h)}function l(){e.result((0,zb.callValidateCode)(e,t,u),()=>f(t),()=>d(t))}function d(h){let g=(0,wt._)`${h}.errors`;o.assign(jo.default.vErrors,(0,wt._)`${jo.default.vErrors} === null ? ${g} : ${jo.default.vErrors}.concat(${g})`),o.assign(jo.default.errors,(0,wt._)`${jo.default.vErrors}.length`)}function f(h){var g;if(!i.opts.unevaluated)return;let y=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(i.props=bc.mergeEvaluated.props(o,y.props,i.props));else{let b=o.var("props",(0,wt._)`${h}.evaluated.props`);i.props=bc.mergeEvaluated.props(o,b,i.props,wt.Name)}if(i.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(i.items=bc.mergeEvaluated.items(o,y.items,i.items));else{let b=o.var("items",(0,wt._)`${h}.evaluated.items`);i.items=bc.mergeEvaluated.items(o,b,i.items,wt.Name)}}}Kn.callRef=xc;Kn.default=IN});var Nb=S(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});var zN=Ib(),RN=Ob(),AN=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",zN.default,RN.default];fh.default=AN});var Db=S(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});var wc=K(),un=wc.operators,kc={maximum:{okStr:"<=",ok:un.LTE,fail:un.GT},minimum:{okStr:">=",ok:un.GTE,fail:un.LT},exclusiveMaximum:{okStr:"<",ok:un.LT,fail:un.GTE},exclusiveMinimum:{okStr:">",ok:un.GT,fail:un.LTE}},ON={message:({keyword:e,schemaCode:t})=>(0,wc.str)`must be ${kc[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,wc._)`{comparison: ${kc[e].okStr}, limit: ${t}}`},NN={keyword:Object.keys(kc),type:"number",schemaType:"number",$data:!0,error:ON,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,wc._)`${r} ${kc[t].fail} ${n} || isNaN(${r})`)}};hh.default=NN});var jb=S(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});var as=K(),DN={message:({schemaCode:e})=>(0,as.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,as._)`{multipleOf: ${e}}`},jN={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:DN,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,as._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,as._)`${s} !== parseInt(${s})`;e.fail$data((0,as._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};mh.default=jN});var Lb=S(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});function Mb(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}gh.default=Mb;Mb.code='require("ajv/dist/runtime/ucs2length").default'});var Zb=S(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});var Jn=K(),MN=le(),LN=Lb(),ZN={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Jn.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Jn._)`{limit: ${e}}`},qN={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:ZN,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?Jn.operators.GT:Jn.operators.LT,s=o.opts.unicode===!1?(0,Jn._)`${r}.length`:(0,Jn._)`${(0,MN.useFunc)(e.gen,LN.default)}(${r})`;e.fail$data((0,Jn._)`${s} ${i} ${n}`)}};yh.default=qN});var qb=S(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});var FN=Zt(),Sc=K(),UN={message:({schemaCode:e})=>(0,Sc.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Sc._)`{pattern: ${e}}`},BN={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:UN,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,s=i.opts.unicodeRegExp?"u":"",a=r?(0,Sc._)`(new RegExp(${o}, ${s}))`:(0,FN.usePattern)(e,n);e.fail$data((0,Sc._)`!${a}.test(${t})`)}};_h.default=BN});var Fb=S(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});var cs=K(),VN={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,cs.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,cs._)`{limit: ${e}}`},HN={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:VN,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?cs.operators.GT:cs.operators.LT;e.fail$data((0,cs._)`Object.keys(${r}).length ${o} ${n}`)}};vh.default=HN});var Ub=S(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});var us=Zt(),ls=K(),GN=le(),WN={message:({params:{missingProperty:e}})=>(0,ls.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,ls._)`{missingProperty: ${e}}`},KN={keyword:"required",type:"object",schemaType:"array",$data:!0,error:WN,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?u():p(),a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let g of r)if(f?.[g]===void 0&&!h.has(g)){let y=s.schemaEnv.baseId+s.errSchemaPath,b=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,GN.checkStrictMode)(s,b,s.opts.strictRequired)}}function u(){if(c||i)e.block$data(ls.nil,l);else for(let f of r)(0,us.checkReportMissingProp)(e,f)}function p(){let f=t.let("missing");if(c||i){let h=t.let("valid",!0);e.block$data(h,()=>d(f,h)),e.ok(h)}else t.if((0,us.checkMissingProp)(e,r,f)),(0,us.reportMissingProp)(e,f),t.else()}function l(){t.forOf("prop",n,f=>{e.setParams({missingProperty:f}),t.if((0,us.noPropertyInData)(t,o,f,a.ownProperties),()=>e.error())})}function d(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,(0,us.propertyInData)(t,o,f,a.ownProperties)),t.if((0,ls.not)(h),()=>{e.error(),t.break()})},ls.nil)}}};bh.default=KN});var Bb=S(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});var ps=K(),JN={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,ps.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,ps._)`{limit: ${e}}`},YN={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:JN,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?ps.operators.GT:ps.operators.LT;e.fail$data((0,ps._)`${r}.length ${o} ${n}`)}};xh.default=YN});var $c=S(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});var Vb=Hf();Vb.code='require("ajv/dist/runtime/equal").default';wh.default=Vb});var Hb=S(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});var kh=Yi(),We=K(),QN=le(),XN=$c(),e4={message:({params:{i:e,j:t}})=>(0,We.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,We._)`{i: ${e}, j: ${t}}`},t4={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:e4,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!n&&!o)return;let c=t.let("valid"),u=i.items?(0,kh.getSchemaTypes)(i.items):[];e.block$data(c,p,(0,We._)`${s} === false`),e.ok(c);function p(){let h=t.let("i",(0,We._)`${r}.length`),g=t.let("j");e.setParams({i:h,j:g}),t.assign(c,!0),t.if((0,We._)`${h} > 1`,()=>(l()?d:f)(h,g))}function l(){return u.length>0&&!u.some(h=>h==="object"||h==="array")}function d(h,g){let y=t.name("item"),b=(0,kh.checkDataTypes)(u,y,a.opts.strictNumbers,kh.DataType.Wrong),v=t.const("indices",(0,We._)`{}`);t.for((0,We._)`;${h}--;`,()=>{t.let(y,(0,We._)`${r}[${h}]`),t.if(b,(0,We._)`continue`),u.length>1&&t.if((0,We._)`typeof ${y} == "string"`,(0,We._)`${y} += "_"`),t.if((0,We._)`typeof ${v}[${y}] == "number"`,()=>{t.assign(g,(0,We._)`${v}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,We._)`${v}[${y}] = ${h}`)})}function f(h,g){let y=(0,QN.useFunc)(t,XN.default),b=t.name("outer");t.label(b).for((0,We._)`;${h}--;`,()=>t.for((0,We._)`${g} = ${h}; ${g}--;`,()=>t.if((0,We._)`${y}(${r}[${h}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(b)})))}}};Sh.default=t4});var Gb=S(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});var $h=K(),r4=le(),n4=$c(),o4={message:"must be equal to constant",params:({schemaCode:e})=>(0,$h._)`{allowedValue: ${e}}`},i4={keyword:"const",$data:!0,error:o4,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,$h._)`!${(0,r4.useFunc)(t,n4.default)}(${r}, ${o})`):e.fail((0,$h._)`${i} !== ${r}`)}};Th.default=i4});var Wb=S(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});var ds=K(),s4=le(),a4=$c(),c4={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ds._)`{allowedValues: ${e}}`},u4={keyword:"enum",schemaType:"array",$data:!0,error:c4,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=s.opts.loopEnum,c,u=()=>c??(c=(0,s4.useFunc)(t,a4.default)),p;if(a||n)p=t.let("valid"),e.block$data(p,l);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let f=t.const("vSchema",i);p=(0,ds.or)(...o.map((h,g)=>d(f,g)))}e.pass(p);function l(){t.assign(p,!1),t.forOf("v",i,f=>t.if((0,ds._)`${u()}(${r}, ${f})`,()=>t.assign(p,!0).break()))}function d(f,h){let g=o[h];return typeof g=="object"&&g!==null?(0,ds._)`${u()}(${r}, ${f}[${h}])`:(0,ds._)`${r} === ${g}`}}};Ph.default=u4});var Kb=S(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});var l4=Db(),p4=jb(),d4=Zb(),f4=qb(),h4=Fb(),m4=Ub(),g4=Bb(),y4=Hb(),_4=Gb(),v4=Wb(),b4=[l4.default,p4.default,d4.default,f4.default,h4.default,m4.default,g4.default,y4.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},_4.default,v4.default];Ch.default=b4});var Ih=S(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.validateAdditionalItems=void 0;var Yn=K(),Eh=le(),x4={message:({params:{len:e}})=>(0,Yn.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Yn._)`{limit: ${e}}`},w4={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:x4,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Eh.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Jb(e,n)}};function Jb(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,Yn._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Yn._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,Eh.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,Yn._)`${a} <= ${t.length}`);r.if((0,Yn.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,p=>{e.subschema({keyword:i,dataProp:p,dataPropType:Eh.Type.Num},u),s.allErrors||r.if((0,Yn.not)(u),()=>r.break())})}}fs.validateAdditionalItems=Jb;fs.default=w4});var zh=S(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.validateTuple=void 0;var Yb=K(),Tc=le(),k4=Zt(),S4={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return Qb(e,"additionalItems",t);r.items=!0,!(0,Tc.alwaysValidSchema)(r,t)&&e.ok((0,k4.validateArray)(e))}};function Qb(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;p(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Tc.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,Yb._)`${i}.length`);r.forEach((l,d)=>{(0,Tc.alwaysValidSchema)(a,l)||(n.if((0,Yb._)`${u} > ${d}`,()=>e.subschema({keyword:s,schemaProp:d,dataProp:d},c)),e.ok(c))});function p(l){let{opts:d,errSchemaPath:f}=a,h=r.length,g=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(d.strictTuples&&!g){let y=`"${s}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;(0,Tc.checkStrictMode)(a,y,d.strictTuples)}}}hs.validateTuple=Qb;hs.default=S4});var Xb=S(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});var $4=zh(),T4={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,$4.validateTuple)(e,"items")};Rh.default=T4});var tx=S(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});var ex=K(),P4=le(),C4=Zt(),E4=Ih(),I4={message:({params:{len:e}})=>(0,ex.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ex._)`{limit: ${e}}`},z4={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:I4,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,P4.alwaysValidSchema)(n,t)&&(o?(0,E4.validateAdditionalItems)(e,o):e.ok((0,C4.validateArray)(e)))}};Ah.default=z4});var rx=S(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});var Ft=K(),Pc=le(),R4={message:({params:{min:e,max:t}})=>t===void 0?(0,Ft.str)`must contain at least ${e} valid item(s)`:(0,Ft.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Ft._)`{minContains: ${e}}`:(0,Ft._)`{minContains: ${e}, maxContains: ${t}}`},A4={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:R4,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:c,maxContains:u}=n;i.opts.next?(s=c===void 0?1:c,a=u):s=1;let p=t.const("len",(0,Ft._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,Pc.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Pc.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Pc.alwaysValidSchema)(i,r)){let g=(0,Ft._)`${p} >= ${s}`;a!==void 0&&(g=(0,Ft._)`${g} && ${p} <= ${a}`),e.pass(g);return}i.items=!0;let l=t.name("valid");a===void 0&&s===1?f(l,()=>t.if(l,()=>t.break())):s===0?(t.let(l,!0),a!==void 0&&t.if((0,Ft._)`${o}.length > 0`,d)):(t.let(l,!1),d()),e.result(l,()=>e.reset());function d(){let g=t.name("_valid"),y=t.let("count",0);f(g,()=>t.if(g,()=>h(y)))}function f(g,y){t.forRange("i",0,p,b=>{e.subschema({keyword:"contains",dataProp:b,dataPropType:Pc.Type.Num,compositeRule:!0},g),y()})}function h(g){t.code((0,Ft._)`${g}++`),a===void 0?t.if((0,Ft._)`${g} >= ${s}`,()=>t.assign(l,!0).break()):(t.if((0,Ft._)`${g} > ${a}`,()=>t.assign(l,!1).break()),s===1?t.assign(l,!0):t.if((0,Ft._)`${g} >= ${s}`,()=>t.assign(l,!0)))}}};Oh.default=A4});var ix=S(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.validateSchemaDeps=gr.validatePropertyDeps=gr.error=void 0;var Nh=K(),O4=le(),ms=Zt();gr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Nh.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Nh._)`{property: ${e},
|
|
32
|
+
]`;continue}o+=n[c],n[c]==="\\"?i=!0:s&&n[c]==="]"?s=!1:!s&&n[c]==="["&&(s=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}var Hd,Jt,mR,Ka=_(()=>{tn();Jt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Hd===void 0&&(Hd=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Hd),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};mR=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function Ja(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===P.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,o)=>({...n,[o]:B(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",o]})??Ee(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:B(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===P.ZodString&&e.keyType._def.checks?.length){let{type:n,...o}=Wa(e.keyType._def,t);return{...r,propertyNames:o}}else{if(e.keyType?._def.typeName===P.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===P.ZodBranded&&e.keyType._def.type._def.typeName===P.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...o}=Ha(e.keyType._def,t);return{...r,propertyNames:o}}}return r}var Ya=_(()=>{mi();De();Ka();Ga();Mt()});function Zv(e,t){if(t.mapStrategy==="record")return Ja(e,t);let r=B(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Ee(t),n=B(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Ee(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var Wd=_(()=>{De();Ya();Mt()});function qv(e){let t=e.values,n=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),o=Array.from(new Set(n.map(i=>typeof i)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:n}}var Kd=_(()=>{});function Fv(e){return e.target==="openAi"?void 0:{not:Ee({...e,currentPath:[...e.currentPath,"not"]})}}var Jd=_(()=>{Mt()});function Uv(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Yd=_(()=>{});function Vv(e,t){if(t.target==="openApi3")return Bv(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in qi&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,i)=>{let s=qi[i._def.typeName];return s&&!o.includes(s)?[...o,s]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,i)=>{let s=typeof i._def.value;switch(s){case"string":case"number":case"boolean":return[...o,s];case"bigint":return[...o,"integer"];case"object":if(i._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(n.length===r.length){let o=n.filter((i,s,a)=>a.indexOf(i)===s);return{type:o.length>1?o:o[0],enum:r.reduce((i,s)=>i.includes(s._def.value)?i:[...i,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(i=>!n.includes(i))],[])};return Bv(e,t)}var qi,Bv,Qa=_(()=>{De();qi={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};Bv=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,o)=>B(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0}});function Hv(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:qi[e.innerType._def.typeName],nullable:!0}:{type:[qi[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let n=B(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=B(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var Qd=_(()=>{De();Qa()});function Gv(e,t){let r={type:"number"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"int":r.type="integer",Od(r,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?se(r,"minimum",n.value,n.message,t):se(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),se(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?se(r,"maximum",n.value,n.message,t):se(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),se(r,"maximum",n.value,n.message,t));break;case"multipleOf":se(r,"multipleOf",n.value,n.message,t);break}return r}var Xd=_(()=>{tn()});function Wv(e,t){let r=t.target==="openAi",n={type:"object",properties:{}},o=[],i=e.shape();for(let a in i){let c=i[a];if(c===void 0||c._def===void 0)continue;let u=_R(c);u&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);let p=B(c._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});p!==void 0&&(n.properties[a]=p,u||o.push(a))}o.length&&(n.required=o);let s=yR(e,t);return s!==void 0&&(n.additionalProperties=s),n}function yR(e,t){if(e.catchall._def.typeName!=="ZodNever")return B(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function _R(e){try{return e.isOptional()}catch{return!0}}var ef=_(()=>{De()});var Kv,tf=_(()=>{De();Mt();Kv=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return B(e.innerType._def,t);let r=B(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Ee(t)},r]}:Ee(t)}});var Jv,rf=_(()=>{De();Jv=(e,t)=>{if(t.pipeStrategy==="input")return B(e.in._def,t);if(t.pipeStrategy==="output")return B(e.out._def,t);let r=B(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=B(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}}});function Yv(e,t){return B(e.type._def,t)}var nf=_(()=>{De()});function Qv(e,t){let n={type:"array",uniqueItems:!0,items:B(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&se(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&se(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}var of=_(()=>{tn();De()});function Xv(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>B(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:B(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>B(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}var sf=_(()=>{De()});function e0(e){return{not:Ee(e)}}var af=_(()=>{Mt()});function t0(e){return Ee(e)}var cf=_(()=>{Mt()});var r0,uf=_(()=>{De();r0=(e,t)=>B(e.innerType._def,t)});var n0,lf=_(()=>{mi();Mt();Nd();Dd();jd();Ga();Md();Zd();qd();Fd();Ud();Bd();Vd();Wd();Kd();Jd();Yd();Qd();Xd();ef();tf();rf();nf();Ya();of();Ka();sf();af();Qa();cf();uf();n0=(e,t,r)=>{switch(t){case P.ZodString:return Wa(e,r);case P.ZodNumber:return Gv(e,r);case P.ZodObject:return Wv(e,r);case P.ZodBigInt:return zv(e,r);case P.ZodBoolean:return Rv();case P.ZodDate:return Ld(e,r);case P.ZodUndefined:return e0(r);case P.ZodNull:return Uv(r);case P.ZodArray:return Iv(e,r);case P.ZodUnion:case P.ZodDiscriminatedUnion:return Vv(e,r);case P.ZodIntersection:return jv(e,r);case P.ZodTuple:return Xv(e,r);case P.ZodRecord:return Ja(e,r);case P.ZodLiteral:return Mv(e,r);case P.ZodEnum:return Dv(e);case P.ZodNativeEnum:return qv(e);case P.ZodNullable:return Hv(e,r);case P.ZodOptional:return Kv(e,r);case P.ZodMap:return Zv(e,r);case P.ZodSet:return Qv(e,r);case P.ZodLazy:return()=>e.getter()._def;case P.ZodPromise:return Yv(e,r);case P.ZodNaN:case P.ZodNever:return Fv(r);case P.ZodEffects:return Nv(e,r);case P.ZodAny:return Ee(r);case P.ZodUnknown:return t0(r);case P.ZodDefault:return Ov(e,r);case P.ZodBranded:return Ha(e,r);case P.ZodReadonly:return r0(e,r);case P.ZodCatch:return Av(e,r);case P.ZodPipeline:return Jv(e,r);case P.ZodFunction:case P.ZodVoid:case P.ZodSymbol:return;default:return(n=>{})(t)}}});function B(e,t,r=!1){let n=t.seen.get(e);if(t.override){let a=t.override?.(e,t,n,r);if(a!==Pv)return a}if(n&&!r){let a=vR(n,t);if(a!==void 0)return a}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=n0(e,e.typeName,t),s=typeof i=="function"?B(i(),t):i;if(s&&bR(e,t,s),t.postProcess){let a=t.postProcess(s,e,t);return o.jsonSchema=s,a}return o.jsonSchema=s,s}var vR,bR,De=_(()=>{Ua();lf();Va();Mt();vR=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Ba(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Ee(t)):t.$refStrategy==="seen"?Ee(t):void 0}},bR=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r)});var o0=_(()=>{});var pf,df=_(()=>{De();Ad();Mt();pf=(e,t)=>{let r=Ev(t),n=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[u,p])=>({...c,[u]:B(p._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??Ee(r)}),{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=B(e._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??Ee(r),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(i.title=s),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=o===void 0?n?{...i,[r.definitionPath]:n}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:i}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a}});var i0=_(()=>{Ua();Ad();tn();Va();De();o0();Mt();Nd();Dd();jd();Ga();Md();Zd();qd();Fd();Ud();Bd();Vd();Wd();Kd();Jd();Yd();Qd();Xd();ef();tf();rf();nf();uf();Ya();of();Ka();sf();af();Qa();cf();lf();df();df()});function xR(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function ff(e,t){return Nt(e)?Yp(e,{target:xR(t?.target),io:t?.pipeStrategy??"input"}):pf(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function hf(e){let r=Qr(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=_a(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function mf(e,t){let r=Yr(e,t);if(!r.success)throw r.error;return r.data}var gf=_(()=>{ed();Ci();i0()});function s0(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function a0(e,t){let r={...e};for(let n in t){let o=n,i=t[o];if(i===void 0)continue;let s=r[o];s0(s)&&s0(i)?r[o]={...s,...i}:r[o]=i}return r}var wR,Xa,c0=_(()=>{Ci();Zi();$v();gf();wR=6e4,Xa=class{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler($a,r=>{this._oncancel(r)}),this.setNotificationHandler(Pa,r=>{this._onprogress(r)}),this.setRequestHandler(Ta,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Ca,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new O(L.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Ia,async(r,n)=>{let o=async()=>{let i=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(i,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,p=this._requestResolvers.get(u);if(p)if(this._requestResolvers.delete(u),a.type==="response")p(c);else{let l=c,d=new O(l.error.code,l.error.message,l.error.data);p(d)}else{let l=a.type==="response"?"Response":"Error";this._onerror(new Error(`${l} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(i,n.sessionId);if(!s)throw new O(L.InvalidParams,`Task not found: ${i}`);if(!en(s.status))return await this._waitForTaskUpdate(i,n.signal),await o();if(en(s.status)){let a=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...a,_meta:{...a._meta,[Xr]:{taskId:i}}}}return await o()};return await o()}),this.setRequestHandler(za,async(r,n)=>{try{let{tasks:o,nextCursor:i}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:i,_meta:{}}}catch(o){throw new O(L.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Aa,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new O(L.InvalidParams,`Task not found: ${r.params.taskId}`);if(en(o.status))throw new O(L.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new O(L.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(o){throw o instanceof O?o:new O(L.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,n,o,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:o})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),O.fromError(L.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=i=>{n?.(i),this._onerror(i)};let o=this._transport?.onmessage;this._transport.onmessage=(i,s)=>{o?.(i,s),Ri(i)||hv(i)?this._onresponse(i):_d(i)?this._onrequest(i,s):fv(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=O.fromError(L.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of t.values())n(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){let r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,r){let n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,o=this._transport,i=t.params?._meta?.[Xr]?.taskId;if(n===void 0){let p={jsonrpc:"2.0",id:t.id,error:{code:L.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:p,timestamp:Date.now()},o?.sessionId).catch(l=>this._onerror(new Error(`Failed to enqueue error response: ${l}`))):o?.send(p).catch(l=>this._onerror(new Error(`Failed to send an error response: ${l}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(t.id,s);let a=lv(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,o?.sessionId):void 0,u={signal:s.signal,sessionId:o?.sessionId,_meta:t.params?._meta,sendNotification:async p=>{if(s.signal.aborted)return;let l={relatedRequestId:t.id};i&&(l.relatedTask={taskId:i}),await this.notification(p,l)},sendRequest:async(p,l,d)=>{if(s.signal.aborted)throw new O(L.ConnectionClosed,"Request was cancelled");let f={...d,relatedRequestId:t.id};i&&!f.relatedTask&&(f.relatedTask={taskId:i});let h=f.relatedTask?.taskId??i;return h&&c&&await c.updateTaskStatus(h,"input_required"),await this.request(p,l,f)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:i,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,u)).then(async p=>{if(s.signal.aborted)return;let l={result:p,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:l,timestamp:Date.now()},o?.sessionId):await o?.send(l)},async p=>{if(s.signal.aborted)return;let l={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(p.code)?p.code:L.InternalError,message:p.message??"Internal error",...p.data!==void 0&&{data:p.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:l,timestamp:Date.now()},o?.sessionId):await o?.send(l)}).catch(p=>this._onerror(new Error(`Failed to send response: ${p}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,o=Number(r),i=this._progressHandlers.get(o);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let s=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(c);return}i(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Ri(t))n(t);else{let s=new O(t.error.code,t.error.message,t.error.data);n(s)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let i=!1;if(Ri(t)&&t.result&&typeof t.result=="object"){let s=t.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(i=!0,this._taskProgressTokens.set(a.taskId,r))}}if(i||this._progressHandlers.delete(r),Ri(t))o(t);else{let s=O.fromError(t.error.code,t.error.message,t.error.data);o(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(t,r,n)}}catch(s){yield{type:"error",error:s instanceof O?s:new O(L.InternalError,String(s))}}return}let i;try{let s=await this.request(t,$o,n);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new O(L.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:a},en(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)}:a.status==="failed"?yield{type:"error",error:new O(L.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new O(L.InternalError,`Task ${i} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof O?s:new O(L.InternalError,String(s))}}}request(t,r,n){let{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s,task:a,relatedTask:c}=n??{};return new Promise((u,p)=>{let l=v=>{p(v)};if(!this._transport){l(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(v){l(v);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...t,jsonrpc:"2.0",id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...t.params,_meta:{...t.params?._meta||{},progressToken:d}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Xr]:c}});let h=v=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(v)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(C=>this._onerror(new Error(`Failed to send cancellation: ${C}`)));let k=v instanceof O?v:new O(L.RequestTimeout,String(v));p(k)};this._responseHandlers.set(d,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return p(v);try{let k=Yr(r,v.result);k.success?u(k.data):p(k.error)}catch(k){p(k)}}}),n?.signal?.addEventListener("abort",()=>{h(n?.signal?.reason)});let g=n?.timeout??wR,y=()=>h(O.fromError(L.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(d,g,n?.maxTotalTimeout,y,n?.resetTimeoutOnProgress??!1);let b=c?.taskId;if(b){let v=k=>{let C=this._responseHandlers.get(d);C?C(k):this._onerror(new Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,v),this._enqueueTaskMessage(b,{type:"request",message:f,timestamp:Date.now()}).catch(k=>{this._cleanupTimeout(d),p(k)})}else this._transport.send(f,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(v=>{this._cleanupTimeout(d),p(v)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},Ea,r)}async getTaskResult(t,r,n){return this.request({method:"tasks/result",params:t},r,n)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},Ra,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},yv,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let n=r?.relatedTask?.taskId;if(n){let a={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[Xr]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Xr]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Xr]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(t,r){let n=hf(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,i)=>{let s=mf(t,o);return Promise.resolve(r(s,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let n=hf(t);this._notificationHandlers.set(n,o=>{let i=mf(t,o);return Promise.resolve(r(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n,o)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let o of n)if(o.type==="request"&&_d(o.message)){let i=o.message.id,s=this._requestResolvers.get(i);s?(s(new O(L.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(t);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,i)=>{if(r.aborted){i(new O(L.InvalidRequest,"Request cancelled"));return}let s=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(s),i(new O(L.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!t)throw new Error("No request provided");return await n.createTask(o,t.id,{method:t.method,params:t.params},r)},getTask:async o=>{let i=await n.getTask(o,r);if(!i)throw new O(L.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(o,i,s)=>{await n.storeTaskResult(o,i,s,r);let a=await n.getTask(o,r);if(a){let c=ji.parse({method:"notifications/tasks/status",params:a});await this.notification(c),en(a.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,i,s)=>{let a=await n.getTask(o,r);if(!a)throw new O(L.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(en(a.status))throw new O(L.InvalidParams,`Cannot update task "${o}" from terminal status "${a.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,i,s,r);let c=await n.getTask(o,r);if(c){let u=ji.parse({method:"notifications/tasks/status",params:c});await this.notification(u),en(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}}});var Bi=S(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.regexpCode=ue.getEsmExportName=ue.getProperty=ue.safeStringify=ue.stringify=ue.strConcat=ue.addCodeArg=ue.str=ue._=ue.nil=ue._Code=ue.Name=ue.IDENTIFIER=ue._CodeOrName=void 0;var Fi=class{};ue._CodeOrName=Fi;ue.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Fn=class extends Fi{constructor(t){if(super(),!ue.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ue.Name=Fn;var Lt=class extends Fi{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof Fn&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ue._Code=Lt;ue.nil=new Lt("");function u0(e,...t){let r=[e[0]],n=0;for(;n<t.length;)_f(r,t[n]),r.push(e[++n]);return new Lt(r)}ue._=u0;var yf=new Lt("+");function l0(e,...t){let r=[Ui(e[0])],n=0;for(;n<t.length;)r.push(yf),_f(r,t[n]),r.push(yf,Ui(e[++n]));return kR(r),new Lt(r)}ue.str=l0;function _f(e,t){t instanceof Lt?e.push(...t._items):t instanceof Fn?e.push(t):e.push(TR(t))}ue.addCodeArg=_f;function kR(e){let t=1;for(;t<e.length-1;){if(e[t]===yf){let r=SR(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function SR(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Fn||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Fn))return`"${e}${t.slice(1)}`}function $R(e,t){return t.emptyStr()?e:e.emptyStr()?t:l0`${e}${t}`}ue.strConcat=$R;function TR(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ui(Array.isArray(e)?e.join(","):e)}function PR(e){return new Lt(Ui(e))}ue.stringify=PR;function Ui(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ue.safeStringify=Ui;function CR(e){return typeof e=="string"&&ue.IDENTIFIER.test(e)?new Lt(`.${e}`):u0`[${e}]`}ue.getProperty=CR;function ER(e){if(typeof e=="string"&&ue.IDENTIFIER.test(e))return new Lt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}ue.getEsmExportName=ER;function IR(e){return new Lt(e.toString())}ue.regexpCode=IR});var xf=S(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.ValueScope=bt.ValueScopeName=bt.Scope=bt.varKinds=bt.UsedValueState=void 0;var vt=Bi(),vf=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},ec;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(ec||(bt.UsedValueState=ec={}));bt.varKinds={const:new vt.Name("const"),let:new vt.Name("let"),var:new vt.Name("var")};var tc=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof vt.Name?t:this.name(t)}name(t){return new vt.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};bt.Scope=tc;var rc=class extends vt.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,vt._)`.${new vt.Name(r)}[${n}]`}};bt.ValueScopeName=rc;var zR=(0,vt._)`\n`,bf=class extends tc{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?zR:vt.nil}}get(){return this._scope}name(t){return new rc(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:i}=o,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let p=a.get(s);if(p)return p}else a=this._values[i]=new Map;a.set(s,o);let c=this._scope[i]||(this._scope[i]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:i,itemIndex:u}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,vt._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let i=vt.nil;for(let s in t){let a=t[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,ec.Started);let p=r(u);if(p){let l=this.opts.es5?bt.varKinds.var:bt.varKinds.const;i=(0,vt._)`${i}${l} ${u} = ${p};${this.opts._n}`}else if(p=o?.(u))i=(0,vt._)`${i}${p}${this.opts._n}`;else throw new vf(u);c.set(u,ec.Completed)})}return i}};bt.ValueScope=bf});var Y=S(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.or=X.and=X.not=X.CodeGen=X.operators=X.varKinds=X.ValueScopeName=X.ValueScope=X.Scope=X.Name=X.regexpCode=X.stringify=X.getProperty=X.nil=X.strConcat=X.str=X._=void 0;var ae=Bi(),Qt=xf(),rn=Bi();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return rn._}});Object.defineProperty(X,"str",{enumerable:!0,get:function(){return rn.str}});Object.defineProperty(X,"strConcat",{enumerable:!0,get:function(){return rn.strConcat}});Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return rn.nil}});Object.defineProperty(X,"getProperty",{enumerable:!0,get:function(){return rn.getProperty}});Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return rn.stringify}});Object.defineProperty(X,"regexpCode",{enumerable:!0,get:function(){return rn.regexpCode}});Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return rn.Name}});var sc=xf();Object.defineProperty(X,"Scope",{enumerable:!0,get:function(){return sc.Scope}});Object.defineProperty(X,"ValueScope",{enumerable:!0,get:function(){return sc.ValueScope}});Object.defineProperty(X,"ValueScopeName",{enumerable:!0,get:function(){return sc.ValueScopeName}});Object.defineProperty(X,"varKinds",{enumerable:!0,get:function(){return sc.varKinds}});X.operators={GT:new ae._Code(">"),GTE:new ae._Code(">="),LT:new ae._Code("<"),LTE:new ae._Code("<="),EQ:new ae._Code("==="),NEQ:new ae._Code("!=="),NOT:new ae._Code("!"),OR:new ae._Code("||"),AND:new ae._Code("&&"),ADD:new ae._Code("+")};var Cr=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},wf=class extends Cr{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Qt.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Eo(this.rhs,t,r)),this}get names(){return this.rhs instanceof ae._CodeOrName?this.rhs.names:{}}},nc=class extends Cr{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof ae.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Eo(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ae.Name?{}:{...this.lhs.names};return ic(t,this.rhs)}},kf=class extends nc{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},Sf=class extends Cr{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},$f=class extends Cr{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Tf=class extends Cr{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Pf=class extends Cr{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Eo(this.code,t,r),this}get names(){return this.code instanceof ae._CodeOrName?this.code.names:{}}},Vi=class extends Cr{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let i=n[o];i.optimizeNames(t,r)||(RR(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Vn(t,r.names),{})}},Er=class extends Vi{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Cf=class extends Vi{},Co=class extends Er{};Co.kind="else";var Un=class e extends Er{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Co(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(p0(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Eo(this.condition,t,r),this}get names(){let t=super.names;return ic(t,this.condition),this.else&&Vn(t,this.else.names),t}};Un.kind="if";var Bn=class extends Er{};Bn.kind="for";var Ef=class extends Bn{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Eo(this.iteration,t,r),this}get names(){return Vn(super.names,this.iteration.names)}},If=class extends Bn{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Qt.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return`for(${r} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=ic(super.names,this.from);return ic(t,this.to)}},oc=class extends Bn{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Eo(this.iterable,t,r),this}get names(){return Vn(super.names,this.iterable.names)}},Hi=class extends Er{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Hi.kind="func";var Gi=class extends Vi{render(t){return"return "+super.render(t)}};Gi.kind="return";var zf=class extends Er{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Vn(t,this.catch.names),this.finally&&Vn(t,this.finally.names),t}},Wi=class extends Er{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Wi.kind="catch";var Ki=class extends Er{render(t){return"finally"+super.render(t)}};Ki.kind="finally";var Rf=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
33
|
+
`:""},this._extScope=t,this._scope=new Qt.Scope({parent:t}),this._nodes=[new Cf]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new wf(t,i,n)),i}const(t,r,n){return this._def(Qt.varKinds.const,t,r,n)}let(t,r,n){return this._def(Qt.varKinds.let,t,r,n)}var(t,r,n){return this._def(Qt.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new nc(t,r,n))}add(t,r){return this._leafNode(new kf(t,X.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ae.nil&&this._leafNode(new Pf(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,ae.addCodeArg)(r,o));return r.push("}"),new ae._Code(r)}if(t,r,n){if(this._blockNode(new Un(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Un(t))}else(){return this._elseNode(new Co)}endIf(){return this._endBlockNode(Un,Co)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Ef(t),r)}forRange(t,r,n,o,i=this.opts.es5?Qt.varKinds.var:Qt.varKinds.let){let s=this._scope.toName(t);return this._for(new If(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Qt.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof ae.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ae._)`${s}.length`,a=>{this.var(i,(0,ae._)`${s}[${a}]`),n(i)})}return this._for(new oc("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Qt.varKinds.var:Qt.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ae._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new oc("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(Bn)}label(t){return this._leafNode(new Sf(t))}break(t){return this._leafNode(new $f(t))}return(t){let r=new Gi;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Gi)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new zf;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Wi(i),r(i)}return n&&(this._currNode=o.finally=new Ki,this.code(n)),this._endBlockNode(Wi,Ki)}throw(t){return this._leafNode(new Tf(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=ae.nil,n,o){return this._blockNode(new Hi(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Hi)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof Un))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};X.CodeGen=Rf;function Vn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function ic(e,t){return t instanceof ae._CodeOrName?Vn(e,t.names):e}function Eo(e,t,r){if(e instanceof ae.Name)return n(e);if(!o(e))return e;return new ae._Code(e._items.reduce((i,s)=>(s instanceof ae.Name&&(s=n(s)),s instanceof ae._Code?i.push(...s._items):i.push(s),i),[]));function n(i){let s=r[i.str];return s===void 0||t[i.str]!==1?i:(delete t[i.str],s)}function o(i){return i instanceof ae._Code&&i._items.some(s=>s instanceof ae.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function RR(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function p0(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ae._)`!${Af(e)}`}X.not=p0;var AR=d0(X.operators.AND);function OR(...e){return e.reduce(AR)}X.and=OR;var NR=d0(X.operators.OR);function DR(...e){return e.reduce(NR)}X.or=DR;function d0(e){return(t,r)=>t===ae.nil?r:r===ae.nil?t:(0,ae._)`${Af(t)} ${e} ${Af(r)}`}function Af(e){return e instanceof ae.Name?e:(0,ae._)`(${e})`}});var le=S(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.checkStrictMode=ee.getErrorPath=ee.Type=ee.useFunc=ee.setEvaluated=ee.evaluatedPropsToName=ee.mergeEvaluated=ee.eachItem=ee.unescapeJsonPointer=ee.escapeJsonPointer=ee.escapeFragment=ee.unescapeFragment=ee.schemaRefOrVal=ee.schemaHasRulesButRef=ee.schemaHasRules=ee.checkUnknownRules=ee.alwaysValidSchema=ee.toHash=void 0;var _e=Y(),jR=Bi();function MR(e){let t={};for(let r of e)t[r]=!0;return t}ee.toHash=MR;function LR(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(m0(e,t),!g0(t,e.self.RULES.all))}ee.alwaysValidSchema=LR;function m0(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let i in t)o[i]||v0(e,`unknown keyword: "${i}"`)}ee.checkUnknownRules=m0;function g0(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}ee.schemaHasRules=g0;function ZR(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}ee.schemaHasRulesButRef=ZR;function qR({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,_e._)`${r}`}return(0,_e._)`${e}${t}${(0,_e.getProperty)(n)}`}ee.schemaRefOrVal=qR;function FR(e){return y0(decodeURIComponent(e))}ee.unescapeFragment=FR;function UR(e){return encodeURIComponent(Nf(e))}ee.escapeFragment=UR;function Nf(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ee.escapeJsonPointer=Nf;function y0(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ee.unescapeJsonPointer=y0;function BR(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}ee.eachItem=BR;function f0({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof _e.Name?(i instanceof _e.Name?e(o,i,s):t(o,i,s),s):i instanceof _e.Name?(t(o,s,i),i):r(i,s);return a===_e.Name&&!(c instanceof _e.Name)?n(o,c):c}}ee.mergeEvaluated={props:f0({mergeNames:(e,t,r)=>e.if((0,_e._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,_e._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,_e._)`${r} || {}`).code((0,_e._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,_e._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,_e._)`${r} || {}`),Df(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:_0}),items:f0({mergeNames:(e,t,r)=>e.if((0,_e._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,_e._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,_e._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,_e._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function _0(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,_e._)`{}`);return t!==void 0&&Df(e,r,t),r}ee.evaluatedPropsToName=_0;function Df(e,t,r){Object.keys(r).forEach(n=>e.assign((0,_e._)`${t}${(0,_e.getProperty)(n)}`,!0))}ee.setEvaluated=Df;var h0={};function VR(e,t){return e.scopeValue("func",{ref:t,code:h0[t.code]||(h0[t.code]=new jR._Code(t.code))})}ee.useFunc=VR;var Of;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Of||(ee.Type=Of={}));function HR(e,t,r){if(e instanceof _e.Name){let n=t===Of.Num;return r?n?(0,_e._)`"[" + ${e} + "]"`:(0,_e._)`"['" + ${e} + "']"`:n?(0,_e._)`"/" + ${e}`:(0,_e._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,_e.getProperty)(e).toString():"/"+Nf(e)}ee.getErrorPath=HR;function v0(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}ee.checkStrictMode=v0});var Ir=S(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});var et=Y(),GR={data:new et.Name("data"),valCxt:new et.Name("valCxt"),instancePath:new et.Name("instancePath"),parentData:new et.Name("parentData"),parentDataProperty:new et.Name("parentDataProperty"),rootData:new et.Name("rootData"),dynamicAnchors:new et.Name("dynamicAnchors"),vErrors:new et.Name("vErrors"),errors:new et.Name("errors"),this:new et.Name("this"),self:new et.Name("self"),scope:new et.Name("scope"),json:new et.Name("json"),jsonPos:new et.Name("jsonPos"),jsonLen:new et.Name("jsonLen"),jsonPart:new et.Name("jsonPart")};jf.default=GR});var Ji=S(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.extendErrors=tt.resetErrorsCount=tt.reportExtraError=tt.reportError=tt.keyword$DataError=tt.keywordError=void 0;var ce=Y(),ac=le(),lt=Ir();tt.keywordError={message:({keyword:e})=>(0,ce.str)`must pass "${e}" keyword validation`};tt.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ce.str)`"${e}" keyword must be ${t} ($data)`:(0,ce.str)`"${e}" keyword is invalid ($data)`};function WR(e,t=tt.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=w0(e,t,r);n??(s||a)?b0(i,c):x0(o,(0,ce._)`[${c}]`)}tt.reportError=WR;function KR(e,t=tt.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=w0(e,t,r);b0(o,a),i||s||x0(n,lt.default.vErrors)}tt.reportExtraError=KR;function JR(e,t){e.assign(lt.default.errors,t),e.if((0,ce._)`${lt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ce._)`${lt.default.vErrors}.length`,t),()=>e.assign(lt.default.vErrors,null)))}tt.resetErrorsCount=JR;function YR({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",o,lt.default.errors,a=>{e.const(s,(0,ce._)`${lt.default.vErrors}[${a}]`),e.if((0,ce._)`${s}.instancePath === undefined`,()=>e.assign((0,ce._)`${s}.instancePath`,(0,ce.strConcat)(lt.default.instancePath,i.errorPath))),e.assign((0,ce._)`${s}.schemaPath`,(0,ce.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,ce._)`${s}.schema`,r),e.assign((0,ce._)`${s}.data`,n))})}tt.extendErrors=YR;function b0(e,t){let r=e.const("err",t);e.if((0,ce._)`${lt.default.vErrors} === null`,()=>e.assign(lt.default.vErrors,(0,ce._)`[${r}]`),(0,ce._)`${lt.default.vErrors}.push(${r})`),e.code((0,ce._)`${lt.default.errors}++`)}function x0(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,ce._)`new ${e.ValidationError}(${t})`):(r.assign((0,ce._)`${n}.errors`,t),r.return(!1))}var Hn={keyword:new ce.Name("keyword"),schemaPath:new ce.Name("schemaPath"),params:new ce.Name("params"),propertyName:new ce.Name("propertyName"),message:new ce.Name("message"),schema:new ce.Name("schema"),parentSchema:new ce.Name("parentSchema")};function w0(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ce._)`{}`:QR(e,t,r)}function QR(e,t,r={}){let{gen:n,it:o}=e,i=[XR(o,r),eA(e,r)];return tA(e,t,i),n.object(...i)}function XR({errorPath:e},{instancePath:t}){let r=t?(0,ce.str)`${e}${(0,ac.getErrorPath)(t,ac.Type.Str)}`:e;return[lt.default.instancePath,(0,ce.strConcat)(lt.default.instancePath,r)]}function eA({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,ce.str)`${t}/${e}`;return r&&(o=(0,ce.str)`${o}${(0,ac.getErrorPath)(r,ac.Type.Str)}`),[Hn.schemaPath,o]}function tA(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:c,propertyName:u,topSchemaRef:p,schemaPath:l}=a;n.push([Hn.keyword,o],[Hn.params,typeof t=="function"?t(e):t||(0,ce._)`{}`]),c.messages&&n.push([Hn.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Hn.schema,s],[Hn.parentSchema,(0,ce._)`${p}${l}`],[lt.default.data,i]),u&&n.push([Hn.propertyName,u])}});var S0=S(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.boolOrEmptySchema=Io.topBoolOrEmptySchema=void 0;var rA=Ji(),nA=Y(),oA=Ir(),iA={message:"boolean schema is false"};function sA(e){let{gen:t,schema:r,validateName:n}=e;r===!1?k0(e,!1):typeof r=="object"&&r.$async===!0?t.return(oA.default.data):(t.assign((0,nA._)`${n}.errors`,null),t.return(!0))}Io.topBoolOrEmptySchema=sA;function aA(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),k0(e)):r.var(t,!0)}Io.boolOrEmptySchema=aA;function k0(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,rA.reportError)(o,iA,void 0,t)}});var Mf=S(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.getRules=zo.isJSONType=void 0;var cA=["string","number","integer","boolean","null","object","array"],uA=new Set(cA);function lA(e){return typeof e=="string"&&uA.has(e)}zo.isJSONType=lA;function pA(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}zo.getRules=pA});var Lf=S(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.shouldUseRule=nn.shouldUseGroup=nn.schemaHasRulesForType=void 0;function dA({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&$0(e,n)}nn.schemaHasRulesForType=dA;function $0(e,t){return t.rules.some(r=>T0(e,r))}nn.shouldUseGroup=$0;function T0(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}nn.shouldUseRule=T0});var Yi=S(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.reportTypeError=rt.checkDataTypes=rt.checkDataType=rt.coerceAndCheckDataType=rt.getJSONTypes=rt.getSchemaTypes=rt.DataType=void 0;var fA=Mf(),hA=Lf(),mA=Ji(),K=Y(),P0=le(),Ro;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ro||(rt.DataType=Ro={}));function gA(e){let t=C0(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}rt.getSchemaTypes=gA;function C0(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(fA.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}rt.getJSONTypes=C0;function yA(e,t){let{gen:r,data:n,opts:o}=e,i=_A(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,hA.schemaHasRulesForType)(e,t[0]));if(s){let a=qf(t,n,o.strictNumbers,Ro.Wrong);r.if(a,()=>{i.length?vA(e,t,i):Ff(e)})}return s}rt.coerceAndCheckDataType=yA;var E0=new Set(["string","number","integer","boolean","null"]);function _A(e,t){return t?e.filter(r=>E0.has(r)||t==="array"&&r==="array"):[]}function vA(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,K._)`typeof ${o}`),a=n.let("coerced",(0,K._)`undefined`);i.coerceTypes==="array"&&n.if((0,K._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,K._)`${o}[0]`).assign(s,(0,K._)`typeof ${o}`).if(qf(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,K._)`${a} !== undefined`);for(let u of r)(E0.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);n.else(),Ff(e),n.endIf(),n.if((0,K._)`${a} !== undefined`,()=>{n.assign(o,a),bA(e,a)});function c(u){switch(u){case"string":n.elseIf((0,K._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,K._)`"" + ${o}`).elseIf((0,K._)`${o} === null`).assign(a,(0,K._)`""`);return;case"number":n.elseIf((0,K._)`${s} == "boolean" || ${o} === null
|
|
34
|
+
|| (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,K._)`+${o}`);return;case"integer":n.elseIf((0,K._)`${s} === "boolean" || ${o} === null
|
|
35
|
+
|| (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,K._)`+${o}`);return;case"boolean":n.elseIf((0,K._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,K._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf((0,K._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf((0,K._)`${s} === "string" || ${s} === "number"
|
|
36
|
+
|| ${s} === "boolean" || ${o} === null`).assign(a,(0,K._)`[${o}]`)}}}function bA({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,K._)`${t} !== undefined`,()=>e.assign((0,K._)`${t}[${r}]`,n))}function Zf(e,t,r,n=Ro.Correct){let o=n===Ro.Correct?K.operators.EQ:K.operators.NEQ,i;switch(e){case"null":return(0,K._)`${t} ${o} null`;case"array":i=(0,K._)`Array.isArray(${t})`;break;case"object":i=(0,K._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,K._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,K._)`typeof ${t} ${o} ${e}`}return n===Ro.Correct?i:(0,K.not)(i);function s(a=K.nil){return(0,K.and)((0,K._)`typeof ${t} == "number"`,a,r?(0,K._)`isFinite(${t})`:K.nil)}}rt.checkDataType=Zf;function qf(e,t,r,n){if(e.length===1)return Zf(e[0],t,r,n);let o,i=(0,P0.toHash)(e);if(i.array&&i.object){let s=(0,K._)`typeof ${t} != "object"`;o=i.null?s:(0,K._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=K.nil;i.number&&delete i.integer;for(let s in i)o=(0,K.and)(o,Zf(s,t,r,n));return o}rt.checkDataTypes=qf;var xA={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,K._)`{type: ${e}}`:(0,K._)`{type: ${t}}`};function Ff(e){let t=wA(e);(0,mA.reportError)(t,xA)}rt.reportTypeError=Ff;function wA(e){let{gen:t,data:r,schema:n}=e,o=(0,P0.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var z0=S(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.assignDefaults=void 0;var Ao=Y(),kA=le();function SA(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)I0(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>I0(e,i,o.default))}cc.assignDefaults=SA;function I0(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,Ao._)`${i}${(0,Ao.getProperty)(t)}`;if(o){(0,kA.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,Ao._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Ao._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Ao._)`${a} = ${(0,Ao.stringify)(r)}`)}});var Zt=S(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.validateUnion=ge.validateArray=ge.usePattern=ge.callValidateCode=ge.schemaProperties=ge.allSchemaProperties=ge.noPropertyInData=ge.propertyInData=ge.isOwnProperty=ge.hasPropFunc=ge.reportMissingProp=ge.checkMissingProp=ge.checkReportMissingProp=void 0;var ke=Y(),Uf=le(),on=Ir(),$A=le();function TA(e,t){let{gen:r,data:n,it:o}=e;r.if(Vf(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,ke._)`${t}`},!0),e.error()})}ge.checkReportMissingProp=TA;function PA({gen:e,data:t,it:{opts:r}},n,o){return(0,ke.or)(...n.map(i=>(0,ke.and)(Vf(e,t,i,r.ownProperties),(0,ke._)`${o} = ${i}`)))}ge.checkMissingProp=PA;function CA(e,t){e.setParams({missingProperty:t},!0),e.error()}ge.reportMissingProp=CA;function R0(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ke._)`Object.prototype.hasOwnProperty`})}ge.hasPropFunc=R0;function Bf(e,t,r){return(0,ke._)`${R0(e)}.call(${t}, ${r})`}ge.isOwnProperty=Bf;function EA(e,t,r,n){let o=(0,ke._)`${t}${(0,ke.getProperty)(r)} !== undefined`;return n?(0,ke._)`${o} && ${Bf(e,t,r)}`:o}ge.propertyInData=EA;function Vf(e,t,r,n){let o=(0,ke._)`${t}${(0,ke.getProperty)(r)} === undefined`;return n?(0,ke.or)(o,(0,ke.not)(Bf(e,t,r))):o}ge.noPropertyInData=Vf;function A0(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ge.allSchemaProperties=A0;function IA(e,t){return A0(t).filter(r=>!(0,Uf.alwaysValidSchema)(e,t[r]))}ge.schemaProperties=IA;function zA({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){let p=u?(0,ke._)`${e}, ${t}, ${n}${o}`:t,l=[[on.default.instancePath,(0,ke.strConcat)(on.default.instancePath,i)],[on.default.parentData,s.parentData],[on.default.parentDataProperty,s.parentDataProperty],[on.default.rootData,on.default.rootData]];s.opts.dynamicRef&&l.push([on.default.dynamicAnchors,on.default.dynamicAnchors]);let d=(0,ke._)`${p}, ${r.object(...l)}`;return c!==ke.nil?(0,ke._)`${a}.call(${c}, ${d})`:(0,ke._)`${a}(${d})`}ge.callValidateCode=zA;var RA=(0,ke._)`new RegExp`;function AA({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ke._)`${o.code==="new RegExp"?RA:(0,$A.useFunc)(e,o)}(${r}, ${n})`})}ge.usePattern=AA;function OA(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){let c=t.const("len",(0,ke._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Uf.Type.Num},i),t.if((0,ke.not)(i),a)})}}ge.validateArray=OA;function NA(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Uf.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let p=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);t.assign(s,(0,ke._)`${s} || ${a}`),e.mergeValidEvaluated(p,a)||t.if((0,ke.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ge.validateUnion=NA});var D0=S(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.validateKeywordUsage=fr.validSchemaType=fr.funcKeywordCode=fr.macroKeywordCode=void 0;var pt=Y(),Gn=Ir(),DA=Zt(),jA=Ji();function MA(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=N0(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:pt.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}fr.macroKeywordCode=MA;function LA(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;qA(c,t);let u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,p=N0(n,o,u),l=n.let("valid");e.block$data(l,d),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function d(){if(t.errors===!1)g(),t.modifying&&O0(e),y(()=>e.error());else{let b=t.async?f():h();t.modifying&&O0(e),y(()=>ZA(e,b))}}function f(){let b=n.let("ruleErrs",null);return n.try(()=>g((0,pt._)`await `),v=>n.assign(l,!1).if((0,pt._)`${v} instanceof ${c.ValidationError}`,()=>n.assign(b,(0,pt._)`${v}.errors`),()=>n.throw(v))),b}function h(){let b=(0,pt._)`${p}.errors`;return n.assign(b,null),g(pt.nil),b}function g(b=t.async?(0,pt._)`await `:pt.nil){let v=c.opts.passContext?Gn.default.this:Gn.default.self,k=!("compile"in t&&!a||t.schema===!1);n.assign(l,(0,pt._)`${b}${(0,DA.callValidateCode)(e,p,v,k)}`,t.modifying)}function y(b){var v;n.if((0,pt.not)((v=t.valid)!==null&&v!==void 0?v:l),b)}}fr.funcKeywordCode=LA;function O0(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,pt._)`${n.parentData}[${n.parentDataProperty}]`))}function ZA(e,t){let{gen:r}=e;r.if((0,pt._)`Array.isArray(${t})`,()=>{r.assign(Gn.default.vErrors,(0,pt._)`${Gn.default.vErrors} === null ? ${t} : ${Gn.default.vErrors}.concat(${t})`).assign(Gn.default.errors,(0,pt._)`${Gn.default.vErrors}.length`),(0,jA.extendErrors)(e)},()=>e.error())}function qA({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function N0(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,pt.stringify)(r)})}function FA(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}fr.validSchemaType=FA;function UA({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let s=o.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}fr.validateKeywordUsage=UA});var M0=S(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.extendSubschemaMode=sn.extendSubschemaData=sn.getSubschema=void 0;var hr=Y(),j0=le();function BA(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,hr._)`${e.schemaPath}${(0,hr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,hr._)`${e.schemaPath}${(0,hr.getProperty)(t)}${(0,hr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,j0.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}sn.getSubschema=BA;function VA(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:p,opts:l}=t,d=a.let("data",(0,hr._)`${t.data}${(0,hr.getProperty)(r)}`,!0);c(d),e.errorPath=(0,hr.str)`${u}${(0,j0.getErrorPath)(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=(0,hr._)`${r}`,e.dataPathArr=[...p,e.parentDataProperty]}if(o!==void 0){let u=o instanceof hr.Name?o:a.let("data",o,!0);c(u),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}sn.extendSubschemaData=VA;function HA(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}sn.extendSubschemaMode=HA});var Hf=S((NU,L0)=>{"use strict";L0.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var q0=S((DU,Z0)=>{"use strict";var an=Z0.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};uc(t,n,o,e,"",e)};an.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};an.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};an.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};an.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 uc(e,t,r,n,o,i,s,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,c,u);for(var p in n){var l=n[p];if(Array.isArray(l)){if(p in an.arrayKeywords)for(var d=0;d<l.length;d++)uc(e,t,r,l[d],o+"/"+p+"/"+d,i,o,p,n,d)}else if(p in an.propsKeywords){if(l&&typeof l=="object")for(var f in l)uc(e,t,r,l[f],o+"/"+p+"/"+GA(f),i,o,p,n,f)}else(p in an.keywords||e.allKeys&&!(p in an.skipKeywords))&&uc(e,t,r,l,o+"/"+p,i,o,p,n)}r(n,o,i,s,a,c,u)}}function GA(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Qi=S(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.getSchemaRefs=xt.resolveUrl=xt.normalizeId=xt._getFullPath=xt.getFullPath=xt.inlineRef=void 0;var WA=le(),KA=Hf(),JA=q0(),YA=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function QA(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Gf(e):t?F0(e)<=t:!1}xt.inlineRef=QA;var XA=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Gf(e){for(let t in e){if(XA.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Gf)||typeof r=="object"&&Gf(r))return!0}return!1}function F0(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!YA.has(r)&&(typeof e[r]=="object"&&(0,WA.eachItem)(e[r],n=>t+=F0(n)),t===1/0))return 1/0}return t}function U0(e,t="",r){r!==!1&&(t=Oo(t));let n=e.parse(t);return B0(e,n)}xt.getFullPath=U0;function B0(e,t){return e.serialize(t).split("#")[0]+"#"}xt._getFullPath=B0;var eO=/#\/?$/;function Oo(e){return e?e.replace(eO,""):""}xt.normalizeId=Oo;function tO(e,t,r){return r=Oo(r),e.resolve(t,r)}xt.resolveUrl=tO;var rO=/^[a-z_][-a-z0-9._]*$/i;function nO(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Oo(e[r]||t),i={"":o},s=U0(n,o,!1),a={},c=new Set;return JA(e,{allKeys:!0},(l,d,f,h)=>{if(h===void 0)return;let g=s+d,y=i[h];typeof l[r]=="string"&&(y=b.call(this,l[r])),v.call(this,l.$anchor),v.call(this,l.$dynamicAnchor),i[d]=y;function b(k){let C=this.opts.uriResolver.resolve;if(k=Oo(y?C(y,k):k),c.has(k))throw p(k);c.add(k);let T=this.refs[k];return typeof T=="string"&&(T=this.refs[T]),typeof T=="object"?u(l,T.schema,k):k!==Oo(g)&&(k[0]==="#"?(u(l,a[k],k),a[k]=l):this.refs[k]=g),k}function v(k){if(typeof k=="string"){if(!rO.test(k))throw new Error(`invalid anchor "${k}"`);b.call(this,`#${k}`)}}}),a;function u(l,d,f){if(d!==void 0&&!KA(l,d))throw p(f)}function p(l){return new Error(`reference "${l}" resolves to more than one schema`)}}xt.getSchemaRefs=nO});var ts=S(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.getData=cn.KeywordCxt=cn.validateFunctionCode=void 0;var K0=S0(),V0=Yi(),Kf=Lf(),lc=Yi(),oO=z0(),es=D0(),Wf=M0(),D=Y(),H=Ir(),iO=Qi(),zr=le(),Xi=Ji();function sO(e){if(Q0(e)&&(X0(e),Y0(e))){uO(e);return}J0(e,()=>(0,K0.topBoolOrEmptySchema)(e))}cn.validateFunctionCode=sO;function J0({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,D._)`${H.default.data}, ${H.default.valCxt}`,n.$async,()=>{e.code((0,D._)`"use strict"; ${H0(r,o)}`),cO(e,o),e.code(i)}):e.func(t,(0,D._)`${H.default.data}, ${aO(o)}`,n.$async,()=>e.code(H0(r,o)).code(i))}function aO(e){return(0,D._)`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${e.dynamicRef?(0,D._)`, ${H.default.dynamicAnchors}={}`:D.nil}}={}`}function cO(e,t){e.if(H.default.valCxt,()=>{e.var(H.default.instancePath,(0,D._)`${H.default.valCxt}.${H.default.instancePath}`),e.var(H.default.parentData,(0,D._)`${H.default.valCxt}.${H.default.parentData}`),e.var(H.default.parentDataProperty,(0,D._)`${H.default.valCxt}.${H.default.parentDataProperty}`),e.var(H.default.rootData,(0,D._)`${H.default.valCxt}.${H.default.rootData}`),t.dynamicRef&&e.var(H.default.dynamicAnchors,(0,D._)`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{e.var(H.default.instancePath,(0,D._)`""`),e.var(H.default.parentData,(0,D._)`undefined`),e.var(H.default.parentDataProperty,(0,D._)`undefined`),e.var(H.default.rootData,H.default.data),t.dynamicRef&&e.var(H.default.dynamicAnchors,(0,D._)`{}`)})}function uO(e){let{schema:t,opts:r,gen:n}=e;J0(e,()=>{r.$comment&&t.$comment&&tb(e),hO(e),n.let(H.default.vErrors,null),n.let(H.default.errors,0),r.unevaluated&&lO(e),eb(e),yO(e)})}function lO(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,D._)`${r}.evaluated`),t.if((0,D._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,D._)`${e.evaluated}.props`,(0,D._)`undefined`)),t.if((0,D._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,D._)`${e.evaluated}.items`,(0,D._)`undefined`))}function H0(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,D._)`/*# sourceURL=${r} */`:D.nil}function pO(e,t){if(Q0(e)&&(X0(e),Y0(e))){dO(e,t);return}(0,K0.boolOrEmptySchema)(e,t)}function Y0({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Q0(e){return typeof e.schema!="boolean"}function dO(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&tb(e),mO(e),gO(e);let i=n.const("_errs",H.default.errors);eb(e,i),n.var(t,(0,D._)`${i} === ${H.default.errors}`)}function X0(e){(0,zr.checkUnknownRules)(e),fO(e)}function eb(e,t){if(e.opts.jtd)return G0(e,[],!1,t);let r=(0,V0.getSchemaTypes)(e.schema),n=(0,V0.coerceAndCheckDataType)(e,r);G0(e,r,!n,t)}function fO(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,zr.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function hO(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,zr.checkStrictMode)(e,"default is ignored in the schema root")}function mO(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,iO.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function gO(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function tb({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,D._)`${H.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=(0,D.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,D._)`${H.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function yO(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,D._)`${H.default.errors} === 0`,()=>t.return(H.default.data),()=>t.throw((0,D._)`new ${o}(${H.default.vErrors})`)):(t.assign((0,D._)`${n}.errors`,H.default.vErrors),i.unevaluated&&_O(e),t.return((0,D._)`${H.default.errors} === 0`))}function _O({gen:e,evaluated:t,props:r,items:n}){r instanceof D.Name&&e.assign((0,D._)`${t}.props`,r),n instanceof D.Name&&e.assign((0,D._)`${t}.items`,n)}function G0(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:c,self:u}=e,{RULES:p}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,zr.schemaHasRulesButRef)(i,p))){o.block(()=>nb(e,"$ref",p.all.$ref.definition));return}c.jtd||vO(e,t),o.block(()=>{for(let d of p.rules)l(d);l(p.post)});function l(d){(0,Kf.shouldUseGroup)(i,d)&&(d.type?(o.if((0,lc.checkDataType)(d.type,s,c.strictNumbers)),W0(e,d),t.length===1&&t[0]===d.type&&r&&(o.else(),(0,lc.reportTypeError)(e)),o.endIf()):W0(e,d),a||o.if((0,D._)`${H.default.errors} === ${n||0}`))}}function W0(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,oO.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,Kf.shouldUseRule)(n,i)&&nb(e,i.keyword,i.definition,t.type)})}function vO(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(bO(e,t),e.opts.allowUnionTypes||xO(e,t),wO(e,e.dataTypes))}function bO(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{rb(e.dataTypes,r)||Jf(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),SO(e,t)}}function xO(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Jf(e,"use allowUnionTypes to allow union type keyword")}function wO(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Kf.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>kO(t,s))&&Jf(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function kO(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function rb(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function SO(e,t){let r=[];for(let n of e.dataTypes)rb(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Jf(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,zr.checkStrictMode)(e,t,e.opts.strictTypes)}var pc=class{constructor(t,r,n){if((0,es.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,zr.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",ob(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,es.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",H.default.errors))}result(t,r,n){this.failResult((0,D.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,D.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,D._)`${r} !== undefined && (${(0,D.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Xi.reportExtraError:Xi.reportError)(this,this.def.error,r)}$dataError(){(0,Xi.reportError)(this,this.def.$dataError||Xi.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Xi.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=D.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=D.nil,r=D.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,D.or)((0,D._)`${o} === undefined`,r)),t!==D.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==D.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,D.or)(s(),a());function s(){if(n.length){if(!(r instanceof D.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,D._)`${(0,lc.checkDataTypes)(c,r,i.opts.strictNumbers,lc.DataType.Wrong)}`}return D.nil}function a(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,D._)`!${c}(${r})`}return D.nil}}subschema(t,r){let n=(0,Wf.getSubschema)(this.it,t);(0,Wf.extendSubschemaData)(n,this.it,t),(0,Wf.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return pO(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=zr.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=zr.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,D.Name)),!0}};cn.KeywordCxt=pc;function nb(e,t,r,n){let o=new pc(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,es.funcKeywordCode)(o,r):"macro"in r?(0,es.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,es.funcKeywordCode)(o,r)}var $O=/^\/(?:[^~]|~0|~1)*$/,TO=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ob(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return H.default.rootData;if(e[0]==="/"){if(!$O.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=H.default.rootData}else{let u=TO.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let p=+u[1];if(o=u[2],o==="#"){if(p>=t)throw new Error(c("property/index",p));return n[t-p]}if(p>t)throw new Error(c("data",p));if(i=r[t-p],!o)return i}let s=i,a=o.split("/");for(let u of a)u&&(i=(0,D._)`${i}${(0,D.getProperty)((0,zr.unescapeJsonPointer)(u))}`,s=(0,D._)`${s} && ${i}`);return s;function c(u,p){return`Cannot access ${u} ${p} levels up, current level is ${t}`}}cn.getData=ob});var dc=S(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});var Yf=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Qf.default=Yf});var rs=S(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});var Xf=Qi(),eh=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Xf.resolveUrl)(t,r,n),this.missingSchema=(0,Xf.normalizeId)((0,Xf.getFullPath)(t,this.missingRef))}};th.default=eh});var hc=S(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.resolveSchema=qt.getCompilingSchema=qt.resolveRef=qt.compileSchema=qt.SchemaEnv=void 0;var Xt=Y(),PO=dc(),Wn=Ir(),er=Qi(),ib=le(),CO=ts(),No=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,er.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};qt.SchemaEnv=No;function nh(e){let t=sb.call(this,e);if(t)return t;let r=(0,er.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new Xt.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:PO.default,code:(0,Xt._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");e.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:Wn.default.data,parentData:Wn.default.parentData,parentDataProperty:Wn.default.parentDataProperty,dataNames:[Wn.default.data],dataPathArr:[Xt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Xt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Xt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Xt._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(e),(0,CO.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let l=s.toString();p=`${s.scopeRefs(Wn.default.scope)}return ${l}`,this.opts.code.process&&(p=this.opts.code.process(p,e));let f=new Function(`${Wn.default.self}`,`${Wn.default.scope}`,p)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:l,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:g}=u;f.evaluated={props:h instanceof Xt.Name?void 0:h,items:g instanceof Xt.Name?void 0:g,dynamicProps:h instanceof Xt.Name,dynamicItems:g instanceof Xt.Name},f.source&&(f.source.evaluated=(0,Xt.stringify)(f.evaluated))}return e.validate=f,e}catch(l){throw delete e.validate,delete e.validateName,p&&this.logger.error("Error compiling schema, function code:",p),l}finally{this._compilations.delete(e)}}qt.compileSchema=nh;function EO(e,t,r){var n;r=(0,er.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=RO.call(this,e,r);if(i===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(i=new No({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=IO.call(this,i)}qt.resolveRef=EO;function IO(e){return(0,er.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:nh.call(this,e)}function sb(e){for(let t of this._compilations)if(zO(t,e))return t}qt.getCompilingSchema=sb;function zO(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function RO(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||fc.call(this,e,t)}function fc(e,t){let r=this.opts.uriResolver.parse(t),n=(0,er._getFullPath)(this.opts.uriResolver,r),o=(0,er.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return rh.call(this,r,e);let i=(0,er.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=fc.call(this,e,s);return typeof a?.schema!="object"?void 0:rh.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||nh.call(this,s),i===(0,er.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,er.resolveUrl)(this.opts.uriResolver,o,u)),new No({schema:a,schemaId:c,root:e,baseId:o})}return rh.call(this,r,s)}}qt.resolveSchema=fc;var AO=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function rh(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,ib.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!AO.has(a)&&u&&(t=(0,er.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,ib.schemaHasRulesButRef)(r,this.RULES)){let a=(0,er.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=fc.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new No({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var ab=S((FU,OO)=>{OO.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var ih=S((UU,pb)=>{"use strict";var NO=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),ub=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function oh(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var DO=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function cb(e){return e.length=0,!0}function jO(e,t,r){if(e.length){let n=oh(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function MO(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=jO;for(let c=0;c<e.length;c++){let u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(s=!0),!a(o,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(i=!0),n.push(":");continue}else if(u==="%"){if(!a(o,n,r))break;a=cb}else{o.push(u);continue}}return o.length&&(a===cb?r.zone=o.join(""):s?n.push(o.join("")):n.push(oh(o))),r.address=n.join(""),r}function lb(e){if(LO(e,":")<2)return{host:e,isIPV6:!1};let t=MO(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function LO(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function ZO(e){let t=e,r=[],n=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(o===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function qO(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function FO(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!ub(r)){let n=lb(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}pb.exports={nonSimpleDomain:DO,recomposeAuthority:FO,normalizeComponentEncoding:qO,removeDotSegments:ZO,isIPv4:ub,isUUID:NO,normalizeIPv6:lb,stringArrayToHexStripped:oh}});var gb=S((BU,mb)=>{"use strict";var{isUUID:UO}=ih(),BO=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,VO=["http","https","ws","wss","urn","urn:uuid"];function HO(e){return VO.indexOf(e)!==-1}function sh(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function db(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function fb(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function GO(e){return e.secure=sh(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function WO(e){if((e.port===(sh(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function KO(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(BO);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,i=ah(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function JO(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=ah(o);i&&(e=i.serialize(e,t));let s=e,a=e.nss;return s.path=`${n||t.nid}:${a}`,t.skipEscape=!0,s}function YO(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!UO(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function QO(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var hb={scheme:"http",domainHost:!0,parse:db,serialize:fb},XO={scheme:"https",domainHost:hb.domainHost,parse:db,serialize:fb},mc={scheme:"ws",domainHost:!0,parse:GO,serialize:WO},eN={scheme:"wss",domainHost:mc.domainHost,parse:mc.parse,serialize:mc.serialize},tN={scheme:"urn",parse:KO,serialize:JO,skipNormalize:!0},rN={scheme:"urn:uuid",parse:YO,serialize:QO,skipNormalize:!0},gc={http:hb,https:XO,ws:mc,wss:eN,urn:tN,"urn:uuid":rN};Object.setPrototypeOf(gc,null);function ah(e){return e&&(gc[e]||gc[e.toLowerCase()])||void 0}mb.exports={wsIsSecure:sh,SCHEMES:gc,isValidSchemeName:HO,getSchemeHandler:ah}});var vb=S((VU,_c)=>{"use strict";var{normalizeIPv6:nN,removeDotSegments:ns,recomposeAuthority:oN,normalizeComponentEncoding:yc,isIPv4:iN,nonSimpleDomain:sN}=ih(),{SCHEMES:aN,getSchemeHandler:yb}=gb();function cN(e,t){return typeof e=="string"?e=mr(Rr(e,t),t):typeof e=="object"&&(e=Rr(mr(e,t),t)),e}function uN(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=_b(Rr(e,n),Rr(t,n),n,!0);return n.skipEscape=!0,mr(o,n)}function _b(e,t,r,n){let o={};return n||(e=Rr(mr(e,r),r),t=Rr(mr(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=ns(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=ns(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=ns(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=ns(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function lN(e,t,r){return typeof e=="string"?(e=unescape(e),e=mr(yc(Rr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=mr(yc(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=mr(yc(Rr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=mr(yc(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function mr(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=yb(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let s=oN(r);if(s!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(s),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=ns(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var pN=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Rr(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let i=e.match(pN);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(iN(n.host)===!1){let c=nN(n.host);n.host=c.host.toLowerCase(),o=c.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let s=yb(r.scheme||n.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&n.host&&(r.domainHost||s&&s.domainHost)&&o===!1&&sN(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!s||s&&!s.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),s&&s.parse&&s.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var ch={SCHEMES:aN,normalize:cN,resolve:uN,resolveComponent:_b,equal:lN,serialize:mr,parse:Rr};_c.exports=ch;_c.exports.default=ch;_c.exports.fastUri=ch});var xb=S(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});var bb=vb();bb.code='require("ajv/dist/runtime/uri").default';uh.default=bb});var Eb=S(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.CodeGen=Ge.Name=Ge.nil=Ge.stringify=Ge.str=Ge._=Ge.KeywordCxt=void 0;var dN=ts();Object.defineProperty(Ge,"KeywordCxt",{enumerable:!0,get:function(){return dN.KeywordCxt}});var Do=Y();Object.defineProperty(Ge,"_",{enumerable:!0,get:function(){return Do._}});Object.defineProperty(Ge,"str",{enumerable:!0,get:function(){return Do.str}});Object.defineProperty(Ge,"stringify",{enumerable:!0,get:function(){return Do.stringify}});Object.defineProperty(Ge,"nil",{enumerable:!0,get:function(){return Do.nil}});Object.defineProperty(Ge,"Name",{enumerable:!0,get:function(){return Do.Name}});Object.defineProperty(Ge,"CodeGen",{enumerable:!0,get:function(){return Do.CodeGen}});var fN=dc(),Tb=rs(),hN=Mf(),os=hc(),mN=Y(),is=Qi(),vc=Yi(),ph=le(),wb=ab(),gN=xb(),Pb=(e,t)=>new RegExp(e,t);Pb.code="new RegExp";var yN=["removeAdditional","useDefaults","coerceTypes"],_N=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),vN={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},bN={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},kb=200;function xN(e){var t,r,n,o,i,s,a,c,u,p,l,d,f,h,g,y,b,v,k,C,T,U,Q,Ie,ht;let we=e.strict,Qe=(t=e.code)===null||t===void 0?void 0:t.optimize,Rt=Qe===!0||Qe===void 0?1:Qe||0,li=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Pb,uo=(o=e.uriResolver)!==null&&o!==void 0?o:gN.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:we)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:we)!==null&&c!==void 0?c:!0,strictTypes:(p=(u=e.strictTypes)!==null&&u!==void 0?u:we)!==null&&p!==void 0?p:"log",strictTuples:(d=(l=e.strictTuples)!==null&&l!==void 0?l:we)!==null&&d!==void 0?d:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:we)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Rt,regExp:li}:{optimize:Rt,regExp:li},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:kb,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:kb,meta:(b=e.meta)!==null&&b!==void 0?b:!0,messages:(v=e.messages)!==null&&v!==void 0?v:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(C=e.schemaId)!==null&&C!==void 0?C:"$id",addUsedSchema:(T=e.addUsedSchema)!==null&&T!==void 0?T:!0,validateSchema:(U=e.validateSchema)!==null&&U!==void 0?U:!0,validateFormats:(Q=e.validateFormats)!==null&&Q!==void 0?Q:!0,unicodeRegExp:(Ie=e.unicodeRegExp)!==null&&Ie!==void 0?Ie:!0,int32range:(ht=e.int32range)!==null&&ht!==void 0?ht:!0,uriResolver:uo}}var ss=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...xN(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new mN.ValueScope({scope:{},prefixes:_N,es5:r,lines:n}),this.logger=PN(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,hN.getRules)(),Sb.call(this,vN,t,"NOT SUPPORTED"),Sb.call(this,bN,t,"DEPRECATED","warn"),this._metaOpts=$N.call(this),t.formats&&kN.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&SN.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),wN.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=wb;n==="id"&&(o={...wb},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(p,l){await i.call(this,p.$schema);let d=this._addSchema(p,l);return d.validate||s.call(this,d)}async function i(p){p&&!this.getSchema(p)&&await o.call(this,{$ref:p},!0)}async function s(p){try{return this._compileSchemaEnv(p)}catch(l){if(!(l instanceof Tb.default))throw l;return a.call(this,l),await c.call(this,l.missingSchema),s.call(this,p)}}function a({missingSchema:p,missingRef:l}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${l} cannot be resolved`)}async function c(p){let l=await u.call(this,p);this.refs[p]||await i.call(this,l.$schema),this.refs[p]||this.addSchema(l,p,r)}async function u(p){let l=this._loading[p];if(l)return l;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:s}=this.opts;if(i=t[s],i!==void 0&&typeof i!="string")throw new Error(`schema ${s} must be string`)}return r=(0,is.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=$b.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new os.SchemaEnv({schema:{},schemaId:n});if(r=os.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=$b.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,is.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(EN.call(this,n,r),!r)return(0,ph.eachItem)(n,i=>lh.call(this,i)),this;zN.call(this,r);let o={...r,type:(0,vc.getJSONTypes)(r.type),schemaType:(0,vc.getJSONTypes)(r.schemaType)};return(0,ph.eachItem)(n,o.type.length===0?i=>lh.call(this,i,o):i=>o.type.forEach(s=>lh.call(this,i,o,s))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),s=t;for(let a of i)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,p=s[a];u&&p&&(s[a]=Cb(p))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof t=="object")s=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,is.normalizeId)(s||n);let u=is.getSchemaRefs.call(this,t,n);return c=new os.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):os.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{os.compileSchema.call(this,t)}finally{this.opts=r}}};ss.ValidationError=fN.default;ss.MissingRefError=Tb.default;Ge.default=ss;function Sb(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function $b(e){return e=(0,is.normalizeId)(e),this.schemas[e]||this.refs[e]}function wN(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function kN(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function SN(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function $N(){let e={...this.opts};for(let t of yN)delete e[t];return e}var TN={log(){},warn(){},error(){}};function PN(e){if(e===!1)return TN;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var CN=/^[a-z_$][a-z0-9_$:-]*$/i;function EN(e,t){let{RULES:r}=this;if((0,ph.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!CN.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function lh(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=o?i.post:i.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,vc.getJSONTypes)(t.type),schemaType:(0,vc.getJSONTypes)(t.schemaType)}};t.before?IN.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function IN(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function zN(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=Cb(t)),e.validateSchema=this.compile(t,!0))}var RN={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Cb(e){return{anyOf:[e,RN]}}});var Ib=S(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var AN={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};dh.default=AN});var Ob=S(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.callRef=Kn.getValidate=void 0;var ON=rs(),zb=Zt(),wt=Y(),jo=Ir(),Rb=hc(),bc=le(),NN={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:c}=n,{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return l();let p=Rb.resolveRef.call(c,u,o,r);if(p===void 0)throw new ON.default(n.opts.uriResolver,o,r);if(p instanceof Rb.SchemaEnv)return d(p);return f(p);function l(){if(i===u)return xc(e,s,i,i.$async);let h=t.scopeValue("root",{ref:u});return xc(e,(0,wt._)`${h}.validate`,u,u.$async)}function d(h){let g=Ab(e,h);xc(e,g,h,h.$async)}function f(h){let g=t.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,wt.stringify)(h)}:{ref:h}),y=t.name("valid"),b=e.subschema({schema:h,dataTypes:[],schemaPath:wt.nil,topSchemaRef:g,errSchemaPath:r},y);e.mergeEvaluated(b),e.ok(y)}}};function Ab(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,wt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Kn.getValidate=Ab;function xc(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?jo.default.this:wt.nil;n?p():l();function p(){if(!a.$async)throw new Error("async schema referenced by sync schema");let h=o.let("valid");o.try(()=>{o.code((0,wt._)`await ${(0,zb.callValidateCode)(e,t,u)}`),f(t),s||o.assign(h,!0)},g=>{o.if((0,wt._)`!(${g} instanceof ${i.ValidationError})`,()=>o.throw(g)),d(g),s||o.assign(h,!1)}),e.ok(h)}function l(){e.result((0,zb.callValidateCode)(e,t,u),()=>f(t),()=>d(t))}function d(h){let g=(0,wt._)`${h}.errors`;o.assign(jo.default.vErrors,(0,wt._)`${jo.default.vErrors} === null ? ${g} : ${jo.default.vErrors}.concat(${g})`),o.assign(jo.default.errors,(0,wt._)`${jo.default.vErrors}.length`)}function f(h){var g;if(!i.opts.unevaluated)return;let y=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(i.props=bc.mergeEvaluated.props(o,y.props,i.props));else{let b=o.var("props",(0,wt._)`${h}.evaluated.props`);i.props=bc.mergeEvaluated.props(o,b,i.props,wt.Name)}if(i.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(i.items=bc.mergeEvaluated.items(o,y.items,i.items));else{let b=o.var("items",(0,wt._)`${h}.evaluated.items`);i.items=bc.mergeEvaluated.items(o,b,i.items,wt.Name)}}}Kn.callRef=xc;Kn.default=NN});var Nb=S(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});var DN=Ib(),jN=Ob(),MN=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",DN.default,jN.default];fh.default=MN});var Db=S(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});var wc=Y(),un=wc.operators,kc={maximum:{okStr:"<=",ok:un.LTE,fail:un.GT},minimum:{okStr:">=",ok:un.GTE,fail:un.LT},exclusiveMaximum:{okStr:"<",ok:un.LT,fail:un.GTE},exclusiveMinimum:{okStr:">",ok:un.GT,fail:un.LTE}},LN={message:({keyword:e,schemaCode:t})=>(0,wc.str)`must be ${kc[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,wc._)`{comparison: ${kc[e].okStr}, limit: ${t}}`},ZN={keyword:Object.keys(kc),type:"number",schemaType:"number",$data:!0,error:LN,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,wc._)`${r} ${kc[t].fail} ${n} || isNaN(${r})`)}};hh.default=ZN});var jb=S(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});var as=Y(),qN={message:({schemaCode:e})=>(0,as.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,as._)`{multipleOf: ${e}}`},FN={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:qN,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,as._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,as._)`${s} !== parseInt(${s})`;e.fail$data((0,as._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};mh.default=FN});var Lb=S(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});function Mb(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}gh.default=Mb;Mb.code='require("ajv/dist/runtime/ucs2length").default'});var Zb=S(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});var Jn=Y(),UN=le(),BN=Lb(),VN={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Jn.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Jn._)`{limit: ${e}}`},HN={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:VN,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?Jn.operators.GT:Jn.operators.LT,s=o.opts.unicode===!1?(0,Jn._)`${r}.length`:(0,Jn._)`${(0,UN.useFunc)(e.gen,BN.default)}(${r})`;e.fail$data((0,Jn._)`${s} ${i} ${n}`)}};yh.default=HN});var qb=S(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});var GN=Zt(),Sc=Y(),WN={message:({schemaCode:e})=>(0,Sc.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Sc._)`{pattern: ${e}}`},KN={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:WN,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,s=i.opts.unicodeRegExp?"u":"",a=r?(0,Sc._)`(new RegExp(${o}, ${s}))`:(0,GN.usePattern)(e,n);e.fail$data((0,Sc._)`!${a}.test(${t})`)}};_h.default=KN});var Fb=S(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});var cs=Y(),JN={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,cs.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,cs._)`{limit: ${e}}`},YN={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:JN,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?cs.operators.GT:cs.operators.LT;e.fail$data((0,cs._)`Object.keys(${r}).length ${o} ${n}`)}};vh.default=YN});var Ub=S(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});var us=Zt(),ls=Y(),QN=le(),XN={message:({params:{missingProperty:e}})=>(0,ls.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,ls._)`{missingProperty: ${e}}`},e4={keyword:"required",type:"object",schemaType:"array",$data:!0,error:XN,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?u():p(),a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let g of r)if(f?.[g]===void 0&&!h.has(g)){let y=s.schemaEnv.baseId+s.errSchemaPath,b=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,QN.checkStrictMode)(s,b,s.opts.strictRequired)}}function u(){if(c||i)e.block$data(ls.nil,l);else for(let f of r)(0,us.checkReportMissingProp)(e,f)}function p(){let f=t.let("missing");if(c||i){let h=t.let("valid",!0);e.block$data(h,()=>d(f,h)),e.ok(h)}else t.if((0,us.checkMissingProp)(e,r,f)),(0,us.reportMissingProp)(e,f),t.else()}function l(){t.forOf("prop",n,f=>{e.setParams({missingProperty:f}),t.if((0,us.noPropertyInData)(t,o,f,a.ownProperties),()=>e.error())})}function d(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,(0,us.propertyInData)(t,o,f,a.ownProperties)),t.if((0,ls.not)(h),()=>{e.error(),t.break()})},ls.nil)}}};bh.default=e4});var Bb=S(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});var ps=Y(),t4={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,ps.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,ps._)`{limit: ${e}}`},r4={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:t4,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?ps.operators.GT:ps.operators.LT;e.fail$data((0,ps._)`${r}.length ${o} ${n}`)}};xh.default=r4});var $c=S(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});var Vb=Hf();Vb.code='require("ajv/dist/runtime/equal").default';wh.default=Vb});var Hb=S(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});var kh=Yi(),We=Y(),n4=le(),o4=$c(),i4={message:({params:{i:e,j:t}})=>(0,We.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,We._)`{i: ${e}, j: ${t}}`},s4={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:i4,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!n&&!o)return;let c=t.let("valid"),u=i.items?(0,kh.getSchemaTypes)(i.items):[];e.block$data(c,p,(0,We._)`${s} === false`),e.ok(c);function p(){let h=t.let("i",(0,We._)`${r}.length`),g=t.let("j");e.setParams({i:h,j:g}),t.assign(c,!0),t.if((0,We._)`${h} > 1`,()=>(l()?d:f)(h,g))}function l(){return u.length>0&&!u.some(h=>h==="object"||h==="array")}function d(h,g){let y=t.name("item"),b=(0,kh.checkDataTypes)(u,y,a.opts.strictNumbers,kh.DataType.Wrong),v=t.const("indices",(0,We._)`{}`);t.for((0,We._)`;${h}--;`,()=>{t.let(y,(0,We._)`${r}[${h}]`),t.if(b,(0,We._)`continue`),u.length>1&&t.if((0,We._)`typeof ${y} == "string"`,(0,We._)`${y} += "_"`),t.if((0,We._)`typeof ${v}[${y}] == "number"`,()=>{t.assign(g,(0,We._)`${v}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,We._)`${v}[${y}] = ${h}`)})}function f(h,g){let y=(0,n4.useFunc)(t,o4.default),b=t.name("outer");t.label(b).for((0,We._)`;${h}--;`,()=>t.for((0,We._)`${g} = ${h}; ${g}--;`,()=>t.if((0,We._)`${y}(${r}[${h}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(b)})))}}};Sh.default=s4});var Gb=S(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});var $h=Y(),a4=le(),c4=$c(),u4={message:"must be equal to constant",params:({schemaCode:e})=>(0,$h._)`{allowedValue: ${e}}`},l4={keyword:"const",$data:!0,error:u4,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,$h._)`!${(0,a4.useFunc)(t,c4.default)}(${r}, ${o})`):e.fail((0,$h._)`${i} !== ${r}`)}};Th.default=l4});var Wb=S(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});var ds=Y(),p4=le(),d4=$c(),f4={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ds._)`{allowedValues: ${e}}`},h4={keyword:"enum",schemaType:"array",$data:!0,error:f4,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=s.opts.loopEnum,c,u=()=>c??(c=(0,p4.useFunc)(t,d4.default)),p;if(a||n)p=t.let("valid"),e.block$data(p,l);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let f=t.const("vSchema",i);p=(0,ds.or)(...o.map((h,g)=>d(f,g)))}e.pass(p);function l(){t.assign(p,!1),t.forOf("v",i,f=>t.if((0,ds._)`${u()}(${r}, ${f})`,()=>t.assign(p,!0).break()))}function d(f,h){let g=o[h];return typeof g=="object"&&g!==null?(0,ds._)`${u()}(${r}, ${f}[${h}])`:(0,ds._)`${r} === ${g}`}}};Ph.default=h4});var Kb=S(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});var m4=Db(),g4=jb(),y4=Zb(),_4=qb(),v4=Fb(),b4=Ub(),x4=Bb(),w4=Hb(),k4=Gb(),S4=Wb(),$4=[m4.default,g4.default,y4.default,_4.default,v4.default,b4.default,x4.default,w4.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},k4.default,S4.default];Ch.default=$4});var Ih=S(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.validateAdditionalItems=void 0;var Yn=Y(),Eh=le(),T4={message:({params:{len:e}})=>(0,Yn.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Yn._)`{limit: ${e}}`},P4={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:T4,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Eh.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Jb(e,n)}};function Jb(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,Yn._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Yn._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,Eh.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,Yn._)`${a} <= ${t.length}`);r.if((0,Yn.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,p=>{e.subschema({keyword:i,dataProp:p,dataPropType:Eh.Type.Num},u),s.allErrors||r.if((0,Yn.not)(u),()=>r.break())})}}fs.validateAdditionalItems=Jb;fs.default=P4});var zh=S(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.validateTuple=void 0;var Yb=Y(),Tc=le(),C4=Zt(),E4={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return Qb(e,"additionalItems",t);r.items=!0,!(0,Tc.alwaysValidSchema)(r,t)&&e.ok((0,C4.validateArray)(e))}};function Qb(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;p(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Tc.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,Yb._)`${i}.length`);r.forEach((l,d)=>{(0,Tc.alwaysValidSchema)(a,l)||(n.if((0,Yb._)`${u} > ${d}`,()=>e.subschema({keyword:s,schemaProp:d,dataProp:d},c)),e.ok(c))});function p(l){let{opts:d,errSchemaPath:f}=a,h=r.length,g=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(d.strictTuples&&!g){let y=`"${s}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;(0,Tc.checkStrictMode)(a,y,d.strictTuples)}}}hs.validateTuple=Qb;hs.default=E4});var Xb=S(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});var I4=zh(),z4={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,I4.validateTuple)(e,"items")};Rh.default=z4});var tx=S(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});var ex=Y(),R4=le(),A4=Zt(),O4=Ih(),N4={message:({params:{len:e}})=>(0,ex.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ex._)`{limit: ${e}}`},D4={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:N4,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,R4.alwaysValidSchema)(n,t)&&(o?(0,O4.validateAdditionalItems)(e,o):e.ok((0,A4.validateArray)(e)))}};Ah.default=D4});var rx=S(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});var Ft=Y(),Pc=le(),j4={message:({params:{min:e,max:t}})=>t===void 0?(0,Ft.str)`must contain at least ${e} valid item(s)`:(0,Ft.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Ft._)`{minContains: ${e}}`:(0,Ft._)`{minContains: ${e}, maxContains: ${t}}`},M4={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:j4,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:c,maxContains:u}=n;i.opts.next?(s=c===void 0?1:c,a=u):s=1;let p=t.const("len",(0,Ft._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,Pc.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Pc.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Pc.alwaysValidSchema)(i,r)){let g=(0,Ft._)`${p} >= ${s}`;a!==void 0&&(g=(0,Ft._)`${g} && ${p} <= ${a}`),e.pass(g);return}i.items=!0;let l=t.name("valid");a===void 0&&s===1?f(l,()=>t.if(l,()=>t.break())):s===0?(t.let(l,!0),a!==void 0&&t.if((0,Ft._)`${o}.length > 0`,d)):(t.let(l,!1),d()),e.result(l,()=>e.reset());function d(){let g=t.name("_valid"),y=t.let("count",0);f(g,()=>t.if(g,()=>h(y)))}function f(g,y){t.forRange("i",0,p,b=>{e.subschema({keyword:"contains",dataProp:b,dataPropType:Pc.Type.Num,compositeRule:!0},g),y()})}function h(g){t.code((0,Ft._)`${g}++`),a===void 0?t.if((0,Ft._)`${g} >= ${s}`,()=>t.assign(l,!0).break()):(t.if((0,Ft._)`${g} > ${a}`,()=>t.assign(l,!1).break()),s===1?t.assign(l,!0):t.if((0,Ft._)`${g} >= ${s}`,()=>t.assign(l,!0)))}}};Oh.default=M4});var ix=S(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.validateSchemaDeps=gr.validatePropertyDeps=gr.error=void 0;var Nh=Y(),L4=le(),ms=Zt();gr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Nh.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Nh._)`{property: ${e},
|
|
37
37
|
missingProperty: ${n},
|
|
38
38
|
depsCount: ${t},
|
|
39
|
-
deps: ${r}}`};var N4={keyword:"dependencies",type:"object",schemaType:"object",error:gr.error,code(e){let[t,r]=D4(e);nx(e,t),ox(e,r)}};function D4({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function nx(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let s in t){let a=t[s];if(a.length===0)continue;let c=(0,ms.propertyInData)(r,n,s,o.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,ms.checkReportMissingProp)(e,u)}):(r.if((0,Nh._)`${c} && (${(0,ms.checkMissingProp)(e,a,i)})`),(0,ms.reportMissingProp)(e,i),r.else())}}gr.validatePropertyDeps=nx;function ox(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,O4.alwaysValidSchema)(i,t[a])||(r.if((0,ms.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:a},s);e.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),e.ok(s))}gr.validateSchemaDeps=ox;gr.default=N4});var ax=S(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});var sx=K(),j4=le(),M4={message:"property name must be valid",params:({params:e})=>(0,sx._)`{propertyName: ${e.propertyName}}`},L4={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:M4,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,j4.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,sx.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};Dh.default=L4});var Mh=S(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});var Cc=Zt(),tr=K(),Z4=Ir(),Ec=le(),q4={message:"must NOT have additional properties",params:({params:e})=>(0,tr._)`{additionalProperty: ${e.additionalProperty}}`},F4={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:q4,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,Ec.alwaysValidSchema)(s,r))return;let u=(0,Cc.allSchemaProperties)(n.properties),p=(0,Cc.allSchemaProperties)(n.patternProperties);l(),e.ok((0,tr._)`${i} === ${Z4.default.errors}`);function l(){t.forIn("key",o,y=>{!u.length&&!p.length?h(y):t.if(d(y),()=>h(y))})}function d(y){let b;if(u.length>8){let v=(0,Ec.schemaRefOrVal)(s,n.properties,"properties");b=(0,Cc.isOwnProperty)(t,v,y)}else u.length?b=(0,tr.or)(...u.map(v=>(0,tr._)`${y} === ${v}`)):b=tr.nil;return p.length&&(b=(0,tr.or)(b,...p.map(v=>(0,tr._)`${(0,Cc.usePattern)(e,v)}.test(${y})`))),(0,tr.not)(b)}function f(y){t.code((0,tr._)`delete ${o}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){e.setParams({additionalProperty:y}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,Ec.alwaysValidSchema)(s,r)){let b=t.name("valid");c.removeAdditional==="failing"?(g(y,b,!1),t.if((0,tr.not)(b),()=>{e.reset(),f(y)})):(g(y,b),a||t.if((0,tr.not)(b),()=>t.break()))}}function g(y,b,v){let k={keyword:"additionalProperties",dataProp:y,dataPropType:Ec.Type.Str};v===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(k,b)}}};jh.default=F4});var lx=S(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0});var U4=ts(),cx=Zt(),Lh=le(),ux=Mh(),B4={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&ux.default.code(new U4.KeywordCxt(i,ux.default,"additionalProperties"));let s=(0,cx.allSchemaProperties)(r);for(let l of s)i.definedProperties.add(l);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Lh.mergeEvaluated.props(t,(0,Lh.toHash)(s),i.props));let a=s.filter(l=>!(0,Lh.alwaysValidSchema)(i,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a)u(l)?p(l):(t.if((0,cx.propertyInData)(t,o,l,i.opts.ownProperties)),p(l),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(l),e.ok(c);function u(l){return i.opts.useDefaults&&!i.compositeRule&&r[l].default!==void 0}function p(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};Zh.default=B4});var hx=S(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});var px=Zt(),Ic=K(),dx=le(),fx=le(),V4={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,px.allSchemaProperties)(r),c=a.filter(g=>(0,dx.alwaysValidSchema)(i,r[g]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,p=t.name("valid");i.props!==!0&&!(i.props instanceof Ic.Name)&&(i.props=(0,fx.evaluatedPropsToName)(t,i.props));let{props:l}=i;d();function d(){for(let g of a)u&&f(g),i.allErrors?h(g):(t.var(p,!0),h(g),t.if(p))}function f(g){for(let y in u)new RegExp(g).test(y)&&(0,dx.checkStrictMode)(i,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function h(g){t.forIn("key",n,y=>{t.if((0,Ic._)`${(0,px.usePattern)(e,g)}.test(${y})`,()=>{let b=c.includes(g);b||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:fx.Type.Str},p),i.opts.unevaluated&&l!==!0?t.assign((0,Ic._)`${l}[${y}]`,!0):!b&&!i.allErrors&&t.if((0,Ic.not)(p),()=>t.break())})})}}};qh.default=V4});var mx=S(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});var H4=le(),G4={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,H4.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Fh.default=G4});var gx=S(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});var W4=Zt(),K4={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:W4.validateUnion,error:{message:"must match a schema in anyOf"}};Uh.default=K4});var yx=S(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});var zc=K(),J4=le(),Y4={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,zc._)`{passingSchemas: ${e.passing}}`},Q4={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Y4,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,s=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((p,l)=>{let d;(0,J4.alwaysValidSchema)(o,p)?t.var(c,!0):d=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c),l>0&&t.if((0,zc._)`${c} && ${s}`).assign(s,!1).assign(a,(0,zc._)`[${a}, ${l}]`).else(),t.if(c,()=>{t.assign(s,!0),t.assign(a,l),d&&e.mergeEvaluated(d,zc.Name)})})}}};Bh.default=Q4});var _x=S(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});var X4=le(),eD={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((i,s)=>{if((0,X4.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};Vh.default=eD});var xx=S(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});var Rc=K(),bx=le(),tD={message:({params:e})=>(0,Rc.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Rc._)`{failingKeyword: ${e.ifClause}}`},rD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:tD,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,bx.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=vx(n,"then"),i=vx(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),o&&i){let p=t.let("ifClause");e.setParams({ifClause:p}),t.if(a,u("then",p),u("else",p))}else o?t.if(a,u("then")):t.if((0,Rc.not)(a),u("else"));e.pass(s,()=>e.error(!0));function c(){let p=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(p)}function u(p,l){return()=>{let d=e.subschema({keyword:p},a);t.assign(s,a),e.mergeValidEvaluated(d,s),l?t.assign(l,(0,Rc._)`${p}`):e.setParams({ifClause:p})}}}};function vx(e,t){let r=e.schema[t];return r!==void 0&&!(0,bx.alwaysValidSchema)(e,r)}Hh.default=rD});var wx=S(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});var nD=le(),oD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,nD.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Gh.default=oD});var kx=S(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});var iD=Ih(),sD=Xb(),aD=zh(),cD=tx(),uD=rx(),lD=ix(),pD=ax(),dD=Mh(),fD=lx(),hD=hx(),mD=mx(),gD=gx(),yD=yx(),_D=_x(),vD=xx(),bD=wx();function xD(e=!1){let t=[mD.default,gD.default,yD.default,_D.default,vD.default,bD.default,pD.default,dD.default,lD.default,fD.default,hD.default];return e?t.push(sD.default,cD.default):t.push(iD.default,aD.default),t.push(uD.default),t}Wh.default=xD});var Sx=S(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});var Oe=K(),wD={message:({schemaCode:e})=>(0,Oe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Oe._)`{format: ${e}}`},kD={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:wD,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:p,self:l}=a;if(!c.validateFormats)return;o?d():f();function d(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),g=r.const("fDef",(0,Oe._)`${h}[${s}]`),y=r.let("fType"),b=r.let("format");r.if((0,Oe._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(y,(0,Oe._)`${g}.type || "string"`).assign(b,(0,Oe._)`${g}.validate`),()=>r.assign(y,(0,Oe._)`"string"`).assign(b,g)),e.fail$data((0,Oe.or)(v(),k()));function v(){return c.strictSchema===!1?Oe.nil:(0,Oe._)`${s} && !${b}`}function k(){let C=p.$async?(0,Oe._)`(${g}.async ? await ${b}(${n}) : ${b}(${n}))`:(0,Oe._)`${b}(${n})`,T=(0,Oe._)`(typeof ${b} == "function" ? ${C} : ${b}.test(${n}))`;return(0,Oe._)`${b} && ${b} !== true && ${y} === ${t} && !${T}`}}function f(){let h=l.formats[i];if(!h){v();return}if(h===!0)return;let[g,y,b]=k(h);g===t&&e.pass(C());function v(){if(c.strictSchema===!1){l.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function k(T){let F=T instanceof RegExp?(0,Oe.regexpCode)(T):c.code.formats?(0,Oe._)`${c.code.formats}${(0,Oe.getProperty)(i)}`:void 0,Y=r.scopeValue("formats",{key:i,ref:T,code:F});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,Oe._)`${Y}.validate`]:["string",T,Y]}function C(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Oe._)`await ${b}(${n})`}return typeof y=="function"?(0,Oe._)`${b}(${n})`:(0,Oe._)`${b}.test(${n})`}}}};Kh.default=kD});var $x=S(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});var SD=Sx(),$D=[SD.default];Jh.default=$D});var Tx=S(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.contentVocabulary=Mo.metadataVocabulary=void 0;Mo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Mo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Cx=S(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});var TD=Nb(),PD=Kb(),CD=kx(),ED=$x(),Px=Tx(),ID=[TD.default,PD.default,(0,CD.default)(),ED.default,Px.metadataVocabulary,Px.contentVocabulary];Yh.default=ID});var Ix=S(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.DiscrError=void 0;var Ex;(function(e){e.Tag="tag",e.Mapping="mapping"})(Ex||(Ac.DiscrError=Ex={}))});var Rx=S(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});var Lo=K(),Qh=Ix(),zx=hc(),zD=rs(),RD=le(),AD={message:({params:{discrError:e,tagName:t}})=>e===Qh.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Lo._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},OD={keyword:"discriminator",type:"object",schemaType:"object",error:AD,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",(0,Lo._)`${r}${(0,Lo.getProperty)(a)}`);t.if((0,Lo._)`typeof ${u} == "string"`,()=>p(),()=>e.error(!1,{discrError:Qh.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function p(){let f=d();t.if(!1);for(let h in f)t.elseIf((0,Lo._)`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:Qh.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(g,Lo.Name),h}function d(){var f;let h={},g=b(o),y=!0;for(let C=0;C<s.length;C++){let T=s[C];if(T?.$ref&&!(0,RD.schemaHasRulesButRef)(T,i.self.RULES)){let Y=T.$ref;if(T=zx.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,Y),T instanceof zx.SchemaEnv&&(T=T.schema),T===void 0)throw new zD.default(i.opts.uriResolver,i.baseId,Y)}let F=(f=T?.properties)===null||f===void 0?void 0:f[a];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||b(T)),v(F,C)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return h;function b({required:C}){return Array.isArray(C)&&C.includes(a)}function v(C,T){if(C.const)k(C.const,T);else if(C.enum)for(let F of C.enum)k(F,T);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function k(C,T){if(typeof C!="string"||C in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[C]=T}}}};Xh.default=OD});var Ax=S(($B,ND)=>{ND.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 tm=S((Se,em)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.MissingRefError=Se.ValidationError=Se.CodeGen=Se.Name=Se.nil=Se.stringify=Se.str=Se._=Se.KeywordCxt=Se.Ajv=void 0;var DD=Eb(),jD=Cx(),MD=Rx(),Ox=Ax(),LD=["/properties"],Oc="http://json-schema.org/draft-07/schema",Zo=class extends DD.default{_addVocabularies(){super._addVocabularies(),jD.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(MD.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(Ox,LD):Ox;this.addMetaSchema(t,Oc,!1),this.refs["http://json-schema.org/schema"]=Oc}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Oc)?Oc:void 0)}};Se.Ajv=Zo;em.exports=Se=Zo;em.exports.Ajv=Zo;Object.defineProperty(Se,"__esModule",{value:!0});Se.default=Zo;var ZD=ts();Object.defineProperty(Se,"KeywordCxt",{enumerable:!0,get:function(){return ZD.KeywordCxt}});var qo=K();Object.defineProperty(Se,"_",{enumerable:!0,get:function(){return qo._}});Object.defineProperty(Se,"str",{enumerable:!0,get:function(){return qo.str}});Object.defineProperty(Se,"stringify",{enumerable:!0,get:function(){return qo.stringify}});Object.defineProperty(Se,"nil",{enumerable:!0,get:function(){return qo.nil}});Object.defineProperty(Se,"Name",{enumerable:!0,get:function(){return qo.Name}});Object.defineProperty(Se,"CodeGen",{enumerable:!0,get:function(){return qo.CodeGen}});var qD=dc();Object.defineProperty(Se,"ValidationError",{enumerable:!0,get:function(){return qD.default}});var FD=rs();Object.defineProperty(Se,"MissingRefError",{enumerable:!0,get:function(){return FD.default}})});var Fx=S(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.formatNames=_r.fastFormats=_r.fullFormats=void 0;function yr(e,t){return{validate:e,compare:t}}_r.fullFormats={date:yr(Mx,im),time:yr(nm(!0),sm),"date-time":yr(Nx(!0),Zx),"iso-time":yr(nm(),Lx),"iso-date-time":yr(Nx(),qx),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:WD,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:tj,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:KD,int32:{type:"number",validate:QD},int64:{type:"number",validate:XD},float:{type:"number",validate:jx},double:{type:"number",validate:jx},password:!0,binary:!0};_r.fastFormats={..._r.fullFormats,date:yr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,im),time:yr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,sm),"date-time":yr(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Zx),"iso-time":yr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Lx),"iso-date-time":yr(/^\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,qx),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};_r.formatNames=Object.keys(_r.fullFormats);function UD(e){return e%4===0&&(e%100!==0||e%400===0)}var BD=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,VD=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Mx(e){let t=BD.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&UD(r)?29:VD[n])}function im(e,t){if(e&&t)return e>t?1:e<t?-1:0}var rm=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function nm(e){return function(r){let n=rm.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),p=+(n[7]||0);if(u>23||p>59||e&&!a)return!1;if(o<=23&&i<=59&&s<60)return!0;let l=i-p*c,d=o-u*c-(l<0?1:0);return(d===23||d===-1)&&(l===59||l===-1)&&s<61}}function sm(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function Lx(e,t){if(!(e&&t))return;let r=rm.exec(e),n=rm.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var om=/t|\s/i;function Nx(e){let t=nm(e);return function(n){let o=n.split(om);return o.length===2&&Mx(o[0])&&t(o[1])}}function Zx(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function qx(e,t){if(!(e&&t))return;let[r,n]=e.split(om),[o,i]=t.split(om),s=im(r,o);if(s!==void 0)return s||sm(n,i)}var HD=/\/|:/,GD=/^(?:[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;function WD(e){return HD.test(e)&&GD.test(e)}var Dx=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function KD(e){return Dx.lastIndex=0,Dx.test(e)}var JD=-(2**31),YD=2**31-1;function QD(e){return Number.isInteger(e)&&e<=YD&&e>=JD}function XD(e){return Number.isInteger(e)}function jx(){return!0}var ej=/[^\\]\\Z/;function tj(e){if(ej.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var Ux=S(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.formatLimitDefinition=void 0;var rj=tm(),rr=K(),ln=rr.operators,Nc={formatMaximum:{okStr:"<=",ok:ln.LTE,fail:ln.GT},formatMinimum:{okStr:">=",ok:ln.GTE,fail:ln.LT},formatExclusiveMaximum:{okStr:"<",ok:ln.LT,fail:ln.GTE},formatExclusiveMinimum:{okStr:">",ok:ln.GT,fail:ln.LTE}},nj={message:({keyword:e,schemaCode:t})=>(0,rr.str)`should be ${Nc[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,rr._)`{comparison: ${Nc[e].okStr}, limit: ${t}}`};Fo.formatLimitDefinition={keyword:Object.keys(Nc),type:"string",schemaType:"string",$data:!0,error:nj,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let c=new rj.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?u():p();function u(){let d=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),f=t.const("fmt",(0,rr._)`${d}[${c.schemaCode}]`);e.fail$data((0,rr.or)((0,rr._)`typeof ${f} != "object"`,(0,rr._)`${f} instanceof RegExp`,(0,rr._)`typeof ${f}.compare != "function"`,l(f)))}function p(){let d=c.schema,f=a.formats[d];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${o}": format "${d}" does not define "compare" function`);let h=t.scopeValue("formats",{key:d,ref:f,code:s.code.formats?(0,rr._)`${s.code.formats}${(0,rr.getProperty)(d)}`:void 0});e.fail$data(l(h))}function l(d){return(0,rr._)`${d}.compare(${r}, ${n}) ${Nc[o].fail} 0`}},dependencies:["format"]};var oj=e=>(e.addKeyword(Fo.formatLimitDefinition),e);Fo.default=oj});var Gx=S((gs,Hx)=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});var Uo=Fx(),ij=Ux(),am=K(),Bx=new am.Name("fullFormats"),sj=new am.Name("fastFormats"),cm=(e,t={keywords:!0})=>{if(Array.isArray(t))return Vx(e,t,Uo.fullFormats,Bx),e;let[r,n]=t.mode==="fast"?[Uo.fastFormats,sj]:[Uo.fullFormats,Bx],o=t.formats||Uo.formatNames;return Vx(e,o,r,n),t.keywords&&(0,ij.default)(e),e};cm.get=(e,t="full")=>{let n=(t==="fast"?Uo.fastFormats:Uo.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function Vx(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,am._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}Hx.exports=gs=cm;Object.defineProperty(gs,"__esModule",{value:!0});gs.default=cm});function aj(){let e=new Wx.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Kx.default)(e),e}var Wx,Kx,Dc,Jx=_(()=>{Wx=st(tm(),1),Kx=st(Gx(),1);Dc=class{constructor(t){this._ajv=t??aj()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var jc,Yx=_(()=>{jc=class{constructor(t){this._server=t}requestStream(t,r,n){return this._server.requestStream(t,r,n)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._server.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}}});function Qx(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function Xx(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var ew=_(()=>{});var Mc,tw=_(()=>{c0();Zi();Jx();Ci();Yx();ew();Mc=class extends Xa{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Li.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let i=this._loggingLevels.get(o);return i?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(i):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Dc,this.setRequestHandler(xd,n=>this._oninitialize(n)),this.setNotificationHandler(wd,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Ed,async(n,o)=>{let i=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=Li.safeParse(s);return a.success&&this._loggingLevels.set(i,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new jc(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=a0(this._capabilities,t)}setRequestHandler(t,r){let o=Qr(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i;if(Nt(o)){let a=o;i=a._zod?.def?.value??a.value}else{let a=o;i=a._def?.value??a.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");if(i==="tools/call"){let a=async(c,u)=>{let p=Yr(Po,c);if(!p.success){let h=p.error instanceof Error?p.error.message:String(p.error);throw new O(L.InvalidParams,`Invalid tools/call request: ${h}`)}let{params:l}=p.data,d=await Promise.resolve(r(c,u));if(l.task){let h=Yr($o,d);if(!h.success){let g=h.error instanceof Error?h.error.message:String(h.error);throw new O(L.InvalidParams,`Invalid task creation result: ${g}`)}return h.data}let f=Yr(Za,d);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new O(L.InvalidParams,`Invalid tools/call result: ${h}`)}return f.data};return super.setRequestHandler(t,a)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){Xx(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&Qx(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:av.includes(r)?r:gd,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Sa)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],i=o.some(u=>u.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(u=>u.type==="tool_use");if(i){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(l=>l.type==="tool_use").map(l=>l.id)),p=new Set(o.filter(l=>l.type==="tool_result").map(l=>l.toolUseId));if(u.size!==p.size||![...u].every(l=>p.has(l)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},zd,r):this.request({method:"sampling/createMessage",params:t},Id,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=t;return this.request({method:"elicitation/create",params:o},qa,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=t.mode==="form"?t:{...t,mode:"form"},i=await this.request({method:"elicitation/create",params:o},qa,r);if(i.action==="accept"&&i.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(i.content);if(!a.valid)throw new O(L.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof O?s:new O(L.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return i}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},Rd,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function um(e){return!!e&&typeof e=="object"&&nw in e}function ow(e){return e[nw]?.complete}var nw,rw,iw=_(()=>{nw=Symbol.for("mcp.completable");(function(e){e.Completable="McpCompletable"})(rw||(rw={}))});var Lc,sw=_(()=>{Lc=class e{static isTemplate(t){return/\{[^}\s]+\}/.test(t)}static validateLength(t,r,n){if(t.length>r)throw new Error(`${n} exceeds maximum length of ${r} characters (got ${t.length})`)}get variableNames(){return this.parts.flatMap(t=>typeof t=="string"?[]:t.names)}constructor(t){e.validateLength(t,1e6,"Template"),this.template=t,this.parts=this.parse(t)}toString(){return this.template}parse(t){let r=[],n="",o=0,i=0;for(;o<t.length;)if(t[o]==="{"){n&&(r.push(n),n="");let s=t.indexOf("}",o);if(s===-1)throw new Error("Unclosed template expression");if(i++,i>1e4)throw new Error("Template contains too many expressions (max 10000)");let a=t.slice(o+1,s),c=this.getOperator(a),u=a.includes("*"),p=this.getNames(a),l=p[0];for(let d of p)e.validateLength(d,1e6,"Variable name");r.push({name:l,operator:c,names:p,exploded:u}),o=s+1}else n+=t[o],o++;return n&&r.push(n),r}getOperator(t){return["+","#",".","/","?","&"].find(n=>t.startsWith(n))||""}getNames(t){let r=this.getOperator(t);return t.slice(r.length).split(",").map(n=>n.replace("*","").trim()).filter(n=>n.length>0)}encodeValue(t,r){return e.validateLength(t,1e6,"Variable value"),r==="+"||r==="#"?encodeURI(t):encodeURIComponent(t)}expandPart(t,r){if(t.operator==="?"||t.operator==="&"){let s=t.names.map(c=>{let u=r[c];if(u===void 0)return"";let p=Array.isArray(u)?u.map(l=>this.encodeValue(l,t.operator)).join(","):this.encodeValue(u.toString(),t.operator);return`${c}=${p}`}).filter(c=>c.length>0);return s.length===0?"":(t.operator==="?"?"?":"&")+s.join("&")}if(t.names.length>1){let s=t.names.map(a=>r[a]).filter(a=>a!==void 0);return s.length===0?"":s.map(a=>Array.isArray(a)?a[0]:a).join(",")}let n=r[t.name];if(n===void 0)return"";let i=(Array.isArray(n)?n:[n]).map(s=>this.encodeValue(s,t.operator));switch(t.operator){case"":return i.join(",");case"+":return i.join(",");case"#":return"#"+i.join(",");case".":return"."+i.join(".");case"/":return"/"+i.join("/");default:return i.join(",")}}expand(t){let r="",n=!1;for(let o of this.parts){if(typeof o=="string"){r+=o;continue}let i=this.expandPart(o,t);i&&((o.operator==="?"||o.operator==="&")&&n?r+=i.replace("?","&"):r+=i,(o.operator==="?"||o.operator==="&")&&(n=!0))}return r}escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp(t){let r=[];for(let i of t.names)e.validateLength(i,1e6,"Variable name");if(t.operator==="?"||t.operator==="&"){for(let i=0;i<t.names.length;i++){let s=t.names[i],a=i===0?"\\"+t.operator:"&";r.push({pattern:a+this.escapeRegExp(s)+"=([^&]+)",name:s})}return r}let n,o=t.name;switch(t.operator){case"":n=t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)";break;case"+":case"#":n="(.+)";break;case".":n="\\.([^/,]+)";break;case"/":n="/"+(t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)");break;default:n="([^/]+)"}return r.push({pattern:n,name:o}),r}match(t){e.validateLength(t,1e6,"URI");let r="^",n=[];for(let a of this.parts)if(typeof a=="string")r+=this.escapeRegExp(a);else{let c=this.partToRegExp(a);for(let{pattern:u,name:p}of c)r+=u,n.push({name:p,exploded:a.exploded})}r+="$",e.validateLength(r,1e6,"Generated regex pattern");let o=new RegExp(r),i=t.match(o);if(!i)return null;let s={};for(let a=0;a<n.length;a++){let{name:c,exploded:u}=n[a],p=i[a+1],l=c.replace("*","");u&&p.includes(",")?s[l]=p.split(","):s[l]=p}return s}}});function uj(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!cj.test(e)){let r=e.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,o,i)=>i.indexOf(n)===o);return t.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function lj(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function lm(e){let t=uj(e);return lj(e,t.warnings),t.isValid}var cj,aw=_(()=>{cj=/^[A-Za-z0-9._-]{1,128}$/});var Zc,cw=_(()=>{Zc=class{constructor(t){this._mcpServer=t}registerToolTask(t,r,n){let o={taskSupport:"required",...r.execution};if(o.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${t}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(t,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,o,r._meta,n)}}});var pe=_(()=>{Ws();Ws()});function pw(e){return e!==null&&typeof e=="object"&&"parse"in e&&typeof e.parse=="function"&&"safeParse"in e&&typeof e.safeParse=="function"}function dj(e){return"_def"in e||"_zod"in e||pw(e)}function pm(e){return typeof e!="object"||e===null||dj(e)?!1:Object.keys(e).length===0?!0:Object.values(e).some(pw)}function uw(e){if(e)return pm(e)?qn(e):e}function fj(e){let t=Qr(e);return t?Object.entries(t).map(([r,n])=>{let o=A_(n),i=O_(n);return{name:r,description:o,required:!i}}):[]}function pn(e){let r=Qr(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=_a(r);if(typeof n=="string")return n;throw new Error("Schema method literal must be a string")}function lw(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var qc,_s,pj,ys,dw=_(()=>{tw();Ci();gf();Zi();iw();sw();aw();cw();pe();qc=class{constructor(t,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new Mc(t,r)}get experimental(){return this._experimental||(this._experimental={tasks:new Zc(this)}),this._experimental}async connect(t){return await this.server.connect(t)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(pn(La)),this.server.assertCanSetRequestHandler(pn(Po)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(La,()=>({tools:Object.entries(this._registeredTools).filter(([,t])=>t.enabled).map(([t,r])=>{let n={name:t,title:r.title,description:r.description,inputSchema:(()=>{let o=ko(r.inputSchema);return o?ff(o,{strictUnions:!0,pipeStrategy:"input"}):pj})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=ko(r.outputSchema);o&&(n.outputSchema=ff(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Po,async(t,r)=>{try{let n=this._registeredTools[t.params.name];if(!n)throw new O(L.InvalidParams,`Tool ${t.params.name} not found`);if(!n.enabled)throw new O(L.InvalidParams,`Tool ${t.params.name} disabled`);let o=!!t.params.task,i=n.execution?.taskSupport,s="createTask"in n.handler;if((i==="required"||i==="optional")&&!s)throw new O(L.InternalError,`Tool ${t.params.name} has taskSupport '${i}' but was not registered with registerToolTask`);if(i==="required"&&!o)throw new O(L.MethodNotFound,`Tool ${t.params.name} requires task augmentation (taskSupport: 'required')`);if(i==="optional"&&!o&&s)return await this.handleAutomaticTaskPolling(n,t,r);let a=await this.validateToolInput(n,t.params.arguments,t.params.name),c=await this.executeToolHandler(n,a,r);return o||await this.validateToolOutput(n,c,t.params.name),c}catch(n){if(n instanceof O&&n.code===L.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(t){return{content:[{type:"text",text:t}],isError:!0}}async validateToolInput(t,r,n){if(!t.inputSchema)return;let i=ko(t.inputSchema)??t.inputSchema,s=await ga(i,r);if(!s.success){let a="error"in s?s.error:"Unknown error",c=ya(a);throw new O(L.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${c}`)}return s.data}async validateToolOutput(t,r,n){if(!t.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new O(L.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=ko(t.outputSchema),i=await ga(o,r.structuredContent);if(!i.success){let s="error"in i?i.error:"Unknown error",a=ya(s);throw new O(L.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${a}`)}}async executeToolHandler(t,r,n){let o=t.handler;if("createTask"in o){if(!n.taskStore)throw new Error("No task store provided.");let s={...n,taskStore:n.taskStore};if(t.inputSchema){let a=o;return await Promise.resolve(a.createTask(r,s))}else{let a=o;return await Promise.resolve(a.createTask(s))}}if(t.inputSchema){let s=o;return await Promise.resolve(s(r,n))}else{let s=o;return await Promise.resolve(s(n))}}async handleAutomaticTaskPolling(t,r,n){if(!n.taskStore)throw new Error("No task store provided for task-capable tool.");let o=await this.validateToolInput(t,r.params.arguments,r.params.name),i=t.handler,s={...n,taskStore:n.taskStore},a=o?await Promise.resolve(i.createTask(o,s)):await Promise.resolve(i.createTask(s)),c=a.task.taskId,u=a.task,p=u.pollInterval??5e3;for(;u.status!=="completed"&&u.status!=="failed"&&u.status!=="cancelled";){await new Promise(d=>setTimeout(d,p));let l=await n.taskStore.getTask(c);if(!l)throw new O(L.InternalError,`Task ${c} not found during polling`);u=l}return await n.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(pn(Fa)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Fa,async t=>{switch(t.params.ref.type){case"ref/prompt":return kv(t),this.handlePromptCompletion(t,t.params.ref);case"ref/resource":return Sv(t),this.handleResourceCompletion(t,t.params.ref);default:throw new O(L.InvalidParams,`Invalid completion reference: ${t.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(t,r){let n=this._registeredPrompts[r.name];if(!n)throw new O(L.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new O(L.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return ys;let i=Qr(n.argsSchema)?.[t.params.argument.name];if(!um(i))return ys;let s=ow(i);if(!s)return ys;let a=await s(t.params.argument.value,t.params.context);return lw(a)}async handleResourceCompletion(t,r){let n=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return ys;throw new O(L.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(t.params.argument.name);if(!o)return ys;let i=await o(t.params.argument.value,t.params.context);return lw(i)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(pn(Oa)),this.server.assertCanSetRequestHandler(pn(Na)),this.server.assertCanSetRequestHandler(pn(Da)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Oa,async(t,r)=>{let n=Object.entries(this._registeredResources).filter(([i,s])=>s.enabled).map(([i,s])=>({uri:i,name:s.name,...s.metadata})),o=[];for(let i of Object.values(this._registeredResourceTemplates)){if(!i.resourceTemplate.listCallback)continue;let s=await i.resourceTemplate.listCallback(r);for(let a of s.resources)o.push({...i.metadata,...a})}return{resources:[...n,...o]}}),this.server.setRequestHandler(Na,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,n])=>({name:r,uriTemplate:n.resourceTemplate.uriTemplate.toString(),...n.metadata}))})),this.server.setRequestHandler(Da,async(t,r)=>{let n=new URL(t.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new O(L.InvalidParams,`Resource ${n} disabled`);return o.readCallback(n,r)}for(let i of Object.values(this._registeredResourceTemplates)){let s=i.resourceTemplate.uriTemplate.match(n.toString());if(s)return i.readCallback(n,s,r)}throw new O(L.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(pn(ja)),this.server.assertCanSetRequestHandler(pn(Ma)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(ja,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,r])=>({name:t,title:r.title,description:r.description,arguments:r.argsSchema?fj(r.argsSchema):void 0}))})),this.server.setRequestHandler(Ma,async(t,r)=>{let n=this._registeredPrompts[t.params.name];if(!n)throw new O(L.InvalidParams,`Prompt ${t.params.name} not found`);if(!n.enabled)throw new O(L.InvalidParams,`Prompt ${t.params.name} disabled`);if(n.argsSchema){let o=ko(n.argsSchema),i=await ga(o,t.params.arguments);if(!i.success){let c="error"in i?i.error:"Unknown error",u=ya(c);throw new O(L.InvalidParams,`Invalid arguments for prompt ${t.params.name}: ${u}`)}let s=i.data,a=n.callback;return await Promise.resolve(a(s,r))}else{let o=n.callback;return await Promise.resolve(o(r))}}),this._promptHandlersInitialized=!0)}resource(t,r,...n){let o;typeof n[0]=="object"&&(o=n.shift());let i=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(t,void 0,r,o,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let s=this._createRegisteredResourceTemplate(t,void 0,r,o,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(t,r,n,o){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let i=this._createRegisteredResource(t,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let i=this._createRegisteredResourceTemplate(t,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}}_createRegisteredResource(t,r,n,o,i){let s={name:t,title:r,metadata:o,readCallback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==n&&(delete this._registeredResources[n],a.uri&&(this._registeredResources[a.uri]=s)),typeof a.name<"u"&&(s.name=a.name),typeof a.title<"u"&&(s.title=a.title),typeof a.metadata<"u"&&(s.metadata=a.metadata),typeof a.callback<"u"&&(s.readCallback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[n]=s,s}_createRegisteredResourceTemplate(t,r,n,o,i){let s={resourceTemplate:n,title:r,metadata:o,readCallback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:u=>{typeof u.name<"u"&&u.name!==t&&(delete this._registeredResourceTemplates[t],u.name&&(this._registeredResourceTemplates[u.name]=s)),typeof u.title<"u"&&(s.title=u.title),typeof u.template<"u"&&(s.resourceTemplate=u.template),typeof u.metadata<"u"&&(s.metadata=u.metadata),typeof u.callback<"u"&&(s.readCallback=u.callback),typeof u.enabled<"u"&&(s.enabled=u.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[t]=s;let a=n.uriTemplate.variableNames;return Array.isArray(a)&&a.some(u=>!!n.completeCallback(u))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(t,r,n,o,i){let s={title:r,description:n,argsSchema:o===void 0?void 0:qn(o),callback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==t&&(delete this._registeredPrompts[t],a.name&&(this._registeredPrompts[a.name]=s)),typeof a.title<"u"&&(s.title=a.title),typeof a.description<"u"&&(s.description=a.description),typeof a.argsSchema<"u"&&(s.argsSchema=qn(a.argsSchema)),typeof a.callback<"u"&&(s.callback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[t]=s,o&&Object.values(o).some(c=>{let u=c instanceof gt?c._def?.innerType:c;return um(u)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(t,r,n,o,i,s,a,c,u){lm(t);let p={title:r,description:n,inputSchema:uw(o),outputSchema:uw(i),annotations:s,execution:a,_meta:c,handler:u,enabled:!0,disable:()=>p.update({enabled:!1}),enable:()=>p.update({enabled:!0}),remove:()=>p.update({name:null}),update:l=>{typeof l.name<"u"&&l.name!==t&&(typeof l.name=="string"&&lm(l.name),delete this._registeredTools[t],l.name&&(this._registeredTools[l.name]=p)),typeof l.title<"u"&&(p.title=l.title),typeof l.description<"u"&&(p.description=l.description),typeof l.paramsSchema<"u"&&(p.inputSchema=qn(l.paramsSchema)),typeof l.outputSchema<"u"&&(p.outputSchema=qn(l.outputSchema)),typeof l.callback<"u"&&(p.handler=l.callback),typeof l.annotations<"u"&&(p.annotations=l.annotations),typeof l._meta<"u"&&(p._meta=l._meta),typeof l.enabled<"u"&&(p.enabled=l.enabled),this.sendToolListChanged()}};return this._registeredTools[t]=p,this.setToolRequestHandlers(),this.sendToolListChanged(),p}tool(t,...r){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let n,o,i,s;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let c=r[0];pm(c)?(o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!pm(r[0])&&(s=r.shift())):typeof c=="object"&&c!==null&&(s=r.shift())}let a=r[0];return this._createRegisteredTool(t,void 0,n,o,i,s,{taskSupport:"forbidden"},void 0,a)}registerTool(t,r,n){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let{title:o,description:i,inputSchema:s,outputSchema:a,annotations:c,_meta:u}=r;return this._createRegisteredTool(t,o,i,s,a,c,{taskSupport:"forbidden"},u,n)}prompt(t,...r){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let o;r.length>1&&(o=r.shift());let i=r[0],s=this._createRegisteredPrompt(t,void 0,n,o,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(t,r,n){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let{title:o,description:i,argsSchema:s}=r,a=this._createRegisteredPrompt(t,o,i,s,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(t,r){return this.server.sendLoggingMessage(t,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},_s=class{constructor(t,r){this._callbacks=r,this._uriTemplate=typeof t=="string"?new Lc(t):t}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(t){return this._callbacks.complete?.[t]}},pj={type:"object",properties:{}};ys={completion:{values:[],hasMore:!1}}});function hj(e){return mv.parse(JSON.parse(e))}function fw(e){return JSON.stringify(e)+`
|
|
39
|
+
deps: ${r}}`};var Z4={keyword:"dependencies",type:"object",schemaType:"object",error:gr.error,code(e){let[t,r]=q4(e);nx(e,t),ox(e,r)}};function q4({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function nx(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let s in t){let a=t[s];if(a.length===0)continue;let c=(0,ms.propertyInData)(r,n,s,o.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,ms.checkReportMissingProp)(e,u)}):(r.if((0,Nh._)`${c} && (${(0,ms.checkMissingProp)(e,a,i)})`),(0,ms.reportMissingProp)(e,i),r.else())}}gr.validatePropertyDeps=nx;function ox(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,L4.alwaysValidSchema)(i,t[a])||(r.if((0,ms.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:a},s);e.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),e.ok(s))}gr.validateSchemaDeps=ox;gr.default=Z4});var ax=S(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});var sx=Y(),F4=le(),U4={message:"property name must be valid",params:({params:e})=>(0,sx._)`{propertyName: ${e.propertyName}}`},B4={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:U4,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,F4.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,sx.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};Dh.default=B4});var Mh=S(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});var Cc=Zt(),tr=Y(),V4=Ir(),Ec=le(),H4={message:"must NOT have additional properties",params:({params:e})=>(0,tr._)`{additionalProperty: ${e.additionalProperty}}`},G4={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:H4,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,Ec.alwaysValidSchema)(s,r))return;let u=(0,Cc.allSchemaProperties)(n.properties),p=(0,Cc.allSchemaProperties)(n.patternProperties);l(),e.ok((0,tr._)`${i} === ${V4.default.errors}`);function l(){t.forIn("key",o,y=>{!u.length&&!p.length?h(y):t.if(d(y),()=>h(y))})}function d(y){let b;if(u.length>8){let v=(0,Ec.schemaRefOrVal)(s,n.properties,"properties");b=(0,Cc.isOwnProperty)(t,v,y)}else u.length?b=(0,tr.or)(...u.map(v=>(0,tr._)`${y} === ${v}`)):b=tr.nil;return p.length&&(b=(0,tr.or)(b,...p.map(v=>(0,tr._)`${(0,Cc.usePattern)(e,v)}.test(${y})`))),(0,tr.not)(b)}function f(y){t.code((0,tr._)`delete ${o}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){e.setParams({additionalProperty:y}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,Ec.alwaysValidSchema)(s,r)){let b=t.name("valid");c.removeAdditional==="failing"?(g(y,b,!1),t.if((0,tr.not)(b),()=>{e.reset(),f(y)})):(g(y,b),a||t.if((0,tr.not)(b),()=>t.break()))}}function g(y,b,v){let k={keyword:"additionalProperties",dataProp:y,dataPropType:Ec.Type.Str};v===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(k,b)}}};jh.default=G4});var lx=S(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0});var W4=ts(),cx=Zt(),Lh=le(),ux=Mh(),K4={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&ux.default.code(new W4.KeywordCxt(i,ux.default,"additionalProperties"));let s=(0,cx.allSchemaProperties)(r);for(let l of s)i.definedProperties.add(l);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Lh.mergeEvaluated.props(t,(0,Lh.toHash)(s),i.props));let a=s.filter(l=>!(0,Lh.alwaysValidSchema)(i,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a)u(l)?p(l):(t.if((0,cx.propertyInData)(t,o,l,i.opts.ownProperties)),p(l),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(l),e.ok(c);function u(l){return i.opts.useDefaults&&!i.compositeRule&&r[l].default!==void 0}function p(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};Zh.default=K4});var hx=S(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});var px=Zt(),Ic=Y(),dx=le(),fx=le(),J4={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,px.allSchemaProperties)(r),c=a.filter(g=>(0,dx.alwaysValidSchema)(i,r[g]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,p=t.name("valid");i.props!==!0&&!(i.props instanceof Ic.Name)&&(i.props=(0,fx.evaluatedPropsToName)(t,i.props));let{props:l}=i;d();function d(){for(let g of a)u&&f(g),i.allErrors?h(g):(t.var(p,!0),h(g),t.if(p))}function f(g){for(let y in u)new RegExp(g).test(y)&&(0,dx.checkStrictMode)(i,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function h(g){t.forIn("key",n,y=>{t.if((0,Ic._)`${(0,px.usePattern)(e,g)}.test(${y})`,()=>{let b=c.includes(g);b||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:fx.Type.Str},p),i.opts.unevaluated&&l!==!0?t.assign((0,Ic._)`${l}[${y}]`,!0):!b&&!i.allErrors&&t.if((0,Ic.not)(p),()=>t.break())})})}}};qh.default=J4});var mx=S(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});var Y4=le(),Q4={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,Y4.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Fh.default=Q4});var gx=S(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});var X4=Zt(),eD={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:X4.validateUnion,error:{message:"must match a schema in anyOf"}};Uh.default=eD});var yx=S(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});var zc=Y(),tD=le(),rD={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,zc._)`{passingSchemas: ${e.passing}}`},nD={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:rD,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,s=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((p,l)=>{let d;(0,tD.alwaysValidSchema)(o,p)?t.var(c,!0):d=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c),l>0&&t.if((0,zc._)`${c} && ${s}`).assign(s,!1).assign(a,(0,zc._)`[${a}, ${l}]`).else(),t.if(c,()=>{t.assign(s,!0),t.assign(a,l),d&&e.mergeEvaluated(d,zc.Name)})})}}};Bh.default=nD});var _x=S(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});var oD=le(),iD={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((i,s)=>{if((0,oD.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};Vh.default=iD});var xx=S(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});var Rc=Y(),bx=le(),sD={message:({params:e})=>(0,Rc.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Rc._)`{failingKeyword: ${e.ifClause}}`},aD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:sD,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,bx.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=vx(n,"then"),i=vx(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),o&&i){let p=t.let("ifClause");e.setParams({ifClause:p}),t.if(a,u("then",p),u("else",p))}else o?t.if(a,u("then")):t.if((0,Rc.not)(a),u("else"));e.pass(s,()=>e.error(!0));function c(){let p=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(p)}function u(p,l){return()=>{let d=e.subschema({keyword:p},a);t.assign(s,a),e.mergeValidEvaluated(d,s),l?t.assign(l,(0,Rc._)`${p}`):e.setParams({ifClause:p})}}}};function vx(e,t){let r=e.schema[t];return r!==void 0&&!(0,bx.alwaysValidSchema)(e,r)}Hh.default=aD});var wx=S(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});var cD=le(),uD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,cD.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Gh.default=uD});var kx=S(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});var lD=Ih(),pD=Xb(),dD=zh(),fD=tx(),hD=rx(),mD=ix(),gD=ax(),yD=Mh(),_D=lx(),vD=hx(),bD=mx(),xD=gx(),wD=yx(),kD=_x(),SD=xx(),$D=wx();function TD(e=!1){let t=[bD.default,xD.default,wD.default,kD.default,SD.default,$D.default,gD.default,yD.default,mD.default,_D.default,vD.default];return e?t.push(pD.default,fD.default):t.push(lD.default,dD.default),t.push(hD.default),t}Wh.default=TD});var Sx=S(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});var Oe=Y(),PD={message:({schemaCode:e})=>(0,Oe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Oe._)`{format: ${e}}`},CD={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:PD,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:p,self:l}=a;if(!c.validateFormats)return;o?d():f();function d(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),g=r.const("fDef",(0,Oe._)`${h}[${s}]`),y=r.let("fType"),b=r.let("format");r.if((0,Oe._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(y,(0,Oe._)`${g}.type || "string"`).assign(b,(0,Oe._)`${g}.validate`),()=>r.assign(y,(0,Oe._)`"string"`).assign(b,g)),e.fail$data((0,Oe.or)(v(),k()));function v(){return c.strictSchema===!1?Oe.nil:(0,Oe._)`${s} && !${b}`}function k(){let C=p.$async?(0,Oe._)`(${g}.async ? await ${b}(${n}) : ${b}(${n}))`:(0,Oe._)`${b}(${n})`,T=(0,Oe._)`(typeof ${b} == "function" ? ${C} : ${b}.test(${n}))`;return(0,Oe._)`${b} && ${b} !== true && ${y} === ${t} && !${T}`}}function f(){let h=l.formats[i];if(!h){v();return}if(h===!0)return;let[g,y,b]=k(h);g===t&&e.pass(C());function v(){if(c.strictSchema===!1){l.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function k(T){let U=T instanceof RegExp?(0,Oe.regexpCode)(T):c.code.formats?(0,Oe._)`${c.code.formats}${(0,Oe.getProperty)(i)}`:void 0,Q=r.scopeValue("formats",{key:i,ref:T,code:U});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,Oe._)`${Q}.validate`]:["string",T,Q]}function C(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Oe._)`await ${b}(${n})`}return typeof y=="function"?(0,Oe._)`${b}(${n})`:(0,Oe._)`${b}.test(${n})`}}}};Kh.default=CD});var $x=S(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});var ED=Sx(),ID=[ED.default];Jh.default=ID});var Tx=S(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.contentVocabulary=Mo.metadataVocabulary=void 0;Mo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Mo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Cx=S(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});var zD=Nb(),RD=Kb(),AD=kx(),OD=$x(),Px=Tx(),ND=[zD.default,RD.default,(0,AD.default)(),OD.default,Px.metadataVocabulary,Px.contentVocabulary];Yh.default=ND});var Ix=S(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.DiscrError=void 0;var Ex;(function(e){e.Tag="tag",e.Mapping="mapping"})(Ex||(Ac.DiscrError=Ex={}))});var Rx=S(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});var Lo=Y(),Qh=Ix(),zx=hc(),DD=rs(),jD=le(),MD={message:({params:{discrError:e,tagName:t}})=>e===Qh.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Lo._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},LD={keyword:"discriminator",type:"object",schemaType:"object",error:MD,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",(0,Lo._)`${r}${(0,Lo.getProperty)(a)}`);t.if((0,Lo._)`typeof ${u} == "string"`,()=>p(),()=>e.error(!1,{discrError:Qh.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function p(){let f=d();t.if(!1);for(let h in f)t.elseIf((0,Lo._)`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:Qh.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(g,Lo.Name),h}function d(){var f;let h={},g=b(o),y=!0;for(let C=0;C<s.length;C++){let T=s[C];if(T?.$ref&&!(0,jD.schemaHasRulesButRef)(T,i.self.RULES)){let Q=T.$ref;if(T=zx.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,Q),T instanceof zx.SchemaEnv&&(T=T.schema),T===void 0)throw new DD.default(i.opts.uriResolver,i.baseId,Q)}let U=(f=T?.properties)===null||f===void 0?void 0:f[a];if(typeof U!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||b(T)),v(U,C)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return h;function b({required:C}){return Array.isArray(C)&&C.includes(a)}function v(C,T){if(C.const)k(C.const,T);else if(C.enum)for(let U of C.enum)k(U,T);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function k(C,T){if(typeof C!="string"||C in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[C]=T}}}};Xh.default=LD});var Ax=S((AB,ZD)=>{ZD.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 tm=S((Se,em)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.MissingRefError=Se.ValidationError=Se.CodeGen=Se.Name=Se.nil=Se.stringify=Se.str=Se._=Se.KeywordCxt=Se.Ajv=void 0;var qD=Eb(),FD=Cx(),UD=Rx(),Ox=Ax(),BD=["/properties"],Oc="http://json-schema.org/draft-07/schema",Zo=class extends qD.default{_addVocabularies(){super._addVocabularies(),FD.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(UD.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(Ox,BD):Ox;this.addMetaSchema(t,Oc,!1),this.refs["http://json-schema.org/schema"]=Oc}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Oc)?Oc:void 0)}};Se.Ajv=Zo;em.exports=Se=Zo;em.exports.Ajv=Zo;Object.defineProperty(Se,"__esModule",{value:!0});Se.default=Zo;var VD=ts();Object.defineProperty(Se,"KeywordCxt",{enumerable:!0,get:function(){return VD.KeywordCxt}});var qo=Y();Object.defineProperty(Se,"_",{enumerable:!0,get:function(){return qo._}});Object.defineProperty(Se,"str",{enumerable:!0,get:function(){return qo.str}});Object.defineProperty(Se,"stringify",{enumerable:!0,get:function(){return qo.stringify}});Object.defineProperty(Se,"nil",{enumerable:!0,get:function(){return qo.nil}});Object.defineProperty(Se,"Name",{enumerable:!0,get:function(){return qo.Name}});Object.defineProperty(Se,"CodeGen",{enumerable:!0,get:function(){return qo.CodeGen}});var HD=dc();Object.defineProperty(Se,"ValidationError",{enumerable:!0,get:function(){return HD.default}});var GD=rs();Object.defineProperty(Se,"MissingRefError",{enumerable:!0,get:function(){return GD.default}})});var Fx=S(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.formatNames=_r.fastFormats=_r.fullFormats=void 0;function yr(e,t){return{validate:e,compare:t}}_r.fullFormats={date:yr(Mx,im),time:yr(nm(!0),sm),"date-time":yr(Nx(!0),Zx),"iso-time":yr(nm(),Lx),"iso-date-time":yr(Nx(),qx),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:XD,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:sj,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:ej,int32:{type:"number",validate:nj},int64:{type:"number",validate:oj},float:{type:"number",validate:jx},double:{type:"number",validate:jx},password:!0,binary:!0};_r.fastFormats={..._r.fullFormats,date:yr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,im),time:yr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,sm),"date-time":yr(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Zx),"iso-time":yr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Lx),"iso-date-time":yr(/^\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,qx),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};_r.formatNames=Object.keys(_r.fullFormats);function WD(e){return e%4===0&&(e%100!==0||e%400===0)}var KD=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,JD=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Mx(e){let t=KD.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&WD(r)?29:JD[n])}function im(e,t){if(e&&t)return e>t?1:e<t?-1:0}var rm=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function nm(e){return function(r){let n=rm.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),p=+(n[7]||0);if(u>23||p>59||e&&!a)return!1;if(o<=23&&i<=59&&s<60)return!0;let l=i-p*c,d=o-u*c-(l<0?1:0);return(d===23||d===-1)&&(l===59||l===-1)&&s<61}}function sm(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function Lx(e,t){if(!(e&&t))return;let r=rm.exec(e),n=rm.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var om=/t|\s/i;function Nx(e){let t=nm(e);return function(n){let o=n.split(om);return o.length===2&&Mx(o[0])&&t(o[1])}}function Zx(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function qx(e,t){if(!(e&&t))return;let[r,n]=e.split(om),[o,i]=t.split(om),s=im(r,o);if(s!==void 0)return s||sm(n,i)}var YD=/\/|:/,QD=/^(?:[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;function XD(e){return YD.test(e)&&QD.test(e)}var Dx=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function ej(e){return Dx.lastIndex=0,Dx.test(e)}var tj=-(2**31),rj=2**31-1;function nj(e){return Number.isInteger(e)&&e<=rj&&e>=tj}function oj(e){return Number.isInteger(e)}function jx(){return!0}var ij=/[^\\]\\Z/;function sj(e){if(ij.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var Ux=S(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.formatLimitDefinition=void 0;var aj=tm(),rr=Y(),ln=rr.operators,Nc={formatMaximum:{okStr:"<=",ok:ln.LTE,fail:ln.GT},formatMinimum:{okStr:">=",ok:ln.GTE,fail:ln.LT},formatExclusiveMaximum:{okStr:"<",ok:ln.LT,fail:ln.GTE},formatExclusiveMinimum:{okStr:">",ok:ln.GT,fail:ln.LTE}},cj={message:({keyword:e,schemaCode:t})=>(0,rr.str)`should be ${Nc[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,rr._)`{comparison: ${Nc[e].okStr}, limit: ${t}}`};Fo.formatLimitDefinition={keyword:Object.keys(Nc),type:"string",schemaType:"string",$data:!0,error:cj,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let c=new aj.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?u():p();function u(){let d=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),f=t.const("fmt",(0,rr._)`${d}[${c.schemaCode}]`);e.fail$data((0,rr.or)((0,rr._)`typeof ${f} != "object"`,(0,rr._)`${f} instanceof RegExp`,(0,rr._)`typeof ${f}.compare != "function"`,l(f)))}function p(){let d=c.schema,f=a.formats[d];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${o}": format "${d}" does not define "compare" function`);let h=t.scopeValue("formats",{key:d,ref:f,code:s.code.formats?(0,rr._)`${s.code.formats}${(0,rr.getProperty)(d)}`:void 0});e.fail$data(l(h))}function l(d){return(0,rr._)`${d}.compare(${r}, ${n}) ${Nc[o].fail} 0`}},dependencies:["format"]};var uj=e=>(e.addKeyword(Fo.formatLimitDefinition),e);Fo.default=uj});var Gx=S((gs,Hx)=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});var Uo=Fx(),lj=Ux(),am=Y(),Bx=new am.Name("fullFormats"),pj=new am.Name("fastFormats"),cm=(e,t={keywords:!0})=>{if(Array.isArray(t))return Vx(e,t,Uo.fullFormats,Bx),e;let[r,n]=t.mode==="fast"?[Uo.fastFormats,pj]:[Uo.fullFormats,Bx],o=t.formats||Uo.formatNames;return Vx(e,o,r,n),t.keywords&&(0,lj.default)(e),e};cm.get=(e,t="full")=>{let n=(t==="fast"?Uo.fastFormats:Uo.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function Vx(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,am._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}Hx.exports=gs=cm;Object.defineProperty(gs,"__esModule",{value:!0});gs.default=cm});function dj(){let e=new Wx.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Kx.default)(e),e}var Wx,Kx,Dc,Jx=_(()=>{Wx=st(tm(),1),Kx=st(Gx(),1);Dc=class{constructor(t){this._ajv=t??dj()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var jc,Yx=_(()=>{jc=class{constructor(t){this._server=t}requestStream(t,r,n){return this._server.requestStream(t,r,n)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._server.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}}});function Qx(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function Xx(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var ew=_(()=>{});var Mc,tw=_(()=>{c0();Zi();Jx();Ci();Yx();ew();Mc=class extends Xa{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Li.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let i=this._loggingLevels.get(o);return i?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(i):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Dc,this.setRequestHandler(xd,n=>this._oninitialize(n)),this.setNotificationHandler(wd,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Ed,async(n,o)=>{let i=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=Li.safeParse(s);return a.success&&this._loggingLevels.set(i,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new jc(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=a0(this._capabilities,t)}setRequestHandler(t,r){let o=Qr(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i;if(Nt(o)){let a=o;i=a._zod?.def?.value??a.value}else{let a=o;i=a._def?.value??a.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");if(i==="tools/call"){let a=async(c,u)=>{let p=Yr(Po,c);if(!p.success){let h=p.error instanceof Error?p.error.message:String(p.error);throw new O(L.InvalidParams,`Invalid tools/call request: ${h}`)}let{params:l}=p.data,d=await Promise.resolve(r(c,u));if(l.task){let h=Yr($o,d);if(!h.success){let g=h.error instanceof Error?h.error.message:String(h.error);throw new O(L.InvalidParams,`Invalid task creation result: ${g}`)}return h.data}let f=Yr(Za,d);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new O(L.InvalidParams,`Invalid tools/call result: ${h}`)}return f.data};return super.setRequestHandler(t,a)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){Xx(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&Qx(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:av.includes(r)?r:gd,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Sa)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],i=o.some(u=>u.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(u=>u.type==="tool_use");if(i){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(l=>l.type==="tool_use").map(l=>l.id)),p=new Set(o.filter(l=>l.type==="tool_result").map(l=>l.toolUseId));if(u.size!==p.size||![...u].every(l=>p.has(l)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},zd,r):this.request({method:"sampling/createMessage",params:t},Id,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=t;return this.request({method:"elicitation/create",params:o},qa,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=t.mode==="form"?t:{...t,mode:"form"},i=await this.request({method:"elicitation/create",params:o},qa,r);if(i.action==="accept"&&i.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(i.content);if(!a.valid)throw new O(L.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof O?s:new O(L.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return i}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},Rd,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function um(e){return!!e&&typeof e=="object"&&nw in e}function ow(e){return e[nw]?.complete}var nw,rw,iw=_(()=>{nw=Symbol.for("mcp.completable");(function(e){e.Completable="McpCompletable"})(rw||(rw={}))});var Lc,sw=_(()=>{Lc=class e{static isTemplate(t){return/\{[^}\s]+\}/.test(t)}static validateLength(t,r,n){if(t.length>r)throw new Error(`${n} exceeds maximum length of ${r} characters (got ${t.length})`)}get variableNames(){return this.parts.flatMap(t=>typeof t=="string"?[]:t.names)}constructor(t){e.validateLength(t,1e6,"Template"),this.template=t,this.parts=this.parse(t)}toString(){return this.template}parse(t){let r=[],n="",o=0,i=0;for(;o<t.length;)if(t[o]==="{"){n&&(r.push(n),n="");let s=t.indexOf("}",o);if(s===-1)throw new Error("Unclosed template expression");if(i++,i>1e4)throw new Error("Template contains too many expressions (max 10000)");let a=t.slice(o+1,s),c=this.getOperator(a),u=a.includes("*"),p=this.getNames(a),l=p[0];for(let d of p)e.validateLength(d,1e6,"Variable name");r.push({name:l,operator:c,names:p,exploded:u}),o=s+1}else n+=t[o],o++;return n&&r.push(n),r}getOperator(t){return["+","#",".","/","?","&"].find(n=>t.startsWith(n))||""}getNames(t){let r=this.getOperator(t);return t.slice(r.length).split(",").map(n=>n.replace("*","").trim()).filter(n=>n.length>0)}encodeValue(t,r){return e.validateLength(t,1e6,"Variable value"),r==="+"||r==="#"?encodeURI(t):encodeURIComponent(t)}expandPart(t,r){if(t.operator==="?"||t.operator==="&"){let s=t.names.map(c=>{let u=r[c];if(u===void 0)return"";let p=Array.isArray(u)?u.map(l=>this.encodeValue(l,t.operator)).join(","):this.encodeValue(u.toString(),t.operator);return`${c}=${p}`}).filter(c=>c.length>0);return s.length===0?"":(t.operator==="?"?"?":"&")+s.join("&")}if(t.names.length>1){let s=t.names.map(a=>r[a]).filter(a=>a!==void 0);return s.length===0?"":s.map(a=>Array.isArray(a)?a[0]:a).join(",")}let n=r[t.name];if(n===void 0)return"";let i=(Array.isArray(n)?n:[n]).map(s=>this.encodeValue(s,t.operator));switch(t.operator){case"":return i.join(",");case"+":return i.join(",");case"#":return"#"+i.join(",");case".":return"."+i.join(".");case"/":return"/"+i.join("/");default:return i.join(",")}}expand(t){let r="",n=!1;for(let o of this.parts){if(typeof o=="string"){r+=o;continue}let i=this.expandPart(o,t);i&&((o.operator==="?"||o.operator==="&")&&n?r+=i.replace("?","&"):r+=i,(o.operator==="?"||o.operator==="&")&&(n=!0))}return r}escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp(t){let r=[];for(let i of t.names)e.validateLength(i,1e6,"Variable name");if(t.operator==="?"||t.operator==="&"){for(let i=0;i<t.names.length;i++){let s=t.names[i],a=i===0?"\\"+t.operator:"&";r.push({pattern:a+this.escapeRegExp(s)+"=([^&]+)",name:s})}return r}let n,o=t.name;switch(t.operator){case"":n=t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)";break;case"+":case"#":n="(.+)";break;case".":n="\\.([^/,]+)";break;case"/":n="/"+(t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)");break;default:n="([^/]+)"}return r.push({pattern:n,name:o}),r}match(t){e.validateLength(t,1e6,"URI");let r="^",n=[];for(let a of this.parts)if(typeof a=="string")r+=this.escapeRegExp(a);else{let c=this.partToRegExp(a);for(let{pattern:u,name:p}of c)r+=u,n.push({name:p,exploded:a.exploded})}r+="$",e.validateLength(r,1e6,"Generated regex pattern");let o=new RegExp(r),i=t.match(o);if(!i)return null;let s={};for(let a=0;a<n.length;a++){let{name:c,exploded:u}=n[a],p=i[a+1],l=c.replace("*","");u&&p.includes(",")?s[l]=p.split(","):s[l]=p}return s}}});function hj(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!fj.test(e)){let r=e.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,o,i)=>i.indexOf(n)===o);return t.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function mj(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function lm(e){let t=hj(e);return mj(e,t.warnings),t.isValid}var fj,aw=_(()=>{fj=/^[A-Za-z0-9._-]{1,128}$/});var Zc,cw=_(()=>{Zc=class{constructor(t){this._mcpServer=t}registerToolTask(t,r,n){let o={taskSupport:"required",...r.execution};if(o.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${t}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(t,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,o,r._meta,n)}}});var pe=_(()=>{Ws();Ws()});function pw(e){return e!==null&&typeof e=="object"&&"parse"in e&&typeof e.parse=="function"&&"safeParse"in e&&typeof e.safeParse=="function"}function yj(e){return"_def"in e||"_zod"in e||pw(e)}function pm(e){return typeof e!="object"||e===null||yj(e)?!1:Object.keys(e).length===0?!0:Object.values(e).some(pw)}function uw(e){if(e)return pm(e)?qn(e):e}function _j(e){let t=Qr(e);return t?Object.entries(t).map(([r,n])=>{let o=A_(n),i=O_(n);return{name:r,description:o,required:!i}}):[]}function pn(e){let r=Qr(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=_a(r);if(typeof n=="string")return n;throw new Error("Schema method literal must be a string")}function lw(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var qc,_s,gj,ys,dw=_(()=>{tw();Ci();gf();Zi();iw();sw();aw();cw();pe();qc=class{constructor(t,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new Mc(t,r)}get experimental(){return this._experimental||(this._experimental={tasks:new Zc(this)}),this._experimental}async connect(t){return await this.server.connect(t)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(pn(La)),this.server.assertCanSetRequestHandler(pn(Po)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(La,()=>({tools:Object.entries(this._registeredTools).filter(([,t])=>t.enabled).map(([t,r])=>{let n={name:t,title:r.title,description:r.description,inputSchema:(()=>{let o=ko(r.inputSchema);return o?ff(o,{strictUnions:!0,pipeStrategy:"input"}):gj})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=ko(r.outputSchema);o&&(n.outputSchema=ff(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Po,async(t,r)=>{try{let n=this._registeredTools[t.params.name];if(!n)throw new O(L.InvalidParams,`Tool ${t.params.name} not found`);if(!n.enabled)throw new O(L.InvalidParams,`Tool ${t.params.name} disabled`);let o=!!t.params.task,i=n.execution?.taskSupport,s="createTask"in n.handler;if((i==="required"||i==="optional")&&!s)throw new O(L.InternalError,`Tool ${t.params.name} has taskSupport '${i}' but was not registered with registerToolTask`);if(i==="required"&&!o)throw new O(L.MethodNotFound,`Tool ${t.params.name} requires task augmentation (taskSupport: 'required')`);if(i==="optional"&&!o&&s)return await this.handleAutomaticTaskPolling(n,t,r);let a=await this.validateToolInput(n,t.params.arguments,t.params.name),c=await this.executeToolHandler(n,a,r);return o||await this.validateToolOutput(n,c,t.params.name),c}catch(n){if(n instanceof O&&n.code===L.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(t){return{content:[{type:"text",text:t}],isError:!0}}async validateToolInput(t,r,n){if(!t.inputSchema)return;let i=ko(t.inputSchema)??t.inputSchema,s=await ga(i,r);if(!s.success){let a="error"in s?s.error:"Unknown error",c=ya(a);throw new O(L.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${c}`)}return s.data}async validateToolOutput(t,r,n){if(!t.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new O(L.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=ko(t.outputSchema),i=await ga(o,r.structuredContent);if(!i.success){let s="error"in i?i.error:"Unknown error",a=ya(s);throw new O(L.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${a}`)}}async executeToolHandler(t,r,n){let o=t.handler;if("createTask"in o){if(!n.taskStore)throw new Error("No task store provided.");let s={...n,taskStore:n.taskStore};if(t.inputSchema){let a=o;return await Promise.resolve(a.createTask(r,s))}else{let a=o;return await Promise.resolve(a.createTask(s))}}if(t.inputSchema){let s=o;return await Promise.resolve(s(r,n))}else{let s=o;return await Promise.resolve(s(n))}}async handleAutomaticTaskPolling(t,r,n){if(!n.taskStore)throw new Error("No task store provided for task-capable tool.");let o=await this.validateToolInput(t,r.params.arguments,r.params.name),i=t.handler,s={...n,taskStore:n.taskStore},a=o?await Promise.resolve(i.createTask(o,s)):await Promise.resolve(i.createTask(s)),c=a.task.taskId,u=a.task,p=u.pollInterval??5e3;for(;u.status!=="completed"&&u.status!=="failed"&&u.status!=="cancelled";){await new Promise(d=>setTimeout(d,p));let l=await n.taskStore.getTask(c);if(!l)throw new O(L.InternalError,`Task ${c} not found during polling`);u=l}return await n.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(pn(Fa)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Fa,async t=>{switch(t.params.ref.type){case"ref/prompt":return kv(t),this.handlePromptCompletion(t,t.params.ref);case"ref/resource":return Sv(t),this.handleResourceCompletion(t,t.params.ref);default:throw new O(L.InvalidParams,`Invalid completion reference: ${t.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(t,r){let n=this._registeredPrompts[r.name];if(!n)throw new O(L.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new O(L.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return ys;let i=Qr(n.argsSchema)?.[t.params.argument.name];if(!um(i))return ys;let s=ow(i);if(!s)return ys;let a=await s(t.params.argument.value,t.params.context);return lw(a)}async handleResourceCompletion(t,r){let n=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return ys;throw new O(L.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(t.params.argument.name);if(!o)return ys;let i=await o(t.params.argument.value,t.params.context);return lw(i)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(pn(Oa)),this.server.assertCanSetRequestHandler(pn(Na)),this.server.assertCanSetRequestHandler(pn(Da)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Oa,async(t,r)=>{let n=Object.entries(this._registeredResources).filter(([i,s])=>s.enabled).map(([i,s])=>({uri:i,name:s.name,...s.metadata})),o=[];for(let i of Object.values(this._registeredResourceTemplates)){if(!i.resourceTemplate.listCallback)continue;let s=await i.resourceTemplate.listCallback(r);for(let a of s.resources)o.push({...i.metadata,...a})}return{resources:[...n,...o]}}),this.server.setRequestHandler(Na,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,n])=>({name:r,uriTemplate:n.resourceTemplate.uriTemplate.toString(),...n.metadata}))})),this.server.setRequestHandler(Da,async(t,r)=>{let n=new URL(t.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new O(L.InvalidParams,`Resource ${n} disabled`);return o.readCallback(n,r)}for(let i of Object.values(this._registeredResourceTemplates)){let s=i.resourceTemplate.uriTemplate.match(n.toString());if(s)return i.readCallback(n,s,r)}throw new O(L.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(pn(ja)),this.server.assertCanSetRequestHandler(pn(Ma)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(ja,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,r])=>({name:t,title:r.title,description:r.description,arguments:r.argsSchema?_j(r.argsSchema):void 0}))})),this.server.setRequestHandler(Ma,async(t,r)=>{let n=this._registeredPrompts[t.params.name];if(!n)throw new O(L.InvalidParams,`Prompt ${t.params.name} not found`);if(!n.enabled)throw new O(L.InvalidParams,`Prompt ${t.params.name} disabled`);if(n.argsSchema){let o=ko(n.argsSchema),i=await ga(o,t.params.arguments);if(!i.success){let c="error"in i?i.error:"Unknown error",u=ya(c);throw new O(L.InvalidParams,`Invalid arguments for prompt ${t.params.name}: ${u}`)}let s=i.data,a=n.callback;return await Promise.resolve(a(s,r))}else{let o=n.callback;return await Promise.resolve(o(r))}}),this._promptHandlersInitialized=!0)}resource(t,r,...n){let o;typeof n[0]=="object"&&(o=n.shift());let i=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(t,void 0,r,o,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let s=this._createRegisteredResourceTemplate(t,void 0,r,o,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(t,r,n,o){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let i=this._createRegisteredResource(t,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let i=this._createRegisteredResourceTemplate(t,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}}_createRegisteredResource(t,r,n,o,i){let s={name:t,title:r,metadata:o,readCallback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==n&&(delete this._registeredResources[n],a.uri&&(this._registeredResources[a.uri]=s)),typeof a.name<"u"&&(s.name=a.name),typeof a.title<"u"&&(s.title=a.title),typeof a.metadata<"u"&&(s.metadata=a.metadata),typeof a.callback<"u"&&(s.readCallback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[n]=s,s}_createRegisteredResourceTemplate(t,r,n,o,i){let s={resourceTemplate:n,title:r,metadata:o,readCallback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:u=>{typeof u.name<"u"&&u.name!==t&&(delete this._registeredResourceTemplates[t],u.name&&(this._registeredResourceTemplates[u.name]=s)),typeof u.title<"u"&&(s.title=u.title),typeof u.template<"u"&&(s.resourceTemplate=u.template),typeof u.metadata<"u"&&(s.metadata=u.metadata),typeof u.callback<"u"&&(s.readCallback=u.callback),typeof u.enabled<"u"&&(s.enabled=u.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[t]=s;let a=n.uriTemplate.variableNames;return Array.isArray(a)&&a.some(u=>!!n.completeCallback(u))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(t,r,n,o,i){let s={title:r,description:n,argsSchema:o===void 0?void 0:qn(o),callback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==t&&(delete this._registeredPrompts[t],a.name&&(this._registeredPrompts[a.name]=s)),typeof a.title<"u"&&(s.title=a.title),typeof a.description<"u"&&(s.description=a.description),typeof a.argsSchema<"u"&&(s.argsSchema=qn(a.argsSchema)),typeof a.callback<"u"&&(s.callback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[t]=s,o&&Object.values(o).some(c=>{let u=c instanceof gt?c._def?.innerType:c;return um(u)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(t,r,n,o,i,s,a,c,u){lm(t);let p={title:r,description:n,inputSchema:uw(o),outputSchema:uw(i),annotations:s,execution:a,_meta:c,handler:u,enabled:!0,disable:()=>p.update({enabled:!1}),enable:()=>p.update({enabled:!0}),remove:()=>p.update({name:null}),update:l=>{typeof l.name<"u"&&l.name!==t&&(typeof l.name=="string"&&lm(l.name),delete this._registeredTools[t],l.name&&(this._registeredTools[l.name]=p)),typeof l.title<"u"&&(p.title=l.title),typeof l.description<"u"&&(p.description=l.description),typeof l.paramsSchema<"u"&&(p.inputSchema=qn(l.paramsSchema)),typeof l.outputSchema<"u"&&(p.outputSchema=qn(l.outputSchema)),typeof l.callback<"u"&&(p.handler=l.callback),typeof l.annotations<"u"&&(p.annotations=l.annotations),typeof l._meta<"u"&&(p._meta=l._meta),typeof l.enabled<"u"&&(p.enabled=l.enabled),this.sendToolListChanged()}};return this._registeredTools[t]=p,this.setToolRequestHandlers(),this.sendToolListChanged(),p}tool(t,...r){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let n,o,i,s;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let c=r[0];pm(c)?(o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!pm(r[0])&&(s=r.shift())):typeof c=="object"&&c!==null&&(s=r.shift())}let a=r[0];return this._createRegisteredTool(t,void 0,n,o,i,s,{taskSupport:"forbidden"},void 0,a)}registerTool(t,r,n){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let{title:o,description:i,inputSchema:s,outputSchema:a,annotations:c,_meta:u}=r;return this._createRegisteredTool(t,o,i,s,a,c,{taskSupport:"forbidden"},u,n)}prompt(t,...r){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let o;r.length>1&&(o=r.shift());let i=r[0],s=this._createRegisteredPrompt(t,void 0,n,o,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(t,r,n){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let{title:o,description:i,argsSchema:s}=r,a=this._createRegisteredPrompt(t,o,i,s,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(t,r){return this.server.sendLoggingMessage(t,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},_s=class{constructor(t,r){this._callbacks=r,this._uriTemplate=typeof t=="string"?new Lc(t):t}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(t){return this._callbacks.complete?.[t]}},gj={type:"object",properties:{}};ys={completion:{values:[],hasMore:!1}}});function vj(e){return mv.parse(JSON.parse(e))}function fw(e){return JSON.stringify(e)+`
|
|
40
40
|
`}var Fc,hw=_(()=>{Zi();Fc=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
|
|
41
|
-
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),
|
|
41
|
+
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),vj(r)}clear(){this._buffer=void 0}}});var dm,Uc,mw=_(()=>{dm=st(require("node:process"),1);hw();Uc=class{constructor(t=dm.default.stdin,r=dm.default.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new Fc,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(t){return new Promise(r=>{let n=fw(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}}});function zw(e){return typeof e>"u"||e===null}function bj(e){return typeof e=="object"&&e!==null}function xj(e){return Array.isArray(e)?e:zw(e)?[]:[e]}function wj(e,t){var r,n,o,i;if(t)for(i=Object.keys(t),r=0,n=i.length;r<n;r+=1)o=i[r],e[o]=t[o];return e}function kj(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function Sj(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}function Rw(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
42
42
|
|
|
43
|
-
`+e.mark.snippet),n+" "+r):n}function bs(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Rw(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}function fm(e,t,r,n,o){var i="",s="",a=Math.floor(o/2)-1;return n-t>a&&(i=" ... ",t=n-a+i.length),r-n>a&&(s=" ...",r=n+a-s.length),{str:i+e.slice(t,r).replace(/\t/g,"\u2192")+s,pos:n-t+i.length}}function hm(e,t){return Ze.repeat(" ",t-e.length)+e}function
|
|
43
|
+
`+e.mark.snippet),n+" "+r):n}function bs(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Rw(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}function fm(e,t,r,n,o){var i="",s="",a=Math.floor(o/2)-1;return n-t>a&&(i=" ... ",t=n-a+i.length),r-n>a&&(s=" ...",r=n+a-s.length),{str:i+e.slice(t,r).replace(/\t/g,"\u2192")+s,pos:n-t+i.length}}function hm(e,t){return Ze.repeat(" ",t-e.length)+e}function zj(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],o=[],i,s=-1;i=r.exec(e.buffer);)o.push(i.index),n.push(i.index+i[0].length),e.position<=i.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var a="",c,u,p=Math.min(e.line+t.linesAfter,o.length).toString().length,l=t.maxLength-(t.indent+p+3);for(c=1;c<=t.linesBefore&&!(s-c<0);c++)u=fm(e.buffer,n[s-c],o[s-c],e.position-(n[s]-n[s-c]),l),a=Ze.repeat(" ",t.indent)+hm((e.line-c+1).toString(),p)+" | "+u.str+`
|
|
44
44
|
`+a;for(u=fm(e.buffer,n[s],o[s],e.position,l),a+=Ze.repeat(" ",t.indent)+hm((e.line+1).toString(),p)+" | "+u.str+`
|
|
45
45
|
`,a+=Ze.repeat("-",t.indent+p+3+u.pos)+`^
|
|
46
46
|
`,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)u=fm(e.buffer,n[s+c],o[s+c],e.position-(n[s]-n[s+c]),l),a+=Ze.repeat(" ",t.indent)+hm((e.line+c+1).toString(),p)+" | "+u.str+`
|
|
47
|
-
`;return a.replace(/\n$/,"")}function
|
|
48
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function
|
|
49
|
-
`,t-1))}function
|
|
47
|
+
`;return a.replace(/\n$/,"")}function Nj(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function Dj(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Aj.indexOf(r)===-1)throw new dt('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Nj(t.styleAliases||null),Oj.indexOf(this.kind)===-1)throw new dt('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}function gw(e,t){var r=[];return e[t].forEach(function(n){var o=r.length;r.forEach(function(i,s){i.tag===n.tag&&i.kind===n.kind&&i.multi===n.multi&&(o=s)}),r[o]=n}),r}function jj(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function gm(e){return this.extend(e)}function Mj(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Lj(){return null}function Zj(e){return e===null}function qj(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Fj(e){return e==="true"||e==="True"||e==="TRUE"}function Uj(e){return Object.prototype.toString.call(e)==="[object Boolean]"}function Bj(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Vj(e){return 48<=e&&e<=55}function Hj(e){return 48<=e&&e<=57}function Gj(e){if(e===null)return!1;var t=e.length,r=0,n=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;n=!0}return n&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Bj(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Vj(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Hj(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function Wj(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function Kj(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ze.isNegativeZero(e)}function Yj(e){return!(e===null||!Jj.test(e)||e[e.length-1]==="_")}function Qj(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}function e3(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ze.isNegativeZero(e))return"-0.0";return r=e.toString(10),Xj.test(r)?r.replace("e",".e"):r}function t3(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ze.isNegativeZero(e))}function r3(e){return e===null?!1:Bw.exec(e)!==null||Vw.exec(e)!==null}function n3(e){var t,r,n,o,i,s,a,c=0,u=null,p,l,d;if(t=Bw.exec(e),t===null&&(t=Vw.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,n,o));if(i=+t[4],s=+t[5],a=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(p=+t[10],l=+(t[11]||0),u=(p*60+l)*6e4,t[9]==="-"&&(u=-u)),d=new Date(Date.UTC(r,n,o,i,s,a,c)),u&&d.setTime(d.getTime()-u),d}function o3(e){return e.toISOString()}function i3(e){return e==="<<"||e===null}function s3(e){if(e===null)return!1;var t,r,n=0,o=e.length,i=xm;for(r=0;r<o;r++)if(t=i.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function a3(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,i=xm,s=0,a=[];for(t=0;t<o;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|i.indexOf(n.charAt(t));return r=o%4*6,r===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):r===18?(a.push(s>>10&255),a.push(s>>2&255)):r===12&&a.push(s>>4&255),new Uint8Array(a)}function c3(e){var t="",r=0,n,o,i=e.length,s=xm;for(n=0;n<i;n++)n%3===0&&n&&(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[n];return o=i%3,o===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):o===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):o===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}function u3(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function d3(e){if(e===null)return!0;var t=[],r,n,o,i,s,a=e;for(r=0,n=a.length;r<n;r+=1){if(o=a[r],s=!1,p3.call(o)!=="[object Object]")return!1;for(i in o)if(l3.call(o,i))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(i)===-1)t.push(i);else return!1}return!0}function f3(e){return e!==null?e:[]}function m3(e){if(e===null)return!0;var t,r,n,o,i,s=e;for(i=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(n=s[t],h3.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;i[t]=[o[0],n[o[0]]]}return!0}function g3(e){if(e===null)return[];var t,r,n,o,i,s=e;for(i=new Array(s.length),t=0,r=s.length;t<r;t+=1)n=s[t],o=Object.keys(n),i[t]=[o[0],n[o[0]]];return i}function _3(e){if(e===null)return!0;var t,r=e;for(t in r)if(y3.call(r,t)&&r[t]!==null)return!1;return!0}function v3(e){return e!==null?e:{}}function _w(e){return Object.prototype.toString.call(e)}function vr(e){return e===10||e===13}function Xn(e){return e===9||e===32}function kt(e){return e===9||e===32||e===10||e===13}function Vo(e){return e===44||e===91||e===93||e===123||e===125}function S3(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function $3(e){return e===120?2:e===117?4:e===85?8:0}function T3(e){return 48<=e&&e<=57?e-48:-1}function vw(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
48
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function P3(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function rk(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}function C3(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||wm,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function ik(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=Rj(r),new dt(t,r)}function j(e,t){throw ik(e,t)}function Hc(e,t){e.onWarning&&e.onWarning.call(null,ik(e,t))}function dn(e,t,r,n){var o,i,s,a;if(t<r){if(a=e.input.slice(t,r),n)for(o=0,i=a.length;o<i;o+=1)s=a.charCodeAt(o),s===9||32<=s&&s<=1114111||j(e,"expected valid JSON character");else x3.test(a)&&j(e,"the stream contains non-printable characters");e.result+=a}}function xw(e,t,r,n){var o,i,s,a;for(Ze.isObject(r)||j(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),s=0,a=o.length;s<a;s+=1)i=o[s],fn.call(t,i)||(rk(t,i,r[i]),n[i]=!0)}function Ho(e,t,r,n,o,i,s,a,c){var u,p;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),u=0,p=o.length;u<p;u+=1)Array.isArray(o[u])&&j(e,"nested arrays are not supported inside keys"),typeof o=="object"&&_w(o[u])==="[object Object]"&&(o[u]="[object Object]");if(typeof o=="object"&&_w(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(u=0,p=i.length;u<p;u+=1)xw(e,t,i[u],r);else xw(e,t,i,r);else!e.json&&!fn.call(r,o)&&fn.call(t,o)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,j(e,"duplicated mapping key")),rk(t,o,i),delete r[o];return t}function km(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):j(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function je(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;Xn(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(vr(o))for(km(e),o=e.input.charCodeAt(e.position),n++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&Hc(e,"deficient indentation"),n}function Kc(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||kt(r)))}function Sm(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ze.repeat(`
|
|
49
|
+
`,t-1))}function E3(e,t,r){var n,o,i,s,a,c,u,p,l=e.kind,d=e.result,f;if(f=e.input.charCodeAt(e.position),kt(f)||Vo(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(o=e.input.charCodeAt(e.position+1),kt(o)||r&&Vo(o)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,a=!1;f!==0;){if(f===58){if(o=e.input.charCodeAt(e.position+1),kt(o)||r&&Vo(o))break}else if(f===35){if(n=e.input.charCodeAt(e.position-1),kt(n))break}else{if(e.position===e.lineStart&&Kc(e)||r&&Vo(f))break;if(vr(f))if(c=e.line,u=e.lineStart,p=e.lineIndent,je(e,!1,-1),e.lineIndent>=t){a=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=u,e.lineIndent=p;break}}a&&(dn(e,i,s,!1),Sm(e,e.line-c),i=s=e.position,a=!1),Xn(f)||(s=e.position+1),f=e.input.charCodeAt(++e.position)}return dn(e,i,s,!1),e.result?!0:(e.kind=l,e.result=d,!1)}function I3(e,t){var r,n,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(dn(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,o=e.position;else return!0;else vr(r)?(dn(e,n,o,!0),Sm(e,je(e,!1,t)),n=o=e.position):e.position===e.lineStart&&Kc(e)?j(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);j(e,"unexpected end of the stream within a single quoted scalar")}function z3(e,t){var r,n,o,i,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return dn(e,r,e.position,!0),e.position++,!0;if(a===92){if(dn(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),vr(a))je(e,!1,t);else if(a<256&&nk[a])e.result+=ok[a],e.position++;else if((s=$3(a))>0){for(o=s,i=0;o>0;o--)a=e.input.charCodeAt(++e.position),(s=S3(a))>=0?i=(i<<4)+s:j(e,"expected hexadecimal character");e.result+=P3(i),e.position++}else j(e,"unknown escape sequence");r=n=e.position}else vr(a)?(dn(e,r,n,!0),Sm(e,je(e,!1,t)),r=n=e.position):e.position===e.lineStart&&Kc(e)?j(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}j(e,"unexpected end of the stream within a double quoted scalar")}function R3(e,t){var r=!0,n,o,i,s=e.tag,a,c=e.anchor,u,p,l,d,f,h=Object.create(null),g,y,b,v;if(v=e.input.charCodeAt(e.position),v===91)p=93,f=!1,a=[];else if(v===123)p=125,f=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),v=e.input.charCodeAt(++e.position);v!==0;){if(je(e,!0,t),v=e.input.charCodeAt(e.position),v===p)return e.position++,e.tag=s,e.anchor=c,e.kind=f?"mapping":"sequence",e.result=a,!0;r?v===44&&j(e,"expected the node content, but found ','"):j(e,"missed comma between flow collection entries"),y=g=b=null,l=d=!1,v===63&&(u=e.input.charCodeAt(e.position+1),kt(u)&&(l=d=!0,e.position++,je(e,!0,t))),n=e.line,o=e.lineStart,i=e.position,Go(e,t,Bc,!1,!0),y=e.tag,g=e.result,je(e,!0,t),v=e.input.charCodeAt(e.position),(d||e.line===n)&&v===58&&(l=!0,v=e.input.charCodeAt(++e.position),je(e,!0,t),Go(e,t,Bc,!1,!0),b=e.result),f?Ho(e,a,h,y,g,b,n,o,i):l?a.push(Ho(e,null,h,y,g,b,n,o,i)):a.push(g),je(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(r=!0,v=e.input.charCodeAt(++e.position)):r=!1}j(e,"unexpected end of the stream within a flow collection")}function A3(e,t){var r,n,o=mm,i=!1,s=!1,a=t,c=0,u=!1,p,l;if(l=e.input.charCodeAt(e.position),l===124)n=!1;else if(l===62)n=!0;else return!1;for(e.kind="scalar",e.result="";l!==0;)if(l=e.input.charCodeAt(++e.position),l===43||l===45)mm===o?o=l===43?yw:b3:j(e,"repeat of a chomping mode identifier");else if((p=T3(l))>=0)p===0?j(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?j(e,"repeat of an indentation width identifier"):(a=t+p-1,s=!0);else break;if(Xn(l)){do l=e.input.charCodeAt(++e.position);while(Xn(l));if(l===35)do l=e.input.charCodeAt(++e.position);while(!vr(l)&&l!==0)}for(;l!==0;){for(km(e),e.lineIndent=0,l=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&l===32;)e.lineIndent++,l=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),vr(l)){c++;continue}if(e.lineIndent<a){o===yw?e.result+=Ze.repeat(`
|
|
50
50
|
`,i?1+c:c):o===mm&&i&&(e.result+=`
|
|
51
51
|
`);break}for(n?Xn(l)?(u=!0,e.result+=Ze.repeat(`
|
|
52
52
|
`,i?1+c:c)):u?(u=!1,e.result+=Ze.repeat(`
|
|
53
53
|
`,c+1)):c===0?i&&(e.result+=" "):e.result+=Ze.repeat(`
|
|
54
54
|
`,c):e.result+=Ze.repeat(`
|
|
55
|
-
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!vr(l)&&l!==0;)l=e.input.charCodeAt(++e.position);dn(e,r,e.position,!1)}return!0}function ww(e,t){var r,n=e.tag,o=e.anchor,i=[],s,a=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,j(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!kt(s))));){if(a=!0,e.position++,je(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,Go(e,t,Xw,!1,!0),i.push(e.result),je(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)j(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=n,e.anchor=o,e.kind="sequence",e.result=i,!0):!1}function
|
|
56
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
55
|
+
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!vr(l)&&l!==0;)l=e.input.charCodeAt(++e.position);dn(e,r,e.position,!1)}return!0}function ww(e,t){var r,n=e.tag,o=e.anchor,i=[],s,a=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,j(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!kt(s))));){if(a=!0,e.position++,je(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,Go(e,t,Xw,!1,!0),i.push(e.result),je(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)j(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=n,e.anchor=o,e.kind="sequence",e.result=i,!0):!1}function O3(e,t,r){var n,o,i,s,a,c,u=e.tag,p=e.anchor,l={},d=Object.create(null),f=null,h=null,g=null,y=!1,b=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),v=e.input.charCodeAt(e.position);v!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,j(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),i=e.line,(v===63||v===58)&&kt(n))v===63?(y&&(Ho(e,l,d,f,h,null,s,a,c),f=h=g=null),b=!0,y=!0,o=!0):y?(y=!1,o=!0):j(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,v=n;else{if(s=e.line,a=e.lineStart,c=e.position,!Go(e,r,Qw,!1,!0))break;if(e.line===i){for(v=e.input.charCodeAt(e.position);Xn(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),kt(v)||j(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Ho(e,l,d,f,h,null,s,a,c),f=h=g=null),b=!0,y=!1,o=!1,f=e.tag,h=e.result;else if(b)j(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=p,!0}else if(b)j(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=p,!0}if((e.line===i||e.lineIndent>t)&&(y&&(s=e.line,a=e.lineStart,c=e.position),Go(e,t,Vc,!0,o)&&(y?h=e.result:g=e.result),y||(Ho(e,l,d,f,h,g,s,a,c),f=h=g=null),je(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&v!==0)j(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Ho(e,l,d,f,h,null,s,a,c),b&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=l),b}function N3(e){var t,r=!1,n=!1,o,i,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&j(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(r=!0,s=e.input.charCodeAt(++e.position)):s===33?(n=!0,o="!!",s=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(i=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):j(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!kt(s);)s===33&&(n?j(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),ek.test(o)||j(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),k3.test(i)&&j(e,"tag suffix cannot contain flow indicator characters")}i&&!tk.test(i)&&j(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{j(e,"tag name is malformed: "+i)}return r?e.tag=i:fn.call(e.tagMap,o)?e.tag=e.tagMap[o]+i:o==="!"?e.tag="!"+i:o==="!!"?e.tag="tag:yaml.org,2002:"+i:j(e,'undeclared tag handle "'+o+'"'),!0}function D3(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&j(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!kt(r)&&!Vo(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&j(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function j3(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!kt(n)&&!Vo(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&j(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),fn.call(e.anchorMap,r)||j(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],je(e,!0,-1),!0}function Go(e,t,r,n,o){var i,s,a,c=1,u=!1,p=!1,l,d,f,h,g,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=s=a=Vc===r||Xw===r,n&&je(e,!0,-1)&&(u=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;N3(e)||D3(e);)je(e,!0,-1)?(u=!0,a=i,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):a=!1;if(a&&(a=u||o),(c===1||Vc===r)&&(Bc===r||Qw===r?g=t:g=t+1,y=e.position-e.lineStart,c===1?a&&(ww(e,y)||O3(e,y,g))||R3(e,g)?p=!0:(s&&A3(e,g)||I3(e,g)||z3(e,g)?p=!0:j3(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&j(e,"alias node should not have any properties")):E3(e,g,Bc===r)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=a&&ww(e,y))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&j(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),l=0,d=e.implicitTypes.length;l<d;l+=1)if(h=e.implicitTypes[l],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(fn.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,f=e.typeMap.multi[e.kind||"fallback"],l=0,d=f.length;l<d;l+=1)if(e.tag.slice(0,f[l].tag.length)===f[l].tag){h=f[l];break}h||j(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&j(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):j(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function M3(e){var t=e.position,r,n,o,i=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(je(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(i=!0,s=e.input.charCodeAt(++e.position),r=e.position;s!==0&&!kt(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),o=[],n.length<1&&j(e,"directive name must not be less than one character in length");s!==0;){for(;Xn(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!vr(s));break}if(vr(s))break;for(r=e.position;s!==0&&!kt(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}s!==0&&km(e),fn.call(bw,n)?bw[n](e,n,o):Hc(e,'unknown document directive "'+n+'"')}if(je(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,je(e,!0,-1)):i&&j(e,"directives end mark is expected"),Go(e,e.lineIndent-1,Vc,!1,!0),je(e,!0,-1),e.checkLineBreaks&&w3.test(e.input.slice(t,e.position))&&Hc(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Kc(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,je(e,!0,-1));return}if(e.position<e.length-1)j(e,"end of the stream or a document separator is expected");else return}function sk(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
56
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new C3(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,j(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)M3(r);return r.documents}function L3(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=sk(e,r);if(typeof t!="function")return n;for(var o=0,i=n.length;o<i;o+=1)t(n[o])}function Z3(e,t){var r=sk(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new dt("expected a single document in the stream, but found more")}}function aM(e,t){var r,n,o,i,s,a,c;if(t===null)return{};for(r={},n=Object.keys(t),o=0,i=n.length;o<i;o+=1)s=n[o],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),c=e.compiledTypeMap.fallback[s],c&&uk.call(c.styleAliases,a)&&(a=c.styleAliases[a]),r[s]=a;return r}function cM(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new dt("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Ze.repeat("0",n-t.length)+t}function lM(e){this.schema=e.schema||wm,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ze.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=aM(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?ws:uM,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function kw(e,t){for(var r=Ze.repeat(" ",t),n=0,o=-1,i="",s,a=e.length;n<a;)o=e.indexOf(`
|
|
57
57
|
`,n),o===-1?(s=e.slice(n),n=a):(s=e.slice(n,o+1),n=o+1),s.length&&s!==`
|
|
58
58
|
`&&(i+=r),i+=s;return i}function _m(e,t){return`
|
|
59
|
-
`+Ze.repeat(" ",e.indent*t)}function
|
|
59
|
+
`+Ze.repeat(" ",e.indent*t)}function pM(e,t){var r,n,o;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}function Wc(e){return e===V3||e===U3}function ks(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==$m||65536<=e&&e<=1114111}function Sw(e){return ks(e)&&e!==$m&&e!==B3&&e!==xs}function $w(e,t,r){var n=Sw(e),o=n&&!Wc(e);return(r?n:n&&e!==lk&&e!==pk&&e!==dk&&e!==fk&&e!==hk)&&e!==ym&&!(t===Gc&&!o)||Sw(t)&&!Wc(t)&&e===ym||t===Gc&&o}function dM(e){return ks(e)&&e!==$m&&!Wc(e)&&e!==Q3&&e!==tM&&e!==Gc&&e!==lk&&e!==pk&&e!==dk&&e!==fk&&e!==hk&&e!==ym&&e!==K3&&e!==Y3&&e!==H3&&e!==oM&&e!==X3&&e!==eM&&e!==J3&&e!==G3&&e!==W3&&e!==rM&&e!==nM}function fM(e){return!Wc(e)&&e!==Gc}function vs(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function mk(e){var t=/^\n* /;return t.test(e)}function hM(e,t,r,n,o,i,s,a){var c,u=0,p=null,l=!1,d=!1,f=n!==-1,h=-1,g=dM(vs(e,0))&&fM(vs(e,e.length-1));if(t||s)for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=vs(e,c),!ks(u))return Bo;g=g&&$w(u,p,a),p=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=vs(e,c),u===xs)l=!0,f&&(d=d||c-h-1>n&&e[h+1]!==" ",h=c);else if(!ks(u))return Bo;g=g&&$w(u,p,a),p=u}d=d||f&&c-h-1>n&&e[h+1]!==" "}return!l&&!d?g&&!s&&!o(e)?gk:i===ws?Bo:vm:r>9&&mk(e)?Bo:s?i===ws?Bo:vm:d?_k:yk}function mM(e,t,r,n,o){e.dump=(function(){if(t.length===0)return e.quotingType===ws?'""':"''";if(!e.noCompatMode&&(iM.indexOf(t)!==-1||sM.test(t)))return e.quotingType===ws?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,r),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),a=n||e.flowLevel>-1&&r>=e.flowLevel;function c(u){return pM(e,u)}switch(hM(t,a,e.indent,s,c,e.quotingType,e.forceQuotes&&!n,o)){case gk:return t;case vm:return"'"+t.replace(/'/g,"''")+"'";case yk:return"|"+Tw(t,e.indent)+Pw(kw(t,i));case _k:return">"+Tw(t,e.indent)+Pw(kw(gM(t,s),i));case Bo:return'"'+yM(t)+'"';default:throw new dt("impossible error: invalid scalar style")}})()}function Tw(e,t){var r=mk(e)?String(t):"",n=e[e.length-1]===`
|
|
60
60
|
`,o=n&&(e[e.length-2]===`
|
|
61
61
|
`||e===`
|
|
62
62
|
`),i=o?"+":n?"":"-";return r+i+`
|
|
63
63
|
`}function Pw(e){return e[e.length-1]===`
|
|
64
|
-
`?e.slice(0,-1):e}function
|
|
64
|
+
`?e.slice(0,-1):e}function gM(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=e.indexOf(`
|
|
65
65
|
`);return u=u!==-1?u:e.length,r.lastIndex=u,Cw(e.slice(0,u),t)})(),o=e[0]===`
|
|
66
66
|
`||e[0]===" ",i,s;s=r.exec(e);){var a=s[1],c=s[2];i=c[0]===" ",n+=a+(!o&&!i&&c!==""?`
|
|
67
67
|
`:"")+Cw(c,t),o=i}return n}function Cw(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,o=0,i,s=0,a=0,c="";n=r.exec(e);)a=n.index,a-o>t&&(i=s>o?s:a,c+=`
|
|
68
68
|
`+e.slice(o,i),o=i+1),s=a;return c+=`
|
|
69
69
|
`,e.length-o>t&&s>o?c+=e.slice(o,s)+`
|
|
70
|
-
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function
|
|
71
|
-
`:""}function Tm(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var
|
|
72
|
-
\r`;Ww=new Ke("tag:yaml.org,2002:binary",{kind:"scalar",resolve:
|
|
73
|
-
GODD_CONFIG \u74B0\u5883\u5909\u6570\u307E\u305F\u306F .cursor/mcp.json \u306E env.GODD_CONFIG \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let r=(0,Wo.readFileSync)(t,"utf-8"),n=hn.load(r);return bk.parse(n)}function
|
|
70
|
+
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function yM(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=vs(e,o),n=nt[r],!n&&ks(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||cM(r);return t}function _M(e,t,r){var n="",o=e.tag,i,s,a;for(i=0,s=r.length;i<s;i+=1)a=r[i],e.replacer&&(a=e.replacer.call(r,String(i),a)),(Ar(e,t,a,!1,!1)||typeof a>"u"&&Ar(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function Ew(e,t,r,n){var o="",i=e.tag,s,a,c;for(s=0,a=r.length;s<a;s+=1)c=r[s],e.replacer&&(c=e.replacer.call(r,String(s),c)),(Ar(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&Ar(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=_m(e,t)),e.dump&&xs===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=i,e.dump=o||"[]"}function vM(e,t,r){var n="",o=e.tag,i=Object.keys(r),s,a,c,u,p;for(s=0,a=i.length;s<a;s+=1)p="",n!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=i[s],u=r[c],e.replacer&&(u=e.replacer.call(r,c,u)),Ar(e,t,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ar(e,t,u,!1,!1)&&(p+=e.dump,n+=p));e.tag=o,e.dump="{"+n+"}"}function bM(e,t,r,n){var o="",i=e.tag,s=Object.keys(r),a,c,u,p,l,d;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new dt("sortKeys must be a boolean or a function");for(a=0,c=s.length;a<c;a+=1)d="",(!n||o!=="")&&(d+=_m(e,t)),u=s[a],p=r[u],e.replacer&&(p=e.replacer.call(r,u,p)),Ar(e,t+1,u,!0,!0,!0)&&(l=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,l&&(e.dump&&xs===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,l&&(d+=_m(e,t)),Ar(e,t+1,p,!0,l)&&(e.dump&&xs===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,o+=d));e.tag=i,e.dump=o||"{}"}function Iw(e,t,r){var n,o,i,s,a,c;for(o=r?e.explicitTypes:e.implicitTypes,i=0,s=o.length;i<s;i+=1)if(a=o[i],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(r?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(c=e.styleMap[a.tag]||a.defaultStyle,ck.call(a.represent)==="[object Function]")n=a.represent(t,c);else if(uk.call(a.represent,c))n=a.represent[c](t,c);else throw new dt("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function Ar(e,t,r,n,o,i,s){e.tag=null,e.dump=r,Iw(e,r,!1)||Iw(e,r,!0);var a=ck.call(e.dump),c=n,u;n&&(n=e.flowLevel<0||e.flowLevel>t);var p=a==="[object Object]"||a==="[object Array]",l,d;if(p&&(l=e.duplicates.indexOf(r),d=l!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(o=!1),d&&e.usedDuplicates[l])e.dump="*ref_"+l;else{if(p&&d&&!e.usedDuplicates[l]&&(e.usedDuplicates[l]=!0),a==="[object Object]")n&&Object.keys(e.dump).length!==0?(bM(e,t,e.dump,o),d&&(e.dump="&ref_"+l+e.dump)):(vM(e,t,e.dump),d&&(e.dump="&ref_"+l+" "+e.dump));else if(a==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?Ew(e,t-1,e.dump,o):Ew(e,t,e.dump,o),d&&(e.dump="&ref_"+l+e.dump)):(_M(e,t,e.dump),d&&(e.dump="&ref_"+l+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&mM(e,e.dump,t,i,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new dt("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function xM(e,t){var r=[],n=[],o,i;for(bm(e,r,n),o=0,i=n.length;o<i;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(i)}function bm(e,t,r){var n,o,i;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,i=e.length;o<i;o+=1)bm(e[o],t,r);else for(n=Object.keys(e),o=0,i=n.length;o<i;o+=1)bm(e[n[o]],t,r)}function wM(e,t){t=t||{};var r=new lM(t);r.noRefs||xM(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Ar(r,0,n,!0,!0)?r.dump+`
|
|
71
|
+
`:""}function Tm(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var $j,Tj,Pj,Cj,Ej,Ij,Ze,dt,Rj,Aj,Oj,Ke,Aw,Ow,Nw,Dw,jw,Mw,Lw,Zw,Jj,Xj,qw,Fw,Uw,Bw,Vw,Hw,Gw,xm,Ww,l3,p3,Kw,h3,Jw,y3,Yw,wm,fn,Bc,Qw,Xw,Vc,mm,b3,yw,x3,w3,k3,ek,tk,nk,ok,Qn,bw,q3,F3,ak,ck,uk,$m,U3,xs,B3,V3,H3,G3,ym,W3,K3,J3,Y3,lk,Q3,Gc,X3,eM,tM,rM,pk,dk,nM,fk,oM,hk,nt,iM,sM,uM,ws,gk,vm,yk,_k,Bo,kM,SM,$M,TM,PM,CM,EM,IM,zM,RM,AM,OM,NM,DM,jM,MM,hn,Pm=_(()=>{$j=zw,Tj=bj,Pj=xj,Cj=kj,Ej=Sj,Ij=wj,Ze={isNothing:$j,isObject:Tj,toArray:Pj,repeat:Cj,isNegativeZero:Ej,extend:Ij};bs.prototype=Object.create(Error.prototype);bs.prototype.constructor=bs;bs.prototype.toString=function(t){return this.name+": "+Rw(this,t)};dt=bs;Rj=zj,Aj=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Oj=["scalar","sequence","mapping"];Ke=Dj;gm.prototype.extend=function(t){var r=[],n=[];if(t instanceof Ke)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new dt("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof Ke))throw new dt("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new dt("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new dt("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(i){if(!(i instanceof Ke))throw new dt("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(gm.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=gw(o,"implicit"),o.compiledExplicit=gw(o,"explicit"),o.compiledTypeMap=jj(o.compiledImplicit,o.compiledExplicit),o};Aw=gm,Ow=new Ke("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Nw=new Ke("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Dw=new Ke("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),jw=new Aw({explicit:[Ow,Nw,Dw]});Mw=new Ke("tag:yaml.org,2002:null",{kind:"scalar",resolve:Mj,construct:Lj,predicate:Zj,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});Lw=new Ke("tag:yaml.org,2002:bool",{kind:"scalar",resolve:qj,construct:Fj,predicate:Uj,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});Zw=new Ke("tag:yaml.org,2002:int",{kind:"scalar",resolve:Gj,construct:Wj,predicate:Kj,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Jj=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");Xj=/^[-+]?[0-9]+e/;qw=new Ke("tag:yaml.org,2002:float",{kind:"scalar",resolve:Yj,construct:Qj,predicate:t3,represent:e3,defaultStyle:"lowercase"}),Fw=jw.extend({implicit:[Mw,Lw,Zw,qw]}),Uw=Fw,Bw=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Vw=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");Hw=new Ke("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r3,construct:n3,instanceOf:Date,represent:o3});Gw=new Ke("tag:yaml.org,2002:merge",{kind:"scalar",resolve:i3}),xm=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
72
|
+
\r`;Ww=new Ke("tag:yaml.org,2002:binary",{kind:"scalar",resolve:s3,construct:a3,predicate:u3,represent:c3}),l3=Object.prototype.hasOwnProperty,p3=Object.prototype.toString;Kw=new Ke("tag:yaml.org,2002:omap",{kind:"sequence",resolve:d3,construct:f3}),h3=Object.prototype.toString;Jw=new Ke("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:m3,construct:g3}),y3=Object.prototype.hasOwnProperty;Yw=new Ke("tag:yaml.org,2002:set",{kind:"mapping",resolve:_3,construct:v3}),wm=Uw.extend({implicit:[Hw,Gw],explicit:[Ww,Kw,Jw,Yw]}),fn=Object.prototype.hasOwnProperty,Bc=1,Qw=2,Xw=3,Vc=4,mm=1,b3=2,yw=3,x3=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,w3=/[\x85\u2028\u2029]/,k3=/[,\[\]\{\}]/,ek=/^(?:!|!!|![a-z\-]+!)$/i,tk=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;nk=new Array(256),ok=new Array(256);for(Qn=0;Qn<256;Qn++)nk[Qn]=vw(Qn)?1:0,ok[Qn]=vw(Qn);bw={YAML:function(t,r,n){var o,i,s;t.version!==null&&j(t,"duplication of %YAML directive"),n.length!==1&&j(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&j(t,"ill-formed argument of the YAML directive"),i=parseInt(o[1],10),s=parseInt(o[2],10),i!==1&&j(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Hc(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var o,i;n.length!==2&&j(t,"TAG directive accepts exactly two arguments"),o=n[0],i=n[1],ek.test(o)||j(t,"ill-formed tag handle (first argument) of the TAG directive"),fn.call(t.tagMap,o)&&j(t,'there is a previously declared suffix for "'+o+'" tag handle'),tk.test(i)||j(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{j(t,"tag prefix is malformed: "+i)}t.tagMap[o]=i}};q3=L3,F3=Z3,ak={loadAll:q3,load:F3},ck=Object.prototype.toString,uk=Object.prototype.hasOwnProperty,$m=65279,U3=9,xs=10,B3=13,V3=32,H3=33,G3=34,ym=35,W3=37,K3=38,J3=39,Y3=42,lk=44,Q3=45,Gc=58,X3=61,eM=62,tM=63,rM=64,pk=91,dk=93,nM=96,fk=123,oM=124,hk=125,nt={};nt[0]="\\0";nt[7]="\\a";nt[8]="\\b";nt[9]="\\t";nt[10]="\\n";nt[11]="\\v";nt[12]="\\f";nt[13]="\\r";nt[27]="\\e";nt[34]='\\"';nt[92]="\\\\";nt[133]="\\N";nt[160]="\\_";nt[8232]="\\L";nt[8233]="\\P";iM=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],sM=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;uM=1,ws=2;gk=1,vm=2,yk=3,_k=4,Bo=5;kM=wM,SM={dump:kM};$M=Ke,TM=Aw,PM=jw,CM=Fw,EM=Uw,IM=wm,zM=ak.load,RM=ak.loadAll,AM=SM.dump,OM=dt,NM={binary:Ww,float:qw,map:Dw,null:Mw,pairs:Jw,set:Yw,timestamp:Hw,bool:Lw,int:Zw,merge:Gw,omap:Kw,seq:Nw,str:Ow},DM=Tm("safeLoad","load"),jM=Tm("safeLoadAll","loadAll"),MM=Tm("safeDump","dump"),hn={Type:$M,Schema:TM,FAILSAFE_SCHEMA:PM,JSON_SCHEMA:CM,CORE_SCHEMA:EM,DEFAULT_SCHEMA:IM,load:zM,loadAll:RM,dump:AM,YAMLException:OM,types:NM,safeLoad:DM,safeLoadAll:jM,safeDump:MM}});var LM,ZM,qM,FM,UM,BM,vk,bk,xk=_(()=>{"use strict";pe();LM=m.object({id:m.string(),label:m.string(),name:m.string(),mindset_template:m.string().optional()}),ZM=m.object({name:m.string(),root_dir:m.string().default("frontend"),build_command:m.string(),package_manager:m.string().default("pnpm"),mindset_template:m.string().optional()}),qM=m.object({name:m.string(),root_dir:m.string().default("backend"),architecture:m.string(),dependency_direction:m.string(),package_manager:m.string().default("uv"),mindset_template:m.string().optional()}),FM=m.object({frontend:m.string().optional(),backend:m.string().optional(),preflight_command:m.string().default("pnpm preflight"),summary:m.string().default("format/lint/typecheck/build")}),UM=m.object({name:m.string(),description:m.string(),runtime:m.enum(["python","node","unknown"]).default("unknown"),setup_hint:m.string().optional(),enabled:m.boolean().default(!0)}),BM=m.object({id:m.string(),label:m.string(),category:m.enum(["frontend","backend","testing","infra","devtool","monitoring"]),description:m.string(),url:m.string().optional(),guidance:m.string().optional()}),vk=m.object({name:m.string(),description:m.string().optional(),stacks:m.array(LM),frontend:ZM.optional(),backend:qM.optional(),quality_gate:FM.optional(),vendor:m.array(UM).optional(),tools:m.array(BM).optional()}),bk=m.object({license_key:m.string().min(1,"license_key \u306F\u5FC5\u9808\u3067\u3059"),stack_profile:m.string().optional(),components:m.array(m.string().min(1,"\u7A7A\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u540D\u306F\u7121\u52B9\u3067\u3059")).optional(),language:m.string().default("en"),registry_url:m.string().default("https://godd-registry.up.railway.app")}).refine(e=>e.stack_profile!==void 0||e.components!==void 0&&e.components.length>0,{message:"Either 'stack_profile' or 'components' must be provided"})});function wk(e){let t=e??process.env.GODD_CONFIG;if(!t)throw new Error(`${Ut} \u306E\u30D1\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002GODD_CONFIG \u74B0\u5883\u5909\u6570\u3092\u8A2D\u5B9A\u3059\u308B\u304B\u3001\u660E\u793A\u7684\u306B\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);if(!(0,Wo.existsSync)(t))throw new Error(`${Ut} \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${t}
|
|
73
|
+
GODD_CONFIG \u74B0\u5883\u5909\u6570\u307E\u305F\u306F .cursor/mcp.json \u306E env.GODD_CONFIG \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let r=(0,Wo.readFileSync)(t,"utf-8"),n=hn.load(r);return bk.parse(n)}function HM(e){let t=hn.load(e);return vk.parse(t)}function Cm(e,t){if(!VM.test(e))throw new Error(`\u30B9\u30BF\u30C3\u30AF\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u540D\u304C\u4E0D\u6B63\u3067\u3059: '${e}' \u2014 \u82F1\u6570\u5B57\u30FB\u30CF\u30A4\u30D5\u30F3\u30FB\u30C9\u30C3\u30C8\u30FB\u30A2\u30F3\u30C0\u30FC\u30B9\u30B3\u30A2\u306E\u307F\u4F7F\u7528\u53EF\u80FD\u3067\u3059\u3002`);let r=t??(0,Ss.join)(process.cwd(),"stacks"),n=(0,Ss.resolve)(r,`${e}.yaml`);if(!n.startsWith((0,Ss.resolve)(r)))throw new Error(`\u30B9\u30BF\u30C3\u30AF\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\u304C\u4E0D\u6B63\u3067\u3059: '${e}'`);if(!(0,Wo.existsSync)(n))throw new Error(`\u30B9\u30BF\u30C3\u30AF\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB '${e}' \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${n}`);let o=(0,Wo.readFileSync)(n,"utf-8");return HM(o)}var Wo,Ss,VM,Ut,Em=_(()=>{"use strict";Wo=require("node:fs"),Ss=require("node:path");Pm();xk();VM=/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/,Ut="config.godd"});function Ne(e){return e instanceof Error?e.message:String(e)}var Ko=_(()=>{"use strict"});var ft=S(Et=>{"use strict";Et.__esModule=!0;Et.extend=kk;Et.indexOf=YM;Et.escapeExpression=QM;Et.isEmpty=XM;Et.createFrame=eL;Et.blockParams=tL;Et.appendContextPath=rL;var GM={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},WM=/[&<>"'`=]/g,KM=/[&<>"'`=]/;function JM(e){return GM[e]}function kk(e){for(var t=1;t<arguments.length;t++)for(var r in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],r)&&(e[r]=arguments[t][r]);return e}var zm=Object.prototype.toString;Et.toString=zm;var Im=function(t){return typeof t=="function"};Im(/x/)&&(Et.isFunction=Im=function(e){return typeof e=="function"&&zm.call(e)==="[object Function]"});Et.isFunction=Im;var Sk=Array.isArray||function(e){return e&&typeof e=="object"?zm.call(e)==="[object Array]":!1};Et.isArray=Sk;function YM(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function QM(e){if(typeof e!="string"){if(e&&e.toHTML)return e.toHTML();if(e==null)return"";if(!e)return e+"";e=""+e}return KM.test(e)?e.replace(WM,JM):e}function XM(e){return!e&&e!==0?!0:!!(Sk(e)&&e.length===0)}function eL(e){var t=kk({},e);return t._parent=e,t}function tL(e,t){return e.path=t,e}function rL(e,t){return(e?e+".":"")+t}});var Bt=S((Jc,$k)=>{"use strict";Jc.__esModule=!0;var Rm=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function Am(e,t){var r=t&&t.loc,n=void 0,o=void 0,i=void 0,s=void 0;r&&(n=r.start.line,o=r.end.line,i=r.start.column,s=r.end.column,e+=" - "+n+":"+i);for(var a=Error.prototype.constructor.call(this,e),c=0;c<Rm.length;c++)this[Rm[c]]=a[Rm[c]];Error.captureStackTrace&&Error.captureStackTrace(this,Am);try{r&&(this.lineNumber=n,this.endLineNumber=o,Object.defineProperty?(Object.defineProperty(this,"column",{value:i,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:s,enumerable:!0})):(this.column=i,this.endColumn=s))}catch{}}Am.prototype=new Error;Jc.default=Am;$k.exports=Jc.default});var Pk=S((Yc,Tk)=>{"use strict";Yc.__esModule=!0;var Om=ft();Yc.default=function(e){e.registerHelper("blockHelperMissing",function(t,r){var n=r.inverse,o=r.fn;if(t===!0)return o(this);if(t===!1||t==null)return n(this);if(Om.isArray(t))return t.length>0?(r.ids&&(r.ids=[r.name]),e.helpers.each(t,r)):n(this);if(r.data&&r.ids){var i=Om.createFrame(r.data);i.contextPath=Om.appendContextPath(r.data.contextPath,r.name),r={data:i}}return o(t,r)})};Tk.exports=Yc.default});var Ek=S((Qc,Ck)=>{"use strict";Qc.__esModule=!0;function nL(e){return e&&e.__esModule?e:{default:e}}var $s=ft(),oL=Bt(),iL=nL(oL);Qc.default=function(e){e.registerHelper("each",function(t,r){if(!r)throw new iL.default("Must pass iterator to #each");var n=r.fn,o=r.inverse,i=0,s="",a=void 0,c=void 0;r.data&&r.ids&&(c=$s.appendContextPath(r.data.contextPath,r.ids[0])+"."),$s.isFunction(t)&&(t=t.call(this)),r.data&&(a=$s.createFrame(r.data));function u(h,g,y){a&&(a.key=h,a.index=g,a.first=g===0,a.last=!!y,c&&(a.contextPath=c+h)),s=s+n(t[h],{data:a,blockParams:$s.blockParams([t[h],h],[c+h,null])})}if(t&&typeof t=="object")if($s.isArray(t))for(var p=t.length;i<p;i++)i in t&&u(i,i,i===t.length-1);else if(typeof Symbol=="function"&&t[Symbol.iterator]){for(var l=[],d=t[Symbol.iterator](),f=d.next();!f.done;f=d.next())l.push(f.value);t=l;for(var p=t.length;i<p;i++)u(i,i,i===t.length-1)}else(function(){var h=void 0;Object.keys(t).forEach(function(g){h!==void 0&&u(h,i-1),h=g,i++}),h!==void 0&&u(h,i-1,!0)})();return i===0&&(s=o(this)),s})};Ck.exports=Qc.default});var zk=S((Xc,Ik)=>{"use strict";Xc.__esModule=!0;function sL(e){return e&&e.__esModule?e:{default:e}}var aL=Bt(),cL=sL(aL);Xc.default=function(e){e.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new cL.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};Ik.exports=Xc.default});var Nk=S((eu,Ok)=>{"use strict";eu.__esModule=!0;function uL(e){return e&&e.__esModule?e:{default:e}}var Rk=ft(),lL=Bt(),Ak=uL(lL);eu.default=function(e){e.registerHelper("if",function(t,r){if(arguments.length!=2)throw new Ak.default("#if requires exactly one argument");return Rk.isFunction(t)&&(t=t.call(this)),!r.hash.includeZero&&!t||Rk.isEmpty(t)?r.inverse(this):r.fn(this)}),e.registerHelper("unless",function(t,r){if(arguments.length!=2)throw new Ak.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:r.inverse,inverse:r.fn,hash:r.hash})})};Ok.exports=eu.default});var jk=S((tu,Dk)=>{"use strict";tu.__esModule=!0;tu.default=function(e){e.registerHelper("log",function(){for(var t=[void 0],r=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)t.push(arguments[n]);var o=1;r.hash.level!=null?o=r.hash.level:r.data&&r.data.level!=null&&(o=r.data.level),t[0]=o,e.log.apply(e,t)})};Dk.exports=tu.default});var Lk=S((ru,Mk)=>{"use strict";ru.__esModule=!0;ru.default=function(e){e.registerHelper("lookup",function(t,r,n){return t&&n.lookupProperty(t,r)})};Mk.exports=ru.default});var qk=S((nu,Zk)=>{"use strict";nu.__esModule=!0;function pL(e){return e&&e.__esModule?e:{default:e}}var Ts=ft(),dL=Bt(),fL=pL(dL);nu.default=function(e){e.registerHelper("with",function(t,r){if(arguments.length!=2)throw new fL.default("#with requires exactly one argument");Ts.isFunction(t)&&(t=t.call(this));var n=r.fn;if(Ts.isEmpty(t))return r.inverse(this);var o=r.data;return r.data&&r.ids&&(o=Ts.createFrame(r.data),o.contextPath=Ts.appendContextPath(r.data.contextPath,r.ids[0])),n(t,{data:o,blockParams:Ts.blockParams([t],[o&&o.contextPath])})})};Zk.exports=nu.default});var Nm=S(ou=>{"use strict";ou.__esModule=!0;ou.registerDefaultHelpers=CL;ou.moveHelperToHooks=EL;function eo(e){return e&&e.__esModule?e:{default:e}}var hL=Pk(),mL=eo(hL),gL=Ek(),yL=eo(gL),_L=zk(),vL=eo(_L),bL=Nk(),xL=eo(bL),wL=jk(),kL=eo(wL),SL=Lk(),$L=eo(SL),TL=qk(),PL=eo(TL);function CL(e){mL.default(e),yL.default(e),vL.default(e),xL.default(e),kL.default(e),$L.default(e),PL.default(e)}function EL(e,t,r){e.helpers[t]&&(e.hooks[t]=e.helpers[t],r||delete e.helpers[t])}});var Uk=S((iu,Fk)=>{"use strict";iu.__esModule=!0;var IL=ft();iu.default=function(e){e.registerDecorator("inline",function(t,r,n,o){var i=t;return r.partials||(r.partials={},i=function(s,a){var c=n.partials;n.partials=IL.extend({},c,r.partials);var u=t(s,a);return n.partials=c,u}),r.partials[o.args[0]]=o.fn,i})};Fk.exports=iu.default});var Bk=S(Dm=>{"use strict";Dm.__esModule=!0;Dm.registerDefaultDecorators=OL;function zL(e){return e&&e.__esModule?e:{default:e}}var RL=Uk(),AL=zL(RL);function OL(e){AL.default(e)}});var jm=S((su,Vk)=>{"use strict";su.__esModule=!0;var NL=ft(),Jo={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(t){if(typeof t=="string"){var r=NL.indexOf(Jo.methodMap,t.toLowerCase());r>=0?t=r:t=parseInt(t,10)}return t},log:function(t){if(t=Jo.lookupLevel(t),typeof console<"u"&&Jo.lookupLevel(Jo.level)<=t){var r=Jo.methodMap[t];console[r]||(r="log");for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];console[r].apply(console,o)}}};su.default=Jo;Vk.exports=su.default});var Hk=S(Mm=>{"use strict";Mm.__esModule=!0;Mm.createNewLookupObject=jL;var DL=ft();function jL(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return DL.extend.apply(void 0,[Object.create(null)].concat(t))}});var Lm=S(Ps=>{"use strict";Ps.__esModule=!0;Ps.createProtoAccessControl=qL;Ps.resultIsAllowed=FL;Ps.resetLoggedProperties=BL;function ML(e){return e&&e.__esModule?e:{default:e}}var Gk=Hk(),LL=jm(),ZL=ML(LL),au=Object.create(null);function qL(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var r=Object.create(null);return r.__proto__=!1,{properties:{whitelist:Gk.createNewLookupObject(r,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:Gk.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}}function FL(e,t,r){return Wk(typeof e=="function"?t.methods:t.properties,r)}function Wk(e,t){return e.whitelist[t]!==void 0?e.whitelist[t]===!0:e.defaultValue!==void 0?e.defaultValue:(UL(t),!1)}function UL(e){au[e]!==!0&&(au[e]=!0,ZL.default.log("error",'Handlebars: Access has been denied to resolve the property "'+e+`" because it is not an "own property" of its parent.
|
|
74
74
|
You can add a runtime option to disable the check or this warning:
|
|
75
|
-
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function
|
|
75
|
+
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function BL(){Object.keys(au).forEach(function(e){delete au[e]})}});var uu=S(br=>{"use strict";br.__esModule=!0;br.HandlebarsEnvironment=Fm;function Kk(e){return e&&e.__esModule?e:{default:e}}var to=ft(),VL=Bt(),Zm=Kk(VL),HL=Nm(),GL=Bk(),WL=jm(),cu=Kk(WL),KL=Lm(),JL="4.7.8";br.VERSION=JL;var YL=8;br.COMPILER_REVISION=YL;var QL=7;br.LAST_COMPATIBLE_COMPILER_REVISION=QL;var XL={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};br.REVISION_CHANGES=XL;var qm="[object Object]";function Fm(e,t,r){this.helpers=e||{},this.partials=t||{},this.decorators=r||{},HL.registerDefaultHelpers(this),GL.registerDefaultDecorators(this)}Fm.prototype={constructor:Fm,logger:cu.default,log:cu.default.log,registerHelper:function(t,r){if(to.toString.call(t)===qm){if(r)throw new Zm.default("Arg not supported with multiple helpers");to.extend(this.helpers,t)}else this.helpers[t]=r},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,r){if(to.toString.call(t)===qm)to.extend(this.partials,t);else{if(typeof r>"u")throw new Zm.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=r}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,r){if(to.toString.call(t)===qm){if(r)throw new Zm.default("Arg not supported with multiple decorators");to.extend(this.decorators,t)}else this.decorators[t]=r},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){KL.resetLoggedProperties()}};var e9=cu.default.log;br.log=e9;br.createFrame=to.createFrame;br.logger=cu.default});var Yk=S((lu,Jk)=>{"use strict";lu.__esModule=!0;function Um(e){this.string=e}Um.prototype.toString=Um.prototype.toHTML=function(){return""+this.string};lu.default=Um;Jk.exports=lu.default});var Qk=S(Bm=>{"use strict";Bm.__esModule=!0;Bm.wrapHelper=t9;function t9(e,t){if(typeof e!="function")return e;var r=function(){var o=arguments[arguments.length-1];return arguments[arguments.length-1]=t(o),e.apply(this,arguments)};return r}});var nS=S(mn=>{"use strict";mn.__esModule=!0;mn.checkRevision=a9;mn.template=c9;mn.wrapProgram=pu;mn.resolvePartial=u9;mn.invokePartial=l9;mn.noop=tS;function r9(e){return e&&e.__esModule?e:{default:e}}function n9(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var o9=ft(),Or=n9(o9),i9=Bt(),Nr=r9(i9),Dr=uu(),Xk=Nm(),s9=Qk(),eS=Lm();function a9(e){var t=e&&e[0]||1,r=Dr.COMPILER_REVISION;if(!(t>=Dr.LAST_COMPATIBLE_COMPILER_REVISION&&t<=Dr.COMPILER_REVISION))if(t<Dr.LAST_COMPATIBLE_COMPILER_REVISION){var n=Dr.REVISION_CHANGES[r],o=Dr.REVISION_CHANGES[t];throw new Nr.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+o+").")}else throw new Nr.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")}function c9(e,t){if(!t)throw new Nr.default("No environment passed to template");if(!e||!e.main)throw new Nr.default("Unknown template object: "+typeof e);e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var r=e.compiler&&e.compiler[0]===7;function n(s,a,c){c.hash&&(a=Or.extend({},a,c.hash),c.ids&&(c.ids[0]=!0)),s=t.VM.resolvePartial.call(this,s,a,c);var u=Or.extend({},c,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),p=t.VM.invokePartial.call(this,s,a,u);if(p==null&&t.compile&&(c.partials[c.name]=t.compile(s,e.compilerOptions,t),p=c.partials[c.name](a,u)),p!=null){if(c.indent){for(var l=p.split(`
|
|
76
76
|
`),d=0,f=l.length;d<f&&!(!l[d]&&d+1===f);d++)l[d]=c.indent+l[d];p=l.join(`
|
|
77
|
-
`)}return p}else throw new Nr.default("The partial "+c.name+" could not be compiled when running in runtime-only mode")}var o={strict:function(a,c,u){if(!a||!(c in a))throw new Nr.default('"'+c+'" not defined in '+a,{loc:u});return o.lookupProperty(a,c)},lookupProperty:function(a,c){var u=a[c];if(u==null||Object.prototype.hasOwnProperty.call(a,c)||eS.resultIsAllowed(u,o.protoAccessControl,c))return u},lookup:function(a,c){for(var u=a.length,p=0;p<u;p++){var l=a[p]&&o.lookupProperty(a[p],c);if(l!=null)return a[p][c]}},lambda:function(a,c){return typeof a=="function"?a.call(c):a},escapeExpression:Or.escapeExpression,invokePartial:n,fn:function(a){var c=e[a];return c.decorator=e[a+"_d"],c},programs:[],program:function(a,c,u,p,l){var d=this.programs[a],f=this.fn(a);return c||l||p||u?d=pu(this,a,f,c,u,p,l):d||(d=this.programs[a]=pu(this,a,f)),d},data:function(a,c){for(;a&&c--;)a=a._parent;return a},mergeIfNeeded:function(a,c){var u=a||c;return a&&c&&a!==c&&(u=Or.extend({},c,a)),u},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:e.compiler};function i(s){var a=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],c=a.data;i._setup(a),!a.partial&&e.useData&&(c=s9(s,c));var u=void 0,p=e.useBlockParams?[]:void 0;e.useDepths&&(a.depths?u=s!=a.depths[0]?[s].concat(a.depths):a.depths:u=[s]);function l(d){return""+e.main(o,d,o.helpers,o.partials,c,p,u)}return l=rS(e.main,l,o,a.depths||[],c,p),l(s,a)}return i.isTop=!0,i._setup=function(s){if(s.partial)o.protoAccessControl=s.protoAccessControl,o.helpers=s.helpers,o.partials=s.partials,o.decorators=s.decorators,o.hooks=s.hooks;else{var a=Or.extend({},t.helpers,s.helpers);a9(a,o),o.helpers=a,e.usePartial&&(o.partials=o.mergeIfNeeded(s.partials,t.partials)),(e.usePartial||e.useDecorators)&&(o.decorators=Or.extend({},t.decorators,s.decorators)),o.hooks={},o.protoAccessControl=eS.createProtoAccessControl(s);var c=s.allowCallsToHelperMissing||r;Xk.moveHelperToHooks(o,"helperMissing",c),Xk.moveHelperToHooks(o,"blockHelperMissing",c)}},i._child=function(s,a,c,u){if(e.useBlockParams&&!c)throw new Nr.default("must pass block params");if(e.useDepths&&!u)throw new Nr.default("must pass parent depths");return pu(o,s,e[s],a,0,c,u)},i}function pu(e,t,r,n,o,i,s){function a(c){var u=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],p=s;return s&&c!=s[0]&&!(c===e.nullContext&&s[0]===null)&&(p=[c].concat(s)),r(e,c,e.helpers,e.partials,u.data||n,i&&[u.blockParams].concat(i),p)}return a=rS(r,a,e,s,n,i),a.program=t,a.depth=s?s.length:0,a.blockParams=o||0,a}function o9(e,t,r){return e?!e.call&&!r.name&&(r.name=e,e=r.partials[e]):r.name==="@partial-block"?e=r.data["partial-block"]:e=r.partials[r.name],e}function i9(e,t,r){var n=r.data&&r.data["partial-block"];r.partial=!0,r.ids&&(r.data.contextPath=r.ids[0]||r.data.contextPath);var o=void 0;if(r.fn&&r.fn!==tS&&(function(){r.data=Dr.createFrame(r.data);var i=r.fn;o=r.data["partial-block"]=function(a){var c=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return c.data=Dr.createFrame(c.data),c.data["partial-block"]=n,i(a,c)},i.partials&&(r.partials=Or.extend({},r.partials,i.partials))})(),e===void 0&&o&&(e=o),e===void 0)throw new Nr.default("The partial "+r.name+" could not be found");if(e instanceof Function)return e(t,r)}function tS(){return""}function s9(e,t){return(!t||!("root"in t))&&(t=t?Dr.createFrame(t):{},t.root=e),t}function rS(e,t,r,n,o,i){if(e.decorator){var s={};t=e.decorator(t,s,r,n&&n[0],o,i,n),Or.extend(t,s)}return t}function a9(e,t){Object.keys(e).forEach(function(r){var n=e[r];e[r]=c9(n,t)})}function c9(e,t){var r=t.lookupProperty;return t9.wrapHelper(e,function(n){return Or.extend({lookupProperty:r},n)})}});var Vm=S((du,oS)=>{"use strict";du.__esModule=!0;du.default=function(e){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var t=globalThis.Handlebars;e.noConflict=function(){return globalThis.Handlebars===e&&(globalThis.Handlebars=t),e}};oS.exports=du.default});var uS=S((fu,cS)=>{"use strict";fu.__esModule=!0;function Gm(e){return e&&e.__esModule?e:{default:e}}function Wm(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var u9=uu(),iS=Wm(u9),l9=Yk(),p9=Gm(l9),d9=Bt(),f9=Gm(d9),h9=ft(),Hm=Wm(h9),m9=nS(),sS=Wm(m9),g9=Vm(),y9=Gm(g9);function aS(){var e=new iS.HandlebarsEnvironment;return Hm.extend(e,iS),e.SafeString=p9.default,e.Exception=f9.default,e.Utils=Hm,e.escapeExpression=Hm.escapeExpression,e.VM=sS,e.template=function(t){return sS.template(t,e)},e}var Cs=aS();Cs.create=aS;y9.default(Cs);Cs.default=Cs;fu.default=Cs;cS.exports=fu.default});var Km=S((hu,pS)=>{"use strict";hu.__esModule=!0;var lS={helpers:{helperExpression:function(t){return t.type==="SubExpression"||(t.type==="MustacheStatement"||t.type==="BlockStatement")&&!!(t.params&&t.params.length||t.hash)},scopedId:function(t){return/^\.|this\b/.test(t.original)},simpleId:function(t){return t.parts.length===1&&!lS.helpers.scopedId(t)&&!t.depth}}};hu.default=lS;pS.exports=hu.default});var fS=S((mu,dS)=>{"use strict";mu.__esModule=!0;var _9=(function(){var e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(o,i,s,a,c,u,p){var l=u.length-1;switch(c){case 1:return u[l-1];case 2:this.$=a.prepareProgram(u[l]);break;case 3:this.$=u[l];break;case 4:this.$=u[l];break;case 5:this.$=u[l];break;case 6:this.$=u[l];break;case 7:this.$=u[l];break;case 8:this.$=u[l];break;case 9:this.$={type:"CommentStatement",value:a.stripComment(u[l]),strip:a.stripFlags(u[l],u[l]),loc:a.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:u[l],value:u[l],loc:a.locInfo(this._$)};break;case 11:this.$=a.prepareRawBlock(u[l-2],u[l-1],u[l],this._$);break;case 12:this.$={path:u[l-3],params:u[l-2],hash:u[l-1]};break;case 13:this.$=a.prepareBlock(u[l-3],u[l-2],u[l-1],u[l],!1,this._$);break;case 14:this.$=a.prepareBlock(u[l-3],u[l-2],u[l-1],u[l],!0,this._$);break;case 15:this.$={open:u[l-5],path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 16:this.$={path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 17:this.$={path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 18:this.$={strip:a.stripFlags(u[l-1],u[l-1]),program:u[l]};break;case 19:var d=a.prepareBlock(u[l-2],u[l-1],u[l],u[l],!1,this._$),f=a.prepareProgram([d],u[l-1].loc);f.chained=!0,this.$={strip:u[l-2].strip,program:f,chain:!0};break;case 20:this.$=u[l];break;case 21:this.$={path:u[l-1],strip:a.stripFlags(u[l-2],u[l])};break;case 22:this.$=a.prepareMustache(u[l-3],u[l-2],u[l-1],u[l-4],a.stripFlags(u[l-4],u[l]),this._$);break;case 23:this.$=a.prepareMustache(u[l-3],u[l-2],u[l-1],u[l-4],a.stripFlags(u[l-4],u[l]),this._$);break;case 24:this.$={type:"PartialStatement",name:u[l-3],params:u[l-2],hash:u[l-1],indent:"",strip:a.stripFlags(u[l-4],u[l]),loc:a.locInfo(this._$)};break;case 25:this.$=a.preparePartialBlock(u[l-2],u[l-1],u[l],this._$);break;case 26:this.$={path:u[l-3],params:u[l-2],hash:u[l-1],strip:a.stripFlags(u[l-4],u[l])};break;case 27:this.$=u[l];break;case 28:this.$=u[l];break;case 29:this.$={type:"SubExpression",path:u[l-3],params:u[l-2],hash:u[l-1],loc:a.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:u[l],loc:a.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:a.id(u[l-2]),value:u[l],loc:a.locInfo(this._$)};break;case 32:this.$=a.id(u[l-1]);break;case 33:this.$=u[l];break;case 34:this.$=u[l];break;case 35:this.$={type:"StringLiteral",value:u[l],original:u[l],loc:a.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(u[l]),original:Number(u[l]),loc:a.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:u[l]==="true",original:u[l]==="true",loc:a.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:a.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:a.locInfo(this._$)};break;case 40:this.$=u[l];break;case 41:this.$=u[l];break;case 42:this.$=a.preparePath(!0,u[l],this._$);break;case 43:this.$=a.preparePath(!1,u[l],this._$);break;case 44:u[l-2].push({part:a.id(u[l]),original:u[l],separator:u[l-1]}),this.$=u[l-2];break;case 45:this.$=[{part:a.id(u[l]),original:u[l]}];break;case 46:this.$=[];break;case 47:u[l-1].push(u[l]);break;case 48:this.$=[];break;case 49:u[l-1].push(u[l]);break;case 50:this.$=[];break;case 51:u[l-1].push(u[l]);break;case 58:this.$=[];break;case 59:u[l-1].push(u[l]);break;case 64:this.$=[];break;case 65:u[l-1].push(u[l]);break;case 70:this.$=[];break;case 71:u[l-1].push(u[l]);break;case 78:this.$=[];break;case 79:u[l-1].push(u[l]);break;case 82:this.$=[];break;case 83:u[l-1].push(u[l]);break;case 86:this.$=[];break;case 87:u[l-1].push(u[l]);break;case 90:this.$=[];break;case 91:u[l-1].push(u[l]);break;case 94:this.$=[];break;case 95:u[l-1].push(u[l]);break;case 98:this.$=[u[l]];break;case 99:u[l-1].push(u[l]);break;case 100:this.$=[u[l]];break;case 101:u[l-1].push(u[l]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(o,i){throw new Error(o)},parse:function(o){var i=this,s=[0],a=[null],c=[],u=this.table,p="",l=0,d=0,f=0,h=2,g=1;this.lexer.setInput(o),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var y=this.lexer.yylloc;c.push(y);var b=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function v(ar){s.length=s.length-2*ar,a.length=a.length-ar,c.length=c.length-ar}function k(){var ar;return ar=i.lexer.lex()||1,typeof ar!="number"&&(ar=i.symbols_[ar]||ar),ar}for(var C,T,F,Y,Ie,ht,we={},Qe,Rt,li,uo;;){if(F=s[s.length-1],this.defaultActions[F]?Y=this.defaultActions[F]:((C===null||typeof C>"u")&&(C=k()),Y=u[F]&&u[F][C]),typeof Y>"u"||!Y.length||!Y[0]){var Fu="";if(!f){uo=[];for(Qe in u[F])this.terminals_[Qe]&&Qe>2&&uo.push("'"+this.terminals_[Qe]+"'");this.lexer.showPosition?Fu="Parse error on line "+(l+1)+`:
|
|
77
|
+
`)}return p}else throw new Nr.default("The partial "+c.name+" could not be compiled when running in runtime-only mode")}var o={strict:function(a,c,u){if(!a||!(c in a))throw new Nr.default('"'+c+'" not defined in '+a,{loc:u});return o.lookupProperty(a,c)},lookupProperty:function(a,c){var u=a[c];if(u==null||Object.prototype.hasOwnProperty.call(a,c)||eS.resultIsAllowed(u,o.protoAccessControl,c))return u},lookup:function(a,c){for(var u=a.length,p=0;p<u;p++){var l=a[p]&&o.lookupProperty(a[p],c);if(l!=null)return a[p][c]}},lambda:function(a,c){return typeof a=="function"?a.call(c):a},escapeExpression:Or.escapeExpression,invokePartial:n,fn:function(a){var c=e[a];return c.decorator=e[a+"_d"],c},programs:[],program:function(a,c,u,p,l){var d=this.programs[a],f=this.fn(a);return c||l||p||u?d=pu(this,a,f,c,u,p,l):d||(d=this.programs[a]=pu(this,a,f)),d},data:function(a,c){for(;a&&c--;)a=a._parent;return a},mergeIfNeeded:function(a,c){var u=a||c;return a&&c&&a!==c&&(u=Or.extend({},c,a)),u},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:e.compiler};function i(s){var a=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],c=a.data;i._setup(a),!a.partial&&e.useData&&(c=p9(s,c));var u=void 0,p=e.useBlockParams?[]:void 0;e.useDepths&&(a.depths?u=s!=a.depths[0]?[s].concat(a.depths):a.depths:u=[s]);function l(d){return""+e.main(o,d,o.helpers,o.partials,c,p,u)}return l=rS(e.main,l,o,a.depths||[],c,p),l(s,a)}return i.isTop=!0,i._setup=function(s){if(s.partial)o.protoAccessControl=s.protoAccessControl,o.helpers=s.helpers,o.partials=s.partials,o.decorators=s.decorators,o.hooks=s.hooks;else{var a=Or.extend({},t.helpers,s.helpers);d9(a,o),o.helpers=a,e.usePartial&&(o.partials=o.mergeIfNeeded(s.partials,t.partials)),(e.usePartial||e.useDecorators)&&(o.decorators=Or.extend({},t.decorators,s.decorators)),o.hooks={},o.protoAccessControl=eS.createProtoAccessControl(s);var c=s.allowCallsToHelperMissing||r;Xk.moveHelperToHooks(o,"helperMissing",c),Xk.moveHelperToHooks(o,"blockHelperMissing",c)}},i._child=function(s,a,c,u){if(e.useBlockParams&&!c)throw new Nr.default("must pass block params");if(e.useDepths&&!u)throw new Nr.default("must pass parent depths");return pu(o,s,e[s],a,0,c,u)},i}function pu(e,t,r,n,o,i,s){function a(c){var u=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],p=s;return s&&c!=s[0]&&!(c===e.nullContext&&s[0]===null)&&(p=[c].concat(s)),r(e,c,e.helpers,e.partials,u.data||n,i&&[u.blockParams].concat(i),p)}return a=rS(r,a,e,s,n,i),a.program=t,a.depth=s?s.length:0,a.blockParams=o||0,a}function u9(e,t,r){return e?!e.call&&!r.name&&(r.name=e,e=r.partials[e]):r.name==="@partial-block"?e=r.data["partial-block"]:e=r.partials[r.name],e}function l9(e,t,r){var n=r.data&&r.data["partial-block"];r.partial=!0,r.ids&&(r.data.contextPath=r.ids[0]||r.data.contextPath);var o=void 0;if(r.fn&&r.fn!==tS&&(function(){r.data=Dr.createFrame(r.data);var i=r.fn;o=r.data["partial-block"]=function(a){var c=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return c.data=Dr.createFrame(c.data),c.data["partial-block"]=n,i(a,c)},i.partials&&(r.partials=Or.extend({},r.partials,i.partials))})(),e===void 0&&o&&(e=o),e===void 0)throw new Nr.default("The partial "+r.name+" could not be found");if(e instanceof Function)return e(t,r)}function tS(){return""}function p9(e,t){return(!t||!("root"in t))&&(t=t?Dr.createFrame(t):{},t.root=e),t}function rS(e,t,r,n,o,i){if(e.decorator){var s={};t=e.decorator(t,s,r,n&&n[0],o,i,n),Or.extend(t,s)}return t}function d9(e,t){Object.keys(e).forEach(function(r){var n=e[r];e[r]=f9(n,t)})}function f9(e,t){var r=t.lookupProperty;return s9.wrapHelper(e,function(n){return Or.extend({lookupProperty:r},n)})}});var Vm=S((du,oS)=>{"use strict";du.__esModule=!0;du.default=function(e){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var t=globalThis.Handlebars;e.noConflict=function(){return globalThis.Handlebars===e&&(globalThis.Handlebars=t),e}};oS.exports=du.default});var uS=S((fu,cS)=>{"use strict";fu.__esModule=!0;function Gm(e){return e&&e.__esModule?e:{default:e}}function Wm(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var h9=uu(),iS=Wm(h9),m9=Yk(),g9=Gm(m9),y9=Bt(),_9=Gm(y9),v9=ft(),Hm=Wm(v9),b9=nS(),sS=Wm(b9),x9=Vm(),w9=Gm(x9);function aS(){var e=new iS.HandlebarsEnvironment;return Hm.extend(e,iS),e.SafeString=g9.default,e.Exception=_9.default,e.Utils=Hm,e.escapeExpression=Hm.escapeExpression,e.VM=sS,e.template=function(t){return sS.template(t,e)},e}var Cs=aS();Cs.create=aS;w9.default(Cs);Cs.default=Cs;fu.default=Cs;cS.exports=fu.default});var Km=S((hu,pS)=>{"use strict";hu.__esModule=!0;var lS={helpers:{helperExpression:function(t){return t.type==="SubExpression"||(t.type==="MustacheStatement"||t.type==="BlockStatement")&&!!(t.params&&t.params.length||t.hash)},scopedId:function(t){return/^\.|this\b/.test(t.original)},simpleId:function(t){return t.parts.length===1&&!lS.helpers.scopedId(t)&&!t.depth}}};hu.default=lS;pS.exports=hu.default});var fS=S((mu,dS)=>{"use strict";mu.__esModule=!0;var k9=(function(){var e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(o,i,s,a,c,u,p){var l=u.length-1;switch(c){case 1:return u[l-1];case 2:this.$=a.prepareProgram(u[l]);break;case 3:this.$=u[l];break;case 4:this.$=u[l];break;case 5:this.$=u[l];break;case 6:this.$=u[l];break;case 7:this.$=u[l];break;case 8:this.$=u[l];break;case 9:this.$={type:"CommentStatement",value:a.stripComment(u[l]),strip:a.stripFlags(u[l],u[l]),loc:a.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:u[l],value:u[l],loc:a.locInfo(this._$)};break;case 11:this.$=a.prepareRawBlock(u[l-2],u[l-1],u[l],this._$);break;case 12:this.$={path:u[l-3],params:u[l-2],hash:u[l-1]};break;case 13:this.$=a.prepareBlock(u[l-3],u[l-2],u[l-1],u[l],!1,this._$);break;case 14:this.$=a.prepareBlock(u[l-3],u[l-2],u[l-1],u[l],!0,this._$);break;case 15:this.$={open:u[l-5],path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 16:this.$={path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 17:this.$={path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 18:this.$={strip:a.stripFlags(u[l-1],u[l-1]),program:u[l]};break;case 19:var d=a.prepareBlock(u[l-2],u[l-1],u[l],u[l],!1,this._$),f=a.prepareProgram([d],u[l-1].loc);f.chained=!0,this.$={strip:u[l-2].strip,program:f,chain:!0};break;case 20:this.$=u[l];break;case 21:this.$={path:u[l-1],strip:a.stripFlags(u[l-2],u[l])};break;case 22:this.$=a.prepareMustache(u[l-3],u[l-2],u[l-1],u[l-4],a.stripFlags(u[l-4],u[l]),this._$);break;case 23:this.$=a.prepareMustache(u[l-3],u[l-2],u[l-1],u[l-4],a.stripFlags(u[l-4],u[l]),this._$);break;case 24:this.$={type:"PartialStatement",name:u[l-3],params:u[l-2],hash:u[l-1],indent:"",strip:a.stripFlags(u[l-4],u[l]),loc:a.locInfo(this._$)};break;case 25:this.$=a.preparePartialBlock(u[l-2],u[l-1],u[l],this._$);break;case 26:this.$={path:u[l-3],params:u[l-2],hash:u[l-1],strip:a.stripFlags(u[l-4],u[l])};break;case 27:this.$=u[l];break;case 28:this.$=u[l];break;case 29:this.$={type:"SubExpression",path:u[l-3],params:u[l-2],hash:u[l-1],loc:a.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:u[l],loc:a.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:a.id(u[l-2]),value:u[l],loc:a.locInfo(this._$)};break;case 32:this.$=a.id(u[l-1]);break;case 33:this.$=u[l];break;case 34:this.$=u[l];break;case 35:this.$={type:"StringLiteral",value:u[l],original:u[l],loc:a.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(u[l]),original:Number(u[l]),loc:a.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:u[l]==="true",original:u[l]==="true",loc:a.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:a.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:a.locInfo(this._$)};break;case 40:this.$=u[l];break;case 41:this.$=u[l];break;case 42:this.$=a.preparePath(!0,u[l],this._$);break;case 43:this.$=a.preparePath(!1,u[l],this._$);break;case 44:u[l-2].push({part:a.id(u[l]),original:u[l],separator:u[l-1]}),this.$=u[l-2];break;case 45:this.$=[{part:a.id(u[l]),original:u[l]}];break;case 46:this.$=[];break;case 47:u[l-1].push(u[l]);break;case 48:this.$=[];break;case 49:u[l-1].push(u[l]);break;case 50:this.$=[];break;case 51:u[l-1].push(u[l]);break;case 58:this.$=[];break;case 59:u[l-1].push(u[l]);break;case 64:this.$=[];break;case 65:u[l-1].push(u[l]);break;case 70:this.$=[];break;case 71:u[l-1].push(u[l]);break;case 78:this.$=[];break;case 79:u[l-1].push(u[l]);break;case 82:this.$=[];break;case 83:u[l-1].push(u[l]);break;case 86:this.$=[];break;case 87:u[l-1].push(u[l]);break;case 90:this.$=[];break;case 91:u[l-1].push(u[l]);break;case 94:this.$=[];break;case 95:u[l-1].push(u[l]);break;case 98:this.$=[u[l]];break;case 99:u[l-1].push(u[l]);break;case 100:this.$=[u[l]];break;case 101:u[l-1].push(u[l]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(o,i){throw new Error(o)},parse:function(o){var i=this,s=[0],a=[null],c=[],u=this.table,p="",l=0,d=0,f=0,h=2,g=1;this.lexer.setInput(o),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var y=this.lexer.yylloc;c.push(y);var b=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function v(ar){s.length=s.length-2*ar,a.length=a.length-ar,c.length=c.length-ar}function k(){var ar;return ar=i.lexer.lex()||1,typeof ar!="number"&&(ar=i.symbols_[ar]||ar),ar}for(var C,T,U,Q,Ie,ht,we={},Qe,Rt,li,uo;;){if(U=s[s.length-1],this.defaultActions[U]?Q=this.defaultActions[U]:((C===null||typeof C>"u")&&(C=k()),Q=u[U]&&u[U][C]),typeof Q>"u"||!Q.length||!Q[0]){var Fu="";if(!f){uo=[];for(Qe in u[U])this.terminals_[Qe]&&Qe>2&&uo.push("'"+this.terminals_[Qe]+"'");this.lexer.showPosition?Fu="Parse error on line "+(l+1)+`:
|
|
78
78
|
`+this.lexer.showPosition()+`
|
|
79
|
-
Expecting `+uo.join(", ")+", got '"+(this.terminals_[C]||C)+"'":Fu="Parse error on line "+(l+1)+": Unexpected "+(C==1?"end of input":"'"+(this.terminals_[C]||C)+"'"),this.parseError(Fu,{text:this.lexer.match,token:this.terminals_[C]||C,line:this.lexer.yylineno,loc:y,expected:uo})}}if(
|
|
79
|
+
Expecting `+uo.join(", ")+", got '"+(this.terminals_[C]||C)+"'":Fu="Parse error on line "+(l+1)+": Unexpected "+(C==1?"end of input":"'"+(this.terminals_[C]||C)+"'"),this.parseError(Fu,{text:this.lexer.match,token:this.terminals_[C]||C,line:this.lexer.yylineno,loc:y,expected:uo})}}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+C);switch(Q[0]){case 1:s.push(C),a.push(this.lexer.yytext),c.push(this.lexer.yylloc),s.push(Q[1]),C=null,T?(C=T,T=null):(d=this.lexer.yyleng,p=this.lexer.yytext,l=this.lexer.yylineno,y=this.lexer.yylloc,f>0&&f--);break;case 2:if(Rt=this.productions_[Q[1]][1],we.$=a[a.length-Rt],we._$={first_line:c[c.length-(Rt||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(Rt||1)].first_column,last_column:c[c.length-1].last_column},b&&(we._$.range=[c[c.length-(Rt||1)].range[0],c[c.length-1].range[1]]),ht=this.performAction.call(we,p,d,l,this.yy,Q[1],a,c),typeof ht<"u")return ht;Rt&&(s=s.slice(0,-1*Rt*2),a=a.slice(0,-1*Rt),c=c.slice(0,-1*Rt)),s.push(this.productions_[Q[1]][0]),a.push(we.$),c.push(we._$),li=u[s[s.length-2]][s[s.length-1]],s.push(li);break;case 3:return!0}}return!0}},t=(function(){var n={EOF:1,parseError:function(i,s){if(this.yy.parser)this.yy.parser.parseError(i,s);else throw new Error(i)},setInput:function(i){return this._input=i,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var s=i.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},unput:function(i){var s=i.length,a=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s-1),this.offset-=s;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===c.length?this.yylloc.first_column:0)+c[c.length-a.length].length-a[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-s]),this},more:function(){return this._more=!0,this},less:function(i){this.unput(this.match.slice(i))},pastInput:function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var i=this.pastInput(),s=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
80
80
|
`+s+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,s,a,c,u,p;this._more||(this.yytext="",this.match="");for(var l=this._currentRules(),d=0;d<l.length&&(a=this._input.match(this.rules[l[d]]),!(a&&(!s||a[0].length>s[0].length)&&(s=a,c=d,!this.options.flex)));d++);return s?(p=s[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],i=this.performAction.call(this,this.yy,this,l[c],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
81
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var i=this.next();return typeof i<"u"?i:this.lex()},begin:function(i){this.conditionStack.push(i)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(i){this.begin(i)}};return n.options={},n.performAction=function(i,s,a,c){function u(l,d){return s.yytext=s.yytext.substring(l,s.yyleng-d+l)}var p=c;switch(a){case 0:if(s.yytext.slice(-2)==="\\\\"?(u(0,1),this.begin("mu")):s.yytext.slice(-1)==="\\"?(u(0,1),this.begin("emu")):this.begin("mu"),s.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(u(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(s.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return s.yytext=u(1,2).replace(/\\"/g,'"'),80;break;case 32:return s.yytext=u(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return s.yytext=s.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n})();e.lexer=t;function r(){this.yy={}}return r.prototype=e,e.Parser=r,new r})();mu.default=_9;dS.exports=mu.default});var vu=S((_u,gS)=>{"use strict";_u.__esModule=!0;function v9(e){return e&&e.__esModule?e:{default:e}}var b9=Bt(),Jm=v9(b9);function gu(){this.parents=[]}gu.prototype={constructor:gu,mutating:!1,acceptKey:function(t,r){var n=this.accept(t[r]);if(this.mutating){if(n&&!gu.prototype[n.type])throw new Jm.default('Unexpected node type "'+n.type+'" found when accepting '+r+" on "+t.type);t[r]=n}},acceptRequired:function(t,r){if(this.acceptKey(t,r),!t[r])throw new Jm.default(t.type+" requires "+r)},acceptArray:function(t){for(var r=0,n=t.length;r<n;r++)this.acceptKey(t,r),t[r]||(t.splice(r,1),r--,n--)},accept:function(t){if(t){if(!this[t.type])throw new Jm.default("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;var r=this[t.type](t);if(this.current=this.parents.shift(),!this.mutating||r)return r;if(r!==!1)return t}},Program:function(t){this.acceptArray(t.body)},MustacheStatement:yu,Decorator:yu,BlockStatement:hS,DecoratorBlock:hS,PartialStatement:mS,PartialBlockStatement:function(t){mS.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:yu,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(t){this.acceptArray(t.pairs)},HashPair:function(t){this.acceptRequired(t,"value")}};function yu(e){this.acceptRequired(e,"path"),this.acceptArray(e.params),this.acceptKey(e,"hash")}function hS(e){yu.call(this,e),this.acceptKey(e,"program"),this.acceptKey(e,"inverse")}function mS(e){this.acceptRequired(e,"name"),this.acceptArray(e.params),this.acceptKey(e,"hash")}_u.default=gu;gS.exports=_u.default});var _S=S((bu,yS)=>{"use strict";bu.__esModule=!0;function x9(e){return e&&e.__esModule?e:{default:e}}var w9=vu(),k9=x9(w9);function xr(){var e=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=e}xr.prototype=new k9.default;xr.prototype.Program=function(e){var t=!this.options.ignoreStandalone,r=!this.isRootSeen;this.isRootSeen=!0;for(var n=e.body,o=0,i=n.length;o<i;o++){var s=n[o],a=this.accept(s);if(a){var c=Ym(n,o,r),u=Qm(n,o,r),p=a.openStandalone&&c,l=a.closeStandalone&&u,d=a.inlineStandalone&&c&&u;a.close&&ro(n,o,!0),a.open&&gn(n,o,!0),t&&d&&(ro(n,o),gn(n,o)&&s.type==="PartialStatement"&&(s.indent=/([ \t]+$)/.exec(n[o-1].original)[1])),t&&p&&(ro((s.program||s.inverse).body),gn(n,o)),t&&l&&(ro(n,o),gn((s.inverse||s.program).body))}}return e};xr.prototype.BlockStatement=xr.prototype.DecoratorBlock=xr.prototype.PartialBlockStatement=function(e){this.accept(e.program),this.accept(e.inverse);var t=e.program||e.inverse,r=e.program&&e.inverse,n=r,o=r;if(r&&r.chained)for(n=r.body[0].program;o.chained;)o=o.body[o.body.length-1].program;var i={open:e.openStrip.open,close:e.closeStrip.close,openStandalone:Qm(t.body),closeStandalone:Ym((n||t).body)};if(e.openStrip.close&&ro(t.body,null,!0),r){var s=e.inverseStrip;s.open&&gn(t.body,null,!0),s.close&&ro(n.body,null,!0),e.closeStrip.open&&gn(o.body,null,!0),!this.options.ignoreStandalone&&Ym(t.body)&&Qm(n.body)&&(gn(t.body),ro(n.body))}else e.closeStrip.open&&gn(t.body,null,!0);return i};xr.prototype.Decorator=xr.prototype.MustacheStatement=function(e){return e.strip};xr.prototype.PartialStatement=xr.prototype.CommentStatement=function(e){var t=e.strip||{};return{inlineStandalone:!0,open:t.open,close:t.close}};function Ym(e,t,r){t===void 0&&(t=e.length);var n=e[t-1],o=e[t-2];if(!n)return r;if(n.type==="ContentStatement")return(o||!r?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(n.original)}function Qm(e,t,r){t===void 0&&(t=-1);var n=e[t+1],o=e[t+2];if(!n)return r;if(n.type==="ContentStatement")return(o||!r?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original)}function ro(e,t,r){var n=e[t==null?0:t+1];if(!(!n||n.type!=="ContentStatement"||!r&&n.rightStripped)){var o=n.value;n.value=n.value.replace(r?/^\s+/:/^[ \t]*\r?\n?/,""),n.rightStripped=n.value!==o}}function gn(e,t,r){var n=e[t==null?e.length-1:t-1];if(!(!n||n.type!=="ContentStatement"||!r&&n.leftStripped)){var o=n.value;return n.value=n.value.replace(r?/\s+$/:/[ \t]+$/,""),n.leftStripped=n.value!==o,n.leftStripped}}bu.default=xr;yS.exports=bu.default});var vS=S(Vt=>{"use strict";Vt.__esModule=!0;Vt.SourceLocation=T9;Vt.id=P9;Vt.stripFlags=C9;Vt.stripComment=E9;Vt.preparePath=I9;Vt.prepareMustache=z9;Vt.prepareRawBlock=R9;Vt.prepareBlock=A9;Vt.prepareProgram=O9;Vt.preparePartialBlock=N9;function S9(e){return e&&e.__esModule?e:{default:e}}var $9=Bt(),Xm=S9($9);function eg(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var r={loc:e.path.loc};throw new Xm.default(e.path.original+" doesn't match "+t,r)}}function T9(e,t){this.source=e,this.start={line:t.first_line,column:t.first_column},this.end={line:t.last_line,column:t.last_column}}function P9(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e}function C9(e,t){return{open:e.charAt(2)==="~",close:t.charAt(t.length-3)==="~"}}function E9(e){return e.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function I9(e,t,r){r=this.locInfo(r);for(var n=e?"@":"",o=[],i=0,s=0,a=t.length;s<a;s++){var c=t[s].part,u=t[s].original!==c;if(n+=(t[s].separator||"")+c,!u&&(c===".."||c==="."||c==="this")){if(o.length>0)throw new Xm.default("Invalid path: "+n,{loc:r});c===".."&&i++}else o.push(c)}return{type:"PathExpression",data:e,depth:i,parts:o,original:n,loc:r}}function z9(e,t,r,n,o,i){var s=n.charAt(3)||n.charAt(2),a=s!=="{"&&s!=="&",c=/\*/.test(n);return{type:c?"Decorator":"MustacheStatement",path:e,params:t,hash:r,escaped:a,strip:o,loc:this.locInfo(i)}}function R9(e,t,r,n){eg(e,r),n=this.locInfo(n);var o={type:"Program",body:t,strip:{},loc:n};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:o,openStrip:{},inverseStrip:{},closeStrip:{},loc:n}}function A9(e,t,r,n,o,i){n&&n.path&&eg(e,n);var s=/\*/.test(e.open);t.blockParams=e.blockParams;var a=void 0,c=void 0;if(r){if(s)throw new Xm.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=n.strip),c=r.strip,a=r.program}return o&&(o=a,a=t,t=o),{type:s?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:a,openStrip:e.strip,inverseStrip:c,closeStrip:n&&n.strip,loc:this.locInfo(i)}}function O9(e,t){if(!t&&e.length){var r=e[0].loc,n=e[e.length-1].loc;r&&n&&(t={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:e,strip:{},loc:t}}function N9(e,t,r,n){return eg(e,r),{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:r&&r.strip,loc:this.locInfo(n)}}});var wS=S(Es=>{"use strict";Es.__esModule=!0;Es.parseWithoutProcessing=xS;Es.parse=U9;function D9(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function bS(e){return e&&e.__esModule?e:{default:e}}var j9=fS(),tg=bS(j9),M9=_S(),L9=bS(M9),Z9=vS(),q9=D9(Z9),F9=ft();Es.parser=tg.default;var xu={};F9.extend(xu,q9);function xS(e,t){if(e.type==="Program")return e;tg.default.yy=xu,xu.locInfo=function(n){return new xu.SourceLocation(t&&t.srcName,n)};var r=tg.default.parse(e);return r}function U9(e,t){var r=xS(e,t),n=new L9.default(t);return n.accept(r)}});var TS=S(As=>{"use strict";As.__esModule=!0;As.Compiler=rg;As.precompile=G9;As.compile=W9;function SS(e){return e&&e.__esModule?e:{default:e}}var B9=Bt(),zs=SS(B9),Rs=ft(),V9=Km(),Is=SS(V9),H9=[].slice;function rg(){}rg.prototype={compiler:rg,equals:function(t){var r=this.opcodes.length;if(t.opcodes.length!==r)return!1;for(var n=0;n<r;n++){var o=this.opcodes[n],i=t.opcodes[n];if(o.opcode!==i.opcode||!$S(o.args,i.args))return!1}r=this.children.length;for(var n=0;n<r;n++)if(!this.children[n].equals(t.children[n]))return!1;return!0},guid:0,compile:function(t,r){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=r,this.stringParams=r.stringParams,this.trackIds=r.trackIds,r.blockParams=r.blockParams||[],r.knownHelpers=Rs.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},r.knownHelpers),this.accept(t)},compileProgram:function(t){var r=new this.compiler,n=r.compile(t,this.options),o=this.guid++;return this.usePartial=this.usePartial||n.usePartial,this.children[o]=n,this.useDepths=this.useDepths||n.useDepths,o},accept:function(t){if(!this[t.type])throw new zs.default("Unknown type: "+t.type,t);this.sourceNode.unshift(t);var r=this[t.type](t);return this.sourceNode.shift(),r},Program:function(t){this.options.blockParams.unshift(t.blockParams);for(var r=t.body,n=r.length,o=0;o<n;o++)this.accept(r[o]);return this.options.blockParams.shift(),this.isSimple=n===1,this.blockParams=t.blockParams?t.blockParams.length:0,this},BlockStatement:function(t){kS(t);var r=t.program,n=t.inverse;r=r&&this.compileProgram(r),n=n&&this.compileProgram(n);var o=this.classifySexpr(t);o==="helper"?this.helperSexpr(t,r,n):o==="simple"?(this.simpleSexpr(t),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,r,n),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(t){var r=t.program&&this.compileProgram(t.program),n=this.setupFullMustacheParams(t,r,void 0),o=t.path;this.useDecorators=!0,this.opcode("registerDecorator",n.length,o.original)},PartialStatement:function(t){this.usePartial=!0;var r=t.program;r&&(r=this.compileProgram(t.program));var n=t.params;if(n.length>1)throw new zs.default("Unsupported number of partial arguments: "+n.length,t);n.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):n.push({type:"PathExpression",parts:[],depth:0}));var o=t.name.original,i=t.name.type==="SubExpression";i&&this.accept(t.name),this.setupFullMustacheParams(t,r,void 0,!0);var s=t.indent||"";this.options.preventIndent&&s&&(this.opcode("appendContent",s),s=""),this.opcode("invokePartial",i,o,s),this.opcode("append")},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode("appendContent",t.value)},CommentStatement:function(){},SubExpression:function(t){kS(t);var r=this.classifySexpr(t);r==="simple"?this.simpleSexpr(t):r==="helper"?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,r,n){var o=t.path,i=o.parts[0],s=r!=null||n!=null;this.opcode("getContext",o.depth),this.opcode("pushProgram",r),this.opcode("pushProgram",n),o.strict=!0,this.accept(o),this.opcode("invokeAmbiguous",i,s)},simpleSexpr:function(t){var r=t.path;r.strict=!0,this.accept(r),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,r,n){var o=this.setupFullMustacheParams(t,r,n),i=t.path,s=i.parts[0];if(this.options.knownHelpers[s])this.opcode("invokeKnownHelper",o.length,s);else{if(this.options.knownHelpersOnly)throw new zs.default("You specified knownHelpersOnly, but used the unknown helper "+s,t);i.strict=!0,i.falsy=!0,this.accept(i),this.opcode("invokeHelper",o.length,i.original,Is.default.helpers.simpleId(i))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var r=t.parts[0],n=Is.default.helpers.scopedId(t),o=!t.depth&&!n&&this.blockParamIndex(r);o?this.opcode("lookupBlockParam",o,t.parts):r?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,n):this.opcode("pushContext")},StringLiteral:function(t){this.opcode("pushString",t.value)},NumberLiteral:function(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(t){var r=t.pairs,n=0,o=r.length;for(this.opcode("pushHash");n<o;n++)this.pushParam(r[n].value);for(;n--;)this.opcode("assignToHash",r[n].key);this.opcode("popHash")},opcode:function(t){this.opcodes.push({opcode:t,args:H9.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var r=Is.default.helpers.simpleId(t.path),n=r&&!!this.blockParamIndex(t.path.parts[0]),o=!n&&Is.default.helpers.helperExpression(t),i=!n&&(o||r);if(i&&!o){var s=t.path.parts[0],a=this.options;a.knownHelpers[s]?o=!0:a.knownHelpersOnly&&(i=!1)}return o?"helper":i?"ambiguous":"simple"},pushParams:function(t){for(var r=0,n=t.length;r<n;r++)this.pushParam(t[r])},pushParam:function(t){var r=t.value!=null?t.value:t.original||"";if(this.stringParams)r.replace&&(r=r.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",r,t.type),t.type==="SubExpression"&&this.accept(t);else{if(this.trackIds){var n=void 0;if(t.parts&&!Is.default.helpers.scopedId(t)&&!t.depth&&(n=this.blockParamIndex(t.parts[0])),n){var o=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",n,o)}else r=t.original||r,r.replace&&(r=r.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",t.type,r)}this.accept(t)}},setupFullMustacheParams:function(t,r,n,o){var i=t.params;return this.pushParams(i),this.opcode("pushProgram",r),this.opcode("pushProgram",n),t.hash?this.accept(t.hash):this.opcode("emptyHash",o),i},blockParamIndex:function(t){for(var r=0,n=this.options.blockParams.length;r<n;r++){var o=this.options.blockParams[r],i=o&&Rs.indexOf(o,t);if(o&&i>=0)return[r,i]}}};function G9(e,t,r){if(e==null||typeof e!="string"&&e.type!=="Program")throw new zs.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+e);t=t||{},"data"in t||(t.data=!0),t.compat&&(t.useDepths=!0);var n=r.parse(e,t),o=new r.Compiler().compile(n,t);return new r.JavaScriptCompiler().compile(o,t)}function W9(e,t,r){if(t===void 0&&(t={}),e==null||typeof e!="string"&&e.type!=="Program")throw new zs.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+e);t=Rs.extend({},t),"data"in t||(t.data=!0),t.compat&&(t.useDepths=!0);var n=void 0;function o(){var s=r.parse(e,t),a=new r.Compiler().compile(s,t),c=new r.JavaScriptCompiler().compile(a,t,void 0,!0);return r.template(c)}function i(s,a){return n||(n=o()),n.call(this,s,a)}return i._setup=function(s){return n||(n=o()),n._setup(s)},i._child=function(s,a,c,u){return n||(n=o()),n._child(s,a,c,u)},i}function $S(e,t){if(e===t)return!0;if(Rs.isArray(e)&&Rs.isArray(t)&&e.length===t.length){for(var r=0;r<e.length;r++)if(!$S(e[r],t[r]))return!1;return!0}}function kS(e){if(!e.path.parts){var t=e.path;e.path={type:"PathExpression",data:!1,depth:0,parts:[t.original+""],original:t.original+"",loc:t.loc}}}});var CS=S(ng=>{var PS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");ng.encode=function(e){if(0<=e&&e<PS.length)return PS[e];throw new TypeError("Must be between 0 and 63: "+e)};ng.decode=function(e){var t=65,r=90,n=97,o=122,i=48,s=57,a=43,c=47,u=26,p=52;return t<=e&&e<=r?e-t:n<=e&&e<=o?e-n+u:i<=e&&e<=s?e-i+p:e==a?62:e==c?63:-1}});var sg=S(ig=>{var ES=CS(),og=5,IS=1<<og,zS=IS-1,RS=IS;function K9(e){return e<0?(-e<<1)+1:(e<<1)+0}function J9(e){var t=(e&1)===1,r=e>>1;return t?-r:r}ig.encode=function(t){var r="",n,o=K9(t);do n=o&zS,o>>>=og,o>0&&(n|=RS),r+=ES.encode(n);while(o>0);return r};ig.decode=function(t,r,n){var o=t.length,i=0,s=0,a,c;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(c=ES.decode(t.charCodeAt(r++)),c===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));a=!!(c&RS),c&=zS,i=i+(c<<s),s+=og}while(a);n.value=J9(i),n.rest=r}});var Xo=S(ot=>{function Y9(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}ot.getArg=Y9;var AS=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Q9=/^data:.+\,.+$/;function Os(e){var t=e.match(AS);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}ot.urlParse=Os;function Yo(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}ot.urlGenerate=Yo;function ag(e){var t=e,r=Os(e);if(r){if(!r.path)return e;t=r.path}for(var n=ot.isAbsolute(t),o=t.split(/\/+/),i,s=0,a=o.length-1;a>=0;a--)i=o[a],i==="."?o.splice(a,1):i===".."?s++:s>0&&(i===""?(o.splice(a+1,s),s=0):(o.splice(a,2),s--));return t=o.join("/"),t===""&&(t=n?"/":"."),r?(r.path=t,Yo(r)):t}ot.normalize=ag;function OS(e,t){e===""&&(e="."),t===""&&(t=".");var r=Os(t),n=Os(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Yo(r);if(r||t.match(Q9))return t;if(n&&!n.host&&!n.path)return n.host=t,Yo(n);var o=t.charAt(0)==="/"?t:ag(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=o,Yo(n)):o}ot.join=OS;ot.isAbsolute=function(e){return e.charAt(0)==="/"||AS.test(e)};function X9(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}ot.relative=X9;var NS=(function(){var e=Object.create(null);return!("__proto__"in e)})();function DS(e){return e}function eZ(e){return jS(e)?"$"+e:e}ot.toSetString=NS?DS:eZ;function tZ(e){return jS(e)?e.slice(1):e}ot.fromSetString=NS?DS:tZ;function jS(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function rZ(e,t,r){var n=Qo(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:Qo(e.name,t.name)}ot.compareByOriginalPositions=rZ;function nZ(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=Qo(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:Qo(e.name,t.name)}ot.compareByGeneratedPositionsDeflated=nZ;function Qo(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function oZ(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=Qo(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:Qo(e.name,t.name)}ot.compareByGeneratedPositionsInflated=oZ;function iZ(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}ot.parseSourceMapInput=iZ;function sZ(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=Os(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}t=OS(Yo(n),t)}return ag(t)}ot.computeSourceURL=sZ});var lg=S(MS=>{var cg=Xo(),ug=Object.prototype.hasOwnProperty,no=typeof Map<"u";function jr(){this._array=[],this._set=no?new Map:Object.create(null)}jr.fromArray=function(t,r){for(var n=new jr,o=0,i=t.length;o<i;o++)n.add(t[o],r);return n};jr.prototype.size=function(){return no?this._set.size:Object.getOwnPropertyNames(this._set).length};jr.prototype.add=function(t,r){var n=no?t:cg.toSetString(t),o=no?this.has(t):ug.call(this._set,n),i=this._array.length;(!o||r)&&this._array.push(t),o||(no?this._set.set(t,i):this._set[n]=i)};jr.prototype.has=function(t){if(no)return this._set.has(t);var r=cg.toSetString(t);return ug.call(this._set,r)};jr.prototype.indexOf=function(t){if(no){var r=this._set.get(t);if(r>=0)return r}else{var n=cg.toSetString(t);if(ug.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};jr.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};jr.prototype.toArray=function(){return this._array.slice()};MS.ArraySet=jr});var qS=S(ZS=>{var LS=Xo();function aZ(e,t){var r=e.generatedLine,n=t.generatedLine,o=e.generatedColumn,i=t.generatedColumn;return n>r||n==r&&i>=o||LS.compareByGeneratedPositionsInflated(e,t)<=0}function wu(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}wu.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};wu.prototype.add=function(t){aZ(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};wu.prototype.toArray=function(){return this._sorted||(this._array.sort(LS.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};ZS.MappingList=wu});var pg=S(FS=>{var Ns=sg(),Me=Xo(),ku=lg().ArraySet,cZ=qS().MappingList;function Ht(e){e||(e={}),this._file=Me.getArg(e,"file",null),this._sourceRoot=Me.getArg(e,"sourceRoot",null),this._skipValidation=Me.getArg(e,"skipValidation",!1),this._sources=new ku,this._names=new ku,this._mappings=new cZ,this._sourcesContents=null}Ht.prototype._version=3;Ht.fromSourceMap=function(t){var r=t.sourceRoot,n=new Ht({file:t.file,sourceRoot:r});return t.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,r!=null&&(i.source=Me.relative(r,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),n.addMapping(i)}),t.sources.forEach(function(o){var i=o;r!==null&&(i=Me.relative(r,o)),n._sources.has(i)||n._sources.add(i);var s=t.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};Ht.prototype.addMapping=function(t){var r=Me.getArg(t,"generated"),n=Me.getArg(t,"original",null),o=Me.getArg(t,"source",null),i=Me.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i})};Ht.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=Me.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Me.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Me.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Ht.prototype.applySourceMap=function(t,r,n){var o=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=t.file}var i=this._sourceRoot;i!=null&&(o=Me.relative(i,o));var s=new ku,a=new ku;this._mappings.unsortedForEach(function(c){if(c.source===o&&c.originalLine!=null){var u=t.originalPositionFor({line:c.originalLine,column:c.originalColumn});u.source!=null&&(c.source=u.source,n!=null&&(c.source=Me.join(n,c.source)),i!=null&&(c.source=Me.relative(i,c.source)),c.originalLine=u.line,c.originalColumn=u.column,u.name!=null&&(c.name=u.name))}var p=c.source;p!=null&&!s.has(p)&&s.add(p);var l=c.name;l!=null&&!a.has(l)&&a.add(l)},this),this._sources=s,this._names=a,t.sources.forEach(function(c){var u=t.sourceContentFor(c);u!=null&&(n!=null&&(c=Me.join(n,c)),i!=null&&(c=Me.relative(i,c)),this.setSourceContent(c,u))},this)};Ht.prototype._validateMapping=function(t,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!o)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:o}))}};Ht.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,o=0,i=0,s=0,a="",c,u,p,l,d=this._mappings.toArray(),f=0,h=d.length;f<h;f++){if(u=d[f],c="",u.generatedLine!==r)for(t=0;u.generatedLine!==r;)c+=";",r++;else if(f>0){if(!Me.compareByGeneratedPositionsInflated(u,d[f-1]))continue;c+=","}c+=Ns.encode(u.generatedColumn-t),t=u.generatedColumn,u.source!=null&&(l=this._sources.indexOf(u.source),c+=Ns.encode(l-s),s=l,c+=Ns.encode(u.originalLine-1-o),o=u.originalLine-1,c+=Ns.encode(u.originalColumn-n),n=u.originalColumn,u.name!=null&&(p=this._names.indexOf(u.name),c+=Ns.encode(p-i),i=p)),a+=c}return a};Ht.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Me.relative(r,n));var o=Me.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};Ht.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};Ht.prototype.toString=function(){return JSON.stringify(this.toJSON())};FS.SourceMapGenerator=Ht});var US=S(oo=>{oo.GREATEST_LOWER_BOUND=1;oo.LEAST_UPPER_BOUND=2;function dg(e,t,r,n,o,i){var s=Math.floor((t-e)/2)+e,a=o(r,n[s],!0);return a===0?s:a>0?t-s>1?dg(s,t,r,n,o,i):i==oo.LEAST_UPPER_BOUND?t<n.length?t:-1:s:s-e>1?dg(e,s,r,n,o,i):i==oo.LEAST_UPPER_BOUND?s:e<0?-1:e}oo.search=function(t,r,n,o){if(r.length===0)return-1;var i=dg(-1,r.length,t,r,n,o||oo.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&n(r[i],r[i-1],!0)===0;)--i;return i}});var VS=S(BS=>{function fg(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function uZ(e,t){return Math.round(e+Math.random()*(t-e))}function hg(e,t,r,n){if(r<n){var o=uZ(r,n),i=r-1;fg(e,o,n);for(var s=e[n],a=r;a<n;a++)t(e[a],s)<=0&&(i+=1,fg(e,i,a));fg(e,i+1,a);var c=i+1;hg(e,t,r,c-1),hg(e,t,c+1,n)}}BS.quickSort=function(e,t){hg(e,t,0,e.length-1)}});var GS=S(Su=>{var R=Xo(),mg=US(),ei=lg().ArraySet,lZ=sg(),Ds=VS().quickSort;function $e(e,t){var r=e;return typeof e=="string"&&(r=R.parseSourceMapInput(e)),r.sections!=null?new nr(r,t):new Je(r,t)}$e.fromSourceMap=function(e,t){return Je.fromSourceMap(e,t)};$e.prototype._version=3;$e.prototype.__generatedMappings=null;Object.defineProperty($e.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});$e.prototype.__originalMappings=null;Object.defineProperty($e.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});$e.prototype._charIsMappingSeparator=function(t,r){var n=t.charAt(r);return n===";"||n===","};$e.prototype._parseMappings=function(t,r){throw new Error("Subclasses must implement _parseMappings")};$e.GENERATED_ORDER=1;$e.ORIGINAL_ORDER=2;$e.GREATEST_LOWER_BOUND=1;$e.LEAST_UPPER_BOUND=2;$e.prototype.eachMapping=function(t,r,n){var o=r||null,i=n||$e.GENERATED_ORDER,s;switch(i){case $e.GENERATED_ORDER:s=this._generatedMappings;break;case $e.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;s.map(function(c){var u=c.source===null?null:this._sources.at(c.source);return u=R.computeSourceURL(a,u,this._sourceMapURL),{source:u,generatedLine:c.generatedLine,generatedColumn:c.generatedColumn,originalLine:c.originalLine,originalColumn:c.originalColumn,name:c.name===null?null:this._names.at(c.name)}},this).forEach(t,o)};$e.prototype.allGeneratedPositionsFor=function(t){var r=R.getArg(t,"line"),n={source:R.getArg(t,"source"),originalLine:r,originalColumn:R.getArg(t,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",R.compareByOriginalPositions,mg.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(t.column===void 0)for(var a=s.originalLine;s&&s.originalLine===a;)o.push({line:R.getArg(s,"generatedLine",null),column:R.getArg(s,"generatedColumn",null),lastColumn:R.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var c=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==c;)o.push({line:R.getArg(s,"generatedLine",null),column:R.getArg(s,"generatedColumn",null),lastColumn:R.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};Su.SourceMapConsumer=$e;function Je(e,t){var r=e;typeof e=="string"&&(r=R.parseSourceMapInput(e));var n=R.getArg(r,"version"),o=R.getArg(r,"sources"),i=R.getArg(r,"names",[]),s=R.getArg(r,"sourceRoot",null),a=R.getArg(r,"sourcesContent",null),c=R.getArg(r,"mappings"),u=R.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=R.normalize(s)),o=o.map(String).map(R.normalize).map(function(p){return s&&R.isAbsolute(s)&&R.isAbsolute(p)?R.relative(s,p):p}),this._names=ei.fromArray(i.map(String),!0),this._sources=ei.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(p){return R.computeSourceURL(s,p,t)}),this.sourceRoot=s,this.sourcesContent=a,this._mappings=c,this._sourceMapURL=t,this.file=u}Je.prototype=Object.create($e.prototype);Je.prototype.consumer=$e;Je.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=R.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==e)return r;return-1};Je.fromSourceMap=function(t,r){var n=Object.create(Je.prototype),o=n._names=ei.fromArray(t._names.toArray(),!0),i=n._sources=ei.fromArray(t._sources.toArray(),!0);n.sourceRoot=t._sourceRoot,n.sourcesContent=t._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=t._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(f){return R.computeSourceURL(n.sourceRoot,f,r)});for(var s=t._mappings.toArray().slice(),a=n.__generatedMappings=[],c=n.__originalMappings=[],u=0,p=s.length;u<p;u++){var l=s[u],d=new HS;d.generatedLine=l.generatedLine,d.generatedColumn=l.generatedColumn,l.source&&(d.source=i.indexOf(l.source),d.originalLine=l.originalLine,d.originalColumn=l.originalColumn,l.name&&(d.name=o.indexOf(l.name)),c.push(d)),a.push(d)}return Ds(n.__originalMappings,R.compareByOriginalPositions),n};Je.prototype._version=3;Object.defineProperty(Je.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function HS(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Je.prototype._parseMappings=function(t,r){for(var n=1,o=0,i=0,s=0,a=0,c=0,u=t.length,p=0,l={},d={},f=[],h=[],g,y,b,v,k;p<u;)if(t.charAt(p)===";")n++,p++,o=0;else if(t.charAt(p)===",")p++;else{for(g=new HS,g.generatedLine=n,v=p;v<u&&!this._charIsMappingSeparator(t,v);v++);if(y=t.slice(p,v),b=l[y],b)p+=y.length;else{for(b=[];p<v;)lZ.decode(t,p,d),k=d.value,p=d.rest,b.push(k);if(b.length===2)throw new Error("Found a source, but no line and column");if(b.length===3)throw new Error("Found a source and line, but no column");l[y]=b}g.generatedColumn=o+b[0],o=g.generatedColumn,b.length>1&&(g.source=a+b[1],a+=b[1],g.originalLine=i+b[2],i=g.originalLine,g.originalLine+=1,g.originalColumn=s+b[3],s=g.originalColumn,b.length>4&&(g.name=c+b[4],c+=b[4])),h.push(g),typeof g.originalLine=="number"&&f.push(g)}Ds(h,R.compareByGeneratedPositionsDeflated),this.__generatedMappings=h,Ds(f,R.compareByOriginalPositions),this.__originalMappings=f};Je.prototype._findMapping=function(t,r,n,o,i,s){if(t[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[n]);if(t[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[o]);return mg.search(t,r,i,s)};Je.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var r=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var n=this._generatedMappings[t+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};Je.prototype.originalPositionFor=function(t){var r={generatedLine:R.getArg(t,"line"),generatedColumn:R.getArg(t,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",R.compareByGeneratedPositionsDeflated,R.getArg(t,"bias",$e.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var i=R.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=R.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=R.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:R.getArg(o,"originalLine",null),column:R.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};Je.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1};Je.prototype.sourceContentFor=function(t,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(t);if(n>=0)return this.sourcesContent[n];var o=t;this.sourceRoot!=null&&(o=R.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=R.urlParse(this.sourceRoot))){var s=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(r)return null;throw new Error('"'+o+'" is not in the SourceMap.')};Je.prototype.generatedPositionFor=function(t){var r=R.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:R.getArg(t,"line"),originalColumn:R.getArg(t,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",R.compareByOriginalPositions,R.getArg(t,"bias",$e.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:R.getArg(i,"generatedLine",null),column:R.getArg(i,"generatedColumn",null),lastColumn:R.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Su.BasicSourceMapConsumer=Je;function nr(e,t){var r=e;typeof e=="string"&&(r=R.parseSourceMapInput(e));var n=R.getArg(r,"version"),o=R.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new ei,this._names=new ei;var i={line:-1,column:0};this._sections=o.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var a=R.getArg(s,"offset"),c=R.getArg(a,"line"),u=R.getArg(a,"column");if(c<i.line||c===i.line&&u<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=a,{generatedOffset:{generatedLine:c+1,generatedColumn:u+1},consumer:new $e(R.getArg(s,"map"),t)}})}nr.prototype=Object.create($e.prototype);nr.prototype.constructor=$e;nr.prototype._version=3;Object.defineProperty(nr.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}});nr.prototype.originalPositionFor=function(t){var r={generatedLine:R.getArg(t,"line"),generatedColumn:R.getArg(t,"column")},n=mg.search(r,this._sections,function(i,s){var a=i.generatedLine-s.generatedOffset.generatedLine;return a||i.generatedColumn-s.generatedOffset.generatedColumn}),o=this._sections[n];return o?o.consumer.originalPositionFor({line:r.generatedLine-(o.generatedOffset.generatedLine-1),column:r.generatedColumn-(o.generatedOffset.generatedLine===r.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}};nr.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})};nr.prototype.sourceContentFor=function(t,r){for(var n=0;n<this._sections.length;n++){var o=this._sections[n],i=o.consumer.sourceContentFor(t,!0);if(i)return i}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')};nr.prototype.generatedPositionFor=function(t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(R.getArg(t,"source"))!==-1){var o=n.consumer.generatedPositionFor(t);if(o){var i={line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};nr.prototype._parseMappings=function(t,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var a=i[s],c=o.consumer._sources.at(a.source);c=R.computeSourceURL(o.consumer.sourceRoot,c,this._sourceMapURL),this._sources.add(c),c=this._sources.indexOf(c);var u=null;a.name&&(u=o.consumer._names.at(a.name),this._names.add(u),u=this._names.indexOf(u));var p={source:c,generatedLine:a.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(o.generatedOffset.generatedLine===a.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:u};this.__generatedMappings.push(p),typeof p.originalLine=="number"&&this.__originalMappings.push(p)}Ds(this.__generatedMappings,R.compareByGeneratedPositionsDeflated),Ds(this.__originalMappings,R.compareByOriginalPositions)};Su.IndexedSourceMapConsumer=nr});var KS=S(WS=>{var pZ=pg().SourceMapGenerator,$u=Xo(),dZ=/(\r?\n)/,fZ=10,ti="$$$isSourceNode$$$";function It(e,t,r,n,o){this.children=[],this.sourceContents={},this.line=e??null,this.column=t??null,this.source=r??null,this.name=o??null,this[ti]=!0,n!=null&&this.add(n)}It.fromStringWithSourceMap=function(t,r,n){var o=new It,i=t.split(dZ),s=0,a=function(){var d=h(),f=h()||"";return d+f;function h(){return s<i.length?i[s++]:void 0}},c=1,u=0,p=null;return r.eachMapping(function(d){if(p!==null)if(c<d.generatedLine)l(p,a()),c++,u=0;else{var f=i[s]||"",h=f.substr(0,d.generatedColumn-u);i[s]=f.substr(d.generatedColumn-u),u=d.generatedColumn,l(p,h),p=d;return}for(;c<d.generatedLine;)o.add(a()),c++;if(u<d.generatedColumn){var f=i[s]||"";o.add(f.substr(0,d.generatedColumn)),i[s]=f.substr(d.generatedColumn),u=d.generatedColumn}p=d},this),s<i.length&&(p&&l(p,a()),o.add(i.splice(s).join(""))),r.sources.forEach(function(d){var f=r.sourceContentFor(d);f!=null&&(n!=null&&(d=$u.join(n,d)),o.setSourceContent(d,f))}),o;function l(d,f){if(d===null||d.source===void 0)o.add(f);else{var h=n?$u.join(n,d.source):d.source;o.add(new It(d.originalLine,d.originalColumn,h,f,d.name))}}};It.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[ti]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};It.prototype.prepend=function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[ti]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};It.prototype.walk=function(t){for(var r,n=0,o=this.children.length;n<o;n++)r=this.children[n],r[ti]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})};It.prototype.join=function(t){var r,n,o=this.children.length;if(o>0){for(r=[],n=0;n<o-1;n++)r.push(this.children[n]),r.push(t);r.push(this.children[n]),this.children=r}return this};It.prototype.replaceRight=function(t,r){var n=this.children[this.children.length-1];return n[ti]?n.replaceRight(t,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this};It.prototype.setSourceContent=function(t,r){this.sourceContents[$u.toSetString(t)]=r};It.prototype.walkSourceContents=function(t){for(var r=0,n=this.children.length;r<n;r++)this.children[r][ti]&&this.children[r].walkSourceContents(t);for(var o=Object.keys(this.sourceContents),r=0,n=o.length;r<n;r++)t($u.fromSetString(o[r]),this.sourceContents[o[r]])};It.prototype.toString=function(){var t="";return this.walk(function(r){t+=r}),t};It.prototype.toStringWithSourceMap=function(t){var r={code:"",line:1,column:0},n=new pZ(t),o=!1,i=null,s=null,a=null,c=null;return this.walk(function(u,p){r.code+=u,p.source!==null&&p.line!==null&&p.column!==null?((i!==p.source||s!==p.line||a!==p.column||c!==p.name)&&n.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:r.line,column:r.column},name:p.name}),i=p.source,s=p.line,a=p.column,c=p.name,o=!0):o&&(n.addMapping({generated:{line:r.line,column:r.column}}),i=null,o=!1);for(var l=0,d=u.length;l<d;l++)u.charCodeAt(l)===fZ?(r.line++,r.column=0,l+1===d?(i=null,o=!1):o&&n.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:r.line,column:r.column},name:p.name})):r.column++}),this.walkSourceContents(function(u,p){n.setSourceContent(u,p)}),{code:r.code,map:n}};WS.SourceNode=It});var JS=S(Tu=>{Tu.SourceMapGenerator=pg().SourceMapGenerator;Tu.SourceMapConsumer=GS().SourceMapConsumer;Tu.SourceNode=KS().SourceNode});var e1=S((Pu,XS)=>{"use strict";Pu.__esModule=!0;var yg=ft(),io=void 0;try{(typeof define!="function"||!define.amd)&&(YS=JS(),io=YS.SourceNode)}catch{}var YS;io||(io=function(e,t,r,n){this.src="",n&&this.add(n)},io.prototype={add:function(t){yg.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){yg.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function gg(e,t,r){if(yg.isArray(e)){for(var n=[],o=0,i=e.length;o<i;o++)n.push(t.wrap(e[o],r));return n}else if(typeof e=="boolean"||typeof e=="number")return e+"";return e}function QS(e){this.srcFile=e,this.source=[]}QS.prototype={isEmpty:function(){return!this.source.length},prepend:function(t,r){this.source.unshift(this.wrap(t,r))},push:function(t,r){this.source.push(this.wrap(t,r))},merge:function(){var t=this.empty();return this.each(function(r){t.add([" ",r,`
|
|
82
|
-
`])}),t},each:function(t){for(var r=0,n=this.source.length;r<n;r++)t(this.source[r])},empty:function(){var t=this.currentLocation||{start:{}};return new io(t.start.line,t.start.column,this.srcFile)},wrap:function(t){var r=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return t instanceof io?t:(t=gg(t,this,r),new io(r.start.line,r.start.column,this.srcFile,t))},functionCall:function(t,r,n){return n=this.generateList(n),this.wrap([t,r?"."+r+"(":"(",n,")"])},quotedString:function(t){return'"'+(t+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(t){var r=this,n=[];Object.keys(t).forEach(function(i){var s=gg(t[i],r);s!=="undefined"&&n.push([r.quotedString(i),":",s])});var o=this.generateList(n);return o.prepend("{"),o.add("}"),o},generateList:function(t){for(var r=this.empty(),n=0,o=t.length;n<o;n++)n&&r.add(","),r.add(gg(t[n],this));return r},generateArray:function(t){var r=this.generateList(t);return r.prepend("["),r.add("]"),r}};Pu.default=QS;XS.exports=Pu.default});var i1=S((Cu,o1)=>{"use strict";Cu.__esModule=!0;function n1(e){return e&&e.__esModule?e:{default:e}}var t1=uu(),
|
|
81
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var i=this.next();return typeof i<"u"?i:this.lex()},begin:function(i){this.conditionStack.push(i)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(i){this.begin(i)}};return n.options={},n.performAction=function(i,s,a,c){function u(l,d){return s.yytext=s.yytext.substring(l,s.yyleng-d+l)}var p=c;switch(a){case 0:if(s.yytext.slice(-2)==="\\\\"?(u(0,1),this.begin("mu")):s.yytext.slice(-1)==="\\"?(u(0,1),this.begin("emu")):this.begin("mu"),s.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(u(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(s.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return s.yytext=u(1,2).replace(/\\"/g,'"'),80;break;case 32:return s.yytext=u(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return s.yytext=s.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n})();e.lexer=t;function r(){this.yy={}}return r.prototype=e,e.Parser=r,new r})();mu.default=k9;dS.exports=mu.default});var vu=S((_u,gS)=>{"use strict";_u.__esModule=!0;function S9(e){return e&&e.__esModule?e:{default:e}}var $9=Bt(),Jm=S9($9);function gu(){this.parents=[]}gu.prototype={constructor:gu,mutating:!1,acceptKey:function(t,r){var n=this.accept(t[r]);if(this.mutating){if(n&&!gu.prototype[n.type])throw new Jm.default('Unexpected node type "'+n.type+'" found when accepting '+r+" on "+t.type);t[r]=n}},acceptRequired:function(t,r){if(this.acceptKey(t,r),!t[r])throw new Jm.default(t.type+" requires "+r)},acceptArray:function(t){for(var r=0,n=t.length;r<n;r++)this.acceptKey(t,r),t[r]||(t.splice(r,1),r--,n--)},accept:function(t){if(t){if(!this[t.type])throw new Jm.default("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;var r=this[t.type](t);if(this.current=this.parents.shift(),!this.mutating||r)return r;if(r!==!1)return t}},Program:function(t){this.acceptArray(t.body)},MustacheStatement:yu,Decorator:yu,BlockStatement:hS,DecoratorBlock:hS,PartialStatement:mS,PartialBlockStatement:function(t){mS.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:yu,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(t){this.acceptArray(t.pairs)},HashPair:function(t){this.acceptRequired(t,"value")}};function yu(e){this.acceptRequired(e,"path"),this.acceptArray(e.params),this.acceptKey(e,"hash")}function hS(e){yu.call(this,e),this.acceptKey(e,"program"),this.acceptKey(e,"inverse")}function mS(e){this.acceptRequired(e,"name"),this.acceptArray(e.params),this.acceptKey(e,"hash")}_u.default=gu;gS.exports=_u.default});var _S=S((bu,yS)=>{"use strict";bu.__esModule=!0;function T9(e){return e&&e.__esModule?e:{default:e}}var P9=vu(),C9=T9(P9);function xr(){var e=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=e}xr.prototype=new C9.default;xr.prototype.Program=function(e){var t=!this.options.ignoreStandalone,r=!this.isRootSeen;this.isRootSeen=!0;for(var n=e.body,o=0,i=n.length;o<i;o++){var s=n[o],a=this.accept(s);if(a){var c=Ym(n,o,r),u=Qm(n,o,r),p=a.openStandalone&&c,l=a.closeStandalone&&u,d=a.inlineStandalone&&c&&u;a.close&&ro(n,o,!0),a.open&&gn(n,o,!0),t&&d&&(ro(n,o),gn(n,o)&&s.type==="PartialStatement"&&(s.indent=/([ \t]+$)/.exec(n[o-1].original)[1])),t&&p&&(ro((s.program||s.inverse).body),gn(n,o)),t&&l&&(ro(n,o),gn((s.inverse||s.program).body))}}return e};xr.prototype.BlockStatement=xr.prototype.DecoratorBlock=xr.prototype.PartialBlockStatement=function(e){this.accept(e.program),this.accept(e.inverse);var t=e.program||e.inverse,r=e.program&&e.inverse,n=r,o=r;if(r&&r.chained)for(n=r.body[0].program;o.chained;)o=o.body[o.body.length-1].program;var i={open:e.openStrip.open,close:e.closeStrip.close,openStandalone:Qm(t.body),closeStandalone:Ym((n||t).body)};if(e.openStrip.close&&ro(t.body,null,!0),r){var s=e.inverseStrip;s.open&&gn(t.body,null,!0),s.close&&ro(n.body,null,!0),e.closeStrip.open&&gn(o.body,null,!0),!this.options.ignoreStandalone&&Ym(t.body)&&Qm(n.body)&&(gn(t.body),ro(n.body))}else e.closeStrip.open&&gn(t.body,null,!0);return i};xr.prototype.Decorator=xr.prototype.MustacheStatement=function(e){return e.strip};xr.prototype.PartialStatement=xr.prototype.CommentStatement=function(e){var t=e.strip||{};return{inlineStandalone:!0,open:t.open,close:t.close}};function Ym(e,t,r){t===void 0&&(t=e.length);var n=e[t-1],o=e[t-2];if(!n)return r;if(n.type==="ContentStatement")return(o||!r?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(n.original)}function Qm(e,t,r){t===void 0&&(t=-1);var n=e[t+1],o=e[t+2];if(!n)return r;if(n.type==="ContentStatement")return(o||!r?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original)}function ro(e,t,r){var n=e[t==null?0:t+1];if(!(!n||n.type!=="ContentStatement"||!r&&n.rightStripped)){var o=n.value;n.value=n.value.replace(r?/^\s+/:/^[ \t]*\r?\n?/,""),n.rightStripped=n.value!==o}}function gn(e,t,r){var n=e[t==null?e.length-1:t-1];if(!(!n||n.type!=="ContentStatement"||!r&&n.leftStripped)){var o=n.value;return n.value=n.value.replace(r?/\s+$/:/[ \t]+$/,""),n.leftStripped=n.value!==o,n.leftStripped}}bu.default=xr;yS.exports=bu.default});var vS=S(Vt=>{"use strict";Vt.__esModule=!0;Vt.SourceLocation=z9;Vt.id=R9;Vt.stripFlags=A9;Vt.stripComment=O9;Vt.preparePath=N9;Vt.prepareMustache=D9;Vt.prepareRawBlock=j9;Vt.prepareBlock=M9;Vt.prepareProgram=L9;Vt.preparePartialBlock=Z9;function E9(e){return e&&e.__esModule?e:{default:e}}var I9=Bt(),Xm=E9(I9);function eg(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var r={loc:e.path.loc};throw new Xm.default(e.path.original+" doesn't match "+t,r)}}function z9(e,t){this.source=e,this.start={line:t.first_line,column:t.first_column},this.end={line:t.last_line,column:t.last_column}}function R9(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e}function A9(e,t){return{open:e.charAt(2)==="~",close:t.charAt(t.length-3)==="~"}}function O9(e){return e.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function N9(e,t,r){r=this.locInfo(r);for(var n=e?"@":"",o=[],i=0,s=0,a=t.length;s<a;s++){var c=t[s].part,u=t[s].original!==c;if(n+=(t[s].separator||"")+c,!u&&(c===".."||c==="."||c==="this")){if(o.length>0)throw new Xm.default("Invalid path: "+n,{loc:r});c===".."&&i++}else o.push(c)}return{type:"PathExpression",data:e,depth:i,parts:o,original:n,loc:r}}function D9(e,t,r,n,o,i){var s=n.charAt(3)||n.charAt(2),a=s!=="{"&&s!=="&",c=/\*/.test(n);return{type:c?"Decorator":"MustacheStatement",path:e,params:t,hash:r,escaped:a,strip:o,loc:this.locInfo(i)}}function j9(e,t,r,n){eg(e,r),n=this.locInfo(n);var o={type:"Program",body:t,strip:{},loc:n};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:o,openStrip:{},inverseStrip:{},closeStrip:{},loc:n}}function M9(e,t,r,n,o,i){n&&n.path&&eg(e,n);var s=/\*/.test(e.open);t.blockParams=e.blockParams;var a=void 0,c=void 0;if(r){if(s)throw new Xm.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=n.strip),c=r.strip,a=r.program}return o&&(o=a,a=t,t=o),{type:s?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:a,openStrip:e.strip,inverseStrip:c,closeStrip:n&&n.strip,loc:this.locInfo(i)}}function L9(e,t){if(!t&&e.length){var r=e[0].loc,n=e[e.length-1].loc;r&&n&&(t={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:e,strip:{},loc:t}}function Z9(e,t,r,n){return eg(e,r),{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:r&&r.strip,loc:this.locInfo(n)}}});var wS=S(Es=>{"use strict";Es.__esModule=!0;Es.parseWithoutProcessing=xS;Es.parse=W9;function q9(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function bS(e){return e&&e.__esModule?e:{default:e}}var F9=fS(),tg=bS(F9),U9=_S(),B9=bS(U9),V9=vS(),H9=q9(V9),G9=ft();Es.parser=tg.default;var xu={};G9.extend(xu,H9);function xS(e,t){if(e.type==="Program")return e;tg.default.yy=xu,xu.locInfo=function(n){return new xu.SourceLocation(t&&t.srcName,n)};var r=tg.default.parse(e);return r}function W9(e,t){var r=xS(e,t),n=new B9.default(t);return n.accept(r)}});var TS=S(As=>{"use strict";As.__esModule=!0;As.Compiler=rg;As.precompile=Q9;As.compile=X9;function SS(e){return e&&e.__esModule?e:{default:e}}var K9=Bt(),zs=SS(K9),Rs=ft(),J9=Km(),Is=SS(J9),Y9=[].slice;function rg(){}rg.prototype={compiler:rg,equals:function(t){var r=this.opcodes.length;if(t.opcodes.length!==r)return!1;for(var n=0;n<r;n++){var o=this.opcodes[n],i=t.opcodes[n];if(o.opcode!==i.opcode||!$S(o.args,i.args))return!1}r=this.children.length;for(var n=0;n<r;n++)if(!this.children[n].equals(t.children[n]))return!1;return!0},guid:0,compile:function(t,r){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=r,this.stringParams=r.stringParams,this.trackIds=r.trackIds,r.blockParams=r.blockParams||[],r.knownHelpers=Rs.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},r.knownHelpers),this.accept(t)},compileProgram:function(t){var r=new this.compiler,n=r.compile(t,this.options),o=this.guid++;return this.usePartial=this.usePartial||n.usePartial,this.children[o]=n,this.useDepths=this.useDepths||n.useDepths,o},accept:function(t){if(!this[t.type])throw new zs.default("Unknown type: "+t.type,t);this.sourceNode.unshift(t);var r=this[t.type](t);return this.sourceNode.shift(),r},Program:function(t){this.options.blockParams.unshift(t.blockParams);for(var r=t.body,n=r.length,o=0;o<n;o++)this.accept(r[o]);return this.options.blockParams.shift(),this.isSimple=n===1,this.blockParams=t.blockParams?t.blockParams.length:0,this},BlockStatement:function(t){kS(t);var r=t.program,n=t.inverse;r=r&&this.compileProgram(r),n=n&&this.compileProgram(n);var o=this.classifySexpr(t);o==="helper"?this.helperSexpr(t,r,n):o==="simple"?(this.simpleSexpr(t),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,r,n),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(t){var r=t.program&&this.compileProgram(t.program),n=this.setupFullMustacheParams(t,r,void 0),o=t.path;this.useDecorators=!0,this.opcode("registerDecorator",n.length,o.original)},PartialStatement:function(t){this.usePartial=!0;var r=t.program;r&&(r=this.compileProgram(t.program));var n=t.params;if(n.length>1)throw new zs.default("Unsupported number of partial arguments: "+n.length,t);n.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):n.push({type:"PathExpression",parts:[],depth:0}));var o=t.name.original,i=t.name.type==="SubExpression";i&&this.accept(t.name),this.setupFullMustacheParams(t,r,void 0,!0);var s=t.indent||"";this.options.preventIndent&&s&&(this.opcode("appendContent",s),s=""),this.opcode("invokePartial",i,o,s),this.opcode("append")},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode("appendContent",t.value)},CommentStatement:function(){},SubExpression:function(t){kS(t);var r=this.classifySexpr(t);r==="simple"?this.simpleSexpr(t):r==="helper"?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,r,n){var o=t.path,i=o.parts[0],s=r!=null||n!=null;this.opcode("getContext",o.depth),this.opcode("pushProgram",r),this.opcode("pushProgram",n),o.strict=!0,this.accept(o),this.opcode("invokeAmbiguous",i,s)},simpleSexpr:function(t){var r=t.path;r.strict=!0,this.accept(r),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,r,n){var o=this.setupFullMustacheParams(t,r,n),i=t.path,s=i.parts[0];if(this.options.knownHelpers[s])this.opcode("invokeKnownHelper",o.length,s);else{if(this.options.knownHelpersOnly)throw new zs.default("You specified knownHelpersOnly, but used the unknown helper "+s,t);i.strict=!0,i.falsy=!0,this.accept(i),this.opcode("invokeHelper",o.length,i.original,Is.default.helpers.simpleId(i))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var r=t.parts[0],n=Is.default.helpers.scopedId(t),o=!t.depth&&!n&&this.blockParamIndex(r);o?this.opcode("lookupBlockParam",o,t.parts):r?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,n):this.opcode("pushContext")},StringLiteral:function(t){this.opcode("pushString",t.value)},NumberLiteral:function(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(t){var r=t.pairs,n=0,o=r.length;for(this.opcode("pushHash");n<o;n++)this.pushParam(r[n].value);for(;n--;)this.opcode("assignToHash",r[n].key);this.opcode("popHash")},opcode:function(t){this.opcodes.push({opcode:t,args:Y9.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var r=Is.default.helpers.simpleId(t.path),n=r&&!!this.blockParamIndex(t.path.parts[0]),o=!n&&Is.default.helpers.helperExpression(t),i=!n&&(o||r);if(i&&!o){var s=t.path.parts[0],a=this.options;a.knownHelpers[s]?o=!0:a.knownHelpersOnly&&(i=!1)}return o?"helper":i?"ambiguous":"simple"},pushParams:function(t){for(var r=0,n=t.length;r<n;r++)this.pushParam(t[r])},pushParam:function(t){var r=t.value!=null?t.value:t.original||"";if(this.stringParams)r.replace&&(r=r.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",r,t.type),t.type==="SubExpression"&&this.accept(t);else{if(this.trackIds){var n=void 0;if(t.parts&&!Is.default.helpers.scopedId(t)&&!t.depth&&(n=this.blockParamIndex(t.parts[0])),n){var o=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",n,o)}else r=t.original||r,r.replace&&(r=r.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",t.type,r)}this.accept(t)}},setupFullMustacheParams:function(t,r,n,o){var i=t.params;return this.pushParams(i),this.opcode("pushProgram",r),this.opcode("pushProgram",n),t.hash?this.accept(t.hash):this.opcode("emptyHash",o),i},blockParamIndex:function(t){for(var r=0,n=this.options.blockParams.length;r<n;r++){var o=this.options.blockParams[r],i=o&&Rs.indexOf(o,t);if(o&&i>=0)return[r,i]}}};function Q9(e,t,r){if(e==null||typeof e!="string"&&e.type!=="Program")throw new zs.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+e);t=t||{},"data"in t||(t.data=!0),t.compat&&(t.useDepths=!0);var n=r.parse(e,t),o=new r.Compiler().compile(n,t);return new r.JavaScriptCompiler().compile(o,t)}function X9(e,t,r){if(t===void 0&&(t={}),e==null||typeof e!="string"&&e.type!=="Program")throw new zs.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+e);t=Rs.extend({},t),"data"in t||(t.data=!0),t.compat&&(t.useDepths=!0);var n=void 0;function o(){var s=r.parse(e,t),a=new r.Compiler().compile(s,t),c=new r.JavaScriptCompiler().compile(a,t,void 0,!0);return r.template(c)}function i(s,a){return n||(n=o()),n.call(this,s,a)}return i._setup=function(s){return n||(n=o()),n._setup(s)},i._child=function(s,a,c,u){return n||(n=o()),n._child(s,a,c,u)},i}function $S(e,t){if(e===t)return!0;if(Rs.isArray(e)&&Rs.isArray(t)&&e.length===t.length){for(var r=0;r<e.length;r++)if(!$S(e[r],t[r]))return!1;return!0}}function kS(e){if(!e.path.parts){var t=e.path;e.path={type:"PathExpression",data:!1,depth:0,parts:[t.original+""],original:t.original+"",loc:t.loc}}}});var CS=S(ng=>{var PS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");ng.encode=function(e){if(0<=e&&e<PS.length)return PS[e];throw new TypeError("Must be between 0 and 63: "+e)};ng.decode=function(e){var t=65,r=90,n=97,o=122,i=48,s=57,a=43,c=47,u=26,p=52;return t<=e&&e<=r?e-t:n<=e&&e<=o?e-n+u:i<=e&&e<=s?e-i+p:e==a?62:e==c?63:-1}});var sg=S(ig=>{var ES=CS(),og=5,IS=1<<og,zS=IS-1,RS=IS;function eZ(e){return e<0?(-e<<1)+1:(e<<1)+0}function tZ(e){var t=(e&1)===1,r=e>>1;return t?-r:r}ig.encode=function(t){var r="",n,o=eZ(t);do n=o&zS,o>>>=og,o>0&&(n|=RS),r+=ES.encode(n);while(o>0);return r};ig.decode=function(t,r,n){var o=t.length,i=0,s=0,a,c;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(c=ES.decode(t.charCodeAt(r++)),c===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));a=!!(c&RS),c&=zS,i=i+(c<<s),s+=og}while(a);n.value=tZ(i),n.rest=r}});var Xo=S(ot=>{function rZ(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}ot.getArg=rZ;var AS=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,nZ=/^data:.+\,.+$/;function Os(e){var t=e.match(AS);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}ot.urlParse=Os;function Yo(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}ot.urlGenerate=Yo;function ag(e){var t=e,r=Os(e);if(r){if(!r.path)return e;t=r.path}for(var n=ot.isAbsolute(t),o=t.split(/\/+/),i,s=0,a=o.length-1;a>=0;a--)i=o[a],i==="."?o.splice(a,1):i===".."?s++:s>0&&(i===""?(o.splice(a+1,s),s=0):(o.splice(a,2),s--));return t=o.join("/"),t===""&&(t=n?"/":"."),r?(r.path=t,Yo(r)):t}ot.normalize=ag;function OS(e,t){e===""&&(e="."),t===""&&(t=".");var r=Os(t),n=Os(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Yo(r);if(r||t.match(nZ))return t;if(n&&!n.host&&!n.path)return n.host=t,Yo(n);var o=t.charAt(0)==="/"?t:ag(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=o,Yo(n)):o}ot.join=OS;ot.isAbsolute=function(e){return e.charAt(0)==="/"||AS.test(e)};function oZ(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}ot.relative=oZ;var NS=(function(){var e=Object.create(null);return!("__proto__"in e)})();function DS(e){return e}function iZ(e){return jS(e)?"$"+e:e}ot.toSetString=NS?DS:iZ;function sZ(e){return jS(e)?e.slice(1):e}ot.fromSetString=NS?DS:sZ;function jS(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function aZ(e,t,r){var n=Qo(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:Qo(e.name,t.name)}ot.compareByOriginalPositions=aZ;function cZ(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=Qo(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:Qo(e.name,t.name)}ot.compareByGeneratedPositionsDeflated=cZ;function Qo(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function uZ(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=Qo(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:Qo(e.name,t.name)}ot.compareByGeneratedPositionsInflated=uZ;function lZ(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}ot.parseSourceMapInput=lZ;function pZ(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=Os(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}t=OS(Yo(n),t)}return ag(t)}ot.computeSourceURL=pZ});var lg=S(MS=>{var cg=Xo(),ug=Object.prototype.hasOwnProperty,no=typeof Map<"u";function jr(){this._array=[],this._set=no?new Map:Object.create(null)}jr.fromArray=function(t,r){for(var n=new jr,o=0,i=t.length;o<i;o++)n.add(t[o],r);return n};jr.prototype.size=function(){return no?this._set.size:Object.getOwnPropertyNames(this._set).length};jr.prototype.add=function(t,r){var n=no?t:cg.toSetString(t),o=no?this.has(t):ug.call(this._set,n),i=this._array.length;(!o||r)&&this._array.push(t),o||(no?this._set.set(t,i):this._set[n]=i)};jr.prototype.has=function(t){if(no)return this._set.has(t);var r=cg.toSetString(t);return ug.call(this._set,r)};jr.prototype.indexOf=function(t){if(no){var r=this._set.get(t);if(r>=0)return r}else{var n=cg.toSetString(t);if(ug.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};jr.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};jr.prototype.toArray=function(){return this._array.slice()};MS.ArraySet=jr});var qS=S(ZS=>{var LS=Xo();function dZ(e,t){var r=e.generatedLine,n=t.generatedLine,o=e.generatedColumn,i=t.generatedColumn;return n>r||n==r&&i>=o||LS.compareByGeneratedPositionsInflated(e,t)<=0}function wu(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}wu.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};wu.prototype.add=function(t){dZ(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};wu.prototype.toArray=function(){return this._sorted||(this._array.sort(LS.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};ZS.MappingList=wu});var pg=S(FS=>{var Ns=sg(),Me=Xo(),ku=lg().ArraySet,fZ=qS().MappingList;function Ht(e){e||(e={}),this._file=Me.getArg(e,"file",null),this._sourceRoot=Me.getArg(e,"sourceRoot",null),this._skipValidation=Me.getArg(e,"skipValidation",!1),this._sources=new ku,this._names=new ku,this._mappings=new fZ,this._sourcesContents=null}Ht.prototype._version=3;Ht.fromSourceMap=function(t){var r=t.sourceRoot,n=new Ht({file:t.file,sourceRoot:r});return t.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,r!=null&&(i.source=Me.relative(r,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),n.addMapping(i)}),t.sources.forEach(function(o){var i=o;r!==null&&(i=Me.relative(r,o)),n._sources.has(i)||n._sources.add(i);var s=t.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};Ht.prototype.addMapping=function(t){var r=Me.getArg(t,"generated"),n=Me.getArg(t,"original",null),o=Me.getArg(t,"source",null),i=Me.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i})};Ht.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=Me.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Me.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Me.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Ht.prototype.applySourceMap=function(t,r,n){var o=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=t.file}var i=this._sourceRoot;i!=null&&(o=Me.relative(i,o));var s=new ku,a=new ku;this._mappings.unsortedForEach(function(c){if(c.source===o&&c.originalLine!=null){var u=t.originalPositionFor({line:c.originalLine,column:c.originalColumn});u.source!=null&&(c.source=u.source,n!=null&&(c.source=Me.join(n,c.source)),i!=null&&(c.source=Me.relative(i,c.source)),c.originalLine=u.line,c.originalColumn=u.column,u.name!=null&&(c.name=u.name))}var p=c.source;p!=null&&!s.has(p)&&s.add(p);var l=c.name;l!=null&&!a.has(l)&&a.add(l)},this),this._sources=s,this._names=a,t.sources.forEach(function(c){var u=t.sourceContentFor(c);u!=null&&(n!=null&&(c=Me.join(n,c)),i!=null&&(c=Me.relative(i,c)),this.setSourceContent(c,u))},this)};Ht.prototype._validateMapping=function(t,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!o)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:o}))}};Ht.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,o=0,i=0,s=0,a="",c,u,p,l,d=this._mappings.toArray(),f=0,h=d.length;f<h;f++){if(u=d[f],c="",u.generatedLine!==r)for(t=0;u.generatedLine!==r;)c+=";",r++;else if(f>0){if(!Me.compareByGeneratedPositionsInflated(u,d[f-1]))continue;c+=","}c+=Ns.encode(u.generatedColumn-t),t=u.generatedColumn,u.source!=null&&(l=this._sources.indexOf(u.source),c+=Ns.encode(l-s),s=l,c+=Ns.encode(u.originalLine-1-o),o=u.originalLine-1,c+=Ns.encode(u.originalColumn-n),n=u.originalColumn,u.name!=null&&(p=this._names.indexOf(u.name),c+=Ns.encode(p-i),i=p)),a+=c}return a};Ht.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Me.relative(r,n));var o=Me.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};Ht.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};Ht.prototype.toString=function(){return JSON.stringify(this.toJSON())};FS.SourceMapGenerator=Ht});var US=S(oo=>{oo.GREATEST_LOWER_BOUND=1;oo.LEAST_UPPER_BOUND=2;function dg(e,t,r,n,o,i){var s=Math.floor((t-e)/2)+e,a=o(r,n[s],!0);return a===0?s:a>0?t-s>1?dg(s,t,r,n,o,i):i==oo.LEAST_UPPER_BOUND?t<n.length?t:-1:s:s-e>1?dg(e,s,r,n,o,i):i==oo.LEAST_UPPER_BOUND?s:e<0?-1:e}oo.search=function(t,r,n,o){if(r.length===0)return-1;var i=dg(-1,r.length,t,r,n,o||oo.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&n(r[i],r[i-1],!0)===0;)--i;return i}});var VS=S(BS=>{function fg(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function hZ(e,t){return Math.round(e+Math.random()*(t-e))}function hg(e,t,r,n){if(r<n){var o=hZ(r,n),i=r-1;fg(e,o,n);for(var s=e[n],a=r;a<n;a++)t(e[a],s)<=0&&(i+=1,fg(e,i,a));fg(e,i+1,a);var c=i+1;hg(e,t,r,c-1),hg(e,t,c+1,n)}}BS.quickSort=function(e,t){hg(e,t,0,e.length-1)}});var GS=S(Su=>{var R=Xo(),mg=US(),ei=lg().ArraySet,mZ=sg(),Ds=VS().quickSort;function $e(e,t){var r=e;return typeof e=="string"&&(r=R.parseSourceMapInput(e)),r.sections!=null?new nr(r,t):new Je(r,t)}$e.fromSourceMap=function(e,t){return Je.fromSourceMap(e,t)};$e.prototype._version=3;$e.prototype.__generatedMappings=null;Object.defineProperty($e.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});$e.prototype.__originalMappings=null;Object.defineProperty($e.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});$e.prototype._charIsMappingSeparator=function(t,r){var n=t.charAt(r);return n===";"||n===","};$e.prototype._parseMappings=function(t,r){throw new Error("Subclasses must implement _parseMappings")};$e.GENERATED_ORDER=1;$e.ORIGINAL_ORDER=2;$e.GREATEST_LOWER_BOUND=1;$e.LEAST_UPPER_BOUND=2;$e.prototype.eachMapping=function(t,r,n){var o=r||null,i=n||$e.GENERATED_ORDER,s;switch(i){case $e.GENERATED_ORDER:s=this._generatedMappings;break;case $e.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;s.map(function(c){var u=c.source===null?null:this._sources.at(c.source);return u=R.computeSourceURL(a,u,this._sourceMapURL),{source:u,generatedLine:c.generatedLine,generatedColumn:c.generatedColumn,originalLine:c.originalLine,originalColumn:c.originalColumn,name:c.name===null?null:this._names.at(c.name)}},this).forEach(t,o)};$e.prototype.allGeneratedPositionsFor=function(t){var r=R.getArg(t,"line"),n={source:R.getArg(t,"source"),originalLine:r,originalColumn:R.getArg(t,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",R.compareByOriginalPositions,mg.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(t.column===void 0)for(var a=s.originalLine;s&&s.originalLine===a;)o.push({line:R.getArg(s,"generatedLine",null),column:R.getArg(s,"generatedColumn",null),lastColumn:R.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var c=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==c;)o.push({line:R.getArg(s,"generatedLine",null),column:R.getArg(s,"generatedColumn",null),lastColumn:R.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};Su.SourceMapConsumer=$e;function Je(e,t){var r=e;typeof e=="string"&&(r=R.parseSourceMapInput(e));var n=R.getArg(r,"version"),o=R.getArg(r,"sources"),i=R.getArg(r,"names",[]),s=R.getArg(r,"sourceRoot",null),a=R.getArg(r,"sourcesContent",null),c=R.getArg(r,"mappings"),u=R.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=R.normalize(s)),o=o.map(String).map(R.normalize).map(function(p){return s&&R.isAbsolute(s)&&R.isAbsolute(p)?R.relative(s,p):p}),this._names=ei.fromArray(i.map(String),!0),this._sources=ei.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(p){return R.computeSourceURL(s,p,t)}),this.sourceRoot=s,this.sourcesContent=a,this._mappings=c,this._sourceMapURL=t,this.file=u}Je.prototype=Object.create($e.prototype);Je.prototype.consumer=$e;Je.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=R.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==e)return r;return-1};Je.fromSourceMap=function(t,r){var n=Object.create(Je.prototype),o=n._names=ei.fromArray(t._names.toArray(),!0),i=n._sources=ei.fromArray(t._sources.toArray(),!0);n.sourceRoot=t._sourceRoot,n.sourcesContent=t._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=t._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(f){return R.computeSourceURL(n.sourceRoot,f,r)});for(var s=t._mappings.toArray().slice(),a=n.__generatedMappings=[],c=n.__originalMappings=[],u=0,p=s.length;u<p;u++){var l=s[u],d=new HS;d.generatedLine=l.generatedLine,d.generatedColumn=l.generatedColumn,l.source&&(d.source=i.indexOf(l.source),d.originalLine=l.originalLine,d.originalColumn=l.originalColumn,l.name&&(d.name=o.indexOf(l.name)),c.push(d)),a.push(d)}return Ds(n.__originalMappings,R.compareByOriginalPositions),n};Je.prototype._version=3;Object.defineProperty(Je.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function HS(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Je.prototype._parseMappings=function(t,r){for(var n=1,o=0,i=0,s=0,a=0,c=0,u=t.length,p=0,l={},d={},f=[],h=[],g,y,b,v,k;p<u;)if(t.charAt(p)===";")n++,p++,o=0;else if(t.charAt(p)===",")p++;else{for(g=new HS,g.generatedLine=n,v=p;v<u&&!this._charIsMappingSeparator(t,v);v++);if(y=t.slice(p,v),b=l[y],b)p+=y.length;else{for(b=[];p<v;)mZ.decode(t,p,d),k=d.value,p=d.rest,b.push(k);if(b.length===2)throw new Error("Found a source, but no line and column");if(b.length===3)throw new Error("Found a source and line, but no column");l[y]=b}g.generatedColumn=o+b[0],o=g.generatedColumn,b.length>1&&(g.source=a+b[1],a+=b[1],g.originalLine=i+b[2],i=g.originalLine,g.originalLine+=1,g.originalColumn=s+b[3],s=g.originalColumn,b.length>4&&(g.name=c+b[4],c+=b[4])),h.push(g),typeof g.originalLine=="number"&&f.push(g)}Ds(h,R.compareByGeneratedPositionsDeflated),this.__generatedMappings=h,Ds(f,R.compareByOriginalPositions),this.__originalMappings=f};Je.prototype._findMapping=function(t,r,n,o,i,s){if(t[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[n]);if(t[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[o]);return mg.search(t,r,i,s)};Je.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var r=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var n=this._generatedMappings[t+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};Je.prototype.originalPositionFor=function(t){var r={generatedLine:R.getArg(t,"line"),generatedColumn:R.getArg(t,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",R.compareByGeneratedPositionsDeflated,R.getArg(t,"bias",$e.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var i=R.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=R.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=R.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:R.getArg(o,"originalLine",null),column:R.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};Je.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1};Je.prototype.sourceContentFor=function(t,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(t);if(n>=0)return this.sourcesContent[n];var o=t;this.sourceRoot!=null&&(o=R.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=R.urlParse(this.sourceRoot))){var s=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(r)return null;throw new Error('"'+o+'" is not in the SourceMap.')};Je.prototype.generatedPositionFor=function(t){var r=R.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:R.getArg(t,"line"),originalColumn:R.getArg(t,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",R.compareByOriginalPositions,R.getArg(t,"bias",$e.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:R.getArg(i,"generatedLine",null),column:R.getArg(i,"generatedColumn",null),lastColumn:R.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Su.BasicSourceMapConsumer=Je;function nr(e,t){var r=e;typeof e=="string"&&(r=R.parseSourceMapInput(e));var n=R.getArg(r,"version"),o=R.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new ei,this._names=new ei;var i={line:-1,column:0};this._sections=o.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var a=R.getArg(s,"offset"),c=R.getArg(a,"line"),u=R.getArg(a,"column");if(c<i.line||c===i.line&&u<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=a,{generatedOffset:{generatedLine:c+1,generatedColumn:u+1},consumer:new $e(R.getArg(s,"map"),t)}})}nr.prototype=Object.create($e.prototype);nr.prototype.constructor=$e;nr.prototype._version=3;Object.defineProperty(nr.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}});nr.prototype.originalPositionFor=function(t){var r={generatedLine:R.getArg(t,"line"),generatedColumn:R.getArg(t,"column")},n=mg.search(r,this._sections,function(i,s){var a=i.generatedLine-s.generatedOffset.generatedLine;return a||i.generatedColumn-s.generatedOffset.generatedColumn}),o=this._sections[n];return o?o.consumer.originalPositionFor({line:r.generatedLine-(o.generatedOffset.generatedLine-1),column:r.generatedColumn-(o.generatedOffset.generatedLine===r.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}};nr.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})};nr.prototype.sourceContentFor=function(t,r){for(var n=0;n<this._sections.length;n++){var o=this._sections[n],i=o.consumer.sourceContentFor(t,!0);if(i)return i}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')};nr.prototype.generatedPositionFor=function(t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(R.getArg(t,"source"))!==-1){var o=n.consumer.generatedPositionFor(t);if(o){var i={line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};nr.prototype._parseMappings=function(t,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var a=i[s],c=o.consumer._sources.at(a.source);c=R.computeSourceURL(o.consumer.sourceRoot,c,this._sourceMapURL),this._sources.add(c),c=this._sources.indexOf(c);var u=null;a.name&&(u=o.consumer._names.at(a.name),this._names.add(u),u=this._names.indexOf(u));var p={source:c,generatedLine:a.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(o.generatedOffset.generatedLine===a.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:u};this.__generatedMappings.push(p),typeof p.originalLine=="number"&&this.__originalMappings.push(p)}Ds(this.__generatedMappings,R.compareByGeneratedPositionsDeflated),Ds(this.__originalMappings,R.compareByOriginalPositions)};Su.IndexedSourceMapConsumer=nr});var KS=S(WS=>{var gZ=pg().SourceMapGenerator,$u=Xo(),yZ=/(\r?\n)/,_Z=10,ti="$$$isSourceNode$$$";function It(e,t,r,n,o){this.children=[],this.sourceContents={},this.line=e??null,this.column=t??null,this.source=r??null,this.name=o??null,this[ti]=!0,n!=null&&this.add(n)}It.fromStringWithSourceMap=function(t,r,n){var o=new It,i=t.split(yZ),s=0,a=function(){var d=h(),f=h()||"";return d+f;function h(){return s<i.length?i[s++]:void 0}},c=1,u=0,p=null;return r.eachMapping(function(d){if(p!==null)if(c<d.generatedLine)l(p,a()),c++,u=0;else{var f=i[s]||"",h=f.substr(0,d.generatedColumn-u);i[s]=f.substr(d.generatedColumn-u),u=d.generatedColumn,l(p,h),p=d;return}for(;c<d.generatedLine;)o.add(a()),c++;if(u<d.generatedColumn){var f=i[s]||"";o.add(f.substr(0,d.generatedColumn)),i[s]=f.substr(d.generatedColumn),u=d.generatedColumn}p=d},this),s<i.length&&(p&&l(p,a()),o.add(i.splice(s).join(""))),r.sources.forEach(function(d){var f=r.sourceContentFor(d);f!=null&&(n!=null&&(d=$u.join(n,d)),o.setSourceContent(d,f))}),o;function l(d,f){if(d===null||d.source===void 0)o.add(f);else{var h=n?$u.join(n,d.source):d.source;o.add(new It(d.originalLine,d.originalColumn,h,f,d.name))}}};It.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[ti]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};It.prototype.prepend=function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[ti]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};It.prototype.walk=function(t){for(var r,n=0,o=this.children.length;n<o;n++)r=this.children[n],r[ti]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})};It.prototype.join=function(t){var r,n,o=this.children.length;if(o>0){for(r=[],n=0;n<o-1;n++)r.push(this.children[n]),r.push(t);r.push(this.children[n]),this.children=r}return this};It.prototype.replaceRight=function(t,r){var n=this.children[this.children.length-1];return n[ti]?n.replaceRight(t,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this};It.prototype.setSourceContent=function(t,r){this.sourceContents[$u.toSetString(t)]=r};It.prototype.walkSourceContents=function(t){for(var r=0,n=this.children.length;r<n;r++)this.children[r][ti]&&this.children[r].walkSourceContents(t);for(var o=Object.keys(this.sourceContents),r=0,n=o.length;r<n;r++)t($u.fromSetString(o[r]),this.sourceContents[o[r]])};It.prototype.toString=function(){var t="";return this.walk(function(r){t+=r}),t};It.prototype.toStringWithSourceMap=function(t){var r={code:"",line:1,column:0},n=new gZ(t),o=!1,i=null,s=null,a=null,c=null;return this.walk(function(u,p){r.code+=u,p.source!==null&&p.line!==null&&p.column!==null?((i!==p.source||s!==p.line||a!==p.column||c!==p.name)&&n.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:r.line,column:r.column},name:p.name}),i=p.source,s=p.line,a=p.column,c=p.name,o=!0):o&&(n.addMapping({generated:{line:r.line,column:r.column}}),i=null,o=!1);for(var l=0,d=u.length;l<d;l++)u.charCodeAt(l)===_Z?(r.line++,r.column=0,l+1===d?(i=null,o=!1):o&&n.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:r.line,column:r.column},name:p.name})):r.column++}),this.walkSourceContents(function(u,p){n.setSourceContent(u,p)}),{code:r.code,map:n}};WS.SourceNode=It});var JS=S(Tu=>{Tu.SourceMapGenerator=pg().SourceMapGenerator;Tu.SourceMapConsumer=GS().SourceMapConsumer;Tu.SourceNode=KS().SourceNode});var e1=S((Pu,XS)=>{"use strict";Pu.__esModule=!0;var yg=ft(),io=void 0;try{(typeof define!="function"||!define.amd)&&(YS=JS(),io=YS.SourceNode)}catch{}var YS;io||(io=function(e,t,r,n){this.src="",n&&this.add(n)},io.prototype={add:function(t){yg.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){yg.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function gg(e,t,r){if(yg.isArray(e)){for(var n=[],o=0,i=e.length;o<i;o++)n.push(t.wrap(e[o],r));return n}else if(typeof e=="boolean"||typeof e=="number")return e+"";return e}function QS(e){this.srcFile=e,this.source=[]}QS.prototype={isEmpty:function(){return!this.source.length},prepend:function(t,r){this.source.unshift(this.wrap(t,r))},push:function(t,r){this.source.push(this.wrap(t,r))},merge:function(){var t=this.empty();return this.each(function(r){t.add([" ",r,`
|
|
82
|
+
`])}),t},each:function(t){for(var r=0,n=this.source.length;r<n;r++)t(this.source[r])},empty:function(){var t=this.currentLocation||{start:{}};return new io(t.start.line,t.start.column,this.srcFile)},wrap:function(t){var r=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return t instanceof io?t:(t=gg(t,this,r),new io(r.start.line,r.start.column,this.srcFile,t))},functionCall:function(t,r,n){return n=this.generateList(n),this.wrap([t,r?"."+r+"(":"(",n,")"])},quotedString:function(t){return'"'+(t+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(t){var r=this,n=[];Object.keys(t).forEach(function(i){var s=gg(t[i],r);s!=="undefined"&&n.push([r.quotedString(i),":",s])});var o=this.generateList(n);return o.prepend("{"),o.add("}"),o},generateList:function(t){for(var r=this.empty(),n=0,o=t.length;n<o;n++)n&&r.add(","),r.add(gg(t[n],this));return r},generateArray:function(t){var r=this.generateList(t);return r.prepend("["),r.add("]"),r}};Pu.default=QS;XS.exports=Pu.default});var i1=S((Cu,o1)=>{"use strict";Cu.__esModule=!0;function n1(e){return e&&e.__esModule?e:{default:e}}var t1=uu(),vZ=Bt(),_g=n1(vZ),bZ=ft(),xZ=e1(),r1=n1(xZ);function ri(e){this.value=e}function ni(){}ni.prototype={nameLookup:function(t,r){return this.internalNameLookup(t,r)},depthedLookup:function(t){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(t),")"]},compilerInfo:function(){var t=t1.COMPILER_REVISION,r=t1.REVISION_CHANGES[t];return[t,r]},appendToBuffer:function(t,r,n){return bZ.isArray(t)||(t=[t]),t=this.source.wrap(t,r),this.environment.isSimple?["return ",t,";"]:n?["buffer += ",t,";"]:(t.appendToBuffer=!0,t)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(t,r){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",t,",",JSON.stringify(r),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(t,r,n,o){this.environment=t,this.options=r,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!o,this.name=this.environment.name,this.isChild=!!n,this.context=n||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(t,r),this.useDepths=this.useDepths||t.useDepths||t.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||t.useBlockParams;var i=t.opcodes,s=void 0,a=void 0,c=void 0,u=void 0;for(c=0,u=i.length;c<u;c++)s=i[c],this.source.currentLocation=s.loc,a=a||s.loc,this[s.opcode].apply(this,s.args);if(this.source.currentLocation=a,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new _g.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
|
|
83
83
|
`]),this.decorators.push("return fn;"),o?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
|
|
84
84
|
`),this.decorators.push(`}
|
|
85
85
|
`),this.decorators=this.decorators.merge()));var p=this.createFunctionContext(o);if(this.isChild)return p;var l={compiler:this.compilerInfo(),main:p};this.decorators&&(l.main_d=this.decorators,l.useDecorators=!0);var d=this.context,f=d.programs,h=d.decorators;for(c=0,u=f.length;c<u;c++)f[c]&&(l[c]=f[c],h[c]&&(l[c+"_d"]=h[c],l.useDecorators=!0));return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),o?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),r.srcName?(l=l.toStringWithSourceMap({file:r.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new r1.default(this.options.srcName),this.decorators=new r1.default(this.options.srcName)},createFunctionContext:function(t){var r=this,n="",o=this.stackVars.concat(this.registers.list);o.length>0&&(n+=", "+o.join(", "));var i=0;Object.keys(this.aliases).forEach(function(c){var u=r.aliases[c];u.children&&u.referenceCount>1&&(n+=", alias"+ ++i+"="+c,u.children[0]="alias"+i)}),this.lookupPropertyFunctionIsUsed&&(n+=", "+this.lookupPropertyFunctionVarDeclaration());var s=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&s.push("blockParams"),this.useDepths&&s.push("depths");var a=this.mergeSource(n);return t?(s.push(a),Function.apply(this,s)):this.source.wrap(["function(",s.join(","),`) {
|
|
@@ -91,9 +91,9 @@ Expecting `+uo.join(", ")+", got '"+(this.terminals_[C]||C)+"'":Fu="Parse error
|
|
|
91
91
|
}
|
|
92
92
|
return undefined
|
|
93
93
|
}
|
|
94
|
-
`.trim()},blockValue:function(t){var r=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(t,0,n);var o=this.popStack();n.splice(1,0,o),this.push(this.source.functionCall(r,"call",n))},ambiguousBlockValue:function(){var t=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,!0),this.flushInline();var n=this.topStack();r.splice(1,0,n),this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(t,"call",r),"}"])},appendContent:function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function(){if(this.isInline())this.replaceStack(function(r){return[" != null ? ",r,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(t){this.lastContext=t},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(t,r,n,o){var i=0;!o&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(t[i++])):this.pushContext(),this.resolvePath("context",t,i,r,n)},lookupBlockParam:function(t,r){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",r,1)},lookupData:function(t,r,n){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",r,0,!0,n)},resolvePath:function(t,r,n,o,i){var s=this;if(this.options.strict||this.options.assumeObjects){this.push(yZ(this.options.strict&&i,this,r,n,t));return}for(var a=r.length;n<a;n++)this.replaceStack(function(c){var u=s.nameLookup(c,r[n],t);return o?[" && ",u]:[" != null ? ",u," : ",c]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(t,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof t=="string"?this.pushString(t):this.pushStackLiteral(t))},emptyHash:function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},pushString:function(t){this.pushStackLiteral(this.quotedString(t))},pushLiteral:function(t){this.pushStackLiteral(t)},pushProgram:function(t){t!=null?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},registerDecorator:function(t,r){var n=this.nameLookup("decorators",r,"decorator"),o=this.setupHelperArgs(r,t);this.decorators.push(["fn = ",this.decorators.functionCall(n,"",["fn","props","container",o])," || fn;"])},invokeHelper:function(t,r,n){var o=this.popStack(),i=this.setupHelper(t,r),s=[];n&&s.push(i.name),s.push(o),this.options.strict||s.push(this.aliasable("container.hooks.helperMissing"));var a=["(",this.itemsSeparatedBy(s,"||"),")"],c=this.source.functionCall(a,"call",i.callParams);this.push(c)},itemsSeparatedBy:function(t,r){var n=[];n.push(t[0]);for(var o=1;o<t.length;o++)n.push(r,t[o]);return n},invokeKnownHelper:function(t,r){var n=this.setupHelper(t,r);this.push(this.source.functionCall(n.name,"call",n.callParams))},invokeAmbiguous:function(t,r){this.useRegister("helper");var n=this.popStack();this.emptyHash();var o=this.setupHelper(0,t,r),i=this.lastHelper=this.nameLookup("helpers",t,"helper"),s=["(","(helper = ",i," || ",n,")"];this.options.strict||(s[0]="(helper = ",s.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",s,o.paramsInit?["),(",o.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",o.callParams)," : helper))"])},invokePartial:function(t,r,n){var o=[],i=this.setupParams(r,1,o);t&&(r=this.popStack(),delete i.name),n&&(i.indent=JSON.stringify(n)),i.helpers="helpers",i.partials="partials",i.decorators="container.decorators",t?o.unshift(r):o.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(i.depths="depths"),i=this.objectLiteral(i),o.push(i),this.push(this.source.functionCall("container.invokePartial","",o))},assignToHash:function(t){var r=this.popStack(),n=void 0,o=void 0,i=void 0;this.trackIds&&(i=this.popStack()),this.stringParams&&(o=this.popStack(),n=this.popStack());var s=this.hash;n&&(s.contexts[t]=n),o&&(s.types[t]=o),i&&(s.ids[t]=i),s.values[t]=r},pushId:function(t,r,n){t==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(n?" + "+JSON.stringify("."+n):"")):t==="PathExpression"?this.pushString(r):t==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:ni,compileChildren:function(t,r){for(var n=t.children,o=void 0,i=void 0,s=0,a=n.length;s<a;s++){o=n[s],i=new this.compiler;var c=this.matchExistingProgram(o);if(c==null){this.context.programs.push("");var u=this.context.programs.length;o.index=u,o.name="program"+u,this.context.programs[u]=i.compile(o,r,this.context,!this.precompile),this.context.decorators[u]=i.decorators,this.context.environments[u]=o,this.useDepths=this.useDepths||i.useDepths,this.useBlockParams=this.useBlockParams||i.useBlockParams,o.useDepths=this.useDepths,o.useBlockParams=this.useBlockParams}else o.index=c.index,o.name="program"+c.index,this.useDepths=this.useDepths||c.useDepths,this.useBlockParams=this.useBlockParams||c.useBlockParams}},matchExistingProgram:function(t){for(var r=0,n=this.context.environments.length;r<n;r++){var o=this.context.environments[r];if(o&&o.equals(t))return o}},programExpression:function(t){var r=this.environment.children[t],n=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths"),"container.program("+n.join(", ")+")"},useRegister:function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},push:function(t){return t instanceof ri||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function(t){this.push(new ri(t))},pushSource:function(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},replaceStack:function(t){var r=["("],n=void 0,o=void 0,i=void 0;if(!this.isInline())throw new _g.default("replaceStack on non-inline");var s=this.popStack(!0);if(s instanceof ri)n=[s.value],r=["(",n],i=!0;else{o=!0;var a=this.incrStack();r=["((",this.push(a)," = ",s,")"],n=this.topStack()}var c=t.call(this,n);i||this.popStack(),o&&this.stackSlot--,this.push(r.concat(c,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;this.inlineStack=[];for(var r=0,n=t.length;r<n;r++){var o=t[r];if(o instanceof ri)this.compileStack.push(o);else{var i=this.incrStack();this.pushSource([i," = ",o,";"]),this.compileStack.push(i)}}},isInline:function(){return this.inlineStack.length},popStack:function(t){var r=this.isInline(),n=(r?this.inlineStack:this.compileStack).pop();if(!t&&n instanceof ri)return n.value;if(!r){if(!this.stackSlot)throw new _g.default("Invalid stack pop");this.stackSlot--}return n},topStack:function(){var t=this.isInline()?this.inlineStack:this.compileStack,r=t[t.length-1];return r instanceof ri?r.value:r},contextName:function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},quotedString:function(t){return this.source.quotedString(t)},objectLiteral:function(t){return this.source.objectLiteral(t)},aliasable:function(t){var r=this.aliases[t];return r?(r.referenceCount++,r):(r=this.aliases[t]=this.source.wrap(t),r.aliasable=!0,r.referenceCount=1,r)},setupHelper:function(t,r,n){var o=[],i=this.setupHelperArgs(r,t,o,n),s=this.nameLookup("helpers",r,"helper"),a=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:o,paramsInit:i,name:s,callParams:[a].concat(o)}},setupParams:function(t,r,n){var o={},i=[],s=[],a=[],c=!n,u=void 0;c&&(n=[]),o.name=this.quotedString(t),o.hash=this.popStack(),this.trackIds&&(o.hashIds=this.popStack()),this.stringParams&&(o.hashTypes=this.popStack(),o.hashContexts=this.popStack());var p=this.popStack(),l=this.popStack();(l||p)&&(o.fn=l||"container.noop",o.inverse=p||"container.noop");for(var d=r;d--;)u=this.popStack(),n[d]=u,this.trackIds&&(a[d]=this.popStack()),this.stringParams&&(s[d]=this.popStack(),i[d]=this.popStack());return c&&(o.args=this.source.generateArray(n)),this.trackIds&&(o.ids=this.source.generateArray(a)),this.stringParams&&(o.types=this.source.generateArray(s),o.contexts=this.source.generateArray(i)),this.options.data&&(o.data="data"),this.useBlockParams&&(o.blockParams="blockParams"),o},setupHelperArgs:function(t,r,n,o){var i=this.setupParams(t,r,n);return i.loc=JSON.stringify(this.source.currentLocation),i=this.objectLiteral(i),o?(this.useRegister("options"),n.push("options"),["options=",i]):n?(n.push(i),""):i}};(function(){for(var e="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),t=ni.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();ni.isValidJavaScriptVariableName=function(e){return!ni.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function yZ(e,t,r,n,o){var i=t.popStack(),s=r.length;for(e&&s--;n<s;n++)i=t.nameLookup(i,r[n],o);return e?[t.aliasable("container.strict"),"(",i,", ",t.quotedString(r[n]),", ",JSON.stringify(t.source.currentLocation)," )"]:i}Cu.default=ni;o1.exports=Cu.default});var c1=S((Eu,a1)=>{"use strict";Eu.__esModule=!0;function js(e){return e&&e.__esModule?e:{default:e}}var _Z=uS(),vZ=js(_Z),bZ=Km(),xZ=js(bZ),vg=wS(),bg=TS(),wZ=i1(),kZ=js(wZ),SZ=vu(),$Z=js(SZ),TZ=Vm(),PZ=js(TZ),CZ=vZ.default.create;function s1(){var e=CZ();return e.compile=function(t,r){return bg.compile(t,r,e)},e.precompile=function(t,r){return bg.precompile(t,r,e)},e.AST=xZ.default,e.Compiler=bg.Compiler,e.JavaScriptCompiler=kZ.default,e.Parser=vg.parser,e.parse=vg.parse,e.parseWithoutProcessing=vg.parseWithoutProcessing,e}var oi=s1();oi.create=s1;PZ.default(oi);oi.Visitor=$Z.default;oi.default=oi;Eu.default=oi;a1.exports=Eu.default});var u1=S(Iu=>{"use strict";Iu.__esModule=!0;Iu.print=RZ;Iu.PrintVisitor=Ae;function EZ(e){return e&&e.__esModule?e:{default:e}}var IZ=vu(),zZ=EZ(IZ);function RZ(e){return new Ae().accept(e)}function Ae(){this.padding=0}Ae.prototype=new zZ.default;Ae.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
|
|
95
|
-
`,t};Ae.prototype.Program=function(e){var t="",r=e.body,n=void 0,o=void 0;if(e.blockParams){var i="BLOCK PARAMS: [";for(n=0,o=e.blockParams.length;n<o;n++)i+=" "+e.blockParams[n];i+=" ]",t+=this.pad(i)}for(n=0,o=r.length;n<o;n++)t+=this.accept(r[n]);return this.padding--,t};Ae.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Ae.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Ae.prototype.BlockStatement=Ae.prototype.DecoratorBlock=function(e){var t="";return t+=this.pad((e.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad("{{^}}"),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t};Ae.prototype.PartialStatement=function(e){var t="PARTIAL:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),this.pad("{{> "+t+" }}")};Ae.prototype.PartialBlockStatement=function(e){var t="PARTIAL BLOCK:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),t+=" "+this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--,this.pad("{{> "+t+" }}")};Ae.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Ae.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Ae.prototype.SubExpression=function(e){for(var t=e.params,r=[],n=void 0,o=0,i=t.length;o<i;o++)r.push(this.accept(t[o]));return t="["+r.join(", ")+"]",n=e.hash?" "+this.accept(e.hash):"",this.accept(e.path)+" "+t+n};Ae.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Ae.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Ae.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Ae.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Ae.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Ae.prototype.NullLiteral=function(){return"NULL"};Ae.prototype.Hash=function(e){for(var t=e.pairs,r=[],n=0,o=t.length;n<o;n++)r.push(this.accept(t[n]));return"HASH{"+r.join(", ")+"}"};Ae.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var xg=S((OV,d1)=>{var zu=c1().default,p1=u1();zu.PrintVisitor=p1.PrintVisitor;zu.print=p1.print;d1.exports=zu;function l1(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=zu.compile(n)}typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=l1,require.extensions[".hbs"]=l1)});function Ms(e,t){Ru.default.registerPartial(e,t)}function Mr(e,t){AZ.set(e,t),wg.set(e,Ru.default.compile(t))}function OZ(e,t){return{profile_name:e.name,stacks:e.stacks,frontend:e.frontend?{...e.frontend,mindset:""}:void 0,backend:e.backend?{...e.backend,mindset:""}:void 0,quality_gate:e.quality_gate,tools:e.tools??[],vendor:e.vendor??[],...t}}function f1(e,t){let r=wg.get(`mindset:${e}`);return r?r(t):`[Mindset '${e}' not found]`}function h1(e,t,r){let n=wg.get(`prompt:${e}`);if(!n)throw new Error(`\u30D7\u30ED\u30F3\u30D7\u30C8\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 '${e}' \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093`);let o=OZ(t,r);if(t.frontend?.mindset_template){let i=f1(t.frontend.mindset_template,o);o.frontend.mindset=i}if(t.backend?.mindset_template){let i=f1(t.backend.mindset_template,o);o.backend.mindset=i}return n(o)}var Ru,wg,AZ,Au=_(()=>{"use strict";Ru=st(xg(),1);Ru.default.registerHelper("eq",function(e,t){return e===t});wg=new Map,AZ=new Map});function Ou(e,t){if((0,ii.existsSync)(e))for(let r of(0,ii.readdirSync)(e)){if(!r.endsWith(".hbs"))continue;let n=(0,Lr.basename)(r,".hbs");try{let o=(0,ii.readFileSync)((0,Lr.join)(e,r),"utf-8");t(n,o)}catch(o){console.error(`[GoDD] \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u8AAD\u307F\u8FBC\u307F\u30B9\u30AD\u30C3\u30D7: ${(0,Lr.join)(e,r)} \u2014 ${Ne(o)}`)}}}function kg(e){Ou((0,Lr.join)(e,"partials"),(t,r)=>Ms(t,r)),Ou((0,Lr.join)(e,"prompts"),(t,r)=>Mr(`prompt:${t}`,r)),Ou((0,Lr.join)(e,"mindsets"),(t,r)=>Mr(`mindset:${t}`,r)),Ou((0,Lr.join)(e,"agents"),(t,r)=>Mr(`agent:${t}`,r))}async function NZ(e,t){let{pbkdf2:r}=await import("node:crypto");return new Promise((n,o)=>{r(e,t,1e5,32,"sha256",(i,s)=>{i?o(i):n(s)})})}async function DZ(e,t){let r;try{r=JSON.parse(e)}catch(p){throw new Error(`\u6697\u53F7\u5316\u30D0\u30F3\u30C9\u30EB\u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${Ne(p)}`)}if(r.version!==1)throw new Error(`\u672A\u5BFE\u5FDC\u306E\u30D0\u30F3\u30C9\u30EB\u30D0\u30FC\u30B8\u30E7\u30F3: ${r.version}`);let n=Buffer.from(r.salt,"hex"),o=Buffer.from(r.iv,"hex"),i=Buffer.from(r.tag,"hex"),s=Buffer.from(r.data,"base64"),a=await NZ(t,n),c=(0,m1.createDecipheriv)("aes-256-gcm",a,o);c.setAuthTag(i);let u=Buffer.concat([c.update(s),c.final()]);for(let[p,l]of Object.entries(r.templates)){if(!Number.isInteger(l.offset)||!Number.isInteger(l.length)||l.offset<0||l.length<0||l.offset+l.length>u.length)throw new Error(`\u30D0\u30F3\u30C9\u30EB\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 "${p}" \u306E offset/length \u304C\u4E0D\u6B63\u3067\u3059 (offset=${l.offset}, length=${l.length}, bufferSize=${u.length})`);let d=u.subarray(l.offset,l.offset+l.length).toString("utf-8"),f=p.includes(":")?p.split(":").slice(1).join(":"):p;l.type==="partial"?Ms(f,d):Mr(`${l.type}:${f}`,d)}}async function g1(e){return!1}var ii,Lr,m1,y1=_(()=>{"use strict";ii=require("node:fs"),Lr=require("node:path"),m1=require("node:crypto");Au();Ko()});function jZ(){let e=`${(0,v1.hostname)()}-${process.env.USERNAME??process.env.USER??"unknown"}`;return(0,_1.createHash)("sha256").update(e).digest("hex").slice(0,32)}async function b1(e){let t=`${e.registry_url}/v1/auth/validate`,r=jZ(),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({license_key:e.license_key,machine_id:r}),signal:AbortSignal.timeout(1e4)});if(!n.ok)throw new Error(`Registry API \u8A8D\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${n.status} ${n.statusText}`);let o=await n.text(),i;try{i=JSON.parse(o)}catch{throw new Error(`Registry API \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${o.slice(0,200)}`)}let s=MZ.safeParse(i);if(!s.success)throw new Error(`Registry API \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${s.error.message}`);return s.data}async function x1(e,t){let r=e.components??[];if(r.length===0)return null;let n=new URLSearchParams({components:r.join(","),language:e.language}),o=`${e.registry_url}/v1/bundle?${n.toString()}`,i={Authorization:`Bearer ${e.license_key}`};t&&(i["If-None-Match"]=`"${t}"`);let s=await fetch(o,{headers:i,signal:AbortSignal.timeout(1e4)});if(s.status===304)return null;if(!s.ok){let d=await s.text();throw new Error(`Registry API \u30D0\u30F3\u30C9\u30EB\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${s.status} \u2014 ${d}`)}let a=await s.text(),c;try{c=JSON.parse(a)}catch{throw new Error(`Registry API \u306E\u30D0\u30F3\u30C9\u30EB\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${a.slice(0,200)}`)}let u=LZ.safeParse(c);if(!u.success)throw new Error(`Registry API \u306E\u30D0\u30F3\u30C9\u30EB\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${u.error.message}`);let p=u.data,l=s.headers.get("ETag")?.replace(/"/g,"")??"";return{bundle:p,etag:l}}async function w1(e,t){let{pbkdf2:r}=await import("node:crypto"),{createDecipheriv:n}=await import("node:crypto"),o=Buffer.from(e.salt,"hex"),i=Buffer.from(e.iv,"hex"),s=Buffer.from(e.tag,"hex"),a=Buffer.from(e.data,"base64"),c=await new Promise((l,d)=>{r(t,o,1e5,32,"sha256",(f,h)=>{f?d(f):l(h)})}),u=n("aes-256-gcm",c,i);u.setAuthTag(s);let p=Buffer.concat([u.update(a),u.final()]);try{return JSON.parse(p.toString("utf-8"))}catch(l){throw new Error(`Registry API \u30D0\u30F3\u30C9\u30EB\u306E\u5FA9\u53F7\u7D50\u679C\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${Ne(l)}`)}}var _1,v1,MZ,LZ,k1=_(()=>{"use strict";_1=require("node:crypto"),v1=require("node:os");pe();Ko();MZ=m.object({valid:m.boolean(),expires_at:m.string().nullable().optional().default(null),error:m.string().nullable().optional().default(null)});LZ=m.object({version:m.number(),salt:m.string(),iv:m.string(),tag:m.string(),data:m.string(),templates:m.record(m.object({type:m.string()}))})});function Sg(){let e=process.env.HOME??process.env.USERPROFILE??(0,S1.homedir)(),t=(0,so.join)(e,".godd","cache");return(0,St.existsSync)(t)||(0,St.mkdirSync)(t,{recursive:!0}),t}function $g(e,t){let r=`${[...e].sort().join(",")}_${t}`;return(0,or.createHash)("sha256").update(r).digest("hex").slice(0,16)}function $1(e,t){return new Promise((r,n)=>{(0,or.pbkdf2)(e,t,5e4,32,"sha256",(o,i)=>{o?n(o):r(i)})})}async function qZ(e,t){let r=(0,or.randomBytes)(32),n=await $1(t,r),o=(0,or.randomBytes)(12),i=(0,or.createCipheriv)("aes-256-gcm",n,o),s=Buffer.concat([i.update(e),i.final()]),a=i.getAuthTag();return Buffer.concat([r,o,a,s])}async function FZ(e,t){let r=e.subarray(0,32),n=e.subarray(32,44),o=e.subarray(44,60),i=e.subarray(60),s=await $1(t,r),a=(0,or.createDecipheriv)("aes-256-gcm",s,n);return a.setAuthTag(o),Buffer.concat([a.update(i),a.final()])}async function T1(e,t,r,n,o){let i=Sg(),s=$g(r,n),a=await qZ(Buffer.from(e,"utf-8"),o);(0,St.writeFileSync)((0,so.join)(i,`bundle-${s}.enc`),a);let c={etag:t,timestamp:Date.now(),components:r,language:n,profileHash:s};(0,St.writeFileSync)((0,so.join)(i,"meta.json"),JSON.stringify(c,null,2),"utf-8")}async function P1(e,t,r){let n=Sg(),o=(0,so.join)(n,"meta.json");if(!(0,St.existsSync)(o))return null;let i;try{i=JSON.parse((0,St.readFileSync)(o,"utf-8"))}catch{return null}let s=$g(e,t);if(i.profileHash!==s)return null;let a=(0,so.join)(n,`bundle-${s}.enc`);if(!(0,St.existsSync)(a))return null;try{let c=(0,St.readFileSync)(a);return{data:(await FZ(c,r)).toString("utf-8"),etag:i.etag,isExpired:Date.now()-i.timestamp>ZZ}}catch{return null}}function C1(e,t){let r=Sg(),n=(0,so.join)(r,"meta.json");if((0,St.existsSync)(n))try{let o=JSON.parse((0,St.readFileSync)(n,"utf-8")),i=$g(e,t);return o.profileHash!==i?void 0:o.etag}catch{return}}var or,St,S1,so,ZZ,E1=_(()=>{"use strict";or=require("node:crypto"),St=require("node:fs"),S1=require("node:os"),so=require("node:path"),ZZ=600*60*1e3});function Ls(e){for(let[t,r]of Object.entries(e.partials))Ms(t,r);for(let[t,r]of Object.entries(e.prompts))Mr(`prompt:${t}`,r);for(let[t,r]of Object.entries(e.agents))Mr(`agent:${t}`,r);for(let[t,r]of Object.entries(e.mindsets))Mr(`mindset:${t}`,r)}var I1=_(()=>{"use strict";Au()});function Zs(e){let t=e??process.cwd();try{let r=(0,z1.execSync)("git config --get remote.origin.url",{encoding:"utf-8",cwd:t,timeout:5e3}).trim();if(r)return r}catch{}try{let r=(0,R1.join)(t,".git","config");return(0,Nu.existsSync)(r)?(0,Nu.readFileSync)(r,"utf-8").match(/\[remote\s+"origin"\][^[]*url\s*=\s*(.+)/)?.[1]?.trim()??null:null}catch{return null}}var z1,Nu,R1,Tg=_(()=>{"use strict";z1=require("node:child_process"),Nu=require("node:fs"),R1=require("node:path")});async function Cg(e,t){let r=Zs();if(!r)throw new Error("Git \u30EA\u30E2\u30FC\u30C8 (origin) \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002godd init \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002");let n=await fetch(`${e}/v1/repos/register`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({remote_url:r}),signal:AbortSignal.timeout(1e4)});if(!n.ok){let i=(await n.json().catch(()=>({detail:n.statusText}))).detail,s=typeof i=="string"?i:i!=null?JSON.stringify(i):n.statusText;throw new Error(`\u30EA\u30DD\u30B8\u30C8\u30EA\u691C\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${s}`)}Pg.set(r,{verified:!0,verifiedAt:Date.now()})}function UZ(e){if(e){let t=Pg.get(e);return t?Date.now()-t.verifiedAt<A1:!1}for(let t of Pg.values())if(Date.now()-t.verifiedAt<A1)return!0;return!1}async function O1(e,t){let r=Zs();r&&UZ(r)||await Cg(e,t)}var A1,Pg,N1=_(()=>{"use strict";Tg();A1=3600*1e3,Pg=new Map});function si(e){try{return(0,te.existsSync)(e)?JSON.parse((0,te.readFileSync)(e,"utf-8")):null}catch{return null}}function Zr(e,t=4096){try{return(0,te.existsSync)(e)?(0,te.readFileSync)(e).subarray(0,t).toString("utf-8"):""}catch{return""}}function VZ(e){let t=(0,H.join)(e,"vendor");if(!(0,te.existsSync)(t))return[];let r=[];try{for(let n of(0,te.readdirSync)(t)){let o=(0,H.join)(t,n);if(!(0,te.statSync)(o).isDirectory())continue;let i=BZ[n];if(i)r.push({name:n,path:o,description:i.description,runtime:i.runtime,setupHint:i.setupHint});else{let s=(0,te.existsSync)((0,H.join)(o,"pyproject.toml")),a=(0,te.existsSync)((0,H.join)(o,"package.json")),c=s?"python":a?"node":"unknown";r.push({name:n,path:o,description:`vendor/${n}`,runtime:c,setupHint:c==="python"?"uv sync":"pnpm install"})}}}catch{}return r}function HZ(e){let t=[],r=(0,H.join)(e,"backend","pyproject.toml"),n=(0,H.join)(e,"backend","requirements.txt");if((0,te.existsSync)(r)){let y=Zr(r);y.includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/pyproject.toml \u306B fastapi \u3092\u691C\u51FA"}),y.includes("django")&&t.push({id:"django",label:"Django",evidence:"backend/pyproject.toml \u306B django \u3092\u691C\u51FA"})}else(0,te.existsSync)(n)&&Zr(n).includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/requirements.txt \u306B fastapi \u3092\u691C\u51FA"});let o=si((0,H.join)(e,"frontend","package.json")),i=si((0,H.join)(e,"package.json")),s=si((0,H.join)(e,"src","package.json"));for(let[y,b]of[["frontend/package.json",o],["package.json",i],["src/package.json",s]]){if(!b)continue;let v={...b.dependencies,...b.devDependencies};v.react&&t.push({id:"react",label:"React",evidence:`${y} \u306B react \u3092\u691C\u51FA`}),v.next&&t.push({id:"nextjs",label:"Next.js",evidence:`${y} \u306B next \u3092\u691C\u51FA`}),v.vue&&t.push({id:"vue",label:"Vue.js",evidence:`${y} \u306B vue \u3092\u691C\u51FA`}),v.svelte&&t.push({id:"svelte",label:"Svelte",evidence:`${y} \u306B svelte \u3092\u691C\u51FA`}),v.electron&&t.push({id:"electron",label:"Electron",evidence:`${y} \u306B electron \u3092\u691C\u51FA`})}let a=(0,H.join)(e,"pubspec.yaml");if((0,te.existsSync)(a)){let y=Zr(a);t.push({id:"dart",label:"Dart",evidence:"pubspec.yaml \u3092\u691C\u51FA"}),y.includes("flutter")&&t.push({id:"flutter",label:"Flutter",evidence:"pubspec.yaml \u306B flutter \u3092\u691C\u51FA"})}let c=(0,te.existsSync)((0,H.join)(e,"Package.swift")),u=(0,H.join)(e,"ios"),p=(0,te.existsSync)(u)&&(()=>{try{return(0,te.readdirSync)(u).some(y=>y.endsWith(".xcodeproj")||y.endsWith(".xcworkspace"))}catch{return!1}})();(c||p)&&t.push({id:"swift",label:"Swift",evidence:c?"Package.swift \u3092\u691C\u51FA":"ios/*.xcodeproj \u3092\u691C\u51FA"});let l=(0,te.existsSync)((0,H.join)(e,"build.gradle.kts")),d=(0,te.existsSync)((0,H.join)(e,"build.gradle")),f=(0,H.join)(e,"android"),h=(0,te.existsSync)((0,H.join)(f,"build.gradle.kts"))||(0,te.existsSync)((0,H.join)(f,"build.gradle"));(l||d||h)&&t.push({id:"kotlin",label:"Kotlin",evidence:l?"build.gradle.kts \u3092\u691C\u51FA":d?"build.gradle \u3092\u691C\u51FA":"android/build.gradle \u3092\u691C\u51FA"});let g=Zr((0,H.join)(e,"docker-compose.yml"));return g&&g.includes("postgres")&&t.push({id:"postgres",label:"Postgres",evidence:"docker-compose.yml \u306B postgres \u3092\u691C\u51FA"}),((0,te.existsSync)((0,H.join)(e,"prisma","schema.prisma"))||(0,te.existsSync)((0,H.join)(e,"backend","prisma","schema.prisma")))&&t.push({id:"prisma",label:"Prisma",evidence:"prisma/schema.prisma \u3092\u691C\u51FA"}),t}function WZ(e){let t={},r=new Map,n=[(0,H.join)(e,"package.json"),(0,H.join)(e,"frontend","package.json"),(0,H.join)(e,"src","package.json")];for(let o of n){let i=si(o);if(!i)continue;let s=o.replace(e,"").replace(/^[\\/]/,""),a=i.dependencies,c=i.devDependencies;for(let[u,p]of Object.entries({...a,...c}))t[u]=p,r.set(u,s)}return{deps:t,sources:r}}function KZ(e){let t=new Set,r="";for(let n of[(0,H.join)(e,"backend"),e]){let o=(0,H.join)(n,"pyproject.toml");if((0,te.existsSync)(o)){let a=Zr(o,16384).matchAll(/["']([a-zA-Z][\w.-]*)(?:\[.*?\])?(?:>=|<=|==|~=|!=|<|>)?/g);for(let c of a)t.add(c[1].toLowerCase().replace(/[-_.]+/g,"-"));r=o.replace(e,"").replace(/^[\\/]/,"");break}let i=(0,H.join)(n,"requirements.txt");if((0,te.existsSync)(i)){let s=Zr(i,16384);for(let a of s.split(`
|
|
96
|
-
`)){let c=a.trim();if(!c||c.startsWith("#"))continue;let u=c.match(/^([a-zA-Z][\w.-]*)/);u&&t.add(u[1].toLowerCase().replace(/[-_.]+/g,"-"))}r=i.replace(e,"").replace(/^[\\/]/,"");break}}return{deps:t,source:r}}function
|
|
94
|
+
`.trim()},blockValue:function(t){var r=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(t,0,n);var o=this.popStack();n.splice(1,0,o),this.push(this.source.functionCall(r,"call",n))},ambiguousBlockValue:function(){var t=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,!0),this.flushInline();var n=this.topStack();r.splice(1,0,n),this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(t,"call",r),"}"])},appendContent:function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function(){if(this.isInline())this.replaceStack(function(r){return[" != null ? ",r,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(t){this.lastContext=t},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(t,r,n,o){var i=0;!o&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(t[i++])):this.pushContext(),this.resolvePath("context",t,i,r,n)},lookupBlockParam:function(t,r){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",r,1)},lookupData:function(t,r,n){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",r,0,!0,n)},resolvePath:function(t,r,n,o,i){var s=this;if(this.options.strict||this.options.assumeObjects){this.push(wZ(this.options.strict&&i,this,r,n,t));return}for(var a=r.length;n<a;n++)this.replaceStack(function(c){var u=s.nameLookup(c,r[n],t);return o?[" && ",u]:[" != null ? ",u," : ",c]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(t,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof t=="string"?this.pushString(t):this.pushStackLiteral(t))},emptyHash:function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},pushString:function(t){this.pushStackLiteral(this.quotedString(t))},pushLiteral:function(t){this.pushStackLiteral(t)},pushProgram:function(t){t!=null?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},registerDecorator:function(t,r){var n=this.nameLookup("decorators",r,"decorator"),o=this.setupHelperArgs(r,t);this.decorators.push(["fn = ",this.decorators.functionCall(n,"",["fn","props","container",o])," || fn;"])},invokeHelper:function(t,r,n){var o=this.popStack(),i=this.setupHelper(t,r),s=[];n&&s.push(i.name),s.push(o),this.options.strict||s.push(this.aliasable("container.hooks.helperMissing"));var a=["(",this.itemsSeparatedBy(s,"||"),")"],c=this.source.functionCall(a,"call",i.callParams);this.push(c)},itemsSeparatedBy:function(t,r){var n=[];n.push(t[0]);for(var o=1;o<t.length;o++)n.push(r,t[o]);return n},invokeKnownHelper:function(t,r){var n=this.setupHelper(t,r);this.push(this.source.functionCall(n.name,"call",n.callParams))},invokeAmbiguous:function(t,r){this.useRegister("helper");var n=this.popStack();this.emptyHash();var o=this.setupHelper(0,t,r),i=this.lastHelper=this.nameLookup("helpers",t,"helper"),s=["(","(helper = ",i," || ",n,")"];this.options.strict||(s[0]="(helper = ",s.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",s,o.paramsInit?["),(",o.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",o.callParams)," : helper))"])},invokePartial:function(t,r,n){var o=[],i=this.setupParams(r,1,o);t&&(r=this.popStack(),delete i.name),n&&(i.indent=JSON.stringify(n)),i.helpers="helpers",i.partials="partials",i.decorators="container.decorators",t?o.unshift(r):o.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(i.depths="depths"),i=this.objectLiteral(i),o.push(i),this.push(this.source.functionCall("container.invokePartial","",o))},assignToHash:function(t){var r=this.popStack(),n=void 0,o=void 0,i=void 0;this.trackIds&&(i=this.popStack()),this.stringParams&&(o=this.popStack(),n=this.popStack());var s=this.hash;n&&(s.contexts[t]=n),o&&(s.types[t]=o),i&&(s.ids[t]=i),s.values[t]=r},pushId:function(t,r,n){t==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(n?" + "+JSON.stringify("."+n):"")):t==="PathExpression"?this.pushString(r):t==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:ni,compileChildren:function(t,r){for(var n=t.children,o=void 0,i=void 0,s=0,a=n.length;s<a;s++){o=n[s],i=new this.compiler;var c=this.matchExistingProgram(o);if(c==null){this.context.programs.push("");var u=this.context.programs.length;o.index=u,o.name="program"+u,this.context.programs[u]=i.compile(o,r,this.context,!this.precompile),this.context.decorators[u]=i.decorators,this.context.environments[u]=o,this.useDepths=this.useDepths||i.useDepths,this.useBlockParams=this.useBlockParams||i.useBlockParams,o.useDepths=this.useDepths,o.useBlockParams=this.useBlockParams}else o.index=c.index,o.name="program"+c.index,this.useDepths=this.useDepths||c.useDepths,this.useBlockParams=this.useBlockParams||c.useBlockParams}},matchExistingProgram:function(t){for(var r=0,n=this.context.environments.length;r<n;r++){var o=this.context.environments[r];if(o&&o.equals(t))return o}},programExpression:function(t){var r=this.environment.children[t],n=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths"),"container.program("+n.join(", ")+")"},useRegister:function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},push:function(t){return t instanceof ri||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function(t){this.push(new ri(t))},pushSource:function(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},replaceStack:function(t){var r=["("],n=void 0,o=void 0,i=void 0;if(!this.isInline())throw new _g.default("replaceStack on non-inline");var s=this.popStack(!0);if(s instanceof ri)n=[s.value],r=["(",n],i=!0;else{o=!0;var a=this.incrStack();r=["((",this.push(a)," = ",s,")"],n=this.topStack()}var c=t.call(this,n);i||this.popStack(),o&&this.stackSlot--,this.push(r.concat(c,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;this.inlineStack=[];for(var r=0,n=t.length;r<n;r++){var o=t[r];if(o instanceof ri)this.compileStack.push(o);else{var i=this.incrStack();this.pushSource([i," = ",o,";"]),this.compileStack.push(i)}}},isInline:function(){return this.inlineStack.length},popStack:function(t){var r=this.isInline(),n=(r?this.inlineStack:this.compileStack).pop();if(!t&&n instanceof ri)return n.value;if(!r){if(!this.stackSlot)throw new _g.default("Invalid stack pop");this.stackSlot--}return n},topStack:function(){var t=this.isInline()?this.inlineStack:this.compileStack,r=t[t.length-1];return r instanceof ri?r.value:r},contextName:function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},quotedString:function(t){return this.source.quotedString(t)},objectLiteral:function(t){return this.source.objectLiteral(t)},aliasable:function(t){var r=this.aliases[t];return r?(r.referenceCount++,r):(r=this.aliases[t]=this.source.wrap(t),r.aliasable=!0,r.referenceCount=1,r)},setupHelper:function(t,r,n){var o=[],i=this.setupHelperArgs(r,t,o,n),s=this.nameLookup("helpers",r,"helper"),a=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:o,paramsInit:i,name:s,callParams:[a].concat(o)}},setupParams:function(t,r,n){var o={},i=[],s=[],a=[],c=!n,u=void 0;c&&(n=[]),o.name=this.quotedString(t),o.hash=this.popStack(),this.trackIds&&(o.hashIds=this.popStack()),this.stringParams&&(o.hashTypes=this.popStack(),o.hashContexts=this.popStack());var p=this.popStack(),l=this.popStack();(l||p)&&(o.fn=l||"container.noop",o.inverse=p||"container.noop");for(var d=r;d--;)u=this.popStack(),n[d]=u,this.trackIds&&(a[d]=this.popStack()),this.stringParams&&(s[d]=this.popStack(),i[d]=this.popStack());return c&&(o.args=this.source.generateArray(n)),this.trackIds&&(o.ids=this.source.generateArray(a)),this.stringParams&&(o.types=this.source.generateArray(s),o.contexts=this.source.generateArray(i)),this.options.data&&(o.data="data"),this.useBlockParams&&(o.blockParams="blockParams"),o},setupHelperArgs:function(t,r,n,o){var i=this.setupParams(t,r,n);return i.loc=JSON.stringify(this.source.currentLocation),i=this.objectLiteral(i),o?(this.useRegister("options"),n.push("options"),["options=",i]):n?(n.push(i),""):i}};(function(){for(var e="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),t=ni.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();ni.isValidJavaScriptVariableName=function(e){return!ni.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function wZ(e,t,r,n,o){var i=t.popStack(),s=r.length;for(e&&s--;n<s;n++)i=t.nameLookup(i,r[n],o);return e?[t.aliasable("container.strict"),"(",i,", ",t.quotedString(r[n]),", ",JSON.stringify(t.source.currentLocation)," )"]:i}Cu.default=ni;o1.exports=Cu.default});var c1=S((Eu,a1)=>{"use strict";Eu.__esModule=!0;function js(e){return e&&e.__esModule?e:{default:e}}var kZ=uS(),SZ=js(kZ),$Z=Km(),TZ=js($Z),vg=wS(),bg=TS(),PZ=i1(),CZ=js(PZ),EZ=vu(),IZ=js(EZ),zZ=Vm(),RZ=js(zZ),AZ=SZ.default.create;function s1(){var e=AZ();return e.compile=function(t,r){return bg.compile(t,r,e)},e.precompile=function(t,r){return bg.precompile(t,r,e)},e.AST=TZ.default,e.Compiler=bg.Compiler,e.JavaScriptCompiler=CZ.default,e.Parser=vg.parser,e.parse=vg.parse,e.parseWithoutProcessing=vg.parseWithoutProcessing,e}var oi=s1();oi.create=s1;RZ.default(oi);oi.Visitor=IZ.default;oi.default=oi;Eu.default=oi;a1.exports=Eu.default});var u1=S(Iu=>{"use strict";Iu.__esModule=!0;Iu.print=jZ;Iu.PrintVisitor=Ae;function OZ(e){return e&&e.__esModule?e:{default:e}}var NZ=vu(),DZ=OZ(NZ);function jZ(e){return new Ae().accept(e)}function Ae(){this.padding=0}Ae.prototype=new DZ.default;Ae.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
|
|
95
|
+
`,t};Ae.prototype.Program=function(e){var t="",r=e.body,n=void 0,o=void 0;if(e.blockParams){var i="BLOCK PARAMS: [";for(n=0,o=e.blockParams.length;n<o;n++)i+=" "+e.blockParams[n];i+=" ]",t+=this.pad(i)}for(n=0,o=r.length;n<o;n++)t+=this.accept(r[n]);return this.padding--,t};Ae.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Ae.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Ae.prototype.BlockStatement=Ae.prototype.DecoratorBlock=function(e){var t="";return t+=this.pad((e.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad("{{^}}"),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t};Ae.prototype.PartialStatement=function(e){var t="PARTIAL:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),this.pad("{{> "+t+" }}")};Ae.prototype.PartialBlockStatement=function(e){var t="PARTIAL BLOCK:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),t+=" "+this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--,this.pad("{{> "+t+" }}")};Ae.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Ae.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Ae.prototype.SubExpression=function(e){for(var t=e.params,r=[],n=void 0,o=0,i=t.length;o<i;o++)r.push(this.accept(t[o]));return t="["+r.join(", ")+"]",n=e.hash?" "+this.accept(e.hash):"",this.accept(e.path)+" "+t+n};Ae.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Ae.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Ae.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Ae.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Ae.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Ae.prototype.NullLiteral=function(){return"NULL"};Ae.prototype.Hash=function(e){for(var t=e.pairs,r=[],n=0,o=t.length;n<o;n++)r.push(this.accept(t[n]));return"HASH{"+r.join(", ")+"}"};Ae.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var xg=S((FV,d1)=>{var zu=c1().default,p1=u1();zu.PrintVisitor=p1.PrintVisitor;zu.print=p1.print;d1.exports=zu;function l1(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=zu.compile(n)}typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=l1,require.extensions[".hbs"]=l1)});function Ms(e,t){Ru.default.registerPartial(e,t)}function Mr(e,t){MZ.set(e,t),wg.set(e,Ru.default.compile(t))}function LZ(e,t){return{profile_name:e.name,stacks:e.stacks,frontend:e.frontend?{...e.frontend,mindset:""}:void 0,backend:e.backend?{...e.backend,mindset:""}:void 0,quality_gate:e.quality_gate,tools:e.tools??[],vendor:e.vendor??[],...t}}function f1(e,t){let r=wg.get(`mindset:${e}`);return r?r(t):`[Mindset '${e}' not found]`}function h1(e,t,r){let n=wg.get(`prompt:${e}`);if(!n)throw new Error(`\u30D7\u30ED\u30F3\u30D7\u30C8\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 '${e}' \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093`);let o=LZ(t,r);if(t.frontend?.mindset_template){let i=f1(t.frontend.mindset_template,o);o.frontend.mindset=i}if(t.backend?.mindset_template){let i=f1(t.backend.mindset_template,o);o.backend.mindset=i}return n(o)}var Ru,wg,MZ,Au=_(()=>{"use strict";Ru=st(xg(),1);Ru.default.registerHelper("eq",function(e,t){return e===t});wg=new Map,MZ=new Map});function Ou(e,t){if((0,ii.existsSync)(e))for(let r of(0,ii.readdirSync)(e)){if(!r.endsWith(".hbs"))continue;let n=(0,Lr.basename)(r,".hbs");try{let o=(0,ii.readFileSync)((0,Lr.join)(e,r),"utf-8");t(n,o)}catch(o){console.error(`[GoDD] \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u8AAD\u307F\u8FBC\u307F\u30B9\u30AD\u30C3\u30D7: ${(0,Lr.join)(e,r)} \u2014 ${Ne(o)}`)}}}function kg(e){Ou((0,Lr.join)(e,"partials"),(t,r)=>Ms(t,r)),Ou((0,Lr.join)(e,"prompts"),(t,r)=>Mr(`prompt:${t}`,r)),Ou((0,Lr.join)(e,"mindsets"),(t,r)=>Mr(`mindset:${t}`,r)),Ou((0,Lr.join)(e,"agents"),(t,r)=>Mr(`agent:${t}`,r))}async function ZZ(e,t){let{pbkdf2:r}=await import("node:crypto");return new Promise((n,o)=>{r(e,t,1e5,32,"sha256",(i,s)=>{i?o(i):n(s)})})}async function qZ(e,t){let r;try{r=JSON.parse(e)}catch(p){throw new Error(`\u6697\u53F7\u5316\u30D0\u30F3\u30C9\u30EB\u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${Ne(p)}`)}if(r.version!==1)throw new Error(`\u672A\u5BFE\u5FDC\u306E\u30D0\u30F3\u30C9\u30EB\u30D0\u30FC\u30B8\u30E7\u30F3: ${r.version}`);let n=Buffer.from(r.salt,"hex"),o=Buffer.from(r.iv,"hex"),i=Buffer.from(r.tag,"hex"),s=Buffer.from(r.data,"base64"),a=await ZZ(t,n),c=(0,m1.createDecipheriv)("aes-256-gcm",a,o);c.setAuthTag(i);let u=Buffer.concat([c.update(s),c.final()]);for(let[p,l]of Object.entries(r.templates)){if(!Number.isInteger(l.offset)||!Number.isInteger(l.length)||l.offset<0||l.length<0||l.offset+l.length>u.length)throw new Error(`\u30D0\u30F3\u30C9\u30EB\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 "${p}" \u306E offset/length \u304C\u4E0D\u6B63\u3067\u3059 (offset=${l.offset}, length=${l.length}, bufferSize=${u.length})`);let d=u.subarray(l.offset,l.offset+l.length).toString("utf-8"),f=p.includes(":")?p.split(":").slice(1).join(":"):p;l.type==="partial"?Ms(f,d):Mr(`${l.type}:${f}`,d)}}async function g1(e){return!1}var ii,Lr,m1,y1=_(()=>{"use strict";ii=require("node:fs"),Lr=require("node:path"),m1=require("node:crypto");Au();Ko()});function FZ(){let e=`${(0,v1.hostname)()}-${process.env.USERNAME??process.env.USER??"unknown"}`;return(0,_1.createHash)("sha256").update(e).digest("hex").slice(0,32)}async function b1(e){let t=`${e.registry_url}/v1/auth/validate`,r=FZ(),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({license_key:e.license_key,machine_id:r}),signal:AbortSignal.timeout(1e4)});if(!n.ok)throw new Error(`Registry API \u8A8D\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${n.status} ${n.statusText}`);let o=await n.text(),i;try{i=JSON.parse(o)}catch{throw new Error(`Registry API \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${o.slice(0,200)}`)}let s=UZ.safeParse(i);if(!s.success)throw new Error(`Registry API \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${s.error.message}`);return s.data}async function x1(e,t){let r=e.components??[];if(r.length===0)return null;let n=new URLSearchParams({components:r.join(","),language:e.language}),o=`${e.registry_url}/v1/bundle?${n.toString()}`,i={Authorization:`Bearer ${e.license_key}`};t&&(i["If-None-Match"]=`"${t}"`);let s=await fetch(o,{headers:i,signal:AbortSignal.timeout(1e4)});if(s.status===304)return null;if(!s.ok){let d=await s.text();throw new Error(`Registry API \u30D0\u30F3\u30C9\u30EB\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${s.status} \u2014 ${d}`)}let a=await s.text(),c;try{c=JSON.parse(a)}catch{throw new Error(`Registry API \u306E\u30D0\u30F3\u30C9\u30EB\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${a.slice(0,200)}`)}let u=BZ.safeParse(c);if(!u.success)throw new Error(`Registry API \u306E\u30D0\u30F3\u30C9\u30EB\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${u.error.message}`);let p=u.data,l=s.headers.get("ETag")?.replace(/"/g,"")??"";return{bundle:p,etag:l}}async function w1(e,t){let{pbkdf2:r}=await import("node:crypto"),{createDecipheriv:n}=await import("node:crypto"),o=Buffer.from(e.salt,"hex"),i=Buffer.from(e.iv,"hex"),s=Buffer.from(e.tag,"hex"),a=Buffer.from(e.data,"base64"),c=await new Promise((l,d)=>{r(t,o,1e5,32,"sha256",(f,h)=>{f?d(f):l(h)})}),u=n("aes-256-gcm",c,i);u.setAuthTag(s);let p=Buffer.concat([u.update(a),u.final()]);try{return JSON.parse(p.toString("utf-8"))}catch(l){throw new Error(`Registry API \u30D0\u30F3\u30C9\u30EB\u306E\u5FA9\u53F7\u7D50\u679C\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${Ne(l)}`)}}var _1,v1,UZ,BZ,k1=_(()=>{"use strict";_1=require("node:crypto"),v1=require("node:os");pe();Ko();UZ=m.object({valid:m.boolean(),expires_at:m.string().nullable().optional().default(null),error:m.string().nullable().optional().default(null)});BZ=m.object({version:m.number(),salt:m.string(),iv:m.string(),tag:m.string(),data:m.string(),templates:m.record(m.object({type:m.string()}))})});function Sg(){let e=process.env.HOME??process.env.USERPROFILE??(0,S1.homedir)(),t=(0,so.join)(e,".godd","cache");return(0,St.existsSync)(t)||(0,St.mkdirSync)(t,{recursive:!0}),t}function $g(e,t){let r=`${[...e].sort().join(",")}_${t}`;return(0,or.createHash)("sha256").update(r).digest("hex").slice(0,16)}function $1(e,t){return new Promise((r,n)=>{(0,or.pbkdf2)(e,t,5e4,32,"sha256",(o,i)=>{o?n(o):r(i)})})}async function HZ(e,t){let r=(0,or.randomBytes)(32),n=await $1(t,r),o=(0,or.randomBytes)(12),i=(0,or.createCipheriv)("aes-256-gcm",n,o),s=Buffer.concat([i.update(e),i.final()]),a=i.getAuthTag();return Buffer.concat([r,o,a,s])}async function GZ(e,t){let r=e.subarray(0,32),n=e.subarray(32,44),o=e.subarray(44,60),i=e.subarray(60),s=await $1(t,r),a=(0,or.createDecipheriv)("aes-256-gcm",s,n);return a.setAuthTag(o),Buffer.concat([a.update(i),a.final()])}async function T1(e,t,r,n,o){let i=Sg(),s=$g(r,n),a=await HZ(Buffer.from(e,"utf-8"),o);(0,St.writeFileSync)((0,so.join)(i,`bundle-${s}.enc`),a);let c={etag:t,timestamp:Date.now(),components:r,language:n,profileHash:s};(0,St.writeFileSync)((0,so.join)(i,"meta.json"),JSON.stringify(c,null,2),"utf-8")}async function P1(e,t,r){let n=Sg(),o=(0,so.join)(n,"meta.json");if(!(0,St.existsSync)(o))return null;let i;try{i=JSON.parse((0,St.readFileSync)(o,"utf-8"))}catch{return null}let s=$g(e,t);if(i.profileHash!==s)return null;let a=(0,so.join)(n,`bundle-${s}.enc`);if(!(0,St.existsSync)(a))return null;try{let c=(0,St.readFileSync)(a);return{data:(await GZ(c,r)).toString("utf-8"),etag:i.etag,isExpired:Date.now()-i.timestamp>VZ}}catch{return null}}function C1(e,t){let r=Sg(),n=(0,so.join)(r,"meta.json");if((0,St.existsSync)(n))try{let o=JSON.parse((0,St.readFileSync)(n,"utf-8")),i=$g(e,t);return o.profileHash!==i?void 0:o.etag}catch{return}}var or,St,S1,so,VZ,E1=_(()=>{"use strict";or=require("node:crypto"),St=require("node:fs"),S1=require("node:os"),so=require("node:path"),VZ=600*60*1e3});function Ls(e){for(let[t,r]of Object.entries(e.partials))Ms(t,r);for(let[t,r]of Object.entries(e.prompts))Mr(`prompt:${t}`,r);for(let[t,r]of Object.entries(e.agents))Mr(`agent:${t}`,r);for(let[t,r]of Object.entries(e.mindsets))Mr(`mindset:${t}`,r)}var I1=_(()=>{"use strict";Au()});function Zs(e){let t=e??process.cwd();try{let r=(0,z1.execSync)("git config --get remote.origin.url",{encoding:"utf-8",cwd:t,timeout:5e3}).trim();if(r)return r}catch{}try{let r=(0,R1.join)(t,".git","config");return(0,Nu.existsSync)(r)?(0,Nu.readFileSync)(r,"utf-8").match(/\[remote\s+"origin"\][^[]*url\s*=\s*(.+)/)?.[1]?.trim()??null:null}catch{return null}}var z1,Nu,R1,Tg=_(()=>{"use strict";z1=require("node:child_process"),Nu=require("node:fs"),R1=require("node:path")});async function Cg(e,t){let r=Zs();if(!r)throw new Error("Git \u30EA\u30E2\u30FC\u30C8 (origin) \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002godd init \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002");let n=await fetch(`${e}/v1/repos/register`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({remote_url:r}),signal:AbortSignal.timeout(1e4)});if(!n.ok){let i=(await n.json().catch(()=>({detail:n.statusText}))).detail,s=typeof i=="string"?i:i!=null?JSON.stringify(i):n.statusText;throw new Error(`\u30EA\u30DD\u30B8\u30C8\u30EA\u691C\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${s}`)}Pg.set(r,{verified:!0,verifiedAt:Date.now()})}function WZ(e){if(e){let t=Pg.get(e);return t?Date.now()-t.verifiedAt<A1:!1}for(let t of Pg.values())if(Date.now()-t.verifiedAt<A1)return!0;return!1}async function O1(e,t){let r=Zs();r&&WZ(r)||await Cg(e,t)}var A1,Pg,N1=_(()=>{"use strict";Tg();A1=3600*1e3,Pg=new Map});function si(e){try{return(0,re.existsSync)(e)?JSON.parse((0,re.readFileSync)(e,"utf-8")):null}catch{return null}}function Zr(e,t=4096){try{return(0,re.existsSync)(e)?(0,re.readFileSync)(e).subarray(0,t).toString("utf-8"):""}catch{return""}}function JZ(e){let t=(0,W.join)(e,"vendor");if(!(0,re.existsSync)(t))return[];let r=[];try{for(let n of(0,re.readdirSync)(t)){let o=(0,W.join)(t,n);if(!(0,re.statSync)(o).isDirectory())continue;let i=KZ[n];if(i)r.push({name:n,path:o,description:i.description,runtime:i.runtime,setupHint:i.setupHint});else{let s=(0,re.existsSync)((0,W.join)(o,"pyproject.toml")),a=(0,re.existsSync)((0,W.join)(o,"package.json")),c=s?"python":a?"node":"unknown";r.push({name:n,path:o,description:`vendor/${n}`,runtime:c,setupHint:c==="python"?"uv sync":"pnpm install"})}}}catch{}return r}function YZ(e){let t=[],r=(0,W.join)(e,"backend","pyproject.toml"),n=(0,W.join)(e,"backend","requirements.txt");if((0,re.existsSync)(r)){let y=Zr(r);y.includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/pyproject.toml \u306B fastapi \u3092\u691C\u51FA"}),y.includes("django")&&t.push({id:"django",label:"Django",evidence:"backend/pyproject.toml \u306B django \u3092\u691C\u51FA"})}else(0,re.existsSync)(n)&&Zr(n).includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/requirements.txt \u306B fastapi \u3092\u691C\u51FA"});let o=si((0,W.join)(e,"frontend","package.json")),i=si((0,W.join)(e,"package.json")),s=si((0,W.join)(e,"src","package.json"));for(let[y,b]of[["frontend/package.json",o],["package.json",i],["src/package.json",s]]){if(!b)continue;let v={...b.dependencies,...b.devDependencies};v.react&&t.push({id:"react",label:"React",evidence:`${y} \u306B react \u3092\u691C\u51FA`}),v.next&&t.push({id:"nextjs",label:"Next.js",evidence:`${y} \u306B next \u3092\u691C\u51FA`}),v.vue&&t.push({id:"vue",label:"Vue.js",evidence:`${y} \u306B vue \u3092\u691C\u51FA`}),v.svelte&&t.push({id:"svelte",label:"Svelte",evidence:`${y} \u306B svelte \u3092\u691C\u51FA`}),v.electron&&t.push({id:"electron",label:"Electron",evidence:`${y} \u306B electron \u3092\u691C\u51FA`})}let a=(0,W.join)(e,"pubspec.yaml");if((0,re.existsSync)(a)){let y=Zr(a);t.push({id:"dart",label:"Dart",evidence:"pubspec.yaml \u3092\u691C\u51FA"}),y.includes("flutter")&&t.push({id:"flutter",label:"Flutter",evidence:"pubspec.yaml \u306B flutter \u3092\u691C\u51FA"})}let c=(0,re.existsSync)((0,W.join)(e,"Package.swift")),u=(0,W.join)(e,"ios"),p=(0,re.existsSync)(u)&&(()=>{try{return(0,re.readdirSync)(u).some(y=>y.endsWith(".xcodeproj")||y.endsWith(".xcworkspace"))}catch{return!1}})();(c||p)&&t.push({id:"swift",label:"Swift",evidence:c?"Package.swift \u3092\u691C\u51FA":"ios/*.xcodeproj \u3092\u691C\u51FA"});let l=(0,re.existsSync)((0,W.join)(e,"build.gradle.kts")),d=(0,re.existsSync)((0,W.join)(e,"build.gradle")),f=(0,W.join)(e,"android"),h=(0,re.existsSync)((0,W.join)(f,"build.gradle.kts"))||(0,re.existsSync)((0,W.join)(f,"build.gradle"));(l||d||h)&&t.push({id:"kotlin",label:"Kotlin",evidence:l?"build.gradle.kts \u3092\u691C\u51FA":d?"build.gradle \u3092\u691C\u51FA":"android/build.gradle \u3092\u691C\u51FA"});let g=Zr((0,W.join)(e,"docker-compose.yml"));return g&&g.includes("postgres")&&t.push({id:"postgres",label:"Postgres",evidence:"docker-compose.yml \u306B postgres \u3092\u691C\u51FA"}),((0,re.existsSync)((0,W.join)(e,"prisma","schema.prisma"))||(0,re.existsSync)((0,W.join)(e,"backend","prisma","schema.prisma")))&&t.push({id:"prisma",label:"Prisma",evidence:"prisma/schema.prisma \u3092\u691C\u51FA"}),t}function XZ(e){let t={},r=new Map,n=[(0,W.join)(e,"package.json"),(0,W.join)(e,"frontend","package.json"),(0,W.join)(e,"src","package.json")];for(let o of n){let i=si(o);if(!i)continue;let s=o.replace(e,"").replace(/^[\\/]/,""),a=i.dependencies,c=i.devDependencies;for(let[u,p]of Object.entries({...a,...c}))t[u]=p,r.set(u,s)}return{deps:t,sources:r}}function e5(e){let t=new Set,r="";for(let n of[(0,W.join)(e,"backend"),e]){let o=(0,W.join)(n,"pyproject.toml");if((0,re.existsSync)(o)){let a=Zr(o,16384).matchAll(/["']([a-zA-Z][\w.-]*)(?:\[.*?\])?(?:>=|<=|==|~=|!=|<|>)?/g);for(let c of a)t.add(c[1].toLowerCase().replace(/[-_.]+/g,"-"));r=o.replace(e,"").replace(/^[\\/]/,"");break}let i=(0,W.join)(n,"requirements.txt");if((0,re.existsSync)(i)){let s=Zr(i,16384);for(let a of s.split(`
|
|
96
|
+
`)){let c=a.trim();if(!c||c.startsWith("#"))continue;let u=c.match(/^([a-zA-Z][\w.-]*)/);u&&t.add(u[1].toLowerCase().replace(/[-_.]+/g,"-"))}r=i.replace(e,"").replace(/^[\\/]/,"");break}}return{deps:t,source:r}}function t5(e){let t=[],r=new Set,{deps:n,sources:o}=XZ(e),{deps:i,source:s}=e5(e),a="";for(let c of["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"]){let u=Zr((0,W.join)(e,c));if(u){a=u;break}}for(let c of QZ)if(!r.has(c.id)){if(c.npmPackage&&c.npmPackage in n){let u=o.get(c.npmPackage)??"package.json";r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${u} \u306B ${c.npmPackage} \u3092\u691C\u51FA`,version:n[c.npmPackage],url:c.url});continue}if(c.pyPackage&&i.has(c.pyPackage.toLowerCase().replace(/[-_.]+/g,"-"))){r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${s} \u306B ${c.pyPackage} \u3092\u691C\u51FA`,url:c.url});continue}if(c.configFiles){for(let u of c.configFiles)if((0,re.existsSync)((0,W.join)(e,u))){r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${u} \u3092\u691C\u51FA`,url:c.url});break}if(r.has(c.id))continue}c.dockerPattern&&a.includes(c.dockerPattern)&&(r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`docker-compose.yml \u306B ${c.dockerPattern} \u3092\u691C\u51FA`,url:c.url}))}return t}function r5(e){let t;for(let i of["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"])if(t=Zr((0,W.join)(e,i)),t)break;if(!t)return[];let r=[],n=/^\s{2}(\w[\w-]*):\s*$/gm,o;for(;(o=n.exec(t))!==null;)r.push(o[1]);return r}function n5(e){let t=(0,W.join)(e,"docs"),r=(0,re.existsSync)((0,W.join)(e,"godd-mcp-server","notes-app","package.json")),n=(0,re.existsSync)((0,W.join)(e,"godd-mcp-server","notes-api","pyproject.toml"));if(!(0,re.existsSync)(t))return{exists:!1,sections:[],files:[],has_notes_app:r,has_notes_api:n};let o=[],i=[];function s(a,c){try{for(let u of(0,re.readdirSync)(a)){if(u.startsWith("."))continue;let p=(0,W.join)(a,u),l=c?`${c}/${u}`:u;(0,re.statSync)(p).isDirectory()?(c||o.push(u),s(p,l)):i.push(l)}}catch{}}return s(t,""),{exists:!0,sections:o,files:i,has_notes_app:r,has_notes_api:n}}function D1(e){let t=si((0,W.join)(e,"package.json"))?.name||(0,W.basename)(e),r=[];try{for(let u of(0,re.readdirSync)(e)){if(u.startsWith(".")||u==="node_modules")continue;let p=(0,W.join)(e,u);(0,re.statSync)(p).isDirectory()&&r.push(u)}}catch{}let o=["package.json","pyproject.toml","docker-compose.yml","docker-compose.yaml","Dockerfile","tsconfig.json",".env.example","env.example","AGENTS.md","README.md","Makefile",".mise.toml","turbo.json","pnpm-workspace.yaml"].filter(u=>(0,re.existsSync)((0,W.join)(e,u))),s=si((0,W.join)(e,"package.json"))?.scripts??{},a=[];try{for(let u of(0,re.readdirSync)(e))(u.match(/^env.*\.example$/)||u.match(/^\.env.*\.example$/))&&a.push(u)}catch{}let c=Zr((0,W.join)(e,"README.md"),500);return{root:e,name:t,detected_stacks:YZ(e),detected_tools:t5(e),vendor_items:JZ(e),key_files:o,directories:r,scripts:s,docker_services:r5(e),env_templates:a,readme_excerpt:c,question_list_path:(0,W.join)(e,"docs","003_requirements","questions.csv"),docs_structure:n5(e)}}var re,W,KZ,QZ,j1=_(()=>{"use strict";re=require("node:fs"),W=require("node:path");KZ={"browser-use":{description:"Python AI \u30D6\u30E9\u30A6\u30B6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8 \u2014 Web\u30D6\u30E9\u30A6\u30B6\u3092\u81EA\u52D5\u64CD\u4F5C",runtime:"python",setupHint:"uv sync && uv run browser-use install"},"android-use":{description:"Python Android AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8 \u2014 Android\u7AEF\u672B\u3092ADB\u3067\u81EA\u52D5\u64CD\u4F5C",runtime:"python",setupHint:"python -m venv .venv && pip install -r requirements.txt"},"react-grab":{description:"Node.js React \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B3\u30D4\u30FC\u30C4\u30FC\u30EB \u2014 React\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30C4\u30EA\u30FC\u3092\u62BD\u51FA",runtime:"node",setupHint:"pnpm install && pnpm build"}};QZ=[{id:"orval",label:"Orval",category:"frontend",description:"OpenAPI \u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u30B3\u30FC\u30C9\u81EA\u52D5\u751F\u6210",url:"https://github.com/orval-labs/orval",npmPackage:"orval",configFiles:["orval.config.ts","orval.config.js","orval.config.cjs"]},{id:"tanstack-query",label:"TanStack Query",category:"frontend",description:"\u975E\u540C\u671F\u30C7\u30FC\u30BF\u30D5\u30A7\u30C3\u30C1\u30F3\u30B0/\u30AD\u30E3\u30C3\u30B7\u30E5\u7BA1\u7406",url:"https://github.com/TanStack/query",npmPackage:"@tanstack/react-query"},{id:"vite",label:"Vite",category:"frontend",description:"\u9AD8\u901F\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",url:"https://vitejs.dev/",npmPackage:"vite",configFiles:["vite.config.ts","vite.config.js","vite.config.mts"]},{id:"biome",label:"Biome",category:"devtool",description:"\u9AD8\u901F Linter / Formatter\uFF08Rust\u88FD\uFF09",url:"https://biomejs.dev/",npmPackage:"@biomejs/biome",configFiles:["biome.json","biome.jsonc"]},{id:"storybook",label:"Storybook",category:"frontend",description:"UI\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u958B\u767A/\u30AB\u30BF\u30ED\u30B0\u30C4\u30FC\u30EB",url:"https://storybook.js.org/",npmPackage:"storybook",configFiles:[".storybook/main.ts",".storybook/main.js"]},{id:"ruff",label:"Ruff",category:"devtool",description:"\u8D85\u9AD8\u901F Python Linter / Formatter\uFF08Rust\u88FD\uFF09",url:"https://docs.astral.sh/ruff/",pyPackage:"ruff",configFiles:["ruff.toml",".ruff.toml"]},{id:"uv",label:"uv",category:"devtool",description:"\u9AD8\u901F Python \u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\uFF08Rust\u88FD\uFF09",url:"https://docs.astral.sh/uv/",configFiles:["uv.lock"]},{id:"sqlmodel",label:"SQLModel",category:"backend",description:"SQLAlchemy + Pydantic \u30D9\u30FC\u30B9\u306E Python ORM",url:"https://sqlmodel.tiangolo.com/",pyPackage:"sqlmodel"},{id:"alembic",label:"Alembic",category:"backend",description:"SQLAlchemy \u30D9\u30FC\u30B9\u306E DB \u30DE\u30A4\u30B0\u30EC\u30FC\u30B7\u30E7\u30F3\u30C4\u30FC\u30EB",url:"https://alembic.sqlalchemy.org/",pyPackage:"alembic",configFiles:["alembic.ini","backend/alembic.ini"]},{id:"fastapi-users",label:"FastAPI Users",category:"backend",description:"FastAPI \u5411\u3051\u8A8D\u8A3C/\u30E6\u30FC\u30B6\u30FC\u7BA1\u7406\u30E9\u30A4\u30D6\u30E9\u30EA",url:"https://fastapi-users.github.io/fastapi-users/",pyPackage:"fastapi-users"},{id:"pytest",label:"Pytest",category:"testing",description:"Python \u30C6\u30B9\u30C8\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF",url:"https://docs.pytest.org/",pyPackage:"pytest",configFiles:["pytest.ini","pyproject.toml"]},{id:"httpx",label:"HTTPX",category:"testing",description:"Python \u975E\u540C\u671F HTTP \u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF08\u30C6\u30B9\u30C8\u7528\uFF09",url:"https://www.python-httpx.org/",pyPackage:"httpx"},{id:"playwright",label:"Playwright",category:"testing",description:"\u30AF\u30ED\u30B9\u30D6\u30E9\u30A6\u30B6 E2E \u30C6\u30B9\u30C8\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF",url:"https://playwright.dev/",npmPackage:"@playwright/test",pyPackage:"playwright",configFiles:["playwright.config.ts","playwright.config.js"]},{id:"docker-compose",label:"Docker Compose",category:"infra",description:"\u30DE\u30EB\u30C1\u30B3\u30F3\u30C6\u30CA\u30AA\u30FC\u30B1\u30B9\u30C8\u30EC\u30FC\u30B7\u30E7\u30F3",url:"https://docs.docker.com/compose/",configFiles:["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"]},{id:"caddy",label:"Caddy",category:"infra",description:"\u81EA\u52D5 HTTPS \u5BFE\u5FDC\u30EA\u30D0\u30FC\u30B9\u30D7\u30ED\u30AD\u30B7",url:"https://caddyserver.com/",configFiles:["Caddyfile"],dockerPattern:"caddy"},{id:"traefik",label:"Traefik",category:"infra",description:"\u30AF\u30E9\u30A6\u30C9\u30CD\u30A4\u30C6\u30A3\u30D6 \u30EA\u30D0\u30FC\u30B9\u30D7\u30ED\u30AD\u30B7 / \u30ED\u30FC\u30C9\u30D0\u30E9\u30F3\u30B5",url:"https://traefik.io/",configFiles:["traefik.yml","traefik.toml"],dockerPattern:"traefik"},{id:"flutter",label:"Flutter",category:"frontend",description:"\u30AF\u30ED\u30B9\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF\uFF08Dart\uFF09",url:"https://flutter.dev/",configFiles:["pubspec.yaml"]},{id:"cocoapods",label:"CocoaPods",category:"devtool",description:"iOS / macOS \u4F9D\u5B58\u7BA1\u7406\u30C4\u30FC\u30EB",url:"https://cocoapods.org/",configFiles:["Podfile","ios/Podfile"]},{id:"gradle",label:"Gradle",category:"devtool",description:"Android / JVM \u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",url:"https://gradle.org/",configFiles:["build.gradle.kts","build.gradle","android/build.gradle.kts","android/build.gradle"]},{id:"swiftpm",label:"Swift Package Manager",category:"devtool",description:"Swift \u30D1\u30C3\u30B1\u30FC\u30B8\u7BA1\u7406\u30FB\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",url:"https://www.swift.org/package-manager/",configFiles:["Package.swift"]},{id:"sentry",label:"Sentry",category:"monitoring",description:"\u30A8\u30E9\u30FC\u8FFD\u8DE1 / \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u76E3\u8996",url:"https://sentry.io/",npmPackage:"@sentry/react",pyPackage:"sentry-sdk",configFiles:["sentry.properties"]}]});function o5(e,t){let r=t??process.env.GODD_PROJECT_ROOT??process.cwd();if(e.projectContext?.root===r)return e.projectContext;let n=D1(r);return e.projectContext=n,n}function M(e,t,r,n,o){let i=o5(e,n),s=e.config.language??"en",a=h1(t,e.profile,{project:i,language:s,...o});return`${s!=="en"?`> **Output Language**: Respond entirely in ${s}.
|
|
97
97
|
|
|
98
98
|
`:""}${a}
|
|
99
99
|
|
|
@@ -149,7 +149,7 @@ ${t.breaking_changes}`),t.verification&&r.push(`## \u52D5\u4F5C\u78BA\u8A8D
|
|
|
149
149
|
${t.verification}`),M(e,"pr-analyze",r.join(`
|
|
150
150
|
|
|
151
151
|
`),t.project_root)}var S2,$2,T2,C2=_(()=>{"use strict";pe();he();S2="godd_pr_analyze",$2="PR\u5206\u6790\u3002PR\u306E\u5DEE\u5206\u3092\u8AAD\u307F\u3001\u30EC\u30D3\u30E5\u30FC\u89B3\u70B9\u30FB\u30EA\u30B9\u30AF\u30FB\u8FFD\u52A0\u3067\u5FC5\u8981\u306A\u60C5\u5831\u3092\u6574\u7406\u3057\u307E\u3059\u3002",T2=m.object({background:m.string().max(2e5).optional().describe("\u5909\u66F4\u306E\u80CC\u666F/\u76EE\u7684"),changes:m.string().max(2e5).optional().describe("\u5909\u66F4\u5185\u5BB9\uFF08\u30D5\u30A1\u30A4\u30EB/\u6A5F\u80FD\u5358\u4F4D\uFF09"),scope:m.string().max(2e5).optional().describe("\u5F71\u97FF\u7BC4\u56F2"),breaking_changes:m.string().max(2e5).optional().describe("\u4E92\u63DB\u6027/\u79FB\u884C\u306E\u6709\u7121"),verification:m.string().max(2e5).optional().describe("\u52D5\u4F5C\u78BA\u8A8D\uFF08\u30B3\u30DE\u30F3\u30C9/\u624B\u52D5\u624B\u9806\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")})});function Eg(e){return e.length<=8?"****":e.slice(0,4)+"****"+e.slice(-4)}function R2(e,t){if(t.mode==="generate-config"){let n=["## GoDD MCP Config \u81EA\u52D5\u751F\u6210\u30E2\u30FC\u30C9","","\u4EE5\u4E0B\u306E\u60C5\u5831\u3092\u3082\u3068\u306B `config.godd` \u3068 `.cursor/mcp.json` \u3092\u751F\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002",""];if(t.components&&t.components.length>0){n.push("### \u9078\u629E\u3055\u308C\u305F\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"),n.push("```yaml"),n.push("components:");for(let o of t.components)n.push(` - ${o}`);n.push("```")}else n.push("### \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u672A\u6307\u5B9A"),n.push("\u30E6\u30FC\u30B6\u30FC\u306B\u4F7F\u7528\u3059\u308B\u6280\u8853\u30B9\u30BF\u30C3\u30AF\u3092\u8CEA\u554F\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),n.push(`
|
|
152
|
-
**\u5229\u7528\u53EF\u80FD\u306A\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8**: ${
|
|
152
|
+
**\u5229\u7528\u53EF\u80FD\u306A\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8**: ${i5}`);t.license_key?n.push(`
|
|
153
153
|
### \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC: \`${Eg(t.license_key)}\`\uFF08\u8A2D\u5B9A\u6E08\u307F\uFF09`):n.push(`
|
|
154
154
|
### \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u672A\u6307\u5B9A\u3067\u3059\u3002\u30E6\u30FC\u30B6\u30FC\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),n.push(`
|
|
155
155
|
### \u8A00\u8A9E: ${t.language??"ja"}`),n.push(`
|
|
@@ -161,7 +161,7 @@ ${t.components.join(", ")}`),t.environment&&r.push(`## \u74B0\u5883\u60C5\u5831
|
|
|
161
161
|
${t.environment}`),t.issues&&r.push(`## \u554F\u984C
|
|
162
162
|
${t.issues}`),M(e,"setup",r.join(`
|
|
163
163
|
|
|
164
|
-
`),t.project_root)}var E2,I2,z2,
|
|
164
|
+
`),t.project_root)}var E2,I2,z2,i5,A2=_(()=>{"use strict";pe();he();E2="godd_setup",I2="\u74B0\u5883\u69CB\u7BC9\u652F\u63F4\u3002GoDD MCP \u306E config.godd / .cursor/mcp.json \u751F\u6210\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E .env \u4F5C\u6210\u3001\u4F9D\u5B58\u5C0E\u5165\u3001Docker \u8D77\u52D5\u307E\u3067\u4E00\u62EC\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3057\u307E\u3059\u3002components \u3092\u6307\u5B9A\u3059\u308B\u3068 config.godd \u3092\u81EA\u52D5\u751F\u6210\u3067\u304D\u307E\u3059\u3002",z2=m.object({mode:m.enum(["full","godd-only","project-only","generate-config"]).optional().default("full").describe("\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u7BC4\u56F2: full=GoDD+\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5168\u4F53, godd-only=GoDD MCP \u8A2D\u5B9A\u306E\u307F, project-only=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u74B0\u5883\u306E\u307F, generate-config=config.godd \u81EA\u52D5\u751F\u6210"),environment:m.string().max(2e5).optional().describe("\u74B0\u5883\u60C5\u5831\uFF08OS\u3001\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u6E08\u307F\u30C4\u30FC\u30EB\u7B49\uFF09"),license_key:m.string().max(1e3).optional().describe("GoDD \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08config.godd \u306B\u66F8\u304D\u8FBC\u3080\uFF09"),stack_profile:m.string().max(1e3).optional().describe("\u30B9\u30BF\u30C3\u30AF\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u540D\uFF08\u4F8B: fastapi-react\uFF09"),components:m.array(m.string().max(1e3)).optional().describe('\u6280\u8853\u30B9\u30BF\u30C3\u30AF\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u540D\u306E\u914D\u5217\uFF08\u4F8B: ["fastapi", "react", "postgresql"]\uFF09\u3002generate-config \u30E2\u30FC\u30C9\u3067\u4F7F\u7528\u3002'),language:m.string().max(1e3).optional().describe("\u30DE\u30A4\u30F3\u30C9\u30BB\u30C3\u30C8\u8A00\u8A9E\uFF08\u4F8B: ja, en\uFF09"),issues:m.string().max(2e5).optional().describe("\u56F0\u3063\u3066\u3044\u308B\u3053\u3068\uFF08\u30A8\u30E9\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8\u7B49\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),i5=["python, typescript, javascript, go, php, ruby, c, html, css","react, nextjs, vue, angular, svelte, vite, tailwind, sass, electron","fastapi, django, flask, express, fastify, nestjs, gin, echo, fiber, laravel, symfony, wordpress, rails, sinatra, koa","node, agent-stdio","postgresql, mysql, mongodb, redis","sqlalchemy, celery","docker, terraform","ddd-clean-architecture"].join(", ")});function j2(e,t){let r=[`## \u5909\u66F4\u70B9
|
|
165
165
|
${t.changes??"(git log \u304B\u3089\u81EA\u52D5\u53D6\u5F97)"}`];return t.compatibility&&r.push(`## \u4E92\u63DB\u6027/\u79FB\u884C
|
|
166
166
|
${t.compatibility}`),t.known_issues&&r.push(`## \u65E2\u77E5\u306E\u554F\u984C
|
|
167
167
|
${t.known_issues}`),M(e,"release-notes",r.join(`
|
|
@@ -196,7 +196,7 @@ ${t.report_type}`),M(e,"analyze-report",r.join(`
|
|
|
196
196
|
`),t.project_root)}var I$,z$,R$,O$=_(()=>{"use strict";pe();he();I$="godd_report",z$="\u5B8C\u4E86\u5831\u544A\u751F\u6210\u3002\u30BF\u30B9\u30AF\u5B8C\u4E86\u6642\u306E\u5909\u66F4\u6982\u8981\u30FB\u5F71\u97FF\u7BC4\u56F2\u30FB\u691C\u8A3C\u7D50\u679C\u30FB\u6B8B\u30EA\u30B9\u30AF\u3092\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306B\u6CBF\u3063\u3066\u6574\u7406\u3057\u307E\u3059\u3002",R$=m.object({target:m.string().max(2e5).optional().describe("\u5831\u544A\u5BFE\u8C61\uFF08\u5909\u66F4\u5185\u5BB9\u306E\u6982\u8981\u307E\u305F\u306F\u30BF\u30B9\u30AF\u540D\uFF09"),report_type:m.string().max(1e3).optional().describe("\u5831\u544A\u30BF\u30A4\u30D7\uFF08\u4F8B: task-completion, incident, investigation\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")})});function M$(e,t){return M(e,"requirements-to-business-flow",`## \u8981\u6C42
|
|
197
197
|
${t.requirements??"(Chat \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304B\u3089\u5224\u65AD)"}`,t.project_root)}var N$,D$,j$,L$=_(()=>{"use strict";pe();he();N$="godd_req_to_flow",D$="\u8981\u6C42\u2192\u30D3\u30B8\u30CD\u30B9\u30D5\u30ED\u30FC\u5909\u63DB\u3002\u81EA\u7136\u8A00\u8A9E\u306E\u8981\u6C42\u304B\u3089As-Is/To-Be\u30D5\u30ED\u30FC\u3068\u30E6\u30FC\u30B9\u30B1\u30FC\u30B9\u3092\u751F\u6210\u3057\u307E\u3059\u3002",j$=m.object({requirements:m.string().max(2e5).optional().describe("\u8981\u6C42\u5185\u5BB9\uFF08\u81EA\u7136\u8A00\u8A9E\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")})});function U$(e,t){return M(e,"requirements-to-tickets",`## \u8981\u6C42
|
|
198
198
|
${t.requirements??"(Chat \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304B\u3089\u5224\u65AD)"}`,t.project_root)}var Z$,q$,F$,B$=_(()=>{"use strict";pe();he();Z$="godd_req_to_tickets",q$="\u8981\u6C42\u2192\u30C1\u30B1\u30C3\u30C8\u5206\u89E3\u3002\u8981\u6C42\u3092\u5B9F\u88C5\u30BF\u30B9\u30AF\uFF08\u30C1\u30B1\u30C3\u30C8\uFF09\u306B\u5206\u89E3\u3057\u3001\u4F9D\u5B58\u95A2\u4FC2\u3068\u691C\u8A3C\u65B9\u6CD5\u3092\u542B\u3081\u3066\u4E00\u89A7\u5316\u3057\u307E\u3059\u3002",F$=m.object({requirements:m.string().max(2e5).optional().describe("\u8981\u6C42\u5185\u5BB9\uFF08\u81EA\u7136\u8A00\u8A9E\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")})});function W$(e,t){return M(e,"specification-to-tickets",`## \u5BFE\u8C61Spec
|
|
199
|
-
${t.specification??"(Chat \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304B\u3089\u5224\u65AD)"}`,t.project_root)}var V$,H$,G$,K$=_(()=>{"use strict";pe();he();V$="godd_spec_to_tickets",H$="\u4ED5\u69D8\u2192\u30C1\u30B1\u30C3\u30C8\u5909\u63DB\u3002Spec\uFF08docs/
|
|
199
|
+
${t.specification??"(Chat \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304B\u3089\u5224\u65AD)"}`,t.project_root)}var V$,H$,G$,K$=_(()=>{"use strict";pe();he();V$="godd_spec_to_tickets",H$="\u4ED5\u69D8\u2192\u30C1\u30B1\u30C3\u30C8\u5909\u63DB\u3002Spec\uFF08docs/003_requirements/spec/\uFF09\u304B\u3089\u5B9F\u88C5\u53EF\u80FD\u306A\u30BF\u30B9\u30AF\u30EA\u30B9\u30C8\u3092\u751F\u6210\u3057\u3001\u5F71\u97FF\u30EC\u30A4\u30E4\u30FC\u30FB\u30C6\u30B9\u30C8\u89B3\u70B9\u30FB\u30EA\u30B9\u30AF\u3092\u4ED8\u4E0E\u3057\u307E\u3059\u3002",G$=m.object({specification:m.string().max(2e5).optional().describe("\u5BFE\u8C61Spec\uFF08API/UI/DB/Feature/Usecase/Error Codes\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")})});function X$(e,t){return M(e,"install",`## \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5BFE\u8C61
|
|
200
200
|
${t.target}`,t.project_root)}var J$,Y$,Q$,eT=_(()=>{"use strict";pe();he();J$="godd_install",Y$="\u30C4\u30FC\u30EB/MCP\u30B5\u30FC\u30D0\u30FC\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3002\u6307\u5B9A\u3055\u308C\u305F\u30C4\u30FC\u30EB\u306E\u74B0\u5883\u306B\u9069\u3057\u305F\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u624B\u9806\u30FB\u8A2D\u5B9A\u30FB\u758E\u901A\u78BA\u8A8D\u3092\u6848\u5185\u3057\u307E\u3059\u3002",Q$=m.object({target:m.string().max(1e3).describe("\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5BFE\u8C61\u306E\u30C4\u30FC\u30EB/MCP\u540D\uFF08\u4F8B: context7, chrome-devtools-mcp, markitdown-mcp, mcp-ocr, serena, vibe-odf-read-mcp\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")})});function oT(e,t){let r=[`## \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D
|
|
201
201
|
${t.project_name??"(\u81EA\u52D5\u691C\u51FA)"}`];return t.roles?.length&&r.push(`## \u30ED\u30FC\u30EB
|
|
202
202
|
${t.roles.map(n=>`- ${n}`).join(`
|
|
@@ -213,7 +213,7 @@ ${t.target_sections.map(n=>`- ${n}`).join(`
|
|
|
213
213
|
${t.deploy_target}`),t.github_repo&&r.push(`## \u5BFE\u8C61\u30EA\u30DD\u30B8\u30C8\u30EA
|
|
214
214
|
${t.github_repo}`),M(e,"notes-deploy",r.join(`
|
|
215
215
|
|
|
216
|
-
`)||"\u30C7\u30D7\u30ED\u30A4\u624B\u9806\u3092\u6848\u5185\u3057\u3066\u304F\u3060\u3055\u3044\u3002",t.project_root)}var pT,dT,fT,mT=_(()=>{"use strict";pe();he();pT="godd_notes_deploy",dT="ripla Notes \u3092\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u3002AI \u304C\u81EA\u5F8B\u5B9F\u884C\u53EF\u80FD\u306A\u624B\u9806\u3092\u8FD4\u3057\u307E\u3059\u3002compose --auto\uFF08\u30ED\u30FC\u30AB\u30EB\u81EA\u52D5\u30C7\u30D7\u30ED\u30A4\uFF09/ compose --config\uFF08\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u6307\u5B9A\uFF09/ deploy -y\uFF08AWS \u5B9F\u30C7\u30D7\u30ED\u30A4\uFF09/ status\uFF08\u72B6\u614B\u78BA\u8A8D\uFF09\u306E\u624B\u9806\u3092\u63D0\u4F9B\u3057\u307E\u3059\u3002",fT=m.object({deploy_target:m.string().max(1e3).optional().describe("\u30C7\u30D7\u30ED\u30A4\u65B9\u5F0F\uFF08compose, deploy, infra \u306E\u3044\u305A\u308C\u304B\uFF09"),github_repo:m.string().max(1e3).optional().describe("\u5BFE\u8C61 GitHub \u30EA\u30DD\u30B8\u30C8\u30EA\uFF08owner/repo \u5F62\u5F0F\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")})});function
|
|
216
|
+
`)||"\u30C7\u30D7\u30ED\u30A4\u624B\u9806\u3092\u6848\u5185\u3057\u3066\u304F\u3060\u3055\u3044\u3002",t.project_root)}var pT,dT,fT,mT=_(()=>{"use strict";pe();he();pT="godd_notes_deploy",dT="ripla Notes \u3092\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u3002AI \u304C\u81EA\u5F8B\u5B9F\u884C\u53EF\u80FD\u306A\u624B\u9806\u3092\u8FD4\u3057\u307E\u3059\u3002compose --auto\uFF08\u30ED\u30FC\u30AB\u30EB\u81EA\u52D5\u30C7\u30D7\u30ED\u30A4\uFF09/ compose --config\uFF08\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u6307\u5B9A\uFF09/ deploy -y\uFF08AWS \u5B9F\u30C7\u30D7\u30ED\u30A4\uFF09/ status\uFF08\u72B6\u614B\u78BA\u8A8D\uFF09\u306E\u624B\u9806\u3092\u63D0\u4F9B\u3057\u307E\u3059\u3002",fT=m.object({deploy_target:m.string().max(1e3).optional().describe("\u30C7\u30D7\u30ED\u30A4\u65B9\u5F0F\uFF08compose, deploy, infra \u306E\u3044\u305A\u308C\u304B\uFF09"),github_repo:m.string().max(1e3).optional().describe("\u5BFE\u8C61 GitHub \u30EA\u30DD\u30B8\u30C8\u30EA\uFF08owner/repo \u5F62\u5F0F\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")})});function s5(){let e=process.env.GODD_CONFIG;if(!e)throw new Error(`GODD_CONFIG \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${Ut} \u306E\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return e}function gT(e){let t;try{t=hn.load(e)}catch{return e.replace(/(license_key\s*:\s*["']?)([^"'\n]+)(["']?)/g,"$1****$3")}if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let r=t;return typeof r.license_key=="string"&&r.license_key.length>0&&(r.license_key="****"),hn.dump(r,{lineWidth:-1,quotingType:'"'})}return e}function bT(e){let t=s5();if(e.action==="show"){if(!(0,yn.existsSync)(t))return`## ${Ut} \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
|
|
217
217
|
|
|
218
218
|
\u30D1\u30B9: \`${t}\`
|
|
219
219
|
|
|
@@ -256,73 +256,75 @@ ${i.map(a=>`- ${a}`).join(`
|
|
|
256
256
|
\`\`\`yaml
|
|
257
257
|
${gT(s)}\`\`\`
|
|
258
258
|
|
|
259
|
-
\u26A0 MCP \u30B5\u30FC\u30D0\u30FC\u306E\u518D\u8D77\u52D5\u304C\u5FC5\u8981\u3067\u3059\uFF08Cursor IDE \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF09\u3002`}var yn,yT,_T,vT,xT=_(()=>{"use strict";pe();yn=require("node:fs");Pm();Em();yT="godd_config",_T="config.godd \u306E\u8868\u793A\u30FB\u66F4\u65B0\u3092\u884C\u3044\u307E\u3059\u3002show \u3067\u73FE\u5728\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3001update \u3067\u6307\u5B9A\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002GODD_CONFIG \u74B0\u5883\u5909\u6570\u3067\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",vT=m.object({action:m.enum(["show","update"]).describe("show=\u73FE\u5728\u306E\u8A2D\u5B9A\u3092\u8868\u793A, update=\u8A2D\u5B9A\u3092\u66F4\u65B0"),license_key:m.string().min(1,"license_key \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(1e3).optional().describe("\u66F4\u65B0\u3059\u308B\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08action=update \u6642\u306E\u307F\uFF09"),components:m.array(m.string().min(1).max(1e3)).min(1,"components \u306F\u7A7A\u914D\u5217\u306B\u3067\u304D\u307E\u305B\u3093").optional().describe("\u66F4\u65B0\u3059\u308B\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u914D\u5217\uFF08action=update \u6642\u306E\u307F\uFF09"),language:m.string().min(1,"language \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(1e3).optional().describe("\u66F4\u65B0\u3059\u308B\u8A00\u8A9E\uFF08action=update \u6642\u306E\u307F\uFF09"),registry_url:m.string().min(1,"registry_url \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").url("registry_url \u306F\u6709\u52B9\u306A URL \u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093").max(1e3).optional().describe("\u66F4\u65B0\u3059\u308B Registry URL\uFF08action=update \u6642\u306E\u307F\uFF09")})});function zg(e){Ig=e}function wT(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");return Buffer.from(t,"base64")}function r5(e){let t=e.split(".");if(t.length!==2)throw new zt("\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306E\u5F62\u5F0F\u304C\u4E0D\u6B63\u3067\u3059");let[r,n]=t;if(Ig){let a=(0,Du.createPublicKey)(Ig),c=wT(n);if(!(0,Du.verify)(null,Buffer.from(r),a,c))throw new zt("\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306E\u7F72\u540D\u304C\u7121\u52B9\u3067\u3059")}else if(process.env.SKIP_LICENSE_VERIFY!=="true")throw new zt("\u516C\u958B\u9375\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u30E9\u30A4\u30BB\u30F3\u30B9\u691C\u8A3C\u304C\u3067\u304D\u307E\u305B\u3093");let o=wT(r).toString("utf-8"),i;try{i=JSON.parse(o)}catch{throw new zt("\u30E9\u30A4\u30BB\u30F3\u30B9\u30E1\u30BF\u30C7\u30FC\u30BF\u306E\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F")}if(i.v!==1)throw new zt(`\u672A\u5BFE\u5FDC\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u30D0\u30FC\u30B8\u30E7\u30F3: ${i.v}`);let s=new Date(i.exp);if(isNaN(s.getTime()))throw new zt("\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6709\u52B9\u671F\u9650\u304C\u4E0D\u6B63\u3067\u3059");if(s<new Date)throw new zt(`\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\uFF08${i.exp}\uFF09`);return i}function Rg(e,t){let r=r5(e);if(r.stack&&r.stack!==t)throw new zt(`\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306F\u30B9\u30BF\u30C3\u30AF '${r.stack}' \u5C02\u7528\u3067\u3059\uFF08\u8981\u6C42: '${t}'\uFF09`);return r}var Du,Ig,zt,kT=_(()=>{"use strict";Du=require("node:crypto"),Ig="";zt=class extends Error{constructor(t){super(t),this.name="LicenseError"}}});var $T={};Br($T,{startServer:()=>ST});function n5(){try{let e=(0,ir.join)(qr,"..","package.json");return JSON.parse((0,ao.readFileSync)(e,"utf-8")).version??"0.0.0"}catch{return"0.0.0"}}async function o5(e){let t=e.components??[];if(t.length===0)return null;let r=await P1(t,e.language,e.license_key);if(r&&!r.isExpired){console.error("[GoDD] \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u30AD\u30E3\u30C3\u30B7\u30E5\u304B\u3089\u30ED\u30FC\u30C9\u3057\u307E\u3057\u305F");try{let n=JSON.parse(r.data);return Ls(n),n}catch{console.error("[GoDD] \u30AD\u30E3\u30C3\u30B7\u30E5\u30C7\u30FC\u30BF\u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002Registry API \u304B\u3089\u518D\u30D5\u30A7\u30C3\u30C1\u3057\u307E\u3059")}}try{let n=C1(t,e.language),o=await x1(e,n);if(o===null&&r){console.error("[GoDD] \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306F\u30AD\u30E3\u30C3\u30B7\u30E5\u3068\u540C\u4E00\u3067\u3059\uFF08304\uFF09");try{let i=JSON.parse(r.data);return Ls(i),i}catch{console.error("[GoDD] 304 \u30AD\u30E3\u30C3\u30B7\u30E5\u30C7\u30FC\u30BF\u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F")}}if(o){let i=await w1(o.bundle,e.license_key);Ls(i);let s=JSON.stringify(i);return await T1(s,o.etag,t,e.language,e.license_key),console.error("[GoDD] \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092 Registry API \u304B\u3089\u30D5\u30A7\u30C3\u30C1\u3057\u307E\u3057\u305F"),i}}catch(n){console.error(`[GoDD] Registry API \u3078\u306E\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${Ne(n)}`)}if(r){console.error("[GoDD] \u8B66\u544A: \u671F\u9650\u5207\u308C\u30AD\u30E3\u30C3\u30B7\u30E5\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059\uFF08Registry API \u5230\u9054\u4E0D\u80FD\uFF09");try{let n=JSON.parse(r.data);return Ls(n),n}catch{console.error("[GoDD] \u671F\u9650\u5207\u308C\u30AD\u30E3\u30C3\u30B7\u30E5\u306E JSON \u30D1\u30FC\u30B9\u306B\u3082\u5931\u6557\u3057\u307E\u3057\u305F")}}return null}async function ST(){let e=wk(),t=e.components&&e.components.length>0,r;if(t){try{let d=await b1(e);d.valid||(console.error(`\u30E9\u30A4\u30BB\u30F3\u30B9\u30A8\u30E9\u30FC: ${d.error??"\u4E0D\u660E\u306A\u30A8\u30E9\u30FC"}`),process.exit(1))}catch(d){console.error(`[GoDD] Registry \u30E9\u30A4\u30BB\u30F3\u30B9\u691C\u8A3C\u5931\u6557\u3002\u30ED\u30FC\u30AB\u30EB\u691C\u8A3C\u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF: ${Ne(d)}`);let f=(0,ir.join)(qr,"..",".keys","public.pem");(0,ao.existsSync)(f)&&zg((0,ao.readFileSync)(f,"utf-8"));try{let h=e.components?.[0]??e.stack_profile??"fastapi-react";Rg(e.license_key,h)}catch(h){h instanceof zt?console.error(`\u30E9\u30A4\u30BB\u30F3\u30B9\u30A8\u30E9\u30FC (\u30ED\u30FC\u30AB\u30EB\u691C\u8A3C): ${h.message}`):console.error(`[GoDD] \u30ED\u30FC\u30AB\u30EB\u30E9\u30A4\u30BB\u30F3\u30B9\u691C\u8A3C\u3067\u4E88\u671F\u3057\u306A\u3044\u30A8\u30E9\u30FC: ${Ne(h)}`),process.exit(1)}}try{await Cg(e.registry_url,e.license_key)}catch(d){console.error("\u30EA\u30DD\u30B8\u30C8\u30EA\u691C\u8A3C\u30A8\u30E9\u30FC:",Ne(d)),console.error(" godd init \u3092\u518D\u5B9F\u884C\u3059\u308B\u304B\u3001Registry API \u304C\u8D77\u52D5\u3057\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)}let l=await o5(e);if(l)r={name:`registry:${e.components.join("+")}`,stacks:e.components.map(d=>({id:d,label:d,name:d})),quality_gate:l.quality_gate?{frontend:l.quality_gate.frontend,backend:l.quality_gate.backend,preflight_command:l.quality_gate.preflight??"pnpm preflight",summary:"format/lint/typecheck/build"}:void 0,tools:l.tools?.map(d=>({id:d.id,label:d.label,category:d.category,description:d.description,guidance:d.guidance}))};else{console.error("[GoDD] Registry/\u30AD\u30E3\u30C3\u30B7\u30E5\u5229\u7528\u4E0D\u53EF\u3002\u30ED\u30FC\u30AB\u30EB\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF"),kg((0,ir.join)(qr,"..","templates"));let d=e.stack_profile??"fastapi-react";try{r=Cm(d,(0,ir.join)(qr,"..","stacks"))}catch(f){console.error(`[GoDD] \u30B9\u30BF\u30C3\u30AF\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB '${d}' \u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${Ne(f)}`),console.error("[GoDD] \u6700\u5C0F\u9650\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3067\u8D77\u52D5\u3057\u307E\u3059"),r={name:d,stacks:[]}}}}else{let l=(0,ir.join)(qr,"..",".keys","public.pem");(0,ao.existsSync)(l)&&zg((0,ao.readFileSync)(l,"utf-8"));try{Rg(e.license_key,e.stack_profile??"fastapi-react")}catch(h){h instanceof zt&&(console.error(`\u30E9\u30A4\u30BB\u30F3\u30B9\u30A8\u30E9\u30FC: ${h.message}`),process.exit(1)),console.error(`[GoDD] \u30E9\u30A4\u30BB\u30F3\u30B9\u691C\u8A3C\u3067\u4E88\u671F\u3057\u306A\u3044\u30A8\u30E9\u30FC: ${Ne(h)}`),process.exit(1)}let d=e.stack_profile??"fastapi-react";try{r=Cm(d,(0,ir.join)(qr,"..","stacks"))}catch(h){console.error(`[GoDD] \u30B9\u30BF\u30C3\u30AF\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB '${d}' \u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${Ne(h)}`),console.error("[GoDD] \u6700\u5C0F\u9650\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3067\u8D77\u52D5\u3057\u307E\u3059"),r={name:d,stacks:[]}}await g1(e.license_key)||kg((0,ir.join)(qr,"..","templates"))}let n={profile:r,config:e},o=new qc({name:"godd-mcp-server",version:n5()});async function i(l){return t&&await O1(e.registry_url,e.license_key),l()}let s=[];function a(l,d,f,h){let g=f.shape;o.tool(l,d,g,async y=>({content:[{type:"text",text:await i(()=>h(n,f.parse(y)))}]})),s.push({name:l,description:d,params:Object.keys(g)})}function c(l,d,f,h){let g=f.shape;o.tool(l,d,g,async y=>({content:[{type:"text",text:await h(f.parse(y))}]})),s.push({name:l,description:d,params:Object.keys(g)})}a(M1,L1,Z1,q1),a(U1,B1,V1,H1),a(W1,K1,J1,Y1),a(X1,e2,t2,r2),a(o2,i2,s2,a2),a(u2,l2,p2,d2),a(h2,m2,g2,y2),a(v2,b2,x2,w2),a(S2,$2,T2,P2),a(E2,I2,z2,R2),a(O2,N2,D2,j2),a(L2,Z2,q2,F2),a(B2,V2,H2,G2),a(K2,J2,Y2,Q2),a(e$,t$,r$,n$),a(i$,s$,a$,c$),a(l$,p$,d$,f$),a(m$,g$,y$,_$),a(b$,x$,w$,k$),a($$,T$,P$,C$),a(I$,z$,R$,A$),a(N$,D$,j$,M$),a(Z$,q$,F$,U$),a(V$,H$,G$,W$),a(J$,Y$,Q$,X$),a(tT,rT,nT,oT),a(sT,aT,cT,uT),a(pT,dT,fT,hT),c(yT,_T,vT,bT);let u=r?.tools??[];u.length>0&&o.resource("ecosystem-tool",new _s("godd://tools/{toolId}",{list:async()=>({resources:u.map(l=>({uri:`godd://tools/${l.id}`,name:l.label,description:l.description,mimeType:"text/plain"}))})}),async(l,{toolId:d})=>{let f=u.find(g=>g.id===String(d));if(!f)return{contents:[{uri:l.href,text:"Tool not found"}]};let h=[`# ${f.label}`,"",`- **\u30AB\u30C6\u30B4\u30EA**: ${f.category}`,`- **\u8AAC\u660E**: ${f.description}`];return f.guidance&&h.push("","## \u5229\u7528\u30AC\u30A4\u30C0\u30F3\u30B9","",f.guidance),"url"in f&&f.url&&h.push("",`- **\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8**: ${f.url}`),{contents:[{uri:l.href,text:h.join(`
|
|
259
|
+
\u26A0 MCP \u30B5\u30FC\u30D0\u30FC\u306E\u518D\u8D77\u52D5\u304C\u5FC5\u8981\u3067\u3059\uFF08Cursor IDE \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF09\u3002`}var yn,yT,_T,vT,xT=_(()=>{"use strict";pe();yn=require("node:fs");Pm();Em();yT="godd_config",_T="config.godd \u306E\u8868\u793A\u30FB\u66F4\u65B0\u3092\u884C\u3044\u307E\u3059\u3002show \u3067\u73FE\u5728\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3001update \u3067\u6307\u5B9A\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002GODD_CONFIG \u74B0\u5883\u5909\u6570\u3067\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",vT=m.object({action:m.enum(["show","update"]).describe("show=\u73FE\u5728\u306E\u8A2D\u5B9A\u3092\u8868\u793A, update=\u8A2D\u5B9A\u3092\u66F4\u65B0"),license_key:m.string().min(1,"license_key \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(1e3).optional().describe("\u66F4\u65B0\u3059\u308B\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08action=update \u6642\u306E\u307F\uFF09"),components:m.array(m.string().min(1).max(1e3)).min(1,"components \u306F\u7A7A\u914D\u5217\u306B\u3067\u304D\u307E\u305B\u3093").optional().describe("\u66F4\u65B0\u3059\u308B\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u914D\u5217\uFF08action=update \u6642\u306E\u307F\uFF09"),language:m.string().min(1,"language \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(1e3).optional().describe("\u66F4\u65B0\u3059\u308B\u8A00\u8A9E\uFF08action=update \u6642\u306E\u307F\uFF09"),registry_url:m.string().min(1,"registry_url \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").url("registry_url \u306F\u6709\u52B9\u306A URL \u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093").max(1e3).optional().describe("\u66F4\u65B0\u3059\u308B Registry URL\uFF08action=update \u6642\u306E\u307F\uFF09")})});function zg(e){Ig=e}function wT(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");return Buffer.from(t,"base64")}function a5(e){let t=e.split(".");if(t.length!==2)throw new zt("\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306E\u5F62\u5F0F\u304C\u4E0D\u6B63\u3067\u3059");let[r,n]=t;if(Ig){let a=(0,Du.createPublicKey)(Ig),c=wT(n);if(!(0,Du.verify)(null,Buffer.from(r),a,c))throw new zt("\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306E\u7F72\u540D\u304C\u7121\u52B9\u3067\u3059")}else if(process.env.SKIP_LICENSE_VERIFY!=="true")throw new zt("\u516C\u958B\u9375\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u30E9\u30A4\u30BB\u30F3\u30B9\u691C\u8A3C\u304C\u3067\u304D\u307E\u305B\u3093");let o=wT(r).toString("utf-8"),i;try{i=JSON.parse(o)}catch{throw new zt("\u30E9\u30A4\u30BB\u30F3\u30B9\u30E1\u30BF\u30C7\u30FC\u30BF\u306E\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F")}if(i.v!==1)throw new zt(`\u672A\u5BFE\u5FDC\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u30D0\u30FC\u30B8\u30E7\u30F3: ${i.v}`);let s=new Date(i.exp);if(isNaN(s.getTime()))throw new zt("\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6709\u52B9\u671F\u9650\u304C\u4E0D\u6B63\u3067\u3059");if(s<new Date)throw new zt(`\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\uFF08${i.exp}\uFF09`);return i}function Rg(e,t){let r=a5(e);if(r.stack&&r.stack!==t)throw new zt(`\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306F\u30B9\u30BF\u30C3\u30AF '${r.stack}' \u5C02\u7528\u3067\u3059\uFF08\u8981\u6C42: '${t}'\uFF09`);return r}var Du,Ig,zt,kT=_(()=>{"use strict";Du=require("node:crypto"),Ig="";zt=class extends Error{constructor(t){super(t),this.name="LicenseError"}}});var $T={};Br($T,{startServer:()=>ST});function c5(){try{let e=(0,ir.join)(qr,"..","package.json");return JSON.parse((0,ao.readFileSync)(e,"utf-8")).version??"0.0.0"}catch{return"0.0.0"}}async function u5(e){let t=e.components??[];if(t.length===0)return null;let r=await P1(t,e.language,e.license_key);if(r&&!r.isExpired){console.error("[GoDD] \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u30AD\u30E3\u30C3\u30B7\u30E5\u304B\u3089\u30ED\u30FC\u30C9\u3057\u307E\u3057\u305F");try{let n=JSON.parse(r.data);return Ls(n),n}catch{console.error("[GoDD] \u30AD\u30E3\u30C3\u30B7\u30E5\u30C7\u30FC\u30BF\u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002Registry API \u304B\u3089\u518D\u30D5\u30A7\u30C3\u30C1\u3057\u307E\u3059")}}try{let n=C1(t,e.language),o=await x1(e,n);if(o===null&&r){console.error("[GoDD] \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306F\u30AD\u30E3\u30C3\u30B7\u30E5\u3068\u540C\u4E00\u3067\u3059\uFF08304\uFF09");try{let i=JSON.parse(r.data);return Ls(i),i}catch{console.error("[GoDD] 304 \u30AD\u30E3\u30C3\u30B7\u30E5\u30C7\u30FC\u30BF\u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F")}}if(o){let i=await w1(o.bundle,e.license_key);Ls(i);let s=JSON.stringify(i);return await T1(s,o.etag,t,e.language,e.license_key),console.error("[GoDD] \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092 Registry API \u304B\u3089\u30D5\u30A7\u30C3\u30C1\u3057\u307E\u3057\u305F"),i}}catch(n){console.error(`[GoDD] Registry API \u3078\u306E\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${Ne(n)}`)}if(r){console.error("[GoDD] \u8B66\u544A: \u671F\u9650\u5207\u308C\u30AD\u30E3\u30C3\u30B7\u30E5\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059\uFF08Registry API \u5230\u9054\u4E0D\u80FD\uFF09");try{let n=JSON.parse(r.data);return Ls(n),n}catch{console.error("[GoDD] \u671F\u9650\u5207\u308C\u30AD\u30E3\u30C3\u30B7\u30E5\u306E JSON \u30D1\u30FC\u30B9\u306B\u3082\u5931\u6557\u3057\u307E\u3057\u305F")}}return null}async function ST(){let e=wk(),t=e.components&&e.components.length>0,r;if(t){try{let d=await b1(e);d.valid||(console.error(`\u30E9\u30A4\u30BB\u30F3\u30B9\u30A8\u30E9\u30FC: ${d.error??"\u4E0D\u660E\u306A\u30A8\u30E9\u30FC"}`),process.exit(1))}catch(d){console.error(`[GoDD] Registry \u30E9\u30A4\u30BB\u30F3\u30B9\u691C\u8A3C\u5931\u6557\u3002\u30ED\u30FC\u30AB\u30EB\u691C\u8A3C\u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF: ${Ne(d)}`);let f=(0,ir.join)(qr,"..",".keys","public.pem");(0,ao.existsSync)(f)&&zg((0,ao.readFileSync)(f,"utf-8"));try{let h=e.components?.[0]??e.stack_profile??"fastapi-react";Rg(e.license_key,h)}catch(h){h instanceof zt?console.error(`\u30E9\u30A4\u30BB\u30F3\u30B9\u30A8\u30E9\u30FC (\u30ED\u30FC\u30AB\u30EB\u691C\u8A3C): ${h.message}`):console.error(`[GoDD] \u30ED\u30FC\u30AB\u30EB\u30E9\u30A4\u30BB\u30F3\u30B9\u691C\u8A3C\u3067\u4E88\u671F\u3057\u306A\u3044\u30A8\u30E9\u30FC: ${Ne(h)}`),process.exit(1)}}try{await Cg(e.registry_url,e.license_key)}catch(d){console.error("\u30EA\u30DD\u30B8\u30C8\u30EA\u691C\u8A3C\u30A8\u30E9\u30FC:",Ne(d)),console.error(" godd init \u3092\u518D\u5B9F\u884C\u3059\u308B\u304B\u3001Registry API \u304C\u8D77\u52D5\u3057\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)}let l=await u5(e);if(l)r={name:`registry:${e.components.join("+")}`,stacks:e.components.map(d=>({id:d,label:d,name:d})),quality_gate:l.quality_gate?{frontend:l.quality_gate.frontend,backend:l.quality_gate.backend,preflight_command:l.quality_gate.preflight??"pnpm preflight",summary:"format/lint/typecheck/build"}:void 0,tools:l.tools?.map(d=>({id:d.id,label:d.label,category:d.category,description:d.description,guidance:d.guidance}))};else{console.error("[GoDD] Registry/\u30AD\u30E3\u30C3\u30B7\u30E5\u5229\u7528\u4E0D\u53EF\u3002\u30ED\u30FC\u30AB\u30EB\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF"),kg((0,ir.join)(qr,"..","templates"));let d=e.stack_profile??"fastapi-react";try{r=Cm(d,(0,ir.join)(qr,"..","stacks"))}catch(f){console.error(`[GoDD] \u30B9\u30BF\u30C3\u30AF\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB '${d}' \u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${Ne(f)}`),console.error("[GoDD] \u6700\u5C0F\u9650\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3067\u8D77\u52D5\u3057\u307E\u3059"),r={name:d,stacks:[]}}}}else{let l=(0,ir.join)(qr,"..",".keys","public.pem");(0,ao.existsSync)(l)&&zg((0,ao.readFileSync)(l,"utf-8"));try{Rg(e.license_key,e.stack_profile??"fastapi-react")}catch(h){h instanceof zt&&(console.error(`\u30E9\u30A4\u30BB\u30F3\u30B9\u30A8\u30E9\u30FC: ${h.message}`),process.exit(1)),console.error(`[GoDD] \u30E9\u30A4\u30BB\u30F3\u30B9\u691C\u8A3C\u3067\u4E88\u671F\u3057\u306A\u3044\u30A8\u30E9\u30FC: ${Ne(h)}`),process.exit(1)}let d=e.stack_profile??"fastapi-react";try{r=Cm(d,(0,ir.join)(qr,"..","stacks"))}catch(h){console.error(`[GoDD] \u30B9\u30BF\u30C3\u30AF\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB '${d}' \u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${Ne(h)}`),console.error("[GoDD] \u6700\u5C0F\u9650\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3067\u8D77\u52D5\u3057\u307E\u3059"),r={name:d,stacks:[]}}await g1(e.license_key)||kg((0,ir.join)(qr,"..","templates"))}let n={profile:r,config:e},o=new qc({name:"godd-mcp-server",version:c5()});async function i(l){return t&&await O1(e.registry_url,e.license_key),l()}let s=[];function a(l,d,f,h){let g=f.shape;o.tool(l,d,g,async y=>({content:[{type:"text",text:await i(()=>h(n,f.parse(y)))}]})),s.push({name:l,description:d,params:Object.keys(g)})}function c(l,d,f,h){let g=f.shape;o.tool(l,d,g,async y=>({content:[{type:"text",text:await h(f.parse(y))}]})),s.push({name:l,description:d,params:Object.keys(g)})}a(M1,L1,Z1,q1),a(U1,B1,V1,H1),a(W1,K1,J1,Y1),a(X1,e2,t2,r2),a(o2,i2,s2,a2),a(u2,l2,p2,d2),a(h2,m2,g2,y2),a(v2,b2,x2,w2),a(S2,$2,T2,P2),a(E2,I2,z2,R2),a(O2,N2,D2,j2),a(L2,Z2,q2,F2),a(B2,V2,H2,G2),a(K2,J2,Y2,Q2),a(e$,t$,r$,n$),a(i$,s$,a$,c$),a(l$,p$,d$,f$),a(m$,g$,y$,_$),a(b$,x$,w$,k$),a($$,T$,P$,C$),a(I$,z$,R$,A$),a(N$,D$,j$,M$),a(Z$,q$,F$,U$),a(V$,H$,G$,W$),a(J$,Y$,Q$,X$),a(tT,rT,nT,oT),a(sT,aT,cT,uT),a(pT,dT,fT,hT),c(yT,_T,vT,bT);let u=r?.tools??[];u.length>0&&o.resource("ecosystem-tool",new _s("godd://tools/{toolId}",{list:async()=>({resources:u.map(l=>({uri:`godd://tools/${l.id}`,name:l.label,description:l.description,mimeType:"text/plain"}))})}),async(l,{toolId:d})=>{let f=u.find(g=>g.id===String(d));if(!f)return{contents:[{uri:l.href,text:"Tool not found"}]};let h=[`# ${f.label}`,"",`- **\u30AB\u30C6\u30B4\u30EA**: ${f.category}`,`- **\u8AAC\u660E**: ${f.description}`];return f.guidance&&h.push("","## \u5229\u7528\u30AC\u30A4\u30C0\u30F3\u30B9","",f.guidance),"url"in f&&f.url&&h.push("",`- **\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8**: ${f.url}`),{contents:[{uri:l.href,text:h.join(`
|
|
260
260
|
`),mimeType:"text/plain"}]}}),o.resource("mcp-tool",new _s("godd://mcp-tools/{toolName}",{list:async()=>({resources:s.map(l=>({uri:`godd://mcp-tools/${l.name}`,name:l.name,description:l.description,mimeType:"text/plain"}))})}),async(l,{toolName:d})=>{let f=s.find(g=>g.name===String(d));if(!f)return{contents:[{uri:l.href,text:"Tool not found"}]};let h=[`# ${f.name}`,"",f.description,"","## \u30D1\u30E9\u30E1\u30FC\u30BF","",...f.params.map(g=>`- \`${g}\``)];return{contents:[{uri:l.href,text:h.join(`
|
|
261
|
-
`),mimeType:"text/plain"}]}});let p=new Uc;await o.connect(p)}var ir,Ag,ao,TT,qr,
|
|
262
|
-
`)}function Og(e){if(
|
|
261
|
+
`),mimeType:"text/plain"}]}});let p=new Uc;await o.connect(p)}var ir,Ag,ao,TT,qr,l5,PT=_(()=>{"use strict";dw();mw();Em();Ko();y1();k1();E1();I1();N1();F1();G1();Q1();n2();c2();f2();_2();k2();C2();A2();M2();U2();W2();X2();o$();u$();h$();v$();S$();E$();O$();L$();B$();K$();eT();iT();lT();mT();xT();kT();ir=require("node:path"),Ag=require("node:url"),ao=require("node:fs"),TT={};try{qr=(0,ir.dirname)((0,Ag.fileURLToPath)(TT.url))}catch{qr=(0,ir.dirname)(process.execPath)}l5=(()=>{try{let e=(0,Ag.fileURLToPath)(TT.url);return process.argv[1]===e}catch{return!process.env.__GODD_CLI__}})();l5&&ST().catch(e=>{console.error("GoDD MCP Server \u8D77\u52D5\u30A8\u30E9\u30FC:",e),process.exit(1)})});var AT={};Br(AT,{buildMcpServerEntry:()=>Og,runInit:()=>RT});function ai(e){return new Promise(t=>{zT.question(e,r=>t(r.trim()))})}function p5(e){let t=new Map;for(let n of e){let o=h5[n.name]??n.category,i=t.get(o)??[];i.push(n),t.set(o,i)}return["language","frontend-ui","frontend-css","frontend-build","frontend","backend-api","backend-orm","backend-task","backend","runtime","database","infra","architecture"].filter(n=>t.has(n)).map(n=>({category:n,components:t.get(n)}))}function m5(e,t){let r=f5[e];return r===void 0||r.length===0?!0:r.some(n=>t.has(n))}function g5(){return!!process.pkg}async function y5(e,t){try{let r=await fetch(`${e}/v1/components`,{headers:{Authorization:`Bearer ${t}`}});return r.ok?await r.json():null}catch{return null}}function _5(e,t,r,n){return["# GoDD MCP Server Configuration","# Generated by godd-init","",`license_key: "${e}"`,"","# \u6280\u8853\u30B9\u30BF\u30C3\u30AF\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8","components:",...t.map(i=>` - ${i}`),"",`language: "${r}"`,"","# Registry API URL (default: production endpoint)",`# registry_url: "${n}"`,""].join(`
|
|
262
|
+
`)}function Og(e){if(g5())return{command:"godd",args:["server"],env:{GODD_CONFIG:e}};let t;try{t=(0,Ng.fileURLToPath)(OT.url)}catch{typeof __filename<"u"?t=__filename:(t=process.argv[1]??process.execPath,console.warn(`[GoDD] import.meta.url / __filename \u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002process.argv[1] \u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF: ${t}`))}let r=(0,$t.dirname)(t),n=t.includes("src")?(0,$t.resolve)(r,"..","..","dist","godd.js"):(0,$t.resolve)(r,"godd.js");return{command:process.execPath,args:[n,"server"],env:{GODD_CONFIG:e}}}async function RT(){console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 GoDD MCP Server \u2014 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log("");let e=await ai("\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: ");e||(console.error("\u30A8\u30E9\u30FC: \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1));let r=await ai("\u4F7F\u7528\u8A00\u8A9E\u3092\u9078\u629E [ja/en/zh/ru/kz/tr] (default: ja): ")||"ja",o=await ai("Registry API URL (default: http://localhost:8100): ")||"http://localhost:8100",i=Zs();i||(console.error(`
|
|
263
263
|
\u30A8\u30E9\u30FC: Git \u30EA\u30E2\u30FC\u30C8 (origin) \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002`),console.error(" git remote add origin <url> \u3067\u30EA\u30E2\u30FC\u30C8\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)),console.log(`
|
|
264
|
-
\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u767B\u9332\u4E2D: ${i}`);try{let T=await fetch(`${o}/v1/repos/register`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({remote_url:i}),signal:AbortSignal.timeout(1e4)});if(!T.ok){let
|
|
265
|
-
\u30A8\u30E9\u30FC: \u30EA\u30DD\u30B8\u30C8\u30EA\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002`),console.error(` ${
|
|
264
|
+
\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u767B\u9332\u4E2D: ${i}`);try{let T=await fetch(`${o}/v1/repos/register`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({remote_url:i}),signal:AbortSignal.timeout(1e4)});if(!T.ok){let U=await T.json().catch(()=>({detail:T.statusText}));console.error(`
|
|
265
|
+
\u30A8\u30E9\u30FC: \u30EA\u30DD\u30B8\u30C8\u30EA\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002`),console.error(` ${U.detail??T.statusText}`),T.status===401?console.error(" \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002"):T.status===403&&console.error(" \u30EA\u30DD\u30B8\u30C8\u30EA\u6570\u306E\u4E0A\u9650\u306B\u9054\u3057\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)}console.log("\u2713 \u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u767B\u9332\u3057\u307E\u3057\u305F")}catch{console.error(`
|
|
266
266
|
\u30A8\u30E9\u30FC: Registry API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002`),console.error(` ${o} \u304C\u8D77\u52D5\u3057\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),process.exit(1)}console.log(`
|
|
267
|
-
\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u4E2D...`);let s=await
|
|
268
|
-
\u3010${
|
|
267
|
+
\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u4E2D...`);let s=await y5(o,e)??CT;console.log(s===CT?" Registry API \u306B\u63A5\u7D9A\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u30D3\u30EB\u30C8\u30A4\u30F3\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002":` ${s.length} \u4EF6\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u3057\u307E\u3057\u305F\u3002`);let a=p5(s),c=new Set,u=new Set;function p(T){return a.find(U=>U.category===T)}async function l(T,U){let Q=d5[T.category]??T.category,Ie=U?T.components.filter(we=>m5(we.name,u)):T.components;if(Ie.length===0){console.log(` \u3010${Q}\u3011 \u2014 \u5BFE\u5FDC\u3059\u308B\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306F\u3042\u308A\u307E\u305B\u3093\uFF08\u30B9\u30AD\u30C3\u30D7\uFF09`);return}console.log(`
|
|
268
|
+
\u3010${Q}\u3011`),Ie.forEach((we,Qe)=>{console.log(` ${String(Qe+1).padStart(2)}. ${we.label.padEnd(25)} ${we.description}`)});let ht=await ai(" \u9078\u629E (\u4F8B: 1,3): ");if(ht.toLowerCase()==="all")for(let we of Ie)c.add(we.name);else if(ht){let we=ht.split(",").map(Qe=>parseInt(Qe.trim(),10));for(let Qe of we)Qe>=1&&Qe<=Ie.length&&c.add(Ie[Qe-1].name)}}let d=[{step:1,title:"\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E",categories:["language"]},{step:2,title:"\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF / \u30E9\u30A4\u30D6\u30E9\u30EA",categories:["frontend-ui","backend-api","frontend","backend"]},{step:3,title:"\u95A2\u9023\u30C4\u30FC\u30EB\uFF08CSS / \u30D3\u30EB\u30C9 / ORM / \u30BF\u30B9\u30AF\u30AD\u30E5\u30FC / \u30E9\u30F3\u30BF\u30A4\u30E0\uFF09",categories:["frontend-css","frontend-build","backend-orm","backend-task","runtime"]},{step:4,title:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9",categories:["database"]},{step:5,title:"\u30A4\u30F3\u30D5\u30E9",categories:["infra"]}],f=d.length;console.log(`
|
|
269
269
|
\u2501\u2501\u2501 \u6280\u8853\u30B9\u30BF\u30C3\u30AF\u9078\u629E\uFF08${f} \u30B9\u30C6\u30C3\u30D7 + \u81EA\u52D5\u8A2D\u5B9A\uFF09\u2501\u2501\u2501`),console.log(`\u8907\u6570\u9078\u629E: "1,3,5" / \u5168\u9078\u629E: "all" / \u30B9\u30AD\u30C3\u30D7: Enter
|
|
270
270
|
`);for(let T of d){console.log(`
|
|
271
|
-
\u2554\u2500 Step ${T.step}/${f}: ${T.title}`);for(let
|
|
271
|
+
\u2554\u2500 Step ${T.step}/${f}: ${T.title}`);for(let U of T.categories){let Q=p(U);Q&&await l(Q,T.step!==1)}if(T.step===1){let U=p("language");if(U)for(let Q of U.components)c.has(Q.name)&&u.add(Q.name);u.size===0&&(console.error(`
|
|
272
272
|
\u30A8\u30E9\u30FC: \u4F7F\u7528\u3059\u308B\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u30921\u3064\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),process.exit(1)),console.log(`
|
|
273
|
-
\u2192 \u9078\u629E\u8A00\u8A9E: ${[...u].join(", ")}`),console.log(" \u4EE5\u964D\u306F\u9078\u629E\u3055\u308C\u305F\u8A00\u8A9E\u306B\u5BFE\u5FDC\u3059\u308B\u6280\u8853\u306E\u307F\u8868\u793A\u3057\u307E\u3059\u3002")}console.log(`\u255A\u2500 Step ${T.step} \u5B8C\u4E86`)}let h=p("architecture");if(h){for(let
|
|
273
|
+
\u2192 \u9078\u629E\u8A00\u8A9E: ${[...u].join(", ")}`),console.log(" \u4EE5\u964D\u306F\u9078\u629E\u3055\u308C\u305F\u8A00\u8A9E\u306B\u5BFE\u5FDC\u3059\u308B\u6280\u8853\u306E\u307F\u8868\u793A\u3057\u307E\u3059\u3002")}console.log(`\u255A\u2500 Step ${T.step} \u5B8C\u4E86`)}let h=p("architecture");if(h){for(let U of h.components)c.add(U.name);let T=h.components.map(U=>U.label).join(", ");console.log(`
|
|
274
274
|
\u2714 \u8A2D\u8A08\u30D1\u30BF\u30FC\u30F3\u3092\u81EA\u52D5\u8A2D\u5B9A\u3057\u307E\u3057\u305F: ${T}`)}c.size===0&&(console.error(`
|
|
275
275
|
\u30A8\u30E9\u30FC: \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C1\u3064\u3082\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`),process.exit(1)),console.log(`
|
|
276
|
-
\u2501\u2501\u2501 \u9078\u629E\u3055\u308C\u305F\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8 (${c.size} \u4EF6) \u2501\u2501\u2501`);for(let T of c){let
|
|
277
|
-
config.godd \u306E\u4FDD\u5B58\u5148 (default: ${y}): `)||y,k=
|
|
278
|
-
\u2713 config.godd \u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${v}`),(await ai(".cursor/mcp.json \u3092\u751F\u6210\u3057\u307E\u3059\u304B\uFF1F [Y/n]: ")).toLowerCase()!=="n"){let T=(0,$t.join)(g,".cursor"),
|
|
279
|
-
\u26A0 \u30E6\u30FC\u30B6\u30FC\u30B0\u30ED\u30FC\u30D0\u30EB\u306E MCP \u8A2D\u5B9A\u3092\u4E0A\u66F8\u304D\u3057\u306A\u3044\u305F\u3081\u3001\u30D5\u30A1\u30A4\u30EB\u306B\u306F\u66F8\u304D\u8FBC\u307F\u307E\u305B\u3093\u3002`),console.log(` \u4EE5\u4E0B\u306E\u30D6\u30ED\u30C3\u30AF\u3092\u624B\u52D5\u3067 ${
|
|
280
|
-
`),console.log(JSON.stringify(Ie,null,2)),console.log("")}else{(0,Gt.existsSync)(T)||(0,Gt.mkdirSync)(T,{recursive:!0});let Ie={mcpServers:{}};if((0,Gt.existsSync)(
|
|
281
|
-
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557`),console.log("\u2551 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86\uFF01 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log(""),console.log("\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:"),console.log(" 1. Cursor IDE \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" 2. \u30C1\u30E3\u30C3\u30C8\u3067 GoDD MCP \u30C4\u30FC\u30EB\u304C\u4F7F\u3048\u308B\u3088\u3046\u306B\u306A\u308A\u307E\u3059"),console.log(" - godd_dev: \u958B\u767A\u652F\u63F4"),console.log(" - godd_check: \u30B3\u30FC\u30C9\u30C1\u30A7\u30C3\u30AF"),console.log(" - godd_review: \u30B3\u30FC\u30C9\u30EC\u30D3\u30E5\u30FC"),console.log(" - godd_setup: \u74B0\u5883\u69CB\u7BC9\u652F\u63F4"),console.log(" \u4ED6 12 \u30C4\u30FC\u30EB"),console.log(""),zT.close()}var ET,Gt,$t,Ng,IT,OT,CT,zT,a5,c5,u5,h5,NT=_(()=>{"use strict";ET=st(require("node:readline"),1),Gt=require("node:fs"),$t=require("node:path"),Ng=require("node:url"),IT=require("node:os");Tg();OT={},CT=[{id:"",name:"python",category:"language",label:"Python",description:"\u6C4E\u7528\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E"},{id:"",name:"typescript",category:"language",label:"TypeScript",description:"\u578B\u5B89\u5168\u306A JavaScript \u30B9\u30FC\u30D1\u30FC\u30BB\u30C3\u30C8"},{id:"",name:"javascript",category:"language",label:"JavaScript",description:"\u52D5\u7684\u30B9\u30AF\u30EA\u30D7\u30C8\u8A00\u8A9E (ES2024+)"},{id:"",name:"go",category:"language",label:"Go",description:"\u9759\u7684\u578B\u4ED8\u3051\u30B3\u30F3\u30D1\u30A4\u30EB\u8A00\u8A9E"},{id:"",name:"php",category:"language",label:"PHP",description:"\u6C4E\u7528\u30B9\u30AF\u30EA\u30D7\u30C8\u8A00\u8A9E"},{id:"",name:"ruby",category:"language",label:"Ruby",description:"\u52D5\u7684\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u6307\u5411\u8A00\u8A9E"},{id:"",name:"c",category:"language",label:"C",description:"\u30B7\u30B9\u30C6\u30E0\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E"},{id:"",name:"html",category:"language",label:"HTML",description:"HyperText Markup Language"},{id:"",name:"css",category:"language",label:"CSS",description:"Cascading Style Sheets"},{id:"",name:"react",category:"frontend",label:"React",description:"React UI \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"nextjs",category:"frontend",label:"Next.js",description:"React \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (SSR/SSG/ISR)"},{id:"",name:"vue",category:"frontend",label:"Vue.js",description:"\u30D7\u30ED\u30B0\u30EC\u30C3\u30B7\u30D6 JavaScript \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"angular",category:"frontend",label:"Angular",description:"TypeScript \u30D9\u30FC\u30B9 Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"svelte",category:"frontend",label:"Svelte",description:"\u30B3\u30F3\u30D1\u30A4\u30EB\u6642 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"vite",category:"frontend",label:"Vite",description:"\u9AD8\u901F\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB"},{id:"",name:"tailwind",category:"frontend",label:"Tailwind CSS",description:"\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3\u30D5\u30A1\u30FC\u30B9\u30C8 CSS"},{id:"",name:"sass",category:"frontend",label:"Sass",description:"CSS \u30D7\u30EA\u30D7\u30ED\u30BB\u30C3\u30B5"},{id:"",name:"electron",category:"frontend",label:"Electron",description:"\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30A2\u30D7\u30EA\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fastapi",category:"backend",label:"FastAPI",description:"\u9AD8\u901F Python Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"django",category:"backend",label:"Django",description:"Python Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (batteries included)"},{id:"",name:"flask",category:"backend",label:"Flask",description:"Python \u30DE\u30A4\u30AF\u30ED Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"express",category:"backend",label:"Express",description:"\u6700\u5C0F\u9650\u306E Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fastify",category:"backend",label:"Fastify",description:"\u9AD8\u901F Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"nestjs",category:"backend",label:"NestJS",description:"\u30D7\u30ED\u30B0\u30EC\u30C3\u30B7\u30D6 Node.js \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"gin",category:"backend",label:"Gin",description:"Go HTTP Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"echo",category:"backend",label:"Echo",description:"\u9AD8\u6027\u80FD Go Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fiber",category:"backend",label:"Fiber",description:"Express \u98A8 Go Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"laravel",category:"backend",label:"Laravel",description:"PHP Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"symfony",category:"backend",label:"Symfony",description:"PHP \u30A8\u30F3\u30BF\u30FC\u30D7\u30E9\u30A4\u30BA\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"wordpress",category:"backend",label:"WordPress",description:"PHP CMS \u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0"},{id:"",name:"rails",category:"backend",label:"Ruby on Rails",description:"Ruby Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (MVC)"},{id:"",name:"sinatra",category:"backend",label:"Sinatra",description:"Ruby \u30DE\u30A4\u30AF\u30ED Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"koa",category:"backend",label:"Koa",description:"\u6B21\u4E16\u4EE3 Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"node",category:"runtime",label:"Node.js",description:"JavaScript \u30E9\u30F3\u30BF\u30A4\u30E0"},{id:"",name:"agent-stdio",category:"runtime",label:"Agent Stdio",description:"MCP Agent stdio \u5B9F\u884C\u30E9\u30F3\u30BF\u30A4\u30E0"},{id:"",name:"postgresql",category:"database",label:"PostgreSQL",description:"\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9 RDB"},{id:"",name:"mysql",category:"database",label:"MySQL",description:"\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9 RDB"},{id:"",name:"mongodb",category:"database",label:"MongoDB",description:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u6307\u5411 NoSQL DB"},{id:"",name:"redis",category:"database",label:"Redis",description:"\u30A4\u30F3\u30E1\u30E2\u30EA KVS / \u30AD\u30E3\u30C3\u30B7\u30E5"},{id:"",name:"sqlalchemy",category:"backend",label:"SQLAlchemy",description:"Python SQL \u30C4\u30FC\u30EB\u30AD\u30C3\u30C8 + ORM"},{id:"",name:"celery",category:"backend",label:"Celery",description:"\u5206\u6563\u30BF\u30B9\u30AF\u30AD\u30E5\u30FC"},{id:"",name:"docker",category:"infra",label:"Docker",description:"\u30B3\u30F3\u30C6\u30CA\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0"},{id:"",name:"terraform",category:"infra",label:"Terraform",description:"IaC \u30C4\u30FC\u30EB (HashiCorp)"},{id:"",name:"ddd-clean-architecture",category:"architecture",label:"DDD / Clean Architecture",description:"\u30C9\u30E1\u30A4\u30F3\u99C6\u52D5\u8A2D\u8A08 + Clean Architecture"}],zT=ET.createInterface({input:process.stdin,output:process.stdout});a5={language:"\u8A00\u8A9E","frontend-ui":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF","frontend-css":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 CSS","frontend-build":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 \u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",frontend:"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 \u305D\u306E\u4ED6","backend-api":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 API \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF","backend-orm":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 ORM / DB \u30C4\u30FC\u30EB","backend-task":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 \u30BF\u30B9\u30AF\u30AD\u30E5\u30FC",backend:"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 \u305D\u306E\u4ED6",runtime:"\u30E9\u30F3\u30BF\u30A4\u30E0",database:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9",infra:"\u30A4\u30F3\u30D5\u30E9",architecture:"\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3"},c5={fastapi:["python"],django:["python"],flask:["python"],sqlalchemy:["python"],celery:["python"],express:["typescript","javascript"],fastify:["typescript","javascript"],nestjs:["typescript","javascript"],koa:["typescript","javascript"],gin:["go"],echo:["go"],fiber:["go"],laravel:["php"],symfony:["php"],wordpress:["php"],rails:["ruby"],sinatra:["ruby"],react:["typescript","javascript"],nextjs:["typescript","javascript"],vue:["typescript","javascript"],angular:["typescript","javascript"],svelte:["typescript","javascript"],vite:["typescript","javascript"],electron:["typescript","javascript"],tailwind:[],sass:[],node:["typescript","javascript"],"agent-stdio":[]},u5={react:"frontend-ui",nextjs:"frontend-ui",vue:"frontend-ui",angular:"frontend-ui",svelte:"frontend-ui",electron:"frontend-ui",tailwind:"frontend-css",sass:"frontend-css",vite:"frontend-build",fastapi:"backend-api",django:"backend-api",flask:"backend-api",express:"backend-api",fastify:"backend-api",nestjs:"backend-api",gin:"backend-api",echo:"backend-api",fiber:"backend-api",laravel:"backend-api",symfony:"backend-api",wordpress:"backend-api",rails:"backend-api",sinatra:"backend-api",koa:"backend-api",sqlalchemy:"backend-orm",celery:"backend-task"};h5=(()=>{try{let e=(0,Ng.fileURLToPath)(OT.url);return process.argv[1]===e}catch{return!process.env.__GODD_CLI__}})();h5&&RT().catch(e=>{console.error("\u30A8\u30E9\u30FC:",e),process.exit(1)})});var LT={};Br(LT,{runInstall:()=>v5});function m5(){if(process.platform==="win32"){let e=process.env.LOCALAPPDATA??(0,_n.join)((0,ju.homedir)(),"AppData","Local");return(0,_n.join)(e,"GoDD")}return(0,_n.join)((0,ju.homedir)(),".godd","bin")}function g5(){return process.platform==="win32"?"godd.exe":"godd"}function MT(e){let t=process.env.PATH??"",r=process.platform==="win32"?";":":";return t.split(r).map(o=>o.replace(/[\\/]+$/,"").toLowerCase()).includes(e.replace(/[\\/]+$/,"").toLowerCase())}function y5(e){if(MT(e)){console.log(" PATH: \u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002");return}try{let t=["$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')","if ($currentPath -and $currentPath.Length -gt 0) {",` $newPath = $currentPath + ';' + '${e.replace(/'/g,"''")}'`,"} else {",` $newPath = '${e.replace(/'/g,"''")}'`,"}","[Environment]::SetEnvironmentVariable('PATH', $newPath, 'User')"].join("; ");(0,DT.execSync)(`powershell -NoProfile -Command "${t}"`,{stdio:"pipe"}),console.log(" PATH: \u30E6\u30FC\u30B6\u30FC\u74B0\u5883\u5909\u6570\u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002")}catch{console.error(` PATH: \u81EA\u52D5\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u4EE5\u4E0B\u3092\u624B\u52D5\u3067 PATH \u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044:
|
|
282
|
-
${e}`)}}function
|
|
276
|
+
\u2501\u2501\u2501 \u9078\u629E\u3055\u308C\u305F\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8 (${c.size} \u4EF6) \u2501\u2501\u2501`);for(let T of c){let U=s.find(Q=>Q.name===T);console.log(` \u2713 ${U?.label??T}`)}let g=process.cwd(),y=(0,$t.join)(g,"config.godd"),v=await ai(`
|
|
277
|
+
config.godd \u306E\u4FDD\u5B58\u5148 (default: ${y}): `)||y,k=_5(e,[...c],r,o);if((0,Gt.writeFileSync)(v,k,"utf-8"),console.log(`
|
|
278
|
+
\u2713 config.godd \u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${v}`),(await ai(".cursor/mcp.json \u3092\u751F\u6210\u3057\u307E\u3059\u304B\uFF1F [Y/n]: ")).toLowerCase()!=="n"){let T=(0,$t.join)(g,".cursor"),U=(0,$t.resolve)((0,$t.join)(T,"mcp.json")),Q=(0,$t.resolve)((0,$t.join)((0,IT.homedir)(),".cursor","mcp.json"));if(U===Q){let Ie={godd:Og((0,$t.resolve)(v))};console.log(`
|
|
279
|
+
\u26A0 \u30E6\u30FC\u30B6\u30FC\u30B0\u30ED\u30FC\u30D0\u30EB\u306E MCP \u8A2D\u5B9A\u3092\u4E0A\u66F8\u304D\u3057\u306A\u3044\u305F\u3081\u3001\u30D5\u30A1\u30A4\u30EB\u306B\u306F\u66F8\u304D\u8FBC\u307F\u307E\u305B\u3093\u3002`),console.log(` \u4EE5\u4E0B\u306E\u30D6\u30ED\u30C3\u30AF\u3092\u624B\u52D5\u3067 ${Q} \u306E mcpServers \u306B\u8FFD\u8A18\u3057\u3066\u304F\u3060\u3055\u3044:
|
|
280
|
+
`),console.log(JSON.stringify(Ie,null,2)),console.log("")}else{(0,Gt.existsSync)(T)||(0,Gt.mkdirSync)(T,{recursive:!0});let Ie={mcpServers:{}};if((0,Gt.existsSync)(U))try{Ie={...JSON.parse((0,Gt.readFileSync)(U,"utf-8"))},(typeof Ie.mcpServers!="object"||Ie.mcpServers===null)&&(Ie.mcpServers={})}catch{console.warn(`\u26A0 \u65E2\u5B58\u306E ${U} \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u65E2\u5B58\u8A2D\u5B9A\u3092\u4FDD\u6301\u3057\u305F\u307E\u307E godd \u30A8\u30F3\u30C8\u30EA\u306E\u307F\u8FFD\u52A0\u3057\u307E\u3059\u3002`);let we=`${U}.bak`;(0,Gt.writeFileSync)(we,(0,Gt.readFileSync)(U,"utf-8"),"utf-8"),console.warn(` \u30D0\u30C3\u30AF\u30A2\u30C3\u30D7: ${we}`)}let ht={...Ie.mcpServers};ht.godd=Og((0,$t.resolve)(v)),Ie.mcpServers=ht,(0,Gt.writeFileSync)(U,JSON.stringify(Ie,null,2),"utf-8"),console.log(`\u2713 .cursor/mcp.json \u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${U}`)}}console.log(`
|
|
281
|
+
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557`),console.log("\u2551 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86\uFF01 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log(""),console.log("\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:"),console.log(" 1. Cursor IDE \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" 2. \u30C1\u30E3\u30C3\u30C8\u3067 GoDD MCP \u30C4\u30FC\u30EB\u304C\u4F7F\u3048\u308B\u3088\u3046\u306B\u306A\u308A\u307E\u3059"),console.log(" - godd_dev: \u958B\u767A\u652F\u63F4"),console.log(" - godd_check: \u30B3\u30FC\u30C9\u30C1\u30A7\u30C3\u30AF"),console.log(" - godd_review: \u30B3\u30FC\u30C9\u30EC\u30D3\u30E5\u30FC"),console.log(" - godd_setup: \u74B0\u5883\u69CB\u7BC9\u652F\u63F4"),console.log(" \u4ED6 12 \u30C4\u30FC\u30EB"),console.log(""),zT.close()}var ET,Gt,$t,Ng,IT,OT,CT,zT,d5,f5,h5,v5,NT=_(()=>{"use strict";ET=st(require("node:readline"),1),Gt=require("node:fs"),$t=require("node:path"),Ng=require("node:url"),IT=require("node:os");Tg();OT={},CT=[{id:"",name:"python",category:"language",label:"Python",description:"\u6C4E\u7528\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E"},{id:"",name:"typescript",category:"language",label:"TypeScript",description:"\u578B\u5B89\u5168\u306A JavaScript \u30B9\u30FC\u30D1\u30FC\u30BB\u30C3\u30C8"},{id:"",name:"javascript",category:"language",label:"JavaScript",description:"\u52D5\u7684\u30B9\u30AF\u30EA\u30D7\u30C8\u8A00\u8A9E (ES2024+)"},{id:"",name:"go",category:"language",label:"Go",description:"\u9759\u7684\u578B\u4ED8\u3051\u30B3\u30F3\u30D1\u30A4\u30EB\u8A00\u8A9E"},{id:"",name:"php",category:"language",label:"PHP",description:"\u6C4E\u7528\u30B9\u30AF\u30EA\u30D7\u30C8\u8A00\u8A9E"},{id:"",name:"ruby",category:"language",label:"Ruby",description:"\u52D5\u7684\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u6307\u5411\u8A00\u8A9E"},{id:"",name:"c",category:"language",label:"C",description:"\u30B7\u30B9\u30C6\u30E0\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E"},{id:"",name:"html",category:"language",label:"HTML",description:"HyperText Markup Language"},{id:"",name:"css",category:"language",label:"CSS",description:"Cascading Style Sheets"},{id:"",name:"react",category:"frontend",label:"React",description:"React UI \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"nextjs",category:"frontend",label:"Next.js",description:"React \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (SSR/SSG/ISR)"},{id:"",name:"vue",category:"frontend",label:"Vue.js",description:"\u30D7\u30ED\u30B0\u30EC\u30C3\u30B7\u30D6 JavaScript \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"angular",category:"frontend",label:"Angular",description:"TypeScript \u30D9\u30FC\u30B9 Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"svelte",category:"frontend",label:"Svelte",description:"\u30B3\u30F3\u30D1\u30A4\u30EB\u6642 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"vite",category:"frontend",label:"Vite",description:"\u9AD8\u901F\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB"},{id:"",name:"tailwind",category:"frontend",label:"Tailwind CSS",description:"\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3\u30D5\u30A1\u30FC\u30B9\u30C8 CSS"},{id:"",name:"sass",category:"frontend",label:"Sass",description:"CSS \u30D7\u30EA\u30D7\u30ED\u30BB\u30C3\u30B5"},{id:"",name:"electron",category:"frontend",label:"Electron",description:"\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30A2\u30D7\u30EA\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fastapi",category:"backend",label:"FastAPI",description:"\u9AD8\u901F Python Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"django",category:"backend",label:"Django",description:"Python Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (batteries included)"},{id:"",name:"flask",category:"backend",label:"Flask",description:"Python \u30DE\u30A4\u30AF\u30ED Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"express",category:"backend",label:"Express",description:"\u6700\u5C0F\u9650\u306E Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fastify",category:"backend",label:"Fastify",description:"\u9AD8\u901F Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"nestjs",category:"backend",label:"NestJS",description:"\u30D7\u30ED\u30B0\u30EC\u30C3\u30B7\u30D6 Node.js \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"gin",category:"backend",label:"Gin",description:"Go HTTP Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"echo",category:"backend",label:"Echo",description:"\u9AD8\u6027\u80FD Go Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fiber",category:"backend",label:"Fiber",description:"Express \u98A8 Go Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"laravel",category:"backend",label:"Laravel",description:"PHP Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"symfony",category:"backend",label:"Symfony",description:"PHP \u30A8\u30F3\u30BF\u30FC\u30D7\u30E9\u30A4\u30BA\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"wordpress",category:"backend",label:"WordPress",description:"PHP CMS \u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0"},{id:"",name:"rails",category:"backend",label:"Ruby on Rails",description:"Ruby Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (MVC)"},{id:"",name:"sinatra",category:"backend",label:"Sinatra",description:"Ruby \u30DE\u30A4\u30AF\u30ED Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"koa",category:"backend",label:"Koa",description:"\u6B21\u4E16\u4EE3 Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"node",category:"runtime",label:"Node.js",description:"JavaScript \u30E9\u30F3\u30BF\u30A4\u30E0"},{id:"",name:"agent-stdio",category:"runtime",label:"Agent Stdio",description:"MCP Agent stdio \u5B9F\u884C\u30E9\u30F3\u30BF\u30A4\u30E0"},{id:"",name:"postgresql",category:"database",label:"PostgreSQL",description:"\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9 RDB"},{id:"",name:"mysql",category:"database",label:"MySQL",description:"\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9 RDB"},{id:"",name:"mongodb",category:"database",label:"MongoDB",description:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u6307\u5411 NoSQL DB"},{id:"",name:"redis",category:"database",label:"Redis",description:"\u30A4\u30F3\u30E1\u30E2\u30EA KVS / \u30AD\u30E3\u30C3\u30B7\u30E5"},{id:"",name:"sqlalchemy",category:"backend",label:"SQLAlchemy",description:"Python SQL \u30C4\u30FC\u30EB\u30AD\u30C3\u30C8 + ORM"},{id:"",name:"celery",category:"backend",label:"Celery",description:"\u5206\u6563\u30BF\u30B9\u30AF\u30AD\u30E5\u30FC"},{id:"",name:"docker",category:"infra",label:"Docker",description:"\u30B3\u30F3\u30C6\u30CA\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0"},{id:"",name:"terraform",category:"infra",label:"Terraform",description:"IaC \u30C4\u30FC\u30EB (HashiCorp)"},{id:"",name:"ddd-clean-architecture",category:"architecture",label:"DDD / Clean Architecture",description:"\u30C9\u30E1\u30A4\u30F3\u99C6\u52D5\u8A2D\u8A08 + Clean Architecture"}],zT=ET.createInterface({input:process.stdin,output:process.stdout});d5={language:"\u8A00\u8A9E","frontend-ui":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF","frontend-css":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 CSS","frontend-build":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 \u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",frontend:"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 \u305D\u306E\u4ED6","backend-api":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 API \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF","backend-orm":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 ORM / DB \u30C4\u30FC\u30EB","backend-task":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 \u30BF\u30B9\u30AF\u30AD\u30E5\u30FC",backend:"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 \u305D\u306E\u4ED6",runtime:"\u30E9\u30F3\u30BF\u30A4\u30E0",database:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9",infra:"\u30A4\u30F3\u30D5\u30E9",architecture:"\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3"},f5={fastapi:["python"],django:["python"],flask:["python"],sqlalchemy:["python"],celery:["python"],express:["typescript","javascript"],fastify:["typescript","javascript"],nestjs:["typescript","javascript"],koa:["typescript","javascript"],gin:["go"],echo:["go"],fiber:["go"],laravel:["php"],symfony:["php"],wordpress:["php"],rails:["ruby"],sinatra:["ruby"],react:["typescript","javascript"],nextjs:["typescript","javascript"],vue:["typescript","javascript"],angular:["typescript","javascript"],svelte:["typescript","javascript"],vite:["typescript","javascript"],electron:["typescript","javascript"],tailwind:[],sass:[],node:["typescript","javascript"],"agent-stdio":[]},h5={react:"frontend-ui",nextjs:"frontend-ui",vue:"frontend-ui",angular:"frontend-ui",svelte:"frontend-ui",electron:"frontend-ui",tailwind:"frontend-css",sass:"frontend-css",vite:"frontend-build",fastapi:"backend-api",django:"backend-api",flask:"backend-api",express:"backend-api",fastify:"backend-api",nestjs:"backend-api",gin:"backend-api",echo:"backend-api",fiber:"backend-api",laravel:"backend-api",symfony:"backend-api",wordpress:"backend-api",rails:"backend-api",sinatra:"backend-api",koa:"backend-api",sqlalchemy:"backend-orm",celery:"backend-task"};v5=(()=>{try{let e=(0,Ng.fileURLToPath)(OT.url);return process.argv[1]===e}catch{return!process.env.__GODD_CLI__}})();v5&&RT().catch(e=>{console.error("\u30A8\u30E9\u30FC:",e),process.exit(1)})});var LT={};Br(LT,{runInstall:()=>S5});function b5(){if(process.platform==="win32"){let e=process.env.LOCALAPPDATA??(0,_n.join)((0,ju.homedir)(),"AppData","Local");return(0,_n.join)(e,"GoDD")}return(0,_n.join)((0,ju.homedir)(),".godd","bin")}function x5(){return process.platform==="win32"?"godd.exe":"godd"}function MT(e){let t=process.env.PATH??"",r=process.platform==="win32"?";":":";return t.split(r).map(o=>o.replace(/[\\/]+$/,"").toLowerCase()).includes(e.replace(/[\\/]+$/,"").toLowerCase())}function w5(e){if(MT(e)){console.log(" PATH: \u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002");return}try{let t=["$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')","if ($currentPath -and $currentPath.Length -gt 0) {",` $newPath = $currentPath + ';' + '${e.replace(/'/g,"''")}'`,"} else {",` $newPath = '${e.replace(/'/g,"''")}'`,"}","[Environment]::SetEnvironmentVariable('PATH', $newPath, 'User')"].join("; ");(0,DT.execSync)(`powershell -NoProfile -Command "${t}"`,{stdio:"pipe"}),console.log(" PATH: \u30E6\u30FC\u30B6\u30FC\u74B0\u5883\u5909\u6570\u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002")}catch{console.error(` PATH: \u81EA\u52D5\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u4EE5\u4E0B\u3092\u624B\u52D5\u3067 PATH \u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044:
|
|
282
|
+
${e}`)}}function k5(e){if(MT(e)){console.log(" PATH: \u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002");return}let t=`
|
|
283
283
|
# GoDD CLI
|
|
284
284
|
export PATH="${e}:$PATH"
|
|
285
|
-
`,r=(0,ju.homedir)(),n=[],o=(0,_n.join)(r,".zshrc"),i=(0,_n.join)(r,".bashrc"),s=(0,_n.join)(r,".bash_profile");if((0,sr.existsSync)(o)&&n.push(o),(0,sr.existsSync)(i)?n.push(i):(0,sr.existsSync)(s)&&n.push(s),n.length===0){let a=process.platform==="darwin"?o:i;n.push(a)}for(let a of n){try{if((0,Mu.readFileSync)(a,"utf-8").includes(e)){console.log(` PATH: ${a} \u306B\u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002`);continue}}catch{}(0,Mu.appendFileSync)(a,t,"utf-8"),console.log(` PATH: ${a} \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002`)}}async function
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
---
|
|
290
|
-
|
|
291
|
-
--- \
|
|
292
|
-
--- \u30EA\
|
|
293
|
-
--- \
|
|
294
|
-
---
|
|
295
|
-
---
|
|
296
|
-
--- \
|
|
297
|
-
--- \u30EA\
|
|
298
|
-
--- \
|
|
299
|
-
---
|
|
300
|
-
---
|
|
301
|
-
--- \
|
|
302
|
-
--- \u30EA\
|
|
303
|
-
--- \
|
|
304
|
-
---
|
|
305
|
-
---
|
|
306
|
-
--- Railway \u8A2D\u5B9A ---`);let
|
|
307
|
-
--- \
|
|
285
|
+
`,r=(0,ju.homedir)(),n=[],o=(0,_n.join)(r,".zshrc"),i=(0,_n.join)(r,".bashrc"),s=(0,_n.join)(r,".bash_profile");if((0,sr.existsSync)(o)&&n.push(o),(0,sr.existsSync)(i)?n.push(i):(0,sr.existsSync)(s)&&n.push(s),n.length===0){let a=process.platform==="darwin"?o:i;n.push(a)}for(let a of n){try{if((0,Mu.readFileSync)(a,"utf-8").includes(e)){console.log(` PATH: ${a} \u306B\u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002`);continue}}catch{}(0,Mu.appendFileSync)(a,t,"utf-8"),console.log(` PATH: ${a} \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002`)}}async function S5(){console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 GoDD CLI \u2014 \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log("");let e=b5(),t=x5(),r=(0,_n.join)(e,t),n=process.execPath;console.log(`\u30BD\u30FC\u30B9: ${n}`),console.log(`\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5148: ${r}`),console.log(""),(0,sr.existsSync)(e)||((0,sr.mkdirSync)(e,{recursive:!0}),console.log(`\u2713 \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F: ${e}`));let o=n.replace(/\\/g,"/").toLowerCase(),i=r.replace(/\\/g,"/").toLowerCase();if(o===i?console.log("\u2713 \u65E2\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5148\u304B\u3089\u5B9F\u884C\u3055\u308C\u3066\u3044\u307E\u3059\uFF08\u30B3\u30D4\u30FC\u3092\u30B9\u30AD\u30C3\u30D7\uFF09\u3002"):((0,sr.copyFileSync)(n,r),console.log("\u2713 \u30D0\u30A4\u30CA\u30EA\u3092\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F\u3002"),process.platform!=="win32"&&(0,sr.chmodSync)(r,493)),console.log(""),process.platform==="win32"?w5(e):k5(e),console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5B8C\u4E86\uFF01 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log(""),console.log("\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:"),console.log(" 1. \u30BF\u30FC\u30DF\u30CA\u30EB\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF08PATH \u3092\u53CD\u6620\u3059\u308B\u305F\u3081\uFF09"),console.log(" 2. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067 godd init \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(""),console.log("\u4F7F\u3044\u65B9:"),console.log(" godd init \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7"),console.log(" godd server MCP \u30B5\u30FC\u30D0\u30FC\u8D77\u52D5\uFF08Cursor \u304C\u81EA\u52D5\u5B9F\u884C\uFF09"),console.log(" godd version \u30D0\u30FC\u30B8\u30E7\u30F3\u8868\u793A"),console.log(" godd help \u30D8\u30EB\u30D7\u8868\u793A"),console.log(""),process.platform==="win32"&&!process.env.TERM&&!process.env.CI){let s=jT.createInterface({input:process.stdin,output:process.stdout});await new Promise(a=>{s.question("Enter \u30AD\u30FC\u3092\u62BC\u3057\u3066\u9589\u3058\u307E\u3059...",()=>{s.close(),a()})})}}var sr,_n,ju,DT,Mu,jT,ZT=_(()=>{"use strict";sr=require("node:fs"),_n=require("node:path"),ju=require("node:os"),DT=require("node:child_process"),Mu=require("node:fs"),jT=st(require("node:readline"),1)});var KT={};Br(KT,{PROVIDER_LABELS:()=>Dg,findNotesSourceDirs:()=>HT,runNotesInfra:()=>B5,scaffoldNotesApplicationSources:()=>WT,shouldExcludeNotesSourceEntry:()=>VT});function $5(){return qT.createInterface({input:process.stdin,output:process.stdout})}function ne(e,t){return new Promise(r=>{e.question(t,n=>r(n.trim()))})}function BT(){try{return(0,F.dirname)((0,FT.fileURLToPath)(V5.url))}catch{return(0,F.dirname)(process.execPath)}}function T5(e){let t=BT(),r=(0,F.resolve)(t,".."),n=(0,F.join)(r,"templates","terraform",e),o=(0,F.join)(r,"templates","github-actions",e);return(0,V.existsSync)(n)&&(0,V.existsSync)(o)?{terraformDir:n,ghaDir:o}:null}function VT(e,t){return e===".env"||e.startsWith(".env.")&&e!==".env.example"||e.endsWith(".pyc")||e.endsWith(".tsbuildinfo")?!0:P5.has(e)||t.has(e)}function I5(e,t){return(0,V.existsSync)((0,F.join)(e,"app","main.py"))&&(0,V.existsSync)((0,F.join)(t,"package.json"))&&(0,V.existsSync)((0,F.join)(t,"src"))}function HT(){let e=BT(),t=[(0,F.resolve)(e,".."),e,(0,F.dirname)(process.execPath),process.cwd()];for(let r of t){let n=(0,F.join)(r,"notes-api"),o=(0,F.join)(r,"notes-app");if((0,V.existsSync)(n)&&(0,V.existsSync)(o)&&I5(n,o))return{apiDir:n,appDir:o}}return null}function GT(e,t,r){(0,V.mkdirSync)(t,{recursive:!0});for(let n of(0,V.readdirSync)(e)){if(VT(n,r))continue;let o=(0,F.join)(e,n),i=(0,F.join)(t,n);(0,V.statSync)(o).isDirectory()?GT(o,i,r):(0,V.copyFileSync)(o,i)}}function WT(e){let t=HT();if(!t)return console.warn(`
|
|
286
|
+
\u26A0 notes-api / notes-app \u306E\u540C\u68B1\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u3089\u306A\u3044\u305F\u3081\u3001\u30A2\u30D7\u30EA scaffold \u3092\u30B9\u30AD\u30C3\u30D7\u3057\u307E\u3057\u305F\u3002`),[];let r=[],n=[{label:"notes-api",src:t.apiDir,dest:(0,F.join)(e,"notes-api"),exclude:E5},{label:"notes-app",src:t.appDir,dest:(0,F.join)(e,"notes-app"),exclude:C5}];console.log(`
|
|
287
|
+
[\u30A2\u30D7\u30EA] Notes \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30BD\u30FC\u30B9\u3092\u540C\u671F: ${e}`);for(let o of n){let i=(0,V.existsSync)(o.dest)?"\u66F4\u65B0":"\u914D\u7F6E";GT(o.src,o.dest,o.exclude),r.push(o.label),console.log(` \u2713 ${o.label}/ \u3092${i}`)}return r}function z5(e){let t=(0,F.join)(e,jg);if(!(0,V.existsSync)(t))return null;try{return JSON.parse((0,V.readFileSync)(t,"utf-8"))}catch{return null}}function R5(e){let t=(0,F.join)(e.outputDir,jg),r={...e};(0,V.writeFileSync)(t,JSON.stringify(r,null,2)+`
|
|
288
|
+
`,"utf-8")}async function A5(e,t){console.log(`
|
|
289
|
+
--- \u30AF\u30E9\u30A6\u30C9\u30D7\u30ED\u30D0\u30A4\u30C0\u9078\u629E ---`);let r=Object.entries(Dg);for(let s=0;s<r.length;s++){let[a,c]=r[s],u=a===(t??"aws");console.log(` ${s+1}. ${c}${u?" [\u30C7\u30D5\u30A9\u30EB\u30C8]":""}`)}let n=r.findIndex(([s])=>s===(t??"aws"))+1,o=await ne(e,`
|
|
290
|
+
\u9078\u629E [${n}]: `)||String(n),i=parseInt(o,10)-1;return(i<0||i>=r.length)&&(console.error("\u30A8\u30E9\u30FC: \u7121\u52B9\u306A\u9078\u629E\u3067\u3059\u3002"),process.exit(1)),r[i][0]}async function O5(e,t){console.log(`
|
|
291
|
+
--- AWS \u30A2\u30AB\u30A6\u30F3\u30C8\u8A2D\u5B9A ---`);let r=await ne(e,`AWS \u30A2\u30AB\u30A6\u30F3\u30C8 ID${t.accountId?` [${t.accountId}]`:""}: `)||t.accountId||"";(!r||!/^\d{12}$/.test(r))&&(console.error("\u30A8\u30E9\u30FC: 12\u6841\u306E AWS \u30A2\u30AB\u30A6\u30F3\u30C8 ID \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let n=await ne(e,`AWS \u30EA\u30FC\u30B8\u30E7\u30F3 [${t.region??"ap-northeast-1"}]: `)||t.region||"ap-northeast-1",o=await ne(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
|
|
292
|
+
--- GitHub \u30EA\u30DD\u30B8\u30C8\u30EA ---`);let i=await ne(e,`GitHub Owner${t.githubOwner?` [${t.githubOwner}]`:""}: `)||t.githubOwner||"",s=await ne(e,`GitHub Repo${t.githubRepo?` [${t.githubRepo}]`:""}: `)||t.githubRepo||"";(!i||!s)&&(console.error("\u30A8\u30E9\u30FC: GitHub Owner \u3068 Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1)),console.log(`
|
|
293
|
+
--- \u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u8A2D\u5B9A ---`);let a=await ne(e,`VPC CIDR [${t.vpcCidr??"10.2.0.0/16"}]: `)||t.vpcCidr||"10.2.0.0/16";console.log(`
|
|
294
|
+
--- \u30EA\u30BD\u30FC\u30B9\u30B5\u30A4\u30BA ---`);let c=await ne(e,`RDS \u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u30AF\u30E9\u30B9 [${t.rdsInstanceClass??"db.t4g.micro"}]: `)||t.rdsInstanceClass||"db.t4g.micro",u=await ne(e,`ECS CPU (vCPU \u5358\u4F4D) [${t.ecsCpu??256}]: `)||String(t.ecsCpu??256),p=await ne(e,`ECS \u30E1\u30E2\u30EA (MB) [${t.ecsMemory??512}]: `)||String(t.ecsMemory??512);console.log(`
|
|
295
|
+
--- \u51FA\u529B\u5148 ---`);let l=await ne(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".",d=parseInt(u,10),f=parseInt(p,10);return{provider:"aws",accountId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,rdsInstanceClass:c,ecsCpu:Number.isFinite(d)?d:256,ecsMemory:Number.isFinite(f)?f:512,outputDir:(0,F.resolve)(l)}}async function N5(e,t){console.log(`
|
|
296
|
+
--- GCP \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u8A2D\u5B9A ---`);let r=await ne(e,`GCP \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ID${t.projectId?` [${t.projectId}]`:""}: `)||t.projectId||"";r||(console.error("\u30A8\u30E9\u30FC: GCP \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ID \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1));let n=await ne(e,`GCP \u30EA\u30FC\u30B8\u30E7\u30F3 [${t.region??"asia-northeast1"}]: `)||t.region||"asia-northeast1",o=await ne(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
|
|
297
|
+
--- GitHub \u30EA\u30DD\u30B8\u30C8\u30EA ---`);let i=await ne(e,`GitHub Owner${t.githubOwner?` [${t.githubOwner}]`:""}: `)||t.githubOwner||"",s=await ne(e,`GitHub Repo${t.githubRepo?` [${t.githubRepo}]`:""}: `)||t.githubRepo||"";(!i||!s)&&(console.error("\u30A8\u30E9\u30FC: GitHub Owner \u3068 Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1)),console.log(`
|
|
298
|
+
--- \u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u8A2D\u5B9A ---`);let a=await ne(e,`VPC CIDR [${t.vpcCidr??"10.0.0.0/16"}]: `)||t.vpcCidr||"10.0.0.0/16";console.log(`
|
|
299
|
+
--- \u30EA\u30BD\u30FC\u30B9\u30B5\u30A4\u30BA ---`);let c=await ne(e,`Cloud SQL \u30C6\u30A3\u30A2 [${t.dbTier??"db-f1-micro"}]: `)||t.dbTier||"db-f1-micro",u=await ne(e,`Cloud Run CPU [${t.cpuLimit??"1"}]: `)||t.cpuLimit||"1",p=await ne(e,`Cloud Run \u30E1\u30E2\u30EA [${t.memoryLimit??"512Mi"}]: `)||t.memoryLimit||"512Mi";console.log(`
|
|
300
|
+
--- \u51FA\u529B\u5148 ---`);let l=await ne(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".";return{provider:"gcp",projectId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,dbTier:c,cpuLimit:u,memoryLimit:p,outputDir:(0,F.resolve)(l)}}async function D5(e,t){console.log(`
|
|
301
|
+
--- Azure \u30B5\u30D6\u30B9\u30AF\u30EA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A ---`);let r=await ne(e,`Azure Subscription ID${t.subscriptionId?` [${t.subscriptionId}]`:""}: `)||t.subscriptionId||"";r||(console.error("\u30A8\u30E9\u30FC: Azure Subscription ID \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1));let n=await ne(e,`Azure \u30EA\u30FC\u30B8\u30E7\u30F3 [${t.region??"japaneast"}]: `)||t.region||"japaneast",o=await ne(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
|
|
302
|
+
--- GitHub \u30EA\u30DD\u30B8\u30C8\u30EA ---`);let i=await ne(e,`GitHub Owner${t.githubOwner?` [${t.githubOwner}]`:""}: `)||t.githubOwner||"",s=await ne(e,`GitHub Repo${t.githubRepo?` [${t.githubRepo}]`:""}: `)||t.githubRepo||"";(!i||!s)&&(console.error("\u30A8\u30E9\u30FC: GitHub Owner \u3068 Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1)),console.log(`
|
|
303
|
+
--- \u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u8A2D\u5B9A ---`);let a=await ne(e,`VNet CIDR [${t.vpcCidr??"10.0.0.0/16"}]: `)||t.vpcCidr||"10.0.0.0/16";console.log(`
|
|
304
|
+
--- \u30EA\u30BD\u30FC\u30B9\u30B5\u30A4\u30BA ---`);let c=await ne(e,`PostgreSQL SKU [${t.dbSku??"B_Standard_B1ms"}]: `)||t.dbSku||"B_Standard_B1ms",u=await ne(e,`Container App CPU [${t.cpuLimit??.25}]: `)||String(t.cpuLimit??.25),p=await ne(e,`Container App \u30E1\u30E2\u30EA [${t.memoryLimit??"0.5Gi"}]: `)||t.memoryLimit||"0.5Gi";console.log(`
|
|
305
|
+
--- \u51FA\u529B\u5148 ---`);let l=await ne(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".",d=parseFloat(u);return{provider:"azure",subscriptionId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,dbSku:c,cpuLimit:Number.isFinite(d)?d:.25,memoryLimit:p,outputDir:(0,F.resolve)(l)}}async function j5(e,t){console.log(`
|
|
306
|
+
--- Vercel + Railway \u8A2D\u5B9A ---`);let r=await ne(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
|
|
307
|
+
--- GitHub \u30EA\u30DD\u30B8\u30C8\u30EA ---`);let n=await ne(e,`GitHub Owner${t.githubOwner?` [${t.githubOwner}]`:""}: `)||t.githubOwner||"",o=await ne(e,`GitHub Repo${t.githubRepo?` [${t.githubRepo}]`:""}: `)||t.githubRepo||"";(!n||!o)&&(console.error("\u30A8\u30E9\u30FC: GitHub Owner \u3068 Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1)),console.log(`
|
|
308
|
+
--- Railway \u8A2D\u5B9A ---`);let i=await ne(e,`Railway API URL${t.railwayApiUrl?` [${t.railwayApiUrl}]`:""}: `)||t.railwayApiUrl||"";i||console.log(" \u203B Railway \u30C7\u30D7\u30ED\u30A4\u5F8C\u306B URL \u304C\u767A\u884C\u3055\u308C\u307E\u3059\u3002\u5F8C\u304B\u3089 .godd-notes-infra.json \u3067\u8A2D\u5B9A\u53EF\u80FD\u3067\u3059\u3002"),console.log(`
|
|
309
|
+
--- \u51FA\u529B\u5148 ---`);let s=await ne(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".";return{provider:"vercel-railway",env:r,githubOwner:n,githubRepo:o,railwayApiUrl:i||"https://your-api.up.railway.app",outputDir:(0,F.resolve)(s)}}async function M5(e){console.log(`
|
|
308
310
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
309
311
|
\u2551 ripla Notes \u30A4\u30F3\u30D5\u30E9\u69CB\u7BC9\u30A6\u30A3\u30B6\u30FC\u30C9 \u2551
|
|
310
|
-
\u2551 Terraform + GitHub Actions \u81EA\u52D5\u751F\u6210
|
|
312
|
+
\u2551 \u30A2\u30D7\u30EA + Terraform + GitHub Actions \u81EA\u52D5\u751F\u6210 \u2551
|
|
311
313
|
\u2551 \u2551
|
|
312
314
|
\u2551 \u5BFE\u5FDC\u30D7\u30ED\u30D0\u30A4\u30C0: \u2551
|
|
313
315
|
\u2551 AWS / GCP / Azure / Vercel\xD7Railway \u2551
|
|
314
316
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
315
|
-
`);let t=
|
|
316
|
-
--- \u8A2D\u5B9A\u306E\u78BA\u8A8D ---`),console.log(` \u30D7\u30ED\u30D0\u30A4\u30C0: ${Dg[e.provider]}`),console.log(` \u74B0\u5883: ${e.env}`),console.log(` GitHub: ${e.githubOwner}/${e.githubRepo}`),e.provider){case"aws":console.log(` AWS \u30A2\u30AB\u30A6\u30F3\u30C8: ${e.accountId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` VPC CIDR: ${e.vpcCidr}`),console.log(` RDS: ${e.rdsInstanceClass}`),console.log(` ECS: ${e.ecsCpu} CPU / ${e.ecsMemory} MB`);break;case"gcp":console.log(` \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8: ${e.projectId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` Cloud SQL: ${e.dbTier}`),console.log(` Cloud Run: ${e.cpuLimit} CPU / ${e.memoryLimit}`);break;case"azure":console.log(` Subscription: ${e.subscriptionId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` PostgreSQL: ${e.dbSku}`),console.log(` Container App: ${e.cpuLimit} CPU / ${e.memoryLimit}`);break;case"vercel-railway":console.log(` Railway API: ${e.railwayApiUrl}`);break}console.log(` \u51FA\u529B\u5148: ${e.outputDir}`)}function
|
|
317
|
-
\u2713 \u8A2D\u5B9A\u3092 ${(0,
|
|
318
|
-
[1/${f}] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let k of u){let C=k.replace(".hbs",""),T=Fr((0,
|
|
319
|
-
[2/${f}] IAM Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${i}`);for(let k of c){let C=k.replace(".hbs",""),T=Fr((0,
|
|
320
|
-
[3/${f}] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${s}`);let v=(0,
|
|
321
|
-
[4/${f}] \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u751F\u6210: ${k}`);let C=Fr(l,n),T=(0,
|
|
317
|
+
`);let t=z5(process.cwd());switch(await A5(e,t?.provider)){case"aws":return O5(e,t??{});case"gcp":return N5(e,t??{});case"azure":return D5(e,t??{});case"vercel-railway":return j5(e,t??{})}}function Fr(e,t){let r;try{r=(0,V.readFileSync)(e,"utf-8")}catch(n){throw new Error(`\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30D5\u30A1\u30A4\u30EB\u304C\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: ${e} \u2014 ${Ne(n)}`,{cause:n})}try{return UT.default.compile(r,{noEscape:!0})(t)}catch(n){throw new Error(`\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u30B3\u30F3\u30D1\u30A4\u30EB/\u30EC\u30F3\u30C0\u30EA\u30F3\u30B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} \u2014 ${Ne(n)}`,{cause:n})}}function L5(e){switch(console.log(`
|
|
318
|
+
--- \u8A2D\u5B9A\u306E\u78BA\u8A8D ---`),console.log(` \u30D7\u30ED\u30D0\u30A4\u30C0: ${Dg[e.provider]}`),console.log(` \u74B0\u5883: ${e.env}`),console.log(` GitHub: ${e.githubOwner}/${e.githubRepo}`),e.provider){case"aws":console.log(` AWS \u30A2\u30AB\u30A6\u30F3\u30C8: ${e.accountId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` VPC CIDR: ${e.vpcCidr}`),console.log(` RDS: ${e.rdsInstanceClass}`),console.log(` ECS: ${e.ecsCpu} CPU / ${e.ecsMemory} MB`);break;case"gcp":console.log(` \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8: ${e.projectId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` Cloud SQL: ${e.dbTier}`),console.log(` Cloud Run: ${e.cpuLimit} CPU / ${e.memoryLimit}`);break;case"azure":console.log(` Subscription: ${e.subscriptionId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` PostgreSQL: ${e.dbSku}`),console.log(` Container App: ${e.cpuLimit} CPU / ${e.memoryLimit}`);break;case"vercel-railway":console.log(` Railway API: ${e.railwayApiUrl}`);break}console.log(` \u51FA\u529B\u5148: ${e.outputDir}`)}function Z5(e){let t=T5(e.provider);t||(console.error(`\u30A8\u30E9\u30FC: ${e.provider} \u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002`),process.exit(1));let{terraformDir:r,ghaDir:n}=t,o=e;e.provider==="aws"?q5(r,n,e,o):F5(r,n,e,o),WT(e.outputDir),R5(e),console.log(`
|
|
319
|
+
\u2713 \u8A2D\u5B9A\u3092 ${(0,F.join)(e.outputDir,jg)} \u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F`)}function q5(e,t,r,n){let o=(0,F.join)(r.outputDir,"terraform","godd-notes",r.env),i=(0,F.join)(r.outputDir,"terraform","godd-notes",`${r.env}-iam`),s=(0,F.join)(r.outputDir,".github","workflows");(0,V.mkdirSync)(o,{recursive:!0}),(0,V.mkdirSync)(i,{recursive:!0}),(0,V.mkdirSync)(s,{recursive:!0});let a=(0,V.readdirSync)(e).filter(k=>k.endsWith(".tf.hbs")),c=["iam.tf.hbs"],u=a.filter(k=>!c.includes(k)),p=(0,F.resolve)(e,"..","..","scripts","aws"),l=(0,F.join)(p,"terraform-backend-setup.sh.hbs"),d=(0,V.existsSync)(l),f=d?4:3,h=[];console.log(`
|
|
320
|
+
[1/${f}] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let k of u){let C=k.replace(".hbs",""),T=Fr((0,F.join)(e,k),n);(0,V.writeFileSync)((0,F.join)(o,C),T,"utf-8"),console.log(` \u2713 ${C}`)}console.log(`
|
|
321
|
+
[2/${f}] IAM Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${i}`);for(let k of c){let C=k.replace(".hbs",""),T=Fr((0,F.join)(e,k),n);(0,V.writeFileSync)((0,F.join)(i,C),T,"utf-8"),console.log(` \u2713 ${C}`)}let g=(0,F.join)(e,"local.tf.hbs");if((0,V.existsSync)(g)){let k=Fr(g,n);(0,V.writeFileSync)((0,F.join)(i,"local.tf"),k,"utf-8"),console.log(" \u2713 local.tf")}else console.warn(` \u26A0 local.tf.hbs \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${g}`),h.push("local.tf.hbs");let y=(0,F.join)(e,"provider.tf.hbs");if((0,V.existsSync)(y)){let k=Fr(y,n);(0,V.writeFileSync)((0,F.join)(i,"provider.tf"),k,"utf-8"),console.log(" \u2713 provider.tf")}else console.warn(` \u26A0 provider.tf.hbs \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${y}`),h.push("provider.tf.hbs");let b=(0,F.join)(e,"backend.tf.hbs");if((0,V.existsSync)(b)){let k=Fr(b,{...n,env:`${r.env}-iam`});(0,V.writeFileSync)((0,F.join)(i,"backend.tf"),k,"utf-8"),console.log(" \u2713 backend.tf")}else console.warn(` \u26A0 backend.tf.hbs \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${b}`),h.push("backend.tf.hbs");console.log(`
|
|
322
|
+
[3/${f}] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${s}`);let v=(0,V.readdirSync)(t).filter(k=>k.endsWith(".yml.hbs"));for(let k of v){let C=k.replace(".hbs",""),T=Fr((0,F.join)(t,k),n);(0,V.writeFileSync)((0,F.join)(s,C),T,"utf-8"),console.log(` \u2713 ${C}`)}if(d){let k=(0,F.join)(r.outputDir,"scripts");(0,V.mkdirSync)(k,{recursive:!0}),console.log(`
|
|
323
|
+
[4/${f}] \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u751F\u6210: ${k}`);let C=Fr(l,n),T=(0,F.join)(k,"terraform-backend-setup.sh");(0,V.writeFileSync)(T,C,"utf-8");try{(0,V.chmodSync)(T,493)}catch{}console.log(" \u2713 terraform-backend-setup.sh")}else console.warn(`
|
|
322
324
|
\u26A0 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u30B9\u30AF\u30EA\u30D7\u30C8\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: `+l),h.push("terraform-backend-setup.sh.hbs");if(h.length>0){console.warn(`
|
|
323
|
-
\u26A0 \u30B9\u30AD\u30C3\u30D7\u3055\u308C\u305F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 (${h.length} \u4EF6):`);for(let k of h)console.warn(` - ${k}`)}}function
|
|
324
|
-
[1/2] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let c of s){let u=c.replace(".hbs",""),p=Fr((0,
|
|
325
|
-
[2/2] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${i}`);let a=(0,
|
|
325
|
+
\u26A0 \u30B9\u30AD\u30C3\u30D7\u3055\u308C\u305F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 (${h.length} \u4EF6):`);for(let k of h)console.warn(` - ${k}`)}}function F5(e,t,r,n){let o=(0,F.join)(r.outputDir,"terraform","godd-notes",r.env),i=(0,F.join)(r.outputDir,".github","workflows");(0,V.mkdirSync)(o,{recursive:!0}),(0,V.mkdirSync)(i,{recursive:!0});let s=(0,V.readdirSync)(e).filter(c=>c.endsWith(".tf.hbs"));console.log(`
|
|
326
|
+
[1/2] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let c of s){let u=c.replace(".hbs",""),p=Fr((0,F.join)(e,c),n);(0,V.writeFileSync)((0,F.join)(o,u),p,"utf-8"),console.log(` \u2713 ${u}`)}console.log(`
|
|
327
|
+
[2/2] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${i}`);let a=(0,V.readdirSync)(t).filter(c=>c.endsWith(".yml.hbs"));for(let c of a){let u=c.replace(".hbs",""),p=Fr((0,F.join)(t,c),n);(0,V.writeFileSync)((0,F.join)(i,u),p,"utf-8"),console.log(` \u2713 ${u}`)}}function U5(e){switch(e.provider){case"aws":console.log(`
|
|
326
328
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
327
329
|
\u2551 AWS \u30A4\u30F3\u30D5\u30E9\u30D5\u30A1\u30A4\u30EB\u751F\u6210\u5B8C\u4E86 \u2551
|
|
328
330
|
\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
|
|
@@ -345,6 +347,9 @@ export PATH="${e}:$PATH"
|
|
|
345
347
|
\u2551 - admin-credentials \u2551
|
|
346
348
|
\u2551 - github-token (\u4EFB\u610F) \u2551
|
|
347
349
|
\u2551 \u2551
|
|
350
|
+
\u2551 5. \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u30C7\u30D7\u30ED\u30A4 \u2551
|
|
351
|
+
\u2551 godd notes deploy -y \u2551
|
|
352
|
+
\u2551 \u2551
|
|
348
353
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
349
354
|
`);break;case"gcp":console.log(`
|
|
350
355
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
@@ -409,8 +414,8 @@ export PATH="${e}:$PATH"
|
|
|
409
414
|
\u2551 terraform init && terraform apply \u2551
|
|
410
415
|
\u2551 \u2551
|
|
411
416
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
412
|
-
`);break}}async function
|
|
413
|
-
GoDD Notes Infra \u2014 \u30DE\u30EB\u30C1\u30AF\u30E9\u30A6\u30C9 \u30A4\u30F3\u30D5\u30E9\u81EA\u52D5\u751F\u6210
|
|
417
|
+
`);break}}async function B5(e){if(e.includes("--help")||e.includes("-h")){console.log(`
|
|
418
|
+
GoDD Notes Infra \u2014 \u30A2\u30D7\u30EA + \u30DE\u30EB\u30C1\u30AF\u30E9\u30A6\u30C9 \u30A4\u30F3\u30D5\u30E9\u81EA\u52D5\u751F\u6210
|
|
414
419
|
|
|
415
420
|
Usage: godd notes infra [options]
|
|
416
421
|
|
|
@@ -426,10 +431,10 @@ Usage: godd notes infra [options]
|
|
|
426
431
|
|
|
427
432
|
Options:
|
|
428
433
|
--help, -h \u3053\u306E\u30D8\u30EB\u30D7\u3092\u8868\u793A
|
|
429
|
-
`);return}let t
|
|
430
|
-
\u3053\u306E\u8A2D\u5B9A\u3067\u751F\u6210\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}
|
|
431
|
-
${Ne(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t.slice(0,200)}`)}let n=["ecr_repository_url","ecs_cluster_name","ecs_service_name","s3_bucket_name","cloudfront_distribution_id","cloudfront_domain","notes_app_url","notes_api_url"],o=n.filter(s=>!r[s]?.value);if(o.length>0)throw new Error(`Terraform output \u306B\u5FC5\u8981\u306A\u5024\u304C\u3042\u308A\u307E\u305B\u3093: ${o.join(", ")}`);let i={};for(let s of n)i[s]=r[s].value;return i}function
|
|
432
|
-
${Ne(i.error)}`);if(i.status!==0)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5931\u6557 (exit ${i.status}): ${e} ${t.join(" ")}`)}async function
|
|
434
|
+
`);return}let t=$5();try{let r=await M5(t);if(L5(r),(await ne(t,`
|
|
435
|
+
\u3053\u306E\u8A2D\u5B9A\u3067\u751F\u6210\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}Z5(r),U5(r)}finally{t.close()}}var qT,V,F,FT,UT,V5,Dg,P5,C5,E5,jg,JT=_(()=>{"use strict";qT=st(require("node:readline"),1),V=require("node:fs"),F=require("node:path"),FT=require("node:url"),UT=st(xg(),1);Ko();V5={},Dg={aws:"AWS (ECS Fargate + S3/CloudFront + RDS)",gcp:"GCP (Cloud Run + GCS + Cloud SQL)",azure:"Azure (Container Apps + Blob Storage + PostgreSQL)","vercel-railway":"Vercel \xD7 Railway (PaaS)"};P5=new Set([".git","coverage","dist","node_modules"]),C5=new Set(["playwright-report","test-results"]),E5=new Set([".pytest_cache",".ruff_cache",".venv","__pycache__"]);jg=".godd-notes-infra.json"});var cP={};Br(cP,{checkAwsPrerequisites:()=>tP,checkDocker:()=>qg,deployToAws:()=>rP,generateEnvFile:()=>nP,generateSecret:()=>wr,getTerraformOutputs:()=>Ug,loadInfraConfig:()=>Fg,parseComposeFlags:()=>sP,parseDeployFlags:()=>iP,runNotes:()=>i8});function XT(){return YT.createInterface({input:process.stdin,output:process.stdout})}function it(e,t){return new Promise(r=>{e.question(t,n=>r(n.trim()))})}function wr(e=48){return QT.randomBytes(e).toString("base64url").slice(0,e)}function qg(){try{return Ye.execSync("docker --version",{stdio:"ignore",timeout:ci}),Ye.execSync("docker compose version",{stdio:"ignore",timeout:ci}),!0}catch{return!1}}function H5(){try{return(0,ye.dirname)((0,Zg.fileURLToPath)(uP.url))}catch{return(0,ye.dirname)(process.execPath)}}function eP(){let e=H5(),t=(0,ye.resolve)(e,".."),r=(0,ye.join)(t,"notes-api"),n=(0,ye.join)(t,"notes-app"),o=(0,ye.join)(t,"templates","notes-compose.yml");return(0,de.existsSync)(r)&&(0,de.existsSync)(n)&&(0,de.existsSync)(o)?{apiDir:r,appDir:n,composeTemplate:o}:null}function Mg(e,t){(0,de.mkdirSync)(t,{recursive:!0});for(let r of(0,de.readdirSync)(e)){if(G5.has(r)||r.endsWith(".pyc")||r.endsWith(".tsbuildinfo"))continue;let n=(0,ye.join)(e,r),o=(0,ye.join)(t,r);(0,de.statSync)(n).isDirectory()?Mg(n,o):(0,de.copyFileSync)(n,o)}}function W5(e,t){return new Promise((r,n)=>{let o=Ye.spawn("docker",["compose",...t],{cwd:e,stdio:"inherit"});o.on("error",i=>n(i)),o.on("close",i=>r(i??1))})}async function K5(e,t=12e4){let r=Date.now(),n=3e3;for(;Date.now()-r<t;){if(await new Promise(i=>{let s=Lg.get(e,{timeout:3e3},a=>{a.resume(),i(a.statusCode===200)});s.on("error",()=>i(!1)),s.on("timeout",()=>{s.destroy(),i(!1)})}))return!0;await new Promise(i=>setTimeout(i,n))}return!1}function Fg(e){let t=(0,ye.join)(e,J5);if(!(0,de.existsSync)(t))return null;try{return JSON.parse((0,de.readFileSync)(t,"utf-8"))}catch{return null}}function Ug(e){if(!(0,de.existsSync)(e))throw new Error(`Terraform \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${e}`);let t;try{t=Ye.execSync("terraform output -json",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch(s){throw new Error(`terraform output \u306E\u5B9F\u884C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002terraform init && terraform apply \u3092\u5148\u306B\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
436
|
+
${Ne(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t.slice(0,200)}`)}let n=["ecr_repository_url","ecs_cluster_name","ecs_service_name","s3_bucket_name","cloudfront_distribution_id","cloudfront_domain","notes_app_url","notes_api_url"],o=n.filter(s=>!r[s]?.value);if(o.length>0)throw new Error(`Terraform output \u306B\u5FC5\u8981\u306A\u5024\u304C\u3042\u308A\u307E\u305B\u3093: ${o.join(", ")}`);let i={};for(let s of n)i[s]=r[s].value;return i}function tP(){let e=[];try{Ye.execSync("aws --version",{stdio:"pipe",timeout:ci})}catch{e.push("AWS CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://aws.amazon.com/cli/")}try{Ye.execSync("aws sts get-caller-identity",{stdio:"pipe",timeout:ci})}catch{e.push("AWS \u8A8D\u8A3C\u60C5\u5831\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002aws configure \u307E\u305F\u306F AWS SSO \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}try{Ye.execSync("docker --version",{stdio:"pipe",timeout:ci})}catch{e.push("Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002")}try{Ye.execSync("pnpm --version",{stdio:"pipe",timeout:ci})}catch{e.push("pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm")}return{ok:e.length===0,errors:e}}function co(e,t,r={}){let{cwd:n,label:o}=r;o&&console.log(` ${o}...`);let i=Ye.spawnSync(e,t,{cwd:n,stdio:"inherit"});if(i.error)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u8D77\u52D5\u5931\u6557: ${e}
|
|
437
|
+
${Ne(i.error)}`);if(i.status!==0)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5931\u6557 (exit ${i.status}): ${e} ${t.join(" ")}`)}async function rP(e,t,r){let n=t.region??"ap-northeast-1",i=`${t.accountId??""}.dkr.ecr.${n}.amazonaws.com`;console.log(`
|
|
433
438
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
434
439
|
\u2551 ripla Notes \u2014 AWS \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
|
|
435
440
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
@@ -453,7 +458,7 @@ ${Ne(i.error)}`);if(i.status!==0)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5931
|
|
|
453
458
|
\u2551 --services ${e.ecs_service_name.padEnd(32)}\u2551
|
|
454
459
|
\u2551 \u2551
|
|
455
460
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
456
|
-
`)}async function
|
|
461
|
+
`)}async function Y5(e){console.log(`
|
|
457
462
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
458
463
|
\u2551 ripla Notes \u30C7\u30D7\u30ED\u30A4\u30A6\u30A3\u30B6\u30FC\u30C9 \u2551
|
|
459
464
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
@@ -462,12 +467,12 @@ ${Ne(i.error)}`);if(i.status!==0)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5931
|
|
|
462
467
|
--- \u30DD\u30FC\u30C8\u8A2D\u5B9A ---`);let s=await it(e,"Notes API \u30DD\u30FC\u30C8 [3100]: ")||"3100",a=await it(e,"Notes App \u30DD\u30FC\u30C8 [5175]: ")||"5175";console.log(`
|
|
463
468
|
--- GitHub \u9023\u643A ---`);let c=await it(e,"GitHub Token (ghp_xxx): "),u=await it(e,"GitHub Owner (\u7D44\u7E54 or \u30E6\u30FC\u30B6\u30FC\u540D): "),p=await it(e,"GitHub Repo (\u30EA\u30DD\u30B8\u30C8\u30EA\u540D): "),l=await it(e,"GitHub Branch [main]: ")||"main";console.log(`
|
|
464
469
|
--- \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3 ---`);let d=await it(e,"JWT \u30B7\u30FC\u30AF\u30EC\u30C3\u30C8 [\u81EA\u52D5\u751F\u6210]: ")||wr(48);console.log(`
|
|
465
|
-
--- \u7BA1\u7406\u8005\u30A2\u30AB\u30A6\u30F3\u30C8 ---`);let f=await it(e,"\u7BA1\u7406\u8005\u30E6\u30FC\u30B6\u30FC\u540D [admin]: ")||"admin",h=await it(e,"\u7BA1\u7406\u8005\u30D1\u30B9\u30EF\u30FC\u30C9: ")||wr(16);return{deployDir:(0,ye.resolve)(t),postgresUser:r,postgresPassword:n,postgresDb:o,postgresPort:i,notesApiPort:s,notesAppPort:a,githubToken:c,githubOwner:u,githubRepo:p,githubBranch:l,jwtSecret:d,adminUsername:f,adminPassword:h}}function
|
|
466
|
-
`)}async function
|
|
467
|
-
[1/5] \u30C7\u30D7\u30ED\u30A4\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6E96\u5099: ${e.deployDir}`),(0,de.mkdirSync)(e.deployDir,{recursive:!0}),console.log("[2/5] notes-api \u3092\u30B3\u30D4\u30FC..."),Mg(r,(0,ye.join)(e.deployDir,"notes-api")),console.log("[3/5] notes-app \u3092\u30B3\u30D4\u30FC..."),Mg(n,(0,ye.join)(e.deployDir,"notes-app")),console.log("[4/5] docker-compose.yml \u3068 .env \u3092\u751F\u6210...");let p=(0,de.readFileSync)(o,"utf-8");(0,de.writeFileSync)((0,ye.join)(e.deployDir,"docker-compose.yml"),p,"utf-8"),(0,de.writeFileSync)((0,ye.join)(e.deployDir,".env"),
|
|
468
|
-
\u30A8\u30E9\u30FC: \u30D5\u30A1\u30A4\u30EB\u64CD\u4F5C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${l}`),console.error(`\u30C7\u30D7\u30ED\u30A4\u5148\u306E\u30D1\u30B9\u3068\u30A2\u30AF\u30BB\u30B9\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044: ${e.deployDir}`),process.exit(1)}console.log("[5/5] Docker Compose \u3067\u30B5\u30FC\u30D3\u30B9\u3092\u8D77\u52D5..."),await
|
|
470
|
+
--- \u7BA1\u7406\u8005\u30A2\u30AB\u30A6\u30F3\u30C8 ---`);let f=await it(e,"\u7BA1\u7406\u8005\u30E6\u30FC\u30B6\u30FC\u540D [admin]: ")||"admin",h=await it(e,"\u7BA1\u7406\u8005\u30D1\u30B9\u30EF\u30FC\u30C9: ")||wr(16);return{deployDir:(0,ye.resolve)(t),postgresUser:r,postgresPassword:n,postgresDb:o,postgresPort:i,notesApiPort:s,notesAppPort:a,githubToken:c,githubOwner:u,githubRepo:p,githubBranch:l,jwtSecret:d,adminUsername:f,adminPassword:h}}function nP(e){return["# ripla Notes \u74B0\u5883\u5909\u6570\uFF08\u81EA\u52D5\u751F\u6210\uFF09",`POSTGRES_USER=${e.postgresUser}`,`POSTGRES_PASSWORD=${e.postgresPassword}`,`POSTGRES_DB=${e.postgresDb}`,`POSTGRES_PORT=${e.postgresPort}`,`NOTES_API_PORT=${e.notesApiPort}`,`NOTES_APP_PORT=${e.notesAppPort}`,`GITHUB_TOKEN=${e.githubToken}`,`GITHUB_OWNER=${e.githubOwner}`,`GITHUB_REPO=${e.githubRepo}`,`GITHUB_BRANCH=${e.githubBranch}`,`JWT_SECRET=${e.jwtSecret}`,`NOTES_ADMIN_USERNAME=${e.adminUsername}`,`NOTES_ADMIN_PASSWORD=${e.adminPassword}`,""].join(`
|
|
471
|
+
`)}async function oP(e){let t=eP();t||(console.error("\u30A8\u30E9\u30FC: notes-api / notes-app \u306E\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"),console.error("npm \u30D1\u30C3\u30B1\u30FC\u30B8\u304C\u6B63\u3057\u304F\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u308B\u304B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let{apiDir:r,appDir:n,composeTemplate:o}=t;try{console.log(`
|
|
472
|
+
[1/5] \u30C7\u30D7\u30ED\u30A4\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6E96\u5099: ${e.deployDir}`),(0,de.mkdirSync)(e.deployDir,{recursive:!0}),console.log("[2/5] notes-api \u3092\u30B3\u30D4\u30FC..."),Mg(r,(0,ye.join)(e.deployDir,"notes-api")),console.log("[3/5] notes-app \u3092\u30B3\u30D4\u30FC..."),Mg(n,(0,ye.join)(e.deployDir,"notes-app")),console.log("[4/5] docker-compose.yml \u3068 .env \u3092\u751F\u6210...");let p=(0,de.readFileSync)(o,"utf-8");(0,de.writeFileSync)((0,ye.join)(e.deployDir,"docker-compose.yml"),p,"utf-8"),(0,de.writeFileSync)((0,ye.join)(e.deployDir,".env"),nP(e),"utf-8")}catch(p){let l=p instanceof Error?p.message:String(p);console.error(`
|
|
473
|
+
\u30A8\u30E9\u30FC: \u30D5\u30A1\u30A4\u30EB\u64CD\u4F5C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${l}`),console.error(`\u30C7\u30D7\u30ED\u30A4\u5148\u306E\u30D1\u30B9\u3068\u30A2\u30AF\u30BB\u30B9\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044: ${e.deployDir}`),process.exit(1)}console.log("[5/5] Docker Compose \u3067\u30B5\u30FC\u30D3\u30B9\u3092\u8D77\u52D5..."),await W5(e.deployDir,["up","-d","--build"])!==0&&(console.error(`
|
|
469
474
|
\u30A8\u30E9\u30FC: docker compose up \u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002`),console.error(`\u30ED\u30B0\u3092\u78BA\u8A8D: cd ${e.deployDir} && docker compose logs`),process.exit(1)),console.log(`
|
|
470
|
-
\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u5F85\u6A5F\u4E2D...`);let s=`http://localhost:${e.notesApiPort}/api/health`;await
|
|
475
|
+
\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u5F85\u6A5F\u4E2D...`);let s=`http://localhost:${e.notesApiPort}/api/health`;await K5(s)||(console.warn(`
|
|
471
476
|
\u8B66\u544A: \u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u304C\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u3057\u307E\u3057\u305F\u3002`),console.warn("\u30B5\u30FC\u30D3\u30B9\u306E\u8D77\u52D5\u306B\u6642\u9593\u304C\u304B\u304B\u3063\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002"),console.warn(`\u624B\u52D5\u3067\u78BA\u8A8D: curl ${s}`));let c=`http://localhost:${e.notesAppPort}`,u=`http://localhost:${e.notesApiPort}`;console.log(`
|
|
472
477
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
473
478
|
\u2551 ripla Notes \u30C7\u30D7\u30ED\u30A4\u5B8C\u4E86 \u2551
|
|
@@ -491,12 +496,12 @@ ${Ne(i.error)}`);if(i.status!==0)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5931
|
|
|
491
496
|
docker compose stop # \u505C\u6B62
|
|
492
497
|
docker compose start # \u518D\u958B
|
|
493
498
|
docker compose down -v # \u5B8C\u5168\u524A\u9664
|
|
494
|
-
`)}async function
|
|
499
|
+
`)}async function Q5(e){qg()||(console.error("\u30A8\u30E9\u30FC: Docker \u304A\u3088\u3073 Docker Compose \u304C\u5FC5\u8981\u3067\u3059\u3002"),console.error("https://docs.docker.com/get-docker/ \u304B\u3089\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let t=await Y5(e);if(console.log(`
|
|
495
500
|
--- \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---`),console.log(` \u30C7\u30D7\u30ED\u30A4\u5148: ${t.deployDir}`),console.log(` DB: ${t.postgresUser}@localhost:${t.postgresPort}/${t.postgresDb}`),console.log(` API \u30DD\u30FC\u30C8: ${t.notesApiPort}`),console.log(` App \u30DD\u30FC\u30C8: ${t.notesAppPort}`),console.log(` GitHub: ${t.githubOwner}/${t.githubRepo} (${t.githubBranch})`),console.log(` \u7BA1\u7406\u8005: ${t.adminUsername}`),(await it(e,`
|
|
496
|
-
\u3053\u306E\u8A2D\u5B9A\u3067\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}await
|
|
497
|
-
`,"utf-8")}async function
|
|
501
|
+
\u3053\u306E\u8A2D\u5B9A\u3067\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}await oP(t)}function iP(e){let t=!1;for(let r=0;r<e.length;r++)(e[r]==="--yes"||e[r]==="-y")&&(t=!0);return{yes:t}}function sP(e){let t=!1,r=null;for(let n=0;n<e.length;n++)e[n]==="--auto"?t=!0:e[n]==="--config"&&n+1<e.length&&(r=e[++n]);return{auto:t,configPath:r}}function X5(e){if(!(0,de.existsSync)(e))throw new Error(`\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${e}`);let t;try{t=JSON.parse((0,de.readFileSync)(e,"utf-8"))}catch{throw new Error(`\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08JSON \u5F62\u5F0F\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\uFF09: ${e}`)}return{deployDir:(0,ye.resolve)(t.deployDir??"./ripla-notes"),postgresUser:t.postgresUser??"app_user",postgresPassword:t.postgresPassword??wr(24),postgresDb:t.postgresDb??"ripla_notes",postgresPort:t.postgresPort??"5432",notesApiPort:t.notesApiPort??"3100",notesAppPort:t.notesAppPort??"5175",githubToken:t.githubToken??"",githubOwner:t.githubOwner??"",githubRepo:t.githubRepo??"",githubBranch:t.githubBranch??"main",jwtSecret:t.jwtSecret??wr(48),adminUsername:t.adminUsername??"admin",adminPassword:t.adminPassword??wr(16)}}function e8(){return{deployDir:(0,ye.resolve)("./ripla-notes"),postgresUser:"app_user",postgresPassword:wr(24),postgresDb:"ripla_notes",postgresPort:"5432",notesApiPort:"3100",notesAppPort:"5175",githubToken:process.env.GITHUB_TOKEN??"",githubOwner:process.env.GITHUB_OWNER??"",githubRepo:process.env.GITHUB_REPO??"",githubBranch:process.env.GITHUB_BRANCH??"main",jwtSecret:wr(48),adminUsername:"admin",adminPassword:wr(16)}}function t8(e){let{postgresPassword:t,jwtSecret:r,adminPassword:n,githubToken:o,...i}=e;(0,de.writeFileSync)(aP,JSON.stringify(i,null,2)+`
|
|
502
|
+
`,"utf-8")}async function r8(){let e=process.cwd(),t=Fg(e);console.log(`
|
|
498
503
|
--- ripla Notes \u30B9\u30C6\u30FC\u30BF\u30B9\u78BA\u8A8D ---
|
|
499
|
-
`);let r=(0,de.existsSync)((0,ye.join)(e,"ripla-notes"))?(0,ye.join)(e,"ripla-notes"):e;if((0,de.existsSync)((0,ye.join)(r,"docker-compose.yml"))){console.log("[Docker Compose]");try{Ye.spawnSync("docker",["compose","ps"],{cwd:r,stdio:"inherit"})}catch{console.log(" Docker Compose \u304C\u8D77\u52D5\u3057\u3066\u3044\u307E\u305B\u3093\u3002")}console.log()}if(t?.provider==="aws"){console.log("[AWS ECS]");let c=t.region??"ap-northeast-1";try{let u=t.env??"dev",p=(0,ye.join)(t.outputDir??e,"terraform","godd-notes",u),l=Ug(p);Ye.spawnSync("aws",["ecs","describe-services","--cluster",l.ecs_cluster_name,"--services",l.ecs_service_name,"--region",c,"--query","services[0].{status:status,running:runningCount,desired:desiredCount,deployments:length(deployments)}","--output","table"],{stdio:"inherit"})}catch(u){console.log(` ECS \u30B9\u30C6\u30FC\u30BF\u30B9\u53D6\u5F97\u306B\u5931\u6557: ${Ne(u)}`)}console.log()}let o=(0,ye.join)(e,
|
|
504
|
+
`);let r=(0,de.existsSync)((0,ye.join)(e,"ripla-notes"))?(0,ye.join)(e,"ripla-notes"):e;if((0,de.existsSync)((0,ye.join)(r,"docker-compose.yml"))){console.log("[Docker Compose]");try{Ye.spawnSync("docker",["compose","ps"],{cwd:r,stdio:"inherit"})}catch{console.log(" Docker Compose \u304C\u8D77\u52D5\u3057\u3066\u3044\u307E\u305B\u3093\u3002")}console.log()}if(t?.provider==="aws"){console.log("[AWS ECS]");let c=t.region??"ap-northeast-1";try{let u=t.env??"dev",p=(0,ye.join)(t.outputDir??e,"terraform","godd-notes",u),l=Ug(p);Ye.spawnSync("aws",["ecs","describe-services","--cluster",l.ecs_cluster_name,"--services",l.ecs_service_name,"--region",c,"--query","services[0].{status:status,running:runningCount,desired:desiredCount,deployments:length(deployments)}","--output","table"],{stdio:"inherit"})}catch(u){console.log(` ECS \u30B9\u30C6\u30FC\u30BF\u30B9\u53D6\u5F97\u306B\u5931\u6557: ${Ne(u)}`)}console.log()}let o=(0,ye.join)(e,aP),s=((0,de.existsSync)(o)?(()=>{try{return JSON.parse((0,de.readFileSync)(o,"utf-8"))}catch{return null}})():null)?.notesApiPort??"3100",a=[s,...s!=="8000"?["8000"]:[]];console.log("[\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF]");for(let c of a){let u=`http://localhost:${c}/api/health`,p=await new Promise(l=>{let d=Lg.get(u,{timeout:3e3},f=>{f.resume(),l(f.statusCode===200)});d.on("error",()=>l(!1)),d.on("timeout",()=>{d.destroy(),l(!1)})});console.log(` ${u}: ${p?"\u2713 OK":"\u2717 \u5FDC\u7B54\u306A\u3057"}`)}}function Lu(){console.log(`
|
|
500
505
|
GoDD Notes \u2014 ripla Notes \u30C7\u30D7\u30ED\u30A4\u7BA1\u7406
|
|
501
506
|
|
|
502
507
|
Usage: godd notes <command> [options]
|
|
@@ -504,7 +509,7 @@ Usage: godd notes <command> [options]
|
|
|
504
509
|
Commands:
|
|
505
510
|
compose \u30ED\u30FC\u30AB\u30EB Docker Compose \u3067\u30C7\u30D7\u30ED\u30A4
|
|
506
511
|
deploy AWS \u306B\u76F4\u63A5\u30C7\u30D7\u30ED\u30A4\uFF08ECR push \u2192 ECS \u66F4\u65B0 \u2192 S3 sync \u2192 CloudFront \u7121\u52B9\u5316\uFF09
|
|
507
|
-
infra \u30AF\u30E9\u30A6\u30C9\u30A4\u30F3\u30D5\u30E9\u3092 Terraform + GitHub Actions \u3067\u69CB\u7BC9
|
|
512
|
+
infra Notes \u30A2\u30D7\u30EA\u96DB\u5F62\u3068\u30AF\u30E9\u30A6\u30C9\u30A4\u30F3\u30D5\u30E9\u3092 Terraform + GitHub Actions \u3067\u69CB\u7BC9
|
|
508
513
|
status \u30C7\u30D7\u30ED\u30A4\u72B6\u614B\u30FB\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u3092\u78BA\u8A8D
|
|
509
514
|
|
|
510
515
|
compose \u30AA\u30D7\u30B7\u30E7\u30F3:
|
|
@@ -531,7 +536,7 @@ Examples:
|
|
|
531
536
|
godd notes compose --config config.json \u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30C7\u30D7\u30ED\u30A4
|
|
532
537
|
godd notes deploy AWS \u306B\u30C7\u30D7\u30ED\u30A4\uFF08\u5BFE\u8A71\u5F62\u5F0F\u3067\u78BA\u8A8D\uFF09
|
|
533
538
|
godd notes deploy -y \u78BA\u8A8D\u306A\u3057\u3067 AWS \u306B\u30C7\u30D7\u30ED\u30A4
|
|
534
|
-
godd notes infra Terraform + CI/CD \u30D5\u30A1\u30A4\u30EB\u751F\u6210
|
|
539
|
+
godd notes infra \u30A2\u30D7\u30EA\u96DB\u5F62 + Terraform + CI/CD \u30D5\u30A1\u30A4\u30EB\u751F\u6210
|
|
535
540
|
godd notes status \u30C7\u30D7\u30ED\u30A4\u72B6\u614B\u3092\u78BA\u8A8D
|
|
536
541
|
|
|
537
542
|
AI \u9023\u643A:
|
|
@@ -543,15 +548,15 @@ AI \u9023\u643A:
|
|
|
543
548
|
\u8A2D\u5B9A\u306E\u6C38\u7D9A\u5316:
|
|
544
549
|
infra \u30B3\u30DE\u30F3\u30C9\u306F .godd-notes-infra.json \u3092\u4FDD\u5B58\u3057\u518D\u5229\u7528\u3002
|
|
545
550
|
compose --config/--auto \u306F .godd-notes-compose.json \u3092\u4FDD\u5B58\u3057\u518D\u5229\u7528\u3002
|
|
546
|
-
`)}async function
|
|
547
|
-
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let n=
|
|
551
|
+
`)}async function n8(e,t,r){console.log(`
|
|
552
|
+
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let n=tP();if(!n.ok){console.error(`
|
|
548
553
|
\u30A8\u30E9\u30FC: AWS \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let u of n.errors)console.error(` - ${u}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
|
|
549
554
|
`);let o=e.env??"dev",i=e.outputDir??t,s=(0,ye.join)(i,"terraform","godd-notes",o);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${s})`);let a=Ug(s);console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
|
|
550
|
-
`);let c=
|
|
551
|
-
\u3053\u306E\u8A2D\u5B9A\u3067 AWS \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}}finally{u.close()}}await
|
|
555
|
+
`);let c=eP();if(c||(console.error("\u30A8\u30E9\u30FC: notes-api / notes-app \u306E\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"),process.exit(1)),console.log("--- AWS \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` ECR: ${a.ecr_repository_url}`),console.log(` ECS: ${a.ecs_cluster_name} / ${a.ecs_service_name}`),console.log(` S3: ${a.s3_bucket_name}`),console.log(` CloudFront: ${a.cloudfront_distribution_id}`),console.log(` App URL: ${a.notes_app_url}`),!r){let u=XT();try{if((await it(u,`
|
|
556
|
+
\u3053\u306E\u8A2D\u5B9A\u3067 AWS \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}}finally{u.close()}}await rP(a,e,c)}async function o8(){try{let e=(0,ye.join)((0,ye.dirname)((0,Zg.fileURLToPath)(uP.url)),"..","..","package.json");if(!(0,de.existsSync)(e))return;let t=JSON.parse((0,de.readFileSync)(e,"utf-8")),r=Ye.spawnSync("npm",["view",t.name,"dist-tags.latest","--json"],{encoding:"utf-8",timeout:5e3});if(r.status!==0||!r.stdout)return;let n=r.stdout.trim(),o=JSON.parse(n);o&&o!==t.version&&(console.log(`
|
|
552
557
|
\u26A0 @ripla/godd-mcp \u306E\u65B0\u3057\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u3042\u308A\u307E\u3059: ${o}\uFF08\u73FE\u5728: ${t.version}\uFF09`),console.log(` \u66F4\u65B0: npm install -g ${t.name}@latest
|
|
553
|
-
`))}catch{}}async function
|
|
554
|
-
--- \u975E\u5BFE\u8A71\u30E2\u30FC\u30C9: \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A ---`),console.log(` \u30C7\u30D7\u30ED\u30A4\u5148: ${n.deployDir}`),console.log(` DB: ${n.postgresUser}@localhost:${n.postgresPort}/${n.postgresDb}`),console.log(` API \u30DD\u30FC\u30C8: ${n.notesApiPort}`),console.log(` App \u30DD\u30FC\u30C8: ${n.notesAppPort}`),console.log(` GitHub: ${n.githubOwner}/${n.githubRepo} (${n.githubBranch})`),console.log(` \u7BA1\u7406\u8005: ${n.adminUsername}`),
|
|
558
|
+
`))}catch{}}async function i8(e){let t=e[0]??"help";switch(t){case"compose":{if(e.includes("--help")||e.includes("-h")){Lu();return}qg()||(console.error("\u30A8\u30E9\u30FC: Docker \u304A\u3088\u3073 Docker Compose \u304C\u5FC5\u8981\u3067\u3059\u3002"),console.error("https://docs.docker.com/get-docker/ \u304B\u3089\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let r=sP(e.slice(1));if(r.auto||r.configPath){let n=r.configPath?X5(r.configPath):e8();n.githubToken||(console.error("\u30A8\u30E9\u30FC: githubToken \u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),console.error("--config \u30D5\u30A1\u30A4\u30EB\u5185\u306B githubToken \u3092\u6307\u5B9A\u3059\u308B\u304B\u3001\u74B0\u5883\u5909\u6570 GITHUB_TOKEN \u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)),console.log(`
|
|
559
|
+
--- \u975E\u5BFE\u8A71\u30E2\u30FC\u30C9: \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A ---`),console.log(` \u30C7\u30D7\u30ED\u30A4\u5148: ${n.deployDir}`),console.log(` DB: ${n.postgresUser}@localhost:${n.postgresPort}/${n.postgresDb}`),console.log(` API \u30DD\u30FC\u30C8: ${n.notesApiPort}`),console.log(` App \u30DD\u30FC\u30C8: ${n.notesAppPort}`),console.log(` GitHub: ${n.githubOwner}/${n.githubRepo} (${n.githubBranch})`),console.log(` \u7BA1\u7406\u8005: ${n.adminUsername}`),t8(n),await oP(n)}else{let n=XT();try{await Q5(n)}finally{n.close()}}break}case"deploy":{if(e.includes("--help")||e.includes("-h")){Lu();return}await o8();let{yes:r}=iP(e),n=process.cwd(),o=Fg(n);(!o||o.provider!=="aws")&&(console.error("\u30A8\u30E9\u30FC: .godd-notes-infra.json \u304C\u898B\u3064\u304B\u3089\u306A\u3044\u304B\u3001provider \u304C aws \u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002"),console.error("\u5148\u306B godd notes infra \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)),await n8(o,n,r);break}case"infra":{let{runNotesInfra:r}=await Promise.resolve().then(()=>(JT(),KT));await r(e.slice(1));break}case"status":{await r8();break}case"help":case"--help":case"-h":Lu();break;default:console.error(`\u4E0D\u660E\u306A\u30B5\u30D6\u30B3\u30DE\u30F3\u30C9: ${t}`),Lu(),process.exit(1)}}var YT,QT,de,ye,Ye,Lg,Zg,uP,ci,G5,J5,aP,lP=_(()=>{"use strict";YT=st(require("node:readline"),1),QT=st(require("node:crypto"),1),de=require("node:fs"),ye=require("node:path"),Ye=st(require("node:child_process"),1),Lg=st(require("node:http"),1),Zg=require("node:url");Ko();uP={};ci=1e4;G5=new Set([".venv","__pycache__",".pytest_cache",".ruff_cache","node_modules",".git",".env","dist"]);J5=".godd-notes-infra.json";aP=".godd-notes-compose.json"});var qu=require("node:fs"),Ur=require("node:path"),Bg=require("node:os"),fP=require("node:url"),h8={};process.env.__GODD_CLI__="1";var s8=(0,fP.fileURLToPath)(h8.url),pP=(0,Ur.dirname)(s8);function a8(){for(let e of[(0,Ur.join)(pP,"..","package.json"),(0,Ur.join)(pP,"..","..","package.json")])try{let t=JSON.parse((0,qu.readFileSync)(e,"utf-8"));if(t.version)return t.version}catch{}return"0.0.0"}var ui=a8();function c8(){return ui.includes("-canary")?`${ui} (canary)`:ui==="0.0.0"?`${ui} (development)`:`${ui} (latest)`}function u8(){let e=process.platform==="win32"?"godd.exe":"godd",t=process.platform==="win32"?(0,Ur.join)(process.env.LOCALAPPDATA??(0,Ur.join)((0,Bg.homedir)(),"AppData","Local"),"GoDD"):(0,Ur.join)((0,Bg.homedir)(),".godd","bin");return(0,qu.existsSync)((0,Ur.join)(t,e))}var l8={i:"install",s:"server",n:"notes",v:"version",h:"help"};function p8(){return u8()?"help":"install"}var Zu=process.argv[2],d8=Zu?l8[Zu]??Zu:p8();function dP(){console.log(`
|
|
555
560
|
GoDD CLI v${ui}
|
|
556
561
|
|
|
557
562
|
Usage: godd <command>
|
|
@@ -569,9 +574,9 @@ Examples:
|
|
|
569
574
|
godd init \u73FE\u5728\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7
|
|
570
575
|
godd notes compose \u30ED\u30FC\u30AB\u30EB Docker Compose \u3067\u30C7\u30D7\u30ED\u30A4
|
|
571
576
|
godd notes deploy AWS \u306B\u30C7\u30D7\u30ED\u30A4\uFF08ECR/ECS/S3/CloudFront\uFF09
|
|
572
|
-
godd notes infra \u30AF\u30E9\u30A6\u30C9\u30A4\u30F3\u30D5\u30E9\u3092\u5BFE\u8A71\u5F62\u5F0F\u3067\u69CB\u7BC9
|
|
577
|
+
godd notes infra Notes \u30A2\u30D7\u30EA\u96DB\u5F62\u3068\u30AF\u30E9\u30A6\u30C9\u30A4\u30F3\u30D5\u30E9\u3092\u5BFE\u8A71\u5F62\u5F0F\u3067\u69CB\u7BC9
|
|
573
578
|
godd version \u30D0\u30FC\u30B8\u30E7\u30F3\u78BA\u8A8D
|
|
574
|
-
`)}async function
|
|
579
|
+
`)}async function f8(){switch(d8){case"server":{let{startServer:e}=await Promise.resolve().then(()=>(PT(),$T));await e();break}case"init":{let{runInit:e}=await Promise.resolve().then(()=>(NT(),AT));await e();break}case"install":{let{runInstall:e}=await Promise.resolve().then(()=>(ZT(),LT));await e();break}case"notes":{let{runNotes:e}=await Promise.resolve().then(()=>(lP(),cP));await e(process.argv.slice(3));break}case"version":console.log(`GoDD CLI v${c8()}`);break;case"help":dP();break;default:console.error(`\u4E0D\u660E\u306A\u30B3\u30DE\u30F3\u30C9: ${Zu}`),dP(),process.exit(1)}}f8().catch(e=>{console.error("GoDD CLI \u30A8\u30E9\u30FC:",e),process.exit(1)});
|
|
575
580
|
/*! Bundled license information:
|
|
576
581
|
|
|
577
582
|
js-yaml/dist/js-yaml.mjs:
|