@ripla/godd-mcp 1.0.8-canary.39 → 1.0.8-canary.40
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/dist/godd.cjs +236 -241
- package/dist/godd.js +113 -263
- package/dist/index.js +100 -105
- package/package.json +1 -1
package/dist/godd.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const __goddBundleUrl = require("node:url").pathToFileURL(__filename).href;
|
|
2
|
-
"use strict";var
|
|
3
|
-
`,o==="binary"){let Z=`godd-mcp-server-${s==="win32"?"win":s==="darwin"?"macos":"linux"}-${a}.zip`,
|
|
4
|
-
\u5C55\u958B\u3057\u305F\u30D5\u30A9\u30EB\u30C0\u30FC\u3067\u66F4\u65B0: ${py(o,r.channel,s)}`:v+="\u540C\u3058\u7248\u30FB\u7CFB\u5217\u306E\u30D0\u30A4\u30CA\u30EA\u914D\u5E03\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093\u3002\u73FE\u5728\u306E\u7248\u3092\u4FDD\u3061\u3001\u914D\u5E03\u5143\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}else v+=`\u66F4\u65B0${s==="win32"&&i?"\uFF08PowerShell\uFF09":""}: ${py(o,r.channel,s,i)}`}catch{v="GoDD\u306E\u66F4\u65B0\u78BA\u8A8D\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u901A\u4FE1\u3068\u914D\u5E03\u5143\u3092\u78BA\u8A8D\u3057\u3001\u5F8C\u3067\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u73FE\u5728\u306E\u51E6\u7406\u306F\u7D99\u7D9A\u3057\u307E\u3059\u3002"}u={checked:_,notice:v};let w;try{(0,Be.mkdirSync)((0,ot.dirname)(m),{recursive:!0}),w=m+`.${process.pid}.tmp`,(0,Be.writeFileSync)(w,JSON.stringify(u),{mode:384}),(0,Be.renameSync)(w,m)}catch{if(w)try{(0,Be.unlinkSync)(w)}catch{}}return v}return()=>(d??=g().finally(()=>{d=void 0}),d)}var fy,Be,ot,hy,my,gy,ls,JR,Rp=b(()=>{"use strict";fy=require("node:crypto"),Be=require("node:fs"),ot=require("node:path"),hy=require("node:os"),my=require("node:child_process"),gy=require("node:util");ei();ls="@ripla/godd-mcp",JR=3600*1e3});function S(e,t,r){function n(a,c){var l;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(l=a._zod).traits??(l.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 l=r?.Parent?new i:this;n(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let p of l._zod.deferred)p();return l}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 Nt(e){return e&&Object.assign(lc,e),lc}var uc,_y,tn,lc,ti=b(()=>{uc=Object.freeze({status:"aborted"});_y=Symbol("zod_brand"),tn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},lc={}});var pe={};Xt(pe,{BIGINT_FORMAT_RANGES:()=>vy,Class:()=>Ip,NUMBER_FORMAT_RANGES:()=>Lp,aborted:()=>co,allowsEval:()=>Np,assert:()=>oA,assertEqual:()=>eA,assertIs:()=>rA,assertNever:()=>nA,assertNotEqual:()=>tA,assignProp:()=>Op,cached:()=>ds,captureStackTrace:()=>dc,cleanEnum:()=>_A,cleanRegex:()=>hs,clone:()=>er,createTransparentProxy:()=>uA,defineLazy:()=>ke,esc:()=>ao,escapeRegex:()=>En,extend:()=>fA,finalizeIssue:()=>_r,floatSafeRemainder:()=>Dp,getElementAtPath:()=>iA,getEnumValues:()=>ps,getLengthableOrigin:()=>ms,getParsedType:()=>lA,getSizableOrigin:()=>wy,isObject:()=>ri,isPlainObject:()=>ni,issue:()=>Zp,joinValues:()=>pc,jsonStringifyReplacer:()=>zp,merge:()=>hA,normalizeParams:()=>j,nullish:()=>fs,numKeys:()=>cA,omit:()=>dA,optionalKeys:()=>Mp,partial:()=>mA,pick:()=>pA,prefixIssues:()=>Or,primitiveTypes:()=>yy,promiseAllObject:()=>sA,propertyKeyTypes:()=>jp,randomString:()=>aA,required:()=>gA,stringifyPrimitive:()=>fc,unwrapMessage:()=>us});function eA(e){return e}function tA(e){return e}function rA(e){}function nA(e){throw new Error}function oA(e){}function ps(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 pc(e,t="|"){return e.map(r=>fc(r)).join(t)}function zp(e,t){return typeof t=="bigint"?t.toString():t}function ds(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function fs(e){return e==null}function hs(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Dp(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 ke(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 Op(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function iA(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function sA(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 aA(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function ao(e){return JSON.stringify(e)}function ri(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ni(e){if(ri(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(ri(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function cA(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function En(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function er(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function j(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 uA(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 fc(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Mp(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function pA(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 er(e,{...e._zod.def,shape:r,checks:[]})}function dA(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 er(e,{...e._zod.def,shape:r,checks:[]})}function fA(e,t){if(!ni(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 Op(this,"shape",n),n},checks:[]};return er(e,r)}function hA(e,t){return er(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Op(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function mA(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 er(t,{...t._zod.def,shape:o,checks:[]})}function gA(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 er(t,{...t._zod.def,shape:o,checks:[]})}function co(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Or(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function us(e){return typeof e=="string"?e:e?.message}function _r(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=us(e.inst?._zod.def?.error?.(e))??us(t?.error?.(e))??us(r.customError?.(e))??us(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function wy(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ms(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Zp(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function _A(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var dc,Np,lA,jp,yy,Lp,vy,Ip,Nr=b(()=>{dc=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};Np=ds(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});lA=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}`)}},jp=new Set(["string","number","symbol"]),yy=new Set(["string","number","bigint","boolean","symbol","undefined"]);Lp={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]},vy={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Ip=class{constructor(...t){}}});function mc(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 gc(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 l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return o(e),n}var by,hc,Up,qp=b(()=>{ti();Nr();by=(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,zp,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},hc=S("$ZodError",by),Up=S("$ZodError",by,{Parent:Error})});var xy,ky,Fp,gs,Gp,_c,Vp=b(()=>{ti();qp();Nr();xy=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 tn;if(s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>_r(c,i,Nt())));throw dc(a,o?.callee),a}return s.value},ky=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=>_r(c,i,Nt())));throw dc(a,o?.callee),a}return s.value},Fp=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 tn;return i.issues.length?{success:!1,error:new(e??hc)(i.issues.map(s=>_r(s,o,Nt())))}:{success:!0,data:i.value}},gs=Fp(Up),Gp=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=>_r(s,o,Nt())))}:{success:!0,data:i.value}},_c=Gp(Up)});function zy(){return new RegExp(vA,"u")}function Fy(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 Gy(e){return new RegExp(`^${Fy(e)}$`)}function Vy(e){let t=Fy({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(`^${Uy}T(?:${n})$`)}var Sy,$y,Py,Ey,Cy,Ty,Ry,Ay,Bp,Iy,vA,Dy,Oy,Ny,jy,My,Hp,Ly,Zy,Uy,qy,By,Hy,Ky,Wy,Jy,Yy,Qy,Xy,yc=b(()=>{Sy=/^[cC][^\s-]{8,}$/,$y=/^[0-9a-z]+$/,Py=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ey=/^[0-9a-vA-V]{20}$/,Cy=/^[A-Za-z0-9]{27}$/,Ty=/^[a-zA-Z0-9_-]{21}$/,Ry=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ay=/^([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})$/,Bp=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)$/,Iy=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,vA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Dy=/^(?:(?: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])$/,Oy=/^(([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})$/,Ny=/^((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])$/,jy=/^(([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])$/,My=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hp=/^[A-Za-z0-9_-]*$/,Ly=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Zy=/^\+(?:[0-9]){6,14}[0-9]$/,Uy="(?:(?:\\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])))",qy=new RegExp(`^${Uy}$`);By=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Hy=/^\d+n?$/,Ky=/^\d+$/,Wy=/^-?\d+(?:\.\d+)?/i,Jy=/true|false/i,Yy=/null/i,Qy=/^[^A-Z]*$/,Xy=/^[^a-z]*$/});var gt,ev,Kp,Wp,tv,rv,nv,ov,iv,ys,sv,av,cv,lv,uv,pv,dv,vc=b(()=>{ti();yc();Nr();gt=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ev={number:"number",bigint:"bigint",object:"date"},Kp=S("$ZodCheckLessThan",(e,t)=>{gt.init(e,t);let r=ev[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})}}),Wp=S("$ZodCheckGreaterThan",(e,t)=>{gt.init(e,t);let r=ev[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})}}),tv=S("$ZodCheckMultipleOf",(e,t)=>{gt.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):Dp(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})}}),rv=S("$ZodCheckNumberFormat",(e,t)=>{gt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Lp[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=Ky)}),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})}}),nv=S("$ZodCheckMaxLength",(e,t)=>{var r;gt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!fs(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=ms(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ov=S("$ZodCheckMinLength",(e,t)=>{var r;gt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!fs(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=ms(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),iv=S("$ZodCheckLengthEquals",(e,t)=>{var r;gt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!fs(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=ms(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})}}),ys=S("$ZodCheckStringFormat",(e,t)=>{var r,n;gt.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=()=>{})}),sv=S("$ZodCheckRegex",(e,t)=>{ys.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})}}),av=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Qy),ys.init(e,t)}),cv=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Xy),ys.init(e,t)}),lv=S("$ZodCheckIncludes",(e,t)=>{gt.init(e,t);let r=En(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})}}),uv=S("$ZodCheckStartsWith",(e,t)=>{gt.init(e,t);let r=new RegExp(`^${En(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})}}),pv=S("$ZodCheckEndsWith",(e,t)=>{gt.init(e,t);let r=new RegExp(`.*${En(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})}}),dv=S("$ZodCheckOverwrite",(e,t)=>{gt.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var wc,Jp=b(()=>{wc=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
|
+
"use strict";var MA=Object.create;var Tp=Object.defineProperty;var LA=Object.getOwnPropertyDescriptor;var ZA=Object.getOwnPropertyNames;var UA=Object.getPrototypeOf,qA=Object.prototype.hasOwnProperty;var b=(e,t)=>()=>(e&&(t=e(e=0)),t);var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Xt=(e,t)=>{for(var r in t)Tp(e,r,{get:t[r],enumerable:!0})},FA=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ZA(t))!qA.call(e,o)&&o!==r&&Tp(e,o,{get:()=>t[o],enumerable:!(n=LA(t,o))||n.enumerable});return e};var ht=(e,t,r)=>(r=e!=null?MA(UA(e)):{},FA(t||!e||!e.__esModule?Tp(r,"default",{value:e,enumerable:!0}):r,e));function Xr(){return"1.0.8-canary.40"}function mr(e){let t=Ap.exec(e);if(!(!t||t[0]!==e)&&!t[4]?.split(".").some(r=>/^\d+$/.test(r)&&r.length>1&&r.startsWith("0")))return{version:e,channel:t[4]?.split(".")[0]??"latest"}}function p_(e,t){if(!mr(e)||!mr(t))throw new Error("Invalid release version");let r=Ap.exec(e),n=Ap.exec(t);for(let s of[1,2,3]){let a=BigInt(r[s])-BigInt(n[s]);if(a!==0n)return a<0n?-1:1}if(!r[4]||!n[4])return r[4]===n[4]?0:r[4]?-1:1;let o=r[4].split("."),i=n[4].split(".");for(let s=0;s<Math.min(o.length,i.length);s++){if(o[s]===i[s])continue;let a=/^\d+$/.test(o[s]),c=/^\d+$/.test(i[s]);return a&&c?BigInt(o[s])<BigInt(i[s])?-1:1:a!==c?a?-1:1:o[s]<i[s]?-1:1}return Math.sign(o.length-i.length)}var u_,as,l_,Ap,Xo=b(()=>{"use strict";u_=require("node:fs"),as=require("node:path"),l_=require("node:url");Ap=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/});function sc(e){try{return(0,Ve.realpathSync)(e).replaceAll("\\","/")}catch{return e.replaceAll("\\","/")}}function VA(e=process.argv[1]??"",t="pkg"in process,r={}){if(t)return"binary";let n=sc(e),o=r.platform??process.platform,i=r.env??process.env,s=p=>o==="win32"?p.toLowerCase().replaceAll("\\","/").replace(/\/+$/,""):p.replace(/\/+$/,"");if(!n.toLowerCase().includes("/node_modules/@ripla/godd-mcp/"))return"source";if(/\/pnpm(?:-cache)?\/dlx\//i.test(n))return"pnpm-dlx";if(/(?:^|\/)bunx-[^/]+\//i.test(n))return"bunx";if(/\/pnpm\/global\//i.test(n)||i.PNPM_HOME&&s(n).startsWith(s(sc(i.PNPM_HOME))+"/global/"))return"pnpm-global";if(/\/yarn\/(?:data\/)?global\//i.test(n))return"yarn-global";if(n.includes("/_npx/"))return"npx";let a=n.indexOf("/node_modules/");if(a<0)return"source";let c=n.slice(0,a),u=i.npm_config_prefix??i.NPM_CONFIG_PREFIX??(o==="win32"?i.APPDATA?i.APPDATA+"/npm":"":(0,ot.dirname)((0,ot.dirname)(r.execPath??process.execPath)));if(u&&s(c)===s(sc(u)+(o==="win32"?"":"/lib")))return"npm-global";try{let p=JSON.parse((0,Ve.readFileSync)((0,ot.join)(c,"package.json"),"utf8")),l=p&&typeof p=="object"?p:{};if([l.dependencies,l.devDependencies].some(d=>d&&typeof d=="object"&&cs in d)){let d=[];return(0,Ve.existsSync)((0,ot.join)(c,"pnpm-lock.yaml"))&&d.push("pnpm-project"),(0,Ve.existsSync)((0,ot.join)(c,"yarn.lock"))&&d.push("yarn-project"),((0,Ve.existsSync)((0,ot.join)(c,"package-lock.json"))||(0,Ve.existsSync)((0,ot.join)(c,"npm-shrinkwrap.json")))&&d.push("npm-project"),d.length===1?d[0]:"unknown"}}catch{}return"unknown"}function d_(e,t,r=process.platform,n){if(!/^[a-z][a-z0-9-]*$/.test(t))throw new Error("Invalid release channel");let o=`${cs}@${t}`,i=n?"'"+n.replace(/'/g,r==="win32"?"''":"'\\''")+"'":void 0;switch(e){case"npm-global":return`npm install --global ${o}`;case"npm-project":return`npm ${i?`--prefix ${i} `:""}install ${o}`;case"pnpm-global":return`pnpm add --global ${o}`;case"pnpm-project":return`pnpm ${i?`--dir ${i} `:""}add ${o}`;case"yarn-project":return`yarn ${i?`--cwd ${i} `:""}add ${o}`;case"yarn-global":return`yarn global add ${o}`;case"npx":return`npx --yes ${o} version`;case"pnpm-dlx":return`pnpm dlx ${o} version`;case"bunx":return`bunx ${o} version`;case"binary":return r==="win32"?".\\godd.exe install":"./godd install";case"source":return"\u30BD\u30FC\u30B9\u3092\u53D6\u5F97\u3057\u305F\u65B9\u6CD5\u3067\u540C\u3058\u7CFB\u5217\u3092\u66F4\u65B0\u3057\u3066\u304F\u3060\u3055\u3044\u3002";case"unknown":return"\u5C0E\u5165\u65B9\u6CD5\u3068\u5C0E\u5165\u5148\u3092\u78BA\u8A8D\u3057\u3001\u540C\u3058\u7CFB\u5217\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u66F4\u65B0\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}async function f_(e){let t=await e(`https://registry.npmjs.org/-/package/${cs}/dist-tags`,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/json"}});if(!t.ok)throw new Error("Package registry unavailable");return t.json()}function BA(e){return e.split(";").map(t=>t.trim().replace(/^"(.*)"$/,"$1")).filter(t=>ot.win32.isAbsolute(t)&&(/^[A-Za-z]:[\\/]/.test(t)||/^\\\\[^\\]/.test(t)))}async function HA(e){let t="npm",r=[];if(process.platform==="win32"){let n=BA(process.env.PATH??""),o="pkg"in process?n.map(s=>(0,ot.join)(s,"node.exe")).find(Ve.existsSync):process.execPath,i=[...o?[(0,ot.dirname)(o)]:[],...n].map(s=>(0,ot.join)(s,"node_modules","npm","bin","npm-cli.js")).find(Ve.existsSync);if(!o||!i)return f_(e);t=o,r=[i]}try{let{stdout:n}=await(0,y_.promisify)(g_.execFile)(t,[...r,"view",cs,"dist-tags","--json"],{timeout:5e3,maxBuffer:65536,windowsHide:!0});return JSON.parse(n)}catch(n){if(!(n&&typeof n=="object"&&"code"in n&&n.code==="ENOENT"))throw n;return f_(e)}}function ac(e={}){let t=e.version??Xr(),r=mr(t),n=sc(e.entry??process.argv[1]??""),o=e.kind??VA(n),i=e.projectRoot??(o.endsWith("-project")?n.split("/node_modules/")[0]:void 0),s=e.platform??process.platform,a=e.arch??process.arch,c=e.directory??(0,ot.join)((0,m_.homedir)(),".cache","godd","updates"),u=e.now??Date.now,p=e.fetcher??fetch,l,d,f=(0,h_.createHash)("sha256").update(`${t}/${o}/${s}/${a}/${i??""}`).digest("hex"),h=(0,ot.join)(c,f+".json");async function g(){if(!r||t==="0.0.0"||o==="source")return"";let y=u();if(!l)try{let x=JSON.parse((0,Ve.readFileSync)(h,"utf8"));x&&typeof x=="object"&&"checked"in x&&typeof x.checked=="number"&&Number.isFinite(x.checked)&&"notice"in x&&typeof x.notice=="string"&&x.notice.length<2e3&&!/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/.test(x.notice)&&(l={checked:x.checked,notice:x.notice})}catch{}if(l&&l.checked<=y&&y-l.checked<GA)return l.notice;let v="";try{let x=e.fetcher?await p(`https://registry.npmjs.org/-/package/${cs}/dist-tags`,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/json"}}):void 0;if(x&&!x.ok)throw new Error("Package registry unavailable");let k=x?await x.json():await HA(p);if(!k||typeof k!="object")throw new Error("Invalid package tags");let P=k[r.channel];if(P!==void 0&&(typeof P!="string"||mr(P)?.channel!==r.channel))throw new Error("The published tag points at another release series");if(typeof P=="string"&&p_(P,t)>0)if(v=`GoDD\u306E\u66F4\u65B0: ${t} \u2192 ${P}\uFF08${r.channel}\uFF09
|
|
3
|
+
`,o==="binary"){let Z=`godd-mcp-server-${s==="win32"?"win":s==="darwin"?"macos":"linux"}-${a}.zip`,qe=await p(`https://api.github.com/repos/ripla-inc/GoDD/releases/tags/v${P}`,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/vnd.github+json"}}),ve=qe.ok?await qe.json():void 0,Fe=(ve&&typeof ve=="object"&&"assets"in ve&&Array.isArray(ve.assets)?ve.assets:[]).find(Ge=>Ge&&typeof Ge=="object"&&"name"in Ge&&Ge.name===Z);Fe&&typeof Fe=="object"&&"browser_download_url"in Fe&&typeof Fe.browser_download_url=="string"&&Fe.browser_download_url.startsWith(`https://github.com/ripla-inc/GoDD/releases/download/v${P}/`)?v+=`\u53D6\u5F97: ${Fe.browser_download_url}
|
|
4
|
+
\u5C55\u958B\u3057\u305F\u30D5\u30A9\u30EB\u30C0\u30FC\u3067\u66F4\u65B0: ${d_(o,r.channel,s)}`:v+="\u540C\u3058\u7248\u30FB\u7CFB\u5217\u306E\u30D0\u30A4\u30CA\u30EA\u914D\u5E03\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093\u3002\u73FE\u5728\u306E\u7248\u3092\u4FDD\u3061\u3001\u914D\u5E03\u5143\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}else v+=`\u66F4\u65B0${s==="win32"&&i?"\uFF08PowerShell\uFF09":""}: ${d_(o,r.channel,s,i)}`}catch{v="GoDD\u306E\u66F4\u65B0\u78BA\u8A8D\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u901A\u4FE1\u3068\u914D\u5E03\u5143\u3092\u78BA\u8A8D\u3057\u3001\u5F8C\u3067\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u73FE\u5728\u306E\u51E6\u7406\u306F\u7D99\u7D9A\u3057\u307E\u3059\u3002"}l={checked:y,notice:v};let w;try{(0,Ve.mkdirSync)((0,ot.dirname)(h),{recursive:!0}),w=h+`.${process.pid}.tmp`,(0,Ve.writeFileSync)(w,JSON.stringify(l),{mode:384}),(0,Ve.renameSync)(w,h)}catch{if(w)try{(0,Ve.unlinkSync)(w)}catch{}}return v}return()=>(d??=g().finally(()=>{d=void 0}),d)}var h_,Ve,ot,m_,g_,y_,cs,GA,Rp=b(()=>{"use strict";h_=require("node:crypto"),Ve=require("node:fs"),ot=require("node:path"),m_=require("node:os"),g_=require("node:child_process"),y_=require("node:util");Xo();cs="@ripla/godd-mcp",GA=3600*1e3});function S(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 Nt(e){return e&&Object.assign(cc,e),cc}var uc,__,en,cc,ei=b(()=>{uc=Object.freeze({status:"aborted"});__=Symbol("zod_brand"),en=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},cc={}});var pe={};Xt(pe,{BIGINT_FORMAT_RANGES:()=>w_,Class:()=>zp,NUMBER_FORMAT_RANGES:()=>Zp,aborted:()=>ao,allowsEval:()=>jp,assert:()=>QA,assertEqual:()=>WA,assertIs:()=>JA,assertNever:()=>YA,assertNotEqual:()=>KA,assignProp:()=>Np,cached:()=>ps,captureStackTrace:()=>pc,cleanEnum:()=>pR,cleanRegex:()=>fs,clone:()=>er,createTransparentProxy:()=>oR,defineLazy:()=>ke,esc:()=>so,escapeRegex:()=>Pn,extend:()=>aR,finalizeIssue:()=>gr,floatSafeRemainder:()=>Op,getElementAtPath:()=>XA,getEnumValues:()=>ls,getLengthableOrigin:()=>hs,getParsedType:()=>nR,getSizableOrigin:()=>b_,isObject:()=>ti,isPlainObject:()=>ri,issue:()=>Up,joinValues:()=>lc,jsonStringifyReplacer:()=>Dp,merge:()=>cR,normalizeParams:()=>j,nullish:()=>ds,numKeys:()=>rR,omit:()=>sR,optionalKeys:()=>Lp,partial:()=>uR,pick:()=>iR,prefixIssues:()=>Dr,primitiveTypes:()=>v_,promiseAllObject:()=>eR,propertyKeyTypes:()=>Mp,randomString:()=>tR,required:()=>lR,stringifyPrimitive:()=>dc,unwrapMessage:()=>us});function WA(e){return e}function KA(e){return e}function JA(e){}function YA(e){throw new Error}function QA(e){}function ls(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 lc(e,t="|"){return e.map(r=>dc(r)).join(t)}function Dp(e,t){return typeof t=="bigint"?t.toString():t}function ps(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function ds(e){return e==null}function fs(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Op(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 ke(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 Np(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function XA(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function eR(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 tR(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function so(e){return JSON.stringify(e)}function ti(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ri(e){if(ti(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(ti(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function rR(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function Pn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function er(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function j(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 oR(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 dc(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Lp(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function iR(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 er(e,{...e._zod.def,shape:r,checks:[]})}function sR(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 er(e,{...e._zod.def,shape:r,checks:[]})}function aR(e,t){if(!ri(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 Np(this,"shape",n),n},checks:[]};return er(e,r)}function cR(e,t){return er(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Np(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function uR(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 er(t,{...t._zod.def,shape:o,checks:[]})}function lR(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 er(t,{...t._zod.def,shape:o,checks:[]})}function ao(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Dr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function us(e){return typeof e=="string"?e:e?.message}function gr(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=us(e.inst?._zod.def?.error?.(e))??us(t?.error?.(e))??us(r.customError?.(e))??us(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function b_(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function hs(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Up(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function pR(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var pc,jp,nR,Mp,v_,Zp,w_,zp,Or=b(()=>{pc=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};jp=ps(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});nR=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}`)}},Mp=new Set(["string","number","symbol"]),v_=new Set(["string","number","bigint","boolean","symbol","undefined"]);Zp={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]},w_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};zp=class{constructor(...t){}}});function hc(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 mc(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 x_,fc,qp,Fp=b(()=>{ei();Or();x_=(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,Dp,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},fc=S("$ZodError",x_),qp=S("$ZodError",x_,{Parent:Error})});var k_,S_,Gp,ms,Vp,gc,Bp=b(()=>{ei();Fp();Or();k_=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 en;if(s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>gr(c,i,Nt())));throw pc(a,o?.callee),a}return s.value},S_=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=>gr(c,i,Nt())));throw pc(a,o?.callee),a}return s.value},Gp=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 en;return i.issues.length?{success:!1,error:new(e??fc)(i.issues.map(s=>gr(s,o,Nt())))}:{success:!0,data:i.value}},ms=Gp(qp),Vp=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=>gr(s,o,Nt())))}:{success:!0,data:i.value}},gc=Vp(qp)});function D_(){return new RegExp(fR,"u")}function G_(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 V_(e){return new RegExp(`^${G_(e)}$`)}function B_(e){let t=G_({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(`^${q_}T(?:${n})$`)}var $_,P_,E_,C_,T_,A_,R_,I_,Hp,z_,fR,O_,N_,j_,M_,L_,Wp,Z_,U_,q_,F_,H_,W_,K_,J_,Y_,Q_,X_,ev,yc=b(()=>{$_=/^[cC][^\s-]{8,}$/,P_=/^[0-9a-z]+$/,E_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,C_=/^[0-9a-vA-V]{20}$/,T_=/^[A-Za-z0-9]{27}$/,A_=/^[a-zA-Z0-9_-]{21}$/,R_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,I_=/^([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})$/,Hp=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)$/,z_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";O_=/^(?:(?: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])$/,N_=/^(([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})$/,j_=/^((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])$/,M_=/^(([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])$/,L_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wp=/^[A-Za-z0-9_-]*$/,Z_=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,U_=/^\+(?:[0-9]){6,14}[0-9]$/,q_="(?:(?:\\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])))",F_=new RegExp(`^${q_}$`);H_=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},W_=/^\d+n?$/,K_=/^\d+$/,J_=/^-?\d+(?:\.\d+)?/i,Y_=/true|false/i,Q_=/null/i,X_=/^[^A-Z]*$/,ev=/^[^a-z]*$/});var mt,tv,Kp,Jp,rv,nv,ov,iv,sv,ys,av,cv,uv,lv,pv,dv,fv,_c=b(()=>{ei();yc();Or();mt=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tv={number:"number",bigint:"bigint",object:"date"},Kp=S("$ZodCheckLessThan",(e,t)=>{mt.init(e,t);let r=tv[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})}}),Jp=S("$ZodCheckGreaterThan",(e,t)=>{mt.init(e,t);let r=tv[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})}}),rv=S("$ZodCheckMultipleOf",(e,t)=>{mt.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):Op(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})}}),nv=S("$ZodCheckNumberFormat",(e,t)=>{mt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Zp[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=K_)}),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})}}),ov=S("$ZodCheckMaxLength",(e,t)=>{var r;mt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ds(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=hs(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),iv=S("$ZodCheckMinLength",(e,t)=>{var r;mt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ds(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=hs(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),sv=S("$ZodCheckLengthEquals",(e,t)=>{var r;mt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ds(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=hs(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})}}),ys=S("$ZodCheckStringFormat",(e,t)=>{var r,n;mt.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=()=>{})}),av=S("$ZodCheckRegex",(e,t)=>{ys.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})}}),cv=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=X_),ys.init(e,t)}),uv=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ev),ys.init(e,t)}),lv=S("$ZodCheckIncludes",(e,t)=>{mt.init(e,t);let r=Pn(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})}}),pv=S("$ZodCheckStartsWith",(e,t)=>{mt.init(e,t);let r=new RegExp(`^${Pn(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})}}),dv=S("$ZodCheckEndsWith",(e,t)=>{mt.init(e,t);let r=new RegExp(`.*${Pn(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})}}),fv=S("$ZodCheckOverwrite",(e,t)=>{mt.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var vc,Yp=b(()=>{vc=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(`
|
|
5
5
|
`).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(`
|
|
6
|
-
`))}}});var hv,Yp=b(()=>{hv={major:4,minor:0,patch:0}});function Fv(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function wA(e){if(!Hp.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Fv(r)}function bA(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 mv(e,t,r){e.issues.length&&t.issues.push(...Or(r,e.issues)),t.value[r]=e.value}function bc(e,t,r){e.issues.length&&t.issues.push(...Or(r,e.issues)),t.value[r]=e.value}function gv(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(...Or(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function _v(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=>_r(i,n,Nt())))}),t}function Qp(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(ni(e)&&ni(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=Qp(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=Qp(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 yv(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),co(e))return e;let n=Qp(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 vv(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function wv(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 bv(e,t,r){return co(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}function xv(e){return e.value=Object.freeze(e.value),e}function kv(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(Zp(o))}}var me,xc,Ee,Sv,$v,Pv,Ev,Cv,Tv,Rv,Av,Iv,zv,Dv,Ov,Nv,jv,Mv,Lv,Zv,Uv,qv,Gv,Vv,Bv,Hv,Xp,Kv,Wv,Jv,Yv,Qv,Xv,ew,tw,rw,nw,ed,ow,iw,sw,aw,cw,lw,uw,pw,dw,fw,hw,mw,gw,_w,yw,vw=b(()=>{vc();ti();Jp();Vp();yc();Nr();Yp();Nr();me=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=hv;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=co(i),l;for(let p of s){if(p._zod.def.when){if(!p._zod.def.when(i))continue}else if(c)continue;let u=i.issues.length,d=p._zod.check(i);if(d instanceof Promise&&a?.async===!1)throw new tn;if(l||d instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await d,i.issues.length!==u&&(c||(c=co(i,u)))});else{if(i.issues.length===u)continue;c||(c=co(i,u))}}return l?l.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 tn;return a.then(c=>o(c,n,s))}return o(a,n,s)}}e["~standard"]={validate:o=>{try{let i=gs(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return _c(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),xc=S("$ZodString",(e,t)=>{me.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??By(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}}),Ee=S("$ZodStringFormat",(e,t)=>{ys.init(e,t),xc.init(e,t)}),Sv=S("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ay),Ee.init(e,t)}),$v=S("$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=Bp(n))}else t.pattern??(t.pattern=Bp());Ee.init(e,t)}),Pv=S("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Iy),Ee.init(e,t)}),Ev=S("$ZodURL",(e,t)=>{Ee.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:Ly.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})}}}),Cv=S("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=zy()),Ee.init(e,t)}),Tv=S("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ty),Ee.init(e,t)}),Rv=S("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Sy),Ee.init(e,t)}),Av=S("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=$y),Ee.init(e,t)}),Iv=S("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Py),Ee.init(e,t)}),zv=S("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ey),Ee.init(e,t)}),Dv=S("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Cy),Ee.init(e,t)}),Ov=S("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Vy(t)),Ee.init(e,t)}),Nv=S("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=qy),Ee.init(e,t)}),jv=S("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Gy(t)),Ee.init(e,t)}),Mv=S("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ry),Ee.init(e,t)}),Lv=S("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Dy),Ee.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Zv=S("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Oy),Ee.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})}}}),Uv=S("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ny),Ee.init(e,t)}),qv=S("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=jy),Ee.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})}}});Gv=S("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=My),Ee.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Fv(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});Vv=S("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Hp),Ee.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{wA(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Bv=S("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Zy),Ee.init(e,t)});Hv=S("$ZodJWT",(e,t)=>{Ee.init(e,t),e._zod.check=r=>{bA(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Xp=S("$ZodNumber",(e,t)=>{me.init(e,t),e._zod.pattern=e._zod.bag.pattern??Wy,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}}),Kv=S("$ZodNumber",(e,t)=>{rv.init(e,t),Xp.init(e,t)}),Wv=S("$ZodBoolean",(e,t)=>{me.init(e,t),e._zod.pattern=Jy,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}}),Jv=S("$ZodBigInt",(e,t)=>{me.init(e,t),e._zod.pattern=Hy,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Yv=S("$ZodNull",(e,t)=>{me.init(e,t),e._zod.pattern=Yy,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}}),Qv=S("$ZodAny",(e,t)=>{me.init(e,t),e._zod.parse=r=>r}),Xv=S("$ZodUnknown",(e,t)=>{me.init(e,t),e._zod.parse=r=>r}),ew=S("$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)}),tw=S("$ZodDate",(e,t)=>{me.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});rw=S("$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(l=>mv(l,r,s))):mv(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});nw=S("$ZodObject",(e,t)=>{me.init(e,t);let r=ds(()=>{let u=Object.keys(t.shape);for(let h of u)if(!(t.shape[h]instanceof me))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);let d=Mp(t.shape);return{shape:t.shape,keys:u,keySet:new Set(u),numKeys:u.length,optionalKeys:new Set(d)}});ke(e._zod,"propValues",()=>{let u=t.shape,d={};for(let h in u){let m=u[h]._zod;if(m.values){d[h]??(d[h]=new Set);for(let g of m.values)d[h].add(g)}}return d});let n=u=>{let d=new wc(["shape","payload","ctx"]),h=r.value,m=w=>{let x=ao(w);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};d.write("const input = payload.value;");let g=Object.create(null),_=0;for(let w of h.keys)g[w]=`key_${_++}`;d.write("const newResult = {}");for(let w of h.keys)if(h.optionalKeys.has(w)){let x=g[w];d.write(`const ${x} = ${m(w)};`);let k=ao(w);d.write(`
|
|
6
|
+
`))}}});var mv,Qp=b(()=>{mv={major:4,minor:0,patch:0}});function Gv(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function hR(e){if(!Wp.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Gv(r)}function mR(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 gv(e,t,r){e.issues.length&&t.issues.push(...Dr(r,e.issues)),t.value[r]=e.value}function wc(e,t,r){e.issues.length&&t.issues.push(...Dr(r,e.issues)),t.value[r]=e.value}function yv(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(...Dr(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function _v(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=>gr(i,n,Nt())))}),t}function Xp(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(ri(e)&&ri(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=Xp(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=Xp(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 vv(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),ao(e))return e;let n=Xp(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 wv(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function bv(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 xv(e,t,r){return ao(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}function kv(e){return e.value=Object.freeze(e.value),e}function Sv(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(Up(o))}}var he,bc,Ee,$v,Pv,Ev,Cv,Tv,Av,Rv,Iv,zv,Dv,Ov,Nv,jv,Mv,Lv,Zv,Uv,qv,Fv,Vv,Bv,Hv,Wv,ed,Kv,Jv,Yv,Qv,Xv,ew,tw,rw,nw,ow,td,iw,sw,aw,cw,uw,lw,pw,dw,fw,hw,mw,gw,yw,_w,vw,ww=b(()=>{_c();ei();Yp();Bp();yc();Or();Qp();Or();he=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=mv;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=ao(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 en;if(u||d instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await d,i.issues.length!==l&&(c||(c=ao(i,l)))});else{if(i.issues.length===l)continue;c||(c=ao(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 en;return a.then(c=>o(c,n,s))}return o(a,n,s)}}e["~standard"]={validate:o=>{try{let i=ms(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return gc(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),bc=S("$ZodString",(e,t)=>{he.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??H_(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}}),Ee=S("$ZodStringFormat",(e,t)=>{ys.init(e,t),bc.init(e,t)}),$v=S("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=I_),Ee.init(e,t)}),Pv=S("$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=Hp(n))}else t.pattern??(t.pattern=Hp());Ee.init(e,t)}),Ev=S("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=z_),Ee.init(e,t)}),Cv=S("$ZodURL",(e,t)=>{Ee.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:Z_.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})}}}),Tv=S("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=D_()),Ee.init(e,t)}),Av=S("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=A_),Ee.init(e,t)}),Rv=S("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$_),Ee.init(e,t)}),Iv=S("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=P_),Ee.init(e,t)}),zv=S("$ZodULID",(e,t)=>{t.pattern??(t.pattern=E_),Ee.init(e,t)}),Dv=S("$ZodXID",(e,t)=>{t.pattern??(t.pattern=C_),Ee.init(e,t)}),Ov=S("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=T_),Ee.init(e,t)}),Nv=S("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=B_(t)),Ee.init(e,t)}),jv=S("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=F_),Ee.init(e,t)}),Mv=S("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=V_(t)),Ee.init(e,t)}),Lv=S("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=R_),Ee.init(e,t)}),Zv=S("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=O_),Ee.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Uv=S("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=N_),Ee.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})}}}),qv=S("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=j_),Ee.init(e,t)}),Fv=S("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=M_),Ee.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})}}});Vv=S("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=L_),Ee.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Gv(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});Bv=S("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Wp),Ee.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{hR(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Hv=S("$ZodE164",(e,t)=>{t.pattern??(t.pattern=U_),Ee.init(e,t)});Wv=S("$ZodJWT",(e,t)=>{Ee.init(e,t),e._zod.check=r=>{mR(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),ed=S("$ZodNumber",(e,t)=>{he.init(e,t),e._zod.pattern=e._zod.bag.pattern??J_,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}}),Kv=S("$ZodNumber",(e,t)=>{nv.init(e,t),ed.init(e,t)}),Jv=S("$ZodBoolean",(e,t)=>{he.init(e,t),e._zod.pattern=Y_,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}}),Yv=S("$ZodBigInt",(e,t)=>{he.init(e,t),e._zod.pattern=W_,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Qv=S("$ZodNull",(e,t)=>{he.init(e,t),e._zod.pattern=Q_,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}}),Xv=S("$ZodAny",(e,t)=>{he.init(e,t),e._zod.parse=r=>r}),ew=S("$ZodUnknown",(e,t)=>{he.init(e,t),e._zod.parse=r=>r}),tw=S("$ZodNever",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),rw=S("$ZodDate",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});nw=S("$ZodArray",(e,t)=>{he.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=>gv(u,r,s))):gv(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});ow=S("$ZodObject",(e,t)=>{he.init(e,t);let r=ps(()=>{let l=Object.keys(t.shape);for(let f of l)if(!(t.shape[f]instanceof he))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);let d=Lp(t.shape);return{shape:t.shape,keys:l,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(d)}});ke(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 vc(["shape","payload","ctx"]),f=r.value,h=w=>{let x=so(w);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};d.write("const input = payload.value;");let g=Object.create(null),y=0;for(let w of f.keys)g[w]=`key_${y++}`;d.write("const newResult = {}");for(let w of f.keys)if(f.optionalKeys.has(w)){let x=g[w];d.write(`const ${x} = ${h(w)};`);let k=so(w);d.write(`
|
|
7
7
|
if (${x}.issues.length) {
|
|
8
8
|
if (input[${k}] === undefined) {
|
|
9
9
|
if (${k} in input) {
|
|
@@ -22,74 +22,74 @@ const __goddBundleUrl = require("node:url").pathToFileURL(__filename).href;
|
|
|
22
22
|
} else {
|
|
23
23
|
newResult[${k}] = ${x}.value;
|
|
24
24
|
}
|
|
25
|
-
`)}else{let x=g[w];d.write(`const ${x} = ${
|
|
25
|
+
`)}else{let x=g[w];d.write(`const ${x} = ${h(w)};`),d.write(`
|
|
26
26
|
if (${x}.issues.length) payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
|
|
27
27
|
...iss,
|
|
28
|
-
path: iss.path ? [${
|
|
29
|
-
})));`),d.write(`newResult[${ao(w)}] = ${x}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");let v=d.compile();return(w,x)=>v(u,w,x)},o,i=ri,s=!lc.jitless,c=s&&Np.value,l=t.catchall,p;e._zod.parse=(u,d)=>{p??(p=r.value);let h=u.value;if(!i(h))return u.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),u;let m=[];if(s&&c&&d?.async===!1&&d.jitless!==!0)o||(o=n(t.shape)),u=o(u,d);else{u.value={};let x=p.shape;for(let k of p.keys){let P=x[k],q=P._zod.run({value:h[k],issues:[]},d),Z=P._zod.optin==="optional"&&P._zod.optout==="optional";q instanceof Promise?m.push(q.then(Fe=>Z?gv(Fe,u,k,h):bc(Fe,u,k))):Z?gv(q,u,k,h):bc(q,u,k)}}if(!l)return m.length?Promise.all(m).then(()=>u):u;let g=[],_=p.keySet,v=l._zod,w=v.def.type;for(let x of Object.keys(h)){if(_.has(x))continue;if(w==="never"){g.push(x);continue}let k=v.run({value:h[x],issues:[]},d);k instanceof Promise?m.push(k.then(P=>bc(P,u,x))):bc(k,u,x)}return g.length&&u.issues.push({code:"unrecognized_keys",keys:g,input:h,inst:e}),m.length?Promise.all(m).then(()=>u):u}});ed=S("$ZodUnion",(e,t)=>{me.init(e,t),ke(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ke(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ke(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),ke(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=>hs(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=>_v(s,r,e,n)):_v(i,r,e,n)}}),ow=S("$ZodDiscriminatedUnion",(e,t)=>{ed.init(e,t);let r=e._zod.parse;ke(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 l of c)o[a].add(l)}}return o});let n=ds(()=>{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(!ri(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)}}),iw=S("$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,l])=>yv(r,c,l)):yv(r,i,s)}});sw=S("$ZodRecord",(e,t)=>{me.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!ni(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 l=t.valueType._zod.run({value:o[c],issues:[]},n);l instanceof Promise?i.push(l.then(p=>{p.issues.length&&r.issues.push(...Or(c,p.issues)),r.value[c]=p.value})):(l.issues.length&&r.issues.push(...Or(c,l.issues)),r.value[c]=l.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(l=>_r(l,n,Nt())),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(l=>{l.issues.length&&r.issues.push(...Or(s,l.issues)),r.value[a.value]=l.value})):(c.issues.length&&r.issues.push(...Or(s,c.issues)),r.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>r):r}}),aw=S("$ZodEnum",(e,t)=>{me.init(e,t);let r=ps(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>jp.has(typeof n)).map(n=>typeof n=="string"?En(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}}),cw=S("$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"?En(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}}),lw=S("$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 tn;return r.value=o,r}}),uw=S("$ZodOptional",(e,t)=>{me.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ke(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ke(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${hs(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)}),pw=S("$ZodNullable",(e,t)=>{me.init(e,t),ke(e._zod,"optin",()=>t.innerType._zod.optin),ke(e._zod,"optout",()=>t.innerType._zod.optout),ke(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${hs(r.source)}|null)$`):void 0}),ke(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)}),dw=S("$ZodDefault",(e,t)=>{me.init(e,t),e._zod.optin="optional",ke(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=>vv(i,t)):vv(o,t)}});fw=S("$ZodPrefault",(e,t)=>{me.init(e,t),e._zod.optin="optional",ke(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))}),hw=S("$ZodNonOptional",(e,t)=>{me.init(e,t),ke(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=>wv(i,e)):wv(o,e)}});mw=S("$ZodCatch",(e,t)=>{me.init(e,t),e._zod.optin="optional",ke(e._zod,"optout",()=>t.innerType._zod.optout),ke(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=>_r(s,n,Nt()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>_r(i,n,Nt()))},input:r.value}),r.issues=[]),r)}}),gw=S("$ZodPipe",(e,t)=>{me.init(e,t),ke(e._zod,"values",()=>t.in._zod.values),ke(e._zod,"optin",()=>t.in._zod.optin),ke(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=>bv(i,t,n)):bv(o,t,n)}});_w=S("$ZodReadonly",(e,t)=>{me.init(e,t),ke(e._zod,"propValues",()=>t.innerType._zod.propValues),ke(e._zod,"values",()=>t.innerType._zod.values),ke(e._zod,"optin",()=>t.innerType._zod.optin),ke(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(xv):xv(o)}});yw=S("$ZodCustom",(e,t)=>{gt.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=>kv(i,r,n,e));kv(o,r,n,e)}})});function ww(){return{localeError:kA()}}var xA,kA,bw=b(()=>{Nr();xA=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},kA=()=>{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 ${xA(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${fc(n.values[0])}`:`Invalid option: expected one of ${pc(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":""}: ${pc(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 kc=b(()=>{});function rd(){return new vs}var xw,kw,vs,rn,nd=b(()=>{xw=Symbol("ZodOutput"),kw=Symbol("ZodInput"),vs=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)}};rn=rd()});function Sw(e,t){return new e({type:"string",...j(t)})}function $w(e,t){return new e({type:"string",coerce:!0,...j(t)})}function Pw(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...j(t)})}function od(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...j(t)})}function Ew(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...j(t)})}function Cw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(t)})}function Tw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(t)})}function Rw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(t)})}function id(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...j(t)})}function Aw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...j(t)})}function Iw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(t)})}function zw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...j(t)})}function Dw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(t)})}function Ow(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...j(t)})}function Nw(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...j(t)})}function jw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(t)})}function Mw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(t)})}function Lw(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(t)})}function Zw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(t)})}function Uw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(t)})}function qw(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...j(t)})}function Fw(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...j(t)})}function Gw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...j(t)})}function Vw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...j(t)})}function Bw(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(t)})}function Hw(e,t){return new e({type:"string",format:"date",check:"string_format",...j(t)})}function Kw(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...j(t)})}function Ww(e,t){return new e({type:"string",format:"duration",check:"string_format",...j(t)})}function Jw(e,t){return new e({type:"number",checks:[],...j(t)})}function Yw(e,t){return new e({type:"number",coerce:!0,checks:[],...j(t)})}function Qw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...j(t)})}function Xw(e,t){return new e({type:"boolean",...j(t)})}function eb(e,t){return new e({type:"boolean",coerce:!0,...j(t)})}function tb(e,t){return new e({type:"bigint",coerce:!0,...j(t)})}function rb(e,t){return new e({type:"null",...j(t)})}function nb(e){return new e({type:"any"})}function ob(e){return new e({type:"unknown"})}function ib(e,t){return new e({type:"never",...j(t)})}function sb(e,t){return new e({type:"date",coerce:!0,...j(t)})}function oi(e,t){return new Kp({check:"less_than",...j(t),value:e,inclusive:!1})}function nn(e,t){return new Kp({check:"less_than",...j(t),value:e,inclusive:!0})}function ii(e,t){return new Wp({check:"greater_than",...j(t),value:e,inclusive:!1})}function yr(e,t){return new Wp({check:"greater_than",...j(t),value:e,inclusive:!0})}function ws(e,t){return new tv({check:"multiple_of",...j(t),value:e})}function Sc(e,t){return new nv({check:"max_length",...j(t),maximum:e})}function si(e,t){return new ov({check:"min_length",...j(t),minimum:e})}function $c(e,t){return new iv({check:"length_equals",...j(t),length:e})}function sd(e,t){return new sv({check:"string_format",format:"regex",...j(t),pattern:e})}function ad(e){return new av({check:"string_format",format:"lowercase",...j(e)})}function cd(e){return new cv({check:"string_format",format:"uppercase",...j(e)})}function ld(e,t){return new lv({check:"string_format",format:"includes",...j(t),includes:e})}function ud(e,t){return new uv({check:"string_format",format:"starts_with",...j(t),prefix:e})}function pd(e,t){return new pv({check:"string_format",format:"ends_with",...j(t),suffix:e})}function lo(e){return new dv({check:"overwrite",tx:e})}function dd(e){return lo(t=>t.normalize(e))}function fd(){return lo(e=>e.trim())}function hd(){return lo(e=>e.toLowerCase())}function md(){return lo(e=>e.toUpperCase())}function ab(e,t,r){return new e({type:"array",element:t,...j(r)})}function cb(e,t,r){let n=j(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function lb(e,t,r){return new e({type:"custom",check:"custom",fn:t,...j(r)})}var ub=b(()=>{vc();Nr()});var pb=b(()=>{});function Ec(e,t){if(e instanceof vs){let n=new Pc(t),o={};for(let a of e._idmap.entries()){let[c,l]=a;n.process(l)}let i={},s={registry:e,uri:t?.uri,defs:o};for(let a of e._idmap.entries()){let[c,l]=a;i[c]=n.emit(l,{...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 Pc(t);return r.process(e),r.emit(e,t)}function Qe(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 Qe(o.element,r);case"object":{for(let i in o.shape)if(Qe(o.shape[i],r))return!0;return!1}case"union":{for(let i of o.options)if(Qe(i,r))return!0;return!1}case"intersection":return Qe(o.left,r)||Qe(o.right,r);case"tuple":{for(let i of o.items)if(Qe(i,r))return!0;return!!(o.rest&&Qe(o.rest,r))}case"record":return Qe(o.keyType,r)||Qe(o.valueType,r);case"map":return Qe(o.keyType,r)||Qe(o.valueType,r);case"set":return Qe(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Qe(o.innerType,r);case"lazy":return Qe(o.getter(),r);case"default":return Qe(o.innerType,r);case"prefault":return Qe(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Qe(o.in,r)||Qe(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}var Pc,db=b(()=>{nd();Nr();Pc=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??rn,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 u={...r,schemaPath:[...r.schemaPath,t],path:r.path},d=t._zod.parent;if(d)a.ref=d,this.process(d,u),this.seen.get(d).isParent=!0;else{let h=a.schema;switch(o.type){case"string":{let m=h;m.type="string";let{minimum:g,maximum:_,format:v,patterns:w,contentEncoding:x}=t._zod.bag;if(typeof g=="number"&&(m.minLength=g),typeof _=="number"&&(m.maxLength=_),v&&(m.format=i[v]??v,m.format===""&&delete m.format),x&&(m.contentEncoding=x),w&&w.size>0){let k=[...w];k.length===1?m.pattern=k[0].source:k.length>1&&(a.schema.allOf=[...k.map(P=>({...this.target==="draft-7"?{type:"string"}:{},pattern:P.source}))])}break}case"number":{let m=h,{minimum:g,maximum:_,format:v,multipleOf:w,exclusiveMaximum:x,exclusiveMinimum:k}=t._zod.bag;typeof v=="string"&&v.includes("int")?m.type="integer":m.type="number",typeof k=="number"&&(m.exclusiveMinimum=k),typeof g=="number"&&(m.minimum=g,typeof k=="number"&&(k>=g?delete m.minimum:delete m.exclusiveMinimum)),typeof x=="number"&&(m.exclusiveMaximum=x),typeof _=="number"&&(m.maximum=_,typeof x=="number"&&(x<=_?delete m.maximum:delete m.exclusiveMaximum)),typeof w=="number"&&(m.multipleOf=w);break}case"boolean":{let m=h;m.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":{h.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":{h.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let m=h,{minimum:g,maximum:_}=t._zod.bag;typeof g=="number"&&(m.minItems=g),typeof _=="number"&&(m.maxItems=_),m.type="array",m.items=this.process(o.element,{...u,path:[...u.path,"items"]});break}case"object":{let m=h;m.type="object",m.properties={};let g=o.shape;for(let w in g)m.properties[w]=this.process(g[w],{...u,path:[...u.path,"properties",w]});let _=new Set(Object.keys(g)),v=new Set([..._].filter(w=>{let x=o.shape[w]._zod;return this.io==="input"?x.optin===void 0:x.optout===void 0}));v.size>0&&(m.required=Array.from(v)),o.catchall?._zod.def.type==="never"?m.additionalProperties=!1:o.catchall?o.catchall&&(m.additionalProperties=this.process(o.catchall,{...u,path:[...u.path,"additionalProperties"]})):this.io==="output"&&(m.additionalProperties=!1);break}case"union":{let m=h;m.anyOf=o.options.map((g,_)=>this.process(g,{...u,path:[...u.path,"anyOf",_]}));break}case"intersection":{let m=h,g=this.process(o.left,{...u,path:[...u.path,"allOf",0]}),_=this.process(o.right,{...u,path:[...u.path,"allOf",1]}),v=x=>"allOf"in x&&Object.keys(x).length===1,w=[...v(g)?g.allOf:[g],...v(_)?_.allOf:[_]];m.allOf=w;break}case"tuple":{let m=h;m.type="array";let g=o.items.map((w,x)=>this.process(w,{...u,path:[...u.path,"prefixItems",x]}));if(this.target==="draft-2020-12"?m.prefixItems=g:m.items=g,o.rest){let w=this.process(o.rest,{...u,path:[...u.path,"items"]});this.target==="draft-2020-12"?m.items=w:m.additionalItems=w}o.rest&&(m.items=this.process(o.rest,{...u,path:[...u.path,"items"]}));let{minimum:_,maximum:v}=t._zod.bag;typeof _=="number"&&(m.minItems=_),typeof v=="number"&&(m.maxItems=v);break}case"record":{let m=h;m.type="object",m.propertyNames=this.process(o.keyType,{...u,path:[...u.path,"propertyNames"]}),m.additionalProperties=this.process(o.valueType,{...u,path:[...u.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 m=h,g=ps(o.entries);g.every(_=>typeof _=="number")&&(m.type="number"),g.every(_=>typeof _=="string")&&(m.type="string"),m.enum=g;break}case"literal":{let m=h,g=[];for(let _ of o.values)if(_===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof _=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");g.push(Number(_))}else g.push(_);if(g.length!==0)if(g.length===1){let _=g[0];m.type=_===null?"null":typeof _,m.const=_}else g.every(_=>typeof _=="number")&&(m.type="number"),g.every(_=>typeof _=="string")&&(m.type="string"),g.every(_=>typeof _=="boolean")&&(m.type="string"),g.every(_=>_===null)&&(m.type="null"),m.enum=g;break}case"file":{let m=h,g={type:"string",format:"binary",contentEncoding:"binary"},{minimum:_,maximum:v,mime:w}=t._zod.bag;_!==void 0&&(g.minLength=_),v!==void 0&&(g.maxLength=v),w?w.length===1?(g.contentMediaType=w[0],Object.assign(m,g)):m.anyOf=w.map(x=>({...g,contentMediaType:x})):Object.assign(m,g);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let m=this.process(o.innerType,u);h.anyOf=[m,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,u),a.ref=o.innerType;break}case"success":{let m=h;m.type="boolean";break}case"default":{this.process(o.innerType,u),a.ref=o.innerType,h.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,u),a.ref=o.innerType,this.io==="input"&&(h._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,u),a.ref=o.innerType;let m;try{m=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}h.default=m;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let m=h,g=t._zod.pattern;if(!g)throw new Error("Pattern not found in template literal");m.type="string",m.pattern=g.source;break}case"pipe":{let m=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(m,u),a.ref=m;break}case"readonly":{this.process(o.innerType,u),a.ref=o.innerType,h.readOnly=!0;break}case"promise":{this.process(o.innerType,u),a.ref=o.innerType;break}case"optional":{this.process(o.innerType,u),a.ref=o.innerType;break}case"lazy":{let m=t._zod.innerType;this.process(m,u),a.ref=m;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let l=this.metadataRegistry.get(t);return l&&Object.assign(a.schema,l),this.io==="input"&&Qe(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 u=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let g=n.external.registry.get(p[0])?.id,_=n.external.uri??(w=>w);if(g)return{ref:_(g)};let v=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=v,{defId:v,ref:`${_("__shared")}#/${u}/${v}`}}if(p[1]===o)return{ref:"#"};let h=`#/${u}/`,m=p[1].schema.id??`__schema${this.counter++}`;return{defId:m,ref:h+m}},s=p=>{if(p[1].schema.$ref)return;let u=p[1],{ref:d,defId:h}=i(p);u.def={...u.schema},h&&(u.defId=h);let m=u.schema;for(let g in m)delete m[g];m.$ref=d};if(n.cycles==="throw")for(let p of this.seen.entries()){let u=p[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
30
|
-
|
|
31
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let p of this.seen.entries()){let u=p[1];if(t===p[0]){s(p);continue}if(n.external){let h=n.external.registry.get(p[0])?.id;if(t!==p[0]&&h){s(p);continue}}if(this.metadataRegistry.get(p[0])?.id){s(p);continue}if(u.cycle){s(p);continue}if(u.count>1&&n.reused==="ref"){s(p);continue}}let a=(p,u)=>{let d=this.seen.get(p),h=d.def??d.schema,m={...h};if(d.ref===null)return;let g=d.ref;if(d.ref=null,g){a(g,u);let _=this.seen.get(g).schema;_.$ref&&u.target==="draft-7"?(h.allOf=h.allOf??[],h.allOf.push(_)):(Object.assign(h,_),Object.assign(h,m))}d.isParent||this.override({zodSchema:p,jsonSchema:h,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 l=n.external?.defs??{};for(let p of this.seen.entries()){let u=p[1];u.def&&u.defId&&(l[u.defId]=u.def)}n.external||Object.keys(l).length>0&&(this.target==="draft-2020-12"?c.$defs=l:c.definitions=l);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}}});var fb=b(()=>{});var Et=b(()=>{ti();Vp();qp();vw();vc();Yp();Nr();yc();kc();nd();Jp();pb();ub();db();fb()});var gd=b(()=>{Et()});var bs={};Xt(bs,{ZodISODate:()=>mb,ZodISODateTime:()=>hb,ZodISODuration:()=>_b,ZodISOTime:()=>gb,date:()=>yd,datetime:()=>_d,duration:()=>wd,time:()=>vd});function _d(e){return Bw(hb,e)}function yd(e){return Hw(mb,e)}function vd(e){return Kw(gb,e)}function wd(e){return Ww(_b,e)}var hb,mb,gb,_b,bd=b(()=>{Et();Cc();hb=S("ZodISODateTime",(e,t)=>{Ov.init(e,t),Ae.init(e,t)});mb=S("ZodISODate",(e,t)=>{Nv.init(e,t),Ae.init(e,t)});gb=S("ZodISOTime",(e,t)=>{jv.init(e,t),Ae.init(e,t)});_b=S("ZodISODuration",(e,t)=>{Mv.init(e,t),Ae.init(e,t)})});var vb,w7,xs,xd=b(()=>{Et();Et();vb=(e,t)=>{hc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>gc(e,r)},flatten:{value:r=>mc(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},w7=S("ZodError",vb),xs=S("ZodError",vb,{Parent:Error})});var wb,bb,xb,kb,kd=b(()=>{Et();xd();wb=xy(xs),bb=ky(xs),xb=Fp(xs),kb=Gp(xs)});function y(e){return Sw(Pd,e)}function Tb(e){return id(Cb,e)}function de(e){return Jw(Rc,e)}function $b(e){return Qw(BA,e)}function we(e){return Xw(Ed,e)}function Cd(e){return rb(HA,e)}function Ab(){return nb(KA)}function Ie(){return ob(WA)}function YA(e){return ib(JA,e)}function T(e,t){return ab(QA,e,t)}function R(e,t){let r={type:"object",get shape(){return pe.assignProp(this,"shape",{...e}),this.shape},...pe.normalizeParams(t)};return new zb(r)}function Xe(e,t){return new zb({type:"object",get shape(){return pe.assignProp(this,"shape",{...e}),this.shape},catchall:Ie(),...pe.normalizeParams(t)})}function $e(e,t){return new Db({type:"union",options:e,...pe.normalizeParams(t)})}function Td(e,t,r){return new XA({type:"union",options:t,discriminator:e,...pe.normalizeParams(r)})}function Ac(e,t){return new eI({type:"intersection",left:e,right:t})}function ze(e,t,r){return new tI({type:"record",keyType:e,valueType:t,...pe.normalizeParams(r)})}function jt(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Sd({type:"enum",entries:r,...pe.normalizeParams(t)})}function O(e,t){return new rI({type:"literal",values:Array.isArray(e)?e:[e],...pe.normalizeParams(t)})}function Ob(e){return new nI({type:"transform",transform:e})}function Ne(e){return new Nb({type:"optional",innerType:e})}function Pb(e){return new oI({type:"nullable",innerType:e})}function sI(e,t){return new iI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function cI(e,t){return new aI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function lI(e,t){return new jb({type:"nonoptional",innerType:e,...pe.normalizeParams(t)})}function pI(e,t){return new uI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function $d(e,t){return new dI({type:"pipe",in:e,out:t})}function hI(e){return new fI({type:"readonly",innerType:e})}function mI(e){let t=new gt({check:"custom"});return t._zod.check=e,t}function Lb(e,t){return cb(Mb,e??(()=>!0),t)}function gI(e,t={}){return lb(Mb,e,t)}function _I(e){let t=mI(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(pe.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(pe.issue(o))}},e(r.value,r)));return t}function Rd(e,t){return $d(Ob(e),t)}var Se,Eb,Pd,Ae,RA,Sb,Tc,Cb,AA,IA,zA,DA,OA,NA,jA,MA,LA,ZA,UA,qA,FA,GA,VA,Rc,BA,Ed,Rb,HA,KA,WA,JA,Ib,QA,zb,Db,XA,eI,tI,Sd,rI,nI,Nb,oI,iI,aI,jb,uI,dI,fI,Mb,Cc=b(()=>{Et();Et();gd();bd();kd();Se=S("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)=>er(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>wb(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>xb(e,r,n),e.parseAsync=async(r,n)=>bb(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>kb(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(gI(r,n)),e.superRefine=r=>e.check(_I(r)),e.overwrite=r=>e.check(lo(r)),e.optional=()=>Ne(e),e.nullable=()=>Pb(e),e.nullish=()=>Ne(Pb(e)),e.nonoptional=r=>lI(e,r),e.array=()=>T(e),e.or=r=>$e([e,r]),e.and=r=>Ac(e,r),e.transform=r=>$d(e,Ob(r)),e.default=r=>sI(e,r),e.prefault=r=>cI(e,r),e.catch=r=>pI(e,r),e.pipe=r=>$d(e,r),e.readonly=()=>hI(e),e.describe=r=>{let n=e.clone();return rn.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return rn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return rn.get(e);let n=e.clone();return rn.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Eb=S("_ZodString",(e,t)=>{xc.init(e,t),Se.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(sd(...n)),e.includes=(...n)=>e.check(ld(...n)),e.startsWith=(...n)=>e.check(ud(...n)),e.endsWith=(...n)=>e.check(pd(...n)),e.min=(...n)=>e.check(si(...n)),e.max=(...n)=>e.check(Sc(...n)),e.length=(...n)=>e.check($c(...n)),e.nonempty=(...n)=>e.check(si(1,...n)),e.lowercase=n=>e.check(ad(n)),e.uppercase=n=>e.check(cd(n)),e.trim=()=>e.check(fd()),e.normalize=(...n)=>e.check(dd(...n)),e.toLowerCase=()=>e.check(hd()),e.toUpperCase=()=>e.check(md())}),Pd=S("ZodString",(e,t)=>{xc.init(e,t),Eb.init(e,t),e.email=r=>e.check(Pw(RA,r)),e.url=r=>e.check(id(Cb,r)),e.jwt=r=>e.check(Vw(VA,r)),e.emoji=r=>e.check(Aw(AA,r)),e.guid=r=>e.check(od(Sb,r)),e.uuid=r=>e.check(Ew(Tc,r)),e.uuidv4=r=>e.check(Cw(Tc,r)),e.uuidv6=r=>e.check(Tw(Tc,r)),e.uuidv7=r=>e.check(Rw(Tc,r)),e.nanoid=r=>e.check(Iw(IA,r)),e.guid=r=>e.check(od(Sb,r)),e.cuid=r=>e.check(zw(zA,r)),e.cuid2=r=>e.check(Dw(DA,r)),e.ulid=r=>e.check(Ow(OA,r)),e.base64=r=>e.check(qw(qA,r)),e.base64url=r=>e.check(Fw(FA,r)),e.xid=r=>e.check(Nw(NA,r)),e.ksuid=r=>e.check(jw(jA,r)),e.ipv4=r=>e.check(Mw(MA,r)),e.ipv6=r=>e.check(Lw(LA,r)),e.cidrv4=r=>e.check(Zw(ZA,r)),e.cidrv6=r=>e.check(Uw(UA,r)),e.e164=r=>e.check(Gw(GA,r)),e.datetime=r=>e.check(_d(r)),e.date=r=>e.check(yd(r)),e.time=r=>e.check(vd(r)),e.duration=r=>e.check(wd(r))});Ae=S("ZodStringFormat",(e,t)=>{Ee.init(e,t),Eb.init(e,t)}),RA=S("ZodEmail",(e,t)=>{Pv.init(e,t),Ae.init(e,t)}),Sb=S("ZodGUID",(e,t)=>{Sv.init(e,t),Ae.init(e,t)}),Tc=S("ZodUUID",(e,t)=>{$v.init(e,t),Ae.init(e,t)}),Cb=S("ZodURL",(e,t)=>{Ev.init(e,t),Ae.init(e,t)});AA=S("ZodEmoji",(e,t)=>{Cv.init(e,t),Ae.init(e,t)}),IA=S("ZodNanoID",(e,t)=>{Tv.init(e,t),Ae.init(e,t)}),zA=S("ZodCUID",(e,t)=>{Rv.init(e,t),Ae.init(e,t)}),DA=S("ZodCUID2",(e,t)=>{Av.init(e,t),Ae.init(e,t)}),OA=S("ZodULID",(e,t)=>{Iv.init(e,t),Ae.init(e,t)}),NA=S("ZodXID",(e,t)=>{zv.init(e,t),Ae.init(e,t)}),jA=S("ZodKSUID",(e,t)=>{Dv.init(e,t),Ae.init(e,t)}),MA=S("ZodIPv4",(e,t)=>{Lv.init(e,t),Ae.init(e,t)}),LA=S("ZodIPv6",(e,t)=>{Zv.init(e,t),Ae.init(e,t)}),ZA=S("ZodCIDRv4",(e,t)=>{Uv.init(e,t),Ae.init(e,t)}),UA=S("ZodCIDRv6",(e,t)=>{qv.init(e,t),Ae.init(e,t)}),qA=S("ZodBase64",(e,t)=>{Gv.init(e,t),Ae.init(e,t)}),FA=S("ZodBase64URL",(e,t)=>{Vv.init(e,t),Ae.init(e,t)}),GA=S("ZodE164",(e,t)=>{Bv.init(e,t),Ae.init(e,t)}),VA=S("ZodJWT",(e,t)=>{Hv.init(e,t),Ae.init(e,t)}),Rc=S("ZodNumber",(e,t)=>{Xp.init(e,t),Se.init(e,t),e.gt=(n,o)=>e.check(ii(n,o)),e.gte=(n,o)=>e.check(yr(n,o)),e.min=(n,o)=>e.check(yr(n,o)),e.lt=(n,o)=>e.check(oi(n,o)),e.lte=(n,o)=>e.check(nn(n,o)),e.max=(n,o)=>e.check(nn(n,o)),e.int=n=>e.check($b(n)),e.safe=n=>e.check($b(n)),e.positive=n=>e.check(ii(0,n)),e.nonnegative=n=>e.check(yr(0,n)),e.negative=n=>e.check(oi(0,n)),e.nonpositive=n=>e.check(nn(0,n)),e.multipleOf=(n,o)=>e.check(ws(n,o)),e.step=(n,o)=>e.check(ws(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});BA=S("ZodNumberFormat",(e,t)=>{Kv.init(e,t),Rc.init(e,t)});Ed=S("ZodBoolean",(e,t)=>{Wv.init(e,t),Se.init(e,t)});Rb=S("ZodBigInt",(e,t)=>{Jv.init(e,t),Se.init(e,t),e.gte=(n,o)=>e.check(yr(n,o)),e.min=(n,o)=>e.check(yr(n,o)),e.gt=(n,o)=>e.check(ii(n,o)),e.gte=(n,o)=>e.check(yr(n,o)),e.min=(n,o)=>e.check(yr(n,o)),e.lt=(n,o)=>e.check(oi(n,o)),e.lte=(n,o)=>e.check(nn(n,o)),e.max=(n,o)=>e.check(nn(n,o)),e.positive=n=>e.check(ii(BigInt(0),n)),e.negative=n=>e.check(oi(BigInt(0),n)),e.nonpositive=n=>e.check(nn(BigInt(0),n)),e.nonnegative=n=>e.check(yr(BigInt(0),n)),e.multipleOf=(n,o)=>e.check(ws(n,o));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null}),HA=S("ZodNull",(e,t)=>{Yv.init(e,t),Se.init(e,t)});KA=S("ZodAny",(e,t)=>{Qv.init(e,t),Se.init(e,t)});WA=S("ZodUnknown",(e,t)=>{Xv.init(e,t),Se.init(e,t)});JA=S("ZodNever",(e,t)=>{ew.init(e,t),Se.init(e,t)});Ib=S("ZodDate",(e,t)=>{tw.init(e,t),Se.init(e,t),e.min=(n,o)=>e.check(yr(n,o)),e.max=(n,o)=>e.check(nn(n,o));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null}),QA=S("ZodArray",(e,t)=>{rw.init(e,t),Se.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(si(r,n)),e.nonempty=r=>e.check(si(1,r)),e.max=(r,n)=>e.check(Sc(r,n)),e.length=(r,n)=>e.check($c(r,n)),e.unwrap=()=>e.element});zb=S("ZodObject",(e,t)=>{nw.init(e,t),Se.init(e,t),pe.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>jt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ie()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ie()}),e.strict=()=>e.clone({...e._zod.def,catchall:YA()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>pe.extend(e,r),e.merge=r=>pe.merge(e,r),e.pick=r=>pe.pick(e,r),e.omit=r=>pe.omit(e,r),e.partial=(...r)=>pe.partial(Nb,e,r[0]),e.required=(...r)=>pe.required(jb,e,r[0])});Db=S("ZodUnion",(e,t)=>{ed.init(e,t),Se.init(e,t),e.options=t.options});XA=S("ZodDiscriminatedUnion",(e,t)=>{Db.init(e,t),ow.init(e,t)});eI=S("ZodIntersection",(e,t)=>{iw.init(e,t),Se.init(e,t)});tI=S("ZodRecord",(e,t)=>{sw.init(e,t),Se.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});Sd=S("ZodEnum",(e,t)=>{aw.init(e,t),Se.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 Sd({...t,checks:[],...pe.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 Sd({...t,checks:[],...pe.normalizeParams(o),entries:i})}});rI=S("ZodLiteral",(e,t)=>{cw.init(e,t),Se.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]}})});nI=S("ZodTransform",(e,t)=>{lw.init(e,t),Se.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=i=>{if(typeof i=="string")r.issues.push(pe.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(pe.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});Nb=S("ZodOptional",(e,t)=>{uw.init(e,t),Se.init(e,t),e.unwrap=()=>e._zod.def.innerType});oI=S("ZodNullable",(e,t)=>{pw.init(e,t),Se.init(e,t),e.unwrap=()=>e._zod.def.innerType});iI=S("ZodDefault",(e,t)=>{dw.init(e,t),Se.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});aI=S("ZodPrefault",(e,t)=>{fw.init(e,t),Se.init(e,t),e.unwrap=()=>e._zod.def.innerType});jb=S("ZodNonOptional",(e,t)=>{hw.init(e,t),Se.init(e,t),e.unwrap=()=>e._zod.def.innerType});uI=S("ZodCatch",(e,t)=>{mw.init(e,t),Se.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});dI=S("ZodPipe",(e,t)=>{gw.init(e,t),Se.init(e,t),e.in=t.in,e.out=t.out});fI=S("ZodReadonly",(e,t)=>{_w.init(e,t),Se.init(e,t)});Mb=S("ZodCustom",(e,t)=>{yw.init(e,t),Se.init(e,t)})});var Zb,Ub=b(()=>{Zb={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"}});var Ic={};Xt(Ic,{bigint:()=>bI,boolean:()=>wI,date:()=>xI,number:()=>vI,string:()=>yI});function yI(e){return $w(Pd,e)}function vI(e){return Yw(Rc,e)}function wI(e){return eb(Ed,e)}function bI(e){return tb(Rb,e)}function xI(e){return sb(Ib,e)}var qb=b(()=>{Et();Cc()});var Fb=b(()=>{Et();Cc();gd();xd();kd();Ub();Et();bw();Et();kc();bd();qb();Nt(ww())});var Gb=b(()=>{Fb()});var Ad=b(()=>{Gb()});var ci,Bb,Cn,Dc,it,Hb,Kb,dV,EI,CI,zd,Ht,ks,Wb,st,tr,rr,at,Oc,Jb,po,Yb,Qb,Dd,fo,X,Od,Xb,li,fV,Nc,TI,jc,RI,Ss,ai,e0,AI,II,zI,DI,OI,NI,Nd,jI,MI,Mc,t0,Lc,LI,ZI,Zc,UI,$s,Ps,qI,Es,ui,FI,Cs,Uc,qc,Fc,hV,Gc,Vc,Bc,r0,n0,o0,jd,i0,Ts,pi,s0,GI,Md,VI,BI,HI,Ld,KI,Zd,WI,JI,YI,QI,XI,ez,tz,rz,nz,oz,Ud,iz,sz,qd,Fd,Gd,Vd,az,cz,lz,Bd,uz,pz,dz,fz,hz,a0,Hd,mz,Hc,mV,gz,Rs,_z,gV,As,yz,Kd,vz,wz,bz,xz,kz,Sz,$z,zc,Pz,Ez,Cz,Wd,Jd,Tz,Rz,Az,Iz,zz,Dz,Oz,Nz,jz,Mz,Lz,Zz,Uz,qz,Fz,Gz,Vz,Bz,Kc,Hz,Kz,Wz,Jz,Yz,Qz,Xz,Yd,eD,_V,yV,vV,wV,bV,xV,B,Id,Tn=b(()=>{Ad();ci="2025-11-25",Bb=[ci,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Cn="io.modelcontextprotocol/related-task",Dc="2.0",it=Lb(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Hb=$e([y(),de().int()]),Kb=y(),dV=Xe({ttl:$e([de(),Cd()]).optional(),pollInterval:de().optional()}),EI=R({ttl:de().optional()}),CI=R({taskId:y()}),zd=Xe({progressToken:Hb.optional(),[Cn]:CI.optional()}),Ht=R({_meta:zd.optional()}),ks=Ht.extend({task:EI.optional()}),Wb=e=>ks.safeParse(e).success,st=R({method:y(),params:Ht.loose().optional()}),tr=R({_meta:zd.optional()}),rr=R({method:y(),params:tr.loose().optional()}),at=Xe({_meta:zd.optional()}),Oc=$e([y(),de().int()]),Jb=R({jsonrpc:O(Dc),id:Oc,...st.shape}).strict(),po=e=>Jb.safeParse(e).success,Yb=R({jsonrpc:O(Dc),...rr.shape}).strict(),Qb=e=>Yb.safeParse(e).success,Dd=R({jsonrpc:O(Dc),id:Oc,result:at}).strict(),fo=e=>Dd.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"})(X||(X={}));Od=R({jsonrpc:O(Dc),id:Oc.optional(),error:R({code:de().int(),message:y(),data:Ie().optional()})}).strict(),Xb=e=>Od.safeParse(e).success,li=$e([Jb,Yb,Dd,Od]),fV=$e([Dd,Od]),Nc=at.strict(),TI=tr.extend({requestId:Oc.optional(),reason:y().optional()}),jc=rr.extend({method:O("notifications/cancelled"),params:TI}),RI=R({src:y(),mimeType:y().optional(),sizes:T(y()).optional(),theme:jt(["light","dark"]).optional()}),Ss=R({icons:T(RI).optional()}),ai=R({name:y(),title:y().optional()}),e0=ai.extend({...ai.shape,...Ss.shape,version:y(),websiteUrl:y().optional(),description:y().optional()}),AI=Ac(R({applyDefaults:we().optional()}),ze(y(),Ie())),II=Rd(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Ac(R({form:AI.optional(),url:it.optional()}),ze(y(),Ie()).optional())),zI=Xe({list:it.optional(),cancel:it.optional(),requests:Xe({sampling:Xe({createMessage:it.optional()}).optional(),elicitation:Xe({create:it.optional()}).optional()}).optional()}),DI=Xe({list:it.optional(),cancel:it.optional(),requests:Xe({tools:Xe({call:it.optional()}).optional()}).optional()}),OI=R({experimental:ze(y(),it).optional(),sampling:R({context:it.optional(),tools:it.optional()}).optional(),elicitation:II.optional(),roots:R({listChanged:we().optional()}).optional(),tasks:zI.optional()}),NI=Ht.extend({protocolVersion:y(),capabilities:OI,clientInfo:e0}),Nd=st.extend({method:O("initialize"),params:NI}),jI=R({experimental:ze(y(),it).optional(),logging:it.optional(),completions:it.optional(),prompts:R({listChanged:we().optional()}).optional(),resources:R({subscribe:we().optional(),listChanged:we().optional()}).optional(),tools:R({listChanged:we().optional()}).optional(),tasks:DI.optional()}),MI=at.extend({protocolVersion:y(),capabilities:jI,serverInfo:e0,instructions:y().optional()}),Mc=rr.extend({method:O("notifications/initialized"),params:tr.optional()}),t0=e=>Mc.safeParse(e).success,Lc=st.extend({method:O("ping"),params:Ht.optional()}),LI=R({progress:de(),total:Ne(de()),message:Ne(y())}),ZI=R({...tr.shape,...LI.shape,progressToken:Hb}),Zc=rr.extend({method:O("notifications/progress"),params:ZI}),UI=Ht.extend({cursor:Kb.optional()}),$s=st.extend({params:UI.optional()}),Ps=at.extend({nextCursor:Kb.optional()}),qI=jt(["working","input_required","completed","failed","cancelled"]),Es=R({taskId:y(),status:qI,ttl:$e([de(),Cd()]),createdAt:y(),lastUpdatedAt:y(),pollInterval:Ne(de()),statusMessage:Ne(y())}),ui=at.extend({task:Es}),FI=tr.merge(Es),Cs=rr.extend({method:O("notifications/tasks/status"),params:FI}),Uc=st.extend({method:O("tasks/get"),params:Ht.extend({taskId:y()})}),qc=at.merge(Es),Fc=st.extend({method:O("tasks/result"),params:Ht.extend({taskId:y()})}),hV=at.loose(),Gc=$s.extend({method:O("tasks/list")}),Vc=Ps.extend({tasks:T(Es)}),Bc=st.extend({method:O("tasks/cancel"),params:Ht.extend({taskId:y()})}),r0=at.merge(Es),n0=R({uri:y(),mimeType:Ne(y()),_meta:ze(y(),Ie()).optional()}),o0=n0.extend({text:y()}),jd=y().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),i0=n0.extend({blob:jd}),Ts=jt(["user","assistant"]),pi=R({audience:T(Ts).optional(),priority:de().min(0).max(1).optional(),lastModified:bs.datetime({offset:!0}).optional()}),s0=R({...ai.shape,...Ss.shape,uri:y(),description:Ne(y()),mimeType:Ne(y()),annotations:pi.optional(),_meta:Ne(Xe({}))}),GI=R({...ai.shape,...Ss.shape,uriTemplate:y(),description:Ne(y()),mimeType:Ne(y()),annotations:pi.optional(),_meta:Ne(Xe({}))}),Md=$s.extend({method:O("resources/list")}),VI=Ps.extend({resources:T(s0)}),BI=$s.extend({method:O("resources/templates/list")}),HI=Ps.extend({resourceTemplates:T(GI)}),Ld=Ht.extend({uri:y()}),KI=Ld,Zd=st.extend({method:O("resources/read"),params:KI}),WI=at.extend({contents:T($e([o0,i0]))}),JI=rr.extend({method:O("notifications/resources/list_changed"),params:tr.optional()}),YI=Ld,QI=st.extend({method:O("resources/subscribe"),params:YI}),XI=Ld,ez=st.extend({method:O("resources/unsubscribe"),params:XI}),tz=tr.extend({uri:y()}),rz=rr.extend({method:O("notifications/resources/updated"),params:tz}),nz=R({name:y(),description:Ne(y()),required:Ne(we())}),oz=R({...ai.shape,...Ss.shape,description:Ne(y()),arguments:Ne(T(nz)),_meta:Ne(Xe({}))}),Ud=$s.extend({method:O("prompts/list")}),iz=Ps.extend({prompts:T(oz)}),sz=Ht.extend({name:y(),arguments:ze(y(),y()).optional()}),qd=st.extend({method:O("prompts/get"),params:sz}),Fd=R({type:O("text"),text:y(),annotations:pi.optional(),_meta:ze(y(),Ie()).optional()}),Gd=R({type:O("image"),data:jd,mimeType:y(),annotations:pi.optional(),_meta:ze(y(),Ie()).optional()}),Vd=R({type:O("audio"),data:jd,mimeType:y(),annotations:pi.optional(),_meta:ze(y(),Ie()).optional()}),az=R({type:O("tool_use"),name:y(),id:y(),input:ze(y(),Ie()),_meta:ze(y(),Ie()).optional()}),cz=R({type:O("resource"),resource:$e([o0,i0]),annotations:pi.optional(),_meta:ze(y(),Ie()).optional()}),lz=s0.extend({type:O("resource_link")}),Bd=$e([Fd,Gd,Vd,lz,cz]),uz=R({role:Ts,content:Bd}),pz=at.extend({description:y().optional(),messages:T(uz)}),dz=rr.extend({method:O("notifications/prompts/list_changed"),params:tr.optional()}),fz=R({title:y().optional(),readOnlyHint:we().optional(),destructiveHint:we().optional(),idempotentHint:we().optional(),openWorldHint:we().optional()}),hz=R({taskSupport:jt(["required","optional","forbidden"]).optional()}),a0=R({...ai.shape,...Ss.shape,description:y().optional(),inputSchema:R({type:O("object"),properties:ze(y(),it).optional(),required:T(y()).optional()}).catchall(Ie()),outputSchema:R({type:O("object"),properties:ze(y(),it).optional(),required:T(y()).optional()}).catchall(Ie()).optional(),annotations:fz.optional(),execution:hz.optional(),_meta:ze(y(),Ie()).optional()}),Hd=$s.extend({method:O("tools/list")}),mz=Ps.extend({tools:T(a0)}),Hc=at.extend({content:T(Bd).default([]),structuredContent:ze(y(),Ie()).optional(),isError:we().optional()}),mV=Hc.or(at.extend({toolResult:Ie()})),gz=ks.extend({name:y(),arguments:ze(y(),Ie()).optional()}),Rs=st.extend({method:O("tools/call"),params:gz}),_z=rr.extend({method:O("notifications/tools/list_changed"),params:tr.optional()}),gV=R({autoRefresh:we().default(!0),debounceMs:de().int().nonnegative().default(300)}),As=jt(["debug","info","notice","warning","error","critical","alert","emergency"]),yz=Ht.extend({level:As}),Kd=st.extend({method:O("logging/setLevel"),params:yz}),vz=tr.extend({level:As,logger:y().optional(),data:Ie()}),wz=rr.extend({method:O("notifications/message"),params:vz}),bz=R({name:y().optional()}),xz=R({hints:T(bz).optional(),costPriority:de().min(0).max(1).optional(),speedPriority:de().min(0).max(1).optional(),intelligencePriority:de().min(0).max(1).optional()}),kz=R({mode:jt(["auto","required","none"]).optional()}),Sz=R({type:O("tool_result"),toolUseId:y().describe("The unique identifier for the corresponding tool call."),content:T(Bd).default([]),structuredContent:R({}).loose().optional(),isError:we().optional(),_meta:ze(y(),Ie()).optional()}),$z=Td("type",[Fd,Gd,Vd]),zc=Td("type",[Fd,Gd,Vd,az,Sz]),Pz=R({role:Ts,content:$e([zc,T(zc)]),_meta:ze(y(),Ie()).optional()}),Ez=ks.extend({messages:T(Pz),modelPreferences:xz.optional(),systemPrompt:y().optional(),includeContext:jt(["none","thisServer","allServers"]).optional(),temperature:de().optional(),maxTokens:de().int(),stopSequences:T(y()).optional(),metadata:it.optional(),tools:T(a0).optional(),toolChoice:kz.optional()}),Cz=st.extend({method:O("sampling/createMessage"),params:Ez}),Wd=at.extend({model:y(),stopReason:Ne(jt(["endTurn","stopSequence","maxTokens"]).or(y())),role:Ts,content:$z}),Jd=at.extend({model:y(),stopReason:Ne(jt(["endTurn","stopSequence","maxTokens","toolUse"]).or(y())),role:Ts,content:$e([zc,T(zc)])}),Tz=R({type:O("boolean"),title:y().optional(),description:y().optional(),default:we().optional()}),Rz=R({type:O("string"),title:y().optional(),description:y().optional(),minLength:de().optional(),maxLength:de().optional(),format:jt(["email","uri","date","date-time"]).optional(),default:y().optional()}),Az=R({type:jt(["number","integer"]),title:y().optional(),description:y().optional(),minimum:de().optional(),maximum:de().optional(),default:de().optional()}),Iz=R({type:O("string"),title:y().optional(),description:y().optional(),enum:T(y()),default:y().optional()}),zz=R({type:O("string"),title:y().optional(),description:y().optional(),oneOf:T(R({const:y(),title:y()})),default:y().optional()}),Dz=R({type:O("string"),title:y().optional(),description:y().optional(),enum:T(y()),enumNames:T(y()).optional(),default:y().optional()}),Oz=$e([Iz,zz]),Nz=R({type:O("array"),title:y().optional(),description:y().optional(),minItems:de().optional(),maxItems:de().optional(),items:R({type:O("string"),enum:T(y())}),default:T(y()).optional()}),jz=R({type:O("array"),title:y().optional(),description:y().optional(),minItems:de().optional(),maxItems:de().optional(),items:R({anyOf:T(R({const:y(),title:y()}))}),default:T(y()).optional()}),Mz=$e([Nz,jz]),Lz=$e([Dz,Oz,Mz]),Zz=$e([Lz,Tz,Rz,Az]),Uz=ks.extend({mode:O("form").optional(),message:y(),requestedSchema:R({type:O("object"),properties:ze(y(),Zz),required:T(y()).optional()})}),qz=ks.extend({mode:O("url"),message:y(),elicitationId:y(),url:y().url()}),Fz=$e([Uz,qz]),Gz=st.extend({method:O("elicitation/create"),params:Fz}),Vz=tr.extend({elicitationId:y()}),Bz=rr.extend({method:O("notifications/elicitation/complete"),params:Vz}),Kc=at.extend({action:jt(["accept","decline","cancel"]),content:Rd(e=>e===null?void 0:e,ze(y(),$e([y(),de(),we(),T(y())])).optional())}),Hz=R({type:O("ref/resource"),uri:y()}),Kz=R({type:O("ref/prompt"),name:y()}),Wz=Ht.extend({ref:$e([Kz,Hz]),argument:R({name:y(),value:y()}),context:R({arguments:ze(y(),y()).optional()}).optional()}),Jz=st.extend({method:O("completion/complete"),params:Wz}),Yz=at.extend({completion:Xe({values:T(y()).max(100),total:Ne(de().int()),hasMore:Ne(we())})}),Qz=R({uri:y().startsWith("file://"),name:y().optional(),_meta:ze(y(),Ie()).optional()}),Xz=st.extend({method:O("roots/list"),params:Ht.optional()}),Yd=at.extend({roots:T(Qz)}),eD=rr.extend({method:O("notifications/roots/list_changed"),params:tr.optional()}),_V=$e([Lc,Nd,Jz,Kd,qd,Ud,Md,BI,Zd,QI,ez,Rs,Hd,Uc,Fc,Gc,Bc]),yV=$e([jc,Zc,Mc,eD,Cs]),vV=$e([Nc,Wd,Jd,Kc,Yd,qc,Vc,ui]),wV=$e([Lc,Cz,Gz,Xz,Uc,Fc,Gc,Bc]),bV=$e([jc,Zc,wz,rz,JI,_z,dz,Cs,Bz]),xV=$e([Nc,MI,Yz,pz,iz,VI,HI,WI,Hc,mz,qc,Vc,ui]),B=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===X.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Id(o.elicitations,r)}return new e(t,r,n)}},Id=class extends B{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(X.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}});function tD(e){return li.parse(JSON.parse(e))}function c0(e){return JSON.stringify(e)+`
|
|
32
|
-
`}var Wc,l0=b(()=>{
|
|
33
|
-
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),
|
|
34
|
-
|
|
35
|
-
`+e.mark.snippet),n+" "+r):n}function
|
|
36
|
-
`+a;for(
|
|
37
|
-
`,a+=
|
|
38
|
-
`,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)
|
|
39
|
-
`;return a.replace(/\n$/,"")}function
|
|
40
|
-
`: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
|
|
41
|
-
`,t-1))}function
|
|
42
|
-
`,i?1+c:c):o===
|
|
43
|
-
`);break}for(n?
|
|
44
|
-
`,i?1+c:c)):
|
|
45
|
-
`,c+1)):c===0?i&&(e.result+=" "):e.result+=
|
|
46
|
-
`,c):e.result+=
|
|
47
|
-
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!
|
|
48
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
28
|
+
path: iss.path ? [${so(w)}, ...iss.path] : [${so(w)}]
|
|
29
|
+
})));`),d.write(`newResult[${so(w)}] = ${x}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");let v=d.compile();return(w,x)=>v(l,w,x)},o,i=ti,s=!cc.jitless,c=s&&jp.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 x=p.shape;for(let k of p.keys){let P=x[k],q=P._zod.run({value:f[k],issues:[]},d),Z=P._zod.optin==="optional"&&P._zod.optout==="optional";q instanceof Promise?h.push(q.then(qe=>Z?yv(qe,l,k,f):wc(qe,l,k))):Z?yv(q,l,k,f):wc(q,l,k)}}if(!u)return h.length?Promise.all(h).then(()=>l):l;let g=[],y=p.keySet,v=u._zod,w=v.def.type;for(let x of Object.keys(f)){if(y.has(x))continue;if(w==="never"){g.push(x);continue}let k=v.run({value:f[x],issues:[]},d);k instanceof Promise?h.push(k.then(P=>wc(P,l,x))):wc(k,l,x)}return g.length&&l.issues.push({code:"unrecognized_keys",keys:g,input:f,inst:e}),h.length?Promise.all(h).then(()=>l):l}});td=S("$ZodUnion",(e,t)=>{he.init(e,t),ke(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ke(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ke(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),ke(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=>fs(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=>_v(s,r,e,n)):_v(i,r,e,n)}}),iw=S("$ZodDiscriminatedUnion",(e,t)=>{td.init(e,t);let r=e._zod.parse;ke(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=ps(()=>{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(!ti(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)}}),sw=S("$ZodIntersection",(e,t)=>{he.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])=>vv(r,c,u)):vv(r,i,s)}});aw=S("$ZodRecord",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!ri(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(...Dr(c,p.issues)),r.value[c]=p.value})):(u.issues.length&&r.issues.push(...Dr(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=>gr(u,n,Nt())),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(...Dr(s,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...Dr(s,c.issues)),r.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>r):r}}),cw=S("$ZodEnum",(e,t)=>{he.init(e,t);let r=ls(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>Mp.has(typeof n)).map(n=>typeof n=="string"?Pn(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}}),uw=S("$ZodLiteral",(e,t)=>{he.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Pn(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}}),lw=S("$ZodTransform",(e,t)=>{he.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 en;return r.value=o,r}}),pw=S("$ZodOptional",(e,t)=>{he.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ke(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ke(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${fs(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)}),dw=S("$ZodNullable",(e,t)=>{he.init(e,t),ke(e._zod,"optin",()=>t.innerType._zod.optin),ke(e._zod,"optout",()=>t.innerType._zod.optout),ke(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${fs(r.source)}|null)$`):void 0}),ke(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)}),fw=S("$ZodDefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",ke(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=>wv(i,t)):wv(o,t)}});hw=S("$ZodPrefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",ke(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))}),mw=S("$ZodNonOptional",(e,t)=>{he.init(e,t),ke(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=>bv(i,e)):bv(o,e)}});gw=S("$ZodCatch",(e,t)=>{he.init(e,t),e._zod.optin="optional",ke(e._zod,"optout",()=>t.innerType._zod.optout),ke(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=>gr(s,n,Nt()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>gr(i,n,Nt()))},input:r.value}),r.issues=[]),r)}}),yw=S("$ZodPipe",(e,t)=>{he.init(e,t),ke(e._zod,"values",()=>t.in._zod.values),ke(e._zod,"optin",()=>t.in._zod.optin),ke(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=>xv(i,t,n)):xv(o,t,n)}});_w=S("$ZodReadonly",(e,t)=>{he.init(e,t),ke(e._zod,"propValues",()=>t.innerType._zod.propValues),ke(e._zod,"values",()=>t.innerType._zod.values),ke(e._zod,"optin",()=>t.innerType._zod.optin),ke(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(kv):kv(o)}});vw=S("$ZodCustom",(e,t)=>{mt.init(e,t),he.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=>Sv(i,r,n,e));Sv(o,r,n,e)}})});function bw(){return{localeError:yR()}}var gR,yR,xw=b(()=>{Or();gR=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},yR=()=>{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 ${gR(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${dc(n.values[0])}`:`Invalid option: expected one of ${lc(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":""}: ${lc(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 xc=b(()=>{});function nd(){return new _s}var kw,Sw,_s,tn,od=b(()=>{kw=Symbol("ZodOutput"),Sw=Symbol("ZodInput"),_s=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)}};tn=nd()});function $w(e,t){return new e({type:"string",...j(t)})}function Pw(e,t){return new e({type:"string",coerce:!0,...j(t)})}function Ew(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...j(t)})}function id(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...j(t)})}function Cw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...j(t)})}function Tw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(t)})}function Aw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(t)})}function Rw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(t)})}function sd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...j(t)})}function Iw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...j(t)})}function zw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(t)})}function Dw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...j(t)})}function Ow(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(t)})}function Nw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...j(t)})}function jw(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...j(t)})}function Mw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(t)})}function Lw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(t)})}function Zw(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(t)})}function Uw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(t)})}function qw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(t)})}function Fw(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...j(t)})}function Gw(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...j(t)})}function Vw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...j(t)})}function Bw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...j(t)})}function Hw(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(t)})}function Ww(e,t){return new e({type:"string",format:"date",check:"string_format",...j(t)})}function Kw(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...j(t)})}function Jw(e,t){return new e({type:"string",format:"duration",check:"string_format",...j(t)})}function Yw(e,t){return new e({type:"number",checks:[],...j(t)})}function Qw(e,t){return new e({type:"number",coerce:!0,checks:[],...j(t)})}function Xw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...j(t)})}function eb(e,t){return new e({type:"boolean",...j(t)})}function tb(e,t){return new e({type:"boolean",coerce:!0,...j(t)})}function rb(e,t){return new e({type:"bigint",coerce:!0,...j(t)})}function nb(e,t){return new e({type:"null",...j(t)})}function ob(e){return new e({type:"any"})}function ib(e){return new e({type:"unknown"})}function sb(e,t){return new e({type:"never",...j(t)})}function ab(e,t){return new e({type:"date",coerce:!0,...j(t)})}function ni(e,t){return new Kp({check:"less_than",...j(t),value:e,inclusive:!1})}function rn(e,t){return new Kp({check:"less_than",...j(t),value:e,inclusive:!0})}function oi(e,t){return new Jp({check:"greater_than",...j(t),value:e,inclusive:!1})}function yr(e,t){return new Jp({check:"greater_than",...j(t),value:e,inclusive:!0})}function vs(e,t){return new rv({check:"multiple_of",...j(t),value:e})}function kc(e,t){return new ov({check:"max_length",...j(t),maximum:e})}function ii(e,t){return new iv({check:"min_length",...j(t),minimum:e})}function Sc(e,t){return new sv({check:"length_equals",...j(t),length:e})}function ad(e,t){return new av({check:"string_format",format:"regex",...j(t),pattern:e})}function cd(e){return new cv({check:"string_format",format:"lowercase",...j(e)})}function ud(e){return new uv({check:"string_format",format:"uppercase",...j(e)})}function ld(e,t){return new lv({check:"string_format",format:"includes",...j(t),includes:e})}function pd(e,t){return new pv({check:"string_format",format:"starts_with",...j(t),prefix:e})}function dd(e,t){return new dv({check:"string_format",format:"ends_with",...j(t),suffix:e})}function co(e){return new fv({check:"overwrite",tx:e})}function fd(e){return co(t=>t.normalize(e))}function hd(){return co(e=>e.trim())}function md(){return co(e=>e.toLowerCase())}function gd(){return co(e=>e.toUpperCase())}function cb(e,t,r){return new e({type:"array",element:t,...j(r)})}function ub(e,t,r){let n=j(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function lb(e,t,r){return new e({type:"custom",check:"custom",fn:t,...j(r)})}var pb=b(()=>{_c();Or()});var db=b(()=>{});function Pc(e,t){if(e instanceof _s){let n=new $c(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 $c(t);return r.process(e),r.emit(e,t)}function Je(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 Je(o.element,r);case"object":{for(let i in o.shape)if(Je(o.shape[i],r))return!0;return!1}case"union":{for(let i of o.options)if(Je(i,r))return!0;return!1}case"intersection":return Je(o.left,r)||Je(o.right,r);case"tuple":{for(let i of o.items)if(Je(i,r))return!0;return!!(o.rest&&Je(o.rest,r))}case"record":return Je(o.keyType,r)||Je(o.valueType,r);case"map":return Je(o.keyType,r)||Je(o.valueType,r);case"set":return Je(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Je(o.innerType,r);case"lazy":return Je(o.getter(),r);case"default":return Je(o.innerType,r);case"prefault":return Je(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Je(o.in,r)||Je(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}var $c,fb=b(()=>{od();Or();$c=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??tn,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:v,patterns:w,contentEncoding:x}=t._zod.bag;if(typeof g=="number"&&(h.minLength=g),typeof y=="number"&&(h.maxLength=y),v&&(h.format=i[v]??v,h.format===""&&delete h.format),x&&(h.contentEncoding=x),w&&w.size>0){let k=[...w];k.length===1?h.pattern=k[0].source:k.length>1&&(a.schema.allOf=[...k.map(P=>({...this.target==="draft-7"?{type:"string"}:{},pattern:P.source}))])}break}case"number":{let h=f,{minimum:g,maximum:y,format:v,multipleOf:w,exclusiveMaximum:x,exclusiveMinimum:k}=t._zod.bag;typeof v=="string"&&v.includes("int")?h.type="integer":h.type="number",typeof k=="number"&&(h.exclusiveMinimum=k),typeof g=="number"&&(h.minimum=g,typeof k=="number"&&(k>=g?delete h.minimum:delete h.exclusiveMinimum)),typeof x=="number"&&(h.exclusiveMaximum=x),typeof y=="number"&&(h.maximum=y,typeof x=="number"&&(x<=y?delete h.maximum:delete h.exclusiveMaximum)),typeof w=="number"&&(h.multipleOf=w);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 w in g)h.properties[w]=this.process(g[w],{...l,path:[...l.path,"properties",w]});let y=new Set(Object.keys(g)),v=new Set([...y].filter(w=>{let x=o.shape[w]._zod;return this.io==="input"?x.optin===void 0:x.optout===void 0}));v.size>0&&(h.required=Array.from(v)),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]}),v=x=>"allOf"in x&&Object.keys(x).length===1,w=[...v(g)?g.allOf:[g],...v(y)?y.allOf:[y]];h.allOf=w;break}case"tuple":{let h=f;h.type="array";let g=o.items.map((w,x)=>this.process(w,{...l,path:[...l.path,"prefixItems",x]}));if(this.target==="draft-2020-12"?h.prefixItems=g:h.items=g,o.rest){let w=this.process(o.rest,{...l,path:[...l.path,"items"]});this.target==="draft-2020-12"?h.items=w:h.additionalItems=w}o.rest&&(h.items=this.process(o.rest,{...l,path:[...l.path,"items"]}));let{minimum:y,maximum:v}=t._zod.bag;typeof y=="number"&&(h.minItems=y),typeof v=="number"&&(h.maxItems=v);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=ls(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:v,mime:w}=t._zod.bag;y!==void 0&&(g.minLength=y),v!==void 0&&(g.maxLength=v),w?w.length===1?(g.contentMediaType=w[0],Object.assign(h,g)):h.anyOf=w.map(x=>({...g,contentMediaType:x})):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"&&Je(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??(w=>w);if(g)return{ref:y(g)};let v=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=v,{defId:v,ref:`${y("__shared")}#/${l}/${v}`}}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>
|
|
30
|
+
|
|
31
|
+
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 hb=b(()=>{});var Pt=b(()=>{ei();Bp();Fp();ww();_c();Qp();Or();yc();xc();od();Yp();db();pb();fb();hb()});var yd=b(()=>{Pt()});var ws={};Xt(ws,{ZodISODate:()=>gb,ZodISODateTime:()=>mb,ZodISODuration:()=>_b,ZodISOTime:()=>yb,date:()=>vd,datetime:()=>_d,duration:()=>bd,time:()=>wd});function _d(e){return Hw(mb,e)}function vd(e){return Ww(gb,e)}function wd(e){return Kw(yb,e)}function bd(e){return Jw(_b,e)}var mb,gb,yb,_b,xd=b(()=>{Pt();Ec();mb=S("ZodISODateTime",(e,t)=>{Nv.init(e,t),Re.init(e,t)});gb=S("ZodISODate",(e,t)=>{jv.init(e,t),Re.init(e,t)});yb=S("ZodISOTime",(e,t)=>{Mv.init(e,t),Re.init(e,t)});_b=S("ZodISODuration",(e,t)=>{Lv.init(e,t),Re.init(e,t)})});var wb,p7,bs,kd=b(()=>{Pt();Pt();wb=(e,t)=>{fc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>mc(e,r)},flatten:{value:r=>hc(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},p7=S("ZodError",wb),bs=S("ZodError",wb,{Parent:Error})});var bb,xb,kb,Sb,Sd=b(()=>{Pt();kd();bb=k_(bs),xb=S_(bs),kb=Gp(bs),Sb=Vp(bs)});function _(e){return $w(Ed,e)}function Ab(e){return sd(Tb,e)}function de(e){return Yw(Tc,e)}function Pb(e){return Xw(ZR,e)}function we(e){return eb(Cd,e)}function Td(e){return nb(UR,e)}function Ib(){return ob(qR)}function Ie(){return ib(FR)}function VR(e){return sb(GR,e)}function T(e,t){return cb(BR,e,t)}function A(e,t){let r={type:"object",get shape(){return pe.assignProp(this,"shape",{...e}),this.shape},...pe.normalizeParams(t)};return new Db(r)}function Ye(e,t){return new Db({type:"object",get shape(){return pe.assignProp(this,"shape",{...e}),this.shape},catchall:Ie(),...pe.normalizeParams(t)})}function $e(e,t){return new Ob({type:"union",options:e,...pe.normalizeParams(t)})}function Ad(e,t,r){return new HR({type:"union",options:t,discriminator:e,...pe.normalizeParams(r)})}function Ac(e,t){return new WR({type:"intersection",left:e,right:t})}function ze(e,t,r){return new KR({type:"record",keyType:e,valueType:t,...pe.normalizeParams(r)})}function jt(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new $d({type:"enum",entries:r,...pe.normalizeParams(t)})}function O(e,t){return new JR({type:"literal",values:Array.isArray(e)?e:[e],...pe.normalizeParams(t)})}function Nb(e){return new YR({type:"transform",transform:e})}function Ne(e){return new jb({type:"optional",innerType:e})}function Eb(e){return new QR({type:"nullable",innerType:e})}function eI(e,t){return new XR({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function rI(e,t){return new tI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function nI(e,t){return new Mb({type:"nonoptional",innerType:e,...pe.normalizeParams(t)})}function iI(e,t){return new oI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function Pd(e,t){return new sI({type:"pipe",in:e,out:t})}function cI(e){return new aI({type:"readonly",innerType:e})}function uI(e){let t=new mt({check:"custom"});return t._zod.check=e,t}function Zb(e,t){return ub(Lb,e??(()=>!0),t)}function lI(e,t={}){return lb(Lb,e,t)}function pI(e){let t=uI(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(pe.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(pe.issue(o))}},e(r.value,r)));return t}function Rd(e,t){return Pd(Nb(e),t)}var Se,Cb,Ed,Re,SR,$b,Cc,Tb,$R,PR,ER,CR,TR,AR,RR,IR,zR,DR,OR,NR,jR,MR,LR,Tc,ZR,Cd,Rb,UR,qR,FR,GR,zb,BR,Db,Ob,HR,WR,KR,$d,JR,YR,jb,QR,XR,tI,Mb,oI,sI,aI,Lb,Ec=b(()=>{Pt();Pt();yd();xd();Sd();Se=S("ZodType",(e,t)=>(he.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)=>er(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>bb(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>kb(e,r,n),e.parseAsync=async(r,n)=>xb(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Sb(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(lI(r,n)),e.superRefine=r=>e.check(pI(r)),e.overwrite=r=>e.check(co(r)),e.optional=()=>Ne(e),e.nullable=()=>Eb(e),e.nullish=()=>Ne(Eb(e)),e.nonoptional=r=>nI(e,r),e.array=()=>T(e),e.or=r=>$e([e,r]),e.and=r=>Ac(e,r),e.transform=r=>Pd(e,Nb(r)),e.default=r=>eI(e,r),e.prefault=r=>rI(e,r),e.catch=r=>iI(e,r),e.pipe=r=>Pd(e,r),e.readonly=()=>cI(e),e.describe=r=>{let n=e.clone();return tn.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return tn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return tn.get(e);let n=e.clone();return tn.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Cb=S("_ZodString",(e,t)=>{bc.init(e,t),Se.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(ad(...n)),e.includes=(...n)=>e.check(ld(...n)),e.startsWith=(...n)=>e.check(pd(...n)),e.endsWith=(...n)=>e.check(dd(...n)),e.min=(...n)=>e.check(ii(...n)),e.max=(...n)=>e.check(kc(...n)),e.length=(...n)=>e.check(Sc(...n)),e.nonempty=(...n)=>e.check(ii(1,...n)),e.lowercase=n=>e.check(cd(n)),e.uppercase=n=>e.check(ud(n)),e.trim=()=>e.check(hd()),e.normalize=(...n)=>e.check(fd(...n)),e.toLowerCase=()=>e.check(md()),e.toUpperCase=()=>e.check(gd())}),Ed=S("ZodString",(e,t)=>{bc.init(e,t),Cb.init(e,t),e.email=r=>e.check(Ew(SR,r)),e.url=r=>e.check(sd(Tb,r)),e.jwt=r=>e.check(Bw(LR,r)),e.emoji=r=>e.check(Iw($R,r)),e.guid=r=>e.check(id($b,r)),e.uuid=r=>e.check(Cw(Cc,r)),e.uuidv4=r=>e.check(Tw(Cc,r)),e.uuidv6=r=>e.check(Aw(Cc,r)),e.uuidv7=r=>e.check(Rw(Cc,r)),e.nanoid=r=>e.check(zw(PR,r)),e.guid=r=>e.check(id($b,r)),e.cuid=r=>e.check(Dw(ER,r)),e.cuid2=r=>e.check(Ow(CR,r)),e.ulid=r=>e.check(Nw(TR,r)),e.base64=r=>e.check(Fw(NR,r)),e.base64url=r=>e.check(Gw(jR,r)),e.xid=r=>e.check(jw(AR,r)),e.ksuid=r=>e.check(Mw(RR,r)),e.ipv4=r=>e.check(Lw(IR,r)),e.ipv6=r=>e.check(Zw(zR,r)),e.cidrv4=r=>e.check(Uw(DR,r)),e.cidrv6=r=>e.check(qw(OR,r)),e.e164=r=>e.check(Vw(MR,r)),e.datetime=r=>e.check(_d(r)),e.date=r=>e.check(vd(r)),e.time=r=>e.check(wd(r)),e.duration=r=>e.check(bd(r))});Re=S("ZodStringFormat",(e,t)=>{Ee.init(e,t),Cb.init(e,t)}),SR=S("ZodEmail",(e,t)=>{Ev.init(e,t),Re.init(e,t)}),$b=S("ZodGUID",(e,t)=>{$v.init(e,t),Re.init(e,t)}),Cc=S("ZodUUID",(e,t)=>{Pv.init(e,t),Re.init(e,t)}),Tb=S("ZodURL",(e,t)=>{Cv.init(e,t),Re.init(e,t)});$R=S("ZodEmoji",(e,t)=>{Tv.init(e,t),Re.init(e,t)}),PR=S("ZodNanoID",(e,t)=>{Av.init(e,t),Re.init(e,t)}),ER=S("ZodCUID",(e,t)=>{Rv.init(e,t),Re.init(e,t)}),CR=S("ZodCUID2",(e,t)=>{Iv.init(e,t),Re.init(e,t)}),TR=S("ZodULID",(e,t)=>{zv.init(e,t),Re.init(e,t)}),AR=S("ZodXID",(e,t)=>{Dv.init(e,t),Re.init(e,t)}),RR=S("ZodKSUID",(e,t)=>{Ov.init(e,t),Re.init(e,t)}),IR=S("ZodIPv4",(e,t)=>{Zv.init(e,t),Re.init(e,t)}),zR=S("ZodIPv6",(e,t)=>{Uv.init(e,t),Re.init(e,t)}),DR=S("ZodCIDRv4",(e,t)=>{qv.init(e,t),Re.init(e,t)}),OR=S("ZodCIDRv6",(e,t)=>{Fv.init(e,t),Re.init(e,t)}),NR=S("ZodBase64",(e,t)=>{Vv.init(e,t),Re.init(e,t)}),jR=S("ZodBase64URL",(e,t)=>{Bv.init(e,t),Re.init(e,t)}),MR=S("ZodE164",(e,t)=>{Hv.init(e,t),Re.init(e,t)}),LR=S("ZodJWT",(e,t)=>{Wv.init(e,t),Re.init(e,t)}),Tc=S("ZodNumber",(e,t)=>{ed.init(e,t),Se.init(e,t),e.gt=(n,o)=>e.check(oi(n,o)),e.gte=(n,o)=>e.check(yr(n,o)),e.min=(n,o)=>e.check(yr(n,o)),e.lt=(n,o)=>e.check(ni(n,o)),e.lte=(n,o)=>e.check(rn(n,o)),e.max=(n,o)=>e.check(rn(n,o)),e.int=n=>e.check(Pb(n)),e.safe=n=>e.check(Pb(n)),e.positive=n=>e.check(oi(0,n)),e.nonnegative=n=>e.check(yr(0,n)),e.negative=n=>e.check(ni(0,n)),e.nonpositive=n=>e.check(rn(0,n)),e.multipleOf=(n,o)=>e.check(vs(n,o)),e.step=(n,o)=>e.check(vs(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});ZR=S("ZodNumberFormat",(e,t)=>{Kv.init(e,t),Tc.init(e,t)});Cd=S("ZodBoolean",(e,t)=>{Jv.init(e,t),Se.init(e,t)});Rb=S("ZodBigInt",(e,t)=>{Yv.init(e,t),Se.init(e,t),e.gte=(n,o)=>e.check(yr(n,o)),e.min=(n,o)=>e.check(yr(n,o)),e.gt=(n,o)=>e.check(oi(n,o)),e.gte=(n,o)=>e.check(yr(n,o)),e.min=(n,o)=>e.check(yr(n,o)),e.lt=(n,o)=>e.check(ni(n,o)),e.lte=(n,o)=>e.check(rn(n,o)),e.max=(n,o)=>e.check(rn(n,o)),e.positive=n=>e.check(oi(BigInt(0),n)),e.negative=n=>e.check(ni(BigInt(0),n)),e.nonpositive=n=>e.check(rn(BigInt(0),n)),e.nonnegative=n=>e.check(yr(BigInt(0),n)),e.multipleOf=(n,o)=>e.check(vs(n,o));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null}),UR=S("ZodNull",(e,t)=>{Qv.init(e,t),Se.init(e,t)});qR=S("ZodAny",(e,t)=>{Xv.init(e,t),Se.init(e,t)});FR=S("ZodUnknown",(e,t)=>{ew.init(e,t),Se.init(e,t)});GR=S("ZodNever",(e,t)=>{tw.init(e,t),Se.init(e,t)});zb=S("ZodDate",(e,t)=>{rw.init(e,t),Se.init(e,t),e.min=(n,o)=>e.check(yr(n,o)),e.max=(n,o)=>e.check(rn(n,o));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null}),BR=S("ZodArray",(e,t)=>{nw.init(e,t),Se.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(ii(r,n)),e.nonempty=r=>e.check(ii(1,r)),e.max=(r,n)=>e.check(kc(r,n)),e.length=(r,n)=>e.check(Sc(r,n)),e.unwrap=()=>e.element});Db=S("ZodObject",(e,t)=>{ow.init(e,t),Se.init(e,t),pe.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>jt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ie()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ie()}),e.strict=()=>e.clone({...e._zod.def,catchall:VR()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>pe.extend(e,r),e.merge=r=>pe.merge(e,r),e.pick=r=>pe.pick(e,r),e.omit=r=>pe.omit(e,r),e.partial=(...r)=>pe.partial(jb,e,r[0]),e.required=(...r)=>pe.required(Mb,e,r[0])});Ob=S("ZodUnion",(e,t)=>{td.init(e,t),Se.init(e,t),e.options=t.options});HR=S("ZodDiscriminatedUnion",(e,t)=>{Ob.init(e,t),iw.init(e,t)});WR=S("ZodIntersection",(e,t)=>{sw.init(e,t),Se.init(e,t)});KR=S("ZodRecord",(e,t)=>{aw.init(e,t),Se.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});$d=S("ZodEnum",(e,t)=>{cw.init(e,t),Se.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 $d({...t,checks:[],...pe.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 $d({...t,checks:[],...pe.normalizeParams(o),entries:i})}});JR=S("ZodLiteral",(e,t)=>{uw.init(e,t),Se.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]}})});YR=S("ZodTransform",(e,t)=>{lw.init(e,t),Se.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=i=>{if(typeof i=="string")r.issues.push(pe.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(pe.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});jb=S("ZodOptional",(e,t)=>{pw.init(e,t),Se.init(e,t),e.unwrap=()=>e._zod.def.innerType});QR=S("ZodNullable",(e,t)=>{dw.init(e,t),Se.init(e,t),e.unwrap=()=>e._zod.def.innerType});XR=S("ZodDefault",(e,t)=>{fw.init(e,t),Se.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});tI=S("ZodPrefault",(e,t)=>{hw.init(e,t),Se.init(e,t),e.unwrap=()=>e._zod.def.innerType});Mb=S("ZodNonOptional",(e,t)=>{mw.init(e,t),Se.init(e,t),e.unwrap=()=>e._zod.def.innerType});oI=S("ZodCatch",(e,t)=>{gw.init(e,t),Se.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});sI=S("ZodPipe",(e,t)=>{yw.init(e,t),Se.init(e,t),e.in=t.in,e.out=t.out});aI=S("ZodReadonly",(e,t)=>{_w.init(e,t),Se.init(e,t)});Lb=S("ZodCustom",(e,t)=>{vw.init(e,t),Se.init(e,t)})});var Ub,qb=b(()=>{Ub={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"}});var Rc={};Xt(Rc,{bigint:()=>mI,boolean:()=>hI,date:()=>gI,number:()=>fI,string:()=>dI});function dI(e){return Pw(Ed,e)}function fI(e){return Qw(Tc,e)}function hI(e){return tb(Cd,e)}function mI(e){return rb(Rb,e)}function gI(e){return ab(zb,e)}var Fb=b(()=>{Pt();Ec()});var Gb=b(()=>{Pt();Ec();yd();kd();Sd();qb();Pt();xw();Pt();xc();xd();Fb();Nt(bw())});var Vb=b(()=>{Gb()});var Id=b(()=>{Vb()});var ai,Hb,En,zc,it,Wb,Kb,nV,bI,xI,Dd,Bt,xs,Jb,st,tr,rr,at,Dc,Yb,lo,Qb,Xb,Od,po,X,Nd,e0,ci,oV,Oc,kI,Nc,SI,ks,si,t0,$I,PI,EI,CI,TI,AI,jd,RI,II,jc,r0,Mc,zI,DI,Lc,OI,Ss,$s,NI,Ps,ui,jI,Es,Zc,Uc,qc,iV,Fc,Gc,Vc,n0,o0,i0,Md,s0,Cs,li,a0,MI,Ld,LI,ZI,UI,Zd,qI,Ud,FI,GI,VI,BI,HI,WI,KI,JI,YI,QI,qd,XI,ez,Fd,Gd,Vd,Bd,tz,rz,nz,Hd,oz,iz,sz,az,cz,c0,Wd,uz,Bc,sV,lz,Ts,pz,aV,As,dz,Kd,fz,hz,mz,gz,yz,_z,vz,Ic,wz,bz,xz,Jd,Yd,kz,Sz,$z,Pz,Ez,Cz,Tz,Az,Rz,Iz,zz,Dz,Oz,Nz,jz,Mz,Lz,Zz,Hc,Uz,qz,Fz,Gz,Vz,Bz,Hz,Qd,Wz,cV,uV,lV,pV,dV,fV,B,zd,Cn=b(()=>{Id();ai="2025-11-25",Hb=[ai,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],En="io.modelcontextprotocol/related-task",zc="2.0",it=Zb(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Wb=$e([_(),de().int()]),Kb=_(),nV=Ye({ttl:$e([de(),Td()]).optional(),pollInterval:de().optional()}),bI=A({ttl:de().optional()}),xI=A({taskId:_()}),Dd=Ye({progressToken:Wb.optional(),[En]:xI.optional()}),Bt=A({_meta:Dd.optional()}),xs=Bt.extend({task:bI.optional()}),Jb=e=>xs.safeParse(e).success,st=A({method:_(),params:Bt.loose().optional()}),tr=A({_meta:Dd.optional()}),rr=A({method:_(),params:tr.loose().optional()}),at=Ye({_meta:Dd.optional()}),Dc=$e([_(),de().int()]),Yb=A({jsonrpc:O(zc),id:Dc,...st.shape}).strict(),lo=e=>Yb.safeParse(e).success,Qb=A({jsonrpc:O(zc),...rr.shape}).strict(),Xb=e=>Qb.safeParse(e).success,Od=A({jsonrpc:O(zc),id:Dc,result:at}).strict(),po=e=>Od.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"})(X||(X={}));Nd=A({jsonrpc:O(zc),id:Dc.optional(),error:A({code:de().int(),message:_(),data:Ie().optional()})}).strict(),e0=e=>Nd.safeParse(e).success,ci=$e([Yb,Qb,Od,Nd]),oV=$e([Od,Nd]),Oc=at.strict(),kI=tr.extend({requestId:Dc.optional(),reason:_().optional()}),Nc=rr.extend({method:O("notifications/cancelled"),params:kI}),SI=A({src:_(),mimeType:_().optional(),sizes:T(_()).optional(),theme:jt(["light","dark"]).optional()}),ks=A({icons:T(SI).optional()}),si=A({name:_(),title:_().optional()}),t0=si.extend({...si.shape,...ks.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),$I=Ac(A({applyDefaults:we().optional()}),ze(_(),Ie())),PI=Rd(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Ac(A({form:$I.optional(),url:it.optional()}),ze(_(),Ie()).optional())),EI=Ye({list:it.optional(),cancel:it.optional(),requests:Ye({sampling:Ye({createMessage:it.optional()}).optional(),elicitation:Ye({create:it.optional()}).optional()}).optional()}),CI=Ye({list:it.optional(),cancel:it.optional(),requests:Ye({tools:Ye({call:it.optional()}).optional()}).optional()}),TI=A({experimental:ze(_(),it).optional(),sampling:A({context:it.optional(),tools:it.optional()}).optional(),elicitation:PI.optional(),roots:A({listChanged:we().optional()}).optional(),tasks:EI.optional()}),AI=Bt.extend({protocolVersion:_(),capabilities:TI,clientInfo:t0}),jd=st.extend({method:O("initialize"),params:AI}),RI=A({experimental:ze(_(),it).optional(),logging:it.optional(),completions:it.optional(),prompts:A({listChanged:we().optional()}).optional(),resources:A({subscribe:we().optional(),listChanged:we().optional()}).optional(),tools:A({listChanged:we().optional()}).optional(),tasks:CI.optional()}),II=at.extend({protocolVersion:_(),capabilities:RI,serverInfo:t0,instructions:_().optional()}),jc=rr.extend({method:O("notifications/initialized"),params:tr.optional()}),r0=e=>jc.safeParse(e).success,Mc=st.extend({method:O("ping"),params:Bt.optional()}),zI=A({progress:de(),total:Ne(de()),message:Ne(_())}),DI=A({...tr.shape,...zI.shape,progressToken:Wb}),Lc=rr.extend({method:O("notifications/progress"),params:DI}),OI=Bt.extend({cursor:Kb.optional()}),Ss=st.extend({params:OI.optional()}),$s=at.extend({nextCursor:Kb.optional()}),NI=jt(["working","input_required","completed","failed","cancelled"]),Ps=A({taskId:_(),status:NI,ttl:$e([de(),Td()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:Ne(de()),statusMessage:Ne(_())}),ui=at.extend({task:Ps}),jI=tr.merge(Ps),Es=rr.extend({method:O("notifications/tasks/status"),params:jI}),Zc=st.extend({method:O("tasks/get"),params:Bt.extend({taskId:_()})}),Uc=at.merge(Ps),qc=st.extend({method:O("tasks/result"),params:Bt.extend({taskId:_()})}),iV=at.loose(),Fc=Ss.extend({method:O("tasks/list")}),Gc=$s.extend({tasks:T(Ps)}),Vc=st.extend({method:O("tasks/cancel"),params:Bt.extend({taskId:_()})}),n0=at.merge(Ps),o0=A({uri:_(),mimeType:Ne(_()),_meta:ze(_(),Ie()).optional()}),i0=o0.extend({text:_()}),Md=_().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),s0=o0.extend({blob:Md}),Cs=jt(["user","assistant"]),li=A({audience:T(Cs).optional(),priority:de().min(0).max(1).optional(),lastModified:ws.datetime({offset:!0}).optional()}),a0=A({...si.shape,...ks.shape,uri:_(),description:Ne(_()),mimeType:Ne(_()),annotations:li.optional(),_meta:Ne(Ye({}))}),MI=A({...si.shape,...ks.shape,uriTemplate:_(),description:Ne(_()),mimeType:Ne(_()),annotations:li.optional(),_meta:Ne(Ye({}))}),Ld=Ss.extend({method:O("resources/list")}),LI=$s.extend({resources:T(a0)}),ZI=Ss.extend({method:O("resources/templates/list")}),UI=$s.extend({resourceTemplates:T(MI)}),Zd=Bt.extend({uri:_()}),qI=Zd,Ud=st.extend({method:O("resources/read"),params:qI}),FI=at.extend({contents:T($e([i0,s0]))}),GI=rr.extend({method:O("notifications/resources/list_changed"),params:tr.optional()}),VI=Zd,BI=st.extend({method:O("resources/subscribe"),params:VI}),HI=Zd,WI=st.extend({method:O("resources/unsubscribe"),params:HI}),KI=tr.extend({uri:_()}),JI=rr.extend({method:O("notifications/resources/updated"),params:KI}),YI=A({name:_(),description:Ne(_()),required:Ne(we())}),QI=A({...si.shape,...ks.shape,description:Ne(_()),arguments:Ne(T(YI)),_meta:Ne(Ye({}))}),qd=Ss.extend({method:O("prompts/list")}),XI=$s.extend({prompts:T(QI)}),ez=Bt.extend({name:_(),arguments:ze(_(),_()).optional()}),Fd=st.extend({method:O("prompts/get"),params:ez}),Gd=A({type:O("text"),text:_(),annotations:li.optional(),_meta:ze(_(),Ie()).optional()}),Vd=A({type:O("image"),data:Md,mimeType:_(),annotations:li.optional(),_meta:ze(_(),Ie()).optional()}),Bd=A({type:O("audio"),data:Md,mimeType:_(),annotations:li.optional(),_meta:ze(_(),Ie()).optional()}),tz=A({type:O("tool_use"),name:_(),id:_(),input:ze(_(),Ie()),_meta:ze(_(),Ie()).optional()}),rz=A({type:O("resource"),resource:$e([i0,s0]),annotations:li.optional(),_meta:ze(_(),Ie()).optional()}),nz=a0.extend({type:O("resource_link")}),Hd=$e([Gd,Vd,Bd,nz,rz]),oz=A({role:Cs,content:Hd}),iz=at.extend({description:_().optional(),messages:T(oz)}),sz=rr.extend({method:O("notifications/prompts/list_changed"),params:tr.optional()}),az=A({title:_().optional(),readOnlyHint:we().optional(),destructiveHint:we().optional(),idempotentHint:we().optional(),openWorldHint:we().optional()}),cz=A({taskSupport:jt(["required","optional","forbidden"]).optional()}),c0=A({...si.shape,...ks.shape,description:_().optional(),inputSchema:A({type:O("object"),properties:ze(_(),it).optional(),required:T(_()).optional()}).catchall(Ie()),outputSchema:A({type:O("object"),properties:ze(_(),it).optional(),required:T(_()).optional()}).catchall(Ie()).optional(),annotations:az.optional(),execution:cz.optional(),_meta:ze(_(),Ie()).optional()}),Wd=Ss.extend({method:O("tools/list")}),uz=$s.extend({tools:T(c0)}),Bc=at.extend({content:T(Hd).default([]),structuredContent:ze(_(),Ie()).optional(),isError:we().optional()}),sV=Bc.or(at.extend({toolResult:Ie()})),lz=xs.extend({name:_(),arguments:ze(_(),Ie()).optional()}),Ts=st.extend({method:O("tools/call"),params:lz}),pz=rr.extend({method:O("notifications/tools/list_changed"),params:tr.optional()}),aV=A({autoRefresh:we().default(!0),debounceMs:de().int().nonnegative().default(300)}),As=jt(["debug","info","notice","warning","error","critical","alert","emergency"]),dz=Bt.extend({level:As}),Kd=st.extend({method:O("logging/setLevel"),params:dz}),fz=tr.extend({level:As,logger:_().optional(),data:Ie()}),hz=rr.extend({method:O("notifications/message"),params:fz}),mz=A({name:_().optional()}),gz=A({hints:T(mz).optional(),costPriority:de().min(0).max(1).optional(),speedPriority:de().min(0).max(1).optional(),intelligencePriority:de().min(0).max(1).optional()}),yz=A({mode:jt(["auto","required","none"]).optional()}),_z=A({type:O("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:T(Hd).default([]),structuredContent:A({}).loose().optional(),isError:we().optional(),_meta:ze(_(),Ie()).optional()}),vz=Ad("type",[Gd,Vd,Bd]),Ic=Ad("type",[Gd,Vd,Bd,tz,_z]),wz=A({role:Cs,content:$e([Ic,T(Ic)]),_meta:ze(_(),Ie()).optional()}),bz=xs.extend({messages:T(wz),modelPreferences:gz.optional(),systemPrompt:_().optional(),includeContext:jt(["none","thisServer","allServers"]).optional(),temperature:de().optional(),maxTokens:de().int(),stopSequences:T(_()).optional(),metadata:it.optional(),tools:T(c0).optional(),toolChoice:yz.optional()}),xz=st.extend({method:O("sampling/createMessage"),params:bz}),Jd=at.extend({model:_(),stopReason:Ne(jt(["endTurn","stopSequence","maxTokens"]).or(_())),role:Cs,content:vz}),Yd=at.extend({model:_(),stopReason:Ne(jt(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:Cs,content:$e([Ic,T(Ic)])}),kz=A({type:O("boolean"),title:_().optional(),description:_().optional(),default:we().optional()}),Sz=A({type:O("string"),title:_().optional(),description:_().optional(),minLength:de().optional(),maxLength:de().optional(),format:jt(["email","uri","date","date-time"]).optional(),default:_().optional()}),$z=A({type:jt(["number","integer"]),title:_().optional(),description:_().optional(),minimum:de().optional(),maximum:de().optional(),default:de().optional()}),Pz=A({type:O("string"),title:_().optional(),description:_().optional(),enum:T(_()),default:_().optional()}),Ez=A({type:O("string"),title:_().optional(),description:_().optional(),oneOf:T(A({const:_(),title:_()})),default:_().optional()}),Cz=A({type:O("string"),title:_().optional(),description:_().optional(),enum:T(_()),enumNames:T(_()).optional(),default:_().optional()}),Tz=$e([Pz,Ez]),Az=A({type:O("array"),title:_().optional(),description:_().optional(),minItems:de().optional(),maxItems:de().optional(),items:A({type:O("string"),enum:T(_())}),default:T(_()).optional()}),Rz=A({type:O("array"),title:_().optional(),description:_().optional(),minItems:de().optional(),maxItems:de().optional(),items:A({anyOf:T(A({const:_(),title:_()}))}),default:T(_()).optional()}),Iz=$e([Az,Rz]),zz=$e([Cz,Tz,Iz]),Dz=$e([zz,kz,Sz,$z]),Oz=xs.extend({mode:O("form").optional(),message:_(),requestedSchema:A({type:O("object"),properties:ze(_(),Dz),required:T(_()).optional()})}),Nz=xs.extend({mode:O("url"),message:_(),elicitationId:_(),url:_().url()}),jz=$e([Oz,Nz]),Mz=st.extend({method:O("elicitation/create"),params:jz}),Lz=tr.extend({elicitationId:_()}),Zz=rr.extend({method:O("notifications/elicitation/complete"),params:Lz}),Hc=at.extend({action:jt(["accept","decline","cancel"]),content:Rd(e=>e===null?void 0:e,ze(_(),$e([_(),de(),we(),T(_())])).optional())}),Uz=A({type:O("ref/resource"),uri:_()}),qz=A({type:O("ref/prompt"),name:_()}),Fz=Bt.extend({ref:$e([qz,Uz]),argument:A({name:_(),value:_()}),context:A({arguments:ze(_(),_()).optional()}).optional()}),Gz=st.extend({method:O("completion/complete"),params:Fz}),Vz=at.extend({completion:Ye({values:T(_()).max(100),total:Ne(de().int()),hasMore:Ne(we())})}),Bz=A({uri:_().startsWith("file://"),name:_().optional(),_meta:ze(_(),Ie()).optional()}),Hz=st.extend({method:O("roots/list"),params:Bt.optional()}),Qd=at.extend({roots:T(Bz)}),Wz=rr.extend({method:O("notifications/roots/list_changed"),params:tr.optional()}),cV=$e([Mc,jd,Gz,Kd,Fd,qd,Ld,ZI,Ud,BI,WI,Ts,Wd,Zc,qc,Fc,Vc]),uV=$e([Nc,Lc,jc,Wz,Es]),lV=$e([Oc,Jd,Yd,Hc,Qd,Uc,Gc,ui]),pV=$e([Mc,xz,Mz,Hz,Zc,qc,Fc,Vc]),dV=$e([Nc,Lc,hz,JI,GI,pz,sz,Es,Zz]),fV=$e([Oc,II,Vz,iz,XI,LI,UI,FI,Bc,uz,Uc,Gc,ui]),B=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===X.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new zd(o.elicitations,r)}return new e(t,r,n)}},zd=class extends B{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(X.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}});function Kz(e){return ci.parse(JSON.parse(e))}function u0(e){return JSON.stringify(e)+`
|
|
32
|
+
`}var Wc,l0=b(()=>{Cn();Wc=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
|
|
33
|
+
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),Kz(r)}clear(){this._buffer=void 0}}});var Xd,pi,ef=b(()=>{Xd=ht(require("node:process"),1);l0();pi=class{constructor(t=Xd.default.stdin,r=Xd.default.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new Wc,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=u0(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}}});function P0(e){return typeof e>"u"||e===null}function Jz(e){return typeof e=="object"&&e!==null}function Yz(e){return Array.isArray(e)?e:P0(e)?[]:[e]}function Qz(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 Xz(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function eD(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}function E0(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+=`
|
|
34
|
+
|
|
35
|
+
`+e.mark.snippet),n+" "+r):n}function Is(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=E0(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}function tf(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 rf(e,t){return Qe.repeat(" ",t-e.length)+e}function aD(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=tf(e.buffer,n[s-c],o[s-c],e.position-(n[s]-n[s-c]),l),a=Qe.repeat(" ",t.indent)+rf((e.line-c+1).toString(),p)+" | "+u.str+`
|
|
36
|
+
`+a;for(u=tf(e.buffer,n[s],o[s],e.position,l),a+=Qe.repeat(" ",t.indent)+rf((e.line+1).toString(),p)+" | "+u.str+`
|
|
37
|
+
`,a+=Qe.repeat("-",t.indent+p+3+u.pos)+`^
|
|
38
|
+
`,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)u=tf(e.buffer,n[s+c],o[s+c],e.position-(n[s]-n[s+c]),l),a+=Qe.repeat(" ",t.indent)+rf((e.line+c+1).toString(),p)+" | "+u.str+`
|
|
39
|
+
`;return a.replace(/\n$/,"")}function pD(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function dD(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(uD.indexOf(r)===-1)throw new Et('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=pD(t.styleAliases||null),lD.indexOf(this.kind)===-1)throw new Et('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}function p0(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 fD(){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 of(e){return this.extend(e)}function hD(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function mD(){return null}function gD(e){return e===null}function yD(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 _D(e){return e==="true"||e==="True"||e==="TRUE"}function vD(e){return Object.prototype.toString.call(e)==="[object Boolean]"}function wD(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function bD(e){return 48<=e&&e<=55}function xD(e){return 48<=e&&e<=57}function kD(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(!wD(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!bD(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!xD(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function SD(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 $D(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Qe.isNegativeZero(e)}function ED(e){return!(e===null||!PD.test(e)||e[e.length-1]==="_")}function CD(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 AD(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(Qe.isNegativeZero(e))return"-0.0";return r=e.toString(10),TD.test(r)?r.replace("e",".e"):r}function RD(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Qe.isNegativeZero(e))}function ID(e){return e===null?!1:L0.exec(e)!==null||Z0.exec(e)!==null}function zD(e){var t,r,n,o,i,s,a,c=0,u=null,p,l,d;if(t=L0.exec(e),t===null&&(t=Z0.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 DD(e){return e.toISOString()}function OD(e){return e==="<<"||e===null}function ND(e){if(e===null)return!1;var t,r,n=0,o=e.length,i=lf;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 jD(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,i=lf,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 MD(e){var t="",r=0,n,o,i=e.length,s=lf;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 LD(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function qD(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,UD.call(o)!=="[object Object]")return!1;for(i in o)if(ZD.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 FD(e){return e!==null?e:[]}function VD(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],GD.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;i[t]=[o[0],n[o[0]]]}return!0}function BD(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 WD(e){if(e===null)return!0;var t,r=e;for(t in r)if(HD.call(r,t)&&r[t]!==null)return!1;return!0}function KD(e){return e!==null?e:{}}function f0(e){return Object.prototype.toString.call(e)}function Nr(e){return e===10||e===13}function ho(e){return e===9||e===32}function Mt(e){return e===9||e===32||e===10||e===13}function fi(e){return e===44||e===91||e===93||e===123||e===125}function eO(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function tO(e){return e===120?2:e===117?4:e===85?8:0}function rO(e){return 48<=e&&e<=57?e-48:-1}function h0(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
40
|
+
`: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 nO(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Y0(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}function oO(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||pf,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 ex(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=cD(r),new Et(t,r)}function M(e,t){throw ex(e,t)}function Yc(e,t){e.onWarning&&e.onWarning.call(null,ex(e,t))}function Tn(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||M(e,"expected valid JSON character");else YD.test(a)&&M(e,"the stream contains non-printable characters");e.result+=a}}function g0(e,t,r,n){var o,i,s,a;for(Qe.isObject(r)||M(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],An.call(t,i)||(Y0(t,i,r[i]),n[i]=!0)}function hi(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])&&M(e,"nested arrays are not supported inside keys"),typeof o=="object"&&f0(o[u])==="[object Object]"&&(o[u]="[object Object]");if(typeof o=="object"&&f0(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)g0(e,t,i[u],r);else g0(e,t,i,r);else!e.json&&!An.call(r,o)&&An.call(t,o)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,M(e,"duplicated mapping key")),Y0(t,o,i),delete r[o];return t}function df(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++):M(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Be(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;ho(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(Nr(o))for(df(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&&Yc(e,"deficient indentation"),n}function eu(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||Mt(r)))}function ff(e,t){t===1?e.result+=" ":t>1&&(e.result+=Qe.repeat(`
|
|
41
|
+
`,t-1))}function iO(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),Mt(f)||fi(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),Mt(o)||r&&fi(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),Mt(o)||r&&fi(o))break}else if(f===35){if(n=e.input.charCodeAt(e.position-1),Mt(n))break}else{if(e.position===e.lineStart&&eu(e)||r&&fi(f))break;if(Nr(f))if(c=e.line,u=e.lineStart,p=e.lineIndent,Be(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&&(Tn(e,i,s,!1),ff(e,e.line-c),i=s=e.position,a=!1),ho(f)||(s=e.position+1),f=e.input.charCodeAt(++e.position)}return Tn(e,i,s,!1),e.result?!0:(e.kind=l,e.result=d,!1)}function sO(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(Tn(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 Nr(r)?(Tn(e,n,o,!0),ff(e,Be(e,!1,t)),n=o=e.position):e.position===e.lineStart&&eu(e)?M(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);M(e,"unexpected end of the stream within a single quoted scalar")}function aO(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 Tn(e,r,e.position,!0),e.position++,!0;if(a===92){if(Tn(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),Nr(a))Be(e,!1,t);else if(a<256&&Q0[a])e.result+=X0[a],e.position++;else if((s=tO(a))>0){for(o=s,i=0;o>0;o--)a=e.input.charCodeAt(++e.position),(s=eO(a))>=0?i=(i<<4)+s:M(e,"expected hexadecimal character");e.result+=nO(i),e.position++}else M(e,"unknown escape sequence");r=n=e.position}else Nr(a)?(Tn(e,r,n,!0),ff(e,Be(e,!1,t)),r=n=e.position):e.position===e.lineStart&&eu(e)?M(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}M(e,"unexpected end of the stream within a double quoted scalar")}function cO(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,v,w;if(w=e.input.charCodeAt(e.position),w===91)p=93,f=!1,a=[];else if(w===123)p=125,f=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),w=e.input.charCodeAt(++e.position);w!==0;){if(Be(e,!0,t),w=e.input.charCodeAt(e.position),w===p)return e.position++,e.tag=s,e.anchor=c,e.kind=f?"mapping":"sequence",e.result=a,!0;r?w===44&&M(e,"expected the node content, but found ','"):M(e,"missed comma between flow collection entries"),y=g=v=null,l=d=!1,w===63&&(u=e.input.charCodeAt(e.position+1),Mt(u)&&(l=d=!0,e.position++,Be(e,!0,t))),n=e.line,o=e.lineStart,i=e.position,mi(e,t,Kc,!1,!0),y=e.tag,g=e.result,Be(e,!0,t),w=e.input.charCodeAt(e.position),(d||e.line===n)&&w===58&&(l=!0,w=e.input.charCodeAt(++e.position),Be(e,!0,t),mi(e,t,Kc,!1,!0),v=e.result),f?hi(e,a,h,y,g,v,n,o,i):l?a.push(hi(e,null,h,y,g,v,n,o,i)):a.push(g),Be(e,!0,t),w=e.input.charCodeAt(e.position),w===44?(r=!0,w=e.input.charCodeAt(++e.position)):r=!1}M(e,"unexpected end of the stream within a flow collection")}function uO(e,t){var r,n,o=nf,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)nf===o?o=l===43?d0:JD:M(e,"repeat of a chomping mode identifier");else if((p=rO(l))>=0)p===0?M(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?M(e,"repeat of an indentation width identifier"):(a=t+p-1,s=!0);else break;if(ho(l)){do l=e.input.charCodeAt(++e.position);while(ho(l));if(l===35)do l=e.input.charCodeAt(++e.position);while(!Nr(l)&&l!==0)}for(;l!==0;){for(df(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),Nr(l)){c++;continue}if(e.lineIndent<a){o===d0?e.result+=Qe.repeat(`
|
|
42
|
+
`,i?1+c:c):o===nf&&i&&(e.result+=`
|
|
43
|
+
`);break}for(n?ho(l)?(u=!0,e.result+=Qe.repeat(`
|
|
44
|
+
`,i?1+c:c)):u?(u=!1,e.result+=Qe.repeat(`
|
|
45
|
+
`,c+1)):c===0?i&&(e.result+=" "):e.result+=Qe.repeat(`
|
|
46
|
+
`,c):e.result+=Qe.repeat(`
|
|
47
|
+
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!Nr(l)&&l!==0;)l=e.input.charCodeAt(++e.position);Tn(e,r,e.position,!1)}return!0}function y0(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,M(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!Mt(s))));){if(a=!0,e.position++,Be(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,mi(e,t,W0,!1,!0),i.push(e.result),Be(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)M(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 lO(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,v=!1,w;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),w=e.input.charCodeAt(e.position);w!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,M(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),i=e.line,(w===63||w===58)&&Mt(n))w===63?(y&&(hi(e,l,d,f,h,null,s,a,c),f=h=g=null),v=!0,y=!0,o=!0):y?(y=!1,o=!0):M(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,w=n;else{if(s=e.line,a=e.lineStart,c=e.position,!mi(e,r,H0,!1,!0))break;if(e.line===i){for(w=e.input.charCodeAt(e.position);ho(w);)w=e.input.charCodeAt(++e.position);if(w===58)w=e.input.charCodeAt(++e.position),Mt(w)||M(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(hi(e,l,d,f,h,null,s,a,c),f=h=g=null),v=!0,y=!1,o=!1,f=e.tag,h=e.result;else if(v)M(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=p,!0}else if(v)M(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),mi(e,t,Jc,!0,o)&&(y?h=e.result:g=e.result),y||(hi(e,l,d,f,h,g,s,a,c),f=h=g=null),Be(e,!0,-1),w=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&w!==0)M(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&hi(e,l,d,f,h,null,s,a,c),v&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=l),v}function pO(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&&M(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)):M(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Mt(s);)s===33&&(n?M(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),K0.test(o)||M(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),XD.test(i)&&M(e,"tag suffix cannot contain flow indicator characters")}i&&!J0.test(i)&&M(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{M(e,"tag name is malformed: "+i)}return r?e.tag=i:An.call(e.tagMap,o)?e.tag=e.tagMap[o]+i:o==="!"?e.tag="!"+i:o==="!!"?e.tag="tag:yaml.org,2002:"+i:M(e,'undeclared tag handle "'+o+'"'),!0}function dO(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&M(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Mt(r)&&!fi(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&M(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function fO(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&&!Mt(n)&&!fi(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&M(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),An.call(e.anchorMap,r)||M(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Be(e,!0,-1),!0}function mi(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=Jc===r||W0===r,n&&Be(e,!0,-1)&&(u=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;pO(e)||dO(e);)Be(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||Jc===r)&&(Kc===r||H0===r?g=t:g=t+1,y=e.position-e.lineStart,c===1?a&&(y0(e,y)||lO(e,y,g))||cO(e,g)?p=!0:(s&&uO(e,g)||sO(e,g)||aO(e,g)?p=!0:fO(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&M(e,"alias node should not have any properties")):iO(e,g,Kc===r)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=a&&y0(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"&&M(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(An.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||M(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&M(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)):M(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 hO(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&&(Be(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&&!Mt(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),o=[],n.length<1&&M(e,"directive name must not be less than one character in length");s!==0;){for(;ho(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Nr(s));break}if(Nr(s))break;for(r=e.position;s!==0&&!Mt(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}s!==0&&df(e),An.call(m0,n)?m0[n](e,n,o):Yc(e,'unknown document directive "'+n+'"')}if(Be(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,Be(e,!0,-1)):i&&M(e,"directives end mark is expected"),mi(e,e.lineIndent-1,Jc,!1,!0),Be(e,!0,-1),e.checkLineBreaks&&QD.test(e.input.slice(t,e.position))&&Yc(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&eu(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Be(e,!0,-1));return}if(e.position<e.length-1)M(e,"end of the stream or a document separator is expected");else return}function tx(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
48
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new oO(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,M(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;)hO(r);return r.documents}function mO(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=tx(e,r);if(typeof t!="function")return n;for(var o=0,i=n.length;o<i;o+=1)t(n[o])}function gO(e,t){var r=tx(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Et("expected a single document in the stream, but found more")}}function jO(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&&ox.call(c.styleAliases,a)&&(a=c.styleAliases[a]),r[s]=a;return r}function MO(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 Et("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Qe.repeat("0",n-t.length)+t}function ZO(e){this.schema=e.schema||pf,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Qe.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=jO(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==='"'?Ds:LO,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 _0(e,t){for(var r=Qe.repeat(" ",t),n=0,o=-1,i="",s,a=e.length;n<a;)o=e.indexOf(`
|
|
49
49
|
`,n),o===-1?(s=e.slice(n),n=a):(s=e.slice(n,o+1),n=o+1),s.length&&s!==`
|
|
50
|
-
`&&(i+=r),i+=s;return i}function
|
|
51
|
-
`+
|
|
50
|
+
`&&(i+=r),i+=s;return i}function af(e,t){return`
|
|
51
|
+
`+Qe.repeat(" ",e.indent*t)}function UO(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 Xc(e){return e===bO||e===vO}function Os(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==hf||65536<=e&&e<=1114111}function v0(e){return Os(e)&&e!==hf&&e!==wO&&e!==zs}function w0(e,t,r){var n=v0(e),o=n&&!Xc(e);return(r?n:n&&e!==ix&&e!==sx&&e!==ax&&e!==cx&&e!==ux)&&e!==sf&&!(t===Qc&&!o)||v0(t)&&!Xc(t)&&e===sf||t===Qc&&o}function qO(e){return Os(e)&&e!==hf&&!Xc(e)&&e!==CO&&e!==RO&&e!==Qc&&e!==ix&&e!==sx&&e!==ax&&e!==cx&&e!==ux&&e!==sf&&e!==$O&&e!==EO&&e!==xO&&e!==DO&&e!==TO&&e!==AO&&e!==PO&&e!==kO&&e!==SO&&e!==IO&&e!==zO}function FO(e){return!Xc(e)&&e!==Qc}function Rs(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 lx(e){var t=/^\n* /;return t.test(e)}function GO(e,t,r,n,o,i,s,a){var c,u=0,p=null,l=!1,d=!1,f=n!==-1,h=-1,g=qO(Rs(e,0))&&FO(Rs(e,e.length-1));if(t||s)for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=Rs(e,c),!Os(u))return di;g=g&&w0(u,p,a),p=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=Rs(e,c),u===zs)l=!0,f&&(d=d||c-h-1>n&&e[h+1]!==" ",h=c);else if(!Os(u))return di;g=g&&w0(u,p,a),p=u}d=d||f&&c-h-1>n&&e[h+1]!==" "}return!l&&!d?g&&!s&&!o(e)?px:i===Ds?di:cf:r>9&&lx(e)?di:s?i===Ds?di:cf:d?fx:dx}function VO(e,t,r,n,o){e.dump=(function(){if(t.length===0)return e.quotingType===Ds?'""':"''";if(!e.noCompatMode&&(OO.indexOf(t)!==-1||NO.test(t)))return e.quotingType===Ds?'"'+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 UO(e,u)}switch(GO(t,a,e.indent,s,c,e.quotingType,e.forceQuotes&&!n,o)){case px:return t;case cf:return"'"+t.replace(/'/g,"''")+"'";case dx:return"|"+b0(t,e.indent)+x0(_0(t,i));case fx:return">"+b0(t,e.indent)+x0(_0(BO(t,s),i));case di:return'"'+HO(t)+'"';default:throw new Et("impossible error: invalid scalar style")}})()}function b0(e,t){var r=lx(e)?String(t):"",n=e[e.length-1]===`
|
|
52
52
|
`,o=n&&(e[e.length-2]===`
|
|
53
53
|
`||e===`
|
|
54
54
|
`),i=o?"+":n?"":"-";return r+i+`
|
|
55
|
-
`}function
|
|
56
|
-
`?e.slice(0,-1):e}function
|
|
57
|
-
`);return
|
|
55
|
+
`}function x0(e){return e[e.length-1]===`
|
|
56
|
+
`?e.slice(0,-1):e}function BO(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=e.indexOf(`
|
|
57
|
+
`);return u=u!==-1?u:e.length,r.lastIndex=u,k0(e.slice(0,u),t)})(),o=e[0]===`
|
|
58
58
|
`||e[0]===" ",i,s;s=r.exec(e);){var a=s[1],c=s[2];i=c[0]===" ",n+=a+(!o&&!i&&c!==""?`
|
|
59
|
-
`:"")+
|
|
59
|
+
`:"")+k0(c,t),o=i}return n}function k0(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+=`
|
|
60
60
|
`+e.slice(o,i),o=i+1),s=a;return c+=`
|
|
61
61
|
`,e.length-o>t&&s>o?c+=e.slice(o,s)+`
|
|
62
|
-
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function
|
|
63
|
-
`:""}function
|
|
64
|
-
\r`;q0=new ct("tag:yaml.org,2002:binary",{kind:"scalar",resolve:qD,construct:FD,predicate:VD,represent:GD}),BD=Object.prototype.hasOwnProperty,HD=Object.prototype.toString;F0=new ct("tag:yaml.org,2002:omap",{kind:"sequence",resolve:KD,construct:WD}),JD=Object.prototype.toString;G0=new ct("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:YD,construct:QD}),XD=Object.prototype.hasOwnProperty;V0=new ct("tag:yaml.org,2002:set",{kind:"mapping",resolve:eO,construct:tO}),uf=j0.extend({implicit:[Z0,U0],explicit:[q0,F0,G0,V0]}),An=Object.prototype.hasOwnProperty,Jc=1,B0=2,H0=3,Yc=4,rf=1,rO=2,p0=3,nO=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,oO=/[\x85\u2028\u2029]/,iO=/[,\[\]\{\}]/,K0=/^(?:!|!!|![a-z\-]+!)$/i,W0=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;Y0=new Array(256),Q0=new Array(256);for(ho=0;ho<256;ho++)Y0[ho]=f0(ho)?1:0,Q0[ho]=f0(ho);h0={YAML:function(t,r,n){var o,i,s;t.version!==null&&M(t,"duplication of %YAML directive"),n.length!==1&&M(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&M(t,"ill-formed argument of the YAML directive"),i=parseInt(o[1],10),s=parseInt(o[2],10),i!==1&&M(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Qc(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var o,i;n.length!==2&&M(t,"TAG directive accepts exactly two arguments"),o=n[0],i=n[1],K0.test(o)||M(t,"ill-formed tag handle (first argument) of the TAG directive"),An.call(t.tagMap,o)&&M(t,'there is a previously declared suffix for "'+o+'" tag handle'),W0.test(i)||M(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{M(t,"tag prefix is malformed: "+i)}t.tagMap[o]=i}};kO=bO,SO=xO,tx={loadAll:kO,load:SO},rx=Object.prototype.toString,nx=Object.prototype.hasOwnProperty,ff=65279,$O=9,Ds=10,PO=13,EO=32,CO=33,TO=34,of=35,RO=37,AO=38,IO=39,zO=42,ox=44,DO=45,Xc=58,OO=61,NO=62,jO=63,MO=64,ix=91,sx=93,LO=96,ax=123,ZO=124,cx=125,_t={};_t[0]="\\0";_t[7]="\\a";_t[8]="\\b";_t[9]="\\t";_t[10]="\\n";_t[11]="\\v";_t[12]="\\f";_t[13]="\\r";_t[27]="\\e";_t[34]='\\"';_t[92]="\\\\";_t[133]="\\N";_t[160]="\\_";_t[8232]="\\L";_t[8233]="\\P";UO=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],qO=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;VO=1,Os=2;ux=1,af=2,px=3,dx=4,fi=5;iN=oN,sN={dump:iN};aN=ct,cN=E0,lN=A0,uN=N0,pN=j0,dN=uf,fN=tx.load,hN=tx.loadAll,mN=sN.dump,gN=Ct,_N={binary:q0,float:O0,map:R0,null:I0,pairs:G0,set:V0,timestamp:Z0,bool:z0,int:D0,merge:U0,omap:F0,seq:T0,str:C0},yN=hf("safeLoad","load"),vN=hf("safeLoadAll","loadAll"),wN=hf("safeDump","dump"),vr={Type:aN,Schema:cN,FAILSAFE_SCHEMA:lN,JSON_SCHEMA:uN,CORE_SCHEMA:pN,DEFAULT_SCHEMA:dN,load:fN,loadAll:hN,dump:mN,YAMLException:gN,types:_N,safeLoad:yN,safeLoadAll:vN,safeDump:wN}});var te,mf,I,Mr,Ms=b(()=>{(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})})(mf||(mf={}));I=te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Mr=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 E,bN,Lt,rl=b(()=>{Ms();E=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"]),bN=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Lt=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 l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(s))):a[l]=a[l]||{_errors:[]},a=a[l],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()}};Lt.create=e=>new Lt(e)});var xN,sn,gf=b(()=>{rl();Ms();xN=(e,t)=>{let r;switch(e.code){case E.invalid_type:e.received===I.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case E.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,te.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${te.joinValues(e.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${te.joinValues(e.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${te.joinValues(e.options)}, received '${e.received}'`;break;case E.invalid_arguments:r="Invalid function arguments";break;case E.invalid_return_type:r="Invalid function return type";break;case E.invalid_date:r="Invalid date";break;case E.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 E.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 E.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 E.custom:r="Invalid input";break;case E.invalid_intersection_types:r="Intersection results could not be merged";break;case E.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case E.not_finite:r="Number must be finite";break;default:r=t.defaultError,te.assertNever(e)}return{message:r}},sn=xN});function kN(e){fx=e}function _i(){return fx}var fx,nl=b(()=>{gf();fx=sn});function A(e,t){let r=_i(),n=Ls({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===sn?void 0:sn].filter(o=>!!o)});e.common.issues.push(n)}var Ls,SN,lt,L,go,yt,ol,il,In,yi,_f=b(()=>{nl();gf();Ls=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(l=>!!l).slice().reverse();for(let l of c)a=l(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},SN=[];lt=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 L;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 L;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}}},L=Object.freeze({status:"aborted"}),go=e=>({status:"dirty",value:e}),yt=e=>({status:"valid",value:e}),ol=e=>e.status==="aborted",il=e=>e.status==="dirty",In=e=>e.status==="valid",yi=e=>typeof Promise<"u"&&e instanceof Promise});var hx=b(()=>{});var D,mx=b(()=>{(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(D||(D={}))});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 vx(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 UN(e){return new RegExp(`^${vx(e)}$`)}function wx(e){let t=`${yx}T${vx(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 qN(e,t){return!!((t==="v4"||!t)&&DN.test(e)||(t==="v6"||!t)&&NN.test(e))}function FN(e,t){if(!RN.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 GN(e,t){return!!((t==="v4"||!t)&&ON.test(e)||(t==="v6"||!t)&&jN.test(e))}function VN(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 vi(e){if(e instanceof Zt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=nr.create(vi(n))}return new Zt({...e._def,shape:()=>t})}else return e instanceof ln?new ln({...e._def,type:vi(e.element)}):e instanceof nr?nr.create(vi(e.unwrap())):e instanceof Zr?Zr.create(vi(e.unwrap())):e instanceof Lr?Lr.create(e.items.map(t=>vi(t))):e}function vf(e,t){let r=Mr(e),n=Mr(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=vf(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=vf(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 bx(e,t){return new Eo({values:e,typeName:C.ZodEnum,...V(t)})}function _x(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function xx(e,t={},r){return e?Dn.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=_x(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=_x(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):Dn.create()}var or,gx,J,$N,PN,EN,CN,TN,RN,AN,IN,zN,yf,DN,ON,NN,jN,MN,LN,yx,ZN,zn,_o,yo,vo,wo,wi,bo,xo,Dn,cn,wr,bi,ln,Zt,ko,an,sl,So,Lr,al,xi,ki,cl,$o,Po,Eo,Co,On,ir,nr,Zr,To,Ro,Si,BN,Zs,Us,Ao,HN,C,KN,kx,Sx,WN,JN,$x,YN,QN,XN,ej,tj,rj,nj,oj,ij,sj,aj,cj,lj,uj,pj,dj,fj,hj,mj,gj,_j,yj,vj,wj,bj,xj,kj,Sj,$j,Pj,Ej,Cj,Tj,Rj,Px=b(()=>{rl();nl();mx();_f();Ms();or=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}},gx=(e,t)=>{if(In(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 Lt(e.common.issues);return this._error=r,this._error}}};J=class{get description(){return this._def.description}_getType(t){return Mr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Mr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new lt,ctx:{common:t.parent.common,data:t.data,parsedType:Mr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(yi(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:Mr(t)},o=this._parseSync({data:t,path:n.path,parent:n});return gx(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Mr(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return In(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=>In(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:Mr(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(yi(o)?o:Promise.resolve(o));return gx(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:E.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 ir({schema:this,typeName:C.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 nr.create(this,this._def)}nullable(){return Zr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ln.create(this)}promise(){return On.create(this,this._def)}or(t){return ko.create([this,t],this._def)}and(t){return So.create(this,t,this._def)}transform(t){return new ir({...V(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new To({...V(this._def),innerType:this,defaultValue:r,typeName:C.ZodDefault})}brand(){return new Zs({typeName:C.ZodBranded,type:this,...V(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Ro({...V(this._def),innerType:this,catchValue:r,typeName:C.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Us.create(this,t)}readonly(){return Ao.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},$N=/^c[^\s-]{8,}$/i,PN=/^[0-9a-z]+$/,EN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,CN=/^[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,TN=/^[a-z0-9_-]{21}$/i,RN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,AN=/^[-+]?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)?)??$/,IN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,zN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",DN=/^(?:(?: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])$/,ON=/^(?:(?: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])$/,NN=/^(([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]))$/,jN=/^(([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])$/,MN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,LN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,yx="((\\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])))",ZN=new RegExp(`^${yx}$`);zn=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 A(i,{code:E.invalid_type,expected:I.string,received:i.parsedType}),L}let n=new lt,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),A(o,{code:E.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),A(o,{code:E.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?A(o,{code:E.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&A(o,{code:E.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")IN.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"email",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")yf||(yf=new RegExp(zN,"u")),yf.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"emoji",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")CN.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"uuid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")TN.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"nanoid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")$N.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"cuid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")PN.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"cuid2",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")EN.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"ulid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),A(o,{validation:"url",code:E.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),A(o,{validation:"regex",code:E.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),A(o,{code:E.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),A(o,{code:E.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),A(o,{code:E.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?wx(i).test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{code:E.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?ZN.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{code:E.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?UN(i).test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{code:E.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?AN.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"duration",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?qN(t.data,i.version)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"ip",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?FN(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"jwt",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?GN(t.data,i.version)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"cidr",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?MN.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"base64",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?LN.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"base64url",code:E.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:E.invalid_string,...D.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...D.errToObj(t)})}url(t){return this._addCheck({kind:"url",...D.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...D.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...D.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...D.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...D.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...D.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...D.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...D.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...D.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...D.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...D.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...D.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,...D.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,...D.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...D.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...D.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...D.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...D.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...D.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...D.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...D.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...D.errToObj(r)})}nonempty(t){return this.min(1,D.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}};zn.create=e=>new zn({checks:[],typeName:C.ZodString,coerce:e?.coerce??!1,...V(e)});_o=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 A(i,{code:E.invalid_type,expected:I.number,received:i.parsedType}),L}let n,o=new lt;for(let i of this._def.checks)i.kind==="int"?te.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),A(n,{code:E.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),A(n,{code:E.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),A(n,{code:E.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?VN(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),A(n,{code:E.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),A(n,{code:E.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,D.toString(r))}gt(t,r){return this.setLimit("min",t,!1,D.toString(r))}lte(t,r){return this.setLimit("max",t,!0,D.toString(r))}lt(t,r){return this.setLimit("max",t,!1,D.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:D.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:D.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:D.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:D.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D.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)}};_o.create=e=>new _o({checks:[],typeName:C.ZodNumber,coerce:e?.coerce||!1,...V(e)});yo=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 lt;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),A(n,{code:E.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),A(n,{code:E.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),A(n,{code:E.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 A(r,{code:E.invalid_type,expected:I.bigint,received:r.parsedType}),L}gte(t,r){return this.setLimit("min",t,!0,D.toString(r))}gt(t,r){return this.setLimit("min",t,!1,D.toString(r))}lte(t,r){return this.setLimit("max",t,!0,D.toString(r))}lt(t,r){return this.setLimit("max",t,!1,D.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:D.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:D.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:D.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}};yo.create=e=>new yo({checks:[],typeName:C.ZodBigInt,coerce:e?.coerce??!1,...V(e)});vo=class extends J{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==I.boolean){let n=this._getOrReturnCtx(t);return A(n,{code:E.invalid_type,expected:I.boolean,received:n.parsedType}),L}return yt(t.data)}};vo.create=e=>new vo({typeName:C.ZodBoolean,coerce:e?.coerce||!1,...V(e)});wo=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 A(i,{code:E.invalid_type,expected:I.date,received:i.parsedType}),L}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return A(i,{code:E.invalid_date}),L}let n=new lt,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),A(o,{code:E.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),A(o,{code:E.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:D.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:D.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}};wo.create=e=>new wo({checks:[],coerce:e?.coerce||!1,typeName:C.ZodDate,...V(e)});wi=class extends J{_parse(t){if(this._getType(t)!==I.symbol){let n=this._getOrReturnCtx(t);return A(n,{code:E.invalid_type,expected:I.symbol,received:n.parsedType}),L}return yt(t.data)}};wi.create=e=>new wi({typeName:C.ZodSymbol,...V(e)});bo=class extends J{_parse(t){if(this._getType(t)!==I.undefined){let n=this._getOrReturnCtx(t);return A(n,{code:E.invalid_type,expected:I.undefined,received:n.parsedType}),L}return yt(t.data)}};bo.create=e=>new bo({typeName:C.ZodUndefined,...V(e)});xo=class extends J{_parse(t){if(this._getType(t)!==I.null){let n=this._getOrReturnCtx(t);return A(n,{code:E.invalid_type,expected:I.null,received:n.parsedType}),L}return yt(t.data)}};xo.create=e=>new xo({typeName:C.ZodNull,...V(e)});Dn=class extends J{constructor(){super(...arguments),this._any=!0}_parse(t){return yt(t.data)}};Dn.create=e=>new Dn({typeName:C.ZodAny,...V(e)});cn=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(t){return yt(t.data)}};cn.create=e=>new cn({typeName:C.ZodUnknown,...V(e)});wr=class extends J{_parse(t){let r=this._getOrReturnCtx(t);return A(r,{code:E.invalid_type,expected:I.never,received:r.parsedType}),L}};wr.create=e=>new wr({typeName:C.ZodNever,...V(e)});bi=class extends J{_parse(t){if(this._getType(t)!==I.undefined){let n=this._getOrReturnCtx(t);return A(n,{code:E.invalid_type,expected:I.void,received:n.parsedType}),L}return yt(t.data)}};bi.create=e=>new bi({typeName:C.ZodVoid,...V(e)});ln=class e extends J{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==I.array)return A(r,{code:E.invalid_type,expected:I.array,received:r.parsedType}),L;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(A(r,{code:s?E.too_big:E.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&&(A(r,{code:E.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&&(A(r,{code:E.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 or(r,s,r.path,a)))).then(s=>lt.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new or(r,s,r.path,a)));return lt.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:D.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:D.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:D.toString(r)}})}nonempty(t){return this.min(1,t)}};ln.create=(e,t)=>new ln({type:e,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...V(t)});Zt=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 l=this._getOrReturnCtx(t);return A(l,{code:E.invalid_type,expected:I.object,received:l.parsedType}),L}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof wr&&this._def.unknownKeys==="strip"))for(let l in o.data)s.includes(l)||a.push(l);let c=[];for(let l of s){let p=i[l],u=o.data[l];c.push({key:{status:"valid",value:l},value:p._parse(new or(o,u,o.path,l)),alwaysSet:l in o.data})}if(this._def.catchall instanceof wr){let l=this._def.unknownKeys;if(l==="passthrough")for(let p of a)c.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(l==="strict")a.length>0&&(A(o,{code:E.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let p of a){let u=o.data[p];c.push({key:{status:"valid",value:p},value:l._parse(new or(o,u,o.path,p)),alwaysSet:p in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let l=[];for(let p of c){let u=await p.key,d=await p.value;l.push({key:u,value:d,alwaysSet:p.alwaysSet})}return l}).then(l=>lt.mergeObjectSync(n,l)):lt.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return D.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:D.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:C.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 vi(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 nr;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return bx(te.objectKeys(this.shape))}};Zt.create=(e,t)=>new Zt({shape:()=>e,unknownKeys:"strip",catchall:wr.create(),typeName:C.ZodObject,...V(t)});Zt.strictCreate=(e,t)=>new Zt({shape:()=>e,unknownKeys:"strict",catchall:wr.create(),typeName:C.ZodObject,...V(t)});Zt.lazycreate=(e,t)=>new Zt({shape:e,unknownKeys:"strip",catchall:wr.create(),typeName:C.ZodObject,...V(t)});ko=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 Lt(a.ctx.common.issues));return A(r,{code:E.invalid_union,unionErrors:s}),L}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 l={...r,common:{...r.common,issues:[]},parent:null},p=c._parseSync({data:r.data,path:r.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!i&&(i={result:p,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(c=>new Lt(c));return A(r,{code:E.invalid_union,unionErrors:a}),L}}get options(){return this._def.options}};ko.create=(e,t)=>new ko({options:e,typeName:C.ZodUnion,...V(t)});an=e=>e instanceof $o?an(e.schema):e instanceof ir?an(e.innerType()):e instanceof Po?[e.value]:e instanceof Eo?e.options:e instanceof Co?te.objectValues(e.enum):e instanceof To?an(e._def.innerType):e instanceof bo?[void 0]:e instanceof xo?[null]:e instanceof nr?[void 0,...an(e.unwrap())]:e instanceof Zr?[null,...an(e.unwrap())]:e instanceof Zs||e instanceof Ao?an(e.unwrap()):e instanceof Ro?an(e._def.innerType):[],sl=class e extends J{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.object)return A(r,{code:E.invalid_type,expected:I.object,received:r.parsedType}),L;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}):(A(r,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),L)}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=an(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:C.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...V(n)})}};So=class extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(ol(i)||ol(s))return L;let a=vf(i.value,s.value);return a.valid?((il(i)||il(s))&&r.dirty(),{status:r.value,value:a.data}):(A(n,{code:E.invalid_intersection_types}),L)};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}))}};So.create=(e,t,r)=>new So({left:e,right:t,typeName:C.ZodIntersection,...V(r)});Lr=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.array)return A(n,{code:E.invalid_type,expected:I.array,received:n.parsedType}),L;if(n.data.length<this._def.items.length)return A(n,{code:E.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),L;!this._def.rest&&n.data.length>this._def.items.length&&(A(n,{code:E.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 or(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>lt.mergeArray(r,s)):lt.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Lr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Lr({items:e,typeName:C.ZodTuple,rest:null,...V(t)})};al=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 A(n,{code:E.invalid_type,expected:I.object,received:n.parsedType}),L;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new or(n,a,n.path,a)),value:s._parse(new or(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?lt.mergeObjectAsync(r,o):lt.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:C.ZodRecord,...V(n)}):new e({keyType:zn.create(),valueType:t,typeName:C.ZodRecord,...V(r)})}},xi=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 A(n,{code:E.invalid_type,expected:I.map,received:n.parsedType}),L;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],l)=>({key:o._parse(new or(n,a,n.path,[l,"key"])),value:i._parse(new or(n,c,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let l=await c.key,p=await c.value;if(l.status==="aborted"||p.status==="aborted")return L;(l.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(l.value,p.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let l=c.key,p=c.value;if(l.status==="aborted"||p.status==="aborted")return L;(l.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(l.value,p.value)}return{status:r.value,value:a}}}};xi.create=(e,t,r)=>new xi({valueType:t,keyType:e,typeName:C.ZodMap,...V(r)});ki=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.set)return A(n,{code:E.invalid_type,expected:I.set,received:n.parsedType}),L;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(A(n,{code:E.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&&(A(n,{code:E.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 l=new Set;for(let p of c){if(p.status==="aborted")return L;p.status==="dirty"&&r.dirty(),l.add(p.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((c,l)=>i._parse(new or(n,c,n.path,l)));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:D.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:D.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};ki.create=(e,t)=>new ki({valueType:e,minSize:null,maxSize:null,typeName:C.ZodSet,...V(t)});cl=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 A(r,{code:E.invalid_type,expected:I.function,received:r.parsedType}),L;function n(a,c){return Ls({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_i(),sn].filter(l=>!!l),issueData:{code:E.invalid_arguments,argumentsError:c}})}function o(a,c){return Ls({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_i(),sn].filter(l=>!!l),issueData:{code:E.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof On){let a=this;return yt(async function(...c){let l=new Lt([]),p=await a._def.args.parseAsync(c,i).catch(h=>{throw l.addIssue(n(c,h)),l}),u=await Reflect.apply(s,this,p);return await a._def.returns._def.type.parseAsync(u,i).catch(h=>{throw l.addIssue(o(u,h)),l})})}else{let a=this;return yt(function(...c){let l=a._def.args.safeParse(c,i);if(!l.success)throw new Lt([n(c,l.error)]);let p=Reflect.apply(s,this,l.data),u=a._def.returns.safeParse(p,i);if(!u.success)throw new Lt([o(p,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Lr.create(t).rest(cn.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||Lr.create([]).rest(cn.create()),returns:r||cn.create(),typeName:C.ZodFunction,...V(n)})}},$o=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})}};$o.create=(e,t)=>new $o({getter:e,typeName:C.ZodLazy,...V(t)});Po=class extends J{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return A(r,{received:r.data,code:E.invalid_literal,expected:this._def.value}),L}return{status:"valid",value:t.data}}get value(){return this._def.value}};Po.create=(e,t)=>new Po({value:e,typeName:C.ZodLiteral,...V(t)});Eo=class e extends J{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return A(r,{expected:te.joinValues(n),received:r.parsedType,code:E.invalid_type}),L}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 A(r,{received:r.data,code:E.invalid_enum_value,options:n}),L}return yt(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})}};Eo.create=bx;Co=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 A(n,{expected:te.joinValues(o),received:n.parsedType,code:E.invalid_type}),L}if(this._cache||(this._cache=new Set(te.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=te.objectValues(r);return A(n,{received:n.data,code:E.invalid_enum_value,options:o}),L}return yt(t.data)}get enum(){return this._def.values}};Co.create=(e,t)=>new Co({values:e,typeName:C.ZodNativeEnum,...V(t)});On=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 A(r,{code:E.invalid_type,expected:I.promise,received:r.parsedType}),L;let n=r.parsedType===I.promise?r.data:Promise.resolve(r.data);return yt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};On.create=(e,t)=>new On({type:e,typeName:C.ZodPromise,...V(t)});ir=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.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=>{A(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 L;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?L:c.status==="dirty"?go(c.value):r.value==="dirty"?go(c.value):c});{if(r.value==="aborted")return L;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?L:a.status==="dirty"?go(a.value):r.value==="dirty"?go(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"?L:(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"?L:(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(!In(s))return L;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=>In(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):L);te.assertNever(o)}};ir.create=(e,t,r)=>new ir({schema:e,typeName:C.ZodEffects,effect:t,...V(r)});ir.createWithPreprocess=(e,t,r)=>new ir({schema:t,effect:{type:"preprocess",transform:e},typeName:C.ZodEffects,...V(r)});nr=class extends J{_parse(t){return this._getType(t)===I.undefined?yt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};nr.create=(e,t)=>new nr({innerType:e,typeName:C.ZodOptional,...V(t)});Zr=class extends J{_parse(t){return this._getType(t)===I.null?yt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Zr.create=(e,t)=>new Zr({innerType:e,typeName:C.ZodNullable,...V(t)});To=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}};To.create=(e,t)=>new To({innerType:e,typeName:C.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...V(t)});Ro=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 yi(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Lt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Lt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ro.create=(e,t)=>new Ro({innerType:e,typeName:C.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...V(t)});Si=class extends J{_parse(t){if(this._getType(t)!==I.nan){let n=this._getOrReturnCtx(t);return A(n,{code:E.invalid_type,expected:I.nan,received:n.parsedType}),L}return{status:"valid",value:t.data}}};Si.create=e=>new Si({typeName:C.ZodNaN,...V(e)});BN=Symbol("zod_brand"),Zs=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}},Us=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"?L:i.status==="dirty"?(r.dirty(),go(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"?L: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:C.ZodPipeline})}},Ao=class extends J{_parse(t){let r=this._def.innerType._parse(t),n=o=>(In(o)&&(o.value=Object.freeze(o.value)),o);return yi(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Ao.create=(e,t)=>new Ao({innerType:e,typeName:C.ZodReadonly,...V(t)});HN={object:Zt.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"})(C||(C={}));KN=(e,t={message:`Input not instance of ${e.name}`})=>xx(r=>r instanceof e,t),kx=zn.create,Sx=_o.create,WN=Si.create,JN=yo.create,$x=vo.create,YN=wo.create,QN=wi.create,XN=bo.create,ej=xo.create,tj=Dn.create,rj=cn.create,nj=wr.create,oj=bi.create,ij=ln.create,sj=Zt.create,aj=Zt.strictCreate,cj=ko.create,lj=sl.create,uj=So.create,pj=Lr.create,dj=al.create,fj=xi.create,hj=ki.create,mj=cl.create,gj=$o.create,_j=Po.create,yj=Eo.create,vj=Co.create,wj=On.create,bj=ir.create,xj=nr.create,kj=Zr.create,Sj=ir.createWithPreprocess,$j=Us.create,Pj=()=>kx().optional(),Ej=()=>Sx().optional(),Cj=()=>$x().optional(),Tj={string:(e=>zn.create({...e,coerce:!0})),number:(e=>_o.create({...e,coerce:!0})),boolean:(e=>vo.create({...e,coerce:!0})),bigint:(e=>yo.create({...e,coerce:!0})),date:(e=>wo.create({...e,coerce:!0}))},Rj=L});var f={};Xt(f,{BRAND:()=>BN,DIRTY:()=>go,EMPTY_PATH:()=>SN,INVALID:()=>L,NEVER:()=>Rj,OK:()=>yt,ParseStatus:()=>lt,Schema:()=>J,ZodAny:()=>Dn,ZodArray:()=>ln,ZodBigInt:()=>yo,ZodBoolean:()=>vo,ZodBranded:()=>Zs,ZodCatch:()=>Ro,ZodDate:()=>wo,ZodDefault:()=>To,ZodDiscriminatedUnion:()=>sl,ZodEffects:()=>ir,ZodEnum:()=>Eo,ZodError:()=>Lt,ZodFirstPartyTypeKind:()=>C,ZodFunction:()=>cl,ZodIntersection:()=>So,ZodIssueCode:()=>E,ZodLazy:()=>$o,ZodLiteral:()=>Po,ZodMap:()=>xi,ZodNaN:()=>Si,ZodNativeEnum:()=>Co,ZodNever:()=>wr,ZodNull:()=>xo,ZodNullable:()=>Zr,ZodNumber:()=>_o,ZodObject:()=>Zt,ZodOptional:()=>nr,ZodParsedType:()=>I,ZodPipeline:()=>Us,ZodPromise:()=>On,ZodReadonly:()=>Ao,ZodRecord:()=>al,ZodSchema:()=>J,ZodSet:()=>ki,ZodString:()=>zn,ZodSymbol:()=>wi,ZodTransformer:()=>ir,ZodTuple:()=>Lr,ZodType:()=>J,ZodUndefined:()=>bo,ZodUnion:()=>ko,ZodUnknown:()=>cn,ZodVoid:()=>bi,addIssueToContext:()=>A,any:()=>tj,array:()=>ij,bigint:()=>JN,boolean:()=>$x,coerce:()=>Tj,custom:()=>xx,date:()=>YN,datetimeRegex:()=>wx,defaultErrorMap:()=>sn,discriminatedUnion:()=>lj,effect:()=>bj,enum:()=>yj,function:()=>mj,getErrorMap:()=>_i,getParsedType:()=>Mr,instanceof:()=>KN,intersection:()=>uj,isAborted:()=>ol,isAsync:()=>yi,isDirty:()=>il,isValid:()=>In,late:()=>HN,lazy:()=>gj,literal:()=>_j,makeIssue:()=>Ls,map:()=>fj,nan:()=>WN,nativeEnum:()=>vj,never:()=>nj,null:()=>ej,nullable:()=>kj,number:()=>Sx,object:()=>sj,objectUtil:()=>mf,oboolean:()=>Cj,onumber:()=>Ej,optional:()=>xj,ostring:()=>Pj,pipeline:()=>$j,preprocess:()=>Sj,promise:()=>wj,quotelessJson:()=>bN,record:()=>dj,set:()=>hj,setErrorMap:()=>kN,strictObject:()=>aj,string:()=>kx,symbol:()=>QN,transformer:()=>bj,tuple:()=>pj,undefined:()=>XN,union:()=>cj,unknown:()=>rj,util:()=>te,void:()=>oj});var ll=b(()=>{nl();_f();hx();Ms();Px();rl()});var Ke=b(()=>{ll();ll()});var Aj,Ij,zj,Dj,Oj,Nj,jj,Mj,Ex,Cx=b(()=>{"use strict";Ke();Aj=f.object({id:f.string(),label:f.string(),name:f.string(),mindset_template:f.string().optional()}),Ij=f.object({name:f.string(),root_dir:f.string().default("frontend"),build_command:f.string(),package_manager:f.string().default("pnpm"),mindset_template:f.string().optional()}),zj=f.object({name:f.string(),root_dir:f.string().default("backend"),architecture:f.string(),dependency_direction:f.string(),package_manager:f.string().default("uv"),mindset_template:f.string().optional()}),Dj=f.object({frontend:f.string().optional(),backend:f.string().optional(),preflight_command:f.string().default("pnpm preflight"),summary:f.string().default("format/lint/typecheck/build")}),Oj=f.object({name:f.string(),description:f.string(),runtime:f.enum(["python","node","unknown"]).default("unknown"),setup_hint:f.string().optional(),enabled:f.boolean().default(!0)}),Nj=f.object({id:f.string(),label:f.string(),category:f.enum(["frontend","backend","testing","infra","devtool","monitoring"]),description:f.string(),url:f.string().optional(),guidance:f.string().optional()}),jj=f.object({name:f.string(),description:f.string().optional(),stacks:f.array(Aj),frontend:Ij.optional(),backend:zj.optional(),quality_gate:Dj.optional(),vendor:f.array(Oj).optional(),tools:f.array(Nj).optional()}),Mj=f.object({enabled:f.boolean().optional(),tool:f.string().optional(),question_channel:f.string().optional(),permalink_tool:f.string().optional()}),Ex=f.object({license_key:f.string().min(1).optional(),stack_profile:f.string().optional(),components:f.array(f.string().min(1,"\u7A7A\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u540D\u306F\u7121\u52B9\u3067\u3059")).optional(),language:f.string().optional(),registry_url:f.string().optional(),slack:Mj.optional()}).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 rt(e){return e.trim().replace(/\/+$/,"")}function Nn(e=process.env){let t=e.XDG_CONFIG_HOME?.trim(),r=t||(0,$i.join)((0,wf.homedir)(),".config");return(0,$i.join)(r,"godd","credentials.json")}function br(e=process.env){let t=[Nn(e),(0,$i.join)((0,wf.homedir)(),".config","godd","credentials.json")];return[...new Set(t)]}function ul(e){if(!(0,tt.existsSync)(e))return{};let t;try{t=JSON.parse((0,tt.readFileSync)(e,"utf-8"))}catch{throw new Error(`\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: ${e}
|
|
65
|
-
godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}let r=
|
|
66
|
-
godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}function
|
|
67
|
-
`,o=`${t}.${process.pid}.${(0,
|
|
68
|
-
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,dl.readFileSync)(t,"utf-8"),n=vr.load(r),o=Ex.parse(n),i=process.env.GODD_REGISTRY_URL??o.registry_url??pn,s={stack_profile:o.stack_profile,components:o.components??[],language:process.env.GODD_LANGUAGE??o.language??Uj,registry_url:i},a=process.env.GODD_LICENSE_KEY??o.license_key;return a?{license_key:a,auth_source:"license_key",...s}:{license_key:xf(i),auth_source:"device_token",...s}}function xf(e,t={}){let r=t.paths??br(),n=t.warn??(s=>console.error(s)),o=Io(e,r);if(!o){let s=un(r);throw s.length>0?new Error(`\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u306F\u5225\u306E Registry\uFF08${s.map(a=>a.registry_url).join(", ")}\uFF09\u5411\u3051\u3067\u3059\u3002godd login --registry-url ${rt(e)} \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`):new Error("license_key \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002GODD_LICENSE_KEY \u74B0\u5883\u5909\u6570\u3092\u8A2D\u5B9A\u3059\u308B\u304B\u3001.env \u306B\u8A18\u8F09\u3057\u3066\u304F\u3060\u3055\u3044\u3002Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u4F7F\u3046\u5834\u5408\u306F godd login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}let{credentials:i}=o;return pl(i)&&n(`[GoDD] \u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u306F\u624B\u5143\u306E\u8A18\u9332\u3067\u306F\u6709\u52B9\u671F\u9650\uFF08${i.expires_at}\uFF09\u3092\u904E\u304E\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u304C\u5EF6\u9577\u3057\u3066\u3044\u308C\u3070\u305D\u306E\u307E\u307E\u4F7F\u3048\u307E\u3059\u3002\u62D2\u5426\u3055\u308C\u305F\u5834\u5408\u306F godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),i.access_token}var dl,Kt,pn,Uj,jn=b(()=>{"use strict";dl=require("node:fs");js();Cx();Pi();Kt="config.godd",pn="https://dev.api.godd.ripla-inc.com",Uj="en"});function fl(e,t,r){if(e.__GODD_CLI__)return!1;if(!r)return!0;if(!t)return!1;let n;try{n=(0,jx.fileURLToPath)(r)}catch{return!0}return t===n?!0:Ox(t)===Ox(n)}function Ox(e){try{return(0,Nx.realpathSync)(e)}catch{return e}}var Nx,jx,kf=b(()=>{"use strict";Nx=require("node:fs"),jx=require("node:url")});var hl=b(()=>{ll()});var Mx=b(()=>{Et()});var Lx=b(()=>{});var Zx=b(()=>{});var Ux=b(()=>{});var qx=b(()=>{});var Fx=b(()=>{Et();Mx();Lx();Zx();Et();kc();Ux();qx()});var Gx=b(()=>{Fx()});var Sf=b(()=>{Gx()});function zo(e){return!!e._zod}function Mn(e,t){return zo(e)?gs(e,t):e.safeParse(t)}function ml(e){if(!e)return;let t;if(zo(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function Bx(e){if(zo(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 gl=b(()=>{Sf()});function Ln(e){return e==="completed"||e==="failed"||e==="cancelled"}var Hx=b(()=>{});var Wx,Kx,Jx,_l=b(()=>{Wx=Symbol("Let zodToJsonSchema decide on which parser to use"),Kx={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"},Jx=e=>typeof e=="string"?{...Kx,name:e}:{...Kx,...e}});var Yx,$f=b(()=>{_l();Yx=e=>{let t=Jx(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 Pf(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function se(e,t,r,n,o){e[t]=r,Pf(e,t,n,o)}var Zn=b(()=>{});var yl,vl=b(()=>{yl=(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 De(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?yl(t,e.currentPath):t.join("/")}}var sr=b(()=>{vl()});function Qx(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==C.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 Ef=b(()=>{hl();Zn();We()});function Xx(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 Cf=b(()=>{Zn()});function ek(){return{type:"boolean"}}var Tf=b(()=>{});function wl(e,t){return U(e.type._def,t)}var bl=b(()=>{We()});var tk,Rf=b(()=>{We();tk=(e,t)=>U(e.innerType._def,t)});function Af(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,i)=>Af(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 Gj(e,t)}}var Gj,If=b(()=>{Zn();Gj=(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 rk(e,t){return{...U(e.innerType._def,t),default:e.defaultValue()}}var zf=b(()=>{We()});function nk(e,t){return t.effectStrategy==="input"?U(e.schema._def,t):De(t)}var Df=b(()=>{We();sr()});function ok(e){return{type:"string",enum:Array.from(e.values)}}var Of=b(()=>{});function ik(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(Vj(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 Vj,Nf=b(()=>{We();Vj=e=>"type"in e&&e.type==="string"?!1:"allOf"in e});function sk(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 jf=b(()=>{});function xl(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":kr(r,"email",n.message,t);break;case"format:idn-email":kr(r,"idn-email",n.message,t);break;case"pattern:zod":Tt(r,xr.email,n.message,t);break}break;case"url":kr(r,"uri",n.message,t);break;case"uuid":kr(r,"uuid",n.message,t);break;case"regex":Tt(r,n.regex,n.message,t);break;case"cuid":Tt(r,xr.cuid,n.message,t);break;case"cuid2":Tt(r,xr.cuid2,n.message,t);break;case"startsWith":Tt(r,RegExp(`^${Lf(n.value,t)}`),n.message,t);break;case"endsWith":Tt(r,RegExp(`${Lf(n.value,t)}$`),n.message,t);break;case"datetime":kr(r,"date-time",n.message,t);break;case"date":kr(r,"date",n.message,t);break;case"time":kr(r,"time",n.message,t);break;case"duration":kr(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":{Tt(r,RegExp(Lf(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&kr(r,"ipv4",n.message,t),n.version!=="v4"&&kr(r,"ipv6",n.message,t);break}case"base64url":Tt(r,xr.base64url,n.message,t);break;case"jwt":Tt(r,xr.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&Tt(r,xr.ipv4Cidr,n.message,t),n.version!=="v4"&&Tt(r,xr.ipv6Cidr,n.message,t);break}case"emoji":Tt(r,xr.emoji(),n.message,t);break;case"ulid":{Tt(r,xr.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{kr(r,"binary",n.message,t);break}case"contentEncoding:base64":{se(r,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{Tt(r,xr.base64,n.message,t);break}}break}case"nanoid":Tt(r,xr.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Lf(e,t){return t.patternStrategy==="escape"?Hj(e):e}function Hj(e){let t="";for(let r=0;r<e.length;r++)Bj.has(e[r])||(t+="\\"),t+=e[r];return t}function kr(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 Tt(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:ak(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):se(e,"pattern",ak(t,n),r,n)}function ak(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
|
|
62
|
+
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function HO(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=Rs(e,o),n=gt[r],!n&&Os(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||MO(r);return t}function WO(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)),(nn(e,t,a,!1,!1)||typeof a>"u"&&nn(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function S0(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)),(nn(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&nn(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=af(e,t)),e.dump&&zs===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=i,e.dump=o||"[]"}function KO(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)),nn(e,t,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),nn(e,t,u,!1,!1)&&(p+=e.dump,n+=p));e.tag=o,e.dump="{"+n+"}"}function JO(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 Et("sortKeys must be a boolean or a function");for(a=0,c=s.length;a<c;a+=1)d="",(!n||o!=="")&&(d+=af(e,t)),u=s[a],p=r[u],e.replacer&&(p=e.replacer.call(r,u,p)),nn(e,t+1,u,!0,!0,!0)&&(l=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,l&&(e.dump&&zs===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,l&&(d+=af(e,t)),nn(e,t+1,p,!0,l)&&(e.dump&&zs===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,o+=d));e.tag=i,e.dump=o||"{}"}function $0(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,nx.call(a.represent)==="[object Function]")n=a.represent(t,c);else if(ox.call(a.represent,c))n=a.represent[c](t,c);else throw new Et("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function nn(e,t,r,n,o,i,s){e.tag=null,e.dump=r,$0(e,r,!1)||$0(e,r,!0);var a=nx.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?(JO(e,t,e.dump,o),d&&(e.dump="&ref_"+l+e.dump)):(KO(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?S0(e,t-1,e.dump,o):S0(e,t,e.dump,o),d&&(e.dump="&ref_"+l+e.dump)):(WO(e,t,e.dump),d&&(e.dump="&ref_"+l+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&VO(e,e.dump,t,i,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Et("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 YO(e,t){var r=[],n=[],o,i;for(uf(e,r,n),o=0,i=n.length;o<i;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(i)}function uf(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)uf(e[o],t,r);else for(n=Object.keys(e),o=0,i=n.length;o<i;o+=1)uf(e[n[o]],t,r)}function QO(e,t){t=t||{};var r=new ZO(t);r.noRefs||YO(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),nn(r,0,n,!0,!0)?r.dump+`
|
|
63
|
+
`:""}function mf(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 tD,rD,nD,oD,iD,sD,Qe,Et,cD,uD,lD,ct,C0,T0,A0,R0,I0,z0,D0,O0,PD,TD,N0,j0,M0,L0,Z0,U0,q0,lf,F0,ZD,UD,G0,GD,V0,HD,B0,pf,An,Kc,H0,W0,Jc,nf,JD,d0,YD,QD,XD,K0,J0,Q0,X0,fo,m0,yO,_O,rx,nx,ox,hf,vO,zs,wO,bO,xO,kO,sf,SO,$O,PO,EO,ix,CO,Qc,TO,AO,RO,IO,sx,ax,zO,cx,DO,ux,gt,OO,NO,LO,Ds,px,cf,dx,fx,di,XO,eN,tN,rN,nN,oN,iN,sN,aN,cN,uN,lN,pN,dN,fN,hN,_r,Ns=b(()=>{tD=P0,rD=Jz,nD=Yz,oD=Xz,iD=eD,sD=Qz,Qe={isNothing:tD,isObject:rD,toArray:nD,repeat:oD,isNegativeZero:iD,extend:sD};Is.prototype=Object.create(Error.prototype);Is.prototype.constructor=Is;Is.prototype.toString=function(t){return this.name+": "+E0(this,t)};Et=Is;cD=aD,uD=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],lD=["scalar","sequence","mapping"];ct=dD;of.prototype.extend=function(t){var r=[],n=[];if(t instanceof ct)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 Et("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof ct))throw new Et("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new Et("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 Et("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 ct))throw new Et("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(of.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=p0(o,"implicit"),o.compiledExplicit=p0(o,"explicit"),o.compiledTypeMap=fD(o.compiledImplicit,o.compiledExplicit),o};C0=of,T0=new ct("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),A0=new ct("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),R0=new ct("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),I0=new C0({explicit:[T0,A0,R0]});z0=new ct("tag:yaml.org,2002:null",{kind:"scalar",resolve:hD,construct:mD,predicate:gD,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});D0=new ct("tag:yaml.org,2002:bool",{kind:"scalar",resolve:yD,construct:_D,predicate:vD,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});O0=new ct("tag:yaml.org,2002:int",{kind:"scalar",resolve:kD,construct:SD,predicate:$D,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"]}}),PD=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");TD=/^[-+]?[0-9]+e/;N0=new ct("tag:yaml.org,2002:float",{kind:"scalar",resolve:ED,construct:CD,predicate:RD,represent:AD,defaultStyle:"lowercase"}),j0=I0.extend({implicit:[z0,D0,O0,N0]}),M0=j0,L0=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Z0=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]))?))?$");U0=new ct("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:ID,construct:zD,instanceOf:Date,represent:DD});q0=new ct("tag:yaml.org,2002:merge",{kind:"scalar",resolve:OD}),lf=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
64
|
+
\r`;F0=new ct("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ND,construct:jD,predicate:LD,represent:MD}),ZD=Object.prototype.hasOwnProperty,UD=Object.prototype.toString;G0=new ct("tag:yaml.org,2002:omap",{kind:"sequence",resolve:qD,construct:FD}),GD=Object.prototype.toString;V0=new ct("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:VD,construct:BD}),HD=Object.prototype.hasOwnProperty;B0=new ct("tag:yaml.org,2002:set",{kind:"mapping",resolve:WD,construct:KD}),pf=M0.extend({implicit:[U0,q0],explicit:[F0,G0,V0,B0]}),An=Object.prototype.hasOwnProperty,Kc=1,H0=2,W0=3,Jc=4,nf=1,JD=2,d0=3,YD=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,QD=/[\x85\u2028\u2029]/,XD=/[,\[\]\{\}]/,K0=/^(?:!|!!|![a-z\-]+!)$/i,J0=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;Q0=new Array(256),X0=new Array(256);for(fo=0;fo<256;fo++)Q0[fo]=h0(fo)?1:0,X0[fo]=h0(fo);m0={YAML:function(t,r,n){var o,i,s;t.version!==null&&M(t,"duplication of %YAML directive"),n.length!==1&&M(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&M(t,"ill-formed argument of the YAML directive"),i=parseInt(o[1],10),s=parseInt(o[2],10),i!==1&&M(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Yc(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var o,i;n.length!==2&&M(t,"TAG directive accepts exactly two arguments"),o=n[0],i=n[1],K0.test(o)||M(t,"ill-formed tag handle (first argument) of the TAG directive"),An.call(t.tagMap,o)&&M(t,'there is a previously declared suffix for "'+o+'" tag handle'),J0.test(i)||M(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{M(t,"tag prefix is malformed: "+i)}t.tagMap[o]=i}};yO=mO,_O=gO,rx={loadAll:yO,load:_O},nx=Object.prototype.toString,ox=Object.prototype.hasOwnProperty,hf=65279,vO=9,zs=10,wO=13,bO=32,xO=33,kO=34,sf=35,SO=37,$O=38,PO=39,EO=42,ix=44,CO=45,Qc=58,TO=61,AO=62,RO=63,IO=64,sx=91,ax=93,zO=96,cx=123,DO=124,ux=125,gt={};gt[0]="\\0";gt[7]="\\a";gt[8]="\\b";gt[9]="\\t";gt[10]="\\n";gt[11]="\\v";gt[12]="\\f";gt[13]="\\r";gt[27]="\\e";gt[34]='\\"';gt[92]="\\\\";gt[133]="\\N";gt[160]="\\_";gt[8232]="\\L";gt[8233]="\\P";OO=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],NO=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;LO=1,Ds=2;px=1,cf=2,dx=3,fx=4,di=5;XO=QO,eN={dump:XO};tN=ct,rN=C0,nN=I0,oN=j0,iN=M0,sN=pf,aN=rx.load,cN=rx.loadAll,uN=eN.dump,lN=Et,pN={binary:F0,float:N0,map:R0,null:z0,pairs:V0,set:B0,timestamp:U0,bool:D0,int:O0,merge:q0,omap:G0,seq:A0,str:T0},dN=mf("safeLoad","load"),fN=mf("safeLoadAll","loadAll"),hN=mf("safeDump","dump"),_r={Type:tN,Schema:rN,FAILSAFE_SCHEMA:nN,JSON_SCHEMA:oN,CORE_SCHEMA:iN,DEFAULT_SCHEMA:sN,load:aN,loadAll:cN,dump:uN,YAMLException:lN,types:pN,safeLoad:dN,safeLoadAll:fN,safeDump:hN}});var te,gf,I,jr,js=b(()=>{(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})})(gf||(gf={}));I=te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),jr=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 E,mN,Lt,tu=b(()=>{js();E=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"]),mN=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Lt=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()}};Lt.create=e=>new Lt(e)});var gN,on,yf=b(()=>{tu();js();gN=(e,t)=>{let r;switch(e.code){case E.invalid_type:e.received===I.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case E.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,te.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${te.joinValues(e.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${te.joinValues(e.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${te.joinValues(e.options)}, received '${e.received}'`;break;case E.invalid_arguments:r="Invalid function arguments";break;case E.invalid_return_type:r="Invalid function return type";break;case E.invalid_date:r="Invalid date";break;case E.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 E.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 E.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 E.custom:r="Invalid input";break;case E.invalid_intersection_types:r="Intersection results could not be merged";break;case E.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case E.not_finite:r="Number must be finite";break;default:r=t.defaultError,te.assertNever(e)}return{message:r}},on=gN});function yN(e){hx=e}function gi(){return hx}var hx,ru=b(()=>{yf();hx=on});function R(e,t){let r=gi(),n=Ms({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===on?void 0:on].filter(o=>!!o)});e.common.issues.push(n)}var Ms,_N,ut,L,mo,yt,nu,ou,Rn,yi,_f=b(()=>{ru();yf();Ms=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}},_N=[];ut=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 L;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 L;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}}},L=Object.freeze({status:"aborted"}),mo=e=>({status:"dirty",value:e}),yt=e=>({status:"valid",value:e}),nu=e=>e.status==="aborted",ou=e=>e.status==="dirty",Rn=e=>e.status==="valid",yi=e=>typeof Promise<"u"&&e instanceof Promise});var mx=b(()=>{});var D,gx=b(()=>{(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(D||(D={}))});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 wx(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 ON(e){return new RegExp(`^${wx(e)}$`)}function bx(e){let t=`${vx}T${wx(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 NN(e,t){return!!((t==="v4"||!t)&&CN.test(e)||(t==="v6"||!t)&&AN.test(e))}function jN(e,t){if(!SN.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 MN(e,t){return!!((t==="v4"||!t)&&TN.test(e)||(t==="v6"||!t)&&RN.test(e))}function LN(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 _i(e){if(e instanceof Zt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=nr.create(_i(n))}return new Zt({...e._def,shape:()=>t})}else return e instanceof cn?new cn({...e._def,type:_i(e.element)}):e instanceof nr?nr.create(_i(e.unwrap())):e instanceof Lr?Lr.create(_i(e.unwrap())):e instanceof Mr?Mr.create(e.items.map(t=>_i(t))):e}function wf(e,t){let r=jr(e),n=jr(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=wf(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=wf(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 xx(e,t){return new Po({values:e,typeName:C.ZodEnum,...V(t)})}function _x(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function kx(e,t={},r){return e?zn.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=_x(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=_x(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):zn.create()}var or,yx,J,vN,wN,bN,xN,kN,SN,$N,PN,EN,vf,CN,TN,AN,RN,IN,zN,vx,DN,In,go,yo,_o,vo,vi,wo,bo,zn,an,vr,wi,cn,Zt,xo,sn,iu,ko,Mr,su,bi,xi,au,So,$o,Po,Eo,Dn,ir,nr,Lr,Co,To,ki,ZN,Ls,Zs,Ao,UN,C,qN,Sx,$x,FN,GN,Px,VN,BN,HN,WN,KN,JN,YN,QN,XN,ej,tj,rj,nj,oj,ij,sj,aj,cj,uj,lj,pj,dj,fj,hj,mj,gj,yj,_j,vj,wj,bj,xj,kj,Sj,Ex=b(()=>{tu();ru();gx();_f();js();or=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}},yx=(e,t)=>{if(Rn(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 Lt(e.common.issues);return this._error=r,this._error}}};J=class{get description(){return this._def.description}_getType(t){return jr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:jr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ut,ctx:{common:t.parent.common,data:t.data,parsedType:jr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(yi(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:jr(t)},o=this._parseSync({data:t,path:n.path,parent:n});return yx(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:jr(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Rn(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=>Rn(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:jr(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(yi(o)?o:Promise.resolve(o));return yx(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:E.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 ir({schema:this,typeName:C.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 nr.create(this,this._def)}nullable(){return Lr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cn.create(this)}promise(){return Dn.create(this,this._def)}or(t){return xo.create([this,t],this._def)}and(t){return ko.create(this,t,this._def)}transform(t){return new ir({...V(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Co({...V(this._def),innerType:this,defaultValue:r,typeName:C.ZodDefault})}brand(){return new Ls({typeName:C.ZodBranded,type:this,...V(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new To({...V(this._def),innerType:this,catchValue:r,typeName:C.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Zs.create(this,t)}readonly(){return Ao.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},vN=/^c[^\s-]{8,}$/i,wN=/^[0-9a-z]+$/,bN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,xN=/^[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,kN=/^[a-z0-9_-]{21}$/i,SN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$N=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,PN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,EN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",CN=/^(?:(?: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])$/,TN=/^(?:(?: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])$/,AN=/^(([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]))$/,RN=/^(([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])$/,IN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,zN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vx="((\\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])))",DN=new RegExp(`^${vx}$`);In=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 R(i,{code:E.invalid_type,expected:I.string,received:i.parsedType}),L}let n=new ut,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),R(o,{code:E.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),R(o,{code:E.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?R(o,{code:E.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&R(o,{code:E.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")PN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"email",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")vf||(vf=new RegExp(EN,"u")),vf.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"emoji",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")xN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"uuid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")kN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"nanoid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")vN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"cuid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")wN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"cuid2",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")bN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"ulid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),R(o,{validation:"url",code:E.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),R(o,{validation:"regex",code:E.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),R(o,{code:E.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),R(o,{code:E.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?bx(i).test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?DN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?ON(i).test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?$N.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"duration",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?NN(t.data,i.version)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"ip",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?jN(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"jwt",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?MN(t.data,i.version)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"cidr",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?IN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"base64",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?zN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"base64url",code:E.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:E.invalid_string,...D.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...D.errToObj(t)})}url(t){return this._addCheck({kind:"url",...D.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...D.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...D.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...D.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...D.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...D.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...D.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...D.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...D.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...D.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...D.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...D.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,...D.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,...D.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...D.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...D.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...D.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...D.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...D.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...D.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...D.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...D.errToObj(r)})}nonempty(t){return this.min(1,D.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}};In.create=e=>new In({checks:[],typeName:C.ZodString,coerce:e?.coerce??!1,...V(e)});go=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 R(i,{code:E.invalid_type,expected:I.number,received:i.parsedType}),L}let n,o=new ut;for(let i of this._def.checks)i.kind==="int"?te.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),R(n,{code:E.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),R(n,{code:E.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),R(n,{code:E.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?LN(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),R(n,{code:E.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,D.toString(r))}gt(t,r){return this.setLimit("min",t,!1,D.toString(r))}lte(t,r){return this.setLimit("max",t,!0,D.toString(r))}lt(t,r){return this.setLimit("max",t,!1,D.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:D.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:D.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:D.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:D.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D.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)}};go.create=e=>new go({checks:[],typeName:C.ZodNumber,coerce:e?.coerce||!1,...V(e)});yo=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 ut;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),R(n,{code:E.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),R(n,{code:E.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),R(n,{code:E.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 R(r,{code:E.invalid_type,expected:I.bigint,received:r.parsedType}),L}gte(t,r){return this.setLimit("min",t,!0,D.toString(r))}gt(t,r){return this.setLimit("min",t,!1,D.toString(r))}lte(t,r){return this.setLimit("max",t,!0,D.toString(r))}lt(t,r){return this.setLimit("max",t,!1,D.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:D.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:D.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:D.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}};yo.create=e=>new yo({checks:[],typeName:C.ZodBigInt,coerce:e?.coerce??!1,...V(e)});_o=class extends J{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==I.boolean){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.boolean,received:n.parsedType}),L}return yt(t.data)}};_o.create=e=>new _o({typeName:C.ZodBoolean,coerce:e?.coerce||!1,...V(e)});vo=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 R(i,{code:E.invalid_type,expected:I.date,received:i.parsedType}),L}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return R(i,{code:E.invalid_date}),L}let n=new ut,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),R(o,{code:E.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),R(o,{code:E.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:D.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:D.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}};vo.create=e=>new vo({checks:[],coerce:e?.coerce||!1,typeName:C.ZodDate,...V(e)});vi=class extends J{_parse(t){if(this._getType(t)!==I.symbol){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.symbol,received:n.parsedType}),L}return yt(t.data)}};vi.create=e=>new vi({typeName:C.ZodSymbol,...V(e)});wo=class extends J{_parse(t){if(this._getType(t)!==I.undefined){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.undefined,received:n.parsedType}),L}return yt(t.data)}};wo.create=e=>new wo({typeName:C.ZodUndefined,...V(e)});bo=class extends J{_parse(t){if(this._getType(t)!==I.null){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.null,received:n.parsedType}),L}return yt(t.data)}};bo.create=e=>new bo({typeName:C.ZodNull,...V(e)});zn=class extends J{constructor(){super(...arguments),this._any=!0}_parse(t){return yt(t.data)}};zn.create=e=>new zn({typeName:C.ZodAny,...V(e)});an=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(t){return yt(t.data)}};an.create=e=>new an({typeName:C.ZodUnknown,...V(e)});vr=class extends J{_parse(t){let r=this._getOrReturnCtx(t);return R(r,{code:E.invalid_type,expected:I.never,received:r.parsedType}),L}};vr.create=e=>new vr({typeName:C.ZodNever,...V(e)});wi=class extends J{_parse(t){if(this._getType(t)!==I.undefined){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.void,received:n.parsedType}),L}return yt(t.data)}};wi.create=e=>new wi({typeName:C.ZodVoid,...V(e)});cn=class e extends J{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==I.array)return R(r,{code:E.invalid_type,expected:I.array,received:r.parsedType}),L;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(R(r,{code:s?E.too_big:E.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&&(R(r,{code:E.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&&(R(r,{code:E.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 or(r,s,r.path,a)))).then(s=>ut.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new or(r,s,r.path,a)));return ut.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:D.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:D.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:D.toString(r)}})}nonempty(t){return this.min(1,t)}};cn.create=(e,t)=>new cn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...V(t)});Zt=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 R(u,{code:E.invalid_type,expected:I.object,received:u.parsedType}),L}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof vr&&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 or(o,l,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof vr){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&&(R(o,{code:E.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 or(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=>ut.mergeObjectSync(n,u)):ut.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return D.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:D.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:C.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 _i(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 nr;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return xx(te.objectKeys(this.shape))}};Zt.create=(e,t)=>new Zt({shape:()=>e,unknownKeys:"strip",catchall:vr.create(),typeName:C.ZodObject,...V(t)});Zt.strictCreate=(e,t)=>new Zt({shape:()=>e,unknownKeys:"strict",catchall:vr.create(),typeName:C.ZodObject,...V(t)});Zt.lazycreate=(e,t)=>new Zt({shape:e,unknownKeys:"strip",catchall:vr.create(),typeName:C.ZodObject,...V(t)});xo=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 Lt(a.ctx.common.issues));return R(r,{code:E.invalid_union,unionErrors:s}),L}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 Lt(c));return R(r,{code:E.invalid_union,unionErrors:a}),L}}get options(){return this._def.options}};xo.create=(e,t)=>new xo({options:e,typeName:C.ZodUnion,...V(t)});sn=e=>e instanceof So?sn(e.schema):e instanceof ir?sn(e.innerType()):e instanceof $o?[e.value]:e instanceof Po?e.options:e instanceof Eo?te.objectValues(e.enum):e instanceof Co?sn(e._def.innerType):e instanceof wo?[void 0]:e instanceof bo?[null]:e instanceof nr?[void 0,...sn(e.unwrap())]:e instanceof Lr?[null,...sn(e.unwrap())]:e instanceof Ls||e instanceof Ao?sn(e.unwrap()):e instanceof To?sn(e._def.innerType):[],iu=class e extends J{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.object)return R(r,{code:E.invalid_type,expected:I.object,received:r.parsedType}),L;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}):(R(r,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),L)}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=sn(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:C.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...V(n)})}};ko=class extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(nu(i)||nu(s))return L;let a=wf(i.value,s.value);return a.valid?((ou(i)||ou(s))&&r.dirty(),{status:r.value,value:a.data}):(R(n,{code:E.invalid_intersection_types}),L)};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}))}};ko.create=(e,t,r)=>new ko({left:e,right:t,typeName:C.ZodIntersection,...V(r)});Mr=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.array)return R(n,{code:E.invalid_type,expected:I.array,received:n.parsedType}),L;if(n.data.length<this._def.items.length)return R(n,{code:E.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),L;!this._def.rest&&n.data.length>this._def.items.length&&(R(n,{code:E.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 or(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>ut.mergeArray(r,s)):ut.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Mr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Mr({items:e,typeName:C.ZodTuple,rest:null,...V(t)})};su=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 R(n,{code:E.invalid_type,expected:I.object,received:n.parsedType}),L;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new or(n,a,n.path,a)),value:s._parse(new or(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?ut.mergeObjectAsync(r,o):ut.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:C.ZodRecord,...V(n)}):new e({keyType:In.create(),valueType:t,typeName:C.ZodRecord,...V(r)})}},bi=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 R(n,{code:E.invalid_type,expected:I.map,received:n.parsedType}),L;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new or(n,a,n.path,[u,"key"])),value:i._parse(new or(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 L;(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 L;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(u.value,p.value)}return{status:r.value,value:a}}}};bi.create=(e,t,r)=>new bi({valueType:t,keyType:e,typeName:C.ZodMap,...V(r)});xi=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.set)return R(n,{code:E.invalid_type,expected:I.set,received:n.parsedType}),L;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(R(n,{code:E.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&&(R(n,{code:E.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 L;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 or(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:D.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:D.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};xi.create=(e,t)=>new xi({valueType:e,minSize:null,maxSize:null,typeName:C.ZodSet,...V(t)});au=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 R(r,{code:E.invalid_type,expected:I.function,received:r.parsedType}),L;function n(a,c){return Ms({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,gi(),on].filter(u=>!!u),issueData:{code:E.invalid_arguments,argumentsError:c}})}function o(a,c){return Ms({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,gi(),on].filter(u=>!!u),issueData:{code:E.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Dn){let a=this;return yt(async function(...c){let u=new Lt([]),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 yt(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new Lt([n(c,u.error)]);let p=Reflect.apply(s,this,u.data),l=a._def.returns.safeParse(p,i);if(!l.success)throw new Lt([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:Mr.create(t).rest(an.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||Mr.create([]).rest(an.create()),returns:r||an.create(),typeName:C.ZodFunction,...V(n)})}},So=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})}};So.create=(e,t)=>new So({getter:e,typeName:C.ZodLazy,...V(t)});$o=class extends J{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return R(r,{received:r.data,code:E.invalid_literal,expected:this._def.value}),L}return{status:"valid",value:t.data}}get value(){return this._def.value}};$o.create=(e,t)=>new $o({value:e,typeName:C.ZodLiteral,...V(t)});Po=class e extends J{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return R(r,{expected:te.joinValues(n),received:r.parsedType,code:E.invalid_type}),L}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 R(r,{received:r.data,code:E.invalid_enum_value,options:n}),L}return yt(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})}};Po.create=xx;Eo=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 R(n,{expected:te.joinValues(o),received:n.parsedType,code:E.invalid_type}),L}if(this._cache||(this._cache=new Set(te.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=te.objectValues(r);return R(n,{received:n.data,code:E.invalid_enum_value,options:o}),L}return yt(t.data)}get enum(){return this._def.values}};Eo.create=(e,t)=>new Eo({values:e,typeName:C.ZodNativeEnum,...V(t)});Dn=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 R(r,{code:E.invalid_type,expected:I.promise,received:r.parsedType}),L;let n=r.parsedType===I.promise?r.data:Promise.resolve(r.data);return yt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Dn.create=(e,t)=>new Dn({type:e,typeName:C.ZodPromise,...V(t)});ir=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.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=>{R(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 L;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?L:c.status==="dirty"?mo(c.value):r.value==="dirty"?mo(c.value):c});{if(r.value==="aborted")return L;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?L:a.status==="dirty"?mo(a.value):r.value==="dirty"?mo(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"?L:(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"?L:(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(!Rn(s))return L;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=>Rn(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):L);te.assertNever(o)}};ir.create=(e,t,r)=>new ir({schema:e,typeName:C.ZodEffects,effect:t,...V(r)});ir.createWithPreprocess=(e,t,r)=>new ir({schema:t,effect:{type:"preprocess",transform:e},typeName:C.ZodEffects,...V(r)});nr=class extends J{_parse(t){return this._getType(t)===I.undefined?yt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};nr.create=(e,t)=>new nr({innerType:e,typeName:C.ZodOptional,...V(t)});Lr=class extends J{_parse(t){return this._getType(t)===I.null?yt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Lr.create=(e,t)=>new Lr({innerType:e,typeName:C.ZodNullable,...V(t)});Co=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}};Co.create=(e,t)=>new Co({innerType:e,typeName:C.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...V(t)});To=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 yi(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Lt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Lt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};To.create=(e,t)=>new To({innerType:e,typeName:C.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...V(t)});ki=class extends J{_parse(t){if(this._getType(t)!==I.nan){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.nan,received:n.parsedType}),L}return{status:"valid",value:t.data}}};ki.create=e=>new ki({typeName:C.ZodNaN,...V(e)});ZN=Symbol("zod_brand"),Ls=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}},Zs=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"?L:i.status==="dirty"?(r.dirty(),mo(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"?L: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:C.ZodPipeline})}},Ao=class extends J{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Rn(o)&&(o.value=Object.freeze(o.value)),o);return yi(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Ao.create=(e,t)=>new Ao({innerType:e,typeName:C.ZodReadonly,...V(t)});UN={object:Zt.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"})(C||(C={}));qN=(e,t={message:`Input not instance of ${e.name}`})=>kx(r=>r instanceof e,t),Sx=In.create,$x=go.create,FN=ki.create,GN=yo.create,Px=_o.create,VN=vo.create,BN=vi.create,HN=wo.create,WN=bo.create,KN=zn.create,JN=an.create,YN=vr.create,QN=wi.create,XN=cn.create,ej=Zt.create,tj=Zt.strictCreate,rj=xo.create,nj=iu.create,oj=ko.create,ij=Mr.create,sj=su.create,aj=bi.create,cj=xi.create,uj=au.create,lj=So.create,pj=$o.create,dj=Po.create,fj=Eo.create,hj=Dn.create,mj=ir.create,gj=nr.create,yj=Lr.create,_j=ir.createWithPreprocess,vj=Zs.create,wj=()=>Sx().optional(),bj=()=>$x().optional(),xj=()=>Px().optional(),kj={string:(e=>In.create({...e,coerce:!0})),number:(e=>go.create({...e,coerce:!0})),boolean:(e=>_o.create({...e,coerce:!0})),bigint:(e=>yo.create({...e,coerce:!0})),date:(e=>vo.create({...e,coerce:!0}))},Sj=L});var m={};Xt(m,{BRAND:()=>ZN,DIRTY:()=>mo,EMPTY_PATH:()=>_N,INVALID:()=>L,NEVER:()=>Sj,OK:()=>yt,ParseStatus:()=>ut,Schema:()=>J,ZodAny:()=>zn,ZodArray:()=>cn,ZodBigInt:()=>yo,ZodBoolean:()=>_o,ZodBranded:()=>Ls,ZodCatch:()=>To,ZodDate:()=>vo,ZodDefault:()=>Co,ZodDiscriminatedUnion:()=>iu,ZodEffects:()=>ir,ZodEnum:()=>Po,ZodError:()=>Lt,ZodFirstPartyTypeKind:()=>C,ZodFunction:()=>au,ZodIntersection:()=>ko,ZodIssueCode:()=>E,ZodLazy:()=>So,ZodLiteral:()=>$o,ZodMap:()=>bi,ZodNaN:()=>ki,ZodNativeEnum:()=>Eo,ZodNever:()=>vr,ZodNull:()=>bo,ZodNullable:()=>Lr,ZodNumber:()=>go,ZodObject:()=>Zt,ZodOptional:()=>nr,ZodParsedType:()=>I,ZodPipeline:()=>Zs,ZodPromise:()=>Dn,ZodReadonly:()=>Ao,ZodRecord:()=>su,ZodSchema:()=>J,ZodSet:()=>xi,ZodString:()=>In,ZodSymbol:()=>vi,ZodTransformer:()=>ir,ZodTuple:()=>Mr,ZodType:()=>J,ZodUndefined:()=>wo,ZodUnion:()=>xo,ZodUnknown:()=>an,ZodVoid:()=>wi,addIssueToContext:()=>R,any:()=>KN,array:()=>XN,bigint:()=>GN,boolean:()=>Px,coerce:()=>kj,custom:()=>kx,date:()=>VN,datetimeRegex:()=>bx,defaultErrorMap:()=>on,discriminatedUnion:()=>nj,effect:()=>mj,enum:()=>dj,function:()=>uj,getErrorMap:()=>gi,getParsedType:()=>jr,instanceof:()=>qN,intersection:()=>oj,isAborted:()=>nu,isAsync:()=>yi,isDirty:()=>ou,isValid:()=>Rn,late:()=>UN,lazy:()=>lj,literal:()=>pj,makeIssue:()=>Ms,map:()=>aj,nan:()=>FN,nativeEnum:()=>fj,never:()=>YN,null:()=>WN,nullable:()=>yj,number:()=>$x,object:()=>ej,objectUtil:()=>gf,oboolean:()=>xj,onumber:()=>bj,optional:()=>gj,ostring:()=>wj,pipeline:()=>vj,preprocess:()=>_j,promise:()=>hj,quotelessJson:()=>mN,record:()=>sj,set:()=>cj,setErrorMap:()=>yN,strictObject:()=>tj,string:()=>Sx,symbol:()=>BN,transformer:()=>mj,tuple:()=>ij,undefined:()=>HN,union:()=>rj,unknown:()=>JN,util:()=>te,void:()=>QN});var cu=b(()=>{ru();_f();mx();js();Ex();tu()});var Xe=b(()=>{cu();cu()});var $j,Pj,Ej,Cj,Tj,Aj,Rj,Ij,Cx,Tx=b(()=>{"use strict";Xe();$j=m.object({id:m.string(),label:m.string(),name:m.string(),mindset_template:m.string().optional()}),Pj=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()}),Ej=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()}),Cj=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")}),Tj=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)}),Aj=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()}),Rj=m.object({name:m.string(),description:m.string().optional(),stacks:m.array($j),frontend:Pj.optional(),backend:Ej.optional(),quality_gate:Cj.optional(),vendor:m.array(Tj).optional(),tools:m.array(Aj).optional()}),Ij=m.object({enabled:m.boolean().optional(),tool:m.string().optional(),question_channel:m.string().optional(),permalink_tool:m.string().optional()}),Cx=m.object({license_key:m.string().min(1).optional(),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().optional(),registry_url:m.string().optional(),slack:Ij.optional()}).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 rt(e){return e.trim().replace(/\/+$/,"")}function On(e=process.env){let t=e.XDG_CONFIG_HOME?.trim(),r=t||(0,Si.join)((0,bf.homedir)(),".config");return(0,Si.join)(r,"godd","credentials.json")}function wr(e=process.env){let t=[On(e),(0,Si.join)((0,bf.homedir)(),".config","godd","credentials.json")];return[...new Set(t)]}function uu(e){if(!(0,et.existsSync)(e))return{};let t;try{t=JSON.parse((0,et.readFileSync)(e,"utf-8"))}catch{throw new Error(`\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: ${e}
|
|
65
|
+
godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}let r=Dj.safeParse(t);if(r.success){let o={};for(let i of Object.values(r.data.logins))o[rt(i.registry_url)]=i;return o}let n=zj.safeParse(t);if(n.success){let{version:o,...i}=n.data;return{[rt(i.registry_url)]:i}}throw new Error(`\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306E\u5F62\u5F0F\u304C\u4E0D\u6B63\u3067\u3059: ${e}
|
|
66
|
+
godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}function Ro(e,t=wr()){let r=rt(e);for(let n of t){let o=uu(n)[r];if(o)return{credentials:o,path:n}}return null}function un(e=wr()){let t=new Map;for(let r of e)for(let[n,o]of Object.entries(uu(r)))t.has(n)||t.set(n,o);return[...t.values()]}function zx(e,t){let r=(0,Si.dirname)(t);(0,et.mkdirSync)(r,{recursive:!0,mode:448}),process.platform!=="win32"&&(0,et.chmodSync)(r,448);let n=`${JSON.stringify({version:Rx,logins:e},null,2)}
|
|
67
|
+
`,o=`${t}.${process.pid}.${(0,Ax.randomBytes)(6).toString("hex")}.tmp`,i=(0,et.openSync)(o,"wx",384);try{try{(0,et.writeSync)(i,n,null,"utf-8")}finally{(0,et.closeSync)(i)}(0,et.renameSync)(o,t)}catch(s){throw(0,et.rmSync)(o,{force:!0}),s}}function Dx(e,t=On()){let r={};try{r=uu(t)}catch{}r[rt(e.registry_url)]=e,zx(r,t)}function xf(e,t=On()){let r=uu(t),n=rt(e);return n in r?(delete r[n],Object.keys(r).length===0?(0,et.rmSync)(t,{force:!0}):zx(r,t),!0):!1}function lu(e,t=new Date){if(!e.expires_at)return!1;let r=new Date(e.expires_at);return Number.isNaN(r.getTime())?!0:r.getTime()<=t.getTime()}var Ax,et,bf,Si,Rx,Ix,zj,Dj,$i=b(()=>{"use strict";Ax=require("node:crypto"),et=require("node:fs"),bf=require("node:os"),Si=require("node:path");Xe();Rx=2,Ix=m.object({registry_url:m.string().min(1),access_token:m.string().min(1),expires_at:m.string().nullable(),email:m.string().nullable(),license_id:m.string().nullable(),device_name:m.string(),drive_authorized:m.boolean(),saved_at:m.string()}),zj=Ix.extend({version:m.literal(1)}),Dj=m.object({version:m.literal(Rx),logins:m.record(m.string(),Ix)})});function Ox(e){let t=e??process.env.GODD_CONFIG;if(!t)throw new Error(`${Ht} \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,pu.existsSync)(t))throw new Error(`${Ht} \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${t}
|
|
68
|
+
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,pu.readFileSync)(t,"utf-8"),n=_r.load(r),o=Cx.parse(n),i=process.env.GODD_REGISTRY_URL??o.registry_url??ln,s={stack_profile:o.stack_profile,components:o.components??[],language:process.env.GODD_LANGUAGE??o.language??Oj,registry_url:i},a=process.env.GODD_LICENSE_KEY??o.license_key;return a?{license_key:a,auth_source:"license_key",...s}:{license_key:kf(i),auth_source:"device_token",...s}}function kf(e,t={}){let r=t.paths??wr(),n=t.warn??(s=>console.error(s)),o=Ro(e,r);if(!o){let s=un(r);throw s.length>0?new Error(`\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u306F\u5225\u306E Registry\uFF08${s.map(a=>a.registry_url).join(", ")}\uFF09\u5411\u3051\u3067\u3059\u3002godd login --registry-url ${rt(e)} \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`):new Error("license_key \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002GODD_LICENSE_KEY \u74B0\u5883\u5909\u6570\u3092\u8A2D\u5B9A\u3059\u308B\u304B\u3001.env \u306B\u8A18\u8F09\u3057\u3066\u304F\u3060\u3055\u3044\u3002Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u4F7F\u3046\u5834\u5408\u306F godd login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}let{credentials:i}=o;return lu(i)&&n(`[GoDD] \u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u306F\u624B\u5143\u306E\u8A18\u9332\u3067\u306F\u6709\u52B9\u671F\u9650\uFF08${i.expires_at}\uFF09\u3092\u904E\u304E\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u304C\u5EF6\u9577\u3057\u3066\u3044\u308C\u3070\u305D\u306E\u307E\u307E\u4F7F\u3048\u307E\u3059\u3002\u62D2\u5426\u3055\u308C\u305F\u5834\u5408\u306F godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),i.access_token}var pu,Ht,ln,Oj,Nn=b(()=>{"use strict";pu=require("node:fs");Ns();Tx();$i();Ht="config.godd",ln="https://dev.api.godd.ripla-inc.com",Oj="en"});function du(e,t,r){if(e.__GODD_CLI__)return!1;if(!r)return!0;if(!t)return!1;let n;try{n=(0,Mx.fileURLToPath)(r)}catch{return!0}return t===n?!0:Nx(t)===Nx(n)}function Nx(e){try{return(0,jx.realpathSync)(e)}catch{return e}}var jx,Mx,Sf=b(()=>{"use strict";jx=require("node:fs"),Mx=require("node:url")});var fu=b(()=>{cu()});var Lx=b(()=>{Pt()});var Zx=b(()=>{});var Ux=b(()=>{});var qx=b(()=>{});var Fx=b(()=>{});var Gx=b(()=>{Pt();Lx();Zx();Ux();Pt();xc();qx();Fx()});var Vx=b(()=>{Gx()});var $f=b(()=>{Vx()});function Io(e){return!!e._zod}function jn(e,t){return Io(e)?ms(e,t):e.safeParse(t)}function hu(e){if(!e)return;let t;if(Io(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function Hx(e){if(Io(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 mu=b(()=>{$f()});function Mn(e){return e==="completed"||e==="failed"||e==="cancelled"}var Wx=b(()=>{});var Jx,Kx,Yx,gu=b(()=>{Jx=Symbol("Let zodToJsonSchema decide on which parser to use"),Kx={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"},Yx=e=>typeof e=="string"?{...Kx,name:e}:{...Kx,...e}});var Qx,Pf=b(()=>{gu();Qx=e=>{let t=Yx(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 Ef(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function se(e,t,r,n,o){e[t]=r,Ef(e,t,n,o)}var Ln=b(()=>{});var yu,_u=b(()=>{yu=(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 De(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?yu(t,e.currentPath):t.join("/")}}var sr=b(()=>{_u()});function Xx(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==C.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 Cf=b(()=>{fu();Ln();He()});function ek(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 Tf=b(()=>{Ln()});function tk(){return{type:"boolean"}}var Af=b(()=>{});function vu(e,t){return U(e.type._def,t)}var wu=b(()=>{He()});var rk,Rf=b(()=>{He();rk=(e,t)=>U(e.innerType._def,t)});function If(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,i)=>If(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 Mj(e,t)}}var Mj,zf=b(()=>{Ln();Mj=(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 nk(e,t){return{...U(e.innerType._def,t),default:e.defaultValue()}}var Df=b(()=>{He()});function ok(e,t){return t.effectStrategy==="input"?U(e.schema._def,t):De(t)}var Of=b(()=>{He();sr()});function ik(e){return{type:"string",enum:Array.from(e.values)}}var Nf=b(()=>{});function sk(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(Lj(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 Lj,jf=b(()=>{He();Lj=e=>"type"in e&&e.type==="string"?!1:"allOf"in e});function ak(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 Mf=b(()=>{});function bu(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":xr(r,"email",n.message,t);break;case"format:idn-email":xr(r,"idn-email",n.message,t);break;case"pattern:zod":Ct(r,br.email,n.message,t);break}break;case"url":xr(r,"uri",n.message,t);break;case"uuid":xr(r,"uuid",n.message,t);break;case"regex":Ct(r,n.regex,n.message,t);break;case"cuid":Ct(r,br.cuid,n.message,t);break;case"cuid2":Ct(r,br.cuid2,n.message,t);break;case"startsWith":Ct(r,RegExp(`^${Zf(n.value,t)}`),n.message,t);break;case"endsWith":Ct(r,RegExp(`${Zf(n.value,t)}$`),n.message,t);break;case"datetime":xr(r,"date-time",n.message,t);break;case"date":xr(r,"date",n.message,t);break;case"time":xr(r,"time",n.message,t);break;case"duration":xr(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":{Ct(r,RegExp(Zf(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&xr(r,"ipv4",n.message,t),n.version!=="v4"&&xr(r,"ipv6",n.message,t);break}case"base64url":Ct(r,br.base64url,n.message,t);break;case"jwt":Ct(r,br.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&Ct(r,br.ipv4Cidr,n.message,t),n.version!=="v4"&&Ct(r,br.ipv6Cidr,n.message,t);break}case"emoji":Ct(r,br.emoji(),n.message,t);break;case"ulid":{Ct(r,br.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{xr(r,"binary",n.message,t);break}case"contentEncoding:base64":{se(r,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{Ct(r,br.base64,n.message,t);break}}break}case"nanoid":Ct(r,br.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Zf(e,t){return t.patternStrategy==="escape"?Uj(e):e}function Uj(e){let t="";for(let r=0;r<e.length;r++)Zj.has(e[r])||(t+="\\"),t+=e[r];return t}function xr(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 Ct(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:ck(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):se(e,"pattern",ck(t,n),r,n)}function ck(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
|
|
69
69
|
]))`;continue}else if(n[c]==="$"){o+=`($|(?=[\r
|
|
70
70
|
]))`;continue}}if(r.s&&n[c]==="."){o+=s?`${n[c]}\r
|
|
71
71
|
`:`[${n[c]}\r
|
|
72
|
-
]`;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 Mf,xr,Bj,kl=b(()=>{Zn();xr={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:()=>(Mf===void 0&&(Mf=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Mf),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-_]*$/};Bj=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function Sl(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===C.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]})??De(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===C.ZodString&&e.keyType._def.checks?.length){let{type:n,...o}=xl(e.keyType._def,t);return{...r,propertyNames:o}}else{if(e.keyType?._def.typeName===C.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===C.ZodBranded&&e.keyType._def.type._def.typeName===C.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...o}=wl(e.keyType._def,t);return{...r,propertyNames:o}}}return r}var $l=b(()=>{hl();We();kl();bl();sr()});function ck(e,t){if(t.mapStrategy==="record")return Sl(e,t);let r=U(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||De(t),n=U(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||De(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var Zf=b(()=>{We();$l();sr()});function lk(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 Uf=b(()=>{});function uk(e){return e.target==="openAi"?void 0:{not:De({...e,currentPath:[...e.currentPath,"not"]})}}var qf=b(()=>{sr()});function pk(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Ff=b(()=>{});function fk(e,t){if(t.target==="openApi3")return dk(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in qs&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,i)=>{let s=qs[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 dk(e,t)}var qs,dk,Pl=b(()=>{We();qs={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};dk=(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 hk(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:qs[e.innerType._def.typeName],nullable:!0}:{type:[qs[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 Gf=b(()=>{We();Pl()});function mk(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",Pf(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 Vf=b(()=>{Zn()});function gk(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 l=Wj(c);l&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=!1);let p=U(c._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});p!==void 0&&(n.properties[a]=p,l||o.push(a))}o.length&&(n.required=o);let s=Kj(e,t);return s!==void 0&&(n.additionalProperties=s),n}function Kj(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 Wj(e){try{return e.isOptional()}catch{return!0}}var Bf=b(()=>{We()});var _k,Hf=b(()=>{We();sr();_k=(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:De(t)},r]}:De(t)}});var yk,Kf=b(()=>{We();yk=(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 vk(e,t){return U(e.type._def,t)}var Wf=b(()=>{We()});function wk(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 Jf=b(()=>{Zn();We()});function bk(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 Yf=b(()=>{We()});function xk(e){return{not:De(e)}}var Qf=b(()=>{sr()});function kk(e){return De(e)}var Xf=b(()=>{sr()});var Sk,eh=b(()=>{We();Sk=(e,t)=>U(e.innerType._def,t)});var $k,th=b(()=>{hl();sr();Ef();Cf();Tf();bl();Rf();If();zf();Df();Of();Nf();jf();Zf();Uf();qf();Ff();Gf();Vf();Bf();Hf();Kf();Wf();$l();Jf();kl();Yf();Qf();Pl();Xf();eh();$k=(e,t,r)=>{switch(t){case C.ZodString:return xl(e,r);case C.ZodNumber:return mk(e,r);case C.ZodObject:return gk(e,r);case C.ZodBigInt:return Xx(e,r);case C.ZodBoolean:return ek();case C.ZodDate:return Af(e,r);case C.ZodUndefined:return xk(r);case C.ZodNull:return pk(r);case C.ZodArray:return Qx(e,r);case C.ZodUnion:case C.ZodDiscriminatedUnion:return fk(e,r);case C.ZodIntersection:return ik(e,r);case C.ZodTuple:return bk(e,r);case C.ZodRecord:return Sl(e,r);case C.ZodLiteral:return sk(e,r);case C.ZodEnum:return ok(e);case C.ZodNativeEnum:return lk(e);case C.ZodNullable:return hk(e,r);case C.ZodOptional:return _k(e,r);case C.ZodMap:return ck(e,r);case C.ZodSet:return wk(e,r);case C.ZodLazy:return()=>e.getter()._def;case C.ZodPromise:return vk(e,r);case C.ZodNaN:case C.ZodNever:return uk(r);case C.ZodEffects:return nk(e,r);case C.ZodAny:return De(r);case C.ZodUnknown:return kk(r);case C.ZodDefault:return rk(e,r);case C.ZodBranded:return wl(e,r);case C.ZodReadonly:return Sk(e,r);case C.ZodCatch:return tk(e,r);case C.ZodPipeline:return yk(e,r);case C.ZodFunction:case C.ZodVoid:case C.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!==Wx)return a}if(n&&!r){let a=Jj(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=$k(e,e.typeName,t),s=typeof i=="function"?U(i(),t):i;if(s&&Yj(e,t,s),t.postProcess){let a=t.postProcess(s,e,t);return o.jsonSchema=s,a}return o.jsonSchema=s,s}var Jj,Yj,We=b(()=>{_l();th();vl();sr();Jj=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:yl(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`),De(t)):t.$refStrategy==="seen"?De(t):void 0}},Yj=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r)});var Pk=b(()=>{});var rh,nh=b(()=>{We();$f();sr();rh=(e,t)=>{let r=Yx(t),n=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[l,p])=>({...c,[l]:U(p._def,{...r,currentPath:[...r.basePath,r.definitionPath,l]},!0)??De(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)??De(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 Ek=b(()=>{_l();$f();Zn();vl();We();Pk();sr();Ef();Cf();Tf();bl();Rf();If();zf();Df();Of();Nf();jf();Zf();Uf();qf();Ff();Gf();Vf();Bf();Hf();Kf();Wf();eh();$l();Jf();kl();Yf();Qf();Pl();Xf();th();nh();nh()});function Qj(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function Ck(e,t){return zo(e)?Ec(e,{target:Qj(t?.target),io:t?.pipeStrategy??"input"}):rh(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function oh(e){let r=ml(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Bx(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function ih(e,t){let r=Mn(e,t);if(!r.success)throw r.error;return r.data}var sh=b(()=>{Sf();gl();Ek()});function Tk(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Rk(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];Tk(s)&&Tk(i)?r[o]={...s,...i}:r[o]=i}return r}var Xj,El,Ak=b(()=>{gl();Tn();Hx();sh();Xj=6e4,El=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(jc,r=>{this._oncancel(r)}),this.setNotificationHandler(Zc,r=>{this._onprogress(r)}),this.setRequestHandler(Lc,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Uc,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new B(X.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Fc,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,l=c.id,p=this._requestResolvers.get(l);if(p)if(this._requestResolvers.delete(l),a.type==="response")p(c);else{let u=c,d=new B(u.error.code,u.error.message,u.error.data);p(d)}else{let u=a.type==="response"?"Response":"Error";this._onerror(new Error(`${u} handler missing for request ${l}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(i,n.sessionId);if(!s)throw new B(X.InvalidParams,`Task not found: ${i}`);if(!Ln(s.status))return await this._waitForTaskUpdate(i,n.signal),await o();if(Ln(s.status)){let a=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...a,_meta:{...a._meta,[Cn]:{taskId:i}}}}return await o()};return await o()}),this.setRequestHandler(Gc,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 B(X.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Bc,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new B(X.InvalidParams,`Task not found: ${r.params.taskId}`);if(Ln(o.status))throw new B(X.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 B(X.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(o){throw o instanceof B?o:new B(X.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),B.fromError(X.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),fo(i)||Xb(i)?this._onresponse(i):po(i)?this._onrequest(i,s):Qb(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=B.fromError(X.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?.[Cn]?.taskId;if(n===void 0){let p={jsonrpc:"2.0",id:t.id,error:{code:X.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:p,timestamp:Date.now()},o?.sessionId).catch(u=>this._onerror(new Error(`Failed to enqueue error response: ${u}`))):o?.send(p).catch(u=>this._onerror(new Error(`Failed to send an error response: ${u}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(t.id,s);let a=Wb(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,o?.sessionId):void 0,l={signal:s.signal,sessionId:o?.sessionId,_meta:t.params?._meta,sendNotification:async p=>{if(s.signal.aborted)return;let u={relatedRequestId:t.id};i&&(u.relatedTask={taskId:i}),await this.notification(p,u)},sendRequest:async(p,u,d)=>{if(s.signal.aborted)throw new B(X.ConnectionClosed,"Request was cancelled");let h={...d,relatedRequestId:t.id};i&&!h.relatedTask&&(h.relatedTask={taskId:i});let m=h.relatedTask?.taskId??i;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(p,u,h)},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,l)).then(async p=>{if(s.signal.aborted)return;let u={result:p,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:u,timestamp:Date.now()},o?.sessionId):await o?.send(u)},async p=>{if(s.signal.aborted)return;let u={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(p.code)?p.code:X.InternalError,message:p.message??"Internal error",...p.data!==void 0&&{data:p.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:u,timestamp:Date.now()},o?.sessionId):await o?.send(u)}).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),fo(t))n(t);else{let s=new B(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(fo(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),fo(t))o(t);else{let s=B.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 B?s:new B(X.InternalError,String(s))}}return}let i;try{let s=await this.request(t,ui,n);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new B(X.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:a},Ln(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)}:a.status==="failed"?yield{type:"error",error:new B(X.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new B(X.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(l=>setTimeout(l,c)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof B?s:new B(X.InternalError,String(s))}}}request(t,r,n){let{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s,task:a,relatedTask:c}=n??{};return new Promise((l,p)=>{let u=w=>{p(w)};if(!this._transport){u(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(w){u(w);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,h={...t,jsonrpc:"2.0",id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),h.params={...t.params,_meta:{...t.params?._meta||{},progressToken:d}}),a&&(h.params={...h.params,task:a}),c&&(h.params={...h.params,_meta:{...h.params?._meta||{},[Cn]:c}});let m=w=>{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(w)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));let x=w instanceof B?w:new B(X.RequestTimeout,String(w));p(x)};this._responseHandlers.set(d,w=>{if(!n?.signal?.aborted){if(w instanceof Error)return p(w);try{let x=Mn(r,w.result);x.success?l(x.data):p(x.error)}catch(x){p(x)}}}),n?.signal?.addEventListener("abort",()=>{m(n?.signal?.reason)});let g=n?.timeout??Xj,_=()=>m(B.fromError(X.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(d,g,n?.maxTotalTimeout,_,n?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let w=x=>{let k=this._responseHandlers.get(d);k?k(x):this._onerror(new Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,w),this._enqueueTaskMessage(v,{type:"request",message:h,timestamp:Date.now()}).catch(x=>{this._cleanupTimeout(d),p(x)})}else this._transport.send(h,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(w=>{this._cleanupTimeout(d),p(w)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},qc,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},Vc,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},r0,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||{},[Cn]: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||{},[Cn]: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||{},[Cn]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(t,r){let n=oh(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,i)=>{let s=ih(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=oh(t);this._notificationHandlers.set(n,o=>{let i=ih(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"&&po(o.message)){let i=o.message.id,s=this._requestResolvers.get(i);s?(s(new B(X.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 B(X.InvalidRequest,"Request cancelled"));return}let s=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(s),i(new B(X.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 B(X.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=Cs.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Ln(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 B(X.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Ln(a.status))throw new B(X.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 l=Cs.parse({method:"notifications/tasks/status",params:c});await this.notification(l),Ln(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}}});var Vs=$(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.regexpCode=le.getEsmExportName=le.getProperty=le.safeStringify=le.stringify=le.strConcat=le.addCodeArg=le.str=le._=le.nil=le._Code=le.Name=le.IDENTIFIER=le._CodeOrName=void 0;var Fs=class{};le._CodeOrName=Fs;le.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Do=class extends Fs{constructor(t){if(super(),!le.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}}};le.Name=Do;var ar=class extends Fs{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 Do&&(r[n.str]=(r[n.str]||0)+1),r),{})}};le._Code=ar;le.nil=new ar("");function Ik(e,...t){let r=[e[0]],n=0;for(;n<t.length;)ch(r,t[n]),r.push(e[++n]);return new ar(r)}le._=Ik;var ah=new ar("+");function zk(e,...t){let r=[Gs(e[0])],n=0;for(;n<t.length;)r.push(ah),ch(r,t[n]),r.push(ah,Gs(e[++n]));return e4(r),new ar(r)}le.str=zk;function ch(e,t){t instanceof ar?e.push(...t._items):t instanceof Do?e.push(t):e.push(n4(t))}le.addCodeArg=ch;function e4(e){let t=1;for(;t<e.length-1;){if(e[t]===ah){let r=t4(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function t4(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Do||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 Do))return`"${e}${t.slice(1)}`}function r4(e,t){return t.emptyStr()?e:e.emptyStr()?t:zk`${e}${t}`}le.strConcat=r4;function n4(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Gs(Array.isArray(e)?e.join(","):e)}function o4(e){return new ar(Gs(e))}le.stringify=o4;function Gs(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}le.safeStringify=Gs;function i4(e){return typeof e=="string"&&le.IDENTIFIER.test(e)?new ar(`.${e}`):Ik`[${e}]`}le.getProperty=i4;function s4(e){if(typeof e=="string"&&le.IDENTIFIER.test(e))return new ar(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}le.getEsmExportName=s4;function a4(e){return new ar(e.toString())}le.regexpCode=a4});var ph=$(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.ValueScope=qt.ValueScopeName=qt.Scope=qt.varKinds=qt.UsedValueState=void 0;var Ut=Vs(),lh=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Cl;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Cl||(qt.UsedValueState=Cl={}));qt.varKinds={const:new Ut.Name("const"),let:new Ut.Name("let"),var:new Ut.Name("var")};var Tl=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Ut.Name?t:this.name(t)}name(t){return new Ut.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}}};qt.Scope=Tl;var Rl=class extends Ut.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Ut._)`.${new Ut.Name(r)}[${n}]`}};qt.ValueScopeName=Rl;var c4=(0,Ut._)`\n`,uh=class extends Tl{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?c4:Ut.nil}}get(){return this._scope}name(t){return new Rl(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]=[]),l=c.length;return c[l]=r.ref,o.setValue(r,{property:i,itemIndex:l}),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,Ut._)`${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=Ut.nil;for(let s in t){let a=t[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Cl.Started);let p=r(l);if(p){let u=this.opts.es5?qt.varKinds.var:qt.varKinds.const;i=(0,Ut._)`${i}${u} ${l} = ${p};${this.opts._n}`}else if(p=o?.(l))i=(0,Ut._)`${i}${p}${this.opts._n}`;else throw new lh(l);c.set(l,Cl.Completed)})}return i}};qt.ValueScope=uh});var Y=$(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=Vs(),Sr=ph(),Un=Vs();Object.defineProperty(Q,"_",{enumerable:!0,get:function(){return Un._}});Object.defineProperty(Q,"str",{enumerable:!0,get:function(){return Un.str}});Object.defineProperty(Q,"strConcat",{enumerable:!0,get:function(){return Un.strConcat}});Object.defineProperty(Q,"nil",{enumerable:!0,get:function(){return Un.nil}});Object.defineProperty(Q,"getProperty",{enumerable:!0,get:function(){return Un.getProperty}});Object.defineProperty(Q,"stringify",{enumerable:!0,get:function(){return Un.stringify}});Object.defineProperty(Q,"regexpCode",{enumerable:!0,get:function(){return Un.regexpCode}});Object.defineProperty(Q,"Name",{enumerable:!0,get:function(){return Un.Name}});var Dl=ph();Object.defineProperty(Q,"Scope",{enumerable:!0,get:function(){return Dl.Scope}});Object.defineProperty(Q,"ValueScope",{enumerable:!0,get:function(){return Dl.ValueScope}});Object.defineProperty(Q,"ValueScopeName",{enumerable:!0,get:function(){return Dl.ValueScopeName}});Object.defineProperty(Q,"varKinds",{enumerable:!0,get:function(){return Dl.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 dn=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},dh=class extends dn{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Sr.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=Ci(this.rhs,t,r)),this}get names(){return this.rhs instanceof ae._CodeOrName?this.rhs.names:{}}},Al=class extends dn{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=Ci(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ae.Name?{}:{...this.lhs.names};return zl(t,this.rhs)}},fh=class extends Al{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},hh=class extends dn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},mh=class extends dn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},gh=class extends dn{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},_h=class extends dn{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=Ci(this.code,t,r),this}get names(){return this.code instanceof ae._CodeOrName?this.code.names:{}}},Bs=class extends dn{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)||(l4(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>jo(t,r.names),{})}},fn=class extends Bs{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},yh=class extends Bs{},Ei=class extends fn{};Ei.kind="else";var Oo=class e extends fn{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 Ei(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Dk(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=Ci(this.condition,t,r),this}get names(){let t=super.names;return zl(t,this.condition),this.else&&jo(t,this.else.names),t}};Oo.kind="if";var No=class extends fn{};No.kind="for";var vh=class extends No{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=Ci(this.iteration,t,r),this}get names(){return jo(super.names,this.iteration.names)}},wh=class extends No{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Sr.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=zl(super.names,this.from);return zl(t,this.to)}},Il=class extends No{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=Ci(this.iterable,t,r),this}get names(){return jo(super.names,this.iterable.names)}},Hs=class extends fn{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)}};Hs.kind="func";var Ks=class extends Bs{render(t){return"return "+super.render(t)}};Ks.kind="return";var bh=class extends fn{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&&jo(t,this.catch.names),this.finally&&jo(t,this.finally.names),t}},Ws=class extends fn{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Ws.kind="catch";var Js=class extends fn{render(t){return"finally"+super.render(t)}};Js.kind="finally";var xh=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
73
|
-
`:""},this._extScope=t,this._scope=new Sr.Scope({parent:t}),this._nodes=[new yh]}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 dh(t,i,n)),i}const(t,r,n){return this._def(Sr.varKinds.const,t,r,n)}let(t,r,n){return this._def(Sr.varKinds.let,t,r,n)}var(t,r,n){return this._def(Sr.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Al(t,r,n))}add(t,r){return this._leafNode(new fh(t,Q.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ae.nil&&this._leafNode(new _h(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 Oo(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 Oo(t))}else(){return this._elseNode(new Ei)}endIf(){return this._endBlockNode(Oo,Ei)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new vh(t),r)}forRange(t,r,n,o,i=this.opts.es5?Sr.varKinds.var:Sr.varKinds.let){let s=this._scope.toName(t);return this._for(new wh(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Sr.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 Il("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Sr.varKinds.var:Sr.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 Il("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(No)}label(t){return this._leafNode(new hh(t))}break(t){return this._leafNode(new mh(t))}return(t){let r=new Ks;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ks)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new bh;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Ws(i),r(i)}return n&&(this._currNode=o.finally=new Js,this.code(n)),this._endBlockNode(Ws,Js)}throw(t){return this._leafNode(new gh(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 Hs(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Hs)}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 Oo))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=xh;function jo(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function zl(e,t){return t instanceof ae._CodeOrName?jo(e,t.names):e}function Ci(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 l4(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Dk(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ae._)`!${kh(e)}`}Q.not=Dk;var u4=Ok(Q.operators.AND);function p4(...e){return e.reduce(u4)}Q.and=p4;var d4=Ok(Q.operators.OR);function f4(...e){return e.reduce(d4)}Q.or=f4;function Ok(e){return(t,r)=>t===ae.nil?r:r===ae.nil?t:(0,ae._)`${kh(t)} ${e} ${kh(r)}`}function kh(e){return e instanceof ae.Name?e:(0,ae._)`(${e})`}});var ue=$(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 be=Y(),h4=Vs();function m4(e){let t={};for(let r of e)t[r]=!0;return t}ee.toHash=m4;function g4(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Mk(e,t),!Lk(t,e.self.RULES.all))}ee.alwaysValidSchema=g4;function Mk(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]||qk(e,`unknown keyword: "${i}"`)}ee.checkUnknownRules=Mk;function Lk(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}ee.schemaHasRules=Lk;function _4(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=_4;function y4({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,be._)`${r}`}return(0,be._)`${e}${t}${(0,be.getProperty)(n)}`}ee.schemaRefOrVal=y4;function v4(e){return Zk(decodeURIComponent(e))}ee.unescapeFragment=v4;function w4(e){return encodeURIComponent($h(e))}ee.escapeFragment=w4;function $h(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ee.escapeJsonPointer=$h;function Zk(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ee.unescapeJsonPointer=Zk;function b4(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}ee.eachItem=b4;function Nk({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof be.Name?(i instanceof be.Name?e(o,i,s):t(o,i,s),s):i instanceof be.Name?(t(o,s,i),i):r(i,s);return a===be.Name&&!(c instanceof be.Name)?n(o,c):c}}ee.mergeEvaluated={props:Nk({mergeNames:(e,t,r)=>e.if((0,be._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,be._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,be._)`${r} || {}`).code((0,be._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,be._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,be._)`${r} || {}`),Ph(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Uk}),items:Nk({mergeNames:(e,t,r)=>e.if((0,be._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,be._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,be._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,be._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Uk(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,be._)`{}`);return t!==void 0&&Ph(e,r,t),r}ee.evaluatedPropsToName=Uk;function Ph(e,t,r){Object.keys(r).forEach(n=>e.assign((0,be._)`${t}${(0,be.getProperty)(n)}`,!0))}ee.setEvaluated=Ph;var jk={};function x4(e,t){return e.scopeValue("func",{ref:t,code:jk[t.code]||(jk[t.code]=new h4._Code(t.code))})}ee.useFunc=x4;var Sh;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Sh||(ee.Type=Sh={}));function k4(e,t,r){if(e instanceof be.Name){let n=t===Sh.Num;return r?n?(0,be._)`"[" + ${e} + "]"`:(0,be._)`"['" + ${e} + "']"`:n?(0,be._)`"/" + ${e}`:(0,be._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,be.getProperty)(e).toString():"/"+$h(e)}ee.getErrorPath=k4;function qk(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=qk});var hn=$(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});var vt=Y(),S4={data:new vt.Name("data"),valCxt:new vt.Name("valCxt"),instancePath:new vt.Name("instancePath"),parentData:new vt.Name("parentData"),parentDataProperty:new vt.Name("parentDataProperty"),rootData:new vt.Name("rootData"),dynamicAnchors:new vt.Name("dynamicAnchors"),vErrors:new vt.Name("vErrors"),errors:new vt.Name("errors"),this:new vt.Name("this"),self:new vt.Name("self"),scope:new vt.Name("scope"),json:new vt.Name("json"),jsonPos:new vt.Name("jsonPos"),jsonLen:new vt.Name("jsonLen"),jsonPart:new vt.Name("jsonPart")};Eh.default=S4});var Ys=$(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.extendErrors=wt.resetErrorsCount=wt.reportExtraError=wt.reportError=wt.keyword$DataError=wt.keywordError=void 0;var ce=Y(),Ol=ue(),Rt=hn();wt.keywordError={message:({keyword:e})=>(0,ce.str)`must pass "${e}" keyword validation`};wt.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 $4(e,t=wt.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=Vk(e,t,r);n??(s||a)?Fk(i,c):Gk(o,(0,ce._)`[${c}]`)}wt.reportError=$4;function P4(e,t=wt.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=Vk(e,t,r);Fk(o,a),i||s||Gk(n,Rt.default.vErrors)}wt.reportExtraError=P4;function E4(e,t){e.assign(Rt.default.errors,t),e.if((0,ce._)`${Rt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ce._)`${Rt.default.vErrors}.length`,t),()=>e.assign(Rt.default.vErrors,null)))}wt.resetErrorsCount=E4;function C4({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,Rt.default.errors,a=>{e.const(s,(0,ce._)`${Rt.default.vErrors}[${a}]`),e.if((0,ce._)`${s}.instancePath === undefined`,()=>e.assign((0,ce._)`${s}.instancePath`,(0,ce.strConcat)(Rt.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))})}wt.extendErrors=C4;function Fk(e,t){let r=e.const("err",t);e.if((0,ce._)`${Rt.default.vErrors} === null`,()=>e.assign(Rt.default.vErrors,(0,ce._)`[${r}]`),(0,ce._)`${Rt.default.vErrors}.push(${r})`),e.code((0,ce._)`${Rt.default.errors}++`)}function Gk(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 Mo={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 Vk(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ce._)`{}`:T4(e,t,r)}function T4(e,t,r={}){let{gen:n,it:o}=e,i=[R4(o,r),A4(e,r)];return I4(e,t,i),n.object(...i)}function R4({errorPath:e},{instancePath:t}){let r=t?(0,ce.str)`${e}${(0,Ol.getErrorPath)(t,Ol.Type.Str)}`:e;return[Rt.default.instancePath,(0,ce.strConcat)(Rt.default.instancePath,r)]}function A4({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,Ol.getErrorPath)(r,Ol.Type.Str)}`),[Mo.schemaPath,o]}function I4(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:c,propertyName:l,topSchemaRef:p,schemaPath:u}=a;n.push([Mo.keyword,o],[Mo.params,typeof t=="function"?t(e):t||(0,ce._)`{}`]),c.messages&&n.push([Mo.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Mo.schema,s],[Mo.parentSchema,(0,ce._)`${p}${u}`],[Rt.default.data,i]),l&&n.push([Mo.propertyName,l])}});var Hk=$(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.boolOrEmptySchema=Ti.topBoolOrEmptySchema=void 0;var z4=Ys(),D4=Y(),O4=hn(),N4={message:"boolean schema is false"};function j4(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Bk(e,!1):typeof r=="object"&&r.$async===!0?t.return(O4.default.data):(t.assign((0,D4._)`${n}.errors`,null),t.return(!0))}Ti.topBoolOrEmptySchema=j4;function M4(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Bk(e)):r.var(t,!0)}Ti.boolOrEmptySchema=M4;function Bk(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,z4.reportError)(o,N4,void 0,t)}});var Ch=$(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.getRules=Ri.isJSONType=void 0;var L4=["string","number","integer","boolean","null","object","array"],Z4=new Set(L4);function U4(e){return typeof e=="string"&&Z4.has(e)}Ri.isJSONType=U4;function q4(){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:{}}}Ri.getRules=q4});var Th=$(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.shouldUseRule=qn.shouldUseGroup=qn.schemaHasRulesForType=void 0;function F4({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Kk(e,n)}qn.schemaHasRulesForType=F4;function Kk(e,t){return t.rules.some(r=>Wk(e,r))}qn.shouldUseGroup=Kk;function Wk(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))}qn.shouldUseRule=Wk});var Qs=$(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.reportTypeError=bt.checkDataTypes=bt.checkDataType=bt.coerceAndCheckDataType=bt.getJSONTypes=bt.getSchemaTypes=bt.DataType=void 0;var G4=Ch(),V4=Th(),B4=Ys(),H=Y(),Jk=ue(),Ai;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ai||(bt.DataType=Ai={}));function H4(e){let t=Yk(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}bt.getSchemaTypes=H4;function Yk(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(G4.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}bt.getJSONTypes=Yk;function K4(e,t){let{gen:r,data:n,opts:o}=e,i=W4(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,V4.schemaHasRulesForType)(e,t[0]));if(s){let a=Ah(t,n,o.strictNumbers,Ai.Wrong);r.if(a,()=>{i.length?J4(e,t,i):Ih(e)})}return s}bt.coerceAndCheckDataType=K4;var Qk=new Set(["string","number","integer","boolean","null"]);function W4(e,t){return t?e.filter(r=>Qk.has(r)||t==="array"&&r==="array"):[]}function J4(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,H._)`typeof ${o}`),a=n.let("coerced",(0,H._)`undefined`);i.coerceTypes==="array"&&n.if((0,H._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,H._)`${o}[0]`).assign(s,(0,H._)`typeof ${o}`).if(Ah(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,H._)`${a} !== undefined`);for(let l of r)(Qk.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);n.else(),Ih(e),n.endIf(),n.if((0,H._)`${a} !== undefined`,()=>{n.assign(o,a),Y4(e,a)});function c(l){switch(l){case"string":n.elseIf((0,H._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,H._)`"" + ${o}`).elseIf((0,H._)`${o} === null`).assign(a,(0,H._)`""`);return;case"number":n.elseIf((0,H._)`${s} == "boolean" || ${o} === null
|
|
72
|
+
]`;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 Lf,br,Zj,xu=b(()=>{Ln();br={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:()=>(Lf===void 0&&(Lf=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Lf),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-_]*$/};Zj=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function ku(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===C.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]})??De(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===C.ZodString&&e.keyType._def.checks?.length){let{type:n,...o}=bu(e.keyType._def,t);return{...r,propertyNames:o}}else{if(e.keyType?._def.typeName===C.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===C.ZodBranded&&e.keyType._def.type._def.typeName===C.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...o}=vu(e.keyType._def,t);return{...r,propertyNames:o}}}return r}var Su=b(()=>{fu();He();xu();wu();sr()});function uk(e,t){if(t.mapStrategy==="record")return ku(e,t);let r=U(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||De(t),n=U(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||De(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var Uf=b(()=>{He();Su();sr()});function lk(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 qf=b(()=>{});function pk(e){return e.target==="openAi"?void 0:{not:De({...e,currentPath:[...e.currentPath,"not"]})}}var Ff=b(()=>{sr()});function dk(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Gf=b(()=>{});function hk(e,t){if(t.target==="openApi3")return fk(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in Us&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,i)=>{let s=Us[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 fk(e,t)}var Us,fk,$u=b(()=>{He();Us={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};fk=(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 mk(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:Us[e.innerType._def.typeName],nullable:!0}:{type:[Us[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 Vf=b(()=>{He();$u()});function gk(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",Ef(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 Bf=b(()=>{Ln()});function yk(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=Fj(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=qj(e,t);return s!==void 0&&(n.additionalProperties=s),n}function qj(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 Fj(e){try{return e.isOptional()}catch{return!0}}var Hf=b(()=>{He()});var _k,Wf=b(()=>{He();sr();_k=(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:De(t)},r]}:De(t)}});var vk,Kf=b(()=>{He();vk=(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 wk(e,t){return U(e.type._def,t)}var Jf=b(()=>{He()});function bk(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 Yf=b(()=>{Ln();He()});function xk(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 Qf=b(()=>{He()});function kk(e){return{not:De(e)}}var Xf=b(()=>{sr()});function Sk(e){return De(e)}var eh=b(()=>{sr()});var $k,th=b(()=>{He();$k=(e,t)=>U(e.innerType._def,t)});var Pk,rh=b(()=>{fu();sr();Cf();Tf();Af();wu();Rf();zf();Df();Of();Nf();jf();Mf();Uf();qf();Ff();Gf();Vf();Bf();Hf();Wf();Kf();Jf();Su();Yf();xu();Qf();Xf();$u();eh();th();Pk=(e,t,r)=>{switch(t){case C.ZodString:return bu(e,r);case C.ZodNumber:return gk(e,r);case C.ZodObject:return yk(e,r);case C.ZodBigInt:return ek(e,r);case C.ZodBoolean:return tk();case C.ZodDate:return If(e,r);case C.ZodUndefined:return kk(r);case C.ZodNull:return dk(r);case C.ZodArray:return Xx(e,r);case C.ZodUnion:case C.ZodDiscriminatedUnion:return hk(e,r);case C.ZodIntersection:return sk(e,r);case C.ZodTuple:return xk(e,r);case C.ZodRecord:return ku(e,r);case C.ZodLiteral:return ak(e,r);case C.ZodEnum:return ik(e);case C.ZodNativeEnum:return lk(e);case C.ZodNullable:return mk(e,r);case C.ZodOptional:return _k(e,r);case C.ZodMap:return uk(e,r);case C.ZodSet:return bk(e,r);case C.ZodLazy:return()=>e.getter()._def;case C.ZodPromise:return wk(e,r);case C.ZodNaN:case C.ZodNever:return pk(r);case C.ZodEffects:return ok(e,r);case C.ZodAny:return De(r);case C.ZodUnknown:return Sk(r);case C.ZodDefault:return nk(e,r);case C.ZodBranded:return vu(e,r);case C.ZodReadonly:return $k(e,r);case C.ZodCatch:return rk(e,r);case C.ZodPipeline:return vk(e,r);case C.ZodFunction:case C.ZodVoid:case C.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!==Jx)return a}if(n&&!r){let a=Gj(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=Pk(e,e.typeName,t),s=typeof i=="function"?U(i(),t):i;if(s&&Vj(e,t,s),t.postProcess){let a=t.postProcess(s,e,t);return o.jsonSchema=s,a}return o.jsonSchema=s,s}var Gj,Vj,He=b(()=>{gu();rh();_u();sr();Gj=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:yu(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`),De(t)):t.$refStrategy==="seen"?De(t):void 0}},Vj=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r)});var Ek=b(()=>{});var nh,oh=b(()=>{He();Pf();sr();nh=(e,t)=>{let r=Qx(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)??De(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)??De(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 Ck=b(()=>{gu();Pf();Ln();_u();He();Ek();sr();Cf();Tf();Af();wu();Rf();zf();Df();Of();Nf();jf();Mf();Uf();qf();Ff();Gf();Vf();Bf();Hf();Wf();Kf();Jf();th();Su();Yf();xu();Qf();Xf();$u();eh();rh();oh();oh()});function Bj(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function Tk(e,t){return Io(e)?Pc(e,{target:Bj(t?.target),io:t?.pipeStrategy??"input"}):nh(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function ih(e){let r=hu(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Hx(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function sh(e,t){let r=jn(e,t);if(!r.success)throw r.error;return r.data}var ah=b(()=>{$f();mu();Ck()});function Ak(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Rk(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];Ak(s)&&Ak(i)?r[o]={...s,...i}:r[o]=i}return r}var Hj,Pu,Ik=b(()=>{mu();Cn();Wx();ah();Hj=6e4,Pu=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(Nc,r=>{this._oncancel(r)}),this.setNotificationHandler(Lc,r=>{this._onprogress(r)}),this.setRequestHandler(Mc,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Zc,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new B(X.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(qc,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 B(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 B(X.InvalidParams,`Task not found: ${i}`);if(!Mn(s.status))return await this._waitForTaskUpdate(i,n.signal),await o();if(Mn(s.status)){let a=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...a,_meta:{...a._meta,[En]:{taskId:i}}}}return await o()};return await o()}),this.setRequestHandler(Fc,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 B(X.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Vc,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new B(X.InvalidParams,`Task not found: ${r.params.taskId}`);if(Mn(o.status))throw new B(X.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 B(X.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(o){throw o instanceof B?o:new B(X.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),B.fromError(X.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),po(i)||e0(i)?this._onresponse(i):lo(i)?this._onrequest(i,s):Xb(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=B.fromError(X.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?.[En]?.taskId;if(n===void 0){let p={jsonrpc:"2.0",id:t.id,error:{code:X.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=Jb(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 B(X.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:X.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),po(t))n(t);else{let s=new B(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(po(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),po(t))o(t);else{let s=B.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 B?s:new B(X.InternalError,String(s))}}return}let i;try{let s=await this.request(t,ui,n);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new B(X.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:a},Mn(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)}:a.status==="failed"?yield{type:"error",error:new B(X.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new B(X.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 B?s:new B(X.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=w=>{p(w)};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(w){l(w);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||{},[En]:c}});let h=w=>{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(w)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));let x=w instanceof B?w:new B(X.RequestTimeout,String(w));p(x)};this._responseHandlers.set(d,w=>{if(!n?.signal?.aborted){if(w instanceof Error)return p(w);try{let x=jn(r,w.result);x.success?u(x.data):p(x.error)}catch(x){p(x)}}}),n?.signal?.addEventListener("abort",()=>{h(n?.signal?.reason)});let g=n?.timeout??Hj,y=()=>h(B.fromError(X.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(d,g,n?.maxTotalTimeout,y,n?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let w=x=>{let k=this._responseHandlers.get(d);k?k(x):this._onerror(new Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,w),this._enqueueTaskMessage(v,{type:"request",message:f,timestamp:Date.now()}).catch(x=>{this._cleanupTimeout(d),p(x)})}else this._transport.send(f,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(w=>{this._cleanupTimeout(d),p(w)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},Uc,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},Gc,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},n0,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||{},[En]: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||{},[En]: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||{},[En]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(t,r){let n=ih(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,i)=>{let s=sh(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=ih(t);this._notificationHandlers.set(n,o=>{let i=sh(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"&&lo(o.message)){let i=o.message.id,s=this._requestResolvers.get(i);s?(s(new B(X.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 B(X.InvalidRequest,"Request cancelled"));return}let s=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(s),i(new B(X.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 B(X.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=Es.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Mn(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 B(X.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Mn(a.status))throw new B(X.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=Es.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Mn(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}}});var Gs=$(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 qs=class{};ue._CodeOrName=qs;ue.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var zo=class extends qs{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=zo;var ar=class extends qs{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 zo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ue._Code=ar;ue.nil=new ar("");function zk(e,...t){let r=[e[0]],n=0;for(;n<t.length;)uh(r,t[n]),r.push(e[++n]);return new ar(r)}ue._=zk;var ch=new ar("+");function Dk(e,...t){let r=[Fs(e[0])],n=0;for(;n<t.length;)r.push(ch),uh(r,t[n]),r.push(ch,Fs(e[++n]));return Wj(r),new ar(r)}ue.str=Dk;function uh(e,t){t instanceof ar?e.push(...t._items):t instanceof zo?e.push(t):e.push(Yj(t))}ue.addCodeArg=uh;function Wj(e){let t=1;for(;t<e.length-1;){if(e[t]===ch){let r=Kj(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function Kj(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof zo||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 zo))return`"${e}${t.slice(1)}`}function Jj(e,t){return t.emptyStr()?e:e.emptyStr()?t:Dk`${e}${t}`}ue.strConcat=Jj;function Yj(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Fs(Array.isArray(e)?e.join(","):e)}function Qj(e){return new ar(Fs(e))}ue.stringify=Qj;function Fs(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ue.safeStringify=Fs;function Xj(e){return typeof e=="string"&&ue.IDENTIFIER.test(e)?new ar(`.${e}`):zk`[${e}]`}ue.getProperty=Xj;function e4(e){if(typeof e=="string"&&ue.IDENTIFIER.test(e))return new ar(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}ue.getEsmExportName=e4;function t4(e){return new ar(e.toString())}ue.regexpCode=t4});var dh=$(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.ValueScope=qt.ValueScopeName=qt.Scope=qt.varKinds=qt.UsedValueState=void 0;var Ut=Gs(),lh=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Eu;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Eu||(qt.UsedValueState=Eu={}));qt.varKinds={const:new Ut.Name("const"),let:new Ut.Name("let"),var:new Ut.Name("var")};var Cu=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Ut.Name?t:this.name(t)}name(t){return new Ut.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}}};qt.Scope=Cu;var Tu=class extends Ut.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Ut._)`.${new Ut.Name(r)}[${n}]`}};qt.ValueScopeName=Tu;var r4=(0,Ut._)`\n`,ph=class extends Cu{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?r4:Ut.nil}}get(){return this._scope}name(t){return new Tu(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,Ut._)`${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=Ut.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,Eu.Started);let p=r(u);if(p){let l=this.opts.es5?qt.varKinds.var:qt.varKinds.const;i=(0,Ut._)`${i}${l} ${u} = ${p};${this.opts._n}`}else if(p=o?.(u))i=(0,Ut._)`${i}${p}${this.opts._n}`;else throw new lh(u);c.set(u,Eu.Completed)})}return i}};qt.ValueScope=ph});var Y=$(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=Gs(),kr=dh(),Zn=Gs();Object.defineProperty(Q,"_",{enumerable:!0,get:function(){return Zn._}});Object.defineProperty(Q,"str",{enumerable:!0,get:function(){return Zn.str}});Object.defineProperty(Q,"strConcat",{enumerable:!0,get:function(){return Zn.strConcat}});Object.defineProperty(Q,"nil",{enumerable:!0,get:function(){return Zn.nil}});Object.defineProperty(Q,"getProperty",{enumerable:!0,get:function(){return Zn.getProperty}});Object.defineProperty(Q,"stringify",{enumerable:!0,get:function(){return Zn.stringify}});Object.defineProperty(Q,"regexpCode",{enumerable:!0,get:function(){return Zn.regexpCode}});Object.defineProperty(Q,"Name",{enumerable:!0,get:function(){return Zn.Name}});var zu=dh();Object.defineProperty(Q,"Scope",{enumerable:!0,get:function(){return zu.Scope}});Object.defineProperty(Q,"ValueScope",{enumerable:!0,get:function(){return zu.ValueScope}});Object.defineProperty(Q,"ValueScopeName",{enumerable:!0,get:function(){return zu.ValueScopeName}});Object.defineProperty(Q,"varKinds",{enumerable:!0,get:function(){return zu.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 pn=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},fh=class extends pn{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?kr.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=Ei(this.rhs,t,r)),this}get names(){return this.rhs instanceof ae._CodeOrName?this.rhs.names:{}}},Au=class extends pn{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=Ei(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ae.Name?{}:{...this.lhs.names};return Iu(t,this.rhs)}},hh=class extends Au{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},mh=class extends pn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},gh=class extends pn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},yh=class extends pn{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},_h=class extends pn{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=Ei(this.code,t,r),this}get names(){return this.code instanceof ae._CodeOrName?this.code.names:{}}},Vs=class extends pn{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)||(n4(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>No(t,r.names),{})}},dn=class extends Vs{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},vh=class extends Vs{},Pi=class extends dn{};Pi.kind="else";var Do=class e extends dn{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 Pi(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Ok(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=Ei(this.condition,t,r),this}get names(){let t=super.names;return Iu(t,this.condition),this.else&&No(t,this.else.names),t}};Do.kind="if";var Oo=class extends dn{};Oo.kind="for";var wh=class extends Oo{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=Ei(this.iteration,t,r),this}get names(){return No(super.names,this.iteration.names)}},bh=class extends Oo{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?kr.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=Iu(super.names,this.from);return Iu(t,this.to)}},Ru=class extends Oo{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=Ei(this.iterable,t,r),this}get names(){return No(super.names,this.iterable.names)}},Bs=class extends dn{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)}};Bs.kind="func";var Hs=class extends Vs{render(t){return"return "+super.render(t)}};Hs.kind="return";var xh=class extends dn{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&&No(t,this.catch.names),this.finally&&No(t,this.finally.names),t}},Ws=class extends dn{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Ws.kind="catch";var Ks=class extends dn{render(t){return"finally"+super.render(t)}};Ks.kind="finally";var kh=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
73
|
+
`:""},this._extScope=t,this._scope=new kr.Scope({parent:t}),this._nodes=[new vh]}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 fh(t,i,n)),i}const(t,r,n){return this._def(kr.varKinds.const,t,r,n)}let(t,r,n){return this._def(kr.varKinds.let,t,r,n)}var(t,r,n){return this._def(kr.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Au(t,r,n))}add(t,r){return this._leafNode(new hh(t,Q.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ae.nil&&this._leafNode(new _h(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 Do(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 Do(t))}else(){return this._elseNode(new Pi)}endIf(){return this._endBlockNode(Do,Pi)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new wh(t),r)}forRange(t,r,n,o,i=this.opts.es5?kr.varKinds.var:kr.varKinds.let){let s=this._scope.toName(t);return this._for(new bh(i,s,r,n),()=>o(s))}forOf(t,r,n,o=kr.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 Ru("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?kr.varKinds.var:kr.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 Ru("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(Oo)}label(t){return this._leafNode(new mh(t))}break(t){return this._leafNode(new gh(t))}return(t){let r=new Hs;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Hs)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new xh;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Ws(i),r(i)}return n&&(this._currNode=o.finally=new Ks,this.code(n)),this._endBlockNode(Ws,Ks)}throw(t){return this._leafNode(new yh(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 Bs(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Bs)}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 Do))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=kh;function No(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Iu(e,t){return t instanceof ae._CodeOrName?No(e,t.names):e}function Ei(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 n4(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Ok(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ae._)`!${Sh(e)}`}Q.not=Ok;var o4=Nk(Q.operators.AND);function i4(...e){return e.reduce(o4)}Q.and=i4;var s4=Nk(Q.operators.OR);function a4(...e){return e.reduce(s4)}Q.or=a4;function Nk(e){return(t,r)=>t===ae.nil?r:r===ae.nil?t:(0,ae._)`${Sh(t)} ${e} ${Sh(r)}`}function Sh(e){return e instanceof ae.Name?e:(0,ae._)`(${e})`}});var le=$(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 be=Y(),c4=Gs();function u4(e){let t={};for(let r of e)t[r]=!0;return t}ee.toHash=u4;function l4(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Lk(e,t),!Zk(t,e.self.RULES.all))}ee.alwaysValidSchema=l4;function Lk(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]||Fk(e,`unknown keyword: "${i}"`)}ee.checkUnknownRules=Lk;function Zk(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}ee.schemaHasRules=Zk;function p4(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=p4;function d4({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,be._)`${r}`}return(0,be._)`${e}${t}${(0,be.getProperty)(n)}`}ee.schemaRefOrVal=d4;function f4(e){return Uk(decodeURIComponent(e))}ee.unescapeFragment=f4;function h4(e){return encodeURIComponent(Ph(e))}ee.escapeFragment=h4;function Ph(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ee.escapeJsonPointer=Ph;function Uk(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ee.unescapeJsonPointer=Uk;function m4(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}ee.eachItem=m4;function jk({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof be.Name?(i instanceof be.Name?e(o,i,s):t(o,i,s),s):i instanceof be.Name?(t(o,s,i),i):r(i,s);return a===be.Name&&!(c instanceof be.Name)?n(o,c):c}}ee.mergeEvaluated={props:jk({mergeNames:(e,t,r)=>e.if((0,be._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,be._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,be._)`${r} || {}`).code((0,be._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,be._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,be._)`${r} || {}`),Eh(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:qk}),items:jk({mergeNames:(e,t,r)=>e.if((0,be._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,be._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,be._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,be._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function qk(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,be._)`{}`);return t!==void 0&&Eh(e,r,t),r}ee.evaluatedPropsToName=qk;function Eh(e,t,r){Object.keys(r).forEach(n=>e.assign((0,be._)`${t}${(0,be.getProperty)(n)}`,!0))}ee.setEvaluated=Eh;var Mk={};function g4(e,t){return e.scopeValue("func",{ref:t,code:Mk[t.code]||(Mk[t.code]=new c4._Code(t.code))})}ee.useFunc=g4;var $h;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})($h||(ee.Type=$h={}));function y4(e,t,r){if(e instanceof be.Name){let n=t===$h.Num;return r?n?(0,be._)`"[" + ${e} + "]"`:(0,be._)`"['" + ${e} + "']"`:n?(0,be._)`"/" + ${e}`:(0,be._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,be.getProperty)(e).toString():"/"+Ph(e)}ee.getErrorPath=y4;function Fk(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=Fk});var fn=$(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});var _t=Y(),_4={data:new _t.Name("data"),valCxt:new _t.Name("valCxt"),instancePath:new _t.Name("instancePath"),parentData:new _t.Name("parentData"),parentDataProperty:new _t.Name("parentDataProperty"),rootData:new _t.Name("rootData"),dynamicAnchors:new _t.Name("dynamicAnchors"),vErrors:new _t.Name("vErrors"),errors:new _t.Name("errors"),this:new _t.Name("this"),self:new _t.Name("self"),scope:new _t.Name("scope"),json:new _t.Name("json"),jsonPos:new _t.Name("jsonPos"),jsonLen:new _t.Name("jsonLen"),jsonPart:new _t.Name("jsonPart")};Ch.default=_4});var Js=$(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.extendErrors=vt.resetErrorsCount=vt.reportExtraError=vt.reportError=vt.keyword$DataError=vt.keywordError=void 0;var ce=Y(),Du=le(),Tt=fn();vt.keywordError={message:({keyword:e})=>(0,ce.str)`must pass "${e}" keyword validation`};vt.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 v4(e,t=vt.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=Bk(e,t,r);n??(s||a)?Gk(i,c):Vk(o,(0,ce._)`[${c}]`)}vt.reportError=v4;function w4(e,t=vt.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=Bk(e,t,r);Gk(o,a),i||s||Vk(n,Tt.default.vErrors)}vt.reportExtraError=w4;function b4(e,t){e.assign(Tt.default.errors,t),e.if((0,ce._)`${Tt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ce._)`${Tt.default.vErrors}.length`,t),()=>e.assign(Tt.default.vErrors,null)))}vt.resetErrorsCount=b4;function x4({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,Tt.default.errors,a=>{e.const(s,(0,ce._)`${Tt.default.vErrors}[${a}]`),e.if((0,ce._)`${s}.instancePath === undefined`,()=>e.assign((0,ce._)`${s}.instancePath`,(0,ce.strConcat)(Tt.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))})}vt.extendErrors=x4;function Gk(e,t){let r=e.const("err",t);e.if((0,ce._)`${Tt.default.vErrors} === null`,()=>e.assign(Tt.default.vErrors,(0,ce._)`[${r}]`),(0,ce._)`${Tt.default.vErrors}.push(${r})`),e.code((0,ce._)`${Tt.default.errors}++`)}function Vk(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 jo={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 Bk(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ce._)`{}`:k4(e,t,r)}function k4(e,t,r={}){let{gen:n,it:o}=e,i=[S4(o,r),$4(e,r)];return P4(e,t,i),n.object(...i)}function S4({errorPath:e},{instancePath:t}){let r=t?(0,ce.str)`${e}${(0,Du.getErrorPath)(t,Du.Type.Str)}`:e;return[Tt.default.instancePath,(0,ce.strConcat)(Tt.default.instancePath,r)]}function $4({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,Du.getErrorPath)(r,Du.Type.Str)}`),[jo.schemaPath,o]}function P4(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([jo.keyword,o],[jo.params,typeof t=="function"?t(e):t||(0,ce._)`{}`]),c.messages&&n.push([jo.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([jo.schema,s],[jo.parentSchema,(0,ce._)`${p}${l}`],[Tt.default.data,i]),u&&n.push([jo.propertyName,u])}});var Wk=$(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.boolOrEmptySchema=Ci.topBoolOrEmptySchema=void 0;var E4=Js(),C4=Y(),T4=fn(),A4={message:"boolean schema is false"};function R4(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Hk(e,!1):typeof r=="object"&&r.$async===!0?t.return(T4.default.data):(t.assign((0,C4._)`${n}.errors`,null),t.return(!0))}Ci.topBoolOrEmptySchema=R4;function I4(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Hk(e)):r.var(t,!0)}Ci.boolOrEmptySchema=I4;function Hk(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,E4.reportError)(o,A4,void 0,t)}});var Th=$(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.getRules=Ti.isJSONType=void 0;var z4=["string","number","integer","boolean","null","object","array"],D4=new Set(z4);function O4(e){return typeof e=="string"&&D4.has(e)}Ti.isJSONType=O4;function N4(){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:{}}}Ti.getRules=N4});var Ah=$(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.shouldUseRule=Un.shouldUseGroup=Un.schemaHasRulesForType=void 0;function j4({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Kk(e,n)}Un.schemaHasRulesForType=j4;function Kk(e,t){return t.rules.some(r=>Jk(e,r))}Un.shouldUseGroup=Kk;function Jk(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))}Un.shouldUseRule=Jk});var Ys=$(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.reportTypeError=wt.checkDataTypes=wt.checkDataType=wt.coerceAndCheckDataType=wt.getJSONTypes=wt.getSchemaTypes=wt.DataType=void 0;var M4=Th(),L4=Ah(),Z4=Js(),H=Y(),Yk=le(),Ai;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ai||(wt.DataType=Ai={}));function U4(e){let t=Qk(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}wt.getSchemaTypes=U4;function Qk(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(M4.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}wt.getJSONTypes=Qk;function q4(e,t){let{gen:r,data:n,opts:o}=e,i=F4(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,L4.schemaHasRulesForType)(e,t[0]));if(s){let a=Ih(t,n,o.strictNumbers,Ai.Wrong);r.if(a,()=>{i.length?G4(e,t,i):zh(e)})}return s}wt.coerceAndCheckDataType=q4;var Xk=new Set(["string","number","integer","boolean","null"]);function F4(e,t){return t?e.filter(r=>Xk.has(r)||t==="array"&&r==="array"):[]}function G4(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,H._)`typeof ${o}`),a=n.let("coerced",(0,H._)`undefined`);i.coerceTypes==="array"&&n.if((0,H._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,H._)`${o}[0]`).assign(s,(0,H._)`typeof ${o}`).if(Ih(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,H._)`${a} !== undefined`);for(let u of r)(Xk.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);n.else(),zh(e),n.endIf(),n.if((0,H._)`${a} !== undefined`,()=>{n.assign(o,a),V4(e,a)});function c(u){switch(u){case"string":n.elseIf((0,H._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,H._)`"" + ${o}`).elseIf((0,H._)`${o} === null`).assign(a,(0,H._)`""`);return;case"number":n.elseIf((0,H._)`${s} == "boolean" || ${o} === null
|
|
74
74
|
|| (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,H._)`+${o}`);return;case"integer":n.elseIf((0,H._)`${s} === "boolean" || ${o} === null
|
|
75
75
|
|| (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,H._)`+${o}`);return;case"boolean":n.elseIf((0,H._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,H._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf((0,H._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf((0,H._)`${s} === "string" || ${s} === "number"
|
|
76
|
-
|| ${s} === "boolean" || ${o} === null`).assign(a,(0,H._)`[${o}]`)}}}function Y4({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,H._)`${t} !== undefined`,()=>e.assign((0,H._)`${t}[${r}]`,n))}function Rh(e,t,r,n=Ai.Correct){let o=n===Ai.Correct?H.operators.EQ:H.operators.NEQ,i;switch(e){case"null":return(0,H._)`${t} ${o} null`;case"array":i=(0,H._)`Array.isArray(${t})`;break;case"object":i=(0,H._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,H._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,H._)`typeof ${t} ${o} ${e}`}return n===Ai.Correct?i:(0,H.not)(i);function s(a=H.nil){return(0,H.and)((0,H._)`typeof ${t} == "number"`,a,r?(0,H._)`isFinite(${t})`:H.nil)}}bt.checkDataType=Rh;function Ah(e,t,r,n){if(e.length===1)return Rh(e[0],t,r,n);let o,i=(0,Jk.toHash)(e);if(i.array&&i.object){let s=(0,H._)`typeof ${t} != "object"`;o=i.null?s:(0,H._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=H.nil;i.number&&delete i.integer;for(let s in i)o=(0,H.and)(o,Rh(s,t,r,n));return o}bt.checkDataTypes=Ah;var Q4={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,H._)`{type: ${e}}`:(0,H._)`{type: ${t}}`};function Ih(e){let t=X4(e);(0,B4.reportError)(t,Q4)}bt.reportTypeError=Ih;function X4(e){let{gen:t,data:r,schema:n}=e,o=(0,Jk.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var eS=$(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.assignDefaults=void 0;var Ii=Y(),eM=ue();function tM(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)Xk(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>Xk(e,i,o.default))}Nl.assignDefaults=tM;function Xk(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,Ii._)`${i}${(0,Ii.getProperty)(t)}`;if(o){(0,eM.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,Ii._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Ii._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Ii._)`${a} = ${(0,Ii.stringify)(r)}`)}});var cr=$(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 Ce=Y(),zh=ue(),Fn=hn(),rM=ue();function nM(e,t){let{gen:r,data:n,it:o}=e;r.if(Oh(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Ce._)`${t}`},!0),e.error()})}ge.checkReportMissingProp=nM;function oM({gen:e,data:t,it:{opts:r}},n,o){return(0,Ce.or)(...n.map(i=>(0,Ce.and)(Oh(e,t,i,r.ownProperties),(0,Ce._)`${o} = ${i}`)))}ge.checkMissingProp=oM;function iM(e,t){e.setParams({missingProperty:t},!0),e.error()}ge.reportMissingProp=iM;function tS(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ce._)`Object.prototype.hasOwnProperty`})}ge.hasPropFunc=tS;function Dh(e,t,r){return(0,Ce._)`${tS(e)}.call(${t}, ${r})`}ge.isOwnProperty=Dh;function sM(e,t,r,n){let o=(0,Ce._)`${t}${(0,Ce.getProperty)(r)} !== undefined`;return n?(0,Ce._)`${o} && ${Dh(e,t,r)}`:o}ge.propertyInData=sM;function Oh(e,t,r,n){let o=(0,Ce._)`${t}${(0,Ce.getProperty)(r)} === undefined`;return n?(0,Ce.or)(o,(0,Ce.not)(Dh(e,t,r))):o}ge.noPropertyInData=Oh;function rS(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ge.allSchemaProperties=rS;function aM(e,t){return rS(t).filter(r=>!(0,zh.alwaysValidSchema)(e,t[r]))}ge.schemaProperties=aM;function cM({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,l){let p=l?(0,Ce._)`${e}, ${t}, ${n}${o}`:t,u=[[Fn.default.instancePath,(0,Ce.strConcat)(Fn.default.instancePath,i)],[Fn.default.parentData,s.parentData],[Fn.default.parentDataProperty,s.parentDataProperty],[Fn.default.rootData,Fn.default.rootData]];s.opts.dynamicRef&&u.push([Fn.default.dynamicAnchors,Fn.default.dynamicAnchors]);let d=(0,Ce._)`${p}, ${r.object(...u)}`;return c!==Ce.nil?(0,Ce._)`${a}.call(${c}, ${d})`:(0,Ce._)`${a}(${d})`}ge.callValidateCode=cM;var lM=(0,Ce._)`new RegExp`;function uM({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,Ce._)`${o.code==="new RegExp"?lM:(0,rM.useFunc)(e,o)}(${r}, ${n})`})}ge.usePattern=uM;function pM(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,Ce._)`${r}.length`);t.forRange("i",0,c,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:zh.Type.Num},i),t.if((0,Ce.not)(i),a)})}}ge.validateArray=pM;function dM(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,zh.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,l)=>{let p=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);t.assign(s,(0,Ce._)`${s} || ${a}`),e.mergeValidEvaluated(p,a)||t.if((0,Ce.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ge.validateUnion=dM});var iS=$(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.validateKeywordUsage=Ur.validSchemaType=Ur.funcKeywordCode=Ur.macroKeywordCode=void 0;var At=Y(),Lo=hn(),fM=cr(),hM=Ys();function mM(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=oS(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let l=r.name("valid");e.subschema({schema:a,schemaPath:At.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}Ur.macroKeywordCode=mM;function gM(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;yM(c,t);let l=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,p=oS(n,o,l),u=n.let("valid");e.block$data(u,d),e.ok((r=t.valid)!==null&&r!==void 0?r:u);function d(){if(t.errors===!1)g(),t.modifying&&nS(e),_(()=>e.error());else{let v=t.async?h():m();t.modifying&&nS(e),_(()=>_M(e,v))}}function h(){let v=n.let("ruleErrs",null);return n.try(()=>g((0,At._)`await `),w=>n.assign(u,!1).if((0,At._)`${w} instanceof ${c.ValidationError}`,()=>n.assign(v,(0,At._)`${w}.errors`),()=>n.throw(w))),v}function m(){let v=(0,At._)`${p}.errors`;return n.assign(v,null),g(At.nil),v}function g(v=t.async?(0,At._)`await `:At.nil){let w=c.opts.passContext?Lo.default.this:Lo.default.self,x=!("compile"in t&&!a||t.schema===!1);n.assign(u,(0,At._)`${v}${(0,fM.callValidateCode)(e,p,w,x)}`,t.modifying)}function _(v){var w;n.if((0,At.not)((w=t.valid)!==null&&w!==void 0?w:u),v)}}Ur.funcKeywordCode=gM;function nS(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,At._)`${n.parentData}[${n.parentDataProperty}]`))}function _M(e,t){let{gen:r}=e;r.if((0,At._)`Array.isArray(${t})`,()=>{r.assign(Lo.default.vErrors,(0,At._)`${Lo.default.vErrors} === null ? ${t} : ${Lo.default.vErrors}.concat(${t})`).assign(Lo.default.errors,(0,At._)`${Lo.default.vErrors}.length`),(0,hM.extendErrors)(e)},()=>e.error())}function yM({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function oS(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,At.stringify)(r)})}function vM(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")}Ur.validSchemaType=vM;function wM({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)}}Ur.validateKeywordUsage=wM});var aS=$(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.extendSubschemaMode=Gn.extendSubschemaData=Gn.getSubschema=void 0;var qr=Y(),sS=ue();function bM(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,qr._)`${e.schemaPath}${(0,qr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,qr._)`${e.schemaPath}${(0,qr.getProperty)(t)}${(0,qr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,sS.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')}Gn.getSubschema=bM;function xM(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:l,dataPathArr:p,opts:u}=t,d=a.let("data",(0,qr._)`${t.data}${(0,qr.getProperty)(r)}`,!0);c(d),e.errorPath=(0,qr.str)`${l}${(0,sS.getErrorPath)(r,n,u.jsPropertySyntax)}`,e.parentDataProperty=(0,qr._)`${r}`,e.dataPathArr=[...p,e.parentDataProperty]}if(o!==void 0){let l=o instanceof qr.Name?o:a.let("data",o,!0);c(l),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function c(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}Gn.extendSubschemaData=xM;function kM(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}Gn.extendSubschemaMode=kM});var Nh=$((qW,cS)=>{"use strict";cS.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 uS=$((FW,lS)=>{"use strict";var Vn=lS.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(){};jl(t,n,o,e,"",e)};Vn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Vn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Vn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Vn.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 jl(e,t,r,n,o,i,s,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,c,l);for(var p in n){var u=n[p];if(Array.isArray(u)){if(p in Vn.arrayKeywords)for(var d=0;d<u.length;d++)jl(e,t,r,u[d],o+"/"+p+"/"+d,i,o,p,n,d)}else if(p in Vn.propsKeywords){if(u&&typeof u=="object")for(var h in u)jl(e,t,r,u[h],o+"/"+p+"/"+SM(h),i,o,p,n,h)}else(p in Vn.keywords||e.allKeys&&!(p in Vn.skipKeywords))&&jl(e,t,r,u,o+"/"+p,i,o,p,n)}r(n,o,i,s,a,c,l)}}function SM(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Xs=$(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.getSchemaRefs=Ft.resolveUrl=Ft.normalizeId=Ft._getFullPath=Ft.getFullPath=Ft.inlineRef=void 0;var $M=ue(),PM=Nh(),EM=uS(),CM=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function TM(e,t=!0){return typeof e=="boolean"?!0:t===!0?!jh(e):t?pS(e)<=t:!1}Ft.inlineRef=TM;var RM=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function jh(e){for(let t in e){if(RM.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(jh)||typeof r=="object"&&jh(r))return!0}return!1}function pS(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!CM.has(r)&&(typeof e[r]=="object"&&(0,$M.eachItem)(e[r],n=>t+=pS(n)),t===1/0))return 1/0}return t}function dS(e,t="",r){r!==!1&&(t=zi(t));let n=e.parse(t);return fS(e,n)}Ft.getFullPath=dS;function fS(e,t){return e.serialize(t).split("#")[0]+"#"}Ft._getFullPath=fS;var AM=/#\/?$/;function zi(e){return e?e.replace(AM,""):""}Ft.normalizeId=zi;function IM(e,t,r){return r=zi(r),e.resolve(t,r)}Ft.resolveUrl=IM;var zM=/^[a-z_][-a-z0-9._]*$/i;function DM(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=zi(e[r]||t),i={"":o},s=dS(n,o,!1),a={},c=new Set;return EM(e,{allKeys:!0},(u,d,h,m)=>{if(m===void 0)return;let g=s+d,_=i[m];typeof u[r]=="string"&&(_=v.call(this,u[r])),w.call(this,u.$anchor),w.call(this,u.$dynamicAnchor),i[d]=_;function v(x){let k=this.opts.uriResolver.resolve;if(x=zi(_?k(_,x):x),c.has(x))throw p(x);c.add(x);let P=this.refs[x];return typeof P=="string"&&(P=this.refs[P]),typeof P=="object"?l(u,P.schema,x):x!==zi(g)&&(x[0]==="#"?(l(u,a[x],x),a[x]=u):this.refs[x]=g),x}function w(x){if(typeof x=="string"){if(!zM.test(x))throw new Error(`invalid anchor "${x}"`);v.call(this,`#${x}`)}}}),a;function l(u,d,h){if(d!==void 0&&!PM(u,d))throw p(h)}function p(u){return new Error(`reference "${u}" resolves to more than one schema`)}}Ft.getSchemaRefs=DM});var ra=$(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.getData=Bn.KeywordCxt=Bn.validateFunctionCode=void 0;var yS=Hk(),hS=Qs(),Lh=Th(),Ml=Qs(),OM=eS(),ta=iS(),Mh=aS(),N=Y(),F=hn(),NM=Xs(),mn=ue(),ea=Ys();function jM(e){if(bS(e)&&(xS(e),wS(e))){ZM(e);return}vS(e,()=>(0,yS.topBoolOrEmptySchema)(e))}Bn.validateFunctionCode=jM;function vS({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,N._)`${F.default.data}, ${F.default.valCxt}`,n.$async,()=>{e.code((0,N._)`"use strict"; ${mS(r,o)}`),LM(e,o),e.code(i)}):e.func(t,(0,N._)`${F.default.data}, ${MM(o)}`,n.$async,()=>e.code(mS(r,o)).code(i))}function MM(e){return(0,N._)`{${F.default.instancePath}="", ${F.default.parentData}, ${F.default.parentDataProperty}, ${F.default.rootData}=${F.default.data}${e.dynamicRef?(0,N._)`, ${F.default.dynamicAnchors}={}`:N.nil}}={}`}function LM(e,t){e.if(F.default.valCxt,()=>{e.var(F.default.instancePath,(0,N._)`${F.default.valCxt}.${F.default.instancePath}`),e.var(F.default.parentData,(0,N._)`${F.default.valCxt}.${F.default.parentData}`),e.var(F.default.parentDataProperty,(0,N._)`${F.default.valCxt}.${F.default.parentDataProperty}`),e.var(F.default.rootData,(0,N._)`${F.default.valCxt}.${F.default.rootData}`),t.dynamicRef&&e.var(F.default.dynamicAnchors,(0,N._)`${F.default.valCxt}.${F.default.dynamicAnchors}`)},()=>{e.var(F.default.instancePath,(0,N._)`""`),e.var(F.default.parentData,(0,N._)`undefined`),e.var(F.default.parentDataProperty,(0,N._)`undefined`),e.var(F.default.rootData,F.default.data),t.dynamicRef&&e.var(F.default.dynamicAnchors,(0,N._)`{}`)})}function ZM(e){let{schema:t,opts:r,gen:n}=e;vS(e,()=>{r.$comment&&t.$comment&&SS(e),VM(e),n.let(F.default.vErrors,null),n.let(F.default.errors,0),r.unevaluated&&UM(e),kS(e),KM(e)})}function UM(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,N._)`${r}.evaluated`),t.if((0,N._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,N._)`${e.evaluated}.props`,(0,N._)`undefined`)),t.if((0,N._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,N._)`${e.evaluated}.items`,(0,N._)`undefined`))}function mS(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,N._)`/*# sourceURL=${r} */`:N.nil}function qM(e,t){if(bS(e)&&(xS(e),wS(e))){FM(e,t);return}(0,yS.boolOrEmptySchema)(e,t)}function wS({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 bS(e){return typeof e.schema!="boolean"}function FM(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&SS(e),BM(e),HM(e);let i=n.const("_errs",F.default.errors);kS(e,i),n.var(t,(0,N._)`${i} === ${F.default.errors}`)}function xS(e){(0,mn.checkUnknownRules)(e),GM(e)}function kS(e,t){if(e.opts.jtd)return gS(e,[],!1,t);let r=(0,hS.getSchemaTypes)(e.schema),n=(0,hS.coerceAndCheckDataType)(e,r);gS(e,r,!n,t)}function GM(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,mn.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function VM(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,mn.checkStrictMode)(e,"default is ignored in the schema root")}function BM(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,NM.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function HM(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function SS({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,N._)`${F.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=(0,N.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,N._)`${F.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function KM(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,N._)`${F.default.errors} === 0`,()=>t.return(F.default.data),()=>t.throw((0,N._)`new ${o}(${F.default.vErrors})`)):(t.assign((0,N._)`${n}.errors`,F.default.vErrors),i.unevaluated&&WM(e),t.return((0,N._)`${F.default.errors} === 0`))}function WM({gen:e,evaluated:t,props:r,items:n}){r instanceof N.Name&&e.assign((0,N._)`${t}.props`,r),n instanceof N.Name&&e.assign((0,N._)`${t}.items`,n)}function gS(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:c,self:l}=e,{RULES:p}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,mn.schemaHasRulesButRef)(i,p))){o.block(()=>PS(e,"$ref",p.all.$ref.definition));return}c.jtd||JM(e,t),o.block(()=>{for(let d of p.rules)u(d);u(p.post)});function u(d){(0,Lh.shouldUseGroup)(i,d)&&(d.type?(o.if((0,Ml.checkDataType)(d.type,s,c.strictNumbers)),_S(e,d),t.length===1&&t[0]===d.type&&r&&(o.else(),(0,Ml.reportTypeError)(e)),o.endIf()):_S(e,d),a||o.if((0,N._)`${F.default.errors} === ${n||0}`))}}function _S(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,OM.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,Lh.shouldUseRule)(n,i)&&PS(e,i.keyword,i.definition,t.type)})}function JM(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(YM(e,t),e.opts.allowUnionTypes||QM(e,t),XM(e,e.dataTypes))}function YM(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{$S(e.dataTypes,r)||Zh(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),tL(e,t)}}function QM(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Zh(e,"use allowUnionTypes to allow union type keyword")}function XM(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Lh.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>eL(t,s))&&Zh(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function eL(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function $S(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function tL(e,t){let r=[];for(let n of e.dataTypes)$S(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Zh(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,mn.checkStrictMode)(e,t,e.opts.strictTypes)}var Ll=class{constructor(t,r,n){if((0,ta.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,mn.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",ES(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,ta.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",F.default.errors))}result(t,r,n){this.failResult((0,N.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,N.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,N._)`${r} !== undefined && (${(0,N.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?ea.reportExtraError:ea.reportError)(this,this.def.error,r)}$dataError(){(0,ea.reportError)(this,this.def.$dataError||ea.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ea.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=N.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=N.nil,r=N.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,N.or)((0,N._)`${o} === undefined`,r)),t!==N.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==N.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,N.or)(s(),a());function s(){if(n.length){if(!(r instanceof N.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,N._)`${(0,Ml.checkDataTypes)(c,r,i.opts.strictNumbers,Ml.DataType.Wrong)}`}return N.nil}function a(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,N._)`!${c}(${r})`}return N.nil}}subschema(t,r){let n=(0,Mh.getSubschema)(this.it,t);(0,Mh.extendSubschemaData)(n,this.it,t),(0,Mh.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return qM(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=mn.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=mn.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,N.Name)),!0}};Bn.KeywordCxt=Ll;function PS(e,t,r,n){let o=new Ll(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,ta.funcKeywordCode)(o,r):"macro"in r?(0,ta.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,ta.funcKeywordCode)(o,r)}var rL=/^\/(?:[^~]|~0|~1)*$/,nL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ES(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return F.default.rootData;if(e[0]==="/"){if(!rL.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=F.default.rootData}else{let l=nL.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let p=+l[1];if(o=l[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 l of a)l&&(i=(0,N._)`${i}${(0,N.getProperty)((0,mn.unescapeJsonPointer)(l))}`,s=(0,N._)`${s} && ${i}`);return s;function c(l,p){return`Cannot access ${l} ${p} levels up, current level is ${t}`}}Bn.getData=ES});var Zl=$(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});var Uh=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};qh.default=Uh});var na=$(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});var Fh=Xs(),Gh=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Fh.resolveUrl)(t,r,n),this.missingSchema=(0,Fh.normalizeId)((0,Fh.getFullPath)(t,this.missingRef))}};Vh.default=Gh});var ql=$(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.resolveSchema=lr.getCompilingSchema=lr.resolveRef=lr.compileSchema=lr.SchemaEnv=void 0;var $r=Y(),oL=Zl(),Zo=hn(),Pr=Xs(),CS=ue(),iL=ra(),Di=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,Pr.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};lr.SchemaEnv=Di;function Hh(e){let t=TS.call(this,e);if(t)return t;let r=(0,Pr.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new $r.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:oL.default,code:(0,$r._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");e.validateName=c;let l={gen:s,allErrors:this.opts.allErrors,data:Zo.default.data,parentData:Zo.default.parentData,parentDataProperty:Zo.default.parentDataProperty,dataNames:[Zo.default.data],dataPathArr:[$r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,$r.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:$r.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,$r._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(e),(0,iL.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let u=s.toString();p=`${s.scopeRefs(Zo.default.scope)}return ${u}`,this.opts.code.process&&(p=this.opts.code.process(p,e));let h=new Function(`${Zo.default.self}`,`${Zo.default.scope}`,p)(this,this.scope.get());if(this.scope.value(c,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:c,validateCode:u,scopeValues:s._values}),this.opts.unevaluated){let{props:m,items:g}=l;h.evaluated={props:m instanceof $r.Name?void 0:m,items:g instanceof $r.Name?void 0:g,dynamicProps:m instanceof $r.Name,dynamicItems:g instanceof $r.Name},h.source&&(h.source.evaluated=(0,$r.stringify)(h.evaluated))}return e.validate=h,e}catch(u){throw delete e.validate,delete e.validateName,p&&this.logger.error("Error compiling schema, function code:",p),u}finally{this._compilations.delete(e)}}lr.compileSchema=Hh;function sL(e,t,r){var n;r=(0,Pr.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=lL.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 Di({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=aL.call(this,i)}lr.resolveRef=sL;function aL(e){return(0,Pr.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Hh.call(this,e)}function TS(e){for(let t of this._compilations)if(cL(t,e))return t}lr.getCompilingSchema=TS;function cL(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function lL(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Ul.call(this,e,t)}function Ul(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Pr._getFullPath)(this.opts.uriResolver,r),o=(0,Pr.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return Bh.call(this,r,e);let i=(0,Pr.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=Ul.call(this,e,s);return typeof a?.schema!="object"?void 0:Bh.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||Hh.call(this,s),i===(0,Pr.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,l=a[c];return l&&(o=(0,Pr.resolveUrl)(this.opts.uriResolver,o,l)),new Di({schema:a,schemaId:c,root:e,baseId:o})}return Bh.call(this,r,s)}}lr.resolveSchema=Ul;var uL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Bh(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,CS.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!uL.has(a)&&l&&(t=(0,Pr.resolveUrl)(this.opts.uriResolver,t,l))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,CS.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Pr.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Ul.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new Di({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var RS=$((WW,pL)=>{pL.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 Wh=$((JW,DS)=>{"use strict";var dL=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),IS=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 Kh(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 fL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function AS(e){return e.length=0,!0}function hL(e,t,r){if(e.length){let n=Kh(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function mL(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=hL;for(let c=0;c<e.length;c++){let l=e[c];if(!(l==="["||l==="]"))if(l===":"){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(l==="%"){if(!a(o,n,r))break;a=AS}else{o.push(l);continue}}return o.length&&(a===AS?r.zone=o.join(""):s?n.push(o.join("")):n.push(Kh(o))),r.address=n.join(""),r}function zS(e){if(gL(e,":")<2)return{host:e,isIPV6:!1};let t=mL(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 gL(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function _L(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 yL(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 vL(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!IS(r)){let n=zS(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}DS.exports={nonSimpleDomain:fL,recomposeAuthority:vL,normalizeComponentEncoding:yL,removeDotSegments:_L,isIPv4:IS,isUUID:dL,normalizeIPv6:zS,stringArrayToHexStripped:Kh}});var LS=$((YW,MS)=>{"use strict";var{isUUID:wL}=Wh(),bL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,xL=["http","https","ws","wss","urn","urn:uuid"];function kL(e){return xL.indexOf(e)!==-1}function Jh(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 OS(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function NS(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 SL(e){return e.secure=Jh(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function $L(e){if((e.port===(Jh(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 PL(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(bL);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=Yh(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function EL(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=Yh(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 CL(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!wL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function TL(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var jS={scheme:"http",domainHost:!0,parse:OS,serialize:NS},RL={scheme:"https",domainHost:jS.domainHost,parse:OS,serialize:NS},Fl={scheme:"ws",domainHost:!0,parse:SL,serialize:$L},AL={scheme:"wss",domainHost:Fl.domainHost,parse:Fl.parse,serialize:Fl.serialize},IL={scheme:"urn",parse:PL,serialize:EL,skipNormalize:!0},zL={scheme:"urn:uuid",parse:CL,serialize:TL,skipNormalize:!0},Gl={http:jS,https:RL,ws:Fl,wss:AL,urn:IL,"urn:uuid":zL};Object.setPrototypeOf(Gl,null);function Yh(e){return e&&(Gl[e]||Gl[e.toLowerCase()])||void 0}MS.exports={wsIsSecure:Jh,SCHEMES:Gl,isValidSchemeName:kL,getSchemeHandler:Yh}});var qS=$((QW,Bl)=>{"use strict";var{normalizeIPv6:DL,removeDotSegments:oa,recomposeAuthority:OL,normalizeComponentEncoding:Vl,isIPv4:NL,nonSimpleDomain:jL}=Wh(),{SCHEMES:ML,getSchemeHandler:ZS}=LS();function LL(e,t){return typeof e=="string"?e=Fr(gn(e,t),t):typeof e=="object"&&(e=gn(Fr(e,t),t)),e}function ZL(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=US(gn(e,n),gn(t,n),n,!0);return n.skipEscape=!0,Fr(o,n)}function US(e,t,r,n){let o={};return n||(e=gn(Fr(e,r),r),t=gn(Fr(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=oa(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=oa(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=oa(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=oa(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 UL(e,t,r){return typeof e=="string"?(e=unescape(e),e=Fr(Vl(gn(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Fr(Vl(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Fr(Vl(gn(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Fr(Vl(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Fr(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=ZS(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=OL(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=oa(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 qL=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function gn(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(qL);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(NL(n.host)===!1){let c=DL(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=ZS(r.scheme||n.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&n.host&&(r.domainHost||s&&s.domainHost)&&o===!1&&jL(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 Qh={SCHEMES:ML,normalize:LL,resolve:ZL,resolveComponent:US,equal:UL,serialize:Fr,parse:gn};Bl.exports=Qh;Bl.exports.default=Qh;Bl.exports.fastUri=Qh});var GS=$(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});var FS=qS();FS.code='require("ajv/dist/runtime/uri").default';Xh.default=FS});var QS=$(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.CodeGen=ut.Name=ut.nil=ut.stringify=ut.str=ut._=ut.KeywordCxt=void 0;var FL=ra();Object.defineProperty(ut,"KeywordCxt",{enumerable:!0,get:function(){return FL.KeywordCxt}});var Oi=Y();Object.defineProperty(ut,"_",{enumerable:!0,get:function(){return Oi._}});Object.defineProperty(ut,"str",{enumerable:!0,get:function(){return Oi.str}});Object.defineProperty(ut,"stringify",{enumerable:!0,get:function(){return Oi.stringify}});Object.defineProperty(ut,"nil",{enumerable:!0,get:function(){return Oi.nil}});Object.defineProperty(ut,"Name",{enumerable:!0,get:function(){return Oi.Name}});Object.defineProperty(ut,"CodeGen",{enumerable:!0,get:function(){return Oi.CodeGen}});var GL=Zl(),WS=na(),VL=Ch(),ia=ql(),BL=Y(),sa=Xs(),Hl=Qs(),tm=ue(),VS=RS(),HL=GS(),JS=(e,t)=>new RegExp(e,t);JS.code="new RegExp";var KL=["removeAdditional","useDefaults","coerceTypes"],WL=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),JL={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."},YL={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},BS=200;function QL(e){var t,r,n,o,i,s,a,c,l,p,u,d,h,m,g,_,v,w,x,k,P,q,Z,Fe,ve;let ie=e.strict,Ge=(t=e.code)===null||t===void 0?void 0:t.optimize,Ve=Ge===!0||Ge===void 0?1:Ge||0,Pn=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:JS,io=(o=e.uriResolver)!==null&&o!==void 0?o:HL.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:ie)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:ie)!==null&&c!==void 0?c:!0,strictTypes:(p=(l=e.strictTypes)!==null&&l!==void 0?l:ie)!==null&&p!==void 0?p:"log",strictTuples:(d=(u=e.strictTuples)!==null&&u!==void 0?u:ie)!==null&&d!==void 0?d:"log",strictRequired:(m=(h=e.strictRequired)!==null&&h!==void 0?h:ie)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:Ve,regExp:Pn}:{optimize:Ve,regExp:Pn},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:BS,loopEnum:(_=e.loopEnum)!==null&&_!==void 0?_:BS,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:(x=e.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(k=e.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(P=e.addUsedSchema)!==null&&P!==void 0?P:!0,validateSchema:(q=e.validateSchema)!==null&&q!==void 0?q:!0,validateFormats:(Z=e.validateFormats)!==null&&Z!==void 0?Z:!0,unicodeRegExp:(Fe=e.unicodeRegExp)!==null&&Fe!==void 0?Fe:!0,int32range:(ve=e.int32range)!==null&&ve!==void 0?ve:!0,uriResolver:io}}var aa=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...QL(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new BL.ValueScope({scope:{},prefixes:WL,es5:r,lines:n}),this.logger=o3(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,VL.getRules)(),HS.call(this,JL,t,"NOT SUPPORTED"),HS.call(this,YL,t,"DEPRECATED","warn"),this._metaOpts=r3.call(this),t.formats&&e3.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&t3.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),XL.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=VS;n==="id"&&(o={...VS},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,u){await i.call(this,p.$schema);let d=this._addSchema(p,u);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(u){if(!(u instanceof WS.default))throw u;return a.call(this,u),await c.call(this,u.missingSchema),s.call(this,p)}}function a({missingSchema:p,missingRef:u}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${u} cannot be resolved`)}async function c(p){let u=await l.call(this,p);this.refs[p]||await i.call(this,u.$schema),this.refs[p]||this.addSchema(u,p,r)}async function l(p){let u=this._loading[p];if(u)return u;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,sa.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=KS.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new ia.SchemaEnv({schema:{},schemaId:n});if(r=ia.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=KS.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,sa.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(s3.call(this,n,r),!r)return(0,tm.eachItem)(n,i=>em.call(this,i)),this;c3.call(this,r);let o={...r,type:(0,Hl.getJSONTypes)(r.type),schemaType:(0,Hl.getJSONTypes)(r.schemaType)};return(0,tm.eachItem)(n,o.type.length===0?i=>em.call(this,i,o):i=>o.type.forEach(s=>em.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:l}=c.definition,p=s[a];l&&p&&(s[a]=YS(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,sa.normalizeId)(s||n);let l=sa.getSchemaRefs.call(this,t,n);return c=new ia.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:l}),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):ia.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{ia.compileSchema.call(this,t)}finally{this.opts=r}}};aa.ValidationError=GL.default;aa.MissingRefError=WS.default;ut.default=aa;function HS(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 KS(e){return e=(0,sa.normalizeId)(e),this.schemas[e]||this.refs[e]}function XL(){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 e3(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function t3(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 r3(){let e={...this.opts};for(let t of KL)delete e[t];return e}var n3={log(){},warn(){},error(){}};function o3(e){if(e===!1)return n3;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 i3=/^[a-z_$][a-z0-9_$:-]*$/i;function s3(e,t){let{RULES:r}=this;if((0,tm.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!i3.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 em(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,Hl.getJSONTypes)(t.type),schemaType:(0,Hl.getJSONTypes)(t.schemaType)}};t.before?a3.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 a3(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 c3(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=YS(t)),e.validateSchema=this.compile(t,!0))}var l3={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function YS(e){return{anyOf:[e,l3]}}});var XS=$(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});var u3={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};rm.default=u3});var n$=$(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.callRef=Uo.getValidate=void 0;var p3=na(),e$=cr(),Gt=Y(),Ni=hn(),t$=ql(),Kl=ue(),d3={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:l}=i;if((r==="#"||r==="#/")&&o===l.baseId)return u();let p=t$.resolveRef.call(c,l,o,r);if(p===void 0)throw new p3.default(n.opts.uriResolver,o,r);if(p instanceof t$.SchemaEnv)return d(p);return h(p);function u(){if(i===l)return Wl(e,s,i,i.$async);let m=t.scopeValue("root",{ref:l});return Wl(e,(0,Gt._)`${m}.validate`,l,l.$async)}function d(m){let g=r$(e,m);Wl(e,g,m,m.$async)}function h(m){let g=t.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,Gt.stringify)(m)}:{ref:m}),_=t.name("valid"),v=e.subschema({schema:m,dataTypes:[],schemaPath:Gt.nil,topSchemaRef:g,errSchemaPath:r},_);e.mergeEvaluated(v),e.ok(_)}}};function r$(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Gt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Uo.getValidate=r$;function Wl(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,l=c.passContext?Ni.default.this:Gt.nil;n?p():u();function p(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=o.let("valid");o.try(()=>{o.code((0,Gt._)`await ${(0,e$.callValidateCode)(e,t,l)}`),h(t),s||o.assign(m,!0)},g=>{o.if((0,Gt._)`!(${g} instanceof ${i.ValidationError})`,()=>o.throw(g)),d(g),s||o.assign(m,!1)}),e.ok(m)}function u(){e.result((0,e$.callValidateCode)(e,t,l),()=>h(t),()=>d(t))}function d(m){let g=(0,Gt._)`${m}.errors`;o.assign(Ni.default.vErrors,(0,Gt._)`${Ni.default.vErrors} === null ? ${g} : ${Ni.default.vErrors}.concat(${g})`),o.assign(Ni.default.errors,(0,Gt._)`${Ni.default.vErrors}.length`)}function h(m){var g;if(!i.opts.unevaluated)return;let _=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(i.props=Kl.mergeEvaluated.props(o,_.props,i.props));else{let v=o.var("props",(0,Gt._)`${m}.evaluated.props`);i.props=Kl.mergeEvaluated.props(o,v,i.props,Gt.Name)}if(i.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(i.items=Kl.mergeEvaluated.items(o,_.items,i.items));else{let v=o.var("items",(0,Gt._)`${m}.evaluated.items`);i.items=Kl.mergeEvaluated.items(o,v,i.items,Gt.Name)}}}Uo.callRef=Wl;Uo.default=d3});var o$=$(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});var f3=XS(),h3=n$(),m3=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",f3.default,h3.default];nm.default=m3});var i$=$(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var Jl=Y(),Hn=Jl.operators,Yl={maximum:{okStr:"<=",ok:Hn.LTE,fail:Hn.GT},minimum:{okStr:">=",ok:Hn.GTE,fail:Hn.LT},exclusiveMaximum:{okStr:"<",ok:Hn.LT,fail:Hn.GTE},exclusiveMinimum:{okStr:">",ok:Hn.GT,fail:Hn.LTE}},g3={message:({keyword:e,schemaCode:t})=>(0,Jl.str)`must be ${Yl[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Jl._)`{comparison: ${Yl[e].okStr}, limit: ${t}}`},_3={keyword:Object.keys(Yl),type:"number",schemaType:"number",$data:!0,error:g3,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Jl._)`${r} ${Yl[t].fail} ${n} || isNaN(${r})`)}};om.default=_3});var s$=$(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var ca=Y(),y3={message:({schemaCode:e})=>(0,ca.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,ca._)`{multipleOf: ${e}}`},v3={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:y3,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,ca._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,ca._)`${s} !== parseInt(${s})`;e.fail$data((0,ca._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};im.default=v3});var c$=$(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});function a$(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}sm.default=a$;a$.code='require("ajv/dist/runtime/ucs2length").default'});var l$=$(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var qo=Y(),w3=ue(),b3=c$(),x3={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,qo.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,qo._)`{limit: ${e}}`},k3={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:x3,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?qo.operators.GT:qo.operators.LT,s=o.opts.unicode===!1?(0,qo._)`${r}.length`:(0,qo._)`${(0,w3.useFunc)(e.gen,b3.default)}(${r})`;e.fail$data((0,qo._)`${s} ${i} ${n}`)}};am.default=k3});var u$=$(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var S3=cr(),Ql=Y(),$3={message:({schemaCode:e})=>(0,Ql.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Ql._)`{pattern: ${e}}`},P3={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:$3,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,s=i.opts.unicodeRegExp?"u":"",a=r?(0,Ql._)`(new RegExp(${o}, ${s}))`:(0,S3.usePattern)(e,n);e.fail$data((0,Ql._)`!${a}.test(${t})`)}};cm.default=P3});var p$=$(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var la=Y(),E3={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,la.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,la._)`{limit: ${e}}`},C3={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:E3,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?la.operators.GT:la.operators.LT;e.fail$data((0,la._)`Object.keys(${r}).length ${o} ${n}`)}};lm.default=C3});var d$=$(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var ua=cr(),pa=Y(),T3=ue(),R3={message:({params:{missingProperty:e}})=>(0,pa.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,pa._)`{missingProperty: ${e}}`},A3={keyword:"required",type:"object",schemaType:"array",$data:!0,error:R3,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?l():p(),a.strictRequired){let h=e.parentSchema.properties,{definedProperties:m}=e.it;for(let g of r)if(h?.[g]===void 0&&!m.has(g)){let _=s.schemaEnv.baseId+s.errSchemaPath,v=`required property "${g}" is not defined at "${_}" (strictRequired)`;(0,T3.checkStrictMode)(s,v,s.opts.strictRequired)}}function l(){if(c||i)e.block$data(pa.nil,u);else for(let h of r)(0,ua.checkReportMissingProp)(e,h)}function p(){let h=t.let("missing");if(c||i){let m=t.let("valid",!0);e.block$data(m,()=>d(h,m)),e.ok(m)}else t.if((0,ua.checkMissingProp)(e,r,h)),(0,ua.reportMissingProp)(e,h),t.else()}function u(){t.forOf("prop",n,h=>{e.setParams({missingProperty:h}),t.if((0,ua.noPropertyInData)(t,o,h,a.ownProperties),()=>e.error())})}function d(h,m){e.setParams({missingProperty:h}),t.forOf(h,n,()=>{t.assign(m,(0,ua.propertyInData)(t,o,h,a.ownProperties)),t.if((0,pa.not)(m),()=>{e.error(),t.break()})},pa.nil)}}};um.default=A3});var f$=$(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});var da=Y(),I3={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,da.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,da._)`{limit: ${e}}`},z3={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:I3,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?da.operators.GT:da.operators.LT;e.fail$data((0,da._)`${r}.length ${o} ${n}`)}};pm.default=z3});var Xl=$(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});var h$=Nh();h$.code='require("ajv/dist/runtime/equal").default';dm.default=h$});var m$=$(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});var fm=Qs(),pt=Y(),D3=ue(),O3=Xl(),N3={message:({params:{i:e,j:t}})=>(0,pt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,pt._)`{i: ${e}, j: ${t}}`},j3={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:N3,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"),l=i.items?(0,fm.getSchemaTypes)(i.items):[];e.block$data(c,p,(0,pt._)`${s} === false`),e.ok(c);function p(){let m=t.let("i",(0,pt._)`${r}.length`),g=t.let("j");e.setParams({i:m,j:g}),t.assign(c,!0),t.if((0,pt._)`${m} > 1`,()=>(u()?d:h)(m,g))}function u(){return l.length>0&&!l.some(m=>m==="object"||m==="array")}function d(m,g){let _=t.name("item"),v=(0,fm.checkDataTypes)(l,_,a.opts.strictNumbers,fm.DataType.Wrong),w=t.const("indices",(0,pt._)`{}`);t.for((0,pt._)`;${m}--;`,()=>{t.let(_,(0,pt._)`${r}[${m}]`),t.if(v,(0,pt._)`continue`),l.length>1&&t.if((0,pt._)`typeof ${_} == "string"`,(0,pt._)`${_} += "_"`),t.if((0,pt._)`typeof ${w}[${_}] == "number"`,()=>{t.assign(g,(0,pt._)`${w}[${_}]`),e.error(),t.assign(c,!1).break()}).code((0,pt._)`${w}[${_}] = ${m}`)})}function h(m,g){let _=(0,D3.useFunc)(t,O3.default),v=t.name("outer");t.label(v).for((0,pt._)`;${m}--;`,()=>t.for((0,pt._)`${g} = ${m}; ${g}--;`,()=>t.if((0,pt._)`${_}(${r}[${m}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};hm.default=j3});var g$=$(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});var mm=Y(),M3=ue(),L3=Xl(),Z3={message:"must be equal to constant",params:({schemaCode:e})=>(0,mm._)`{allowedValue: ${e}}`},U3={keyword:"const",$data:!0,error:Z3,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,mm._)`!${(0,M3.useFunc)(t,L3.default)}(${r}, ${o})`):e.fail((0,mm._)`${i} !== ${r}`)}};gm.default=U3});var _$=$(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});var fa=Y(),q3=ue(),F3=Xl(),G3={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,fa._)`{allowedValues: ${e}}`},V3={keyword:"enum",schemaType:"array",$data:!0,error:G3,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,l=()=>c??(c=(0,q3.useFunc)(t,F3.default)),p;if(a||n)p=t.let("valid"),e.block$data(p,u);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let h=t.const("vSchema",i);p=(0,fa.or)(...o.map((m,g)=>d(h,g)))}e.pass(p);function u(){t.assign(p,!1),t.forOf("v",i,h=>t.if((0,fa._)`${l()}(${r}, ${h})`,()=>t.assign(p,!0).break()))}function d(h,m){let g=o[m];return typeof g=="object"&&g!==null?(0,fa._)`${l()}(${r}, ${h}[${m}])`:(0,fa._)`${r} === ${g}`}}};_m.default=V3});var y$=$(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});var B3=i$(),H3=s$(),K3=l$(),W3=u$(),J3=p$(),Y3=d$(),Q3=f$(),X3=m$(),e5=g$(),t5=_$(),r5=[B3.default,H3.default,K3.default,W3.default,J3.default,Y3.default,Q3.default,X3.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},e5.default,t5.default];ym.default=r5});var wm=$(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.validateAdditionalItems=void 0;var Fo=Y(),vm=ue(),n5={message:({params:{len:e}})=>(0,Fo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Fo._)`{limit: ${e}}`},o5={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n5,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,vm.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}v$(e,n)}};function v$(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,Fo._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Fo._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,vm.alwaysValidSchema)(s,n)){let l=r.var("valid",(0,Fo._)`${a} <= ${t.length}`);r.if((0,Fo.not)(l),()=>c(l)),e.ok(l)}function c(l){r.forRange("i",t.length,a,p=>{e.subschema({keyword:i,dataProp:p,dataPropType:vm.Type.Num},l),s.allErrors||r.if((0,Fo.not)(l),()=>r.break())})}}ha.validateAdditionalItems=v$;ha.default=o5});var bm=$(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.validateTuple=void 0;var w$=Y(),eu=ue(),i5=cr(),s5={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return b$(e,"additionalItems",t);r.items=!0,!(0,eu.alwaysValidSchema)(r,t)&&e.ok((0,i5.validateArray)(e))}};function b$(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=eu.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,w$._)`${i}.length`);r.forEach((u,d)=>{(0,eu.alwaysValidSchema)(a,u)||(n.if((0,w$._)`${l} > ${d}`,()=>e.subschema({keyword:s,schemaProp:d,dataProp:d},c)),e.ok(c))});function p(u){let{opts:d,errSchemaPath:h}=a,m=r.length,g=m===u.minItems&&(m===u.maxItems||u[t]===!1);if(d.strictTuples&&!g){let _=`"${s}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,eu.checkStrictMode)(a,_,d.strictTuples)}}}ma.validateTuple=b$;ma.default=s5});var x$=$(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});var a5=bm(),c5={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,a5.validateTuple)(e,"items")};xm.default=c5});var S$=$(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});var k$=Y(),l5=ue(),u5=cr(),p5=wm(),d5={message:({params:{len:e}})=>(0,k$.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,k$._)`{limit: ${e}}`},f5={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:d5,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,l5.alwaysValidSchema)(n,t)&&(o?(0,p5.validateAdditionalItems)(e,o):e.ok((0,u5.validateArray)(e)))}};km.default=f5});var $$=$(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});var ur=Y(),tu=ue(),h5={message:({params:{min:e,max:t}})=>t===void 0?(0,ur.str)`must contain at least ${e} valid item(s)`:(0,ur.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,ur._)`{minContains: ${e}}`:(0,ur._)`{minContains: ${e}, maxContains: ${t}}`},m5={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:h5,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:c,maxContains:l}=n;i.opts.next?(s=c===void 0?1:c,a=l):s=1;let p=t.const("len",(0,ur._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,tu.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,tu.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,tu.alwaysValidSchema)(i,r)){let g=(0,ur._)`${p} >= ${s}`;a!==void 0&&(g=(0,ur._)`${g} && ${p} <= ${a}`),e.pass(g);return}i.items=!0;let u=t.name("valid");a===void 0&&s===1?h(u,()=>t.if(u,()=>t.break())):s===0?(t.let(u,!0),a!==void 0&&t.if((0,ur._)`${o}.length > 0`,d)):(t.let(u,!1),d()),e.result(u,()=>e.reset());function d(){let g=t.name("_valid"),_=t.let("count",0);h(g,()=>t.if(g,()=>m(_)))}function h(g,_){t.forRange("i",0,p,v=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:tu.Type.Num,compositeRule:!0},g),_()})}function m(g){t.code((0,ur._)`${g}++`),a===void 0?t.if((0,ur._)`${g} >= ${s}`,()=>t.assign(u,!0).break()):(t.if((0,ur._)`${g} > ${a}`,()=>t.assign(u,!1).break()),s===1?t.assign(u,!0):t.if((0,ur._)`${g} >= ${s}`,()=>t.assign(u,!0)))}}};Sm.default=m5});var C$=$(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.validateSchemaDeps=Gr.validatePropertyDeps=Gr.error=void 0;var $m=Y(),g5=ue(),ga=cr();Gr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,$m.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,$m._)`{property: ${e},
|
|
76
|
+
|| ${s} === "boolean" || ${o} === null`).assign(a,(0,H._)`[${o}]`)}}}function V4({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,H._)`${t} !== undefined`,()=>e.assign((0,H._)`${t}[${r}]`,n))}function Rh(e,t,r,n=Ai.Correct){let o=n===Ai.Correct?H.operators.EQ:H.operators.NEQ,i;switch(e){case"null":return(0,H._)`${t} ${o} null`;case"array":i=(0,H._)`Array.isArray(${t})`;break;case"object":i=(0,H._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,H._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,H._)`typeof ${t} ${o} ${e}`}return n===Ai.Correct?i:(0,H.not)(i);function s(a=H.nil){return(0,H.and)((0,H._)`typeof ${t} == "number"`,a,r?(0,H._)`isFinite(${t})`:H.nil)}}wt.checkDataType=Rh;function Ih(e,t,r,n){if(e.length===1)return Rh(e[0],t,r,n);let o,i=(0,Yk.toHash)(e);if(i.array&&i.object){let s=(0,H._)`typeof ${t} != "object"`;o=i.null?s:(0,H._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=H.nil;i.number&&delete i.integer;for(let s in i)o=(0,H.and)(o,Rh(s,t,r,n));return o}wt.checkDataTypes=Ih;var B4={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,H._)`{type: ${e}}`:(0,H._)`{type: ${t}}`};function zh(e){let t=H4(e);(0,Z4.reportError)(t,B4)}wt.reportTypeError=zh;function H4(e){let{gen:t,data:r,schema:n}=e,o=(0,Yk.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var tS=$(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.assignDefaults=void 0;var Ri=Y(),W4=le();function K4(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)eS(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>eS(e,i,o.default))}Ou.assignDefaults=K4;function eS(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,Ri._)`${i}${(0,Ri.getProperty)(t)}`;if(o){(0,W4.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,Ri._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Ri._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Ri._)`${a} = ${(0,Ri.stringify)(r)}`)}});var cr=$(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.validateUnion=me.validateArray=me.usePattern=me.callValidateCode=me.schemaProperties=me.allSchemaProperties=me.noPropertyInData=me.propertyInData=me.isOwnProperty=me.hasPropFunc=me.reportMissingProp=me.checkMissingProp=me.checkReportMissingProp=void 0;var Ce=Y(),Dh=le(),qn=fn(),J4=le();function Y4(e,t){let{gen:r,data:n,it:o}=e;r.if(Nh(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Ce._)`${t}`},!0),e.error()})}me.checkReportMissingProp=Y4;function Q4({gen:e,data:t,it:{opts:r}},n,o){return(0,Ce.or)(...n.map(i=>(0,Ce.and)(Nh(e,t,i,r.ownProperties),(0,Ce._)`${o} = ${i}`)))}me.checkMissingProp=Q4;function X4(e,t){e.setParams({missingProperty:t},!0),e.error()}me.reportMissingProp=X4;function rS(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ce._)`Object.prototype.hasOwnProperty`})}me.hasPropFunc=rS;function Oh(e,t,r){return(0,Ce._)`${rS(e)}.call(${t}, ${r})`}me.isOwnProperty=Oh;function eM(e,t,r,n){let o=(0,Ce._)`${t}${(0,Ce.getProperty)(r)} !== undefined`;return n?(0,Ce._)`${o} && ${Oh(e,t,r)}`:o}me.propertyInData=eM;function Nh(e,t,r,n){let o=(0,Ce._)`${t}${(0,Ce.getProperty)(r)} === undefined`;return n?(0,Ce.or)(o,(0,Ce.not)(Oh(e,t,r))):o}me.noPropertyInData=Nh;function nS(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}me.allSchemaProperties=nS;function tM(e,t){return nS(t).filter(r=>!(0,Dh.alwaysValidSchema)(e,t[r]))}me.schemaProperties=tM;function rM({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){let p=u?(0,Ce._)`${e}, ${t}, ${n}${o}`:t,l=[[qn.default.instancePath,(0,Ce.strConcat)(qn.default.instancePath,i)],[qn.default.parentData,s.parentData],[qn.default.parentDataProperty,s.parentDataProperty],[qn.default.rootData,qn.default.rootData]];s.opts.dynamicRef&&l.push([qn.default.dynamicAnchors,qn.default.dynamicAnchors]);let d=(0,Ce._)`${p}, ${r.object(...l)}`;return c!==Ce.nil?(0,Ce._)`${a}.call(${c}, ${d})`:(0,Ce._)`${a}(${d})`}me.callValidateCode=rM;var nM=(0,Ce._)`new RegExp`;function oM({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,Ce._)`${o.code==="new RegExp"?nM:(0,J4.useFunc)(e,o)}(${r}, ${n})`})}me.usePattern=oM;function iM(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,Ce._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Dh.Type.Num},i),t.if((0,Ce.not)(i),a)})}}me.validateArray=iM;function sM(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,Dh.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,Ce._)`${s} || ${a}`),e.mergeValidEvaluated(p,a)||t.if((0,Ce.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}me.validateUnion=sM});var sS=$(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.validateKeywordUsage=Zr.validSchemaType=Zr.funcKeywordCode=Zr.macroKeywordCode=void 0;var At=Y(),Mo=fn(),aM=cr(),cM=Js();function uM(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=iS(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:At.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Zr.macroKeywordCode=uM;function lM(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;dM(c,t);let u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,p=iS(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&&oS(e),y(()=>e.error());else{let v=t.async?f():h();t.modifying&&oS(e),y(()=>pM(e,v))}}function f(){let v=n.let("ruleErrs",null);return n.try(()=>g((0,At._)`await `),w=>n.assign(l,!1).if((0,At._)`${w} instanceof ${c.ValidationError}`,()=>n.assign(v,(0,At._)`${w}.errors`),()=>n.throw(w))),v}function h(){let v=(0,At._)`${p}.errors`;return n.assign(v,null),g(At.nil),v}function g(v=t.async?(0,At._)`await `:At.nil){let w=c.opts.passContext?Mo.default.this:Mo.default.self,x=!("compile"in t&&!a||t.schema===!1);n.assign(l,(0,At._)`${v}${(0,aM.callValidateCode)(e,p,w,x)}`,t.modifying)}function y(v){var w;n.if((0,At.not)((w=t.valid)!==null&&w!==void 0?w:l),v)}}Zr.funcKeywordCode=lM;function oS(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,At._)`${n.parentData}[${n.parentDataProperty}]`))}function pM(e,t){let{gen:r}=e;r.if((0,At._)`Array.isArray(${t})`,()=>{r.assign(Mo.default.vErrors,(0,At._)`${Mo.default.vErrors} === null ? ${t} : ${Mo.default.vErrors}.concat(${t})`).assign(Mo.default.errors,(0,At._)`${Mo.default.vErrors}.length`),(0,cM.extendErrors)(e)},()=>e.error())}function dM({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function iS(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,At.stringify)(r)})}function fM(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")}Zr.validSchemaType=fM;function hM({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)}}Zr.validateKeywordUsage=hM});var cS=$(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.extendSubschemaMode=Fn.extendSubschemaData=Fn.getSubschema=void 0;var Ur=Y(),aS=le();function mM(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,Ur._)`${e.schemaPath}${(0,Ur.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,Ur._)`${e.schemaPath}${(0,Ur.getProperty)(t)}${(0,Ur.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,aS.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')}Fn.getSubschema=mM;function gM(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,Ur._)`${t.data}${(0,Ur.getProperty)(r)}`,!0);c(d),e.errorPath=(0,Ur.str)`${u}${(0,aS.getErrorPath)(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=(0,Ur._)`${r}`,e.dataPathArr=[...p,e.parentDataProperty]}if(o!==void 0){let u=o instanceof Ur.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]}}Fn.extendSubschemaData=gM;function yM(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}Fn.extendSubschemaMode=yM});var jh=$((zK,uS)=>{"use strict";uS.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 pS=$((DK,lS)=>{"use strict";var Gn=lS.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(){};Nu(t,n,o,e,"",e)};Gn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Gn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Gn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Gn.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 Nu(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 Gn.arrayKeywords)for(var d=0;d<l.length;d++)Nu(e,t,r,l[d],o+"/"+p+"/"+d,i,o,p,n,d)}else if(p in Gn.propsKeywords){if(l&&typeof l=="object")for(var f in l)Nu(e,t,r,l[f],o+"/"+p+"/"+_M(f),i,o,p,n,f)}else(p in Gn.keywords||e.allKeys&&!(p in Gn.skipKeywords))&&Nu(e,t,r,l,o+"/"+p,i,o,p,n)}r(n,o,i,s,a,c,u)}}function _M(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Qs=$(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.getSchemaRefs=Ft.resolveUrl=Ft.normalizeId=Ft._getFullPath=Ft.getFullPath=Ft.inlineRef=void 0;var vM=le(),wM=jh(),bM=pS(),xM=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function kM(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Mh(e):t?dS(e)<=t:!1}Ft.inlineRef=kM;var SM=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Mh(e){for(let t in e){if(SM.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Mh)||typeof r=="object"&&Mh(r))return!0}return!1}function dS(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!xM.has(r)&&(typeof e[r]=="object"&&(0,vM.eachItem)(e[r],n=>t+=dS(n)),t===1/0))return 1/0}return t}function fS(e,t="",r){r!==!1&&(t=Ii(t));let n=e.parse(t);return hS(e,n)}Ft.getFullPath=fS;function hS(e,t){return e.serialize(t).split("#")[0]+"#"}Ft._getFullPath=hS;var $M=/#\/?$/;function Ii(e){return e?e.replace($M,""):""}Ft.normalizeId=Ii;function PM(e,t,r){return r=Ii(r),e.resolve(t,r)}Ft.resolveUrl=PM;var EM=/^[a-z_][-a-z0-9._]*$/i;function CM(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Ii(e[r]||t),i={"":o},s=fS(n,o,!1),a={},c=new Set;return bM(e,{allKeys:!0},(l,d,f,h)=>{if(h===void 0)return;let g=s+d,y=i[h];typeof l[r]=="string"&&(y=v.call(this,l[r])),w.call(this,l.$anchor),w.call(this,l.$dynamicAnchor),i[d]=y;function v(x){let k=this.opts.uriResolver.resolve;if(x=Ii(y?k(y,x):x),c.has(x))throw p(x);c.add(x);let P=this.refs[x];return typeof P=="string"&&(P=this.refs[P]),typeof P=="object"?u(l,P.schema,x):x!==Ii(g)&&(x[0]==="#"?(u(l,a[x],x),a[x]=l):this.refs[x]=g),x}function w(x){if(typeof x=="string"){if(!EM.test(x))throw new Error(`invalid anchor "${x}"`);v.call(this,`#${x}`)}}}),a;function u(l,d,f){if(d!==void 0&&!wM(l,d))throw p(f)}function p(l){return new Error(`reference "${l}" resolves to more than one schema`)}}Ft.getSchemaRefs=CM});var ta=$(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.getData=Vn.KeywordCxt=Vn.validateFunctionCode=void 0;var vS=Wk(),mS=Ys(),Zh=Ah(),ju=Ys(),TM=tS(),ea=sS(),Lh=cS(),N=Y(),F=fn(),AM=Qs(),hn=le(),Xs=Js();function RM(e){if(xS(e)&&(kS(e),bS(e))){DM(e);return}wS(e,()=>(0,vS.topBoolOrEmptySchema)(e))}Vn.validateFunctionCode=RM;function wS({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,N._)`${F.default.data}, ${F.default.valCxt}`,n.$async,()=>{e.code((0,N._)`"use strict"; ${gS(r,o)}`),zM(e,o),e.code(i)}):e.func(t,(0,N._)`${F.default.data}, ${IM(o)}`,n.$async,()=>e.code(gS(r,o)).code(i))}function IM(e){return(0,N._)`{${F.default.instancePath}="", ${F.default.parentData}, ${F.default.parentDataProperty}, ${F.default.rootData}=${F.default.data}${e.dynamicRef?(0,N._)`, ${F.default.dynamicAnchors}={}`:N.nil}}={}`}function zM(e,t){e.if(F.default.valCxt,()=>{e.var(F.default.instancePath,(0,N._)`${F.default.valCxt}.${F.default.instancePath}`),e.var(F.default.parentData,(0,N._)`${F.default.valCxt}.${F.default.parentData}`),e.var(F.default.parentDataProperty,(0,N._)`${F.default.valCxt}.${F.default.parentDataProperty}`),e.var(F.default.rootData,(0,N._)`${F.default.valCxt}.${F.default.rootData}`),t.dynamicRef&&e.var(F.default.dynamicAnchors,(0,N._)`${F.default.valCxt}.${F.default.dynamicAnchors}`)},()=>{e.var(F.default.instancePath,(0,N._)`""`),e.var(F.default.parentData,(0,N._)`undefined`),e.var(F.default.parentDataProperty,(0,N._)`undefined`),e.var(F.default.rootData,F.default.data),t.dynamicRef&&e.var(F.default.dynamicAnchors,(0,N._)`{}`)})}function DM(e){let{schema:t,opts:r,gen:n}=e;wS(e,()=>{r.$comment&&t.$comment&&$S(e),LM(e),n.let(F.default.vErrors,null),n.let(F.default.errors,0),r.unevaluated&&OM(e),SS(e),qM(e)})}function OM(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,N._)`${r}.evaluated`),t.if((0,N._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,N._)`${e.evaluated}.props`,(0,N._)`undefined`)),t.if((0,N._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,N._)`${e.evaluated}.items`,(0,N._)`undefined`))}function gS(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,N._)`/*# sourceURL=${r} */`:N.nil}function NM(e,t){if(xS(e)&&(kS(e),bS(e))){jM(e,t);return}(0,vS.boolOrEmptySchema)(e,t)}function bS({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 xS(e){return typeof e.schema!="boolean"}function jM(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&$S(e),ZM(e),UM(e);let i=n.const("_errs",F.default.errors);SS(e,i),n.var(t,(0,N._)`${i} === ${F.default.errors}`)}function kS(e){(0,hn.checkUnknownRules)(e),MM(e)}function SS(e,t){if(e.opts.jtd)return yS(e,[],!1,t);let r=(0,mS.getSchemaTypes)(e.schema),n=(0,mS.coerceAndCheckDataType)(e,r);yS(e,r,!n,t)}function MM(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,hn.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function LM(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,hn.checkStrictMode)(e,"default is ignored in the schema root")}function ZM(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,AM.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function UM(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function $S({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,N._)`${F.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=(0,N.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,N._)`${F.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function qM(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,N._)`${F.default.errors} === 0`,()=>t.return(F.default.data),()=>t.throw((0,N._)`new ${o}(${F.default.vErrors})`)):(t.assign((0,N._)`${n}.errors`,F.default.vErrors),i.unevaluated&&FM(e),t.return((0,N._)`${F.default.errors} === 0`))}function FM({gen:e,evaluated:t,props:r,items:n}){r instanceof N.Name&&e.assign((0,N._)`${t}.props`,r),n instanceof N.Name&&e.assign((0,N._)`${t}.items`,n)}function yS(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,hn.schemaHasRulesButRef)(i,p))){o.block(()=>ES(e,"$ref",p.all.$ref.definition));return}c.jtd||GM(e,t),o.block(()=>{for(let d of p.rules)l(d);l(p.post)});function l(d){(0,Zh.shouldUseGroup)(i,d)&&(d.type?(o.if((0,ju.checkDataType)(d.type,s,c.strictNumbers)),_S(e,d),t.length===1&&t[0]===d.type&&r&&(o.else(),(0,ju.reportTypeError)(e)),o.endIf()):_S(e,d),a||o.if((0,N._)`${F.default.errors} === ${n||0}`))}}function _S(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,TM.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,Zh.shouldUseRule)(n,i)&&ES(e,i.keyword,i.definition,t.type)})}function GM(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(VM(e,t),e.opts.allowUnionTypes||BM(e,t),HM(e,e.dataTypes))}function VM(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{PS(e.dataTypes,r)||Uh(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),KM(e,t)}}function BM(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Uh(e,"use allowUnionTypes to allow union type keyword")}function HM(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Zh.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>WM(t,s))&&Uh(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function WM(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function PS(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function KM(e,t){let r=[];for(let n of e.dataTypes)PS(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Uh(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,hn.checkStrictMode)(e,t,e.opts.strictTypes)}var Mu=class{constructor(t,r,n){if((0,ea.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,hn.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",CS(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,ea.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",F.default.errors))}result(t,r,n){this.failResult((0,N.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,N.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,N._)`${r} !== undefined && (${(0,N.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?Xs.reportExtraError:Xs.reportError)(this,this.def.error,r)}$dataError(){(0,Xs.reportError)(this,this.def.$dataError||Xs.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Xs.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=N.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=N.nil,r=N.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,N.or)((0,N._)`${o} === undefined`,r)),t!==N.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==N.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,N.or)(s(),a());function s(){if(n.length){if(!(r instanceof N.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,N._)`${(0,ju.checkDataTypes)(c,r,i.opts.strictNumbers,ju.DataType.Wrong)}`}return N.nil}function a(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,N._)`!${c}(${r})`}return N.nil}}subschema(t,r){let n=(0,Lh.getSubschema)(this.it,t);(0,Lh.extendSubschemaData)(n,this.it,t),(0,Lh.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return NM(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=hn.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=hn.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,N.Name)),!0}};Vn.KeywordCxt=Mu;function ES(e,t,r,n){let o=new Mu(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,ea.funcKeywordCode)(o,r):"macro"in r?(0,ea.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,ea.funcKeywordCode)(o,r)}var JM=/^\/(?:[^~]|~0|~1)*$/,YM=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function CS(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return F.default.rootData;if(e[0]==="/"){if(!JM.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=F.default.rootData}else{let u=YM.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,N._)`${i}${(0,N.getProperty)((0,hn.unescapeJsonPointer)(u))}`,s=(0,N._)`${s} && ${i}`);return s;function c(u,p){return`Cannot access ${u} ${p} levels up, current level is ${t}`}}Vn.getData=CS});var Lu=$(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});var qh=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Fh.default=qh});var ra=$(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});var Gh=Qs(),Vh=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Gh.resolveUrl)(t,r,n),this.missingSchema=(0,Gh.normalizeId)((0,Gh.getFullPath)(t,this.missingRef))}};Bh.default=Vh});var Uu=$(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.resolveSchema=ur.getCompilingSchema=ur.resolveRef=ur.compileSchema=ur.SchemaEnv=void 0;var Sr=Y(),QM=Lu(),Lo=fn(),$r=Qs(),TS=le(),XM=ta(),zi=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,$r.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};ur.SchemaEnv=zi;function Wh(e){let t=AS.call(this,e);if(t)return t;let r=(0,$r.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new Sr.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:QM.default,code:(0,Sr._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");e.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:Lo.default.data,parentData:Lo.default.parentData,parentDataProperty:Lo.default.parentDataProperty,dataNames:[Lo.default.data],dataPathArr:[Sr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Sr.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Sr.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Sr._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(e),(0,XM.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let l=s.toString();p=`${s.scopeRefs(Lo.default.scope)}return ${l}`,this.opts.code.process&&(p=this.opts.code.process(p,e));let f=new Function(`${Lo.default.self}`,`${Lo.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 Sr.Name?void 0:h,items:g instanceof Sr.Name?void 0:g,dynamicProps:h instanceof Sr.Name,dynamicItems:g instanceof Sr.Name},f.source&&(f.source.evaluated=(0,Sr.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)}}ur.compileSchema=Wh;function eL(e,t,r){var n;r=(0,$r.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=nL.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 zi({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=tL.call(this,i)}ur.resolveRef=eL;function tL(e){return(0,$r.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Wh.call(this,e)}function AS(e){for(let t of this._compilations)if(rL(t,e))return t}ur.getCompilingSchema=AS;function rL(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function nL(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Zu.call(this,e,t)}function Zu(e,t){let r=this.opts.uriResolver.parse(t),n=(0,$r._getFullPath)(this.opts.uriResolver,r),o=(0,$r.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return Hh.call(this,r,e);let i=(0,$r.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=Zu.call(this,e,s);return typeof a?.schema!="object"?void 0:Hh.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||Wh.call(this,s),i===(0,$r.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,$r.resolveUrl)(this.opts.uriResolver,o,u)),new zi({schema:a,schemaId:c,root:e,baseId:o})}return Hh.call(this,r,s)}}ur.resolveSchema=Zu;var oL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Hh(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,TS.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!oL.has(a)&&u&&(t=(0,$r.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,TS.schemaHasRulesButRef)(r,this.RULES)){let a=(0,$r.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Zu.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new zi({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var RS=$((ZK,iL)=>{iL.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 Jh=$((UK,OS)=>{"use strict";var sL=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),zS=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 Kh(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 aL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function IS(e){return e.length=0,!0}function cL(e,t,r){if(e.length){let n=Kh(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function uL(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=cL;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=IS}else{o.push(u);continue}}return o.length&&(a===IS?r.zone=o.join(""):s?n.push(o.join("")):n.push(Kh(o))),r.address=n.join(""),r}function DS(e){if(lL(e,":")<2)return{host:e,isIPV6:!1};let t=uL(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 lL(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function pL(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 dL(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 fL(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!zS(r)){let n=DS(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}OS.exports={nonSimpleDomain:aL,recomposeAuthority:fL,normalizeComponentEncoding:dL,removeDotSegments:pL,isIPv4:zS,isUUID:sL,normalizeIPv6:DS,stringArrayToHexStripped:Kh}});var ZS=$((qK,LS)=>{"use strict";var{isUUID:hL}=Jh(),mL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,gL=["http","https","ws","wss","urn","urn:uuid"];function yL(e){return gL.indexOf(e)!==-1}function Yh(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 NS(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function jS(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 _L(e){return e.secure=Yh(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function vL(e){if((e.port===(Yh(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 wL(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(mL);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=Qh(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function bL(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=Qh(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 xL(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!hL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function kL(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var MS={scheme:"http",domainHost:!0,parse:NS,serialize:jS},SL={scheme:"https",domainHost:MS.domainHost,parse:NS,serialize:jS},qu={scheme:"ws",domainHost:!0,parse:_L,serialize:vL},$L={scheme:"wss",domainHost:qu.domainHost,parse:qu.parse,serialize:qu.serialize},PL={scheme:"urn",parse:wL,serialize:bL,skipNormalize:!0},EL={scheme:"urn:uuid",parse:xL,serialize:kL,skipNormalize:!0},Fu={http:MS,https:SL,ws:qu,wss:$L,urn:PL,"urn:uuid":EL};Object.setPrototypeOf(Fu,null);function Qh(e){return e&&(Fu[e]||Fu[e.toLowerCase()])||void 0}LS.exports={wsIsSecure:Yh,SCHEMES:Fu,isValidSchemeName:yL,getSchemeHandler:Qh}});var FS=$((FK,Vu)=>{"use strict";var{normalizeIPv6:CL,removeDotSegments:na,recomposeAuthority:TL,normalizeComponentEncoding:Gu,isIPv4:AL,nonSimpleDomain:RL}=Jh(),{SCHEMES:IL,getSchemeHandler:US}=ZS();function zL(e,t){return typeof e=="string"?e=qr(mn(e,t),t):typeof e=="object"&&(e=mn(qr(e,t),t)),e}function DL(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=qS(mn(e,n),mn(t,n),n,!0);return n.skipEscape=!0,qr(o,n)}function qS(e,t,r,n){let o={};return n||(e=mn(qr(e,r),r),t=mn(qr(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=na(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=na(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=na(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=na(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 OL(e,t,r){return typeof e=="string"?(e=unescape(e),e=qr(Gu(mn(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=qr(Gu(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=qr(Gu(mn(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=qr(Gu(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function qr(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=US(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=TL(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=na(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 NL=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function mn(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(NL);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(AL(n.host)===!1){let c=CL(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=US(r.scheme||n.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&n.host&&(r.domainHost||s&&s.domainHost)&&o===!1&&RL(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 Xh={SCHEMES:IL,normalize:zL,resolve:DL,resolveComponent:qS,equal:OL,serialize:qr,parse:mn};Vu.exports=Xh;Vu.exports.default=Xh;Vu.exports.fastUri=Xh});var VS=$(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});var GS=FS();GS.code='require("ajv/dist/runtime/uri").default';em.default=GS});var XS=$(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.CodeGen=lt.Name=lt.nil=lt.stringify=lt.str=lt._=lt.KeywordCxt=void 0;var jL=ta();Object.defineProperty(lt,"KeywordCxt",{enumerable:!0,get:function(){return jL.KeywordCxt}});var Di=Y();Object.defineProperty(lt,"_",{enumerable:!0,get:function(){return Di._}});Object.defineProperty(lt,"str",{enumerable:!0,get:function(){return Di.str}});Object.defineProperty(lt,"stringify",{enumerable:!0,get:function(){return Di.stringify}});Object.defineProperty(lt,"nil",{enumerable:!0,get:function(){return Di.nil}});Object.defineProperty(lt,"Name",{enumerable:!0,get:function(){return Di.Name}});Object.defineProperty(lt,"CodeGen",{enumerable:!0,get:function(){return Di.CodeGen}});var ML=Lu(),JS=ra(),LL=Th(),oa=Uu(),ZL=Y(),ia=Qs(),Bu=Ys(),rm=le(),BS=RS(),UL=VS(),YS=(e,t)=>new RegExp(e,t);YS.code="new RegExp";var qL=["removeAdditional","useDefaults","coerceTypes"],FL=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),GL={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."},VL={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},HS=200;function BL(e){var t,r,n,o,i,s,a,c,u,p,l,d,f,h,g,y,v,w,x,k,P,q,Z,qe,ve;let ie=e.strict,Fe=(t=e.code)===null||t===void 0?void 0:t.optimize,Ge=Fe===!0||Fe===void 0?1:Fe||0,$n=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:YS,oo=(o=e.uriResolver)!==null&&o!==void 0?o:UL.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:ie)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:ie)!==null&&c!==void 0?c:!0,strictTypes:(p=(u=e.strictTypes)!==null&&u!==void 0?u:ie)!==null&&p!==void 0?p:"log",strictTuples:(d=(l=e.strictTuples)!==null&&l!==void 0?l:ie)!==null&&d!==void 0?d:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:ie)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Ge,regExp:$n}:{optimize:Ge,regExp:$n},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:HS,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:HS,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:(x=e.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(k=e.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(P=e.addUsedSchema)!==null&&P!==void 0?P:!0,validateSchema:(q=e.validateSchema)!==null&&q!==void 0?q:!0,validateFormats:(Z=e.validateFormats)!==null&&Z!==void 0?Z:!0,unicodeRegExp:(qe=e.unicodeRegExp)!==null&&qe!==void 0?qe:!0,int32range:(ve=e.int32range)!==null&&ve!==void 0?ve:!0,uriResolver:oo}}var sa=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...BL(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new ZL.ValueScope({scope:{},prefixes:FL,es5:r,lines:n}),this.logger=QL(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,LL.getRules)(),WS.call(this,GL,t,"NOT SUPPORTED"),WS.call(this,VL,t,"DEPRECATED","warn"),this._metaOpts=JL.call(this),t.formats&&WL.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&KL.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),HL.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=BS;n==="id"&&(o={...BS},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 JS.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,ia.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=KS.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new oa.SchemaEnv({schema:{},schemaId:n});if(r=oa.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=KS.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,ia.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(e3.call(this,n,r),!r)return(0,rm.eachItem)(n,i=>tm.call(this,i)),this;r3.call(this,r);let o={...r,type:(0,Bu.getJSONTypes)(r.type),schemaType:(0,Bu.getJSONTypes)(r.schemaType)};return(0,rm.eachItem)(n,o.type.length===0?i=>tm.call(this,i,o):i=>o.type.forEach(s=>tm.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]=QS(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,ia.normalizeId)(s||n);let u=ia.getSchemaRefs.call(this,t,n);return c=new oa.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):oa.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{oa.compileSchema.call(this,t)}finally{this.opts=r}}};sa.ValidationError=ML.default;sa.MissingRefError=JS.default;lt.default=sa;function WS(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 KS(e){return e=(0,ia.normalizeId)(e),this.schemas[e]||this.refs[e]}function HL(){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 WL(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function KL(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 JL(){let e={...this.opts};for(let t of qL)delete e[t];return e}var YL={log(){},warn(){},error(){}};function QL(e){if(e===!1)return YL;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 XL=/^[a-z_$][a-z0-9_$:-]*$/i;function e3(e,t){let{RULES:r}=this;if((0,rm.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!XL.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 tm(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,Bu.getJSONTypes)(t.type),schemaType:(0,Bu.getJSONTypes)(t.schemaType)}};t.before?t3.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 t3(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 r3(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=QS(t)),e.validateSchema=this.compile(t,!0))}var n3={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function QS(e){return{anyOf:[e,n3]}}});var e$=$(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});var o3={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};nm.default=o3});var o$=$(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.callRef=Zo.getValidate=void 0;var i3=ra(),t$=cr(),Gt=Y(),Oi=fn(),r$=Uu(),Hu=le(),s3={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=r$.resolveRef.call(c,u,o,r);if(p===void 0)throw new i3.default(n.opts.uriResolver,o,r);if(p instanceof r$.SchemaEnv)return d(p);return f(p);function l(){if(i===u)return Wu(e,s,i,i.$async);let h=t.scopeValue("root",{ref:u});return Wu(e,(0,Gt._)`${h}.validate`,u,u.$async)}function d(h){let g=n$(e,h);Wu(e,g,h,h.$async)}function f(h){let g=t.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,Gt.stringify)(h)}:{ref:h}),y=t.name("valid"),v=e.subschema({schema:h,dataTypes:[],schemaPath:Gt.nil,topSchemaRef:g,errSchemaPath:r},y);e.mergeEvaluated(v),e.ok(y)}}};function n$(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Gt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Zo.getValidate=n$;function Wu(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?Oi.default.this:Gt.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,Gt._)`await ${(0,t$.callValidateCode)(e,t,u)}`),f(t),s||o.assign(h,!0)},g=>{o.if((0,Gt._)`!(${g} instanceof ${i.ValidationError})`,()=>o.throw(g)),d(g),s||o.assign(h,!1)}),e.ok(h)}function l(){e.result((0,t$.callValidateCode)(e,t,u),()=>f(t),()=>d(t))}function d(h){let g=(0,Gt._)`${h}.errors`;o.assign(Oi.default.vErrors,(0,Gt._)`${Oi.default.vErrors} === null ? ${g} : ${Oi.default.vErrors}.concat(${g})`),o.assign(Oi.default.errors,(0,Gt._)`${Oi.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=Hu.mergeEvaluated.props(o,y.props,i.props));else{let v=o.var("props",(0,Gt._)`${h}.evaluated.props`);i.props=Hu.mergeEvaluated.props(o,v,i.props,Gt.Name)}if(i.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(i.items=Hu.mergeEvaluated.items(o,y.items,i.items));else{let v=o.var("items",(0,Gt._)`${h}.evaluated.items`);i.items=Hu.mergeEvaluated.items(o,v,i.items,Gt.Name)}}}Zo.callRef=Wu;Zo.default=s3});var i$=$(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var a3=e$(),c3=o$(),u3=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",a3.default,c3.default];om.default=u3});var s$=$(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var Ku=Y(),Bn=Ku.operators,Ju={maximum:{okStr:"<=",ok:Bn.LTE,fail:Bn.GT},minimum:{okStr:">=",ok:Bn.GTE,fail:Bn.LT},exclusiveMaximum:{okStr:"<",ok:Bn.LT,fail:Bn.GTE},exclusiveMinimum:{okStr:">",ok:Bn.GT,fail:Bn.LTE}},l3={message:({keyword:e,schemaCode:t})=>(0,Ku.str)`must be ${Ju[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Ku._)`{comparison: ${Ju[e].okStr}, limit: ${t}}`},p3={keyword:Object.keys(Ju),type:"number",schemaType:"number",$data:!0,error:l3,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Ku._)`${r} ${Ju[t].fail} ${n} || isNaN(${r})`)}};im.default=p3});var a$=$(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});var aa=Y(),d3={message:({schemaCode:e})=>(0,aa.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,aa._)`{multipleOf: ${e}}`},f3={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:d3,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,aa._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,aa._)`${s} !== parseInt(${s})`;e.fail$data((0,aa._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};sm.default=f3});var u$=$(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});function c$(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}am.default=c$;c$.code='require("ajv/dist/runtime/ucs2length").default'});var l$=$(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var Uo=Y(),h3=le(),m3=u$(),g3={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Uo.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Uo._)`{limit: ${e}}`},y3={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:g3,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?Uo.operators.GT:Uo.operators.LT,s=o.opts.unicode===!1?(0,Uo._)`${r}.length`:(0,Uo._)`${(0,h3.useFunc)(e.gen,m3.default)}(${r})`;e.fail$data((0,Uo._)`${s} ${i} ${n}`)}};cm.default=y3});var p$=$(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var _3=cr(),Yu=Y(),v3={message:({schemaCode:e})=>(0,Yu.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Yu._)`{pattern: ${e}}`},w3={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:v3,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,s=i.opts.unicodeRegExp?"u":"",a=r?(0,Yu._)`(new RegExp(${o}, ${s}))`:(0,_3.usePattern)(e,n);e.fail$data((0,Yu._)`!${a}.test(${t})`)}};um.default=w3});var d$=$(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var ca=Y(),b3={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,ca.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,ca._)`{limit: ${e}}`},x3={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:b3,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?ca.operators.GT:ca.operators.LT;e.fail$data((0,ca._)`Object.keys(${r}).length ${o} ${n}`)}};lm.default=x3});var f$=$(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});var ua=cr(),la=Y(),k3=le(),S3={message:({params:{missingProperty:e}})=>(0,la.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,la._)`{missingProperty: ${e}}`},$3={keyword:"required",type:"object",schemaType:"array",$data:!0,error:S3,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,v=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,k3.checkStrictMode)(s,v,s.opts.strictRequired)}}function u(){if(c||i)e.block$data(la.nil,l);else for(let f of r)(0,ua.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,ua.checkMissingProp)(e,r,f)),(0,ua.reportMissingProp)(e,f),t.else()}function l(){t.forOf("prop",n,f=>{e.setParams({missingProperty:f}),t.if((0,ua.noPropertyInData)(t,o,f,a.ownProperties),()=>e.error())})}function d(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,(0,ua.propertyInData)(t,o,f,a.ownProperties)),t.if((0,la.not)(h),()=>{e.error(),t.break()})},la.nil)}}};pm.default=$3});var h$=$(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});var pa=Y(),P3={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,pa.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,pa._)`{limit: ${e}}`},E3={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:P3,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?pa.operators.GT:pa.operators.LT;e.fail$data((0,pa._)`${r}.length ${o} ${n}`)}};dm.default=E3});var Qu=$(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});var m$=jh();m$.code='require("ajv/dist/runtime/equal").default';fm.default=m$});var g$=$(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});var hm=Ys(),pt=Y(),C3=le(),T3=Qu(),A3={message:({params:{i:e,j:t}})=>(0,pt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,pt._)`{i: ${e}, j: ${t}}`},R3={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:A3,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,hm.getSchemaTypes)(i.items):[];e.block$data(c,p,(0,pt._)`${s} === false`),e.ok(c);function p(){let h=t.let("i",(0,pt._)`${r}.length`),g=t.let("j");e.setParams({i:h,j:g}),t.assign(c,!0),t.if((0,pt._)`${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"),v=(0,hm.checkDataTypes)(u,y,a.opts.strictNumbers,hm.DataType.Wrong),w=t.const("indices",(0,pt._)`{}`);t.for((0,pt._)`;${h}--;`,()=>{t.let(y,(0,pt._)`${r}[${h}]`),t.if(v,(0,pt._)`continue`),u.length>1&&t.if((0,pt._)`typeof ${y} == "string"`,(0,pt._)`${y} += "_"`),t.if((0,pt._)`typeof ${w}[${y}] == "number"`,()=>{t.assign(g,(0,pt._)`${w}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,pt._)`${w}[${y}] = ${h}`)})}function f(h,g){let y=(0,C3.useFunc)(t,T3.default),v=t.name("outer");t.label(v).for((0,pt._)`;${h}--;`,()=>t.for((0,pt._)`${g} = ${h}; ${g}--;`,()=>t.if((0,pt._)`${y}(${r}[${h}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};mm.default=R3});var y$=$(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});var gm=Y(),I3=le(),z3=Qu(),D3={message:"must be equal to constant",params:({schemaCode:e})=>(0,gm._)`{allowedValue: ${e}}`},O3={keyword:"const",$data:!0,error:D3,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,gm._)`!${(0,I3.useFunc)(t,z3.default)}(${r}, ${o})`):e.fail((0,gm._)`${i} !== ${r}`)}};ym.default=O3});var _$=$(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});var da=Y(),N3=le(),j3=Qu(),M3={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,da._)`{allowedValues: ${e}}`},L3={keyword:"enum",schemaType:"array",$data:!0,error:M3,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,N3.useFunc)(t,j3.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,da.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,da._)`${u()}(${r}, ${f})`,()=>t.assign(p,!0).break()))}function d(f,h){let g=o[h];return typeof g=="object"&&g!==null?(0,da._)`${u()}(${r}, ${f}[${h}])`:(0,da._)`${r} === ${g}`}}};_m.default=L3});var v$=$(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});var Z3=s$(),U3=a$(),q3=l$(),F3=p$(),G3=d$(),V3=f$(),B3=h$(),H3=g$(),W3=y$(),K3=_$(),J3=[Z3.default,U3.default,q3.default,F3.default,G3.default,V3.default,B3.default,H3.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},W3.default,K3.default];vm.default=J3});var bm=$(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.validateAdditionalItems=void 0;var qo=Y(),wm=le(),Y3={message:({params:{len:e}})=>(0,qo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,qo._)`{limit: ${e}}`},Q3={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Y3,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,wm.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}w$(e,n)}};function w$(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,qo._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,qo._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,wm.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,qo._)`${a} <= ${t.length}`);r.if((0,qo.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,p=>{e.subschema({keyword:i,dataProp:p,dataPropType:wm.Type.Num},u),s.allErrors||r.if((0,qo.not)(u),()=>r.break())})}}fa.validateAdditionalItems=w$;fa.default=Q3});var xm=$(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.validateTuple=void 0;var b$=Y(),Xu=le(),X3=cr(),e5={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return x$(e,"additionalItems",t);r.items=!0,!(0,Xu.alwaysValidSchema)(r,t)&&e.ok((0,X3.validateArray)(e))}};function x$(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=Xu.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,b$._)`${i}.length`);r.forEach((l,d)=>{(0,Xu.alwaysValidSchema)(a,l)||(n.if((0,b$._)`${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,Xu.checkStrictMode)(a,y,d.strictTuples)}}}ha.validateTuple=x$;ha.default=e5});var k$=$(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});var t5=xm(),r5={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,t5.validateTuple)(e,"items")};km.default=r5});var $$=$(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});var S$=Y(),n5=le(),o5=cr(),i5=bm(),s5={message:({params:{len:e}})=>(0,S$.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,S$._)`{limit: ${e}}`},a5={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:s5,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,n5.alwaysValidSchema)(n,t)&&(o?(0,i5.validateAdditionalItems)(e,o):e.ok((0,o5.validateArray)(e)))}};Sm.default=a5});var P$=$($m=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});var lr=Y(),el=le(),c5={message:({params:{min:e,max:t}})=>t===void 0?(0,lr.str)`must contain at least ${e} valid item(s)`:(0,lr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,lr._)`{minContains: ${e}}`:(0,lr._)`{minContains: ${e}, maxContains: ${t}}`},u5={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:c5,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,lr._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,el.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,el.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,el.alwaysValidSchema)(i,r)){let g=(0,lr._)`${p} >= ${s}`;a!==void 0&&(g=(0,lr._)`${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,lr._)`${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,v=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:el.Type.Num,compositeRule:!0},g),y()})}function h(g){t.code((0,lr._)`${g}++`),a===void 0?t.if((0,lr._)`${g} >= ${s}`,()=>t.assign(l,!0).break()):(t.if((0,lr._)`${g} > ${a}`,()=>t.assign(l,!1).break()),s===1?t.assign(l,!0):t.if((0,lr._)`${g} >= ${s}`,()=>t.assign(l,!0)))}}};$m.default=u5});var T$=$(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.validateSchemaDeps=Fr.validatePropertyDeps=Fr.error=void 0;var Pm=Y(),l5=le(),ma=cr();Fr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Pm.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Pm._)`{property: ${e},
|
|
77
77
|
missingProperty: ${n},
|
|
78
78
|
depsCount: ${t},
|
|
79
|
-
deps: ${r}}`};var _5={keyword:"dependencies",type:"object",schemaType:"object",error:Gr.error,code(e){let[t,r]=y5(e);P$(e,t),E$(e,r)}};function y5({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 P$(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,ga.propertyInData)(r,n,s,o.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let l of a)(0,ga.checkReportMissingProp)(e,l)}):(r.if((0,$m._)`${c} && (${(0,ga.checkMissingProp)(e,a,i)})`),(0,ga.reportMissingProp)(e,i),r.else())}}Gr.validatePropertyDeps=P$;function E$(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,g5.alwaysValidSchema)(i,t[a])||(r.if((0,ga.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=E$;Gr.default=_5});var R$=$(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});var T$=Y(),v5=ue(),w5={message:"property name must be valid",params:({params:e})=>(0,T$._)`{propertyName: ${e.propertyName}}`},b5={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:w5,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,v5.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,T$.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};Pm.default=b5});var Cm=$(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});var ru=cr(),Er=Y(),x5=hn(),nu=ue(),k5={message:"must NOT have additional properties",params:({params:e})=>(0,Er._)`{additionalProperty: ${e.additionalProperty}}`},S5={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:k5,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,nu.alwaysValidSchema)(s,r))return;let l=(0,ru.allSchemaProperties)(n.properties),p=(0,ru.allSchemaProperties)(n.patternProperties);u(),e.ok((0,Er._)`${i} === ${x5.default.errors}`);function u(){t.forIn("key",o,_=>{!l.length&&!p.length?m(_):t.if(d(_),()=>m(_))})}function d(_){let v;if(l.length>8){let w=(0,nu.schemaRefOrVal)(s,n.properties,"properties");v=(0,ru.isOwnProperty)(t,w,_)}else l.length?v=(0,Er.or)(...l.map(w=>(0,Er._)`${_} === ${w}`)):v=Er.nil;return p.length&&(v=(0,Er.or)(v,...p.map(w=>(0,Er._)`${(0,ru.usePattern)(e,w)}.test(${_})`))),(0,Er.not)(v)}function h(_){t.code((0,Er._)`delete ${o}[${_}]`)}function m(_){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){h(_);return}if(r===!1){e.setParams({additionalProperty:_}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,nu.alwaysValidSchema)(s,r)){let v=t.name("valid");c.removeAdditional==="failing"?(g(_,v,!1),t.if((0,Er.not)(v),()=>{e.reset(),h(_)})):(g(_,v),a||t.if((0,Er.not)(v),()=>t.break()))}}function g(_,v,w){let x={keyword:"additionalProperties",dataProp:_,dataPropType:nu.Type.Str};w===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,v)}}};Em.default=S5});var z$=$(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});var $5=ra(),A$=cr(),Tm=ue(),I$=Cm(),P5={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&&I$.default.code(new $5.KeywordCxt(i,I$.default,"additionalProperties"));let s=(0,A$.allSchemaProperties)(r);for(let u of s)i.definedProperties.add(u);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Tm.mergeEvaluated.props(t,(0,Tm.toHash)(s),i.props));let a=s.filter(u=>!(0,Tm.alwaysValidSchema)(i,r[u]));if(a.length===0)return;let c=t.name("valid");for(let u of a)l(u)?p(u):(t.if((0,A$.propertyInData)(t,o,u,i.opts.ownProperties)),p(u),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(u),e.ok(c);function l(u){return i.opts.useDefaults&&!i.compositeRule&&r[u].default!==void 0}function p(u){e.subschema({keyword:"properties",schemaProp:u,dataProp:u},c)}}};Rm.default=P5});var j$=$(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});var D$=cr(),ou=Y(),O$=ue(),N$=ue(),E5={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,D$.allSchemaProperties)(r),c=a.filter(g=>(0,O$.alwaysValidSchema)(i,r[g]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&o.properties,p=t.name("valid");i.props!==!0&&!(i.props instanceof ou.Name)&&(i.props=(0,N$.evaluatedPropsToName)(t,i.props));let{props:u}=i;d();function d(){for(let g of a)l&&h(g),i.allErrors?m(g):(t.var(p,!0),m(g),t.if(p))}function h(g){for(let _ in l)new RegExp(g).test(_)&&(0,O$.checkStrictMode)(i,`property ${_} matches pattern ${g} (use allowMatchingProperties)`)}function m(g){t.forIn("key",n,_=>{t.if((0,ou._)`${(0,D$.usePattern)(e,g)}.test(${_})`,()=>{let v=c.includes(g);v||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:_,dataPropType:N$.Type.Str},p),i.opts.unevaluated&&u!==!0?t.assign((0,ou._)`${u}[${_}]`,!0):!v&&!i.allErrors&&t.if((0,ou.not)(p),()=>t.break())})})}}};Am.default=E5});var M$=$(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});var C5=ue(),T5={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,C5.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"}};Im.default=T5});var L$=$(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});var R5=cr(),A5={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:R5.validateUnion,error:{message:"must match a schema in anyOf"}};zm.default=A5});var Z$=$(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});var iu=Y(),I5=ue(),z5={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,iu._)`{passingSchemas: ${e.passing}}`},D5={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:z5,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(l),e.result(s,()=>e.reset(),()=>e.error(!0));function l(){i.forEach((p,u)=>{let d;(0,I5.alwaysValidSchema)(o,p)?t.var(c,!0):d=e.subschema({keyword:"oneOf",schemaProp:u,compositeRule:!0},c),u>0&&t.if((0,iu._)`${c} && ${s}`).assign(s,!1).assign(a,(0,iu._)`[${a}, ${u}]`).else(),t.if(c,()=>{t.assign(s,!0),t.assign(a,u),d&&e.mergeEvaluated(d,iu.Name)})})}}};Dm.default=D5});var U$=$(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});var O5=ue(),N5={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,O5.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};Om.default=N5});var G$=$(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});var su=Y(),F$=ue(),j5={message:({params:e})=>(0,su.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,su._)`{failingKeyword: ${e.ifClause}}`},M5={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:j5,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,F$.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=q$(n,"then"),i=q$(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,l("then",p),l("else",p))}else o?t.if(a,l("then")):t.if((0,su.not)(a),l("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 l(p,u){return()=>{let d=e.subschema({keyword:p},a);t.assign(s,a),e.mergeValidEvaluated(d,s),u?t.assign(u,(0,su._)`${p}`):e.setParams({ifClause:p})}}}};function q$(e,t){let r=e.schema[t];return r!==void 0&&!(0,F$.alwaysValidSchema)(e,r)}Nm.default=M5});var V$=$(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});var L5=ue(),Z5={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,L5.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};jm.default=Z5});var B$=$(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var U5=wm(),q5=x$(),F5=bm(),G5=S$(),V5=$$(),B5=C$(),H5=R$(),K5=Cm(),W5=z$(),J5=j$(),Y5=M$(),Q5=L$(),X5=Z$(),e9=U$(),t9=G$(),r9=V$();function n9(e=!1){let t=[Y5.default,Q5.default,X5.default,e9.default,t9.default,r9.default,H5.default,K5.default,B5.default,W5.default,J5.default];return e?t.push(q5.default,G5.default):t.push(U5.default,F5.default),t.push(V5.default),t}Mm.default=n9});var H$=$(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});var Ze=Y(),o9={message:({schemaCode:e})=>(0,Ze.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Ze._)`{format: ${e}}`},i9={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:o9,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:c,errSchemaPath:l,schemaEnv:p,self:u}=a;if(!c.validateFormats)return;o?d():h();function d(){let m=r.scopeValue("formats",{ref:u.formats,code:c.code.formats}),g=r.const("fDef",(0,Ze._)`${m}[${s}]`),_=r.let("fType"),v=r.let("format");r.if((0,Ze._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(_,(0,Ze._)`${g}.type || "string"`).assign(v,(0,Ze._)`${g}.validate`),()=>r.assign(_,(0,Ze._)`"string"`).assign(v,g)),e.fail$data((0,Ze.or)(w(),x()));function w(){return c.strictSchema===!1?Ze.nil:(0,Ze._)`${s} && !${v}`}function x(){let k=p.$async?(0,Ze._)`(${g}.async ? await ${v}(${n}) : ${v}(${n}))`:(0,Ze._)`${v}(${n})`,P=(0,Ze._)`(typeof ${v} == "function" ? ${k} : ${v}.test(${n}))`;return(0,Ze._)`${v} && ${v} !== true && ${_} === ${t} && !${P}`}}function h(){let m=u.formats[i];if(!m){w();return}if(m===!0)return;let[g,_,v]=x(m);g===t&&e.pass(k());function w(){if(c.strictSchema===!1){u.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function x(P){let q=P instanceof RegExp?(0,Ze.regexpCode)(P):c.code.formats?(0,Ze._)`${c.code.formats}${(0,Ze.getProperty)(i)}`:void 0,Z=r.scopeValue("formats",{key:i,ref:P,code:q});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,Ze._)`${Z}.validate`]:["string",P,Z]}function k(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Ze._)`await ${v}(${n})`}return typeof _=="function"?(0,Ze._)`${v}(${n})`:(0,Ze._)`${v}.test(${n})`}}}};Lm.default=i9});var K$=$(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});var s9=H$(),a9=[s9.default];Zm.default=a9});var W$=$(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.contentVocabulary=ji.metadataVocabulary=void 0;ji.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ji.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Y$=$(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});var c9=o$(),l9=y$(),u9=B$(),p9=K$(),J$=W$(),d9=[c9.default,l9.default,(0,u9.default)(),p9.default,J$.metadataVocabulary,J$.contentVocabulary];Um.default=d9});var X$=$(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.DiscrError=void 0;var Q$;(function(e){e.Tag="tag",e.Mapping="mapping"})(Q$||(au.DiscrError=Q$={}))});var t1=$(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});var Mi=Y(),qm=X$(),e1=ql(),f9=na(),h9=ue(),m9={message:({params:{discrError:e,tagName:t}})=>e===qm.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Mi._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},g9={keyword:"discriminator",type:"object",schemaType:"object",error:m9,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),l=t.const("tag",(0,Mi._)`${r}${(0,Mi.getProperty)(a)}`);t.if((0,Mi._)`typeof ${l} == "string"`,()=>p(),()=>e.error(!1,{discrError:qm.DiscrError.Tag,tag:l,tagName:a})),e.ok(c);function p(){let h=d();t.if(!1);for(let m in h)t.elseIf((0,Mi._)`${l} === ${m}`),t.assign(c,u(h[m]));t.else(),e.error(!1,{discrError:qm.DiscrError.Mapping,tag:l,tagName:a}),t.endIf()}function u(h){let m=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:h},m);return e.mergeEvaluated(g,Mi.Name),m}function d(){var h;let m={},g=v(o),_=!0;for(let k=0;k<s.length;k++){let P=s[k];if(P?.$ref&&!(0,h9.schemaHasRulesButRef)(P,i.self.RULES)){let Z=P.$ref;if(P=e1.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,Z),P instanceof e1.SchemaEnv&&(P=P.schema),P===void 0)throw new f9.default(i.opts.uriResolver,i.baseId,Z)}let q=(h=P?.properties)===null||h===void 0?void 0:h[a];if(typeof q!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);_=_&&(g||v(P)),w(q,k)}if(!_)throw new Error(`discriminator: "${a}" must be required`);return m;function v({required:k}){return Array.isArray(k)&&k.includes(a)}function w(k,P){if(k.const)x(k.const,P);else if(k.enum)for(let q of k.enum)x(q,P);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(k,P){if(typeof k!="string"||k in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[k]=P}}}};Fm.default=g9});var r1=$((ZJ,_9)=>{_9.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 Vm=$((Te,Gm)=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.MissingRefError=Te.ValidationError=Te.CodeGen=Te.Name=Te.nil=Te.stringify=Te.str=Te._=Te.KeywordCxt=Te.Ajv=void 0;var y9=QS(),v9=Y$(),w9=t1(),n1=r1(),b9=["/properties"],cu="http://json-schema.org/draft-07/schema",Li=class extends y9.default{_addVocabularies(){super._addVocabularies(),v9.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(w9.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(n1,b9):n1;this.addMetaSchema(t,cu,!1),this.refs["http://json-schema.org/schema"]=cu}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(cu)?cu:void 0)}};Te.Ajv=Li;Gm.exports=Te=Li;Gm.exports.Ajv=Li;Object.defineProperty(Te,"__esModule",{value:!0});Te.default=Li;var x9=ra();Object.defineProperty(Te,"KeywordCxt",{enumerable:!0,get:function(){return x9.KeywordCxt}});var Zi=Y();Object.defineProperty(Te,"_",{enumerable:!0,get:function(){return Zi._}});Object.defineProperty(Te,"str",{enumerable:!0,get:function(){return Zi.str}});Object.defineProperty(Te,"stringify",{enumerable:!0,get:function(){return Zi.stringify}});Object.defineProperty(Te,"nil",{enumerable:!0,get:function(){return Zi.nil}});Object.defineProperty(Te,"Name",{enumerable:!0,get:function(){return Zi.Name}});Object.defineProperty(Te,"CodeGen",{enumerable:!0,get:function(){return Zi.CodeGen}});var k9=Zl();Object.defineProperty(Te,"ValidationError",{enumerable:!0,get:function(){return k9.default}});var S9=na();Object.defineProperty(Te,"MissingRefError",{enumerable:!0,get:function(){return S9.default}})});var p1=$(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.formatNames=Br.fastFormats=Br.fullFormats=void 0;function Vr(e,t){return{validate:e,compare:t}}Br.fullFormats={date:Vr(a1,Wm),time:Vr(Hm(!0),Jm),"date-time":Vr(o1(!0),l1),"iso-time":Vr(Hm(),c1),"iso-date-time":Vr(o1(),u1),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:R9,"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:j9,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:A9,int32:{type:"number",validate:D9},int64:{type:"number",validate:O9},float:{type:"number",validate:s1},double:{type:"number",validate:s1},password:!0,binary:!0};Br.fastFormats={...Br.fullFormats,date:Vr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Wm),time:Vr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Jm),"date-time":Vr(/^\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,l1),"iso-time":Vr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c1),"iso-date-time":Vr(/^\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,u1),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};Br.formatNames=Object.keys(Br.fullFormats);function $9(e){return e%4===0&&(e%100!==0||e%400===0)}var P9=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,E9=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a1(e){let t=P9.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&&$9(r)?29:E9[n])}function Wm(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Bm=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Hm(e){return function(r){let n=Bm.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,l=+(n[6]||0),p=+(n[7]||0);if(l>23||p>59||e&&!a)return!1;if(o<=23&&i<=59&&s<60)return!0;let u=i-p*c,d=o-l*c-(u<0?1:0);return(d===23||d===-1)&&(u===59||u===-1)&&s<61}}function Jm(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 c1(e,t){if(!(e&&t))return;let r=Bm.exec(e),n=Bm.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 Km=/t|\s/i;function o1(e){let t=Hm(e);return function(n){let o=n.split(Km);return o.length===2&&a1(o[0])&&t(o[1])}}function l1(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function u1(e,t){if(!(e&&t))return;let[r,n]=e.split(Km),[o,i]=t.split(Km),s=Wm(r,o);if(s!==void 0)return s||Jm(n,i)}var C9=/\/|:/,T9=/^(?:[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 R9(e){return C9.test(e)&&T9.test(e)}var i1=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function A9(e){return i1.lastIndex=0,i1.test(e)}var I9=-(2**31),z9=2**31-1;function D9(e){return Number.isInteger(e)&&e<=z9&&e>=I9}function O9(e){return Number.isInteger(e)}function s1(){return!0}var N9=/[^\\]\\Z/;function j9(e){if(N9.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var d1=$(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.formatLimitDefinition=void 0;var M9=Vm(),Cr=Y(),Kn=Cr.operators,lu={formatMaximum:{okStr:"<=",ok:Kn.LTE,fail:Kn.GT},formatMinimum:{okStr:">=",ok:Kn.GTE,fail:Kn.LT},formatExclusiveMaximum:{okStr:"<",ok:Kn.LT,fail:Kn.GTE},formatExclusiveMinimum:{okStr:">",ok:Kn.GT,fail:Kn.LTE}},L9={message:({keyword:e,schemaCode:t})=>(0,Cr.str)`should be ${lu[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Cr._)`{comparison: ${lu[e].okStr}, limit: ${t}}`};Ui.formatLimitDefinition={keyword:Object.keys(lu),type:"string",schemaType:"string",$data:!0,error:L9,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 M9.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?l():p();function l(){let d=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),h=t.const("fmt",(0,Cr._)`${d}[${c.schemaCode}]`);e.fail$data((0,Cr.or)((0,Cr._)`typeof ${h} != "object"`,(0,Cr._)`${h} instanceof RegExp`,(0,Cr._)`typeof ${h}.compare != "function"`,u(h)))}function p(){let d=c.schema,h=a.formats[d];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${o}": format "${d}" does not define "compare" function`);let m=t.scopeValue("formats",{key:d,ref:h,code:s.code.formats?(0,Cr._)`${s.code.formats}${(0,Cr.getProperty)(d)}`:void 0});e.fail$data(u(m))}function u(d){return(0,Cr._)`${d}.compare(${r}, ${n}) ${lu[o].fail} 0`}},dependencies:["format"]};var Z9=e=>(e.addKeyword(Ui.formatLimitDefinition),e);Ui.default=Z9});var g1=$((_a,m1)=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var qi=p1(),U9=d1(),Ym=Y(),f1=new Ym.Name("fullFormats"),q9=new Ym.Name("fastFormats"),Qm=(e,t={keywords:!0})=>{if(Array.isArray(t))return h1(e,t,qi.fullFormats,f1),e;let[r,n]=t.mode==="fast"?[qi.fastFormats,q9]:[qi.fullFormats,f1],o=t.formats||qi.formatNames;return h1(e,o,r,n),t.keywords&&(0,U9.default)(e),e};Qm.get=(e,t="full")=>{let n=(t==="fast"?qi.fastFormats:qi.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function h1(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,Ym._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}m1.exports=_a=Qm;Object.defineProperty(_a,"__esModule",{value:!0});_a.default=Qm});function F9(){let e=new _1.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,y1.default)(e),e}var _1,y1,Fi,Xm=b(()=>{_1=mt(Vm(),1),y1=mt(g1(),1);Fi=class{constructor(t){this._ajv=t??F9()}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 uu,v1=b(()=>{uu=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 w1(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 b1(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 x1=b(()=>{});var pu,k1=b(()=>{Ak();Tn();Xm();gl();v1();x1();pu=class extends El{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(As.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 Fi,this.setRequestHandler(Nd,n=>this._oninitialize(n)),this.setNotificationHandler(Mc,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Kd,async(n,o)=>{let i=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=As.safeParse(s);return a.success&&this._loggingLevels.set(i,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new uu(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Rk(this._capabilities,t)}setRequestHandler(t,r){let o=ml(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i;if(zo(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,l)=>{let p=Mn(Rs,c);if(!p.success){let m=p.error instanceof Error?p.error.message:String(p.error);throw new B(X.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:u}=p.data,d=await Promise.resolve(r(c,l));if(u.task){let m=Mn(ui,d);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new B(X.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=Mn(Hc,d);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new B(X.InvalidParams,`Invalid tools/call result: ${m}`)}return h.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){b1(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&w1(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:Bb.includes(r)?r:ci,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"},Nc)}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(l=>l.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(l=>l.type==="tool_use");if(i){if(o.some(l=>l.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 l=new Set(a.filter(u=>u.type==="tool_use").map(u=>u.id)),p=new Set(o.filter(u=>u.type==="tool_result").map(u=>u.toolUseId));if(l.size!==p.size||![...l].every(u=>p.has(u)))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},Jd,r):this.request({method:"sampling/createMessage",params:t},Wd,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},Kc,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},Kc,r);if(i.action==="accept"&&i.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(i.content);if(!a.valid)throw new B(X.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof B?s:new B(X.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},Yd,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 G9(){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${Kt} \u306E\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return e}function V9(e){let t;try{t=vr.load(e)}catch{return e}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="****"),vr.dump(r,{lineWidth:-1,quotingType:'"'})}return e}function $1(e){if(!(0,Wt.existsSync)(e))return{};let t={};try{let r=(0,Wt.readFileSync)(e,"utf-8");for(let n of r.split(`
|
|
80
|
-
`)){let o=n.trim();if(!o||o.startsWith("#"))continue;let i=o.indexOf("=");if(i===-1)continue;let s=o.slice(0,i).trim();if(
|
|
81
|
-
`)){let
|
|
82
|
-
`);(0,Wt.writeFileSync)(e,s,"utf-8")}function
|
|
83
|
-
`];if((0,Wt.existsSync)(t))try{let c=(0,Wt.readFileSync)(t,"utf-8");s.push(`### ${
|
|
79
|
+
deps: ${r}}`};var p5={keyword:"dependencies",type:"object",schemaType:"object",error:Fr.error,code(e){let[t,r]=d5(e);E$(e,t),C$(e,r)}};function d5({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 E$(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,ma.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,ma.checkReportMissingProp)(e,u)}):(r.if((0,Pm._)`${c} && (${(0,ma.checkMissingProp)(e,a,i)})`),(0,ma.reportMissingProp)(e,i),r.else())}}Fr.validatePropertyDeps=E$;function C$(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,l5.alwaysValidSchema)(i,t[a])||(r.if((0,ma.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))}Fr.validateSchemaDeps=C$;Fr.default=p5});var R$=$(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});var A$=Y(),f5=le(),h5={message:"property name must be valid",params:({params:e})=>(0,A$._)`{propertyName: ${e.propertyName}}`},m5={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:h5,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,f5.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,A$.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};Em.default=m5});var Tm=$(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});var tl=cr(),Pr=Y(),g5=fn(),rl=le(),y5={message:"must NOT have additional properties",params:({params:e})=>(0,Pr._)`{additionalProperty: ${e.additionalProperty}}`},_5={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:y5,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,rl.alwaysValidSchema)(s,r))return;let u=(0,tl.allSchemaProperties)(n.properties),p=(0,tl.allSchemaProperties)(n.patternProperties);l(),e.ok((0,Pr._)`${i} === ${g5.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 v;if(u.length>8){let w=(0,rl.schemaRefOrVal)(s,n.properties,"properties");v=(0,tl.isOwnProperty)(t,w,y)}else u.length?v=(0,Pr.or)(...u.map(w=>(0,Pr._)`${y} === ${w}`)):v=Pr.nil;return p.length&&(v=(0,Pr.or)(v,...p.map(w=>(0,Pr._)`${(0,tl.usePattern)(e,w)}.test(${y})`))),(0,Pr.not)(v)}function f(y){t.code((0,Pr._)`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,rl.alwaysValidSchema)(s,r)){let v=t.name("valid");c.removeAdditional==="failing"?(g(y,v,!1),t.if((0,Pr.not)(v),()=>{e.reset(),f(y)})):(g(y,v),a||t.if((0,Pr.not)(v),()=>t.break()))}}function g(y,v,w){let x={keyword:"additionalProperties",dataProp:y,dataPropType:rl.Type.Str};w===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,v)}}};Cm.default=_5});var D$=$(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});var v5=ta(),I$=cr(),Am=le(),z$=Tm(),w5={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&&z$.default.code(new v5.KeywordCxt(i,z$.default,"additionalProperties"));let s=(0,I$.allSchemaProperties)(r);for(let l of s)i.definedProperties.add(l);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Am.mergeEvaluated.props(t,(0,Am.toHash)(s),i.props));let a=s.filter(l=>!(0,Am.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,I$.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)}}};Rm.default=w5});var M$=$(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});var O$=cr(),nl=Y(),N$=le(),j$=le(),b5={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,O$.allSchemaProperties)(r),c=a.filter(g=>(0,N$.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 nl.Name)&&(i.props=(0,j$.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,N$.checkStrictMode)(i,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function h(g){t.forIn("key",n,y=>{t.if((0,nl._)`${(0,O$.usePattern)(e,g)}.test(${y})`,()=>{let v=c.includes(g);v||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:j$.Type.Str},p),i.opts.unevaluated&&l!==!0?t.assign((0,nl._)`${l}[${y}]`,!0):!v&&!i.allErrors&&t.if((0,nl.not)(p),()=>t.break())})})}}};Im.default=b5});var L$=$(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});var x5=le(),k5={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,x5.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"}};zm.default=k5});var Z$=$(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});var S5=cr(),$5={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:S5.validateUnion,error:{message:"must match a schema in anyOf"}};Dm.default=$5});var U$=$(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});var ol=Y(),P5=le(),E5={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,ol._)`{passingSchemas: ${e.passing}}`},C5={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:E5,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,P5.alwaysValidSchema)(o,p)?t.var(c,!0):d=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c),l>0&&t.if((0,ol._)`${c} && ${s}`).assign(s,!1).assign(a,(0,ol._)`[${a}, ${l}]`).else(),t.if(c,()=>{t.assign(s,!0),t.assign(a,l),d&&e.mergeEvaluated(d,ol.Name)})})}}};Om.default=C5});var q$=$(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});var T5=le(),A5={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,T5.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};Nm.default=A5});var V$=$(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});var il=Y(),G$=le(),R5={message:({params:e})=>(0,il.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,il._)`{failingKeyword: ${e.ifClause}}`},I5={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:R5,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,G$.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=F$(n,"then"),i=F$(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,il.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,il._)`${p}`):e.setParams({ifClause:p})}}}};function F$(e,t){let r=e.schema[t];return r!==void 0&&!(0,G$.alwaysValidSchema)(e,r)}jm.default=I5});var B$=$(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var z5=le(),D5={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,z5.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Mm.default=D5});var H$=$(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});var O5=bm(),N5=k$(),j5=xm(),M5=$$(),L5=P$(),Z5=T$(),U5=R$(),q5=Tm(),F5=D$(),G5=M$(),V5=L$(),B5=Z$(),H5=U$(),W5=q$(),K5=V$(),J5=B$();function Y5(e=!1){let t=[V5.default,B5.default,H5.default,W5.default,K5.default,J5.default,U5.default,q5.default,Z5.default,F5.default,G5.default];return e?t.push(N5.default,M5.default):t.push(O5.default,j5.default),t.push(L5.default),t}Lm.default=Y5});var W$=$(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});var Ze=Y(),Q5={message:({schemaCode:e})=>(0,Ze.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Ze._)`{format: ${e}}`},X5={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Q5,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,Ze._)`${h}[${s}]`),y=r.let("fType"),v=r.let("format");r.if((0,Ze._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(y,(0,Ze._)`${g}.type || "string"`).assign(v,(0,Ze._)`${g}.validate`),()=>r.assign(y,(0,Ze._)`"string"`).assign(v,g)),e.fail$data((0,Ze.or)(w(),x()));function w(){return c.strictSchema===!1?Ze.nil:(0,Ze._)`${s} && !${v}`}function x(){let k=p.$async?(0,Ze._)`(${g}.async ? await ${v}(${n}) : ${v}(${n}))`:(0,Ze._)`${v}(${n})`,P=(0,Ze._)`(typeof ${v} == "function" ? ${k} : ${v}.test(${n}))`;return(0,Ze._)`${v} && ${v} !== true && ${y} === ${t} && !${P}`}}function f(){let h=l.formats[i];if(!h){w();return}if(h===!0)return;let[g,y,v]=x(h);g===t&&e.pass(k());function w(){if(c.strictSchema===!1){l.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function x(P){let q=P instanceof RegExp?(0,Ze.regexpCode)(P):c.code.formats?(0,Ze._)`${c.code.formats}${(0,Ze.getProperty)(i)}`:void 0,Z=r.scopeValue("formats",{key:i,ref:P,code:q});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,Ze._)`${Z}.validate`]:["string",P,Z]}function k(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Ze._)`await ${v}(${n})`}return typeof y=="function"?(0,Ze._)`${v}(${n})`:(0,Ze._)`${v}.test(${n})`}}}};Zm.default=X5});var K$=$(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});var e9=W$(),t9=[e9.default];Um.default=t9});var J$=$(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.contentVocabulary=Ni.metadataVocabulary=void 0;Ni.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ni.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Q$=$(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});var r9=i$(),n9=v$(),o9=H$(),i9=K$(),Y$=J$(),s9=[r9.default,n9.default,(0,o9.default)(),i9.default,Y$.metadataVocabulary,Y$.contentVocabulary];qm.default=s9});var e1=$(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.DiscrError=void 0;var X$;(function(e){e.Tag="tag",e.Mapping="mapping"})(X$||(sl.DiscrError=X$={}))});var r1=$(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});var ji=Y(),Fm=e1(),t1=Uu(),a9=ra(),c9=le(),u9={message:({params:{discrError:e,tagName:t}})=>e===Fm.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,ji._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},l9={keyword:"discriminator",type:"object",schemaType:"object",error:u9,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,ji._)`${r}${(0,ji.getProperty)(a)}`);t.if((0,ji._)`typeof ${u} == "string"`,()=>p(),()=>e.error(!1,{discrError:Fm.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,ji._)`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:Fm.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,ji.Name),h}function d(){var f;let h={},g=v(o),y=!0;for(let k=0;k<s.length;k++){let P=s[k];if(P?.$ref&&!(0,c9.schemaHasRulesButRef)(P,i.self.RULES)){let Z=P.$ref;if(P=t1.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,Z),P instanceof t1.SchemaEnv&&(P=P.schema),P===void 0)throw new a9.default(i.opts.uriResolver,i.baseId,Z)}let q=(f=P?.properties)===null||f===void 0?void 0:f[a];if(typeof q!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||v(P)),w(q,k)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return h;function v({required:k}){return Array.isArray(k)&&k.includes(a)}function w(k,P){if(k.const)x(k.const,P);else if(k.enum)for(let q of k.enum)x(q,P);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(k,P){if(typeof k!="string"||k in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[k]=P}}}};Gm.default=l9});var n1=$((RJ,p9)=>{p9.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 Bm=$((Te,Vm)=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.MissingRefError=Te.ValidationError=Te.CodeGen=Te.Name=Te.nil=Te.stringify=Te.str=Te._=Te.KeywordCxt=Te.Ajv=void 0;var d9=XS(),f9=Q$(),h9=r1(),o1=n1(),m9=["/properties"],al="http://json-schema.org/draft-07/schema",Mi=class extends d9.default{_addVocabularies(){super._addVocabularies(),f9.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(h9.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(o1,m9):o1;this.addMetaSchema(t,al,!1),this.refs["http://json-schema.org/schema"]=al}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(al)?al:void 0)}};Te.Ajv=Mi;Vm.exports=Te=Mi;Vm.exports.Ajv=Mi;Object.defineProperty(Te,"__esModule",{value:!0});Te.default=Mi;var g9=ta();Object.defineProperty(Te,"KeywordCxt",{enumerable:!0,get:function(){return g9.KeywordCxt}});var Li=Y();Object.defineProperty(Te,"_",{enumerable:!0,get:function(){return Li._}});Object.defineProperty(Te,"str",{enumerable:!0,get:function(){return Li.str}});Object.defineProperty(Te,"stringify",{enumerable:!0,get:function(){return Li.stringify}});Object.defineProperty(Te,"nil",{enumerable:!0,get:function(){return Li.nil}});Object.defineProperty(Te,"Name",{enumerable:!0,get:function(){return Li.Name}});Object.defineProperty(Te,"CodeGen",{enumerable:!0,get:function(){return Li.CodeGen}});var y9=Lu();Object.defineProperty(Te,"ValidationError",{enumerable:!0,get:function(){return y9.default}});var _9=ra();Object.defineProperty(Te,"MissingRefError",{enumerable:!0,get:function(){return _9.default}})});var d1=$(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.formatNames=Vr.fastFormats=Vr.fullFormats=void 0;function Gr(e,t){return{validate:e,compare:t}}Vr.fullFormats={date:Gr(c1,Jm),time:Gr(Wm(!0),Ym),"date-time":Gr(i1(!0),l1),"iso-time":Gr(Wm(),u1),"iso-date-time":Gr(i1(),p1),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:S9,"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:R9,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:$9,int32:{type:"number",validate:C9},int64:{type:"number",validate:T9},float:{type:"number",validate:a1},double:{type:"number",validate:a1},password:!0,binary:!0};Vr.fastFormats={...Vr.fullFormats,date:Gr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Jm),time:Gr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Ym),"date-time":Gr(/^\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,l1),"iso-time":Gr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u1),"iso-date-time":Gr(/^\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,p1),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};Vr.formatNames=Object.keys(Vr.fullFormats);function v9(e){return e%4===0&&(e%100!==0||e%400===0)}var w9=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,b9=[0,31,28,31,30,31,30,31,31,30,31,30,31];function c1(e){let t=w9.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&&v9(r)?29:b9[n])}function Jm(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Hm=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Wm(e){return function(r){let n=Hm.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 Ym(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 u1(e,t){if(!(e&&t))return;let r=Hm.exec(e),n=Hm.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 Km=/t|\s/i;function i1(e){let t=Wm(e);return function(n){let o=n.split(Km);return o.length===2&&c1(o[0])&&t(o[1])}}function l1(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function p1(e,t){if(!(e&&t))return;let[r,n]=e.split(Km),[o,i]=t.split(Km),s=Jm(r,o);if(s!==void 0)return s||Ym(n,i)}var x9=/\/|:/,k9=/^(?:[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 S9(e){return x9.test(e)&&k9.test(e)}var s1=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function $9(e){return s1.lastIndex=0,s1.test(e)}var P9=-(2**31),E9=2**31-1;function C9(e){return Number.isInteger(e)&&e<=E9&&e>=P9}function T9(e){return Number.isInteger(e)}function a1(){return!0}var A9=/[^\\]\\Z/;function R9(e){if(A9.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var f1=$(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.formatLimitDefinition=void 0;var I9=Bm(),Er=Y(),Hn=Er.operators,cl={formatMaximum:{okStr:"<=",ok:Hn.LTE,fail:Hn.GT},formatMinimum:{okStr:">=",ok:Hn.GTE,fail:Hn.LT},formatExclusiveMaximum:{okStr:"<",ok:Hn.LT,fail:Hn.GTE},formatExclusiveMinimum:{okStr:">",ok:Hn.GT,fail:Hn.LTE}},z9={message:({keyword:e,schemaCode:t})=>(0,Er.str)`should be ${cl[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Er._)`{comparison: ${cl[e].okStr}, limit: ${t}}`};Zi.formatLimitDefinition={keyword:Object.keys(cl),type:"string",schemaType:"string",$data:!0,error:z9,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 I9.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,Er._)`${d}[${c.schemaCode}]`);e.fail$data((0,Er.or)((0,Er._)`typeof ${f} != "object"`,(0,Er._)`${f} instanceof RegExp`,(0,Er._)`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,Er._)`${s.code.formats}${(0,Er.getProperty)(d)}`:void 0});e.fail$data(l(h))}function l(d){return(0,Er._)`${d}.compare(${r}, ${n}) ${cl[o].fail} 0`}},dependencies:["format"]};var D9=e=>(e.addKeyword(Zi.formatLimitDefinition),e);Zi.default=D9});var y1=$((ga,g1)=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var Ui=d1(),O9=f1(),Qm=Y(),h1=new Qm.Name("fullFormats"),N9=new Qm.Name("fastFormats"),Xm=(e,t={keywords:!0})=>{if(Array.isArray(t))return m1(e,t,Ui.fullFormats,h1),e;let[r,n]=t.mode==="fast"?[Ui.fastFormats,N9]:[Ui.fullFormats,h1],o=t.formats||Ui.formatNames;return m1(e,o,r,n),t.keywords&&(0,O9.default)(e),e};Xm.get=(e,t="full")=>{let n=(t==="fast"?Ui.fastFormats:Ui.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function m1(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,Qm._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}g1.exports=ga=Xm;Object.defineProperty(ga,"__esModule",{value:!0});ga.default=Xm});function j9(){let e=new _1.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,v1.default)(e),e}var _1,v1,qi,eg=b(()=>{_1=ht(Bm(),1),v1=ht(y1(),1);qi=class{constructor(t){this._ajv=t??j9()}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 ul,w1=b(()=>{ul=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 b1(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 x1(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 k1=b(()=>{});var ll,S1=b(()=>{Ik();Cn();eg();mu();w1();k1();ll=class extends Pu{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(As.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 qi,this.setRequestHandler(jd,n=>this._oninitialize(n)),this.setNotificationHandler(jc,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Kd,async(n,o)=>{let i=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=As.safeParse(s);return a.success&&this._loggingLevels.set(i,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new ul(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Rk(this._capabilities,t)}setRequestHandler(t,r){let o=hu(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i;if(Io(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=jn(Ts,c);if(!p.success){let h=p.error instanceof Error?p.error.message:String(p.error);throw new B(X.InvalidParams,`Invalid tools/call request: ${h}`)}let{params:l}=p.data,d=await Promise.resolve(r(c,u));if(l.task){let h=jn(ui,d);if(!h.success){let g=h.error instanceof Error?h.error.message:String(h.error);throw new B(X.InvalidParams,`Invalid task creation result: ${g}`)}return h.data}let f=jn(Bc,d);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new B(X.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){x1(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&b1(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:Hb.includes(r)?r:ai,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"},Oc)}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},Yd,r):this.request({method:"sampling/createMessage",params:t},Jd,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},Hc,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},Hc,r);if(i.action==="accept"&&i.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(i.content);if(!a.valid)throw new B(X.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof B?s:new B(X.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},Qd,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 M9(){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${Ht} \u306E\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return e}function L9(e){let t;try{t=_r.load(e)}catch{return e}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="****"),_r.dump(r,{lineWidth:-1,quotingType:'"'})}return e}function P1(e){if(!(0,Wt.existsSync)(e))return{};let t={};try{let r=(0,Wt.readFileSync)(e,"utf-8");for(let n of r.split(`
|
|
80
|
+
`)){let o=n.trim();if(!o||o.startsWith("#"))continue;let i=o.indexOf("=");if(i===-1)continue;let s=o.slice(0,i).trim();if(!$1.has(s))continue;let a=o.slice(i+1).trim();(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),t[s]=a}}catch{}return t}function Z9(e,t){let r=[];if((0,Wt.existsSync)(e)){let a=(0,Wt.readFileSync)(e,"utf-8");for(let c of a.split(`
|
|
81
|
+
`)){let u=c.trim(),p=u.indexOf("="),l=p>0?u.slice(0,p).trim():"";$1.has(l)||r.push(c)}for(;r.length>0&&r[r.length-1].trim()==="";)r.pop()}let o={...P1(e),...t},i=["","# GoDD MCP Server (managed by godd init)"];o.GODD_LICENSE_KEY&&i.push(`GODD_LICENSE_KEY="${o.GODD_LICENSE_KEY}"`),o.GODD_LANGUAGE&&i.push(`GODD_LANGUAGE="${o.GODD_LANGUAGE}"`),o.GODD_REGISTRY_URL&&i.push(`GODD_REGISTRY_URL="${o.GODD_REGISTRY_URL}"`),i.push("");let s=[...r,...i].join(`
|
|
82
|
+
`);(0,Wt.writeFileSync)(e,s,"utf-8")}function E1(e){let t=M9(),r=(0,pl.join)((0,pl.dirname)(t),".env");if(e.action==="show"){let s=[`## GoDD \u8A2D\u5B9A
|
|
83
|
+
`];if((0,Wt.existsSync)(t))try{let c=(0,Wt.readFileSync)(t,"utf-8");s.push(`### ${Ht}
|
|
84
84
|
|
|
85
85
|
\u30D1\u30B9: \`${t}\`
|
|
86
86
|
|
|
87
87
|
\`\`\`yaml
|
|
88
|
-
${
|
|
88
|
+
${L9(c)}\`\`\``)}catch(c){let u=c instanceof Error?c.message:String(c);s.push(`### ${Ht}
|
|
89
89
|
|
|
90
|
-
\u8AAD\u307F\u53D6\u308A\u30A8\u30E9\u30FC: ${
|
|
90
|
+
\u8AAD\u307F\u53D6\u308A\u30A8\u30E9\u30FC: ${u}`)}else s.push(`### ${Ht}
|
|
91
91
|
|
|
92
|
-
\`${t}\` \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\`godd init\` \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let a
|
|
92
|
+
\`${t}\` \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\`godd init\` \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let a=P1(r);if(Object.keys(a).length>0){let c=Object.entries(a).map(([u,p])=>u==="GODD_LICENSE_KEY"?`${u}="****"`:`${u}="${p}"`).join(`
|
|
93
93
|
`);s.push(`
|
|
94
94
|
### .env (GoDD \u7BA1\u7406\u5024)
|
|
95
95
|
|
|
@@ -98,13 +98,13 @@ ${V9(c)}\`\`\``)}catch(c){let l=c instanceof Error?c.message:String(c);s.push(`#
|
|
|
98
98
|
\`\`\`
|
|
99
99
|
${c}
|
|
100
100
|
\`\`\``)}return s.join(`
|
|
101
|
-
`)}let n=[],o={},i=[];if(e.components!==void 0){if(!(0,Wt.existsSync)(t))return`## \u30A8\u30E9\u30FC: ${
|
|
101
|
+
`)}let n=[],o={},i=[];if(e.components!==void 0){if(!(0,Wt.existsSync)(t))return`## \u30A8\u30E9\u30FC: ${Ht} \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
|
|
102
102
|
|
|
103
|
-
\`godd init\` \u3092\u5148\u306B\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`;try{let s=(0,Wt.readFileSync)(t,"utf-8"),a=
|
|
103
|
+
\`godd init\` \u3092\u5148\u306B\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`;try{let s=(0,Wt.readFileSync)(t,"utf-8"),a=_r.load(s),c=typeof a=="object"&&a!==null&&!Array.isArray(a)?a:{};c.components=e.components,delete c.stack_profile;let u=_r.dump(c,{lineWidth:-1,quotingType:'"'});(0,Wt.writeFileSync)(t,u,"utf-8"),n.push(u),i.push(`components \u2192 [${e.components.join(", ")}]`)}catch(s){let a=s instanceof Error?s.message:String(s);return`## \u30A8\u30E9\u30FC: ${Ht} \u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F
|
|
104
104
|
|
|
105
105
|
${a}`}}if(e.license_key!==void 0&&(o.GODD_LICENSE_KEY=e.license_key,i.push("GODD_LICENSE_KEY \u2192 `****` (\u66F4\u65B0\u6E08\u307F)")),e.language!==void 0&&(o.GODD_LANGUAGE=e.language,i.push(`GODD_LANGUAGE \u2192 \`${e.language}\``)),e.registry_url!==void 0&&(o.GODD_REGISTRY_URL=e.registry_url,i.push(`GODD_REGISTRY_URL \u2192 \`${e.registry_url}\``)),i.length===0)return`## \u66F4\u65B0\u306A\u3057
|
|
106
106
|
|
|
107
|
-
\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08license_key, components, language, registry_url\uFF09\u3002`;if(Object.keys(o).length>0)try{
|
|
107
|
+
\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08license_key, components, language, registry_url\uFF09\u3002`;if(Object.keys(o).length>0)try{Z9(r,o)}catch(s){return`## \u30A8\u30E9\u30FC: .env \u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F
|
|
108
108
|
|
|
109
109
|
${s instanceof Error?s.message:String(s)}`}return`## \u8A2D\u5B9A\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F
|
|
110
110
|
|
|
@@ -112,20 +112,20 @@ ${s instanceof Error?s.message:String(s)}`}return`## \u8A2D\u5B9A\u3092\u66F4\u6
|
|
|
112
112
|
${i.map(s=>`- ${s}`).join(`
|
|
113
113
|
`)}
|
|
114
114
|
|
|
115
|
-
\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 Wt,
|
|
116
|
-
${a}`:""}`)}
|
|
115
|
+
\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 Wt,pl,tg,rg,ng,$1,C1=b(()=>{"use strict";Xe();Wt=require("node:fs"),pl=require("node:path");Ns();Nn();tg="godd-config",rg="GoDD \u8A2D\u5B9A\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\u3002components \u306F config.godd\u3001license_key/language/registry_url \u306F .env \u306B\u4FDD\u5B58\u3055\u308C\u307E\u3059\u3002",ng=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\uFF08.env \u306E GODD_LICENSE_KEY \u3092\u66F4\u65B0\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\uFF08config.godd \u3092\u66F4\u65B0\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\uFF08.env \u306E GODD_LANGUAGE \u3092\u66F4\u65B0\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\uFF08.env \u306E GODD_REGISTRY_URL \u3092\u66F4\u65B0\uFF09")});$1=new Set(["GODD_LICENSE_KEY","GODD_LANGUAGE","GODD_REGISTRY_URL"])});function ya(e){let t=e??process.cwd();try{let r=(0,T1.execSync)("git config --get remote.origin.url",{encoding:"utf-8",cwd:t,timeout:5e3}).trim();if(r)return r}catch{}try{let r=(0,A1.join)(t,".git","config");return(0,dl.existsSync)(r)?(0,dl.readFileSync)(r,"utf-8").match(/\[remote\s+"origin"\][^[]*url\s*=\s*(.+)/)?.[1]?.trim()??null:null}catch{return null}}var T1,dl,A1,og=b(()=>{"use strict";T1=require("node:child_process"),dl=require("node:fs"),A1=require("node:path")});function I1(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:JSON.stringify(r)}}catch{}return e}function z1(e){return e.trim().startsWith("goddt-")?"device_token":"license_key"}function tt(e,t,r){return e===401&&t.includes("Device token has been revoked")?"\u3053\u306E\u7AEF\u672B\u306E\u30ED\u30B0\u30A4\u30F3\u306F\u7121\u52B9\u306B\u306A\u3063\u3066\u3044\u307E\u3059\uFF08\u7BA1\u7406\u753B\u9762\u3067\u5931\u52B9\u3055\u308C\u305F\u304B\u3001\u30ED\u30B0\u30A2\u30A6\u30C8\u6E08\u307F\u3067\u3059\uFF09\u3002godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+R1:e===401&&r==="device_token"?`godd login \u3067\u4FDD\u5B58\u3057\u305F\u30ED\u30B0\u30A4\u30F3\u304C Registry \u3067\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002${R1}`:e===403&&t.includes("License has expired")?"\u30E9\u30A4\u30BB\u30F3\u30B9\u307E\u305F\u306F\u30ED\u30B0\u30A4\u30F3\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3002godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u4F7F\u3063\u3066\u3044\u308B\u5834\u5408\u3084\u3001\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u3066\u3082\u89E3\u6D88\u3057\u306A\u3044\u5834\u5408\u306F\u7BA1\u7406\u8005\u306B\u671F\u9650\u306E\u5EF6\u9577\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403&&t.includes("License is suspended")?"\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u505C\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002":null}var R1,Br=b(()=>{"use strict";R1="\u5225\u306E\u30BF\u30FC\u30DF\u30CA\u30EB\u3067 godd login \u3057\u76F4\u3057\u305F\u76F4\u5F8C\u306A\u3089\u3001MCP \u30B5\u30FC\u30D0\u30FC\uFF08IDE / Claude Code / Codex\uFF09\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53E4\u3044\u30ED\u30B0\u30A4\u30F3\u306F\u5931\u52B9\u3057\u3066\u3044\u307E\u3059\uFF09\u3002"});async function U9(e,t){let r=ya();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,a=tt(n.status,s,z1(t));throw new ig(n.status,`\u30EA\u30DD\u30B8\u30C8\u30EA\u691C\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${s}${a?`
|
|
116
|
+
${a}`:""}`)}sg.set(r,{verified:!0,verifiedAt:Date.now()})}function q9(e){if(e){let t=sg.get(e);return t?Date.now()-t.verifiedAt<D1:!1}for(let t of sg.values())if(Date.now()-t.verifiedAt<D1)return!0;return!1}async function O1(e,t){let r=ya();r&&q9(r)||await U9(e,t)}var D1,ig,sg,N1=b(()=>{"use strict";og();Br();D1=3600*1e3,ig=class extends Error{constructor(r,n){super(n);this.status=r}},sg=new Map});var Rt=$(Kt=>{"use strict";Kt.__esModule=!0;Kt.extend=j1;Kt.indexOf=H9;Kt.escapeExpression=W9;Kt.isEmpty=K9;Kt.createFrame=J9;Kt.blockParams=Y9;Kt.appendContextPath=Q9;var F9={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},G9=/[&<>"'`=]/g,V9=/[&<>"'`=]/;function B9(e){return F9[e]}function j1(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 cg=Object.prototype.toString;Kt.toString=cg;var ag=function(t){return typeof t=="function"};ag(/x/)&&(Kt.isFunction=ag=function(e){return typeof e=="function"&&cg.call(e)==="[object Function]"});Kt.isFunction=ag;var M1=Array.isArray||function(e){return e&&typeof e=="object"?cg.call(e)==="[object Array]":!1};Kt.isArray=M1;function H9(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function W9(e){if(typeof e!="string"){if(e&&e.toHTML)return e.toHTML();if(e==null)return"";if(!e)return e+"";e=""+e}return V9.test(e)?e.replace(G9,B9):e}function K9(e){return!e&&e!==0?!0:!!(M1(e)&&e.length===0)}function J9(e){var t=j1({},e);return t._parent=e,t}function Y9(e,t){return e.path=t,e}function Q9(e,t){return(e?e+".":"")+t}});var pr=$((fl,L1)=>{"use strict";fl.__esModule=!0;var ug=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function lg(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<ug.length;c++)this[ug[c]]=a[ug[c]];Error.captureStackTrace&&Error.captureStackTrace(this,lg);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{}}lg.prototype=new Error;fl.default=lg;L1.exports=fl.default});var U1=$((hl,Z1)=>{"use strict";hl.__esModule=!0;var pg=Rt();hl.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(pg.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=pg.createFrame(r.data);i.contextPath=pg.appendContextPath(r.data.contextPath,r.name),r={data:i}}return o(t,r)})};Z1.exports=hl.default});var F1=$((ml,q1)=>{"use strict";ml.__esModule=!0;function X9(e){return e&&e.__esModule?e:{default:e}}var _a=Rt(),eZ=pr(),tZ=X9(eZ);ml.default=function(e){e.registerHelper("each",function(t,r){if(!r)throw new tZ.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=_a.appendContextPath(r.data.contextPath,r.ids[0])+"."),_a.isFunction(t)&&(t=t.call(this)),r.data&&(a=_a.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:_a.blockParams([t[h],h],[c+h,null])})}if(t&&typeof t=="object")if(_a.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})};q1.exports=ml.default});var V1=$((gl,G1)=>{"use strict";gl.__esModule=!0;function rZ(e){return e&&e.__esModule?e:{default:e}}var nZ=pr(),oZ=rZ(nZ);gl.default=function(e){e.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new oZ.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};G1.exports=gl.default});var K1=$((yl,W1)=>{"use strict";yl.__esModule=!0;function iZ(e){return e&&e.__esModule?e:{default:e}}var B1=Rt(),sZ=pr(),H1=iZ(sZ);yl.default=function(e){e.registerHelper("if",function(t,r){if(arguments.length!=2)throw new H1.default("#if requires exactly one argument");return B1.isFunction(t)&&(t=t.call(this)),!r.hash.includeZero&&!t||B1.isEmpty(t)?r.inverse(this):r.fn(this)}),e.registerHelper("unless",function(t,r){if(arguments.length!=2)throw new H1.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:r.inverse,inverse:r.fn,hash:r.hash})})};W1.exports=yl.default});var Y1=$((_l,J1)=>{"use strict";_l.__esModule=!0;_l.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)})};J1.exports=_l.default});var X1=$((vl,Q1)=>{"use strict";vl.__esModule=!0;vl.default=function(e){e.registerHelper("lookup",function(t,r,n){return t&&n.lookupProperty(t,r)})};Q1.exports=vl.default});var tP=$((wl,eP)=>{"use strict";wl.__esModule=!0;function aZ(e){return e&&e.__esModule?e:{default:e}}var va=Rt(),cZ=pr(),uZ=aZ(cZ);wl.default=function(e){e.registerHelper("with",function(t,r){if(arguments.length!=2)throw new uZ.default("#with requires exactly one argument");va.isFunction(t)&&(t=t.call(this));var n=r.fn;if(va.isEmpty(t))return r.inverse(this);var o=r.data;return r.data&&r.ids&&(o=va.createFrame(r.data),o.contextPath=va.appendContextPath(r.data.contextPath,r.ids[0])),n(t,{data:o,blockParams:va.blockParams([t],[o&&o.contextPath])})})};eP.exports=wl.default});var dg=$(bl=>{"use strict";bl.__esModule=!0;bl.registerDefaultHelpers=SZ;bl.moveHelperToHooks=$Z;function Fo(e){return e&&e.__esModule?e:{default:e}}var lZ=U1(),pZ=Fo(lZ),dZ=F1(),fZ=Fo(dZ),hZ=V1(),mZ=Fo(hZ),gZ=K1(),yZ=Fo(gZ),_Z=Y1(),vZ=Fo(_Z),wZ=X1(),bZ=Fo(wZ),xZ=tP(),kZ=Fo(xZ);function SZ(e){pZ.default(e),fZ.default(e),mZ.default(e),yZ.default(e),vZ.default(e),bZ.default(e),kZ.default(e)}function $Z(e,t,r){e.helpers[t]&&(e.hooks[t]=e.helpers[t],r||delete e.helpers[t])}});var nP=$((xl,rP)=>{"use strict";xl.__esModule=!0;var PZ=Rt();xl.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=PZ.extend({},c,r.partials);var u=t(s,a);return n.partials=c,u}),r.partials[o.args[0]]=o.fn,i})};rP.exports=xl.default});var oP=$(fg=>{"use strict";fg.__esModule=!0;fg.registerDefaultDecorators=AZ;function EZ(e){return e&&e.__esModule?e:{default:e}}var CZ=nP(),TZ=EZ(CZ);function AZ(e){TZ.default(e)}});var hg=$((kl,iP)=>{"use strict";kl.__esModule=!0;var RZ=Rt(),Fi={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(t){if(typeof t=="string"){var r=RZ.indexOf(Fi.methodMap,t.toLowerCase());r>=0?t=r:t=parseInt(t,10)}return t},log:function(t){if(t=Fi.lookupLevel(t),typeof console<"u"&&Fi.lookupLevel(Fi.level)<=t){var r=Fi.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)}}};kl.default=Fi;iP.exports=kl.default});var sP=$(mg=>{"use strict";mg.__esModule=!0;mg.createNewLookupObject=zZ;var IZ=Rt();function zZ(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return IZ.extend.apply(void 0,[Object.create(null)].concat(t))}});var gg=$(wa=>{"use strict";wa.__esModule=!0;wa.createProtoAccessControl=jZ;wa.resultIsAllowed=MZ;wa.resetLoggedProperties=ZZ;function DZ(e){return e&&e.__esModule?e:{default:e}}var aP=sP(),OZ=hg(),NZ=DZ(OZ),Sl=Object.create(null);function jZ(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:aP.createNewLookupObject(r,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:aP.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}}function MZ(e,t,r){return cP(typeof e=="function"?t.methods:t.properties,r)}function cP(e,t){return e.whitelist[t]!==void 0?e.whitelist[t]===!0:e.defaultValue!==void 0?e.defaultValue:(LZ(t),!1)}function LZ(e){Sl[e]!==!0&&(Sl[e]=!0,NZ.default.log("error",'Handlebars: Access has been denied to resolve the property "'+e+`" because it is not an "own property" of its parent.
|
|
117
117
|
You can add a runtime option to disable the check or this warning:
|
|
118
|
-
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function
|
|
119
|
-
`),d=0,
|
|
120
|
-
`)}return p}else throw new yn.default("The partial "+c.name+" could not be compiled when running in runtime-only mode")}var o={strict:function(a,c,l){if(!a||!(c in a))throw new yn.default('"'+c+'" not defined in '+a,{loc:l});return o.lookupProperty(a,c)},lookupProperty:function(a,c){var l=a[c];if(l==null||Object.prototype.hasOwnProperty.call(a,c)||fP.resultIsAllowed(l,o.protoAccessControl,c))return l},lookup:function(a,c){for(var l=a.length,p=0;p<l;p++){var u=a[p]&&o.lookupProperty(a[p],c);if(u!=null)return a[p][c]}},lambda:function(a,c){return typeof a=="function"?a.call(c):a},escapeExpression:_n.escapeExpression,invokePartial:n,fn:function(a){var c=e[a];return c.decorator=e[a+"_d"],c},programs:[],program:function(a,c,l,p,u){var d=this.programs[a],h=this.fn(a);return c||u||p||l?d=Tu(this,a,h,c,l,p,u):d||(d=this.programs[a]=Tu(this,a,h)),d},data:function(a,c){for(;a&&c--;)a=a._parent;return a},mergeIfNeeded:function(a,c){var l=a||c;return a&&c&&a!==c&&(l=_n.extend({},c,a)),l},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=f8(s,c));var l=void 0,p=e.useBlockParams?[]:void 0;e.useDepths&&(a.depths?l=s!=a.depths[0]?[s].concat(a.depths):a.depths:l=[s]);function u(d){return""+e.main(o,d,o.helpers,o.partials,c,p,l)}return u=mP(e.main,u,o,a.depths||[],c,p),u(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=_n.extend({},t.helpers,s.helpers);h8(a,o),o.helpers=a,e.usePartial&&(o.partials=o.mergeIfNeeded(s.partials,t.partials)),(e.usePartial||e.useDecorators)&&(o.decorators=_n.extend({},t.decorators,s.decorators)),o.hooks={},o.protoAccessControl=fP.createProtoAccessControl(s);var c=s.allowCallsToHelperMissing||r;dP.moveHelperToHooks(o,"helperMissing",c),dP.moveHelperToHooks(o,"blockHelperMissing",c)}},i._child=function(s,a,c,l){if(e.useBlockParams&&!c)throw new yn.default("must pass block params");if(e.useDepths&&!l)throw new yn.default("must pass parent depths");return Tu(o,s,e[s],a,0,c,l)},i}function Tu(e,t,r,n,o,i,s){function a(c){var l=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,l.data||n,i&&[l.blockParams].concat(i),p)}return a=mP(r,a,e,s,n,i),a.program=t,a.depth=s?s.length:0,a.blockParams=o||0,a}function p8(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 d8(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!==hP&&(function(){r.data=vn.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=vn.createFrame(c.data),c.data["partial-block"]=n,i(a,c)},i.partials&&(r.partials=_n.extend({},r.partials,i.partials))})(),e===void 0&&o&&(e=o),e===void 0)throw new yn.default("The partial "+r.name+" could not be found");if(e instanceof Function)return e(t,r)}function hP(){return""}function f8(e,t){return(!t||!("root"in t))&&(t=t?vn.createFrame(t):{},t.root=e),t}function mP(e,t,r,n,o,i){if(e.decorator){var s={};t=e.decorator(t,s,r,n&&n[0],o,i,n),_n.extend(t,s)}return t}function h8(e,t){Object.keys(e).forEach(function(r){var n=e[r];e[r]=m8(n,t)})}function m8(e,t){var r=t.lookupProperty;return c8.wrapHelper(e,function(n){return _n.extend({lookupProperty:r},n)})}});var bg=$((Ru,_P)=>{"use strict";Ru.__esModule=!0;Ru.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}};_P.exports=Ru.default});var xP=$((Au,bP)=>{"use strict";Au.__esModule=!0;function kg(e){return e&&e.__esModule?e:{default:e}}function Sg(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 g8=Eu(),yP=Sg(g8),_8=uP(),y8=kg(_8),v8=pr(),w8=kg(v8),b8=It(),xg=Sg(b8),x8=gP(),vP=Sg(x8),k8=bg(),S8=kg(k8);function wP(){var e=new yP.HandlebarsEnvironment;return xg.extend(e,yP),e.SafeString=y8.default,e.Exception=w8.default,e.Utils=xg,e.escapeExpression=xg.escapeExpression,e.VM=vP,e.template=function(t){return vP.template(t,e)},e}var xa=wP();xa.create=wP;S8.default(xa);xa.default=xa;Au.default=xa;bP.exports=Au.default});var $g=$((Iu,SP)=>{"use strict";Iu.__esModule=!0;var kP={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&&!kP.helpers.scopedId(t)&&!t.depth}}};Iu.default=kP;SP.exports=Iu.default});var PP=$((zu,$P)=>{"use strict";zu.__esModule=!0;var $8=(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,l,p){var u=l.length-1;switch(c){case 1:return l[u-1];case 2:this.$=a.prepareProgram(l[u]);break;case 3:this.$=l[u];break;case 4:this.$=l[u];break;case 5:this.$=l[u];break;case 6:this.$=l[u];break;case 7:this.$=l[u];break;case 8:this.$=l[u];break;case 9:this.$={type:"CommentStatement",value:a.stripComment(l[u]),strip:a.stripFlags(l[u],l[u]),loc:a.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:l[u],value:l[u],loc:a.locInfo(this._$)};break;case 11:this.$=a.prepareRawBlock(l[u-2],l[u-1],l[u],this._$);break;case 12:this.$={path:l[u-3],params:l[u-2],hash:l[u-1]};break;case 13:this.$=a.prepareBlock(l[u-3],l[u-2],l[u-1],l[u],!1,this._$);break;case 14:this.$=a.prepareBlock(l[u-3],l[u-2],l[u-1],l[u],!0,this._$);break;case 15:this.$={open:l[u-5],path:l[u-4],params:l[u-3],hash:l[u-2],blockParams:l[u-1],strip:a.stripFlags(l[u-5],l[u])};break;case 16:this.$={path:l[u-4],params:l[u-3],hash:l[u-2],blockParams:l[u-1],strip:a.stripFlags(l[u-5],l[u])};break;case 17:this.$={path:l[u-4],params:l[u-3],hash:l[u-2],blockParams:l[u-1],strip:a.stripFlags(l[u-5],l[u])};break;case 18:this.$={strip:a.stripFlags(l[u-1],l[u-1]),program:l[u]};break;case 19:var d=a.prepareBlock(l[u-2],l[u-1],l[u],l[u],!1,this._$),h=a.prepareProgram([d],l[u-1].loc);h.chained=!0,this.$={strip:l[u-2].strip,program:h,chain:!0};break;case 20:this.$=l[u];break;case 21:this.$={path:l[u-1],strip:a.stripFlags(l[u-2],l[u])};break;case 22:this.$=a.prepareMustache(l[u-3],l[u-2],l[u-1],l[u-4],a.stripFlags(l[u-4],l[u]),this._$);break;case 23:this.$=a.prepareMustache(l[u-3],l[u-2],l[u-1],l[u-4],a.stripFlags(l[u-4],l[u]),this._$);break;case 24:this.$={type:"PartialStatement",name:l[u-3],params:l[u-2],hash:l[u-1],indent:"",strip:a.stripFlags(l[u-4],l[u]),loc:a.locInfo(this._$)};break;case 25:this.$=a.preparePartialBlock(l[u-2],l[u-1],l[u],this._$);break;case 26:this.$={path:l[u-3],params:l[u-2],hash:l[u-1],strip:a.stripFlags(l[u-4],l[u])};break;case 27:this.$=l[u];break;case 28:this.$=l[u];break;case 29:this.$={type:"SubExpression",path:l[u-3],params:l[u-2],hash:l[u-1],loc:a.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:l[u],loc:a.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:a.id(l[u-2]),value:l[u],loc:a.locInfo(this._$)};break;case 32:this.$=a.id(l[u-1]);break;case 33:this.$=l[u];break;case 34:this.$=l[u];break;case 35:this.$={type:"StringLiteral",value:l[u],original:l[u],loc:a.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(l[u]),original:Number(l[u]),loc:a.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:l[u]==="true",original:l[u]==="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.$=l[u];break;case 41:this.$=l[u];break;case 42:this.$=a.preparePath(!0,l[u],this._$);break;case 43:this.$=a.preparePath(!1,l[u],this._$);break;case 44:l[u-2].push({part:a.id(l[u]),original:l[u],separator:l[u-1]}),this.$=l[u-2];break;case 45:this.$=[{part:a.id(l[u]),original:l[u]}];break;case 46:this.$=[];break;case 47:l[u-1].push(l[u]);break;case 48:this.$=[];break;case 49:l[u-1].push(l[u]);break;case 50:this.$=[];break;case 51:l[u-1].push(l[u]);break;case 58:this.$=[];break;case 59:l[u-1].push(l[u]);break;case 64:this.$=[];break;case 65:l[u-1].push(l[u]);break;case 70:this.$=[];break;case 71:l[u-1].push(l[u]);break;case 78:this.$=[];break;case 79:l[u-1].push(l[u]);break;case 82:this.$=[];break;case 83:l[u-1].push(l[u]);break;case 86:this.$=[];break;case 87:l[u-1].push(l[u]);break;case 90:this.$=[];break;case 91:l[u-1].push(l[u]);break;case 94:this.$=[];break;case 95:l[u-1].push(l[u]);break;case 98:this.$=[l[u]];break;case 99:l[u-1].push(l[u]);break;case 100:this.$=[l[u]];break;case 101:l[u-1].push(l[u]);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=[],l=this.table,p="",u=0,d=0,h=0,m=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 _=this.lexer.yylloc;c.push(_);var v=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function w(Pe){s.length=s.length-2*Pe,a.length=a.length-Pe,c.length=c.length-Pe}function x(){var Pe;return Pe=i.lexer.lex()||1,typeof Pe!="number"&&(Pe=i.symbols_[Pe]||Pe),Pe}for(var k,P,q,Z,Fe,ve,ie={},Ge,Ve,Pn,io;;){if(q=s[s.length-1],this.defaultActions[q]?Z=this.defaultActions[q]:((k===null||typeof k>"u")&&(k=x()),Z=l[q]&&l[q][k]),typeof Z>"u"||!Z.length||!Z[0]){var oe="";if(!h){io=[];for(Ge in l[q])this.terminals_[Ge]&&Ge>2&&io.push("'"+this.terminals_[Ge]+"'");this.lexer.showPosition?oe="Parse error on line "+(u+1)+`:
|
|
118
|
+
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function ZZ(){Object.keys(Sl).forEach(function(e){delete Sl[e]})}});var Pl=$(Hr=>{"use strict";Hr.__esModule=!0;Hr.HandlebarsEnvironment=vg;function uP(e){return e&&e.__esModule?e:{default:e}}var Go=Rt(),UZ=pr(),yg=uP(UZ),qZ=dg(),FZ=oP(),GZ=hg(),$l=uP(GZ),VZ=gg(),BZ="4.7.8";Hr.VERSION=BZ;var HZ=8;Hr.COMPILER_REVISION=HZ;var WZ=7;Hr.LAST_COMPATIBLE_COMPILER_REVISION=WZ;var KZ={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"};Hr.REVISION_CHANGES=KZ;var _g="[object Object]";function vg(e,t,r){this.helpers=e||{},this.partials=t||{},this.decorators=r||{},qZ.registerDefaultHelpers(this),FZ.registerDefaultDecorators(this)}vg.prototype={constructor:vg,logger:$l.default,log:$l.default.log,registerHelper:function(t,r){if(Go.toString.call(t)===_g){if(r)throw new yg.default("Arg not supported with multiple helpers");Go.extend(this.helpers,t)}else this.helpers[t]=r},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,r){if(Go.toString.call(t)===_g)Go.extend(this.partials,t);else{if(typeof r>"u")throw new yg.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(Go.toString.call(t)===_g){if(r)throw new yg.default("Arg not supported with multiple decorators");Go.extend(this.decorators,t)}else this.decorators[t]=r},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){VZ.resetLoggedProperties()}};var JZ=$l.default.log;Hr.log=JZ;Hr.createFrame=Go.createFrame;Hr.logger=$l.default});var pP=$((El,lP)=>{"use strict";El.__esModule=!0;function wg(e){this.string=e}wg.prototype.toString=wg.prototype.toHTML=function(){return""+this.string};El.default=wg;lP.exports=El.default});var dP=$(bg=>{"use strict";bg.__esModule=!0;bg.wrapHelper=YZ;function YZ(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 yP=$(Wn=>{"use strict";Wn.__esModule=!0;Wn.checkRevision=n8;Wn.template=o8;Wn.wrapProgram=Cl;Wn.resolvePartial=i8;Wn.invokePartial=s8;Wn.noop=mP;function QZ(e){return e&&e.__esModule?e:{default:e}}function XZ(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 e8=Rt(),gn=XZ(e8),t8=pr(),yn=QZ(t8),_n=Pl(),fP=dg(),r8=dP(),hP=gg();function n8(e){var t=e&&e[0]||1,r=_n.COMPILER_REVISION;if(!(t>=_n.LAST_COMPATIBLE_COMPILER_REVISION&&t<=_n.COMPILER_REVISION))if(t<_n.LAST_COMPATIBLE_COMPILER_REVISION){var n=_n.REVISION_CHANGES[r],o=_n.REVISION_CHANGES[t];throw new yn.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 yn.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 o8(e,t){if(!t)throw new yn.default("No environment passed to template");if(!e||!e.main)throw new yn.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=gn.extend({},a,c.hash),c.ids&&(c.ids[0]=!0)),s=t.VM.resolvePartial.call(this,s,a,c);var u=gn.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(`
|
|
119
|
+
`),d=0,f=l.length;d<f&&!(!l[d]&&d+1===f);d++)l[d]=c.indent+l[d];p=l.join(`
|
|
120
|
+
`)}return p}else throw new yn.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 yn.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)||hP.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:gn.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=Cl(this,a,f,c,u,p,l):d||(d=this.programs[a]=Cl(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=gn.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=a8(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=gP(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=gn.extend({},t.helpers,s.helpers);c8(a,o),o.helpers=a,e.usePartial&&(o.partials=o.mergeIfNeeded(s.partials,t.partials)),(e.usePartial||e.useDecorators)&&(o.decorators=gn.extend({},t.decorators,s.decorators)),o.hooks={},o.protoAccessControl=hP.createProtoAccessControl(s);var c=s.allowCallsToHelperMissing||r;fP.moveHelperToHooks(o,"helperMissing",c),fP.moveHelperToHooks(o,"blockHelperMissing",c)}},i._child=function(s,a,c,u){if(e.useBlockParams&&!c)throw new yn.default("must pass block params");if(e.useDepths&&!u)throw new yn.default("must pass parent depths");return Cl(o,s,e[s],a,0,c,u)},i}function Cl(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=gP(r,a,e,s,n,i),a.program=t,a.depth=s?s.length:0,a.blockParams=o||0,a}function i8(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 s8(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!==mP&&(function(){r.data=_n.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=_n.createFrame(c.data),c.data["partial-block"]=n,i(a,c)},i.partials&&(r.partials=gn.extend({},r.partials,i.partials))})(),e===void 0&&o&&(e=o),e===void 0)throw new yn.default("The partial "+r.name+" could not be found");if(e instanceof Function)return e(t,r)}function mP(){return""}function a8(e,t){return(!t||!("root"in t))&&(t=t?_n.createFrame(t):{},t.root=e),t}function gP(e,t,r,n,o,i){if(e.decorator){var s={};t=e.decorator(t,s,r,n&&n[0],o,i,n),gn.extend(t,s)}return t}function c8(e,t){Object.keys(e).forEach(function(r){var n=e[r];e[r]=u8(n,t)})}function u8(e,t){var r=t.lookupProperty;return r8.wrapHelper(e,function(n){return gn.extend({lookupProperty:r},n)})}});var xg=$((Tl,_P)=>{"use strict";Tl.__esModule=!0;Tl.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}};_P.exports=Tl.default});var kP=$((Al,xP)=>{"use strict";Al.__esModule=!0;function Sg(e){return e&&e.__esModule?e:{default:e}}function $g(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 l8=Pl(),vP=$g(l8),p8=pP(),d8=Sg(p8),f8=pr(),h8=Sg(f8),m8=Rt(),kg=$g(m8),g8=yP(),wP=$g(g8),y8=xg(),_8=Sg(y8);function bP(){var e=new vP.HandlebarsEnvironment;return kg.extend(e,vP),e.SafeString=d8.default,e.Exception=h8.default,e.Utils=kg,e.escapeExpression=kg.escapeExpression,e.VM=wP,e.template=function(t){return wP.template(t,e)},e}var ba=bP();ba.create=bP;_8.default(ba);ba.default=ba;Al.default=ba;xP.exports=Al.default});var Pg=$((Rl,$P)=>{"use strict";Rl.__esModule=!0;var SP={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&&!SP.helpers.scopedId(t)&&!t.depth}}};Rl.default=SP;$P.exports=Rl.default});var EP=$((Il,PP)=>{"use strict";Il.__esModule=!0;var v8=(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 v=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function w(Pe){s.length=s.length-2*Pe,a.length=a.length-Pe,c.length=c.length-Pe}function x(){var Pe;return Pe=i.lexer.lex()||1,typeof Pe!="number"&&(Pe=i.symbols_[Pe]||Pe),Pe}for(var k,P,q,Z,qe,ve,ie={},Fe,Ge,$n,oo;;){if(q=s[s.length-1],this.defaultActions[q]?Z=this.defaultActions[q]:((k===null||typeof k>"u")&&(k=x()),Z=u[q]&&u[q][k]),typeof Z>"u"||!Z.length||!Z[0]){var oe="";if(!f){oo=[];for(Fe in u[q])this.terminals_[Fe]&&Fe>2&&oo.push("'"+this.terminals_[Fe]+"'");this.lexer.showPosition?oe="Parse error on line "+(l+1)+`:
|
|
121
121
|
`+this.lexer.showPosition()+`
|
|
122
|
-
Expecting `+
|
|
123
|
-
`+s+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,s,a,c,
|
|
124
|
-
`+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 l(u,d){return s.yytext=s.yytext.substring(u,s.yyleng-d+u)}var p=c;switch(a){case 0:if(s.yytext.slice(-2)==="\\\\"?(l(0,1),this.begin("mu")):s.yytext.slice(-1)==="\\"?(l(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:(l(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=l(1,2).replace(/\\"/g,'"'),80;break;case 32:return s.yytext=l(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})();zu.default=$8;$P.exports=zu.default});var ju=$((Nu,TP)=>{"use strict";Nu.__esModule=!0;function P8(e){return e&&e.__esModule?e:{default:e}}var E8=pr(),Pg=P8(E8);function Du(){this.parents=[]}Du.prototype={constructor:Du,mutating:!1,acceptKey:function(t,r){var n=this.accept(t[r]);if(this.mutating){if(n&&!Du.prototype[n.type])throw new Pg.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 Pg.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 Pg.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:Ou,Decorator:Ou,BlockStatement:EP,DecoratorBlock:EP,PartialStatement:CP,PartialBlockStatement:function(t){CP.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:Ou,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 Ou(e){this.acceptRequired(e,"path"),this.acceptArray(e.params),this.acceptKey(e,"hash")}function EP(e){Ou.call(this,e),this.acceptKey(e,"program"),this.acceptKey(e,"inverse")}function CP(e){this.acceptRequired(e,"name"),this.acceptArray(e.params),this.acceptKey(e,"hash")}Nu.default=Du;TP.exports=Nu.default});var AP=$((Mu,RP)=>{"use strict";Mu.__esModule=!0;function C8(e){return e&&e.__esModule?e:{default:e}}var T8=ju(),R8=C8(T8);function Kr(){var e=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=e}Kr.prototype=new R8.default;Kr.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=Eg(n,o,r),l=Cg(n,o,r),p=a.openStandalone&&c,u=a.closeStandalone&&l,d=a.inlineStandalone&&c&&l;a.close&&Bo(n,o,!0),a.open&&Jn(n,o,!0),t&&d&&(Bo(n,o),Jn(n,o)&&s.type==="PartialStatement"&&(s.indent=/([ \t]+$)/.exec(n[o-1].original)[1])),t&&p&&(Bo((s.program||s.inverse).body),Jn(n,o)),t&&u&&(Bo(n,o),Jn((s.inverse||s.program).body))}}return e};Kr.prototype.BlockStatement=Kr.prototype.DecoratorBlock=Kr.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:Cg(t.body),closeStandalone:Eg((n||t).body)};if(e.openStrip.close&&Bo(t.body,null,!0),r){var s=e.inverseStrip;s.open&&Jn(t.body,null,!0),s.close&&Bo(n.body,null,!0),e.closeStrip.open&&Jn(o.body,null,!0),!this.options.ignoreStandalone&&Eg(t.body)&&Cg(n.body)&&(Jn(t.body),Bo(n.body))}else e.closeStrip.open&&Jn(t.body,null,!0);return i};Kr.prototype.Decorator=Kr.prototype.MustacheStatement=function(e){return e.strip};Kr.prototype.PartialStatement=Kr.prototype.CommentStatement=function(e){var t=e.strip||{};return{inlineStandalone:!0,open:t.open,close:t.close}};function Eg(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 Cg(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 Bo(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 Jn(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}}Mu.default=Kr;RP.exports=Mu.default});var IP=$(dr=>{"use strict";dr.__esModule=!0;dr.SourceLocation=z8;dr.id=D8;dr.stripFlags=O8;dr.stripComment=N8;dr.preparePath=j8;dr.prepareMustache=M8;dr.prepareRawBlock=L8;dr.prepareBlock=Z8;dr.prepareProgram=U8;dr.preparePartialBlock=q8;function A8(e){return e&&e.__esModule?e:{default:e}}var I8=pr(),Tg=A8(I8);function Rg(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var r={loc:e.path.loc};throw new Tg.default(e.path.original+" doesn't match "+t,r)}}function z8(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 D8(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e}function O8(e,t){return{open:e.charAt(2)==="~",close:t.charAt(t.length-3)==="~"}}function N8(e){return e.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function j8(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,l=t[s].original!==c;if(n+=(t[s].separator||"")+c,!l&&(c===".."||c==="."||c==="this")){if(o.length>0)throw new Tg.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 M8(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 L8(e,t,r,n){Rg(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 Z8(e,t,r,n,o,i){n&&n.path&&Rg(e,n);var s=/\*/.test(e.open);t.blockParams=e.blockParams;var a=void 0,c=void 0;if(r){if(s)throw new Tg.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 U8(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 q8(e,t,r,n){return Rg(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 OP=$(ka=>{"use strict";ka.__esModule=!0;ka.parseWithoutProcessing=DP;ka.parse=J8;function F8(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 zP(e){return e&&e.__esModule?e:{default:e}}var G8=PP(),Ag=zP(G8),V8=AP(),B8=zP(V8),H8=IP(),K8=F8(H8),W8=It();ka.parser=Ag.default;var Lu={};W8.extend(Lu,K8);function DP(e,t){if(e.type==="Program")return e;Ag.default.yy=Lu,Lu.locInfo=function(n){return new Lu.SourceLocation(t&&t.srcName,n)};var r=Ag.default.parse(e);return r}function J8(e,t){var r=DP(e,t),n=new B8.default(t);return n.accept(r)}});var LP=$(Ea=>{"use strict";Ea.__esModule=!0;Ea.Compiler=Ig;Ea.precompile=e6;Ea.compile=t6;function jP(e){return e&&e.__esModule?e:{default:e}}var Y8=pr(),$a=jP(Y8),Pa=It(),Q8=$g(),Sa=jP(Q8),X8=[].slice;function Ig(){}Ig.prototype={compiler:Ig,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||!MP(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=Pa.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 $a.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){NP(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 $a.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){NP(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 $a.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,Sa.default.helpers.simpleId(i))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var r=t.parts[0],n=Sa.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:X8.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var r=Sa.default.helpers.simpleId(t.path),n=r&&!!this.blockParamIndex(t.path.parts[0]),o=!n&&Sa.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&&!Sa.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&&Pa.indexOf(o,t);if(o&&i>=0)return[r,i]}}};function e6(e,t,r){if(e==null||typeof e!="string"&&e.type!=="Program")throw new $a.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 t6(e,t,r){if(t===void 0&&(t={}),e==null||typeof e!="string"&&e.type!=="Program")throw new $a.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+e);t=Pa.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,l){return n||(n=o()),n._child(s,a,c,l)},i}function MP(e,t){if(e===t)return!0;if(Pa.isArray(e)&&Pa.isArray(t)&&e.length===t.length){for(var r=0;r<e.length;r++)if(!MP(e[r],t[r]))return!1;return!0}}function NP(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 UP=$(zg=>{var ZP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");zg.encode=function(e){if(0<=e&&e<ZP.length)return ZP[e];throw new TypeError("Must be between 0 and 63: "+e)};zg.decode=function(e){var t=65,r=90,n=97,o=122,i=48,s=57,a=43,c=47,l=26,p=52;return t<=e&&e<=r?e-t:n<=e&&e<=o?e-n+l:i<=e&&e<=s?e-i+p:e==a?62:e==c?63:-1}});var Ng=$(Og=>{var qP=UP(),Dg=5,FP=1<<Dg,GP=FP-1,VP=FP;function r6(e){return e<0?(-e<<1)+1:(e<<1)+0}function n6(e){var t=(e&1)===1,r=e>>1;return t?-r:r}Og.encode=function(t){var r="",n,o=r6(t);do n=o&GP,o>>>=Dg,o>0&&(n|=VP),r+=qP.encode(n);while(o>0);return r};Og.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=qP.decode(t.charCodeAt(r++)),c===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));a=!!(c&VP),c&=GP,i=i+(c<<s),s+=Dg}while(a);n.value=n6(i),n.rest=r}});var Hi=$(xt=>{function o6(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}xt.getArg=o6;var BP=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,i6=/^data:.+\,.+$/;function Ca(e){var t=e.match(BP);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}xt.urlParse=Ca;function Vi(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}xt.urlGenerate=Vi;function jg(e){var t=e,r=Ca(e);if(r){if(!r.path)return e;t=r.path}for(var n=xt.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,Vi(r)):t}xt.normalize=jg;function HP(e,t){e===""&&(e="."),t===""&&(t=".");var r=Ca(t),n=Ca(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Vi(r);if(r||t.match(i6))return t;if(n&&!n.host&&!n.path)return n.host=t,Vi(n);var o=t.charAt(0)==="/"?t:jg(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=o,Vi(n)):o}xt.join=HP;xt.isAbsolute=function(e){return e.charAt(0)==="/"||BP.test(e)};function s6(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)}xt.relative=s6;var KP=(function(){var e=Object.create(null);return!("__proto__"in e)})();function WP(e){return e}function a6(e){return JP(e)?"$"+e:e}xt.toSetString=KP?WP:a6;function c6(e){return JP(e)?e.slice(1):e}xt.fromSetString=KP?WP:c6;function JP(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 l6(e,t,r){var n=Bi(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:Bi(e.name,t.name)}xt.compareByOriginalPositions=l6;function u6(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=Bi(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:Bi(e.name,t.name)}xt.compareByGeneratedPositionsDeflated=u6;function Bi(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function p6(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=Bi(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:Bi(e.name,t.name)}xt.compareByGeneratedPositionsInflated=p6;function d6(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}xt.parseSourceMapInput=d6;function f6(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=Ca(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=HP(Vi(n),t)}return jg(t)}xt.computeSourceURL=f6});var Zg=$(YP=>{var Mg=Hi(),Lg=Object.prototype.hasOwnProperty,Ho=typeof Map<"u";function wn(){this._array=[],this._set=Ho?new Map:Object.create(null)}wn.fromArray=function(t,r){for(var n=new wn,o=0,i=t.length;o<i;o++)n.add(t[o],r);return n};wn.prototype.size=function(){return Ho?this._set.size:Object.getOwnPropertyNames(this._set).length};wn.prototype.add=function(t,r){var n=Ho?t:Mg.toSetString(t),o=Ho?this.has(t):Lg.call(this._set,n),i=this._array.length;(!o||r)&&this._array.push(t),o||(Ho?this._set.set(t,i):this._set[n]=i)};wn.prototype.has=function(t){if(Ho)return this._set.has(t);var r=Mg.toSetString(t);return Lg.call(this._set,r)};wn.prototype.indexOf=function(t){if(Ho){var r=this._set.get(t);if(r>=0)return r}else{var n=Mg.toSetString(t);if(Lg.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};wn.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};wn.prototype.toArray=function(){return this._array.slice()};YP.ArraySet=wn});var e2=$(XP=>{var QP=Hi();function h6(e,t){var r=e.generatedLine,n=t.generatedLine,o=e.generatedColumn,i=t.generatedColumn;return n>r||n==r&&i>=o||QP.compareByGeneratedPositionsInflated(e,t)<=0}function Zu(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Zu.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};Zu.prototype.add=function(t){h6(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};Zu.prototype.toArray=function(){return this._sorted||(this._array.sort(QP.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};XP.MappingList=Zu});var Ug=$(t2=>{var Ta=Ng(),Je=Hi(),Uu=Zg().ArraySet,m6=e2().MappingList;function fr(e){e||(e={}),this._file=Je.getArg(e,"file",null),this._sourceRoot=Je.getArg(e,"sourceRoot",null),this._skipValidation=Je.getArg(e,"skipValidation",!1),this._sources=new Uu,this._names=new Uu,this._mappings=new m6,this._sourcesContents=null}fr.prototype._version=3;fr.fromSourceMap=function(t){var r=t.sourceRoot,n=new fr({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=Je.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=Je.relative(r,o)),n._sources.has(i)||n._sources.add(i);var s=t.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};fr.prototype.addMapping=function(t){var r=Je.getArg(t,"generated"),n=Je.getArg(t,"original",null),o=Je.getArg(t,"source",null),i=Je.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})};fr.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=Je.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Je.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Je.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};fr.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=Je.relative(i,o));var s=new Uu,a=new Uu;this._mappings.unsortedForEach(function(c){if(c.source===o&&c.originalLine!=null){var l=t.originalPositionFor({line:c.originalLine,column:c.originalColumn});l.source!=null&&(c.source=l.source,n!=null&&(c.source=Je.join(n,c.source)),i!=null&&(c.source=Je.relative(i,c.source)),c.originalLine=l.line,c.originalColumn=l.column,l.name!=null&&(c.name=l.name))}var p=c.source;p!=null&&!s.has(p)&&s.add(p);var u=c.name;u!=null&&!a.has(u)&&a.add(u)},this),this._sources=s,this._names=a,t.sources.forEach(function(c){var l=t.sourceContentFor(c);l!=null&&(n!=null&&(c=Je.join(n,c)),i!=null&&(c=Je.relative(i,c)),this.setSourceContent(c,l))},this)};fr.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}))}};fr.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,o=0,i=0,s=0,a="",c,l,p,u,d=this._mappings.toArray(),h=0,m=d.length;h<m;h++){if(l=d[h],c="",l.generatedLine!==r)for(t=0;l.generatedLine!==r;)c+=";",r++;else if(h>0){if(!Je.compareByGeneratedPositionsInflated(l,d[h-1]))continue;c+=","}c+=Ta.encode(l.generatedColumn-t),t=l.generatedColumn,l.source!=null&&(u=this._sources.indexOf(l.source),c+=Ta.encode(u-s),s=u,c+=Ta.encode(l.originalLine-1-o),o=l.originalLine-1,c+=Ta.encode(l.originalColumn-n),n=l.originalColumn,l.name!=null&&(p=this._names.indexOf(l.name),c+=Ta.encode(p-i),i=p)),a+=c}return a};fr.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Je.relative(r,n));var o=Je.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};fr.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};fr.prototype.toString=function(){return JSON.stringify(this.toJSON())};t2.SourceMapGenerator=fr});var r2=$(Ko=>{Ko.GREATEST_LOWER_BOUND=1;Ko.LEAST_UPPER_BOUND=2;function qg(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?qg(s,t,r,n,o,i):i==Ko.LEAST_UPPER_BOUND?t<n.length?t:-1:s:s-e>1?qg(e,s,r,n,o,i):i==Ko.LEAST_UPPER_BOUND?s:e<0?-1:e}Ko.search=function(t,r,n,o){if(r.length===0)return-1;var i=qg(-1,r.length,t,r,n,o||Ko.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&n(r[i],r[i-1],!0)===0;)--i;return i}});var o2=$(n2=>{function Fg(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g6(e,t){return Math.round(e+Math.random()*(t-e))}function Gg(e,t,r,n){if(r<n){var o=g6(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;Gg(e,t,r,c-1),Gg(e,t,c+1,n)}}n2.quickSort=function(e,t){Gg(e,t,0,e.length-1)}});var s2=$(qu=>{var z=Hi(),Vg=r2(),Ki=Zg().ArraySet,_6=Ng(),Ra=o2().quickSort;function Re(e,t){var r=e;return typeof e=="string"&&(r=z.parseSourceMapInput(e)),r.sections!=null?new Rr(r,t):new dt(r,t)}Re.fromSourceMap=function(e,t){return dt.fromSourceMap(e,t)};Re.prototype._version=3;Re.prototype.__generatedMappings=null;Object.defineProperty(Re.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Re.prototype.__originalMappings=null;Object.defineProperty(Re.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Re.prototype._charIsMappingSeparator=function(t,r){var n=t.charAt(r);return n===";"||n===","};Re.prototype._parseMappings=function(t,r){throw new Error("Subclasses must implement _parseMappings")};Re.GENERATED_ORDER=1;Re.ORIGINAL_ORDER=2;Re.GREATEST_LOWER_BOUND=1;Re.LEAST_UPPER_BOUND=2;Re.prototype.eachMapping=function(t,r,n){var o=r||null,i=n||Re.GENERATED_ORDER,s;switch(i){case Re.GENERATED_ORDER:s=this._generatedMappings;break;case Re.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;s.map(function(c){var l=c.source===null?null:this._sources.at(c.source);return l=z.computeSourceURL(a,l,this._sourceMapURL),{source:l,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)};Re.prototype.allGeneratedPositionsFor=function(t){var r=z.getArg(t,"line"),n={source:z.getArg(t,"source"),originalLine:r,originalColumn:z.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",z.compareByOriginalPositions,Vg.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:z.getArg(s,"generatedLine",null),column:z.getArg(s,"generatedColumn",null),lastColumn:z.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var c=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==c;)o.push({line:z.getArg(s,"generatedLine",null),column:z.getArg(s,"generatedColumn",null),lastColumn:z.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};qu.SourceMapConsumer=Re;function dt(e,t){var r=e;typeof e=="string"&&(r=z.parseSourceMapInput(e));var n=z.getArg(r,"version"),o=z.getArg(r,"sources"),i=z.getArg(r,"names",[]),s=z.getArg(r,"sourceRoot",null),a=z.getArg(r,"sourcesContent",null),c=z.getArg(r,"mappings"),l=z.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=z.normalize(s)),o=o.map(String).map(z.normalize).map(function(p){return s&&z.isAbsolute(s)&&z.isAbsolute(p)?z.relative(s,p):p}),this._names=Ki.fromArray(i.map(String),!0),this._sources=Ki.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(p){return z.computeSourceURL(s,p,t)}),this.sourceRoot=s,this.sourcesContent=a,this._mappings=c,this._sourceMapURL=t,this.file=l}dt.prototype=Object.create(Re.prototype);dt.prototype.consumer=Re;dt.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=z.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};dt.fromSourceMap=function(t,r){var n=Object.create(dt.prototype),o=n._names=Ki.fromArray(t._names.toArray(),!0),i=n._sources=Ki.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(h){return z.computeSourceURL(n.sourceRoot,h,r)});for(var s=t._mappings.toArray().slice(),a=n.__generatedMappings=[],c=n.__originalMappings=[],l=0,p=s.length;l<p;l++){var u=s[l],d=new i2;d.generatedLine=u.generatedLine,d.generatedColumn=u.generatedColumn,u.source&&(d.source=i.indexOf(u.source),d.originalLine=u.originalLine,d.originalColumn=u.originalColumn,u.name&&(d.name=o.indexOf(u.name)),c.push(d)),a.push(d)}return Ra(n.__originalMappings,z.compareByOriginalPositions),n};dt.prototype._version=3;Object.defineProperty(dt.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function i2(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}dt.prototype._parseMappings=function(t,r){for(var n=1,o=0,i=0,s=0,a=0,c=0,l=t.length,p=0,u={},d={},h=[],m=[],g,_,v,w,x;p<l;)if(t.charAt(p)===";")n++,p++,o=0;else if(t.charAt(p)===",")p++;else{for(g=new i2,g.generatedLine=n,w=p;w<l&&!this._charIsMappingSeparator(t,w);w++);if(_=t.slice(p,w),v=u[_],v)p+=_.length;else{for(v=[];p<w;)_6.decode(t,p,d),x=d.value,p=d.rest,v.push(x);if(v.length===2)throw new Error("Found a source, but no line and column");if(v.length===3)throw new Error("Found a source and line, but no column");u[_]=v}g.generatedColumn=o+v[0],o=g.generatedColumn,v.length>1&&(g.source=a+v[1],a+=v[1],g.originalLine=i+v[2],i=g.originalLine,g.originalLine+=1,g.originalColumn=s+v[3],s=g.originalColumn,v.length>4&&(g.name=c+v[4],c+=v[4])),m.push(g),typeof g.originalLine=="number"&&h.push(g)}Ra(m,z.compareByGeneratedPositionsDeflated),this.__generatedMappings=m,Ra(h,z.compareByOriginalPositions),this.__originalMappings=h};dt.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 Vg.search(t,r,i,s)};dt.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}};dt.prototype.originalPositionFor=function(t){var r={generatedLine:z.getArg(t,"line"),generatedColumn:z.getArg(t,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",z.compareByGeneratedPositionsDeflated,z.getArg(t,"bias",Re.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var i=z.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=z.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=z.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:z.getArg(o,"originalLine",null),column:z.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};dt.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1};dt.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=z.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=z.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.')};dt.prototype.generatedPositionFor=function(t){var r=z.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:z.getArg(t,"line"),originalColumn:z.getArg(t,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",z.compareByOriginalPositions,z.getArg(t,"bias",Re.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:z.getArg(i,"generatedLine",null),column:z.getArg(i,"generatedColumn",null),lastColumn:z.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};qu.BasicSourceMapConsumer=dt;function Rr(e,t){var r=e;typeof e=="string"&&(r=z.parseSourceMapInput(e));var n=z.getArg(r,"version"),o=z.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Ki,this._names=new Ki;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=z.getArg(s,"offset"),c=z.getArg(a,"line"),l=z.getArg(a,"column");if(c<i.line||c===i.line&&l<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=a,{generatedOffset:{generatedLine:c+1,generatedColumn:l+1},consumer:new Re(z.getArg(s,"map"),t)}})}Rr.prototype=Object.create(Re.prototype);Rr.prototype.constructor=Re;Rr.prototype._version=3;Object.defineProperty(Rr.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}});Rr.prototype.originalPositionFor=function(t){var r={generatedLine:z.getArg(t,"line"),generatedColumn:z.getArg(t,"column")},n=Vg.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}};Rr.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})};Rr.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.')};Rr.prototype.generatedPositionFor=function(t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(z.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}};Rr.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=z.computeSourceURL(o.consumer.sourceRoot,c,this._sourceMapURL),this._sources.add(c),c=this._sources.indexOf(c);var l=null;a.name&&(l=o.consumer._names.at(a.name),this._names.add(l),l=this._names.indexOf(l));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:l};this.__generatedMappings.push(p),typeof p.originalLine=="number"&&this.__originalMappings.push(p)}Ra(this.__generatedMappings,z.compareByGeneratedPositionsDeflated),Ra(this.__originalMappings,z.compareByOriginalPositions)};qu.IndexedSourceMapConsumer=Rr});var c2=$(a2=>{var y6=Ug().SourceMapGenerator,Fu=Hi(),v6=/(\r?\n)/,w6=10,Wi="$$$isSourceNode$$$";function Yt(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[Wi]=!0,n!=null&&this.add(n)}Yt.fromStringWithSourceMap=function(t,r,n){var o=new Yt,i=t.split(v6),s=0,a=function(){var d=m(),h=m()||"";return d+h;function m(){return s<i.length?i[s++]:void 0}},c=1,l=0,p=null;return r.eachMapping(function(d){if(p!==null)if(c<d.generatedLine)u(p,a()),c++,l=0;else{var h=i[s]||"",m=h.substr(0,d.generatedColumn-l);i[s]=h.substr(d.generatedColumn-l),l=d.generatedColumn,u(p,m),p=d;return}for(;c<d.generatedLine;)o.add(a()),c++;if(l<d.generatedColumn){var h=i[s]||"";o.add(h.substr(0,d.generatedColumn)),i[s]=h.substr(d.generatedColumn),l=d.generatedColumn}p=d},this),s<i.length&&(p&&u(p,a()),o.add(i.splice(s).join(""))),r.sources.forEach(function(d){var h=r.sourceContentFor(d);h!=null&&(n!=null&&(d=Fu.join(n,d)),o.setSourceContent(d,h))}),o;function u(d,h){if(d===null||d.source===void 0)o.add(h);else{var m=n?Fu.join(n,d.source):d.source;o.add(new Yt(d.originalLine,d.originalColumn,m,h,d.name))}}};Yt.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[Wi]||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};Yt.prototype.prepend=function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[Wi]||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};Yt.prototype.walk=function(t){for(var r,n=0,o=this.children.length;n<o;n++)r=this.children[n],r[Wi]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})};Yt.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};Yt.prototype.replaceRight=function(t,r){var n=this.children[this.children.length-1];return n[Wi]?n.replaceRight(t,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this};Yt.prototype.setSourceContent=function(t,r){this.sourceContents[Fu.toSetString(t)]=r};Yt.prototype.walkSourceContents=function(t){for(var r=0,n=this.children.length;r<n;r++)this.children[r][Wi]&&this.children[r].walkSourceContents(t);for(var o=Object.keys(this.sourceContents),r=0,n=o.length;r<n;r++)t(Fu.fromSetString(o[r]),this.sourceContents[o[r]])};Yt.prototype.toString=function(){var t="";return this.walk(function(r){t+=r}),t};Yt.prototype.toStringWithSourceMap=function(t){var r={code:"",line:1,column:0},n=new y6(t),o=!1,i=null,s=null,a=null,c=null;return this.walk(function(l,p){r.code+=l,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 u=0,d=l.length;u<d;u++)l.charCodeAt(u)===w6?(r.line++,r.column=0,u+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(l,p){n.setSourceContent(l,p)}),{code:r.code,map:n}};a2.SourceNode=Yt});var l2=$(Gu=>{Gu.SourceMapGenerator=Ug().SourceMapGenerator;Gu.SourceMapConsumer=s2().SourceMapConsumer;Gu.SourceNode=c2().SourceNode});var f2=$((Vu,d2)=>{"use strict";Vu.__esModule=!0;var Hg=It(),Wo=void 0;try{(typeof define!="function"||!define.amd)&&(u2=l2(),Wo=u2.SourceNode)}catch{}var u2;Wo||(Wo=function(e,t,r,n){this.src="",n&&this.add(n)},Wo.prototype={add:function(t){Hg.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){Hg.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function Bg(e,t,r){if(Hg.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 p2(e){this.srcFile=e,this.source=[]}p2.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,`
|
|
125
|
-
`])}),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 Wo(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 Wo?t:(t=
|
|
122
|
+
Expecting `+oo.join(", ")+", got '"+(this.terminals_[k]||k)+"'":oe="Parse error on line "+(l+1)+": Unexpected "+(k==1?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(oe,{text:this.lexer.match,token:this.terminals_[k]||k,line:this.lexer.yylineno,loc:y,expected:oo})}}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+k);switch(Z[0]){case 1:s.push(k),a.push(this.lexer.yytext),c.push(this.lexer.yylloc),s.push(Z[1]),k=null,P?(k=P,P=null):(d=this.lexer.yyleng,p=this.lexer.yytext,l=this.lexer.yylineno,y=this.lexer.yylloc,f>0&&f--);break;case 2:if(Ge=this.productions_[Z[1]][1],ie.$=a[a.length-Ge],ie._$={first_line:c[c.length-(Ge||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(Ge||1)].first_column,last_column:c[c.length-1].last_column},v&&(ie._$.range=[c[c.length-(Ge||1)].range[0],c[c.length-1].range[1]]),ve=this.performAction.call(ie,p,d,l,this.yy,Z[1],a,c),typeof ve<"u")return ve;Ge&&(s=s.slice(0,-1*Ge*2),a=a.slice(0,-1*Ge),c=c.slice(0,-1*Ge)),s.push(this.productions_[Z[1]][0]),a.push(ie.$),c.push(ie._$),$n=u[s[s.length-2]][s[s.length-1]],s.push($n);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()+`
|
|
123
|
+
`+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.
|
|
124
|
+
`+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})();Il.default=v8;PP.exports=Il.default});var Nl=$((Ol,AP)=>{"use strict";Ol.__esModule=!0;function w8(e){return e&&e.__esModule?e:{default:e}}var b8=pr(),Eg=w8(b8);function zl(){this.parents=[]}zl.prototype={constructor:zl,mutating:!1,acceptKey:function(t,r){var n=this.accept(t[r]);if(this.mutating){if(n&&!zl.prototype[n.type])throw new Eg.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 Eg.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 Eg.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:Dl,Decorator:Dl,BlockStatement:CP,DecoratorBlock:CP,PartialStatement:TP,PartialBlockStatement:function(t){TP.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:Dl,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 Dl(e){this.acceptRequired(e,"path"),this.acceptArray(e.params),this.acceptKey(e,"hash")}function CP(e){Dl.call(this,e),this.acceptKey(e,"program"),this.acceptKey(e,"inverse")}function TP(e){this.acceptRequired(e,"name"),this.acceptArray(e.params),this.acceptKey(e,"hash")}Ol.default=zl;AP.exports=Ol.default});var IP=$((jl,RP)=>{"use strict";jl.__esModule=!0;function x8(e){return e&&e.__esModule?e:{default:e}}var k8=Nl(),S8=x8(k8);function Wr(){var e=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=e}Wr.prototype=new S8.default;Wr.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=Cg(n,o,r),u=Tg(n,o,r),p=a.openStandalone&&c,l=a.closeStandalone&&u,d=a.inlineStandalone&&c&&u;a.close&&Vo(n,o,!0),a.open&&Kn(n,o,!0),t&&d&&(Vo(n,o),Kn(n,o)&&s.type==="PartialStatement"&&(s.indent=/([ \t]+$)/.exec(n[o-1].original)[1])),t&&p&&(Vo((s.program||s.inverse).body),Kn(n,o)),t&&l&&(Vo(n,o),Kn((s.inverse||s.program).body))}}return e};Wr.prototype.BlockStatement=Wr.prototype.DecoratorBlock=Wr.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:Tg(t.body),closeStandalone:Cg((n||t).body)};if(e.openStrip.close&&Vo(t.body,null,!0),r){var s=e.inverseStrip;s.open&&Kn(t.body,null,!0),s.close&&Vo(n.body,null,!0),e.closeStrip.open&&Kn(o.body,null,!0),!this.options.ignoreStandalone&&Cg(t.body)&&Tg(n.body)&&(Kn(t.body),Vo(n.body))}else e.closeStrip.open&&Kn(t.body,null,!0);return i};Wr.prototype.Decorator=Wr.prototype.MustacheStatement=function(e){return e.strip};Wr.prototype.PartialStatement=Wr.prototype.CommentStatement=function(e){var t=e.strip||{};return{inlineStandalone:!0,open:t.open,close:t.close}};function Cg(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 Tg(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 Vo(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 Kn(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}}jl.default=Wr;RP.exports=jl.default});var zP=$(dr=>{"use strict";dr.__esModule=!0;dr.SourceLocation=E8;dr.id=C8;dr.stripFlags=T8;dr.stripComment=A8;dr.preparePath=R8;dr.prepareMustache=I8;dr.prepareRawBlock=z8;dr.prepareBlock=D8;dr.prepareProgram=O8;dr.preparePartialBlock=N8;function $8(e){return e&&e.__esModule?e:{default:e}}var P8=pr(),Ag=$8(P8);function Rg(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var r={loc:e.path.loc};throw new Ag.default(e.path.original+" doesn't match "+t,r)}}function E8(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 C8(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e}function T8(e,t){return{open:e.charAt(2)==="~",close:t.charAt(t.length-3)==="~"}}function A8(e){return e.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function R8(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 Ag.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 I8(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 z8(e,t,r,n){Rg(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 D8(e,t,r,n,o,i){n&&n.path&&Rg(e,n);var s=/\*/.test(e.open);t.blockParams=e.blockParams;var a=void 0,c=void 0;if(r){if(s)throw new Ag.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 O8(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 N8(e,t,r,n){return Rg(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 NP=$(xa=>{"use strict";xa.__esModule=!0;xa.parseWithoutProcessing=OP;xa.parse=G8;function j8(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 DP(e){return e&&e.__esModule?e:{default:e}}var M8=EP(),Ig=DP(M8),L8=IP(),Z8=DP(L8),U8=zP(),q8=j8(U8),F8=Rt();xa.parser=Ig.default;var Ml={};F8.extend(Ml,q8);function OP(e,t){if(e.type==="Program")return e;Ig.default.yy=Ml,Ml.locInfo=function(n){return new Ml.SourceLocation(t&&t.srcName,n)};var r=Ig.default.parse(e);return r}function G8(e,t){var r=OP(e,t),n=new Z8.default(t);return n.accept(r)}});var ZP=$(Pa=>{"use strict";Pa.__esModule=!0;Pa.Compiler=zg;Pa.precompile=W8;Pa.compile=K8;function MP(e){return e&&e.__esModule?e:{default:e}}var V8=pr(),Sa=MP(V8),$a=Rt(),B8=Pg(),ka=MP(B8),H8=[].slice;function zg(){}zg.prototype={compiler:zg,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||!LP(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=$a.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 Sa.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){jP(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 Sa.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){jP(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 Sa.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,ka.default.helpers.simpleId(i))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var r=t.parts[0],n=ka.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:H8.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var r=ka.default.helpers.simpleId(t.path),n=r&&!!this.blockParamIndex(t.path.parts[0]),o=!n&&ka.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&&!ka.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&&$a.indexOf(o,t);if(o&&i>=0)return[r,i]}}};function W8(e,t,r){if(e==null||typeof e!="string"&&e.type!=="Program")throw new Sa.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 K8(e,t,r){if(t===void 0&&(t={}),e==null||typeof e!="string"&&e.type!=="Program")throw new Sa.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+e);t=$a.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 LP(e,t){if(e===t)return!0;if($a.isArray(e)&&$a.isArray(t)&&e.length===t.length){for(var r=0;r<e.length;r++)if(!LP(e[r],t[r]))return!1;return!0}}function jP(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 qP=$(Dg=>{var UP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Dg.encode=function(e){if(0<=e&&e<UP.length)return UP[e];throw new TypeError("Must be between 0 and 63: "+e)};Dg.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 jg=$(Ng=>{var FP=qP(),Og=5,GP=1<<Og,VP=GP-1,BP=GP;function J8(e){return e<0?(-e<<1)+1:(e<<1)+0}function Y8(e){var t=(e&1)===1,r=e>>1;return t?-r:r}Ng.encode=function(t){var r="",n,o=J8(t);do n=o&VP,o>>>=Og,o>0&&(n|=BP),r+=FP.encode(n);while(o>0);return r};Ng.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=FP.decode(t.charCodeAt(r++)),c===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));a=!!(c&BP),c&=VP,i=i+(c<<s),s+=Og}while(a);n.value=Y8(i),n.rest=r}});var Bi=$(bt=>{function Q8(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}bt.getArg=Q8;var HP=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,X8=/^data:.+\,.+$/;function Ea(e){var t=e.match(HP);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}bt.urlParse=Ea;function Gi(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}bt.urlGenerate=Gi;function Mg(e){var t=e,r=Ea(e);if(r){if(!r.path)return e;t=r.path}for(var n=bt.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,Gi(r)):t}bt.normalize=Mg;function WP(e,t){e===""&&(e="."),t===""&&(t=".");var r=Ea(t),n=Ea(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Gi(r);if(r||t.match(X8))return t;if(n&&!n.host&&!n.path)return n.host=t,Gi(n);var o=t.charAt(0)==="/"?t:Mg(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=o,Gi(n)):o}bt.join=WP;bt.isAbsolute=function(e){return e.charAt(0)==="/"||HP.test(e)};function e6(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)}bt.relative=e6;var KP=(function(){var e=Object.create(null);return!("__proto__"in e)})();function JP(e){return e}function t6(e){return YP(e)?"$"+e:e}bt.toSetString=KP?JP:t6;function r6(e){return YP(e)?e.slice(1):e}bt.fromSetString=KP?JP:r6;function YP(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 n6(e,t,r){var n=Vi(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:Vi(e.name,t.name)}bt.compareByOriginalPositions=n6;function o6(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=Vi(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:Vi(e.name,t.name)}bt.compareByGeneratedPositionsDeflated=o6;function Vi(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function i6(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=Vi(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:Vi(e.name,t.name)}bt.compareByGeneratedPositionsInflated=i6;function s6(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}bt.parseSourceMapInput=s6;function a6(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=Ea(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=WP(Gi(n),t)}return Mg(t)}bt.computeSourceURL=a6});var Ug=$(QP=>{var Lg=Bi(),Zg=Object.prototype.hasOwnProperty,Bo=typeof Map<"u";function vn(){this._array=[],this._set=Bo?new Map:Object.create(null)}vn.fromArray=function(t,r){for(var n=new vn,o=0,i=t.length;o<i;o++)n.add(t[o],r);return n};vn.prototype.size=function(){return Bo?this._set.size:Object.getOwnPropertyNames(this._set).length};vn.prototype.add=function(t,r){var n=Bo?t:Lg.toSetString(t),o=Bo?this.has(t):Zg.call(this._set,n),i=this._array.length;(!o||r)&&this._array.push(t),o||(Bo?this._set.set(t,i):this._set[n]=i)};vn.prototype.has=function(t){if(Bo)return this._set.has(t);var r=Lg.toSetString(t);return Zg.call(this._set,r)};vn.prototype.indexOf=function(t){if(Bo){var r=this._set.get(t);if(r>=0)return r}else{var n=Lg.toSetString(t);if(Zg.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};vn.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};vn.prototype.toArray=function(){return this._array.slice()};QP.ArraySet=vn});var t2=$(e2=>{var XP=Bi();function c6(e,t){var r=e.generatedLine,n=t.generatedLine,o=e.generatedColumn,i=t.generatedColumn;return n>r||n==r&&i>=o||XP.compareByGeneratedPositionsInflated(e,t)<=0}function Ll(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Ll.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};Ll.prototype.add=function(t){c6(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};Ll.prototype.toArray=function(){return this._sorted||(this._array.sort(XP.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};e2.MappingList=Ll});var qg=$(r2=>{var Ca=jg(),We=Bi(),Zl=Ug().ArraySet,u6=t2().MappingList;function fr(e){e||(e={}),this._file=We.getArg(e,"file",null),this._sourceRoot=We.getArg(e,"sourceRoot",null),this._skipValidation=We.getArg(e,"skipValidation",!1),this._sources=new Zl,this._names=new Zl,this._mappings=new u6,this._sourcesContents=null}fr.prototype._version=3;fr.fromSourceMap=function(t){var r=t.sourceRoot,n=new fr({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=We.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=We.relative(r,o)),n._sources.has(i)||n._sources.add(i);var s=t.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};fr.prototype.addMapping=function(t){var r=We.getArg(t,"generated"),n=We.getArg(t,"original",null),o=We.getArg(t,"source",null),i=We.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})};fr.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=We.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[We.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[We.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};fr.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=We.relative(i,o));var s=new Zl,a=new Zl;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=We.join(n,c.source)),i!=null&&(c.source=We.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=We.join(n,c)),i!=null&&(c=We.relative(i,c)),this.setSourceContent(c,u))},this)};fr.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}))}};fr.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(!We.compareByGeneratedPositionsInflated(u,d[f-1]))continue;c+=","}c+=Ca.encode(u.generatedColumn-t),t=u.generatedColumn,u.source!=null&&(l=this._sources.indexOf(u.source),c+=Ca.encode(l-s),s=l,c+=Ca.encode(u.originalLine-1-o),o=u.originalLine-1,c+=Ca.encode(u.originalColumn-n),n=u.originalColumn,u.name!=null&&(p=this._names.indexOf(u.name),c+=Ca.encode(p-i),i=p)),a+=c}return a};fr.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=We.relative(r,n));var o=We.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};fr.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};fr.prototype.toString=function(){return JSON.stringify(this.toJSON())};r2.SourceMapGenerator=fr});var n2=$(Ho=>{Ho.GREATEST_LOWER_BOUND=1;Ho.LEAST_UPPER_BOUND=2;function Fg(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?Fg(s,t,r,n,o,i):i==Ho.LEAST_UPPER_BOUND?t<n.length?t:-1:s:s-e>1?Fg(e,s,r,n,o,i):i==Ho.LEAST_UPPER_BOUND?s:e<0?-1:e}Ho.search=function(t,r,n,o){if(r.length===0)return-1;var i=Fg(-1,r.length,t,r,n,o||Ho.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&n(r[i],r[i-1],!0)===0;)--i;return i}});var i2=$(o2=>{function Gg(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function l6(e,t){return Math.round(e+Math.random()*(t-e))}function Vg(e,t,r,n){if(r<n){var o=l6(r,n),i=r-1;Gg(e,o,n);for(var s=e[n],a=r;a<n;a++)t(e[a],s)<=0&&(i+=1,Gg(e,i,a));Gg(e,i+1,a);var c=i+1;Vg(e,t,r,c-1),Vg(e,t,c+1,n)}}o2.quickSort=function(e,t){Vg(e,t,0,e.length-1)}});var a2=$(Ul=>{var z=Bi(),Bg=n2(),Hi=Ug().ArraySet,p6=jg(),Ta=i2().quickSort;function Ae(e,t){var r=e;return typeof e=="string"&&(r=z.parseSourceMapInput(e)),r.sections!=null?new Cr(r,t):new dt(r,t)}Ae.fromSourceMap=function(e,t){return dt.fromSourceMap(e,t)};Ae.prototype._version=3;Ae.prototype.__generatedMappings=null;Object.defineProperty(Ae.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Ae.prototype.__originalMappings=null;Object.defineProperty(Ae.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Ae.prototype._charIsMappingSeparator=function(t,r){var n=t.charAt(r);return n===";"||n===","};Ae.prototype._parseMappings=function(t,r){throw new Error("Subclasses must implement _parseMappings")};Ae.GENERATED_ORDER=1;Ae.ORIGINAL_ORDER=2;Ae.GREATEST_LOWER_BOUND=1;Ae.LEAST_UPPER_BOUND=2;Ae.prototype.eachMapping=function(t,r,n){var o=r||null,i=n||Ae.GENERATED_ORDER,s;switch(i){case Ae.GENERATED_ORDER:s=this._generatedMappings;break;case Ae.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=z.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)};Ae.prototype.allGeneratedPositionsFor=function(t){var r=z.getArg(t,"line"),n={source:z.getArg(t,"source"),originalLine:r,originalColumn:z.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",z.compareByOriginalPositions,Bg.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:z.getArg(s,"generatedLine",null),column:z.getArg(s,"generatedColumn",null),lastColumn:z.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var c=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==c;)o.push({line:z.getArg(s,"generatedLine",null),column:z.getArg(s,"generatedColumn",null),lastColumn:z.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};Ul.SourceMapConsumer=Ae;function dt(e,t){var r=e;typeof e=="string"&&(r=z.parseSourceMapInput(e));var n=z.getArg(r,"version"),o=z.getArg(r,"sources"),i=z.getArg(r,"names",[]),s=z.getArg(r,"sourceRoot",null),a=z.getArg(r,"sourcesContent",null),c=z.getArg(r,"mappings"),u=z.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=z.normalize(s)),o=o.map(String).map(z.normalize).map(function(p){return s&&z.isAbsolute(s)&&z.isAbsolute(p)?z.relative(s,p):p}),this._names=Hi.fromArray(i.map(String),!0),this._sources=Hi.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(p){return z.computeSourceURL(s,p,t)}),this.sourceRoot=s,this.sourcesContent=a,this._mappings=c,this._sourceMapURL=t,this.file=u}dt.prototype=Object.create(Ae.prototype);dt.prototype.consumer=Ae;dt.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=z.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};dt.fromSourceMap=function(t,r){var n=Object.create(dt.prototype),o=n._names=Hi.fromArray(t._names.toArray(),!0),i=n._sources=Hi.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 z.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 s2;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 Ta(n.__originalMappings,z.compareByOriginalPositions),n};dt.prototype._version=3;Object.defineProperty(dt.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function s2(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}dt.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,v,w,x;p<u;)if(t.charAt(p)===";")n++,p++,o=0;else if(t.charAt(p)===",")p++;else{for(g=new s2,g.generatedLine=n,w=p;w<u&&!this._charIsMappingSeparator(t,w);w++);if(y=t.slice(p,w),v=l[y],v)p+=y.length;else{for(v=[];p<w;)p6.decode(t,p,d),x=d.value,p=d.rest,v.push(x);if(v.length===2)throw new Error("Found a source, but no line and column");if(v.length===3)throw new Error("Found a source and line, but no column");l[y]=v}g.generatedColumn=o+v[0],o=g.generatedColumn,v.length>1&&(g.source=a+v[1],a+=v[1],g.originalLine=i+v[2],i=g.originalLine,g.originalLine+=1,g.originalColumn=s+v[3],s=g.originalColumn,v.length>4&&(g.name=c+v[4],c+=v[4])),h.push(g),typeof g.originalLine=="number"&&f.push(g)}Ta(h,z.compareByGeneratedPositionsDeflated),this.__generatedMappings=h,Ta(f,z.compareByOriginalPositions),this.__originalMappings=f};dt.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 Bg.search(t,r,i,s)};dt.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}};dt.prototype.originalPositionFor=function(t){var r={generatedLine:z.getArg(t,"line"),generatedColumn:z.getArg(t,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",z.compareByGeneratedPositionsDeflated,z.getArg(t,"bias",Ae.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var i=z.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=z.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=z.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:z.getArg(o,"originalLine",null),column:z.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};dt.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1};dt.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=z.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=z.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.')};dt.prototype.generatedPositionFor=function(t){var r=z.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:z.getArg(t,"line"),originalColumn:z.getArg(t,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",z.compareByOriginalPositions,z.getArg(t,"bias",Ae.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:z.getArg(i,"generatedLine",null),column:z.getArg(i,"generatedColumn",null),lastColumn:z.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Ul.BasicSourceMapConsumer=dt;function Cr(e,t){var r=e;typeof e=="string"&&(r=z.parseSourceMapInput(e));var n=z.getArg(r,"version"),o=z.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Hi,this._names=new Hi;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=z.getArg(s,"offset"),c=z.getArg(a,"line"),u=z.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 Ae(z.getArg(s,"map"),t)}})}Cr.prototype=Object.create(Ae.prototype);Cr.prototype.constructor=Ae;Cr.prototype._version=3;Object.defineProperty(Cr.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}});Cr.prototype.originalPositionFor=function(t){var r={generatedLine:z.getArg(t,"line"),generatedColumn:z.getArg(t,"column")},n=Bg.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}};Cr.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})};Cr.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.')};Cr.prototype.generatedPositionFor=function(t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(z.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}};Cr.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=z.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)}Ta(this.__generatedMappings,z.compareByGeneratedPositionsDeflated),Ta(this.__originalMappings,z.compareByOriginalPositions)};Ul.IndexedSourceMapConsumer=Cr});var u2=$(c2=>{var d6=qg().SourceMapGenerator,ql=Bi(),f6=/(\r?\n)/,h6=10,Wi="$$$isSourceNode$$$";function Jt(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[Wi]=!0,n!=null&&this.add(n)}Jt.fromStringWithSourceMap=function(t,r,n){var o=new Jt,i=t.split(f6),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=ql.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?ql.join(n,d.source):d.source;o.add(new Jt(d.originalLine,d.originalColumn,h,f,d.name))}}};Jt.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[Wi]||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};Jt.prototype.prepend=function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[Wi]||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};Jt.prototype.walk=function(t){for(var r,n=0,o=this.children.length;n<o;n++)r=this.children[n],r[Wi]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})};Jt.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};Jt.prototype.replaceRight=function(t,r){var n=this.children[this.children.length-1];return n[Wi]?n.replaceRight(t,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this};Jt.prototype.setSourceContent=function(t,r){this.sourceContents[ql.toSetString(t)]=r};Jt.prototype.walkSourceContents=function(t){for(var r=0,n=this.children.length;r<n;r++)this.children[r][Wi]&&this.children[r].walkSourceContents(t);for(var o=Object.keys(this.sourceContents),r=0,n=o.length;r<n;r++)t(ql.fromSetString(o[r]),this.sourceContents[o[r]])};Jt.prototype.toString=function(){var t="";return this.walk(function(r){t+=r}),t};Jt.prototype.toStringWithSourceMap=function(t){var r={code:"",line:1,column:0},n=new d6(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)===h6?(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}};c2.SourceNode=Jt});var l2=$(Fl=>{Fl.SourceMapGenerator=qg().SourceMapGenerator;Fl.SourceMapConsumer=a2().SourceMapConsumer;Fl.SourceNode=u2().SourceNode});var h2=$((Gl,f2)=>{"use strict";Gl.__esModule=!0;var Wg=Rt(),Wo=void 0;try{(typeof define!="function"||!define.amd)&&(p2=l2(),Wo=p2.SourceNode)}catch{}var p2;Wo||(Wo=function(e,t,r,n){this.src="",n&&this.add(n)},Wo.prototype={add:function(t){Wg.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){Wg.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function Hg(e,t,r){if(Wg.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 d2(e){this.srcFile=e,this.source=[]}d2.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,`
|
|
125
|
+
`])}),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 Wo(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 Wo?t:(t=Hg(t,this,r),new Wo(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=Hg(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(Hg(t[n],this));return r},generateArray:function(t){var r=this.generateList(t);return r.prepend("["),r.add("]"),r}};Gl.default=d2;f2.exports=Gl.default});var v2=$((Vl,_2)=>{"use strict";Vl.__esModule=!0;function y2(e){return e&&e.__esModule?e:{default:e}}var m2=Pl(),m6=pr(),Kg=y2(m6),g6=Rt(),y6=h2(),g2=y2(y6);function Ki(e){this.value=e}function Ji(){}Ji.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=m2.COMPILER_REVISION,r=m2.REVISION_CHANGES[t];return[t,r]},appendToBuffer:function(t,r,n){return g6.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 Kg.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(),`;
|
|
126
126
|
`]),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) {
|
|
127
127
|
`),this.decorators.push(`}
|
|
128
|
-
`),this.decorators=this.decorators.merge()));var p=this.createFunctionContext(o);if(this.isChild)return p;var
|
|
128
|
+
`),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 g2.default(this.options.srcName),this.decorators=new g2.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(","),`) {
|
|
129
129
|
`,a,"}"])},mergeSource:function(t){var r=this.environment.isSimple,n=!this.forceBuffer,o=void 0,i=void 0,s=void 0,a=void 0;return this.source.each(function(c){c.appendToBuffer?(s?c.prepend(" + "):s=c,a=c):(s&&(i?s.prepend("buffer += "):o=!0,a.add(";"),s=a=void 0),i=!0,r||(n=!1))}),n?s?(s.prepend("return "),a.add(";")):i||this.source.push('return "";'):(t+=", buffer = "+(o?"":this.initializeBuffer()),s?(s.prepend("return buffer + "),a.add(";")):this.source.push("return buffer;")),t&&this.source.prepend("var "+t.substring(2)+(o?"":`;
|
|
130
130
|
`)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return`
|
|
131
131
|
lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
@@ -134,35 +134,35 @@ Expecting `+io.join(", ")+", got '"+(this.terminals_[k]||k)+"'":oe="Parse error
|
|
|
134
134
|
}
|
|
135
135
|
return undefined
|
|
136
136
|
}
|
|
137
|
-
`.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(S6(this.options.strict&&i,this,r,n,t));return}for(var a=r.length;n<a;n++)this.replaceStack(function(c){var l=s.nameLookup(c,r[n],t);return o?[" && ",l]:[" != null ? ",l," : ",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:Yi,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 l=this.context.programs.length;o.index=l,o.name="program"+l,this.context.programs[l]=i.compile(o,r,this.context,!this.precompile),this.context.decorators[l]=i.decorators,this.context.environments[l]=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 Ji||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function(t){this.push(new Ji(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 Kg.default("replaceStack on non-inline");var s=this.popStack(!0);if(s instanceof Ji)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 Ji)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 Ji)return n.value;if(!r){if(!this.stackSlot)throw new Kg.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 Ji?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,l=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(),u=this.popStack();(u||p)&&(o.fn=u||"container.noop",o.inverse=p||"container.noop");for(var d=r;d--;)l=this.popStack(),n[d]=l,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=Yi.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();Yi.isValidJavaScriptVariableName=function(e){return!Yi.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function S6(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}Bu.default=Yi;_2.exports=Bu.default});var b2=$((Hu,w2)=>{"use strict";Hu.__esModule=!0;function Aa(e){return e&&e.__esModule?e:{default:e}}var $6=xP(),P6=Aa($6),E6=$g(),C6=Aa(E6),Wg=OP(),Jg=LP(),T6=y2(),R6=Aa(T6),A6=ju(),I6=Aa(A6),z6=bg(),D6=Aa(z6),O6=P6.default.create;function v2(){var e=O6();return e.compile=function(t,r){return Jg.compile(t,r,e)},e.precompile=function(t,r){return Jg.precompile(t,r,e)},e.AST=C6.default,e.Compiler=Jg.Compiler,e.JavaScriptCompiler=R6.default,e.Parser=Wg.parser,e.parse=Wg.parse,e.parseWithoutProcessing=Wg.parseWithoutProcessing,e}var Qi=v2();Qi.create=v2;D6.default(Qi);Qi.Visitor=I6.default;Qi.default=Qi;Hu.default=Qi;w2.exports=Hu.default});var x2=$(Ku=>{"use strict";Ku.__esModule=!0;Ku.print=L6;Ku.PrintVisitor=Me;function N6(e){return e&&e.__esModule?e:{default:e}}var j6=ju(),M6=N6(j6);function L6(e){return new Me().accept(e)}function Me(){this.padding=0}Me.prototype=new M6.default;Me.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
|
|
138
|
-
`,t};Me.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};Me.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Me.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Me.prototype.BlockStatement=Me.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};Me.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+" }}")};Me.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+" }}")};Me.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Me.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Me.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};Me.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Me.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Me.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Me.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Me.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Me.prototype.NullLiteral=function(){return"NULL"};Me.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(", ")+"}"};Me.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Ju=$((AY,$2)=>{var Wu=b2().default,S2=x2();Wu.PrintVisitor=S2.PrintVisitor;Wu.print=S2.print;$2.exports=Wu;function k2(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=Wu.compile(n)}typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=k2,require.extensions[".hbs"]=k2)});function Z6(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 P2(e,t){let r=C2.get(`mindset:${e}`);return r?r(t):`[Mindset '${e}' not found]`}function T2(e,t,r){let n=C2.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\u3002\u914D\u4FE1\u30D0\u30F3\u30C9\u30EB\u306B\u542B\u307E\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002MCP \u30B5\u30FC\u30D0\u30FC\u3092\u518D\u8D77\u52D5\u3059\u308B\u3068 Registry \u304B\u3089\u518D\u30D5\u30A7\u30C3\u30C1\u3055\u308C\u307E\u3059\u3002\u89E3\u6D88\u3057\u306A\u3044\u5834\u5408\u306F Registry \u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u767B\u9332\uFF08seed\uFF09\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`);let o=Z6(t,r);if(t.frontend?.mindset_template){let i=P2(t.frontend.mindset_template,o);o.frontend.mindset=i}if(t.backend?.mindset_template){let i=P2(t.backend.mindset_template,o);o.backend.mindset=i}return n(o)}var E2,C2,R2=b(()=>{"use strict";E2=mt(Ju(),1);E2.default.registerHelper("eq",function(e,t){return e===t});C2=new Map});function z2(e){return I2.map(t=>({apiDir:(0,xe.join)(e,...t.api),appDir:(0,xe.join)(e,...t.app)}))}function D2(){try{return(0,xe.dirname)((0,A2.fileURLToPath)(__goddBundleUrl))}catch{return(0,xe.dirname)(process.execPath)}}function U6(e,t){return(0,Ar.existsSync)((0,xe.join)(e,"app","main.py"))&&(0,Ar.existsSync)((0,xe.join)(t,"package.json"))&&(0,Ar.existsSync)((0,xe.join)(t,"src"))}function q6(e){for(let t of I2){let r=(0,xe.join)(e,...t.api),n=(0,xe.join)(e,...t.app);if((0,Ar.existsSync)(r)&&(0,Ar.existsSync)(n)&&U6(r,n))return{apiDir:r,appDir:n,projectRoot:e}}return null}function F6(e){let t=new Set,r=[];for(let n of e){let o=(0,xe.resolve)(n);t.has(o)||(t.add(o),r.push(o))}return r}function O2(e){let t=D2(),r=(0,xe.dirname)(process.execPath),n=F6([...e?.preferredRoots??[],process.cwd(),(0,xe.resolve)(process.cwd(),".."),(0,xe.resolve)(t,".."),(0,xe.resolve)(t,"..",".."),t,r,(0,xe.resolve)(r,"..")]);for(let o of n){let i=q6(o);if(i)return i}return null}function Yu(e){let t=O2(e);return t?{apiDir:t.apiDir,appDir:t.appDir}:null}function G6(e){let t=D2();return[(0,xe.join)(e,"templates","notes-compose.yml"),(0,xe.join)((0,xe.resolve)(t,".."),"templates","notes-compose.yml")].find(n=>(0,Ar.existsSync)(n))??null}function N2(e){let t=O2(e);if(!t)return null;let r=G6(t.projectRoot);return r?{apiDir:t.apiDir,appDir:t.appDir,composeTemplate:r}:null}function Yg(e){return(0,xe.isAbsolute)(e)||V6.test(e)}function B6(e,t){let r=(0,xe.resolve)(t);return typeof e!="string"||e===""?r:Yg(e)?(0,Ar.existsSync)(e)?(0,xe.resolve)(e):(console.warn(` \u26A0 ${bn} \u306E outputDir \u304C\u3053\u306E\u30DE\u30B7\u30F3\u306B\u5B58\u5728\u3057\u306A\u3044\u305F\u3081\u3001\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e} \u2192 ${r}`),r):(0,xe.resolve)(t,e)}function Qu(e){let t=(0,xe.join)(e,bn);if(!(0,Ar.existsSync)(t))return null;try{let r=JSON.parse((0,Ar.readFileSync)(t,"utf-8"));return{...r,outputDir:B6(r.outputDir,e)}}catch{return null}}function H6(e){return[`notes-api: ${e.apiDir}`,`notes-app: ${e.appDir}`]}function j2(e){console.log("--- \u30C7\u30D7\u30ED\u30A4\u5BFE\u8C61\u30BD\u30FC\u30B9 ---");for(let t of H6(e))console.log(` ${t}`);console.log()}var Ar,xe,A2,I2,bn,V6,Xu=b(()=>{"use strict";Ar=require("node:fs"),xe=require("node:path"),A2=require("node:url"),I2=[{api:["notes","api"],app:["notes","app"]},{api:["notes-api"],app:["notes-app"]}];bn=".godd-notes-infra.json",V6=/^(?:[A-Za-z]:[\\/]|\\\\)/});function Xi(e){try{return(0,re.existsSync)(e)?JSON.parse((0,re.readFileSync)(e,"utf-8")):null}catch{return null}}function xn(e,t=4096){try{return(0,re.existsSync)(e)?(0,re.readFileSync)(e).subarray(0,t).toString("utf-8"):""}catch{return""}}function W6(e){let t=(0,K.join)(e,"vendor");if(!(0,re.existsSync)(t))return[];let r=[];try{for(let n of(0,re.readdirSync)(t)){let o=(0,K.join)(t,n);if(!(0,re.statSync)(o).isDirectory())continue;let i=K6[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,K.join)(o,"pyproject.toml")),a=(0,re.existsSync)((0,K.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 J6(e){let t=[],r=(0,K.join)(e,"backend","pyproject.toml"),n=(0,K.join)(e,"backend","requirements.txt");if((0,re.existsSync)(r)){let _=xn(r);_.includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/pyproject.toml \u306B fastapi \u3092\u691C\u51FA"}),_.includes("django")&&t.push({id:"django",label:"Django",evidence:"backend/pyproject.toml \u306B django \u3092\u691C\u51FA"})}else(0,re.existsSync)(n)&&xn(n).includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/requirements.txt \u306B fastapi \u3092\u691C\u51FA"});let o=Xi((0,K.join)(e,"frontend","package.json")),i=Xi((0,K.join)(e,"package.json")),s=Xi((0,K.join)(e,"src","package.json"));for(let[_,v]of[["frontend/package.json",o],["package.json",i],["src/package.json",s]]){if(!v)continue;let w={...v.dependencies,...v.devDependencies};w.react&&t.push({id:"react",label:"React",evidence:`${_} \u306B react \u3092\u691C\u51FA`}),w.next&&t.push({id:"nextjs",label:"Next.js",evidence:`${_} \u306B next \u3092\u691C\u51FA`}),w.vue&&t.push({id:"vue",label:"Vue.js",evidence:`${_} \u306B vue \u3092\u691C\u51FA`}),w.svelte&&t.push({id:"svelte",label:"Svelte",evidence:`${_} \u306B svelte \u3092\u691C\u51FA`}),w.electron&&t.push({id:"electron",label:"Electron",evidence:`${_} \u306B electron \u3092\u691C\u51FA`})}let a=(0,K.join)(e,"pubspec.yaml");if((0,re.existsSync)(a)){let _=xn(a);t.push({id:"dart",label:"Dart",evidence:"pubspec.yaml \u3092\u691C\u51FA"}),_.includes("flutter")&&t.push({id:"flutter",label:"Flutter",evidence:"pubspec.yaml \u306B flutter \u3092\u691C\u51FA"})}let c=(0,re.existsSync)((0,K.join)(e,"Package.swift")),l=(0,K.join)(e,"ios"),p=(0,re.existsSync)(l)&&(()=>{try{return(0,re.readdirSync)(l).some(_=>_.endsWith(".xcodeproj")||_.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 u=(0,re.existsSync)((0,K.join)(e,"build.gradle.kts")),d=(0,re.existsSync)((0,K.join)(e,"build.gradle")),h=(0,K.join)(e,"android"),m=(0,re.existsSync)((0,K.join)(h,"build.gradle.kts"))||(0,re.existsSync)((0,K.join)(h,"build.gradle"));(u||d||m)&&t.push({id:"kotlin",label:"Kotlin",evidence:u?"build.gradle.kts \u3092\u691C\u51FA":d?"build.gradle \u3092\u691C\u51FA":"android/build.gradle \u3092\u691C\u51FA"});let g=xn((0,K.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,K.join)(e,"prisma","schema.prisma"))||(0,re.existsSync)((0,K.join)(e,"backend","prisma","schema.prisma")))&&t.push({id:"prisma",label:"Prisma",evidence:"prisma/schema.prisma \u3092\u691C\u51FA"}),t}function Q6(e){let t={},r=new Map,n=[(0,K.join)(e,"package.json"),(0,K.join)(e,"frontend","package.json"),(0,K.join)(e,"src","package.json")];for(let o of n){let i=Xi(o);if(!i)continue;let s=o.replace(e,"").replace(/^[\\/]/,""),a=i.dependencies,c=i.devDependencies;for(let[l,p]of Object.entries({...a,...c}))t[l]=p,r.set(l,s)}return{deps:t,sources:r}}function X6(e){let t=new Set,r="";for(let n of[(0,K.join)(e,"backend"),e]){let o=(0,K.join)(n,"pyproject.toml");if((0,re.existsSync)(o)){let a=xn(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,K.join)(n,"requirements.txt");if((0,re.existsSync)(i)){let s=xn(i,16384);for(let a of s.split(`
|
|
139
|
-
`)){let c=a.trim();if(!c||c.startsWith("#"))continue;let l=c.match(/^([a-zA-Z][\w.-]*)/);l&&t.add(l[1].toLowerCase().replace(/[-_.]+/g,"-"))}r=i.replace(e,"").replace(/^[\\/]/,"");break}}return{deps:t,source:r}}function eU(e){let t=[],r=new Set,{deps:n,sources:o}=Q6(e),{deps:i,source:s}=X6(e),a="";for(let c of["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"]){let l=xn((0,K.join)(e,c));if(l){a=l;break}}for(let c of Y6)if(!r.has(c.id)){if(c.npmPackage&&c.npmPackage in n){let l=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:`${l} \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 l of c.configFiles)if((0,re.existsSync)((0,K.join)(e,l))){r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${l} \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 tU(e){let t;for(let i of["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"])if(t=xn((0,K.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 rU(e){let t=(0,K.join)(e,"docs"),r=z2(e),n=r.some(({appDir:c})=>(0,re.existsSync)((0,K.join)(c,"package.json"))),o=r.some(({apiDir:c})=>(0,re.existsSync)((0,K.join)(c,"pyproject.toml")));if(!(0,re.existsSync)(t))return{exists:!1,sections:[],files:[],has_notes_app:n,has_notes_api:o};let i=[],s=[];function a(c,l){try{for(let p of(0,re.readdirSync)(c)){if(p.startsWith("."))continue;let u=(0,K.join)(c,p),d=l?`${l}/${p}`:p;(0,re.statSync)(u).isDirectory()?(l||i.push(p),a(u,d)):s.push(d)}}catch{}}return a(t,""),{exists:!0,sections:i,files:s,has_notes_app:n,has_notes_api:o}}function M2(e){let t=Xi((0,K.join)(e,"package.json"))?.name||(0,K.basename)(e),r=[];try{for(let l of(0,re.readdirSync)(e)){if(l.startsWith(".")||l==="node_modules")continue;let p=(0,K.join)(e,l);(0,re.statSync)(p).isDirectory()&&r.push(l)}}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(l=>(0,re.existsSync)((0,K.join)(e,l))),s=Xi((0,K.join)(e,"package.json"))?.scripts??{},a=[];try{for(let l of(0,re.readdirSync)(e))(l.match(/^env.*\.example$/)||l.match(/^\.env.*\.example$/))&&a.push(l)}catch{}let c=xn((0,K.join)(e,"README.md"),500);return{root:e,name:t,detected_stacks:J6(e),detected_tools:eU(e),vendor_items:W6(e),key_files:o,directories:r,scripts:s,docker_services:tU(e),env_templates:a,readme_excerpt:c,docs_structure:rU(e)}}var re,K,K6,Y6,L2=b(()=>{"use strict";re=require("node:fs"),K=require("node:path");Xu();K6={"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"}};Y6=[{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 Z2(e,t){let r=process.platform==="win32"?e.toLowerCase():e,n=process.platform==="win32"?t.toLowerCase():t,o=(0,zt.relative)(r,n);return o===""||!(0,zt.isAbsolute)(o)&&o!==".."&&!o.startsWith(`..${process.platform==="win32"?"\\":"/"}`)}function Qg(e){let t=e,r=[];for(;;){try{(0,ep.lstatSync)(t)}catch(n){if((n&&typeof n=="object"&&"code"in n?n.code:void 0)!=="ENOENT")throw new Error(Yn);let i=(0,zt.dirname)(t);if(i===t)throw new Error(Yn);r.unshift((0,zt.basename)(t)),t=i;continue}try{return(0,zt.resolve)((0,ep.realpathSync)(t),...r)}catch{throw new Error(Yn)}}}function nU(){let e=(0,zt.resolve)(process.cwd()),t=process.env.GODD_PROJECT_ROOT;if(!t)return[e];if(process.platform!=="win32"&&U2.test(t))throw new Error(Yn);let r=process.platform==="win32"?t:t.replaceAll("\\","/"),n=(0,zt.resolve)(e,r);return n===e?[e]:[e,n]}function oU(e){let t=nU(),r=(0,zt.resolve)(process.cwd()),n=process.env.GODD_PROJECT_ROOT,o=n&&process.platform!=="win32"?n.replaceAll("\\","/"):n,i=o?(0,zt.resolve)(r,o):r;if(e===void 0)return Qg(i);if(process.platform!=="win32"&&U2.test(e))throw new Error(Yn);let s=process.platform==="win32"?e:e.replaceAll("\\","/");if(s.includes("\0"))throw new Error(Yn);let a=(0,zt.resolve)(r,s);if(!t.some(u=>Z2(u,a)))throw new Error(Yn);let l=Qg(a);if(!t.some(u=>Z2(Qg(u),l)))throw new Error(Yn);return l}function ft(e,t){let r=oU(t);if(e.projectContext?.root===r)return e.projectContext;let n=M2(r);return e.projectContext=n,n}function Qn(e,t,r,n,o,i){let s=ft(e,n),a=e.config.language??"en",c={project:s,language:a,...o},l=[...i?.prefixTemplates??[],t].map(u=>e.renderPrompt?e.renderPrompt(u,c):T2(u,e.profile,c)).join(`
|
|
137
|
+
`.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(_6(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:Ji,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 Ki||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function(t){this.push(new Ki(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 Kg.default("replaceStack on non-inline");var s=this.popStack(!0);if(s instanceof Ki)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 Ki)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 Ki)return n.value;if(!r){if(!this.stackSlot)throw new Kg.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 Ki?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=Ji.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();Ji.isValidJavaScriptVariableName=function(e){return!Ji.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function _6(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}Vl.default=Ji;_2.exports=Vl.default});var x2=$((Bl,b2)=>{"use strict";Bl.__esModule=!0;function Aa(e){return e&&e.__esModule?e:{default:e}}var v6=kP(),w6=Aa(v6),b6=Pg(),x6=Aa(b6),Jg=NP(),Yg=ZP(),k6=v2(),S6=Aa(k6),$6=Nl(),P6=Aa($6),E6=xg(),C6=Aa(E6),T6=w6.default.create;function w2(){var e=T6();return e.compile=function(t,r){return Yg.compile(t,r,e)},e.precompile=function(t,r){return Yg.precompile(t,r,e)},e.AST=x6.default,e.Compiler=Yg.Compiler,e.JavaScriptCompiler=S6.default,e.Parser=Jg.parser,e.parse=Jg.parse,e.parseWithoutProcessing=Jg.parseWithoutProcessing,e}var Yi=w2();Yi.create=w2;C6.default(Yi);Yi.Visitor=P6.default;Yi.default=Yi;Bl.default=Yi;b2.exports=Bl.default});var k2=$(Hl=>{"use strict";Hl.__esModule=!0;Hl.print=z6;Hl.PrintVisitor=Me;function A6(e){return e&&e.__esModule?e:{default:e}}var R6=Nl(),I6=A6(R6);function z6(e){return new Me().accept(e)}function Me(){this.padding=0}Me.prototype=new I6.default;Me.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
|
|
138
|
+
`,t};Me.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};Me.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Me.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Me.prototype.BlockStatement=Me.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};Me.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+" }}")};Me.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+" }}")};Me.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Me.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Me.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};Me.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Me.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Me.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Me.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Me.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Me.prototype.NullLiteral=function(){return"NULL"};Me.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(", ")+"}"};Me.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Kl=$((xY,P2)=>{var Wl=x2().default,$2=k2();Wl.PrintVisitor=$2.PrintVisitor;Wl.print=$2.print;P2.exports=Wl;function S2(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=Wl.compile(n)}typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=S2,require.extensions[".hbs"]=S2)});function D6(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 E2(e,t){let r=T2.get(`mindset:${e}`);return r?r(t):`[Mindset '${e}' not found]`}function A2(e,t,r){let n=T2.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\u3002\u914D\u4FE1\u30D0\u30F3\u30C9\u30EB\u306B\u542B\u307E\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002MCP \u30B5\u30FC\u30D0\u30FC\u3092\u518D\u8D77\u52D5\u3059\u308B\u3068 Registry \u304B\u3089\u518D\u30D5\u30A7\u30C3\u30C1\u3055\u308C\u307E\u3059\u3002\u89E3\u6D88\u3057\u306A\u3044\u5834\u5408\u306F Registry \u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u767B\u9332\uFF08seed\uFF09\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`);let o=D6(t,r);if(t.frontend?.mindset_template){let i=E2(t.frontend.mindset_template,o);o.frontend.mindset=i}if(t.backend?.mindset_template){let i=E2(t.backend.mindset_template,o);o.backend.mindset=i}return n(o)}var C2,T2,R2=b(()=>{"use strict";C2=ht(Kl(),1);C2.default.registerHelper("eq",function(e,t){return e===t});T2=new Map});var Jl,Qg=b(()=>{"use strict";Jl="finish"});function D2(e){return z2.map(t=>({apiDir:(0,xe.join)(e,...t.api),appDir:(0,xe.join)(e,...t.app)}))}function O2(){try{return(0,xe.dirname)((0,I2.fileURLToPath)(__goddBundleUrl))}catch{return(0,xe.dirname)(process.execPath)}}function O6(e,t){return(0,Tr.existsSync)((0,xe.join)(e,"app","main.py"))&&(0,Tr.existsSync)((0,xe.join)(t,"package.json"))&&(0,Tr.existsSync)((0,xe.join)(t,"src"))}function N6(e){for(let t of z2){let r=(0,xe.join)(e,...t.api),n=(0,xe.join)(e,...t.app);if((0,Tr.existsSync)(r)&&(0,Tr.existsSync)(n)&&O6(r,n))return{apiDir:r,appDir:n,projectRoot:e}}return null}function j6(e){let t=new Set,r=[];for(let n of e){let o=(0,xe.resolve)(n);t.has(o)||(t.add(o),r.push(o))}return r}function N2(e){let t=O2(),r=(0,xe.dirname)(process.execPath),n=j6([...e?.preferredRoots??[],process.cwd(),(0,xe.resolve)(process.cwd(),".."),(0,xe.resolve)(t,".."),(0,xe.resolve)(t,"..",".."),t,r,(0,xe.resolve)(r,"..")]);for(let o of n){let i=N6(o);if(i)return i}return null}function Yl(e){let t=N2(e);return t?{apiDir:t.apiDir,appDir:t.appDir}:null}function M6(e){let t=O2();return[(0,xe.join)(e,"templates","notes-compose.yml"),(0,xe.join)((0,xe.resolve)(t,".."),"templates","notes-compose.yml")].find(n=>(0,Tr.existsSync)(n))??null}function j2(e){let t=N2(e);if(!t)return null;let r=M6(t.projectRoot);return r?{apiDir:t.apiDir,appDir:t.appDir,composeTemplate:r}:null}function Xg(e){return(0,xe.isAbsolute)(e)||L6.test(e)}function Z6(e,t){let r=(0,xe.resolve)(t);return typeof e!="string"||e===""?r:Xg(e)?(0,Tr.existsSync)(e)?(0,xe.resolve)(e):(console.warn(` \u26A0 ${wn} \u306E outputDir \u304C\u3053\u306E\u30DE\u30B7\u30F3\u306B\u5B58\u5728\u3057\u306A\u3044\u305F\u3081\u3001\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e} \u2192 ${r}`),r):(0,xe.resolve)(t,e)}function Ql(e){let t=(0,xe.join)(e,wn);if(!(0,Tr.existsSync)(t))return null;try{let r=JSON.parse((0,Tr.readFileSync)(t,"utf-8"));return{...r,outputDir:Z6(r.outputDir,e)}}catch{return null}}function U6(e){return[`notes-api: ${e.apiDir}`,`notes-app: ${e.appDir}`]}function M2(e){console.log("--- \u30C7\u30D7\u30ED\u30A4\u5BFE\u8C61\u30BD\u30FC\u30B9 ---");for(let t of U6(e))console.log(` ${t}`);console.log()}var Tr,xe,I2,z2,wn,L6,Xl=b(()=>{"use strict";Tr=require("node:fs"),xe=require("node:path"),I2=require("node:url"),z2=[{api:["notes","api"],app:["notes","app"]},{api:["notes-api"],app:["notes-app"]}];wn=".godd-notes-infra.json",L6=/^(?:[A-Za-z]:[\\/]|\\\\)/});function Qi(e){try{return(0,re.existsSync)(e)?JSON.parse((0,re.readFileSync)(e,"utf-8")):null}catch{return null}}function bn(e,t=4096){try{return(0,re.existsSync)(e)?(0,re.readFileSync)(e).subarray(0,t).toString("utf-8"):""}catch{return""}}function F6(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=q6[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 G6(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=bn(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)&&bn(n).includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/requirements.txt \u306B fastapi \u3092\u691C\u51FA"});let o=Qi((0,W.join)(e,"frontend","package.json")),i=Qi((0,W.join)(e,"package.json")),s=Qi((0,W.join)(e,"src","package.json"));for(let[y,v]of[["frontend/package.json",o],["package.json",i],["src/package.json",s]]){if(!v)continue;let w={...v.dependencies,...v.devDependencies};w.react&&t.push({id:"react",label:"React",evidence:`${y} \u306B react \u3092\u691C\u51FA`}),w.next&&t.push({id:"nextjs",label:"Next.js",evidence:`${y} \u306B next \u3092\u691C\u51FA`}),w.vue&&t.push({id:"vue",label:"Vue.js",evidence:`${y} \u306B vue \u3092\u691C\u51FA`}),w.svelte&&t.push({id:"svelte",label:"Svelte",evidence:`${y} \u306B svelte \u3092\u691C\u51FA`}),w.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=bn(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=bn((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 B6(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=Qi(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 H6(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=bn(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=bn(i,16384);for(let a of s.split(`
|
|
139
|
+
`)){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 W6(e){let t=[],r=new Set,{deps:n,sources:o}=B6(e),{deps:i,source:s}=H6(e),a="";for(let c of["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"]){let u=bn((0,W.join)(e,c));if(u){a=u;break}}for(let c of V6)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 K6(e){let t;for(let i of["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"])if(t=bn((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 J6(e){let t=(0,W.join)(e,"docs"),r=D2(e),n=r.some(({appDir:c})=>(0,re.existsSync)((0,W.join)(c,"package.json"))),o=r.some(({apiDir:c})=>(0,re.existsSync)((0,W.join)(c,"pyproject.toml")));if(!(0,re.existsSync)(t))return{exists:!1,sections:[],files:[],has_notes_app:n,has_notes_api:o};let i=[],s=[];function a(c,u){try{for(let p of(0,re.readdirSync)(c)){if(p.startsWith("."))continue;let l=(0,W.join)(c,p),d=u?`${u}/${p}`:p;(0,re.statSync)(l).isDirectory()?(u||i.push(p),a(l,d)):s.push(d)}}catch{}}return a(t,""),{exists:!0,sections:i,files:s,has_notes_app:n,has_notes_api:o}}function L2(e){let t=Qi((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=Qi((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=bn((0,W.join)(e,"README.md"),500);return{root:e,name:t,detected_stacks:G6(e),detected_tools:W6(e),vendor_items:F6(e),key_files:o,directories:r,scripts:s,docker_services:K6(e),env_templates:a,readme_excerpt:c,docs_structure:J6(e)}}var re,W,q6,V6,Z2=b(()=>{"use strict";re=require("node:fs"),W=require("node:path");Xl();q6={"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"}};V6=[{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 U2(e,t){let r=process.platform==="win32"?e.toLowerCase():e,n=process.platform==="win32"?t.toLowerCase():t,o=(0,It.relative)(r,n);return o===""||!(0,It.isAbsolute)(o)&&o!==".."&&!o.startsWith(`..${process.platform==="win32"?"\\":"/"}`)}function ey(e){let t=e,r=[];for(;;){try{(0,ep.lstatSync)(t)}catch(n){if((n&&typeof n=="object"&&"code"in n?n.code:void 0)!=="ENOENT")throw new Error(Jn);let i=(0,It.dirname)(t);if(i===t)throw new Error(Jn);r.unshift((0,It.basename)(t)),t=i;continue}try{return(0,It.resolve)((0,ep.realpathSync)(t),...r)}catch{throw new Error(Jn)}}}function Y6(){let e=(0,It.resolve)(process.cwd()),t=process.env.GODD_PROJECT_ROOT;if(!t)return[e];if(process.platform!=="win32"&&q2.test(t))throw new Error(Jn);let r=process.platform==="win32"?t:t.replaceAll("\\","/"),n=(0,It.resolve)(e,r);return n===e?[e]:[e,n]}function Q6(e){let t=Y6(),r=(0,It.resolve)(process.cwd()),n=process.env.GODD_PROJECT_ROOT,o=n&&process.platform!=="win32"?n.replaceAll("\\","/"):n,i=o?(0,It.resolve)(r,o):r;if(e===void 0)return ey(i);if(process.platform!=="win32"&&q2.test(e))throw new Error(Jn);let s=process.platform==="win32"?e:e.replaceAll("\\","/");if(s.includes("\0"))throw new Error(Jn);let a=(0,It.resolve)(r,s);if(!t.some(l=>U2(l,a)))throw new Error(Jn);let u=ey(a);if(!t.some(l=>U2(ey(l),u)))throw new Error(Jn);return u}function zt(e,t){let r=Q6(t);if(e.projectContext?.root===r)return e.projectContext;let n=L2(r);return e.projectContext=n,n}function Yn(e,t,r,n,o,i){let s=zt(e,n),a=e.config.language??"en",c={project:s,language:a,...o},p=[...i?.prefixTemplates??[],t,...e.endsWithFinish?[Jl]:[]].map(d=>e.renderPrompt?e.renderPrompt(d,c):A2(d,e.profile,c)).join(`
|
|
140
140
|
|
|
141
141
|
`);return`${a!=="en"?`> **Output Language**: Respond entirely in ${a}.
|
|
142
142
|
|
|
143
|
-
`:""}${
|
|
143
|
+
`:""}${p}
|
|
144
144
|
|
|
145
145
|
---
|
|
146
146
|
|
|
147
|
-
${r}`}var ep,
|
|
148
|
-
**\u5229\u7528\u53EF\u80FD\u306A\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8**: ${
|
|
149
|
-
### \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC: \`${
|
|
147
|
+
${r}`}var ep,It,q2,Jn,Ar=b(()=>{"use strict";R2();Qg();Z2();ep=require("node:fs"),It=require("node:path"),q2=/^(?:[A-Za-z]:[\\/]|\\\\)/,Jn="project_root must resolve inside the GoDD workspace."});function ty(e){return e.length<=8?"****":e.slice(0,4)+"****"+e.slice(-4)}function G2(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(`
|
|
148
|
+
**\u5229\u7528\u53EF\u80FD\u306A\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8**: ${X6}`);t.license_key?n.push(`
|
|
149
|
+
### \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC: \`${ty(t.license_key)}\`\uFF08\u8A2D\u5B9A\u6E08\u307F\uFF09`):n.push(`
|
|
150
150
|
### \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(`
|
|
151
151
|
### \u8A00\u8A9E: ${t.language??"ja"}`),n.push(`
|
|
152
|
-
### \u751F\u6210\u3059\u308B\u30D5\u30A1\u30A4\u30EB`),n.push("1. **config.godd** \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u306B\u914D\u7F6E\uFF08components \u306E\u307F\uFF09"),n.push("```yaml"),n.push("components:");for(let o of t.components??["fastapi","react","postgresql"])n.push(` - ${o}`);return n.push("```"),n.push(""),n.push("2. **.env** \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u306B\u914D\u7F6E\uFF08GoDD \u7BA1\u7406\u5024\uFF09"),n.push("```"),n.push(`GODD_LICENSE_KEY="${t.license_key?
|
|
152
|
+
### \u751F\u6210\u3059\u308B\u30D5\u30A1\u30A4\u30EB`),n.push("1. **config.godd** \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u306B\u914D\u7F6E\uFF08components \u306E\u307F\uFF09"),n.push("```yaml"),n.push("components:");for(let o of t.components??["fastapi","react","postgresql"])n.push(` - ${o}`);return n.push("```"),n.push(""),n.push("2. **.env** \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u306B\u914D\u7F6E\uFF08GoDD \u7BA1\u7406\u5024\uFF09"),n.push("```"),n.push(`GODD_LICENSE_KEY="${t.license_key?ty(t.license_key):"YOUR_LICENSE_KEY"}"`),n.push(`GODD_LANGUAGE="${t.language??"ja"}"`),n.push(`GODD_REGISTRY_URL="${ln}"`),n.push("```"),n.push(""),n.push("3. **`.cursor/mcp.json`** \u2014 Cursor IDE \u7528 MCP \u767B\u9332"),n.push("```json"),n.push(JSON.stringify({mcpServers:{godd:{command:"node",args:["path/to/godd-mcp-server/dist/index.js"],env:{GODD_CONFIG:"./config.godd",GODD_LICENSE_KEY:"****",GODD_LANGUAGE:t.language??"ja",GODD_REGISTRY_URL:ln}}}},null,2)),n.push("```"),n.join(`
|
|
153
153
|
`)}let r=[`## \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u30E2\u30FC\u30C9: ${t.mode??"full"}`];return t.license_key&&r.push(`## \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC
|
|
154
|
-
\`${
|
|
154
|
+
\`${ty(t.license_key)}\`\uFF08\u8A2D\u5B9A\u6E08\u307F\uFF09`),t.stack_profile&&r.push(`## \u30B9\u30BF\u30C3\u30AF\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB
|
|
155
155
|
${t.stack_profile}`),t.components&&t.components.length>0&&r.push(`## \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8
|
|
156
156
|
${t.components.join(", ")}`),t.environment&&r.push(`## \u74B0\u5883\u60C5\u5831
|
|
157
157
|
${t.environment}`),t.issues&&r.push(`## \u554F\u984C
|
|
158
|
-
${t.issues}`),
|
|
158
|
+
${t.issues}`),Yn(e,"setup",r.join(`
|
|
159
159
|
|
|
160
|
-
`),t.project_root)}var
|
|
160
|
+
`),t.project_root)}var F2,X6,V2=b(()=>{"use strict";Xe();Ar();Nn();F2=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")}),X6=["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 eU(){try{return(0,Rr.dirname)((0,B2.fileURLToPath)(__goddBundleUrl))}catch{return(0,Rr.dirname)(process.execPath)}}function W2(e,t){let r=[];for(let n of(0,Qn.readdirSync)(e)){if(n==="GENERATED.md")continue;let o=(0,Rr.join)(e,n);if((0,Qn.statSync)(o).isDirectory())r.push(...W2(o,t));else{let i=(0,Rr.relative)(t,o).replace(/\\/g,"/"),s=(0,Qn.readFileSync)(o,"utf-8");r.push({relativePath:i,content:s})}}return r}function ry(e){let t=eU(),r=[(0,Rr.resolve)(t,"..","templates",e),(0,Rr.resolve)(t,"templates",e),(0,Rr.resolve)(t,"..","..","templates",e)];for(let n of r)if((0,Qn.existsSync)(n))try{let o=W2(n,n);if(o.length>0)return o}catch{}return[]}function ny(){return ry("notes-docs")}function K2(e,t){let r=[`## \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D
|
|
161
161
|
${t.project_name??"(\u81EA\u52D5\u691C\u51FA)"}`];t.roles?.length&&r.push(`## \u30ED\u30FC\u30EB
|
|
162
162
|
${t.roles.map(o=>`- ${o}`).join(`
|
|
163
163
|
`)}`),t.screens?.length&&r.push(`## \u753B\u9762ID
|
|
164
164
|
${t.screens.map(o=>`- ${o}`).join(`
|
|
165
|
-
`)}`);let n=
|
|
165
|
+
`)}`);let n=ny();if(n.length>0){let o=n.map(i=>`- docs/${i.relativePath}`).join(`
|
|
166
166
|
`);r.push(`## \u30D0\u30F3\u30C9\u30EB\u6E08\u307F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30D5\u30A1\u30A4\u30EB
|
|
167
167
|
|
|
168
168
|
\u4EE5\u4E0B\u306E\u30D5\u30A1\u30A4\u30EB\u3092 \`docs/\` \u914D\u4E0B\u306B\u4F5C\u6210\u3059\u308B\u3053\u3068\u3002
|
|
@@ -172,37 +172,37 @@ ${o}`);for(let i of n){let s=i.relativePath.endsWith(".csv")?"csv":"md";r.push(`
|
|
|
172
172
|
|
|
173
173
|
\`\`\`${s}
|
|
174
174
|
${i.content.trimEnd()}
|
|
175
|
-
\`\`\``)}}return
|
|
175
|
+
\`\`\``)}}return Yn(e,"docs-init",r.join(`
|
|
176
176
|
|
|
177
|
-
`),t.project_root)}var
|
|
178
|
-
`).trim()}function
|
|
177
|
+
`),t.project_root)}var Qn,Rr,B2,H2,tp=b(()=>{"use strict";Xe();Qn=require("node:fs"),Rr=require("node:path"),B2=require("node:url");Ar();H2=m.object({project_name:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D"),roles:m.array(m.string().max(1e3)).optional().describe("\u30ED\u30FC\u30EB\u540D\u4E00\u89A7\uFF08\u4F8B: \u7BA1\u7406\u8005, \u904B\u55B6\u8005, \u5229\u7528\u8005\uFF09"),screens:m.array(m.string().max(1e3)).optional().describe("\u753B\u9762ID\u4E00\u89A7\uFF08\u4F8B: SC-OP-01, SC-US-01\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 J2(e,t){let r=[];return e.forEach((n,o)=>{n.trim()===t&&r.push(o)}),r}function nU(e){let t=e.split(/\r?\n/),r=J2(t,tU),n=J2(t,rU);return r.length!==1||n.length!==1||n[0]<r[0]?e:t.slice(r[0]+1,n[0]).join(`
|
|
178
|
+
`).trim()}function oU(e,t){let r=(0,Xi.relative)(e,t);return r===""||!r.startsWith("..")&&!(0,Xi.isAbsolute)(r)}function iU(e){try{let t=(0,Ra.realpathSync)(e),r=(0,Ra.realpathSync)((0,Xi.join)(e,"docs","README.md"));return oU(t,r)?nU((0,Ra.readFileSync)(r,"utf-8")):null}catch{return null}}function Y2(e){let t=Math.max(0,...[...e.matchAll(/`+/g)].map(r=>r[0].length));return"`".repeat(Math.max(3,t+1))}function tE(){return X2??=ry("notes-docs"),X2}function aU(){return tE().filter(e=>e.relativePath.includes(sU))}function cU(){return tE().filter(e=>e.relativePath.endsWith(".csv")).map(e=>({relativePath:e.relativePath,header:e.content.split(/\r?\n/)[0]})).filter(({header:e})=>e.trim()!=="")}function uU(e,t){if(e.length<=t)return e;let r=e.slice(0,t);if(e[t]===`
|
|
179
179
|
`)return r;let n=r.lastIndexOf(`
|
|
180
|
-
`);return n===-1?"":r.slice(0,n)}function
|
|
180
|
+
`);return n===-1?"":r.slice(0,n)}function rE(e,t){let r=[`## \u5909\u66F4\u5185\u5BB9
|
|
181
181
|
${t.changes??"(Chat \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304B\u3089\u5224\u65AD)"}`];t.target_sections?.length&&r.push(`## \u66F4\u65B0\u5BFE\u8C61\u30BB\u30AF\u30B7\u30E7\u30F3
|
|
182
182
|
${t.target_sections.map(a=>`- ${a}`).join(`
|
|
183
|
-
`)}`);let n=
|
|
184
|
-
\u2026\uFF08\u4EE5\u964D ${o.length-c.length} \u6587\u5B57\u3092\u5207\u308A\u8A70\u3081\uFF09`:o.trimEnd(),p=
|
|
183
|
+
`)}`);let n=zt(e,t.project_root).root,o=iU(n);if(o){let a=o.length>Q2,c=uU(o,Q2),u=a?`${c}
|
|
184
|
+
\u2026\uFF08\u4EE5\u964D ${o.length-c.length} \u6587\u5B57\u3092\u5207\u308A\u8A70\u3081\uFF09`:o.trimEnd(),p=Y2(u);r.push("## \u7406\u60F3 docs \u69CB\u9020\uFF08\u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u6B63\uFF09\n\n\u4EE5\u4E0B\u306F\u5BFE\u8C61\u30EA\u30DD\u30B8\u30C8\u30EA\u306E `docs/README.md` \u306E\u5185\u5BB9\u3067\u3042\u308B\u3002**\u3053\u3053\u306B\u8A18\u8FF0\u3055\u308C\u305F\u69CB\u9020\u304C\u3001\u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u304A\u3051\u308B docs \u914D\u7F6E\u306E\u6B63**\u3067\u3042\u308B\u3002"+(a?`
|
|
185
185
|
|
|
186
186
|
**\u6CE8\u610F: \u5185\u5BB9\u304C\u5927\u304D\u3044\u305F\u3081\u9014\u4E2D\u3067\u5207\u308A\u8A70\u3081\u305F\u3002** \u5207\u308A\u8A70\u3081\u306F\u884C\u306E\u5883\u754C\u3067\u884C\u3063\u3066\u304A\u308A\u3001\u672B\u5C3E\u306E\u300C\u2026\uFF08\u4EE5\u964D N \u6587\u5B57\u3092\u5207\u308A\u8A70\u3081\uFF09\u300D\u3088\u308A\u5F8C\u308D\u306E\u69CB\u9020\u306F\u5224\u65AD\u5BFE\u8C61\u5916\u3067\u3042\u308B\u3002\u305D\u3053\u306B\u5C5E\u3059\u308B\u4E0D\u8DB3\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u65B0\u898F\u4F5C\u6210\u306F\u884C\u308F\u305A\u3001\u5207\u308A\u8A70\u3081\u304C\u8D77\u304D\u305F\u65E8\u3092\u6700\u7D42\u5831\u544A\u306B\u542B\u3081\u308B\u3053\u3068\u3002`:"")+`
|
|
187
187
|
|
|
188
188
|
${p}md
|
|
189
|
-
${
|
|
190
|
-
${p}`)}else r.push("## docs/README.md \u304C\u8AAD\u307F\u53D6\u308C\u306A\u3044\n\n\u5BFE\u8C61\u30EA\u30DD\u30B8\u30C8\u30EA\u306E `docs/README.md` \u304C\u5B58\u5728\u3057\u306A\u3044\u304B\u8AAD\u307F\u53D6\u308C\u306A\u3044\u305F\u3081\u3001\u7406\u60F3 docs \u69CB\u9020\u3092\u6E21\u305B\u3066\u3044\u306A\u3044\u3002\u69CB\u9020\u306E\u7A81\u304D\u5408\u308F\u305B\u3068\u4E0D\u8DB3\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u65B0\u898F\u4F5C\u6210\u306F\u884C\u308F\u305A\u3001\u65E2\u5B58\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u66F4\u65B0\u306E\u307F\u3092\u884C\u3046\u3053\u3068\u3002\u305D\u306E\u3046\u3048\u3067\u3001**`docs/README.md` \u3092\u8AAD\u3081\u306A\u304B\u3063\u305F\u305F\u3081\u306B\u69CB\u9020\u306E\u540C\u671F\u3092\u30B9\u30AD\u30C3\u30D7\u3057\u305F\u65E8\u3092\u6700\u7D42\u5831\u544A\u306B\u5FC5\u305A\u542B\u3081\u308B\u3053\u3068**\u3002");let i=
|
|
189
|
+
${u}
|
|
190
|
+
${p}`)}else r.push("## docs/README.md \u304C\u8AAD\u307F\u53D6\u308C\u306A\u3044\n\n\u5BFE\u8C61\u30EA\u30DD\u30B8\u30C8\u30EA\u306E `docs/README.md` \u304C\u5B58\u5728\u3057\u306A\u3044\u304B\u8AAD\u307F\u53D6\u308C\u306A\u3044\u305F\u3081\u3001\u7406\u60F3 docs \u69CB\u9020\u3092\u6E21\u305B\u3066\u3044\u306A\u3044\u3002\u69CB\u9020\u306E\u7A81\u304D\u5408\u308F\u305B\u3068\u4E0D\u8DB3\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u65B0\u898F\u4F5C\u6210\u306F\u884C\u308F\u305A\u3001\u65E2\u5B58\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u66F4\u65B0\u306E\u307F\u3092\u884C\u3046\u3053\u3068\u3002\u305D\u306E\u3046\u3048\u3067\u3001**`docs/README.md` \u3092\u8AAD\u3081\u306A\u304B\u3063\u305F\u305F\u3081\u306B\u69CB\u9020\u306E\u540C\u671F\u3092\u30B9\u30AD\u30C3\u30D7\u3057\u305F\u65E8\u3092\u6700\u7D42\u5831\u544A\u306B\u5FC5\u305A\u542B\u3081\u308B\u3053\u3068**\u3002");let i=aU();if(i.length>0){r.push(`## \u4ED5\u69D8\u66F8\u306E\u96DB\u5F62
|
|
191
191
|
|
|
192
|
-
**\u6A5F\u80FD\u30FB\u753B\u9762\u306E\u4ED5\u69D8\u66F8**\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\u3068\u304D\u306E\u672C\u6587\u306F\u3001\u4EE5\u4E0B\u306E\u96DB\u5F62\u306B\u5F93\u3046\u3002\u4E00\u89A7 CSV\u30FB\u9818\u57DF\u306E README \u306A\u3069\u4ED5\u69D8\u66F8\u4EE5\u5916\u306E\u30D5\u30A1\u30A4\u30EB\u306B\u306F\u4F7F\u308F\u306A\u3044\u3002\u65E2\u5B9A\u306F **\u3010\u4ED5\u69D8\u66F8\u3011\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u2460\uFF08\u30D3\u30B8\u30CD\u30B9\u30B5\u30A4\u30C9\u5411\u3051\uFF09** \u3068\u3057\u3001\u4E0A\u8A18\u306E\u7406\u60F3 docs \u69CB\u9020\u304C\u5225\u306E\u96DB\u5F62\u3092\u6307\u3057\u3066\u3044\u308B\u5834\u5408\u306F\u305D\u3061\u3089\u306B\u5F93\u3046\u3002`);for(let a of i){let c=
|
|
192
|
+
**\u6A5F\u80FD\u30FB\u753B\u9762\u306E\u4ED5\u69D8\u66F8**\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\u3068\u304D\u306E\u672C\u6587\u306F\u3001\u4EE5\u4E0B\u306E\u96DB\u5F62\u306B\u5F93\u3046\u3002\u4E00\u89A7 CSV\u30FB\u9818\u57DF\u306E README \u306A\u3069\u4ED5\u69D8\u66F8\u4EE5\u5916\u306E\u30D5\u30A1\u30A4\u30EB\u306B\u306F\u4F7F\u308F\u306A\u3044\u3002\u65E2\u5B9A\u306F **\u3010\u4ED5\u69D8\u66F8\u3011\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u2460\uFF08\u30D3\u30B8\u30CD\u30B9\u30B5\u30A4\u30C9\u5411\u3051\uFF09** \u3068\u3057\u3001\u4E0A\u8A18\u306E\u7406\u60F3 docs \u69CB\u9020\u304C\u5225\u306E\u96DB\u5F62\u3092\u6307\u3057\u3066\u3044\u308B\u5834\u5408\u306F\u305D\u3061\u3089\u306B\u5F93\u3046\u3002`);for(let a of i){let c=Y2(a.content);r.push(`### ${a.relativePath}
|
|
193
193
|
|
|
194
194
|
${c}md
|
|
195
195
|
${a.content.trimEnd()}
|
|
196
196
|
${c}`)}}else r.push(`## \u4ED5\u69D8\u66F8\u306E\u96DB\u5F62\u304C\u8AAD\u307F\u53D6\u308C\u306A\u3044
|
|
197
197
|
|
|
198
|
-
\u914D\u5E03\u7269\u304B\u3089\u4ED5\u69D8\u66F8\u306E\u96DB\u5F62\u3092\u8AAD\u307F\u53D6\u308C\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u96DB\u5F62\u3092\u6E21\u305B\u3066\u3044\u306A\u3044\u3002\u96DB\u5F62\u3092\u5275\u4F5C\u3057\u3066\u306F\u306A\u3089\u305A\u3001\u65E2\u5B58\u4ED5\u69D8\u66F8\u306E\u7AE0\u7ACB\u3066\u3092\u6D41\u7528\u3057\u3066\u4EE3\u7528\u3059\u308B\u3053\u3068\u3082\u3057\u306A\u3044\u3002**\u6A5F\u80FD\u30FB\u753B\u9762\u306E\u4ED5\u69D8\u66F8\u306E\u65B0\u898F\u4F5C\u6210\u306F\u898B\u9001\u308B**\u3053\u3068\uFF08\u4E00\u89A7 CSV\u30FB\u9818\u57DF\u306E README \u306F\u96DB\u5F62\u3092\u4F7F\u308F\u306A\u3044\u305F\u3081\u3001\u3053\u306E\u7BC0\u306E\u5F71\u97FF\u3092\u53D7\u3051\u306A\u3044\uFF09\u3002\u305D\u306E\u3046\u3048\u3067\u3001**\u96DB\u5F62\u3092\u8AAD\u3081\u306A\u304B\u3063\u305F\u305F\u3081\u306B\u4ED5\u69D8\u66F8\u306E\u65B0\u898F\u4F5C\u6210\u3092\u898B\u9001\u3063\u305F\u65E8\u3092\u6700\u7D42\u5831\u544A\u306B\u5FC5\u305A\u542B\u3081\u308B\u3053\u3068**\u3002`);let s=
|
|
198
|
+
\u914D\u5E03\u7269\u304B\u3089\u4ED5\u69D8\u66F8\u306E\u96DB\u5F62\u3092\u8AAD\u307F\u53D6\u308C\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u96DB\u5F62\u3092\u6E21\u305B\u3066\u3044\u306A\u3044\u3002\u96DB\u5F62\u3092\u5275\u4F5C\u3057\u3066\u306F\u306A\u3089\u305A\u3001\u65E2\u5B58\u4ED5\u69D8\u66F8\u306E\u7AE0\u7ACB\u3066\u3092\u6D41\u7528\u3057\u3066\u4EE3\u7528\u3059\u308B\u3053\u3068\u3082\u3057\u306A\u3044\u3002**\u6A5F\u80FD\u30FB\u753B\u9762\u306E\u4ED5\u69D8\u66F8\u306E\u65B0\u898F\u4F5C\u6210\u306F\u898B\u9001\u308B**\u3053\u3068\uFF08\u4E00\u89A7 CSV\u30FB\u9818\u57DF\u306E README \u306F\u96DB\u5F62\u3092\u4F7F\u308F\u306A\u3044\u305F\u3081\u3001\u3053\u306E\u7BC0\u306E\u5F71\u97FF\u3092\u53D7\u3051\u306A\u3044\uFF09\u3002\u305D\u306E\u3046\u3048\u3067\u3001**\u96DB\u5F62\u3092\u8AAD\u3081\u306A\u304B\u3063\u305F\u305F\u3081\u306B\u4ED5\u69D8\u66F8\u306E\u65B0\u898F\u4F5C\u6210\u3092\u898B\u9001\u3063\u305F\u65E8\u3092\u6700\u7D42\u5831\u544A\u306B\u5FC5\u305A\u542B\u3081\u308B\u3053\u3068**\u3002`);let s=cU();return s.length>0&&r.push(`## \u4E00\u89A7 CSV \u306E\u5217\u5B9A\u7FA9
|
|
199
199
|
|
|
200
200
|
\u6B20\u640D\u3057\u305F\u4E00\u89A7 CSV \u3092\u4F5C\u6210\u3059\u308B\u3068\u304D\u306F\u3001\u30D5\u30A1\u30A4\u30EB\u540D\u304C\u4E00\u81F4\u3059\u308B\u4EE5\u4E0B\u306E\u30D8\u30C3\u30C0\u30FC\u884C\u304B\u3089\u59CB\u3081\u308B\uFF08\u904E\u53BB\u306E\u6A5F\u80FD\u30FB\u753B\u9762\u306E\u884C\u3092\u9061\u3063\u3066\u5275\u4F5C\u3057\u306A\u3044\u3002\u4ECA\u56DE\u306E\u5909\u66F4\u306B\u5BFE\u5FDC\u3059\u308B\u884C\u3060\u3051\u3092\u8FFD\u52A0\u3059\u308B\uFF09\u3002\u4E00\u81F4\u3059\u308B\u3082\u306E\u304C\u7121\u3044 CSV \u306F\u5217\u3092\u5275\u4F5C\u305B\u305A\u3001\u4F5C\u6210\u3092\u898B\u9001\u3063\u3066\u6700\u7D42\u5831\u544A\u306B\u542B\u3081\u308B\u3053\u3068\u3002
|
|
201
201
|
|
|
202
202
|
`+s.map(({relativePath:a,header:c})=>`- \`${a}\`: \`${c}\``).join(`
|
|
203
|
-
`)),
|
|
203
|
+
`)),Yn(e,"docs",r.join(`
|
|
204
204
|
|
|
205
|
-
`),t.project_root)}var
|
|
205
|
+
`),t.project_root)}var Ra,Xi,eE,tU,rU,sU,Q2,X2,nE=b(()=>{"use strict";Xe();Ra=require("node:fs"),Xi=require("node:path");Ar();tp();eE=m.object({changes:m.string().max(2e5).optional().describe("\u5909\u66F4\u5185\u5BB9\uFF08\u30B3\u30FC\u30C9\u5909\u66F4\u306E\u6982\u8981\uFF09"),target_sections:m.array(m.string().max(1e3)).optional().describe("\u66F4\u65B0\u5BFE\u8C61\u30BB\u30AF\u30B7\u30E7\u30F3\uFF08\u4F8B: 001_project, 003_requirements, 005_architecture\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")}),tU="<!-- godd:docs-index:start -->",rU="<!-- godd:docs-index:end -->";sU="\u3010\u4ED5\u69D8\u66F8\u3011\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8",Q2=6e4});function iE(e,t){let r=ny(),n=[];if(t.project_name&&n.push(`## \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D
|
|
206
206
|
${t.project_name}`),r.length===0)n.push("## \u8B66\u544A\n\u30D0\u30F3\u30C9\u30EB\u6E08\u307F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\n`godd-mcp-server/templates/notes-docs/` \u304C\u5B58\u5728\u3059\u308B\u304B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n`godd-docs-init` \u30C4\u30FC\u30EB\u3092\u4EE3\u308F\u308A\u306B\u4F7F\u7528\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002");else{let o=r.map(i=>`- docs/${i.relativePath}`).join(`
|
|
207
207
|
`);n.push(`## \u5C55\u958B\u3059\u308B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30D5\u30A1\u30A4\u30EB\uFF08${r.length} \u4EF6\uFF09
|
|
208
208
|
|
|
@@ -213,43 +213,38 @@ ${t.project_name}`),r.length===0)n.push("## \u8B66\u544A\n\u30D0\u30F3\u30C9\u30
|
|
|
213
213
|
|
|
214
214
|
\`\`\`${s}
|
|
215
215
|
${i.content.trimEnd()}
|
|
216
|
-
\`\`\``)}}return
|
|
217
|
-
|
|
218
|
-
`),t.project_root)}var
|
|
219
|
-
godd-knowledge-projects \u3067\u4FDD\u5B58\u3067\u304D\u308B project \u3092\u78BA\u8A8D\u3057\u3001\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`:e===413?`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\u3002${t}`:e===422?`\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${t}`:`Knowledge DB \u3078\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}async function
|
|
220
|
-
`)}var np,eo,
|
|
221
|
-
GoDD \u306E\u958B\u767A\u30C1\u30FC\u30E0\u306E Slack \u306B\u3082\u901A\u77E5\u3055\u308C\u307E\u3059\u3002`}function
|
|
222
|
-
godd-knowledge-projects \u3067\u691C\u7D22\u3067\u304D\u308B project \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:e===422?`\u691C\u7D22\u6761\u4EF6\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${t}`:e===502?`\u610F\u5473\u691C\u7D22\u306B\u4F7F\u3046 embedding \u3092\u751F\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002keywords\uFF08\u56FA\u6709\u540D\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u540D\u30FB\u8A2D\u5B9A\u30AD\u30FC\u540D\u306A\u3069\uFF09\u3092\u6307\u5B9A\u3057\u3066\u547C\u3073\u76F4\u3059\u3068\u3001\u30AD\u30FC\u30EF\u30FC\u30C9\u691C\u7D22\u3060\u3051\u3067\u63A2\u305B\u307E\u3059\u3002\uFF08${t}\uFF09`:`Knowledge DB \u306E\u691C\u7D22\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}async function
|
|
223
|
-
config.godd \u306E knowledge.project_id \u306F\u66F8\u304D\u63DB\u3048\u305A\u3001\u305D\u306E project \u306E\u4ED8\u4E0E\u3092\u7BA1\u7406\u8005\u306B\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`:
|
|
224
|
-
`)}var
|
|
225
|
-
`)}var
|
|
226
|
-
\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u8005\u306B godd-knowledge-search-general \u306E\u8A31\u53EF\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:
|
|
227
|
-
`)}var _E,
|
|
228
|
-
`)}var
|
|
229
|
-
`,"utf-8"),(0,
|
|
230
|
-
${e.content}`}function
|
|
231
|
-
`)}if(t.action==="recall"){let s=
|
|
232
|
-
\u30AF\u30A8\u30EA\u300C${t.query??""}\u300D\u306B\u4E00\u81F4\u3059\u308B\u8A18\u61B6\u306F\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u5168 ${s.length} \u4EF6\uFF09\u3002`;let c=a.map(
|
|
233
|
-
`)}let n=
|
|
216
|
+
\`\`\``)}}return Yn(e,"notes-init",n.join(`
|
|
217
|
+
|
|
218
|
+
`),t.project_root)}var oE,sE=b(()=>{"use strict";Xe();Ar();tp();oE=m.object({project_name:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D\uFF08\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u5185\u306E [\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC] \u306B\u7F6E\u63DB\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 ge(e){return e instanceof Error?e.message:String(e)}var Yt=b(()=>{"use strict"});function Xn(e){let t=(0,aE.join)(e,Ht);if(!(0,rp.existsSync)(t))return;let r;try{r=_r.load((0,rp.readFileSync)(t,"utf-8"))}catch(o){throw new Error(`${Ht} \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: ${ge(o)}`)}let n=lU.safeParse(r??{});if(!n.success)throw new Error(`${Ht} \u306E knowledge.project_id \u304C\u4E0D\u6B63\u3067\u3059\uFF08UUID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09: ${n.error.issues.map(o=>o.message).join(", ")}`);return n.data.knowledge?.project_id}var rp,aE,lU,Ia=b(()=>{"use strict";rp=require("node:fs"),aE=require("node:path");Ns();Xe();Nn();Yt();lU=m.object({knowledge:m.object({project_id:m.string().uuid().optional()}).optional()})});function oy(e){return dU[(0,eo.extname)(e).toLowerCase()]}function iy(e,t){return e.map(r=>{let n=(0,eo.isAbsolute)(r)?r:(0,eo.resolve)(t,r),o;try{o=(0,np.statSync)(n)}catch{throw new Error(`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${r}\uFF08\u89E3\u6C7A\u5F8C\u306E\u30D1\u30B9: ${n}\uFF09`)}if(!o.isFile())throw new Error(`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u304C\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u3042\u308A\u307E\u305B\u3093: ${r}`);try{return{fileName:(0,eo.basename)(n),bytes:(0,np.readFileSync)(n)}}catch(i){throw new Error(`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: ${r} \u2014 ${ge(i)}`)}})}function fU(e,t){if(e!==void 0)return e;let r=Xn(t);if(r!==void 0)return r;throw new Error("\u4FDD\u5B58\u5148\u306E project \u304C\u6C7A\u307E\u3063\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u4FDD\u5B58\u3057\u3066\u3044\u307E\u305B\u3093\u3002godd-knowledge-projects \u3067\u4FDD\u5B58\u3067\u304D\u308B project \u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u3001\u5185\u5BB9\u306B\u5408\u3046\u5019\u88DC\u3092\u9078\u3093\u3067\u3001\u4FDD\u5B58\u524D\u306B\u5FC5\u305A\u30E6\u30FC\u30B6\u30FC\u306B\u78BA\u8A8D\u3057\u3066\u304B\u3089\u3001project_id \u3092\u6307\u5B9A\u3057\u3066\u3082\u3046\u4E00\u5EA6\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002\uFF08\u3053\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u65E2\u5B9A\u306E\u4FDD\u5B58\u5148\u306B\u3059\u308B\u306A\u3089\u3001config.godd \u306B knowledge.project_id \u3092\u8A2D\u5B9A\u3067\u304D\u307E\u3059\uFF09")}function hU(e,t){let r=new FormData;r.append("project_id",e.project_id),r.append("title",e.title),r.append("body",e.body);for(let n of t){let o=oy(n.fileName),i=new Blob([new Uint8Array(n.bytes)],o?{type:o}:void 0);r.append("attachments",i,n.fileName)}return r}function es(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:JSON.stringify(r)}}catch{}return e}function sy(e,t,r){let n=tt(e,t,r);return n||(e===401?"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002godd-config \u3067 GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403?`\u4FDD\u5B58\u5148\u306E project \u304C\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u7D42\u4E86\u3057\u3066\u3044\u308B\u3001\u307E\u305F\u306F\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u671F\u9650\u5207\u308C\u3067\u3059\u3002${t}
|
|
219
|
+
godd-knowledge-projects \u3067\u4FDD\u5B58\u3067\u304D\u308B project \u3092\u78BA\u8A8D\u3057\u3001\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`:e===413?`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\u3002${t}`:e===422?`\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${t}`:`Knowledge DB \u3078\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}async function uE(e,t){let r=zt(e,t.project_root).root,n=fU(t.project_id,r),o=iy(t.attachments??[],r),i=hU({...t,project_id:n},o),s=e.config.registry_url.replace(/\/+$/,""),a,c;try{a=await fetch(`${s}/knowledge`,{method:"POST",headers:{Authorization:`Bearer ${e.config.license_key}`},body:i,signal:AbortSignal.timeout(9e4)}),c=await a.text()}catch(l){throw new Error(`Knowledge DB \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ge(l)}`)}if(!a.ok)throw new za(a.status,sy(a.status,es(c).slice(0,300),e.config.auth_source));let u;try{u=JSON.parse(c)}catch{throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${c.slice(0,200)}`)}let p=pU.safeParse(u);if(!p.success)throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${p.error.message}`);return mU(p.data,t.title)}function mU(e,t){if(!e.saved)return`\u77E5\u898B\u306F\u4FDD\u5B58\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F: ${t}\uFF08id: ${e.id}\uFF09`;let r=[`\u77E5\u898B\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F: ${t}`,`- \u4FDD\u5B58\u5148: ${e.project.name}\uFF08project id: ${e.project.id}\uFF09`,`- id: ${e.id}`];e.attachments.length>0&&r.push(`- \u6DFB\u4ED8 ${e.attachments.length} \u4EF6: ${e.attachments.map(n=>n.file_name).join(", ")}`),e.embedded||r.push("- \u6CE8\u610F: embedding \u306E\u751F\u6210\u306B\u5931\u6557\u3057\u305F\u305F\u3081\u3001\u610F\u5473\u691C\u7D22\u3067\u306F\u5F53\u9762\u30D2\u30C3\u30C8\u3057\u307E\u305B\u3093\uFF08\u4FDD\u5B58\u81EA\u4F53\u306F\u6210\u529F\u3057\u3066\u3044\u307E\u3059\uFF09");for(let n of e.warnings)r.push(`- \u8B66\u544A: ${n}`);return r.join(`
|
|
220
|
+
`)}var np,eo,cE,pU,za,dU,op=b(()=>{"use strict";Xe();np=require("node:fs"),eo=require("node:path");Ar();Ia();Yt();Br();cE=m.object({title:m.string().min(1,"title \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("\u77E5\u898B\u306E 1 \u884C\u8981\u7D04\uFF08\u4E00\u89A7\u8868\u793A\u30FB\u4EBA\u9593\u306E\u30EC\u30D3\u30E5\u30FC\u7528\uFF09"),body:m.string().min(1,"body \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("\u77E5\u898B\u306E\u672C\u6587\u30021 \u884C\u76EE\u306B\u7D50\u8AD6\u3092 1 \u6587\u3001\u4EE5\u964D\u306B\u80CC\u666F\u30FB\u9069\u7528\u6761\u4EF6\u30FB\u6CE8\u610F\u70B9\u3002200\u301C600 \u5B57\u76EE\u5B89"),attachments:m.array(m.string().min(1).max(4e3)).optional().describe("\u6DFB\u4ED8\u3059\u308B\u30ED\u30FC\u30AB\u30EB\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\u3002\u7D76\u5BFE\u30D1\u30B9\u3001\u307E\u305F\u306F project_root \u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9"),project_id:m.string().uuid("project_id \u306F godd-knowledge-projects \u304C\u8FD4\u3059 UUID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044").optional().describe("\u4FDD\u5B58\u5148 project \u306E id\uFF08godd-knowledge-projects \u3067\u53D6\u5F97\uFF09\u3002\u7701\u7565\u6642\u306F config.godd \u306E knowledge.project_id"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u76F8\u5BFE\u30D1\u30B9\u306E\u6DFB\u4ED8\u3068 config.godd \u3092\u89E3\u6C7A\u3059\u308B\u57FA\u6E96\u3002\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),pU=m.object({id:m.string(),saved:m.boolean(),embedded:m.boolean(),attachments:m.array(m.object({id:m.string(),file_name:m.string(),mime_type:m.string().nullable().optional()})),warnings:m.array(m.string()),project:m.object({id:m.string(),name:m.string(),description:m.string().nullable().optional()})}),za=class extends Error{constructor(r,n){super(n);this.status=r;this.name="KnowledgeSaveError"}},dU={".txt":"text/plain",".log":"text/plain",".md":"text/markdown",".csv":"text/csv",".json":"application/json",".yaml":"application/yaml",".yml":"application/yaml",".xml":"application/xml",".html":"text/html",".css":"text/css",".js":"text/javascript",".ts":"text/plain",".py":"text/x-python",".sh":"application/x-sh",".sql":"application/sql",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".pdf":"application/pdf",".zip":"application/zip",".gz":"application/gzip"}});async function pE(e,t){let r=e.config.registry_url.replace(/\/+$/,""),n,o;try{n=await fetch(`${r}/v1/feedback`,{method:"POST",headers:{Authorization:`Bearer ${e.config.license_key}`,"Content-Type":"application/json"},body:JSON.stringify({...t,tool:t.tool?.replace(gU,"")}),signal:AbortSignal.timeout(3e4)}),o=await n.text()}catch(a){throw new Error(`GoDD API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ge(a)}`)}if(!n.ok)throw new Error(_U(n.status,I1(o).slice(0,300),e));let i;try{i=JSON.parse(o)}catch{throw new Error(`\u6539\u5584\u8981\u671B\u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${o.slice(0,200)}`)}let s=yU.safeParse(i);if(!s.success)throw new Error(`\u6539\u5584\u8981\u671B\u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${s.error.message}`);return`\u6539\u5584\u8981\u671B\u3092\u9001\u308A\u307E\u3057\u305F: #${s.data.number} ${s.data.url}
|
|
221
|
+
GoDD \u306E\u958B\u767A\u30C1\u30FC\u30E0\u306E Slack \u306B\u3082\u901A\u77E5\u3055\u308C\u307E\u3059\u3002`}function _U(e,t,r){let n=tt(e,t,r.config.auth_source);return n||(e===401?"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002godd-config \u3067 GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403?"\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u3067\u306F godd-feedback \u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002":`\u6539\u5584\u8981\u671B\u3092\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F: ${e} ${t}`)}var gU,lE,yU,dE=b(()=>{"use strict";Xe();Br();Yt();gU=/^mcp__[A-Za-z0-9_-]+?__/,lE=m.object({tool:m.string().regex(/^(?:mcp__[A-Za-z0-9_-]+?__)?[a-z0-9][a-z0-9-]{0,63}$/,"tool \u306F godd-dev \u306E\u3088\u3046\u306A GoDD \u306E\u30C4\u30FC\u30EB\u540D\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044").optional().describe("\u5BFE\u8C61\u306E GoDD \u30C4\u30FC\u30EB\u540D\uFF08\u4F8B: godd-dev\uFF09\u3002\u7279\u5B9A\u306E\u30C4\u30FC\u30EB\u306E\u8A71\u3067\u306A\u3051\u308C\u3070\u7701\u7565"),title:m.string().trim().min(1,"title \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(200).describe("\u8981\u671B\u306E 1 \u884C\u8981\u7D04"),body:m.string().trim().min(1,"body \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(2e4).describe("\u3069\u3093\u306A\u5834\u9762\u3067\u4F55\u304C\u8D77\u304D\u305F\u304B\u3001\u3069\u3046\u306A\u3063\u3066\u307B\u3057\u3044\u304B")}),yU=m.object({number:m.number(),url:m.string()})});function ay(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:JSON.stringify(r)}}catch{}return e}function cy(e,t,r){let n=tt(e,t,r);return n||(e===401?"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002godd-config \u3067 GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403?`\u6307\u5B9A\u3057\u305F project \u304C\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u671F\u9650\u5207\u308C\u3001\u307E\u305F\u306F\u3053\u306E\u64CD\u4F5C\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${t}
|
|
222
|
+
godd-knowledge-projects \u3067\u691C\u7D22\u3067\u304D\u308B project \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:e===422?`\u691C\u7D22\u6761\u4EF6\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${t}`:e===502?`\u610F\u5473\u691C\u7D22\u306B\u4F7F\u3046 embedding \u3092\u751F\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002keywords\uFF08\u56FA\u6709\u540D\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u540D\u30FB\u8A2D\u5B9A\u30AD\u30FC\u540D\u306A\u3069\uFF09\u3092\u6307\u5B9A\u3057\u3066\u547C\u3073\u76F4\u3059\u3068\u3001\u30AD\u30FC\u30EF\u30FC\u30C9\u691C\u7D22\u3060\u3051\u3067\u63A2\u305B\u307E\u3059\u3002\uFF08${t}\uFF09`:`Knowledge DB \u306E\u691C\u7D22\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}async function hE(e,t){let r=e.config.registry_url.replace(/\/+$/,""),n=t.project_id===void 0?Xn(zt(e,t.project_root).root):void 0,o=t.project_id??n;if(o===void 0)throw new Error("\u691C\u7D22\u3059\u308B project \u304C\u6C7A\u307E\u3063\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u691C\u7D22\u3057\u3066\u3044\u307E\u305B\u3093\u3002godd-knowledge-projects \u3067\u4ED8\u4E0E\u3055\u308C\u305F project \u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u3001\u3053\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u306B\u8A72\u5F53\u3057\u305D\u3046\u306A project \u3092\u9078\u3093\u3067\u3001config.godd \u306B knowledge.project_id \u3068\u3057\u3066\u8FFD\u52A0\u3059\u308B\u304B\u3092\u30E6\u30FC\u30B6\u30FC\u306B\u63D0\u6848\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u81EA\u5206\u3067\u306F\u66F8\u304D\u8FBC\u307E\u306A\u3044\uFF09\u3002\u30E6\u30FC\u30B6\u30FC\u304C project \u3092\u78BA\u8A8D\u30FB\u6307\u793A\u3057\u305F\u5834\u5408\u3060\u3051\u3001project_id \u3092\u6307\u5B9A\u3057\u3066\u3082\u3046\u4E00\u5EA6\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u4ED6\u306E\u6848\u4EF6\u306E\u77E5\u898B\u306F godd-knowledge-search-general\uFF08\u533F\u540D\u5316\u3055\u308C\u305F\u30CA\u30EC\u30C3\u30B8\u5C64\uFF09\u3067\u691C\u7D22\u3067\u304D\u307E\u3059\u3002");let i,s;try{i=await fetch(`${r}/knowledge/search`,{method:"POST",headers:{Authorization:`Bearer ${e.config.license_key}`,"Content-Type":"application/json"},body:JSON.stringify({query:t.query,keywords:t.keywords,project_id:o}),signal:AbortSignal.timeout(3e4)}),s=await i.text()}catch(u){throw new Error(`Knowledge DB \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ge(u)}`)}if(!i.ok){let u=ay(s).slice(0,300),p=i.status===403&&n!==void 0?`config.godd \u306E knowledge.project_id \u306E project \u304C\u3001\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306B\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u671F\u9650\u5207\u308C\u3001\u307E\u305F\u306F\u3053\u306E\u64CD\u4F5C\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${u}
|
|
223
|
+
config.godd \u306E knowledge.project_id \u306F\u66F8\u304D\u63DB\u3048\u305A\u3001\u305D\u306E project \u306E\u4ED8\u4E0E\u3092\u7BA1\u7406\u8005\u306B\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`:cy(i.status,u,e.config.auth_source);throw new Da(i.status,p)}let a;try{a=JSON.parse(s)}catch{throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${s.slice(0,200)}`)}let c=vU.safeParse(a);if(!c.success)throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${c.error.message}`);return wU(c.data,t.query)}function wU(e,t){let r=[];e.results.length===0?r.push(`\u8A72\u5F53\u3059\u308B\u77E5\u898B\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF08query: ${t}\uFF09`):r.push(`${e.results.length} \u4EF6\u306E\u77E5\u898B\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\uFF08query: ${t}\uFF09`);for(let n of e.warnings)r.push(`- \u8B66\u544A: ${n}`);return e.results.forEach((n,o)=>{r.push(""),r.push(`## ${o+1}. ${n.title}`),r.push(`id: ${n.id} / ${n.created_at}`),r.push(""),r.push(n.body),n.attachments.length>0&&(r.push(""),r.push(`\u6DFB\u4ED8\uFF08godd-knowledge-attachment \u3067\u53D6\u5F97\uFF09: ${n.attachments.map(i=>`${i.file_name} [${i.id}]`).join(", ")}`))}),r.join(`
|
|
224
|
+
`)}var fE,vU,Da,uy=b(()=>{"use strict";Xe();Ar();Ia();Yt();Br();fE=m.object({query:m.string().min(1,"query \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("\u63A2\u3057\u3066\u3044\u308B\u5185\u5BB9\u3092\u8AAC\u660E\u3059\u308B\u81EA\u7136\u6587\u3002\u610F\u5473\u691C\u7D22\u306B\u4F7F\u3046"),keywords:m.array(m.string()).optional().describe("\u30AD\u30FC\u30EF\u30FC\u30C9\u691C\u7D22\u306B\u4F7F\u3046\u8A9E\u306E\u914D\u5217\u3002\u56FA\u6709\u540D\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u540D\u30FB\u8A2D\u5B9A\u30AD\u30FC\u540D\u306A\u3069 2\u301C5 \u8A9E"),project_id:m.string().uuid("project_id \u306F UUID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044").optional().describe("\u691C\u7D22\u3059\u308B project \u306E ID\uFF08godd-knowledge-projects \u3067\u78BA\u8A8D\uFF09\u3002\u30E6\u30FC\u30B6\u30FC\u304C\u78BA\u8A8D\u30FB\u6307\u793A\u3057\u305F\u5834\u5408\u3060\u3051\u6307\u5B9A\u3059\u308B\u3002\u7701\u7565\u6642\u306F config.godd \u306E knowledge.project_id\u3002\u3069\u3061\u3089\u3082\u7121\u3051\u308C\u3070\u691C\u7D22\u3057\u306A\u3044"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08config.godd \u3092\u89E3\u6C7A\u3059\u308B\u57FA\u6E96\u3002\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),vU=m.object({results:m.array(m.object({id:m.string(),title:m.string(),body:m.string(),created_at:m.string(),attachments:m.array(m.object({id:m.string(),file_name:m.string(),mime_type:m.string().nullable().optional()}))})),warnings:m.array(m.string())}),Da=class extends Error{constructor(r,n){super(n);this.status=r;this.name="KnowledgeSearchError"}}});function xU(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:JSON.stringify(r)}}catch{}return e}function kU(e,t,r){let n=tt(e,t,r);return n||(e===401?"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002godd-config \u3067 GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403?`\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u671F\u9650\u5207\u308C\u3001\u307E\u305F\u306F\u3053\u306E\u64CD\u4F5C\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${t}`:e===404?"\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002ID \u304C\u9593\u9055\u3063\u3066\u3044\u308B\u304B\u3001\u7D10\u3065\u304F\u77E5\u898B\u304C\u53D6\u308A\u4E0B\u3052\u6E08\u307F\u304B\u3001\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044 project \u306E\u3082\u306E\u3067\u3059\u3002":`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u306E URL \u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}async function gE(e,t){let r=e.config.registry_url.replace(/\/+$/,""),n=encodeURIComponent(t.attachment_id),o,i;try{o=await fetch(`${r}/knowledge/attachments/${n}`,{method:"GET",headers:{Authorization:`Bearer ${e.config.license_key}`},signal:AbortSignal.timeout(3e4)}),i=await o.text()}catch(f){throw new Error(`Knowledge DB \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ge(f)}`)}if(!o.ok)throw new ly(o.status,kU(o.status,xU(i).slice(0,300),e.config.auth_source));let s;try{s=JSON.parse(i)}catch{throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${i.slice(0,200)}`)}let a=bU.safeParse(s);if(!a.success)throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${a.error.message}`);let{file_name:c,mime_type:u,url:p,expires_in:l}=a.data,d=Math.round(l/60);return[`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u306E\u53D6\u5F97 URL \u3092\u767A\u884C\u3057\u307E\u3057\u305F: ${c}`,u?`- \u7A2E\u985E: ${u}`:void 0,`- \u6709\u52B9\u671F\u9650: \u7D04 ${d} \u5206`,`- URL: ${p}`].filter(f=>f!==void 0).join(`
|
|
225
|
+
`)}var mE,bU,ly,yE=b(()=>{"use strict";Xe();Yt();Br();mE=m.object({attachment_id:m.string().min(1,"attachment_id \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("godd-knowledge-search \u306E\u7D50\u679C\u306B\u8868\u793A\u3055\u308C\u305F\u6DFB\u4ED8\u306E ID")}),bU=m.object({id:m.string(),file_name:m.string(),mime_type:m.string().nullable().optional(),url:m.string(),expires_in:m.number()}),ly=class extends Error{constructor(r,n){super(n);this.status=r;this.name="KnowledgeAttachmentError"}}});function $U(e,t,r){let n=tt(e,t,r);return n||(e===403?`\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306B\u306F\u30CA\u30EC\u30C3\u30B8\u5C64\u306E\u691C\u7D22\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u671F\u9650\u5207\u308C\u3067\u3059\u3002${t}
|
|
226
|
+
\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u8005\u306B godd-knowledge-search-general \u306E\u8A31\u53EF\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:cy(e,t,r))}async function vE(e,t){let r=e.config.registry_url.replace(/\/+$/,""),n,o;try{n=await fetch(`${r}/knowledge/general/search`,{method:"POST",headers:{Authorization:`Bearer ${e.config.license_key}`,"Content-Type":"application/json"},body:JSON.stringify({query:t.query,keywords:t.keywords}),signal:AbortSignal.timeout(3e4)}),o=await n.text()}catch(a){throw new Error(`Knowledge DB \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ge(a)}`)}if(!n.ok)throw new Da(n.status,$U(n.status,ay(o).slice(0,300),e.config.auth_source));let i;try{i=JSON.parse(o)}catch{throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${o.slice(0,200)}`)}let s=SU.safeParse(i);if(!s.success)throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${s.error.message}`);return PU(s.data,t.query)}function PU(e,t){let r=[];e.results.length===0?r.push(`\u30CA\u30EC\u30C3\u30B8\u5C64\u306B\u8A72\u5F53\u3059\u308B\u77E5\u898B\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF08query: ${t}\uFF09`):r.push(`\u30CA\u30EC\u30C3\u30B8\u5C64\u304B\u3089 ${e.results.length} \u4EF6\u306E\u77E5\u898B\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\uFF08query: ${t}\uFF09\u3002\u3044\u305A\u308C\u3082\u4ED6\u306E\u6848\u4EF6\u306E\u77E5\u898B\u3092\u533F\u540D\u5316\u3057\u305F\u3082\u306E\u3067\u3059`);for(let n of e.warnings)r.push(`- \u8B66\u544A: ${n}`);return e.results.forEach((n,o)=>{r.push(""),r.push(`## ${o+1}. ${n.title}`),r.push(`id: ${n.id} / ${n.generalized_at}`),r.push(""),r.push(n.body)}),r.join(`
|
|
227
|
+
`)}var _E,SU,wE=b(()=>{"use strict";Xe();uy();Yt();Br();_E=m.object({query:m.string().min(1,"query \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("\u63A2\u3057\u3066\u3044\u308B\u5185\u5BB9\u3092\u8AAC\u660E\u3059\u308B\u81EA\u7136\u6587\u3002\u610F\u5473\u691C\u7D22\u306B\u4F7F\u3046"),keywords:m.array(m.string()).optional().describe("\u30AD\u30FC\u30EF\u30FC\u30C9\u691C\u7D22\u306B\u4F7F\u3046\u8A9E\u306E\u914D\u5217\u3002\u753B\u9762\u540D\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u540D\u30FB\u8A2D\u5B9A\u30AD\u30FC\u540D\u306A\u3069 2\u301C5 \u8A9E")}),SU=m.object({results:m.array(m.object({id:m.string(),title:m.string(),body:m.string(),generalized_at:m.string()})),warnings:m.array(m.string())})});async function xE(e,t){let r=zt(e,t.project_root).root,n=Xn(r),o=e.config.registry_url.replace(/\/+$/,""),i,s;try{i=await fetch(`${o}/knowledge/projects`,{method:"GET",headers:{Authorization:`Bearer ${e.config.license_key}`},signal:AbortSignal.timeout(3e4)}),s=await i.text()}catch(u){throw new Error(`GoDD API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ge(u)}`)}if(!i.ok)throw new za(i.status,sy(i.status,es(s).slice(0,300),e.config.auth_source));let a;try{a=JSON.parse(s)}catch{throw new Error(`project \u4E00\u89A7\u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${s.slice(0,200)}`)}let c=EU.safeParse(a);if(!c.success)throw new Error(`project \u4E00\u89A7\u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${c.error.message}`);return CU(c.data,n)}function CU(e,t){if(e.length===0)return"\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306B\u4ED8\u4E0E\u3055\u308C\u305F project \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u77E5\u898B\u3092\u4FDD\u5B58\u30FB\u53C2\u7167\u3059\u308B\u306B\u306F\u3001GoDD Admin \u306E\u7BA1\u7406\u8005\u306B project \u306E\u4ED8\u4E0E\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002";let r=[`\u4FDD\u5B58\u3067\u304D\u308B project\uFF08${e.length} \u4EF6\uFF09:`];for(let n of e){let o=n.id===t?" \u2190 config.godd \u3067\u8A2D\u5B9A\u4E2D":"";r.push(`- ${n.name}\uFF08id: ${n.id}\uFF09${o}`),n.description&&r.push(` ${n.description}`)}return t===void 0?r.push("","config.godd \u306B knowledge.project_id \u304C\u7121\u3044\u305F\u3081\u3001\u4FDD\u5B58\u6642\u306F\u4E0A\u304B\u3089\u5019\u88DC\u3092\u9078\u3073\u3001\u4FDD\u5B58\u524D\u306B\u5FC5\u305A\u30E6\u30FC\u30B6\u30FC\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"):e.some(n=>n.id===t)||r.push("",`\u6CE8\u610F: config.godd \u306E knowledge.project_id\uFF08${t}\uFF09\u306F\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u3001\u7D42\u4E86\u3057\u3066\u3044\u307E\u3059\u3002\u3053\u306E\u307E\u307E\u3067\u306F\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3059\u308B\u3088\u3046\u3001\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`),r.join(`
|
|
228
|
+
`)}var bE,EU,kE=b(()=>{"use strict";Xe();Ar();Ia();op();Yt();bE=m.object({project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08config.godd \u306E knowledge.project_id \u3092\u8AAD\u3080\u57FA\u6E96\u3002\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),EU=m.array(m.object({id:m.string(),name:m.string(),description:m.string().nullable().optional()}))});function AU(e){return e.toLowerCase().split(/\s+/).map(t=>t.trim()).filter(t=>t.length>0)}function RU(e,t,r){let n=t.content.trim(),o=n.toLowerCase(),i=e.find(a=>a.content.trim().toLowerCase()===o);if(i)return{entries:e,entry:i,duplicate:!0};let s={id:r.id,content:n,tags:(t.tags??[]).map(a=>a.trim()).filter(a=>a.length>0),who:t.who?.trim()||"agent",createdAt:r.now,...t.source?.trim()?{source:t.source.trim()}:{}};return{entries:[...e,s],entry:s,duplicate:!1}}function SE(e,t,r={}){let n=r.limit??PE,o=AU(t),i=[...e].sort((u,p)=>u.createdAt<p.createdAt?-1:u.createdAt>p.createdAt?1:0),s=new Map;i.forEach((u,p)=>{let l=e.length<=1?1:p/(e.length-1);s.set(u.id,l)});let a=e.map(u=>{let p=u.content.toLowerCase(),l=u.tags.map(h=>h.toLowerCase()),d=0;for(let h of o)p.includes(h)&&(d+=2),l.some(g=>g.includes(h))&&(d+=3);let f=s.get(u.id)??0;return{entry:u,score:d+f,keywordScore:d}});return(o.length===0?a:a.filter(u=>u.keywordScore>0)).sort((u,p)=>p.score-u.score).slice(0,Math.max(0,n)).map(({entry:u,score:p})=>({entry:u,score:p}))}function EE(e){return(0,Oa.join)(e,$E)}function py(e){let t=EE(e);if(!(0,Kr.existsSync)(t))return[];try{let r=JSON.parse((0,Kr.readFileSync)(t,"utf-8"));return Array.isArray(r)?r.flatMap(n=>{if(!n||typeof n!="object")return[];let o=n;return typeof o.id!="string"||typeof o.content!="string"?[]:[{id:o.id,content:o.content,tags:Array.isArray(o.tags)?o.tags.filter(i=>typeof i=="string"):[],who:typeof o.who=="string"?o.who:"agent",createdAt:typeof o.createdAt=="string"?o.createdAt:"",...typeof o.source=="string"?{source:o.source}:{}}]}):[]}catch{return[]}}function IU(e,t){let r=EE(e);(0,Kr.mkdirSync)((0,Oa.dirname)(r),{recursive:!0});let n=`${r}.tmp-${(0,fy.randomUUID)()}`;(0,Kr.writeFileSync)(n,`${JSON.stringify(t,null,2)}
|
|
229
|
+
`,"utf-8"),(0,Kr.renameSync)(n,r)}function dy(e){let t=e.tags.length?` [${e.tags.join(", ")}]`:"",r=e.source?` (source: ${e.source})`:"";return`- (${e.createdAt} / ${e.who})${t}${r}
|
|
230
|
+
${e.content}`}function TE(e,t){let r=zt(e,t.project_root).root;if(t.action==="remember"){let s=t.content?.trim();if(!s)return"## \u30A8\u30E9\u30FC\nremember \u306B\u306F `content`\uFF08\u8A18\u61B6\u5185\u5BB9\uFF09\u304C\u5FC5\u8981\u3067\u3059\u3002";let a=py(r),{entries:c,entry:u,duplicate:p}=RU(a,{content:s,tags:t.tags,who:t.who,source:t.source},{id:(0,fy.randomUUID)(),now:new Date().toISOString()});return p||IU(r,c),[p?"## \u8A18\u61B6\u6E08\u307F\uFF08\u91CD\u8907\u306E\u305F\u3081\u30B9\u30AD\u30C3\u30D7\uFF09":"## \u8A18\u61B6\u3057\u307E\u3057\u305F",`- id: ${u.id}`,`- \u4FDD\u5B58\u5148: ${$E}`,`- \u7DCF\u8A18\u61B6\u6570: ${c.length} \u4EF6`,"",dy(u)].join(`
|
|
231
|
+
`)}if(t.action==="recall"){let s=py(r);if(s.length===0)return"## \u8A18\u61B6\u306A\u3057\n\u307E\u3060\u8A18\u61B6\u304C\u3042\u308A\u307E\u305B\u3093\uFF08`godd-memory action=remember` \u3067\u4FDD\u5B58\u3067\u304D\u307E\u3059\uFF09\u3002";let a=SE(s,t.query??"",{limit:t.limit});if(a.length===0)return`## \u8A72\u5F53\u306A\u3057
|
|
232
|
+
\u30AF\u30A8\u30EA\u300C${t.query??""}\u300D\u306B\u4E00\u81F4\u3059\u308B\u8A18\u61B6\u306F\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u5168 ${s.length} \u4EF6\uFF09\u3002`;let c=a.map(u=>dy(u.entry));return[`## \u60F3\u8D77\u3057\u305F\u8A18\u61B6\uFF08${a.length}/${s.length} \u4EF6\uFF09`,t.query?`\u30AF\u30A8\u30EA: ${t.query}`:"\uFF08\u30AF\u30A8\u30EA\u672A\u6307\u5B9A: \u65B0\u3057\u3044\u9806\uFF09","",...c].join(`
|
|
233
|
+
`)}let n=py(r),o=SE(n,t.query??"",{limit:t.limit??30});return["# \u8A18\u61B6\u306E\u7D71\u5408\uFF08consolidate\uFF09","","\u4EE5\u4E0B\u306F `.godd/memory/godd-memory.json` \u304B\u3089\u60F3\u8D77\u3057\u305F\u8A18\u61B6\u3067\u3059\u3002\u91CD\u8907\u30FB\u9673\u8150\u5316\u30FB\u77DB\u76FE\u3092\u8E0F\u307E\u3048\u3066\u6574\u7406\u3057\u3001","\u518D\u5229\u7528\u4FA1\u5024\u306E\u9AD8\u3044\u77E5\u898B\u3092 `.godd/memory/` \u306E\u6574\u7406\u6E08\u307F\u30CA\u30EC\u30C3\u30B8\u3078\u84B8\u7559\u3057\u3066\u304F\u3060\u3055\u3044\u3002","","## \u624B\u9806","1. \u60F3\u8D77\u3057\u305F\u8A18\u61B6\u3092\u4E3B\u984C\u3054\u3068\u306B\u30B0\u30EB\u30FC\u30D4\u30F3\u30B0\u3059\u308B\u3002","2. \u6052\u4E45\u7684\u306B\u6709\u7528\u306A\u3082\u306E\u3092\u6B21\u306E\u3044\u305A\u308C\u304B\u3078\u8981\u7D04\u3057\u3066\u8FFD\u8A18\u3059\u308B\uFF08\u65E2\u5B58\u3068\u77DB\u76FE\u3059\u308B\u5834\u5408\u306F\u660E\u8A18\uFF09:"," - `.godd/memory/decisions.yaml`\uFF08\u8A2D\u8A08\u5224\u65AD\uFF09"," - `.godd/memory/patterns.yaml`\uFF08\u6709\u52B9\u30D1\u30BF\u30FC\u30F3\uFF09"," - `.godd/memory/anti-patterns.yaml`\uFF08\u907F\u3051\u308B\u3079\u304D\u5931\u6557\uFF09"," - `.godd/memory/blockers.yaml`\uFF08\u8A70\u307E\u308A\u3068\u89E3\u6D88\uFF09","3. \u9673\u8150\u5316\u30FB\u91CD\u8907\u3057\u305F\u751F\u8A18\u61B6\u306F\u8981\u7D04\u5F8C\u306B\u6574\u7406\u5BFE\u8C61\u3068\u3057\u3066\u5831\u544A\u3059\u308B\uFF08\u524A\u9664\u306F\u4EBA\u624B\u5224\u65AD\uFF09\u3002","4. \u77DB\u76FE\u306F\u89E3\u6D88\u305B\u305A\u300C\u5BFE\u7ACB\u300D\u3068\u3057\u3066\u4E21\u8AD6\u4F75\u8A18\u3067\u6B8B\u3059\uFF08\u65E9\u3059\u304E\u308B\u6B63\u898F\u5316\u3092\u907F\u3051\u308B\uFF09\u3002","","## \u60F3\u8D77\u3057\u305F\u8A18\u61B6",o.length?o.map(s=>dy(s.entry)).join(`
|
|
234
234
|
`):"\uFF08\u5BFE\u8C61\u306E\u8A18\u61B6\u306A\u3057\uFF09"].join(`
|
|
235
|
-
`)}var
|
|
236
|
-
godd-knowledge-projects \u3067\u4FDD\u5B58\u3067\u304D\u308B project \u3092\u78BA\u8A8D\u3057\u3001\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`:e===413?`\u6210\u679C\u7269\u306E\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\u3002${t}`:e===422?`\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${t}`:`working record \u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}function
|
|
237
|
-
`)}var RE,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
\u6210\u679C\u7269: ${s.deliverables.map(ME).join(", ")}`:""));return[n.results.length>0?`working record \u304C ${n.results.length} \u4EF6\u898B\u3064\u304B\u308A\u307E\u3057\u305F\uFF08\u65B0\u3057\u3044\u9806\uFF09\u3002\u7D4C\u7DEF\u3092\u8AAD\u3080\u306B\u306F id \u3092\u6307\u5B9A\u3057\u3066\u547C\u3073\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:"\u6761\u4EF6\u306B\u5408\u3046 working record \u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002",...o,...n.warnings.map(s=>`- \u8B66\u544A: ${s}`)].join(`
|
|
242
|
-
`)}var DE,OE,NE,GU,VU,f_,ZE=b(()=>{"use strict";Ke();hr();ts();Da();Vt();Tr();DE=f.object({id:f.string().uuid("id \u306F\u4E00\u89A7\u3067\u8FD4\u3055\u308C\u305F UUID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044").optional().describe("\u8AAD\u3080\u8A18\u9332\u306E id\u3002\u6307\u5B9A\u3059\u308B\u3068\u8A73\u7D30\u3092\u8FD4\u3059"),tool_name:f.string().max(200).optional().describe("\u4F7F\u308F\u308C\u305F GoDD \u30C4\u30FC\u30EB\u3067\u7D5E\u308B\uFF08\u4F8B: godd-dev\uFF09"),since:f.string().datetime({offset:!0}).optional().describe("\u3053\u306E\u65E5\u6642\u4EE5\u964D\u306B\u4FDD\u5B58\u3055\u308C\u305F\u8A18\u9332\uFF08ISO 8601\uFF09"),until:f.string().datetime({offset:!0}).optional().describe("\u3053\u306E\u65E5\u6642\u4EE5\u524D\u306B\u4FDD\u5B58\u3055\u308C\u305F\u8A18\u9332\uFF08ISO 8601\uFF09"),url:f.string().max(4e3).optional().describe("\u6210\u679C\u7269\u306E\u30EA\u30F3\u30AF\u3067\u9006\u5F15\u304D\u3059\u308B\uFF08\u5B8C\u5168\u4E00\u81F4\uFF09"),keywords:f.array(f.string()).max(10).optional().describe("\u30BF\u30A4\u30C8\u30EB\u304B\u7D4C\u7DEF\u306B\u3059\u3079\u3066\u542B\u307E\u308C\u308B\u8A9E"),project_id:f.string().uuid("project_id \u306F UUID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044").optional().describe("\u63A2\u3059 project \u306E id\u3002\u30E6\u30FC\u30B6\u30FC\u304C\u78BA\u8A8D\u30FB\u6307\u793A\u3057\u305F\u5834\u5408\u3060\u3051\u6307\u5B9A\u3059\u308B\u3002\u7701\u7565\u6642\u306F config.godd \u306E knowledge.project_id"),project_root:f.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08config.godd \u306E\u89E3\u6C7A\u57FA\u6E96\u3002\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),OE=f.object({type:f.string(),title:f.string(),url:f.string().nullable().optional(),file_name:f.string().nullable().optional()}),NE=f.object({id:f.string(),name:f.string()}),GU=f.object({results:f.array(f.object({id:f.string(),title:f.string(),project:NE,sequence:f.number(),created_at:f.string(),tools:f.array(f.string()),deliverables:f.array(OE)})),warnings:f.array(f.string())}),VU=f.object({id:f.string(),title:f.string(),project:NE,sequence:f.number(),process:f.string(),mcp_version:f.string().nullable().optional(),started_at:f.string().nullable().optional(),created_at:f.string(),tools:f.array(f.object({tool_name:f.string(),steps:f.array(f.string()),definition_version:f.number().nullable().optional(),prompt_versions:f.record(f.number()).nullable().optional(),call_count:f.number()})),deliverables:f.array(OE.extend({body:f.string().nullable().optional(),download_url:f.string().nullable().optional()})),session_records:f.array(f.object({id:f.string(),sequence:f.number(),title:f.string(),created_at:f.string()})),download_url_expires_in:f.number().nullable().optional()}),f_=class extends Error{constructor(r,n){super(n);this.status=r;this.name="WorkingRecordSearchError"}}});var UE,qE=b(()=>{"use strict";G2();tp();rE();iE();Da();pE();a_();gE();vE();xE();TE();zE();ZE();UE={setup:(e,t)=>F2(e,q2.parse(t)),"docs-init":(e,t)=>K2(e,B2.parse(t)),docs:(e,t)=>tE(e,X2.parse(t)),"notes-init":(e,t)=>oE(e,nE.parse(t)),"knowledge-save":(e,t)=>cE(e,aE.parse(t)),feedback:(e,t)=>uE(e,lE.parse(t)),"knowledge-search":(e,t)=>fE(e,dE.parse(t)),"knowledge-attachment":(e,t)=>mE(e,hE.parse(t)),"knowledge-search-general":(e,t)=>yE(e,_E.parse(t)),"knowledge-projects":(e,t)=>bE(e,wE.parse(t)),memory:(e,t)=>CE(e,EE.parse(t)),"working-record-save":(e,t)=>IE(e,AE.parse(t)),"working-record-search":(e,t)=>LE(e,DE.parse(t))}});var ja,FE=b(()=>{"use strict";ja={network:{message:"Registry \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093",action:"\u901A\u4FE1\u3001\u63A5\u7D9A\u5148 URL\u3001DNS \u3068 HTTPS \u306E\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},unavailable:{message:"Registry \u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093",action:"\u7A3C\u50CD\u72B6\u6CC1\u3068\u914D\u4FE1\u6A5F\u80FD\u306E\u53CD\u6620\u3092\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3001\u5FA9\u65E7\u5F8C\u306B\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},timeout:{message:"Registry \u306E\u5FDC\u7B54\u5F85\u3061\u3001\u5229\u7528\u5236\u9650\u3001\u307E\u305F\u306F\u6642\u9593\u5207\u308C\u3067\u3059",action:"\u901A\u4FE1\u3068\u7A3C\u50CD\u72B6\u6CC1\u3092\u78BA\u8A8D\u3057\u3001\u6642\u9593\u3092\u304A\u3044\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},auth:{message:"\u8A8D\u8A3C\u307E\u305F\u306F\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",action:"godd login \u307E\u305F\u306F godd-config \u3067\u8A8D\u8A3C\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u305F\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3001\u505C\u6B62\u3084\u6A29\u9650\u306F\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},missing:{message:"\u5229\u7528\u53EF\u80FD\u306A\u30C4\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",action:"\u6700\u65B0\u306E\u30C4\u30FC\u30EB\u4E00\u89A7\u3068\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},data:{message:"\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093",action:"\u7BA1\u7406\u8005\u306B\u30C7\u30FC\u30BF\u306E\u767B\u9332\u72B6\u614B\u3068\u672C\u4F53\u3068\u306E\u5BFE\u5FDC\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u53E4\u3044\u5185\u5BB9\u3067\u306F\u7D9A\u3051\u307E\u305B\u3093\u3002"},input:{message:"\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F",action:"\u6700\u65B0\u306E\u30AC\u30A4\u30C9\u3068\u5F15\u6570\u306E\u9805\u76EE\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},execution_unknown:{message:"\u5B9F\u884C\u306E\u7D50\u679C\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093",action:"\u51E6\u7406\u304C\u5B8C\u4E86\u3057\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u518D\u9001\u3059\u308B\u524D\u306B\u4FDD\u5B58\u5148\u3084\u51E6\u7406\u7D50\u679C\u3092\u78BA\u8A8D\u3057\u3001\u4E0D\u660E\u306A\u3089\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}});function Dt(e){let t=ja[e];return new Le(e,`${t.message}\u3002${t.action}`)}function BE(e,t,r){if(typeof t=="object"&&t!==null&&"detail"in t&&typeof t.detail=="object"&&t.detail!==null&&"code"in t.detail&&t.detail.code==="delivery_data_invalid")return Dt("data");if(e===426)return new Le("compatibility",`\u672C\u4F53 ${r.client_version??en()} \u306E\u7248\u30FB\u7CFB\u5217\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u540C\u3058\u7CFB\u5217\u306E\u672C\u4F53\u3078\u66F4\u65B0\u3057\u3066MCP\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);if(e===401||e===403){let o=typeof t=="object"&&t!==null&&"detail"in t&&typeof t.detail=="string"?t.detail:"",i=Ue(e,o,r.auth_source);return i?new Le("auth",i.includes("\u518D\u8D77\u52D5")?i:i+`
|
|
243
|
-
\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u305F\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002`):Dt("auth")}return e===404?Dt("missing"):e===429||e===408||e===504?Dt("timeout"):e>=500?Dt("unavailable"):Dt("input")}function ip(e,t){if(e instanceof Le)return e;if(e instanceof Error&&["TimeoutError","AbortError"].includes(e.name))return Dt("timeout");if(e instanceof TypeError&&/fetch|network/i.test(e.message))return Dt("network");if(e&&typeof e=="object"&&"status"in e&&typeof e.status=="number"){let r=e instanceof Error&&["KnowledgeSaveError","KnowledgeSearchError","KnowledgeAttachmentError"].includes(e.name);if(!r){let n=Ue(e.status,e instanceof Error?e.message:"",t.auth_source);if(n)return new Le("auth",n)}if(e instanceof Error){let n=t.license_key.length>8?e.message.replaceAll(t.license_key,"[\u8A8D\u8A3C\u60C5\u5831]"):e.message,o=!r&&e.status===401?`
|
|
244
|
-
${ja.auth.action}`:!r&&e.status===403?`
|
|
245
|
-
\u5229\u7528\u5BFE\u8C61\u306E\u6A29\u9650\u3084\u767B\u9332\u4E0A\u9650\u3092\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:"";return new Le(e.status===401||e.status===403?"auth":"tool",n.slice(0,1500-o.length)+o)}return BE(e.status,{},t)}if(e instanceof f.ZodError){let r=[...new Set(e.issues.map(n=>n.path.join(".")||"\u5165\u529B"))].slice(0,5);return new Le("input",`${ja.input.message}\u3002\u78BA\u8A8D\u3059\u308B\u9805\u76EE: ${r.join("\u3001")}\u3002${ja.input.action}`)}if(e instanceof Error){let r=t.license_key.length>8?e.message.replaceAll(t.license_key,"[\u8A8D\u8A3C\u60C5\u5831]"):e.message;return new Le("tool",r.slice(0,1500))}return Dt("input")}async function rs(e,t,r,n){let o,i,s=n!==void 0&&t.includes("/execute"),a=e.client_version??en(),c=a==="0.0.0"?void 0:gr(a);try{o=await fetch(`${e.registry_url.replace(/\/+$/,"")}/v1/tools${t}`,{method:n===void 0?"GET":"POST",headers:{Authorization:`Bearer ${e.license_key}`,"Content-Type":"application/json","Cache-Control":"no-store",...c?{"X-GoDD-Version":c.version,"X-GoDD-Channel":c.channel}:{}},...n===void 0?{}:{body:JSON.stringify(n)},signal:AbortSignal.timeout(s?9e4:15e3)});let p=await o.text();try{i=JSON.parse(p)}catch{i=null}}catch(p){throw s?Dt("execution_unknown"):p instanceof Error&&["TimeoutError","AbortError"].includes(p.name)?Dt("timeout"):Dt("network")}if(!o.ok){if(t.includes("/prepare?")&&(o.status===400||o.status===422))throw new Le("configuration","\u69CB\u6210\u3084\u8A00\u8A9E\u306E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002config.godd \u306E components \u3068\u8A00\u8A9E\u30B3\u30FC\u30C9\u3092 godd-config \u3067\u78BA\u8A8D\u3057\u3001\u66F4\u65B0\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002");let p=BE(o.status,i,e);throw s&&o.status>=500&&p.kind!=="data"?Dt("execution_unknown"):o.status===404&&t===""?Dt("unavailable"):p}let l=r.safeParse(i);if(!l.success)throw Dt(s?"execution_unknown":"data");return l.data}function m_(e){return new URLSearchParams({components:e.components.join(","),language:e.language}).toString()}var op,GE,VE,HU,h_,Le,g_=b(()=>{"use strict";Ke();Tr();FE();ei();op=f.object({name:f.string(),description:f.string().max(300),inputSchema:f.object({type:f.literal("object")}).passthrough(),version:f.number().int().positive(),guide_uri:f.string(),compatibility:f.object({min_version:f.string().nullable(),max_version:f.string().nullable(),channels:f.array(f.string()).nullable()}).optional()}),GE=f.object({tools:f.array(op),revision:f.string().optional()}),VE=f.object({name:f.string(),version:f.number(),related_tools:f.array(f.string()),guide:f.object({purpose:f.string(),prerequisites:f.array(f.string()),steps:f.array(f.string()),success:f.string(),failures:f.array(f.object({message:f.string(),action:f.string()}))})}),HU=f.object({prompts:f.record(f.string()),agents:f.record(f.string()),partials:f.record(f.string()),mindsets:f.record(f.string()),quality_gate:f.record(f.string()),tools:f.array(f.unknown()),components:f.array(f.string()),language:f.string()}),h_=f.object({definition:op,execution:f.object({kind:f.enum(["prompt","public_client","server"]),prompts:f.array(f.string()),handler:f.string().nullable(),defaults:f.record(f.unknown()),context_env:f.record(f.enum(["GODD_CONFIG","GODD_SLACK_TOOL","GODD_SLACK_PERMALINK_TOOL"])).optional()}).optional(),bundle:HU.nullable().optional(),arguments:f.record(f.unknown()).optional(),result:f.unknown().optional(),prompt_versions:f.record(f.number()).optional(),assets:f.record(f.string()).optional(),catalog_revision:f.string().optional()}),Le=class extends Error{constructor(r,n){super(n);this.kind=r}}});function __(e,t,r){let n=HE.default.create();n.registerHelper("eq",(i,s)=>i===s);for(let[i,s]of Object.entries(t.bundle?.partials??{}))n.registerPartial(i,s);let o={name:`registry:${e.components.join("+")}`,stacks:e.components.map(i=>({id:i,name:i,label:i})),quality_gate:{frontend:t.bundle?.quality_gate.frontend,backend:t.bundle?.quality_gate.backend,preflight_command:t.bundle?.quality_gate.preflight??"pnpm preflight",summary:"format/lint/typecheck/build"}};return{config:e,profile:o,session:r,renderPrompt:(i,s)=>{let a=t.bundle?.prompts[i];if(a===void 0)throw new Le("data","\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002");let c={profile_name:o.name,stacks:o.stacks,quality_gate:o.quality_gate,tools:t.bundle?.tools??[],...t.execution?.defaults,...t.arguments,...s};for(let[l,p]of Object.entries(t.execution?.context_env??{}))c[l]=process.env[p];try{let l={};for(let[p,u]of Object.entries(t.bundle?.mindsets??{}))l[p]=n.compile(u)(c);return c.mindsets=l,n.compile(a)(c)}catch{throw new Le("data","\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}}}}function KE(e,t){let r=__(e,t),n=t.arguments??{},o=ft(r,typeof n.project_root=="string"?n.project_root:void 0),i={...n,project:o,language:e.language},s=t.execution?.prompts.map(l=>r.renderPrompt(l,i)).join(`
|
|
235
|
+
`)}var fy,Kr,Oa,$E,TU,PE,CE,AE=b(()=>{"use strict";Xe();fy=require("node:crypto"),Kr=require("node:fs"),Oa=require("node:path");Ar();$E=(0,Oa.join)(".godd","memory","godd-memory.json"),TU=2e4,PE=10;CE=m.object({action:m.enum(["remember","recall","consolidate"]).describe("remember: \u4FDD\u5B58 / recall: \u691C\u7D22 / consolidate: \u6574\u7406\u624B\u9806\u3092\u8FD4\u3059"),content:m.string().max(TU).optional().describe("remember \u6642\u306E\u8A18\u61B6\u5185\u5BB9\uFF08\u5FC5\u9808\uFF09"),tags:m.array(m.string().max(100)).max(50).optional().describe("\u5206\u985E\u30BF\u30B0\uFF08\u4EFB\u610F\uFF09"),who:m.string().max(100).optional().describe("\u8A18\u61B6\u306E\u66F8\u304D\u624B\uFF08\u65E2\u5B9A agent\uFF09"),source:m.string().max(500).optional().describe("\u7531\u6765\uFF08issue \u756A\u53F7\u30FB\u30BB\u30C3\u30B7\u30E7\u30F3\u7B49\u3001\u4EFB\u610F\uFF09"),query:m.string().max(1e3).optional().describe("recall / consolidate \u6642\u306E\u691C\u7D22\u30AF\u30A8\u30EA\uFF08\u7A7A\u306A\u3089\u65B0\u3057\u3044\u9806\uFF09"),limit:m.number().int().min(1).max(100).optional().describe(`recall / consolidate \u306E\u6700\u5927\u4EF6\u6570\uFF08\u65E2\u5B9A ${PE}\uFF09`),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\uFF08\u81EA\u52D5\u691C\u51FA\uFF09")})});function OU(e,t){if(e.without_project&&e.project_id!==void 0)throw new Error("project_id \u3068 without_project \u306F\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002\u3069\u3061\u3089\u304B\u4E00\u65B9\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002");if(!e.without_project)return e.project_id??Xn(t)}function NU(e,t,r){let n=tt(e,t,r.config.auth_source);return n||(e===401?"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002godd-config \u3067 GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403?`\u4FDD\u5B58\u5148\u306E project \u304C\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u7D42\u4E86\u3057\u3066\u3044\u308B\u3001\u307E\u305F\u306F\u3053\u306E\u64CD\u4F5C\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${t}
|
|
236
|
+
godd-knowledge-projects \u3067\u4FDD\u5B58\u3067\u304D\u308B project \u3092\u78BA\u8A8D\u3057\u3001\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`:e===413?`\u6210\u679C\u7269\u306E\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\u3002${t}`:e===422?`\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${t}`:`working record \u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}function jU(e,t,r,n,o){let i=e.deliverables.flatMap(u=>u.type==="file"&&u.path?[u.path]:[]),s=iy(i,o),a={session_id:r.sessionId,sequence:r.sequence,title:e.title,process:e.process,mcp_version:n,started_at:r.startedAt,tools:r.tools,deliverables:e.deliverables.map(u=>({type:u.type,title:u.title,...u.type==="url"?{url:u.url}:{},...u.type==="text"?{body:u.body}:{},...u.type==="file"&&u.path?{file_name:(0,RE.basename)(u.path)}:{}}))},c=new FormData;t!==void 0&&c.append("project_id",t),c.append("record",JSON.stringify(a));for(let u of s){let p=oy(u.fileName);c.append("files",new Blob([new Uint8Array(u.bytes)],p?{type:p}:void 0),u.fileName)}return c}async function zE(e,t){let r=e.session;if(!r)throw new Error("\u3053\u306E\u30C4\u30FC\u30EB\u306F GoDD MCP \u30B5\u30FC\u30D0\u30FC\u304B\u3089\u3060\u3051\u547C\u3073\u51FA\u305B\u307E\u3059\uFF08\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u8A18\u9332\u304C\u3042\u308A\u307E\u305B\u3093\uFF09\u3002");let n=zt(e,t.project_root).root,o=OU(t,n),i=r.snapshot(),s=jU(t,o,i,e.config.client_version,n),a=e.config.registry_url.replace(/\/+$/,""),c,u;try{c=await fetch(`${a}/working-records`,{method:"POST",headers:{Authorization:`Bearer ${e.config.license_key}`},body:s,signal:AbortSignal.timeout(9e4)}),u=await c.text()}catch(d){throw new Error(`Knowledge DB \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u547C\u3073\u51FA\u3059\u3068\u3001\u540C\u3058\u5185\u5BB9\u3092\u91CD\u8907\u306A\u304F\u4FDD\u5B58\u3057\u76F4\u3057\u307E\u3059: ${ge(d)}`)}if(c.status===409)return r.commit(i),`\u3053\u306E working record \u306F\u4FDD\u5B58\u6E08\u307F\u3067\u3057\u305F\uFF08${i.sequence} \u4EF6\u76EE\uFF09\u3002\u91CD\u8907\u3057\u3066\u4FDD\u5B58\u306F\u3057\u3066\u3044\u307E\u305B\u3093\u3002${es(u).slice(0,300)}`;if(!c.ok)throw new hy(c.status,NU(c.status,es(u).slice(0,300),e));let p;try{p=DU.parse(JSON.parse(u))}catch{throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u3067\u3059: ${u.slice(0,200)}`)}return r.commit(i),[`working record \u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F: ${t.title}`,p.project?`- \u4FDD\u5B58\u5148: ${p.project.name}\uFF08project id: ${p.project.id}\uFF09`:t.without_project?"- \u4FDD\u5B58\u5148: project \u306A\u3057\uFF08\u6307\u5B9A\u3069\u304A\u308A\uFF09":"- \u4FDD\u5B58\u5148: project \u306A\u3057\uFF08config.godd \u306B knowledge.project_id \u3092\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u305D\u306E project \u306B\u4FDD\u5B58\u3055\u308C\u307E\u3059\uFF09",`- id: ${p.id}\uFF08\u3053\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306E ${p.sequence} \u4EF6\u76EE\uFF09`,`- \u4F7F\u3063\u305F GoDD \u30C4\u30FC\u30EB: ${i.tools.length>0?i.tools.map(d=>d.tool_name).join(", "):"\u306A\u3057"}`,`- \u6210\u679C\u7269: ${p.deliverables.length>0?p.deliverables.map(d=>`${d.title}\uFF08${d.type}\uFF09`).join(", "):"\u306A\u3057"}`].join(`
|
|
237
|
+
`)}var RE,zU,IE,DU,hy,DE=b(()=>{"use strict";Xe();RE=require("node:path");Ar();Ia();op();Yt();Br();zU=m.object({type:m.enum(["url","text","file"]).describe("\u6210\u679C\u7269\u306E\u7A2E\u985E"),title:m.string().min(1).max(500).describe("\u6210\u679C\u7269\u306E\u540D\u524D\uFF08\u4F8B: \u898B\u7A4D\u66F8\uFF08\u5E97\u8217\u4E88\u7D04\u30B7\u30B9\u30C6\u30E0\u958B\u767A\uFF09\uFF09"),url:m.string().max(4e3).regex(/^https?:\/\//,"url \u306F http:// \u304B https:// \u3067\u59CB\u307E\u308B\u30EA\u30F3\u30AF\u306B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u300CPR #123\u300D\u306E\u3088\u3046\u306A\u5024\u306F text \u306B\u3059\u308B\uFF09").optional().describe("type=url \u306E\u3068\u304D\u306E\u30EA\u30F3\u30AF\uFF08http(s) \u306E\u307F\uFF09"),body:m.string().optional().describe("type=text \u306E\u3068\u304D\u306E\u672C\u6587\uFF08Markdown\uFF09"),path:m.string().min(1).max(4e3).optional().describe("type=file \u306E\u3068\u304D\u306E\u30ED\u30FC\u30AB\u30EB\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\u3002\u7D76\u5BFE\u30D1\u30B9\u3001\u307E\u305F\u306F project_root \u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9")}).superRefine((e,t)=>{e.type==="url"&&!e.url&&t.addIssue({code:"custom",message:"type=url \u306B\u306F url \u304C\u5FC5\u8981\u3067\u3059"}),e.type==="text"&&!e.body?.trim()&&t.addIssue({code:"custom",message:"type=text \u306B\u306F body \u304C\u5FC5\u8981\u3067\u3059"}),e.type==="file"&&!e.path&&t.addIssue({code:"custom",message:"type=file \u306B\u306F path \u304C\u5FC5\u8981\u3067\u3059"})}),IE=m.object({title:m.string().min(1,"title \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(500).describe("\u3053\u306E\u8A18\u9332\u306E 1 \u884C\u306E\u8981\u7D04\uFF08\u4F8B: \u30B5\u30F3\u30D7\u30EB\u793E \u5E97\u8217\u4E88\u7D04\u30B7\u30B9\u30C6\u30E0\u306E\u898B\u7A4D\uFF09"),process:m.string().min(1,"process \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("\u4F5C\u696D\u306E\u533A\u5207\u308A\u306E\u624B\u9806\u306E\u5F62\u5F0F\u3067\u66F8\u3044\u305F\u7D4C\u7DEF\uFF08Markdown\uFF09"),deliverables:m.array(zU).max(50).default([]).describe("\u6210\u679C\u7269\u306E\u4E00\u89A7\u3002\u7121\u3051\u308C\u3070\u7A7A\u306E\u914D\u5217"),project_id:m.string().uuid("project_id \u306F godd-knowledge-projects \u304C\u8FD4\u3059 UUID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044").optional().describe("\u4FDD\u5B58\u5148 project \u306E id\u3002\u7701\u7565\u6642\u306F config.godd \u306E knowledge.project_id\u3001\u305D\u308C\u3082\u7121\u3051\u308C\u3070 project \u306A\u3057"),without_project:m.boolean().optional().describe("true \u3067 config.godd \u306E\u8A2D\u5B9A\u306B\u304B\u304B\u308F\u3089\u305A project \u306A\u3057\u3067\u4FDD\u5B58\u3059\u308B\uFF08\u91D1\u984D\u3092\u6271\u3046\u4F5C\u696D\u3067\u793E\u5916\u79D8 project \u304C\u7121\u3044\u3068\u304D\uFF09\u3002project_id \u3068\u306F\u4F75\u7528\u3057\u306A\u3044"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08config.godd \u3068\u76F8\u5BFE\u30D1\u30B9\u306E\u89E3\u6C7A\u57FA\u6E96\u3002\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),DU=m.object({id:m.string(),saved:m.boolean(),sequence:m.number(),project:m.object({id:m.string(),name:m.string()}).nullable(),deliverables:m.array(m.object({type:m.string(),title:m.string()}))}),hy=class extends Error{constructor(r,n){super(n);this.status=r;this.name="WorkingRecordSaveError"}}});var OE,NE=b(()=>{"use strict";V2();tp();nE();sE();op();dE();uy();yE();wE();kE();AE();DE();OE={setup:(e,t)=>G2(e,F2.parse(t)),"docs-init":(e,t)=>K2(e,H2.parse(t)),docs:(e,t)=>rE(e,eE.parse(t)),"notes-init":(e,t)=>iE(e,oE.parse(t)),"knowledge-save":(e,t)=>uE(e,cE.parse(t)),feedback:(e,t)=>pE(e,lE.parse(t)),"knowledge-search":(e,t)=>hE(e,fE.parse(t)),"knowledge-attachment":(e,t)=>gE(e,mE.parse(t)),"knowledge-search-general":(e,t)=>vE(e,_E.parse(t)),"knowledge-projects":(e,t)=>xE(e,bE.parse(t)),memory:(e,t)=>TE(e,CE.parse(t)),"working-record-save":(e,t)=>zE(e,IE.parse(t))}});var Na,jE=b(()=>{"use strict";Na={network:{message:"Registry \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093",action:"\u901A\u4FE1\u3001\u63A5\u7D9A\u5148 URL\u3001DNS \u3068 HTTPS \u306E\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},unavailable:{message:"Registry \u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093",action:"\u7A3C\u50CD\u72B6\u6CC1\u3068\u914D\u4FE1\u6A5F\u80FD\u306E\u53CD\u6620\u3092\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3001\u5FA9\u65E7\u5F8C\u306B\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},timeout:{message:"Registry \u306E\u5FDC\u7B54\u5F85\u3061\u3001\u5229\u7528\u5236\u9650\u3001\u307E\u305F\u306F\u6642\u9593\u5207\u308C\u3067\u3059",action:"\u901A\u4FE1\u3068\u7A3C\u50CD\u72B6\u6CC1\u3092\u78BA\u8A8D\u3057\u3001\u6642\u9593\u3092\u304A\u3044\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},auth:{message:"\u8A8D\u8A3C\u307E\u305F\u306F\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",action:"godd login \u307E\u305F\u306F godd-config \u3067\u8A8D\u8A3C\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u305F\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3001\u505C\u6B62\u3084\u6A29\u9650\u306F\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},missing:{message:"\u5229\u7528\u53EF\u80FD\u306A\u30C4\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",action:"\u6700\u65B0\u306E\u30C4\u30FC\u30EB\u4E00\u89A7\u3068\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},data:{message:"\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093",action:"\u7BA1\u7406\u8005\u306B\u30C7\u30FC\u30BF\u306E\u767B\u9332\u72B6\u614B\u3068\u672C\u4F53\u3068\u306E\u5BFE\u5FDC\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u53E4\u3044\u5185\u5BB9\u3067\u306F\u7D9A\u3051\u307E\u305B\u3093\u3002"},input:{message:"\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F",action:"\u6700\u65B0\u306E\u30AC\u30A4\u30C9\u3068\u5F15\u6570\u306E\u9805\u76EE\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},execution_unknown:{message:"\u5B9F\u884C\u306E\u7D50\u679C\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093",action:"\u51E6\u7406\u304C\u5B8C\u4E86\u3057\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u518D\u9001\u3059\u308B\u524D\u306B\u4FDD\u5B58\u5148\u3084\u51E6\u7406\u7D50\u679C\u3092\u78BA\u8A8D\u3057\u3001\u4E0D\u660E\u306A\u3089\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}});function Dt(e){let t=Na[e];return new Le(e,`${t.message}\u3002${t.action}`)}function ZE(e,t,r){if(typeof t=="object"&&t!==null&&"detail"in t&&typeof t.detail=="object"&&t.detail!==null&&"code"in t.detail&&t.detail.code==="delivery_data_invalid")return Dt("data");if(e===426)return new Le("compatibility",`\u672C\u4F53 ${r.client_version??Xr()} \u306E\u7248\u30FB\u7CFB\u5217\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u540C\u3058\u7CFB\u5217\u306E\u672C\u4F53\u3078\u66F4\u65B0\u3057\u3066MCP\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);if(e===401||e===403){let o=typeof t=="object"&&t!==null&&"detail"in t&&typeof t.detail=="string"?t.detail:"",i=tt(e,o,r.auth_source);return i?new Le("auth",i.includes("\u518D\u8D77\u52D5")?i:i+`
|
|
238
|
+
\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u305F\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002`):Dt("auth")}return e===404?Dt("missing"):e===429||e===408||e===504?Dt("timeout"):e>=500?Dt("unavailable"):Dt("input")}function sp(e,t){if(e instanceof Le)return e;if(e instanceof Error&&["TimeoutError","AbortError"].includes(e.name))return Dt("timeout");if(e instanceof TypeError&&/fetch|network/i.test(e.message))return Dt("network");if(e&&typeof e=="object"&&"status"in e&&typeof e.status=="number"){let r=e instanceof Error&&["KnowledgeSaveError","KnowledgeSearchError","KnowledgeAttachmentError"].includes(e.name);if(!r){let n=tt(e.status,e instanceof Error?e.message:"",t.auth_source);if(n)return new Le("auth",n)}if(e instanceof Error){let n=t.license_key.length>8?e.message.replaceAll(t.license_key,"[\u8A8D\u8A3C\u60C5\u5831]"):e.message,o=!r&&e.status===401?`
|
|
239
|
+
${Na.auth.action}`:!r&&e.status===403?`
|
|
240
|
+
\u5229\u7528\u5BFE\u8C61\u306E\u6A29\u9650\u3084\u767B\u9332\u4E0A\u9650\u3092\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:"";return new Le(e.status===401||e.status===403?"auth":"tool",n.slice(0,1500-o.length)+o)}return ZE(e.status,{},t)}if(e instanceof m.ZodError){let r=[...new Set(e.issues.map(n=>n.path.join(".")||"\u5165\u529B"))].slice(0,5);return new Le("input",`${Na.input.message}\u3002\u78BA\u8A8D\u3059\u308B\u9805\u76EE: ${r.join("\u3001")}\u3002${Na.input.action}`)}if(e instanceof Error){let r=t.license_key.length>8?e.message.replaceAll(t.license_key,"[\u8A8D\u8A3C\u60C5\u5831]"):e.message;return new Le("tool",r.slice(0,1500))}return Dt("input")}async function ts(e,t,r,n){let o,i,s=n!==void 0&&t.includes("/execute"),a=e.client_version??Xr(),c=a==="0.0.0"?void 0:mr(a);try{o=await fetch(`${e.registry_url.replace(/\/+$/,"")}/v1/tools${t}`,{method:n===void 0?"GET":"POST",headers:{Authorization:`Bearer ${e.license_key}`,"Content-Type":"application/json","Cache-Control":"no-store",...c?{"X-GoDD-Version":c.version,"X-GoDD-Channel":c.channel}:{}},...n===void 0?{}:{body:JSON.stringify(n)},signal:AbortSignal.timeout(s?9e4:15e3)});let p=await o.text();try{i=JSON.parse(p)}catch{i=null}}catch(p){throw s?Dt("execution_unknown"):p instanceof Error&&["TimeoutError","AbortError"].includes(p.name)?Dt("timeout"):Dt("network")}if(!o.ok){if(t.includes("/prepare?")&&(o.status===400||o.status===422))throw new Le("configuration","\u69CB\u6210\u3084\u8A00\u8A9E\u306E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002config.godd \u306E components \u3068\u8A00\u8A9E\u30B3\u30FC\u30C9\u3092 godd-config \u3067\u78BA\u8A8D\u3057\u3001\u66F4\u65B0\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002");let p=ZE(o.status,i,e);throw s&&o.status>=500&&p.kind!=="data"?Dt("execution_unknown"):o.status===404&&t===""?Dt("unavailable"):p}let u=r.safeParse(i);if(!u.success)throw Dt(s?"execution_unknown":"data");return u.data}function gy(e){return new URLSearchParams({components:e.components.join(","),language:e.language}).toString()}var ip,ME,LE,MU,my,Le,yy=b(()=>{"use strict";Xe();Br();jE();Xo();ip=m.object({name:m.string(),description:m.string().max(300),inputSchema:m.object({type:m.literal("object")}).passthrough(),version:m.number().int().positive(),guide_uri:m.string(),compatibility:m.object({min_version:m.string().nullable(),max_version:m.string().nullable(),channels:m.array(m.string()).nullable()}).optional()}),ME=m.object({tools:m.array(ip),revision:m.string().optional()}),LE=m.object({name:m.string(),version:m.number(),related_tools:m.array(m.string()),guide:m.object({purpose:m.string(),prerequisites:m.array(m.string()),steps:m.array(m.string()),success:m.string(),failures:m.array(m.object({message:m.string(),action:m.string()}))})}),MU=m.object({prompts:m.record(m.string()),agents:m.record(m.string()),partials:m.record(m.string()),mindsets:m.record(m.string()),quality_gate:m.record(m.string()),tools:m.array(m.unknown()),components:m.array(m.string()),language:m.string()}),my=m.object({definition:ip,execution:m.object({kind:m.enum(["prompt","public_client","server"]),prompts:m.array(m.string()),handler:m.string().nullable(),defaults:m.record(m.unknown()),context_env:m.record(m.enum(["GODD_CONFIG","GODD_SLACK_TOOL","GODD_SLACK_PERMALINK_TOOL"])).optional()}).optional(),bundle:MU.nullable().optional(),arguments:m.record(m.unknown()).optional(),result:m.unknown().optional(),prompt_versions:m.record(m.number()).optional(),assets:m.record(m.string()).optional(),catalog_revision:m.string().optional()}),Le=class extends Error{constructor(r,n){super(n);this.kind=r}}});function _y(e,t,r){let n=UE.default.create();n.registerHelper("eq",(s,a)=>s===a);for(let[s,a]of Object.entries(t.bundle?.partials??{}))n.registerPartial(s,a);let o={name:`registry:${e.components.join("+")}`,stacks:e.components.map(s=>({id:s,name:s,label:s})),quality_gate:{frontend:t.bundle?.quality_gate.frontend,backend:t.bundle?.quality_gate.backend,preflight_command:t.bundle?.quality_gate.preflight??"pnpm preflight",summary:"format/lint/typecheck/build"}},i=t.execution?.prompts.includes(Jl)??!1;return{config:e,profile:o,session:r,endsWithFinish:i,renderPrompt:(s,a)=>{let c=t.bundle?.prompts[s];if(c===void 0)throw new Le("data","\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002");let u={profile_name:o.name,stacks:o.stacks,quality_gate:o.quality_gate,tools:t.bundle?.tools??[],...t.execution?.defaults,...t.arguments,...a};for(let[p,l]of Object.entries(t.execution?.context_env??{}))u[p]=process.env[l];try{let p={};for(let[l,d]of Object.entries(t.bundle?.mindsets??{}))p[l]=n.compile(d)(u);return u.mindsets=p,n.compile(c)(u)}catch{throw new Le("data","\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}}}}function qE(e,t){let r=_y(e,t),n=t.arguments??{},o=zt(r,typeof n.project_root=="string"?n.project_root:void 0),i={...n,project:o,language:e.language},s=t.execution?.prompts.map(u=>r.renderPrompt(u,i)).join(`
|
|
246
241
|
|
|
247
242
|
`)??"",a=e.language==="en"?"":`> **Output Language**: Respond entirely in ${e.language}.
|
|
248
243
|
|
|
249
|
-
`,c=Object.entries(t.assets??{}).map(([
|
|
250
|
-
${
|
|
244
|
+
`,c=Object.entries(t.assets??{}).map(([u,p])=>{let l="`".repeat(Math.max(3,...[...p.matchAll(/`+/g)].map(d=>d[0].length+1)));return`### ${u}
|
|
245
|
+
${l}
|
|
251
246
|
${p}
|
|
252
|
-
${
|
|
247
|
+
${l}`}).join(`
|
|
253
248
|
|
|
254
249
|
`);return`${a}${s}
|
|
255
250
|
|
|
@@ -260,52 +255,52 @@ ${JSON.stringify(n,null,2)}${c?`
|
|
|
260
255
|
|
|
261
256
|
## \u540C\u68B1\u30D5\u30A1\u30A4\u30EB
|
|
262
257
|
|
|
263
|
-
${c}`:""}`}var
|
|
264
|
-
${P.message}`}],_meta:{delivery_error:P.kind}}}}),
|
|
265
|
-
\u53E4\u3044\u914D\u4FE1\u5185\u5BB9\u3067\u306F\u51E6\u7406\u3092\u7D9A\u3051\u307E\u305B\u3093\u3002`}]}}}),
|
|
258
|
+
${c}`:""}`}var UE,FE=b(()=>{"use strict";UE=ht(Kl(),1);Ar();yy();Qg()});var GE,LU,ZU,UU,ap,VE=b(()=>{"use strict";GE=require("node:crypto"),LU=new Set(["godd-config","godd-working-record-save","godd-knowledge-projects"]),ZU=new Set(["godd-knowledge-save"]),UU=["step","phase","mode"],ap=class{sessionId;saved=0;calls=[];finishing=!1;constructor(t=(0,GE.randomUUID)()){this.sessionId=t}record(t,r,n={},o=new Date){if(t==="godd-working-record-save"&&(this.finishing=!0),LU.has(t)||this.finishing&&ZU.has(t))return;this.finishing=!1;let i=UU.map(s=>r[s]).filter(s=>typeof s=="string"&&s.length>0);this.calls.push({toolName:t,steps:i,...n,at:o})}recordFailure(t){t==="godd-working-record-save"&&(this.finishing=!0)}snapshot(){let t=new Map;for(let r of this.calls){let n=t.get(r.toolName)??{tool_name:r.toolName,steps:[],call_count:0};n.call_count+=1;for(let o of r.steps)n.steps.includes(o)||n.steps.push(o);r.definitionVersion!==void 0&&(n.definition_version=r.definitionVersion),r.promptVersions!==void 0&&(n.prompt_versions=r.promptVersions),t.set(r.toolName,n)}return{sessionId:this.sessionId,sequence:this.saved+1,startedAt:this.calls[0]?.at.toISOString(),tools:[...t.values()],covered:this.calls.length}}commit(t){t.sequence===this.saved+1&&(this.calls=this.calls.slice(t.covered),this.saved=t.sequence)}}});function BE(e,t,r){e={...e,client_version:t};let n=t==="0.0.0"?void 0:mr(t),o=r?.checkForUpdate??ac({version:t}),i="",s="",a;function c(){a??=o().then(k=>{i=k}).catch(()=>{i=""}).finally(()=>{a=void 0})}c();let u=new ll({name:"godd-mcp-server",version:t},{capabilities:{tools:{listChanged:!0},resources:{},prompts:{}}}),p={name:tg,description:rg,inputSchema:Tk(ng,{target:"jsonSchema7"})},l,d=!1,f=r?.session??new ap;function h(k,P,q){return{client:n??{version:t,channel:"unknown"},...k?{catalog_revision:k}:{},...P!==void 0?{definition_version:P}:{},...q?{prompt_versions:q}:{}}}async function g(){d||(d=!0,await u.notification({method:"notifications/tools/list_changed"}).catch(()=>{}))}async function y(k,P=!0){if(!k)return;let q=l!==void 0&&l!==k;l=k,q&&P&&await g()}async function v(k=!0){let P=await ts(e,"",ME);return await y(P.revision,k),P}async function w(){try{await O1(e.registry_url,e.license_key)}catch(k){throw sp(k,e)}}async function x(k,P){if(k===tg)return{text:await E1(ng.parse(P))};if(e.components.length===0)throw new Le("configuration","\u6280\u8853\u69CB\u6210\uFF08components\uFF09\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002godd init \u307E\u305F\u306F godd-config \u306E update \u3067\u69CB\u6210\u3092\u8A2D\u5B9A\u3057\u3001MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002");if(!/^[a-z]{2}(-[A-Z]{2})?$/.test(e.language))throw new Le("configuration","\u8A00\u8A9E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002godd-config \u3067 en\u3001ja \u306A\u3069\u306E\u8A00\u8A9E\u30B3\u30FC\u30C9\u3092\u8A2D\u5B9A\u3057\u3001MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002");await w();let q=`/${encodeURIComponent(k)}`,Z=await ts(e,`${q}/prepare?${gy(e)}`,my);await y(Z.catalog_revision);let qe={...Z.execution?.defaults,...P};try{let Fe=new qi().getValidator(Z.definition.inputSchema)(qe);if(!Fe.valid)throw new Le("input",`\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${Fe.errorMessage??"\u5F15\u6570\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}`)}catch(ie){throw ie instanceof Le?ie:new Le("data","\u914D\u4FE1\u3055\u308C\u305F\u5F15\u6570\u5B9A\u7FA9\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}if(Z.execution?.kind==="server"){let ie=await ts(e,`${q}/execute?${gy(e)}`,my,qe);if(ie.result===void 0)throw new Le("data","\u5B9F\u884C\u7D50\u679C\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002\u518D\u9001\u306E\u524D\u306B\u51E6\u7406\u7D50\u679C\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");return{text:typeof ie.result=="string"?ie.result:JSON.stringify(ie.result),definitionVersion:ie.definition.version,revision:ie.catalog_revision}}let ve={...Z,arguments:qe};if(Z.execution?.kind==="prompt")return{text:qE(e,ve),definitionVersion:Z.definition.version,revision:Z.catalog_revision,promptVersions:Z.prompt_versions};if(Z.execution?.kind==="public_client"){let ie=OE[Z.execution.handler??""];if(ie)return{text:await ie(_y(e,ve,f),qe),definitionVersion:Z.definition.version,revision:Z.catalog_revision,promptVersions:Z.prompt_versions}}throw new Le("data","\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u767B\u9332\u72B6\u614B\u3068\u672C\u4F53\u3068\u306E\u5BFE\u5FDC\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}return u.setRequestHandler(Wd,async()=>{try{let k=await v(!1);return d=!1,{_meta:h(k.revision),tools:[p,...k.tools.map(P=>({name:P.name,description:P.description,inputSchema:P.inputSchema}))]}}catch(k){let P=sp(k,e);return{tools:[{...p,description:`${rg}
|
|
259
|
+
${P.message}`}],_meta:{delivery_error:P.kind}}}}),u.setRequestHandler(Ts,async({params:k})=>{try{let P=await x(k.name,k.arguments??{});f.record(k.name,k.arguments??{},{definitionVersion:P.definitionVersion,promptVersions:P.promptVersions}),c();let q=i!==s?i:"";return s=i,{_meta:h(P.revision,P.definitionVersion,P.promptVersions),content:[{type:"text",text:P.text},...q?[{type:"text",text:q}]:[]]}}catch(P){f.recordFailure(k.name);let q=sp(P,e);return["missing","input","auth","compatibility"].includes(q.kind)&&await g(),{isError:!0,content:[{type:"text",text:`${q.message}
|
|
260
|
+
\u53E4\u3044\u914D\u4FE1\u5185\u5BB9\u3067\u306F\u51E6\u7406\u3092\u7D9A\u3051\u307E\u305B\u3093\u3002`}]}}}),u.setRequestHandler(Ld,async()=>({resources:(await v()).tools.map(k=>({uri:k.guide_uri,name:k.name,description:k.description,mimeType:"text/markdown"}))})),u.setRequestHandler(Ud,async({params:k})=>{let P=/^godd:\/\/mcp-tools\/([^/?#]+)$/.exec(k.uri);if(!P)throw new Error("Resource not found");let q=await ts(e,`/${encodeURIComponent(decodeURIComponent(P[1]))}/guide`,LE),Z=q.guide,qe=[`# ${q.name}`,`\u672C\u4F53: ${t} / ${n?.channel??"unknown"}\u3001\u914D\u4FE1: ${q.version}`,Z.purpose,"## \u5FC5\u8981\u306A\u3082\u306E",...Z.prerequisites.map(ve=>`- ${ve}`),"## \u624B\u9806",...Z.steps.map((ve,ie)=>`${ie+1}. ${ve}`),"## \u6210\u529F\u3057\u305F\u72B6\u614B",Z.success,"## \u3046\u307E\u304F\u3044\u304B\u306A\u3044\u3068\u304D",...Z.failures.map(ve=>`### ${ve.message}
|
|
266
261
|
${ve.action}`),"## \u95A2\u9023\u30AC\u30A4\u30C9",...q.related_tools.map(ve=>`[${ve}](godd://mcp-tools/${encodeURIComponent(ve)})`)].join(`
|
|
267
262
|
|
|
268
|
-
`);return{_meta:
|
|
263
|
+
`);return{_meta:h(void 0,q.version),contents:[{uri:k.uri,text:qe,mimeType:"text/markdown"}]}}),u.setRequestHandler(qd,async()=>({prompts:(await v()).tools.map(k=>({name:k.name,description:k.description}))})),u.setRequestHandler(Fd,async({params:k})=>{await w();let P=await ts(e,`/${encodeURIComponent(k.name)}`,ip);return{_meta:h(void 0,P.version),messages:[{role:"user",content:{type:"text",text:`${P.name} \u30C4\u30FC\u30EB\u3092\u3001\u6B21\u306E\u5165\u529B\u3092\u78BA\u8A8D\u3057\u3066\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
269
264
|
${JSON.stringify(k.arguments??{},null,2)}
|
|
270
|
-
\u8A73\u3057\u3044\u624B\u9806\u306F ${P.guide_uri} \u304B\u3089\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}}]}}),
|
|
265
|
+
\u8A73\u3057\u3044\u624B\u9806\u306F ${P.guide_uri} \u304B\u3089\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}}]}}),u}var HE=b(()=>{"use strict";S1();Cn();ah();eg();C1();N1();NE();yy();FE();Xo();Rp();VE()});var KE={};Xt(KE,{startServer:()=>WE});function qU(){try{return __goddBundleUrl}catch{return}}async function WE(){let e=Ox();await BE(e,Xr()).connect(new pi)}var JE=b(()=>{"use strict";ef();Nn();Sf();HE();Xo();du(process.env,process.argv[1],qU())&&WE().catch(e=>{let t=e instanceof Error?e.message.replace(/((?:GODD_LICENSE_KEY|license_key)\s*[:=]\s*)[^\s,]+/gi,"$1[\u8A8D\u8A3C\u60C5\u5831]").replace(/goddt-[A-Za-z0-9_-]+|godd-[0-9a-f-]{36}/gi,"[\u8A8D\u8A3C\u60C5\u5831]").split(`
|
|
271
266
|
`).slice(0,4).join(`
|
|
272
|
-
`).slice(0,1500):"\u63A5\u7D9A\u8A2D\u5B9A\u3068\u30ED\u30B0\u30A4\u30F3\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002";console.error(`GoDD \u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093\u3002${t}`),process.exitCode=1})});function
|
|
267
|
+
`).slice(0,1500):"\u63A5\u7D9A\u8A2D\u5B9A\u3068\u30ED\u30B0\u30A4\u30F3\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002";console.error(`GoDD \u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093\u3002${t}`),process.exitCode=1})});function cp(e,t){let r=(0,YE.join)(e,".gitignore"),n=t.map(c=>c.trim()).filter(Boolean);if(n.length===0)return!1;let o=(0,rs.existsSync)(r)?(0,rs.readFileSync)(r,"utf-8"):"",i=new Set(o.split(/\r?\n/).map(c=>c.trim()).filter(Boolean)),s=n.filter(c=>!i.has(c));if(s.length===0)return!1;let a=o.length===0||o.endsWith(`
|
|
273
268
|
`)||o.endsWith(`\r
|
|
274
269
|
`)?o:`${o}
|
|
275
|
-
`;return(0,
|
|
270
|
+
`;return(0,rs.writeFileSync)(r,`${a}${s.join(`
|
|
276
271
|
`)}
|
|
277
|
-
`,"utf-8"),!0}var
|
|
278
|
-
`)){let o=n.trim();if(!o||o.startsWith("#"))continue;let i=o.indexOf("=");if(i===-1)continue;let s=o.slice(0,i).trim(),a=o.slice(i+1).trim();(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),r[s]=a}return r}catch{return{}}}var cp,v_=b(()=>{"use strict";cp=require("node:fs")});function w_(e=process.env){let t=e.GODD_GOOGLE_MCP_URL?.trim();if(!t)return up;try{let r=new URL(t),n=["localhost","127.0.0.1","[::1]"].includes(r.hostname);return r.protocol==="https:"||r.protocol==="http:"&&n?t:null}catch{return null}}function b_(e=process.env){let t=e.GODD_GOOGLE_MCP?.trim().toLowerCase();if(t&&QU.has(t))return{enabled:!1,reason:"disabled"};let r=w_(e);return r?{enabled:!0,url:r}:{enabled:!1,reason:"invalid-url"}}var up,QU,x_=b(()=>{"use strict";up="https://google-mcp.ripla.co.jp/mcp",QU=new Set(["off","0","false","no"])});function $_(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function tq(){let e=$_((0,La.randomBytes)(32));return{verifier:e,challenge:rq(e)}}function rq(e){return $_((0,La.createHash)("sha256").update(e).digest())}function nq(){return $_((0,La.randomBytes)(16))}function Yr(e){let t=rt(e),r;try{r=new URL(t)}catch{throw new Ye(`Registry \u306E URL \u304C\u4E0D\u6B63\u3067\u3059: ${t}`)}if(r.protocol==="https:"||r.protocol==="http:"&&oq.has(r.hostname))return t;throw new Ye(`Registry \u306E URL \u306F https:// \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08http:// \u306F 127.0.0.1 / localhost / [::1] \u306E\u307F\uFF09: ${t}`)}function iq(e,t){let r=new URL(`${Yr(e)}/v1/auth/google/start`);return r.searchParams.set("redirect_uri",t.redirectUri),r.searchParams.set("code_challenge",t.codeChallenge),r.searchParams.set("code_challenge_method","S256"),r.searchParams.set("state",t.state),r.searchParams.set("device_name",t.deviceName),t.drive&&r.searchParams.set("drive","true"),r.toString()}function aq(e,t){if(e.get("state")!==t)return{kind:"state_mismatch"};let r=e.get("error");if(r){let o=e.get("error_description")?.trim()||sq[r]||"";return{kind:"error",error:new Ye(`Google \u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${r}\uFF09${o?`: ${o}`:""}`)}}let n=e.get("code");return n?{kind:"code",code:n}:{kind:"error",error:new Ye("\u30ED\u30B0\u30A4\u30F3\u5FDC\u7B54\u306B\u30B3\u30FC\u30C9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}}function P_(e){return`<!doctype html><html lang="ja"><meta charset="utf-8"><title>GoDD</title><body><p>${e}</p></body></html>`}function Ma(e,t,r){e.writeHead(t,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),e.end(r)}async function uq(e,t,r=S_){let n=null,o=new Promise((u,d)=>{n={resolve:u,reject:d}});o.catch(()=>{});let i=!1,s=!1,a=u=>{i||(i=!0,u())},c,l=(0,sC.createServer)((u,d)=>{let h=new URL(u.url??"/","http://127.0.0.1");if(h.pathname!==oC){d.writeHead(404).end();return}if(u.method!=="GET"){d.writeHead(405,{Allow:"GET"}).end();return}if(i||s){Ma(d,409,k_);return}let m=aq(h.searchParams,e);if(m.kind==="state_mismatch"){Ma(d,400,lq);return}if(m.kind==="error"){Ma(d,400,k_),a(()=>n?.reject(m.error));return}s=!0,clearTimeout(c),t(m.code).then(g=>{Ma(d,200,cq),a(()=>n?.resolve(g))},g=>{Ma(d,502,k_),a(()=>n?.reject(g instanceof Error?g:new Error(String(g))))})});await new Promise((u,d)=>{l.once("error",d),l.listen(0,"127.0.0.1",()=>u())}),c=setTimeout(()=>{a(()=>n?.reject(new Ye(`${Math.round(r/6e4)} \u5206\u4EE5\u5185\u306B\u30ED\u30B0\u30A4\u30F3\u304C\u5B8C\u4E86\u3057\u306A\u304B\u3063\u305F\u305F\u3081\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)))},r),c.unref?.();let{port:p}=l.address();return{redirectUri:`http://127.0.0.1:${p}${oC}`,result:o,close(){clearTimeout(c),a(()=>n?.reject(new Ye("\u30ED\u30B0\u30A4\u30F3\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002"))),l.closeAllConnections?.(),l.close()}}}function aC(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:r&&typeof r=="object"&&"message"in r?String(r.message):JSON.stringify(r)}}catch{}return e.slice(0,300)}async function dq(e,t,r,n=fetch){let o=Yr(e),i,s;try{i=await n(`${o}/v1/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,code_verifier:r}),signal:AbortSignal.timeout(XU)}),s=await i.text()}catch(l){throw new Ye(`Registry API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\uFF08${e}\uFF09: ${l instanceof Error?l.message:String(l)}`)}if(!i.ok)throw i.status===503?new Ye("\u3053\u306E Registry \u3067\u306F Google \u30ED\u30B0\u30A4\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3059\u308B\u304B\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002"):new Ye(`\u30ED\u30B0\u30A4\u30F3\u30B3\u30FC\u30C9\u306E\u4EA4\u63DB\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${i.status}\uFF09: ${aC(s)}\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let a;try{a=JSON.parse(s)}catch{throw new Ye(`Registry API \u306E\u5FDC\u7B54\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${s.slice(0,200)}`)}let c=pq.safeParse(a);if(!c.success)throw new Ye(`Registry API \u306E\u5FDC\u7B54\u304C\u60F3\u5B9A\u3068\u7570\u306A\u308A\u307E\u3059: ${c.error.message}`);return c.data}async function E_(e,t,r=fetch){let n=await r(`${Yr(e)}/v1/auth/logout`,{method:"POST",headers:{Authorization:`Bearer ${t}`},signal:AbortSignal.timeout(1e4)});if(!n.ok){let o=await n.text().catch(()=>"");throw new Error(`${n.status} ${aC(o)}`.trim())}}function fq(e){let t="";try{t=new URL(e).protocol}catch{}if(t!=="https:"&&t!=="http:")return Promise.resolve(!1);let[r,n]=process.platform==="darwin"?["open",[e]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]];return new Promise(o=>{try{let i=(0,iC.spawn)(r,n,{stdio:"ignore",detached:!0});i.once("error",()=>o(!1)),i.once("spawn",()=>{i.unref(),o(!0)})}catch{o(!1)}})}function C_(e){return((e??"").trim()||"unknown device").slice(0,eq)}async function cC(e,t={}){let r=t.log??(c=>console.log(c)),n=t.openBrowser??fq,o=Yr(e.registryUrl),i=tq(),s=nq(),a=await uq(s,c=>dq(o,c,i.verifier,t.fetch),t.timeoutMs??S_);try{let c=iq(o,{redirectUri:a.redirectUri,codeChallenge:i.challenge,state:s,deviceName:C_(e.deviceName),drive:e.drive});return(e.noBrowser?!1:await n(c))?(r("\u30D6\u30E9\u30A6\u30B6\u3067 Google \u30ED\u30B0\u30A4\u30F3\u306E\u753B\u9762\u3092\u958B\u304D\u307E\u3057\u305F\u3002\u30ED\u30B0\u30A4\u30F3\u3092\u5B8C\u4E86\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),r("\u30D6\u30E9\u30A6\u30B6\u304C\u958B\u304B\u306A\u3044\u5834\u5408\u306F\u3001\u6B21\u306E URL \u3092\u958B\u3044\u3066\u304F\u3060\u3055\u3044:")):r("\u6B21\u306E URL \u3092\u30D6\u30E9\u30A6\u30B6\u3067\u958B\u304D\u3001Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u3053\u306E\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u30FC\u306E\u30D6\u30E9\u30A6\u30B6\u3067\u958B\u304F\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF09:"),r(c),r(""),r(`\u5F85\u6A5F\u4E2D...\uFF08${Math.round((t.timeoutMs??S_)/6e4)} \u5206\u3067\u6642\u9593\u5207\u308C\u306B\u306A\u308A\u307E\u3059\uFF09`),await a.result}finally{a.close()}}var iC,La,sC,S_,XU,oC,eq,Ye,oq,sq,cq,k_,lq,pq,pp=b(()=>{"use strict";iC=require("node:child_process"),La=require("node:crypto"),sC=require("node:http");Ke();Pi();S_=300*1e3,XU=15e3,oC="/callback",eq=200,Ye=class extends Error{constructor(t){super(t),this.name="LoginError"}};oq=new Set(["127.0.0.1","localhost","[::1]"]);sq={access_denied:"Google \u306E\u753B\u9762\u3067\u30ED\u30B0\u30A4\u30F3\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F\u3002",not_allowed:"\u3053\u306E Google \u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306B\u7D10\u3065\u304F\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",suspended:"\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u505C\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",expired:"\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",account_mismatch:"\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306B\u306F\u5225\u306E Google \u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u7D10\u3065\u3044\u3066\u3044\u307E\u3059\u3002\u7D10\u3065\u3044\u305F\u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002",google_error:"Google \u3068\u306E\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"};cq=P_("\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u306B\u623B\u3063\u3066\u304F\u3060\u3055\u3044\u3002"),k_=P_("\u30ED\u30B0\u30A4\u30F3\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u306E\u8868\u793A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),lq=P_("\u3053\u306E\u30ED\u30B0\u30A4\u30F3\u64CD\u4F5C\u306E\u5FDC\u7B54\u3067\u306F\u306A\u3044\u305F\u3081\u7121\u8996\u3057\u307E\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u3067\u5B9F\u884C\u4E2D\u306E godd login \u306E\u753B\u9762\u304B\u3089\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002");pq=f.object({access_token:f.string().min(1),token_type:f.string().optional(),expires_at:f.string().nullable().optional().default(null),license_id:f.string().nullable().optional().default(null),email:f.string().nullable().optional().default(null),user:f.string().nullable().optional(),drive_authorized:f.boolean().optional().default(!1),drive_error:f.string().nullable().optional().default(null)})});var R_={};Xt(R_,{formatLoginSummary:()=>gC,loginAndSave:()=>dp,parseLoginArgs:()=>dC,parseLogoutArgs:()=>fC,resolveLoginRegistryUrl:()=>Za,runLogin:()=>hq,runLogout:()=>mq});function dC(e){let t={drive:!1,noBrowser:!1};for(let r=0;r<e.length;r+=1){let n=e[r],[o,i]=n.includes("=")?[n.slice(0,n.indexOf("=")),n.slice(n.indexOf("=")+1)]:[n,void 0],s=()=>{if(i!==void 0)return i;let a=e[r+1];if(a===void 0||a.startsWith("--"))throw new Ye(`${o} \u306B\u306F\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002`);return r+=1,a};switch(o){case"--drive":t.drive=!0;break;case"--no-browser":t.noBrowser=!0;break;case"--device-name":t.deviceName=s();break;case"--registry-url":t.registryUrl=s();break;default:throw new Ye(`\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: ${n}
|
|
279
|
-
\u4F7F\u3044\u65B9: godd login [--drive] [--device-name <\u540D\u524D>] [--no-browser] [--registry-url <url>]`)}}return t}function
|
|
280
|
-
${t}`);o.includes("=")||(n+=1),r.registryUrl=i;continue}throw new
|
|
281
|
-
${t}`)}return r}function
|
|
282
|
-
`),"utf-8"),n}function
|
|
283
|
-
`)}function
|
|
284
|
-
`)){let p=
|
|
285
|
-
`);(0,_e.writeFileSync)(e,a,"utf-8")}function LC(){if(kq())return{command:"godd",args:[]};let e;try{e=(0,wC.fileURLToPath)(__goddBundleUrl)}catch{typeof __filename<"u"?e=__filename:(e=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: ${e}`))}let t=(0,he.dirname)(e),r=e.includes("src")?(0,he.resolve)(t,"..","..","dist","godd.js"):(0,he.resolve)(t,"godd.js");return{command:process.execPath,args:[r]}}function z_(e,t){let r={GODD_CONFIG:e,...t},{command:n,args:o}=LC();return{command:n,args:[...o,"server"],env:r}}function ZC(e){let t=["mcp","serve"];return e&&t.push("--proxy-url",e),{type:"stdio",command:"headroom",args:t}}function UC(e=process.platform){let t="pipx/venv \u306E headroom \u304C Cursor \u304B\u3089\u898B\u3048\u306A\u3044\u5834\u5408\u306F .cursor/mcp.json \u306E command \u3092\u7D76\u5BFE\u30D1\u30B9\u306B\u5909\u66F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002";return e==="darwin"?"macOS + Homebrew Python \u3067\u306F PEP 668 \u306B\u3088\u308A bare pip install \u304C\u5931\u6557\u3059\u308B\u305F\u3081\u3001venv \u307E\u305F\u306F pipx \u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+t:"\u4E8B\u524D\u306B venv/pipx \u7B49\u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+t}function qC(e="core"){return{type:"stdio",command:"agent-browser",args:["mcp","--tools",e]}}function FC(e="https://mcp.typeui.sh",t){let r=t?.trim();return r?{url:e,headers:{Authorization:`Bearer ${r}`}}:{url:e}}async function VC(e,t,r={}){let n=r.fetchImpl??fetch,o=r.timeoutMs??GC,i=`${e.replace(/\/+$/,"")}/v1/google/access`,s;try{s=await n(i,{headers:{Authorization:`Bearer ${t}`},signal:AbortSignal.timeout(o)})}catch(l){let p=l instanceof Error?l.name:"";return{status:"unavailable",reason:p==="TimeoutError"||p==="AbortError"?"\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8":"\u901A\u4FE1\u30A8\u30E9\u30FC"}}if(s.status===401||s.status===403)return{status:"unauthorized",httpStatus:s.status};if(s.status===404)return{status:"unsupported"};if(!s.ok)return{status:"unavailable",reason:`HTTP ${s.status}`};let a;try{a=await s.json()}catch{return{status:"unavailable",reason:"\u5FDC\u7B54\u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093"}}let c=a&&typeof a=="object"?a.projects:void 0;return Array.isArray(c)?c.length===0?{status:"none"}:{status:"granted",projectCount:c.length}:{status:"unavailable",reason:"\u5FDC\u7B54\u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093"}}function BC(e,t){return{url:e,headers:{Authorization:`Bearer ${t}`}}}function Eq(e,t){let{command:r,args:n}=LC(),o={GODD_REGISTRY_URL:e};return t!==up&&(o.GODD_GOOGLE_MCP_URL=t),{command:r,args:[...n,"google-relay"],env:o}}function HC(e){if(!e||typeof e!="object")return!1;let{url:t,headers:r,args:n,env:o}=e;return t!==void 0||r!==void 0||!Array.isArray(n)||n[n.length-1]!=="google-relay"?!1:!(o&&typeof o=="object"&&"GODD_LICENSE_KEY"in o)}function yC(e,t,r,n,o=!1){let i=Cq(e,t,r);return o?i.action==="add"&&e.enabled?{action:"add",entry:Eq(n,e.url),projectCount:i.projectCount,relay:!0}:i.action==="keep"&&i.reason!=="disabled"?{action:"remove",reason:"device-token",cause:i.reason,detail:i.detail}:i:i}function Cq(e,t,r){if(!e.enabled)return{action:"keep",reason:e.reason};if(!t)return{action:"keep",reason:"unavailable"};switch(t.status){case"granted":return{action:"add",entry:BC(e.url,r),projectCount:t.projectCount};case"none":return{action:"remove",reason:"no-projects"};case"unauthorized":return{action:"remove",reason:"unauthorized"};case"unsupported":return{action:"keep",reason:"unsupported"};case"unavailable":return{action:"keep",reason:"unavailable",detail:t.reason}}}async function KC(e,t,r={}){let n=b_(r.env);if(!n.enabled)return yC(n,null,t,e,r.deviceToken);let o=await VC(e,t,{fetchImpl:r.fetchImpl,timeoutMs:r.timeoutMs});return yC(n,o,t,e,r.deviceToken)}function WC(e,t,r){switch(e.action){case"add":return t.written?e.relay?`\u2713 ${Ot}\uFF08Google \u9023\u643A MCP\uFF09\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F\uFF08\u5272\u5F53\u6848\u4EF6 ${e.projectCount} \u4EF6\u3001godd google-relay \u7D4C\u7531\u3002\u30ED\u30B0\u30A4\u30F3\u306E\u30C8\u30FC\u30AF\u30F3\u306F MCP \u8A2D\u5B9A\u306B\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\uFF09`:`\u2713 ${Ot}\uFF08Google \u9023\u643A MCP\uFF09\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F\uFF08\u5272\u5F53\u6848\u4EF6 ${e.projectCount} \u4EF6\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC ${DC(r)}\uFF09`:null;case"remove":if(e.reason==="device-token"){if(e.cause==="unsupported")return t.removed&&!t.kept?`\u2713 Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u305F\u3081\u3001\u65E2\u5B58\u306E ${Ot}\uFF08Google \u9023\u643A MCP\uFF09\u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F\uFF08\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u5E73\u6587\u3067\u66F8\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u305F\u3081\uFF09`:null;let n=e.cause==="invalid-url"?"GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u306A\u3044\u305F\u3081":`Google \u9023\u643A\u306E\u5272\u5F53\u3092\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\uFF08${e.detail??"\u901A\u4FE1\u30A8\u30E9\u30FC"}\uFF09`;return t.kept&&!t.removed?`\u26A0 ${n}\u3001${Ot} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u65E2\u5B58\u306E godd google-relay \u7D4C\u7531\u306E\u8A2D\u5B9A\u306F\u305D\u306E\u307E\u307E\u6B8B\u3057\u307E\u3057\u305F\uFF09`:`\u26A0 ${n}\u3001${Ot} \u3092\u8A2D\u5B9A\u3057\u307E\u305B\u3093\u3067\u3057\u305F`+(t.removed?"\u3002Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u305F\u3081\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u5E73\u6587\u3067\u66F8\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u65E2\u5B58\u306E\u8A2D\u5B9A\u306F\u524A\u9664\u3057\u307E\u3057\u305F":"")+"\u3002\u63A5\u7D9A\u3067\u304D\u308B\u72B6\u614B\u3067 godd init \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044"}return t.removed?e.reason==="no-projects"?`\u2713 Google \u9023\u643A\u306E\u5272\u5F53\u6848\u4EF6\u304C\u7121\u3044\u305F\u3081\u3001${Ot} \u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F`:`\u2713 \u30E9\u30A4\u30BB\u30F3\u30B9\u3067 Google \u9023\u643A\u3092\u5229\u7528\u3067\u304D\u306A\u3044\u305F\u3081\uFF08\u7121\u52B9\u307E\u305F\u306F\u671F\u9650\u5207\u308C\uFF09\u3001${Ot} \u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F`:null;case"keep":return e.reason==="disabled"?` GODD_GOOGLE_MCP \u306E\u6307\u5B9A\u306B\u3088\u308A ${Ot} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`:e.reason==="invalid-url"?`\u26A0 GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u306A\u3044\u305F\u3081\u3001${Ot} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`:e.reason==="unsupported"?null:`\u26A0 Google \u9023\u643A\u306E\u5272\u5F53\u3092\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\uFF08${e.detail??"\u901A\u4FE1\u30A8\u30E9\u30FC"}\uFF09\u3001${Ot} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`}}function JC(e,t,r=[]){let n=e?{...e}:{},i={...typeof n.mcpServers=="object"&&n.mcpServers!==null?n.mcpServers:{},...t};for(let s of r)s in t||delete i[s];return n.mcpServers=i,n}function YC(e){let t={};for(let[r,n]of Object.entries(e))t[r]="url"in n&&!("type"in n)?{type:"http",...n}:n;return t}function QC(e,t,r=(0,bC.homedir)()){return[{label:".cursor/mcp.json\uFF08Cursor \u7528\uFF09",path:(0,he.resolve)((0,he.join)(e,".cursor","mcp.json")),userGlobalPath:(0,he.resolve)((0,he.join)(r,".cursor","mcp.json")),servers:t},{label:".mcp.json\uFF08Claude Code \u7528\uFF09",path:(0,he.resolve)((0,he.join)(e,".mcp.json")),userGlobalPath:(0,he.resolve)((0,he.join)(r,".mcp.json")),servers:YC(t)}]}function XC(e,t,r=[],n){let o=null,i;if((0,_e.existsSync)(e)){let u=(0,_e.readFileSync)(e,"utf-8");try{o=JSON.parse(u)}catch{i=`${e}.bak`,(0,_e.writeFileSync)(i,u,"utf-8")}}else{let u=(0,he.dirname)(e);(0,_e.existsSync)(u)||(0,_e.mkdirSync)(u,{recursive:!0})}let s=o&&typeof o.mcpServers=="object"&&o.mcpServers!==null?o.mcpServers:{},a=r.filter(u=>u in s&&!(u in t)),c=n?a.filter(u=>n(s[u])):[],l=a.filter(u=>!c.includes(u)),p=JC(o,t,l);return(0,_e.writeFileSync)(e,JSON.stringify(p,null,2),"utf-8"),{backupPath:i,removed:l,kept:c}}function eT(e,t,r){let n=e.trim();return Tq.has(n.toLowerCase())?{mode:"google"}:n?{mode:"license_key",licenseKey:n}:t?{mode:"license_key",licenseKey:t}:r?{mode:"google"}:{mode:"missing"}}function tT(e,t){return e?`\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08Enter \u3067\u65E2\u5B58\u3092\u4FDD\u6301 [${DC(e)}]\u3002Google \u3067\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5834\u5408\u306F google\uFF09: `:t?`\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08Enter \u3067\u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3 [${t.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"} / ${t.registry_url}] \u3092\u4F7F\u7528\uFF09: `:"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5834\u5408\u306F google\uFF09: "}function rT(e,t=br()){try{return Io(e,t)?.credentials??un(t)[0]??null}catch{return null}}async function nT(e,t={}){let r=t.log??(c=>console.log(c)),n=t.credentialsPath?[t.credentialsPath]:br(),o=null,i=[];try{o=Io(e,n)?.credentials??null,i=un(n).filter(c=>rt(c.registry_url)!==rt(e))}catch{}if(o)return r(`\u2713 \u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3\u3092\u4F7F\u3044\u307E\u3059: ${o.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}`),pl(o,t.now)&&r(` \u26A0 \u624B\u5143\u306E\u8A18\u9332\u3067\u306F\u6709\u52B9\u671F\u9650\uFF08${o.expires_at}\uFF09\u3092\u904E\u304E\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u304C\u5EF6\u9577\u3057\u3066\u3044\u308C\u3070\u305D\u306E\u307E\u307E\u4F7F\u3048\u307E\u3059\u3002\u62D2\u5426\u3055\u308C\u305F\u5834\u5408\u306F godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),o;if(i.length>0){let c=i.map(l=>l.registry_url).join(", ");r(`
|
|
272
|
+
`,"utf-8"),!0}var rs,YE,vy=b(()=>{"use strict";rs=require("node:fs"),YE=require("node:path")});function lp(e){if(!(0,up.existsSync)(e))return{};try{let t=(0,up.readFileSync)(e,"utf-8"),r={};for(let n of t.split(`
|
|
273
|
+
`)){let o=n.trim();if(!o||o.startsWith("#"))continue;let i=o.indexOf("=");if(i===-1)continue;let s=o.slice(0,i).trim(),a=o.slice(i+1).trim();(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),r[s]=a}return r}catch{return{}}}var up,wy=b(()=>{"use strict";up=require("node:fs")});function by(e=process.env){let t=e.GODD_GOOGLE_MCP_URL?.trim();if(!t)return pp;try{let r=new URL(t),n=["localhost","127.0.0.1","[::1]"].includes(r.hostname);return r.protocol==="https:"||r.protocol==="http:"&&n?t:null}catch{return null}}function xy(e=process.env){let t=e.GODD_GOOGLE_MCP?.trim().toLowerCase();if(t&&FU.has(t))return{enabled:!1,reason:"disabled"};let r=by(e);return r?{enabled:!0,url:r}:{enabled:!1,reason:"invalid-url"}}var pp,FU,ky=b(()=>{"use strict";pp="https://google-mcp.ripla.co.jp/mcp",FU=new Set(["off","0","false","no"])});function Py(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function BU(){let e=Py((0,Ma.randomBytes)(32));return{verifier:e,challenge:HU(e)}}function HU(e){return Py((0,Ma.createHash)("sha256").update(e).digest())}function WU(){return Py((0,Ma.randomBytes)(16))}function Jr(e){let t=rt(e),r;try{r=new URL(t)}catch{throw new Ke(`Registry \u306E URL \u304C\u4E0D\u6B63\u3067\u3059: ${t}`)}if(r.protocol==="https:"||r.protocol==="http:"&&KU.has(r.hostname))return t;throw new Ke(`Registry \u306E URL \u306F https:// \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08http:// \u306F 127.0.0.1 / localhost / [::1] \u306E\u307F\uFF09: ${t}`)}function JU(e,t){let r=new URL(`${Jr(e)}/v1/auth/google/start`);return r.searchParams.set("redirect_uri",t.redirectUri),r.searchParams.set("code_challenge",t.codeChallenge),r.searchParams.set("code_challenge_method","S256"),r.searchParams.set("state",t.state),r.searchParams.set("device_name",t.deviceName),t.drive&&r.searchParams.set("drive","true"),r.toString()}function QU(e,t){if(e.get("state")!==t)return{kind:"state_mismatch"};let r=e.get("error");if(r){let o=e.get("error_description")?.trim()||YU[r]||"";return{kind:"error",error:new Ke(`Google \u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${r}\uFF09${o?`: ${o}`:""}`)}}let n=e.get("code");return n?{kind:"code",code:n}:{kind:"error",error:new Ke("\u30ED\u30B0\u30A4\u30F3\u5FDC\u7B54\u306B\u30B3\u30FC\u30C9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}}function Ey(e){return`<!doctype html><html lang="ja"><meta charset="utf-8"><title>GoDD</title><body><p>${e}</p></body></html>`}function ja(e,t,r){e.writeHead(t,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),e.end(r)}async function tq(e,t,r=$y){let n=null,o=new Promise((l,d)=>{n={resolve:l,reject:d}});o.catch(()=>{});let i=!1,s=!1,a=l=>{i||(i=!0,l())},c,u=(0,eC.createServer)((l,d)=>{let f=new URL(l.url??"/","http://127.0.0.1");if(f.pathname!==QE){d.writeHead(404).end();return}if(l.method!=="GET"){d.writeHead(405,{Allow:"GET"}).end();return}if(i||s){ja(d,409,Sy);return}let h=QU(f.searchParams,e);if(h.kind==="state_mismatch"){ja(d,400,eq);return}if(h.kind==="error"){ja(d,400,Sy),a(()=>n?.reject(h.error));return}s=!0,clearTimeout(c),t(h.code).then(g=>{ja(d,200,XU),a(()=>n?.resolve(g))},g=>{ja(d,502,Sy),a(()=>n?.reject(g instanceof Error?g:new Error(String(g))))})});await new Promise((l,d)=>{u.once("error",d),u.listen(0,"127.0.0.1",()=>l())}),c=setTimeout(()=>{a(()=>n?.reject(new Ke(`${Math.round(r/6e4)} \u5206\u4EE5\u5185\u306B\u30ED\u30B0\u30A4\u30F3\u304C\u5B8C\u4E86\u3057\u306A\u304B\u3063\u305F\u305F\u3081\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)))},r),c.unref?.();let{port:p}=u.address();return{redirectUri:`http://127.0.0.1:${p}${QE}`,result:o,close(){clearTimeout(c),a(()=>n?.reject(new Ke("\u30ED\u30B0\u30A4\u30F3\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002"))),u.closeAllConnections?.(),u.close()}}}function tC(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:r&&typeof r=="object"&&"message"in r?String(r.message):JSON.stringify(r)}}catch{}return e.slice(0,300)}async function nq(e,t,r,n=fetch){let o=Jr(e),i,s;try{i=await n(`${o}/v1/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,code_verifier:r}),signal:AbortSignal.timeout(GU)}),s=await i.text()}catch(u){throw new Ke(`Registry API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\uFF08${e}\uFF09: ${u instanceof Error?u.message:String(u)}`)}if(!i.ok)throw i.status===503?new Ke("\u3053\u306E Registry \u3067\u306F Google \u30ED\u30B0\u30A4\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3059\u308B\u304B\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002"):new Ke(`\u30ED\u30B0\u30A4\u30F3\u30B3\u30FC\u30C9\u306E\u4EA4\u63DB\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${i.status}\uFF09: ${tC(s)}\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let a;try{a=JSON.parse(s)}catch{throw new Ke(`Registry API \u306E\u5FDC\u7B54\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${s.slice(0,200)}`)}let c=rq.safeParse(a);if(!c.success)throw new Ke(`Registry API \u306E\u5FDC\u7B54\u304C\u60F3\u5B9A\u3068\u7570\u306A\u308A\u307E\u3059: ${c.error.message}`);return c.data}async function Cy(e,t,r=fetch){let n=await r(`${Jr(e)}/v1/auth/logout`,{method:"POST",headers:{Authorization:`Bearer ${t}`},signal:AbortSignal.timeout(1e4)});if(!n.ok){let o=await n.text().catch(()=>"");throw new Error(`${n.status} ${tC(o)}`.trim())}}function oq(e){let t="";try{t=new URL(e).protocol}catch{}if(t!=="https:"&&t!=="http:")return Promise.resolve(!1);let[r,n]=process.platform==="darwin"?["open",[e]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]];return new Promise(o=>{try{let i=(0,XE.spawn)(r,n,{stdio:"ignore",detached:!0});i.once("error",()=>o(!1)),i.once("spawn",()=>{i.unref(),o(!0)})}catch{o(!1)}})}function Ty(e){return((e??"").trim()||"unknown device").slice(0,VU)}async function rC(e,t={}){let r=t.log??(c=>console.log(c)),n=t.openBrowser??oq,o=Jr(e.registryUrl),i=BU(),s=WU(),a=await tq(s,c=>nq(o,c,i.verifier,t.fetch),t.timeoutMs??$y);try{let c=JU(o,{redirectUri:a.redirectUri,codeChallenge:i.challenge,state:s,deviceName:Ty(e.deviceName),drive:e.drive});return(e.noBrowser?!1:await n(c))?(r("\u30D6\u30E9\u30A6\u30B6\u3067 Google \u30ED\u30B0\u30A4\u30F3\u306E\u753B\u9762\u3092\u958B\u304D\u307E\u3057\u305F\u3002\u30ED\u30B0\u30A4\u30F3\u3092\u5B8C\u4E86\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),r("\u30D6\u30E9\u30A6\u30B6\u304C\u958B\u304B\u306A\u3044\u5834\u5408\u306F\u3001\u6B21\u306E URL \u3092\u958B\u3044\u3066\u304F\u3060\u3055\u3044:")):r("\u6B21\u306E URL \u3092\u30D6\u30E9\u30A6\u30B6\u3067\u958B\u304D\u3001Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u3053\u306E\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u30FC\u306E\u30D6\u30E9\u30A6\u30B6\u3067\u958B\u304F\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF09:"),r(c),r(""),r(`\u5F85\u6A5F\u4E2D...\uFF08${Math.round((t.timeoutMs??$y)/6e4)} \u5206\u3067\u6642\u9593\u5207\u308C\u306B\u306A\u308A\u307E\u3059\uFF09`),await a.result}finally{a.close()}}var XE,Ma,eC,$y,GU,QE,VU,Ke,KU,YU,XU,Sy,eq,rq,dp=b(()=>{"use strict";XE=require("node:child_process"),Ma=require("node:crypto"),eC=require("node:http");Xe();$i();$y=300*1e3,GU=15e3,QE="/callback",VU=200,Ke=class extends Error{constructor(t){super(t),this.name="LoginError"}};KU=new Set(["127.0.0.1","localhost","[::1]"]);YU={access_denied:"Google \u306E\u753B\u9762\u3067\u30ED\u30B0\u30A4\u30F3\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F\u3002",not_allowed:"\u3053\u306E Google \u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306B\u7D10\u3065\u304F\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",suspended:"\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u505C\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",expired:"\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",account_mismatch:"\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306B\u306F\u5225\u306E Google \u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u7D10\u3065\u3044\u3066\u3044\u307E\u3059\u3002\u7D10\u3065\u3044\u305F\u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002",google_error:"Google \u3068\u306E\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"};XU=Ey("\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u306B\u623B\u3063\u3066\u304F\u3060\u3055\u3044\u3002"),Sy=Ey("\u30ED\u30B0\u30A4\u30F3\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u306E\u8868\u793A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),eq=Ey("\u3053\u306E\u30ED\u30B0\u30A4\u30F3\u64CD\u4F5C\u306E\u5FDC\u7B54\u3067\u306F\u306A\u3044\u305F\u3081\u7121\u8996\u3057\u307E\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u3067\u5B9F\u884C\u4E2D\u306E godd login \u306E\u753B\u9762\u304B\u3089\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002");rq=m.object({access_token:m.string().min(1),token_type:m.string().optional(),expires_at:m.string().nullable().optional().default(null),license_id:m.string().nullable().optional().default(null),email:m.string().nullable().optional().default(null),user:m.string().nullable().optional(),drive_authorized:m.boolean().optional().default(!1),drive_error:m.string().nullable().optional().default(null)})});var Ry={};Xt(Ry,{formatLoginSummary:()=>lC,loginAndSave:()=>fp,parseLoginArgs:()=>sC,parseLogoutArgs:()=>aC,resolveLoginRegistryUrl:()=>La,runLogin:()=>iq,runLogout:()=>sq});function sC(e){let t={drive:!1,noBrowser:!1};for(let r=0;r<e.length;r+=1){let n=e[r],[o,i]=n.includes("=")?[n.slice(0,n.indexOf("=")),n.slice(n.indexOf("=")+1)]:[n,void 0],s=()=>{if(i!==void 0)return i;let a=e[r+1];if(a===void 0||a.startsWith("--"))throw new Ke(`${o} \u306B\u306F\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002`);return r+=1,a};switch(o){case"--drive":t.drive=!0;break;case"--no-browser":t.noBrowser=!0;break;case"--device-name":t.deviceName=s();break;case"--registry-url":t.registryUrl=s();break;default:throw new Ke(`\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: ${n}
|
|
274
|
+
\u4F7F\u3044\u65B9: godd login [--drive] [--device-name <\u540D\u524D>] [--no-browser] [--registry-url <url>]`)}}return t}function aC(e){let t="\u4F7F\u3044\u65B9: godd logout [--registry-url <url>]",r={};for(let n=0;n<e.length;n+=1){let o=e[n];if(o==="--registry-url"||o.startsWith("--registry-url=")){let i=o.includes("=")?o.slice(o.indexOf("=")+1):e[n+1];if(i===void 0||i.startsWith("--"))throw new Ke(`--registry-url \u306B\u306F\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002
|
|
275
|
+
${t}`);o.includes("=")||(n+=1),r.registryUrl=i;continue}throw new Ke(`\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: ${o}
|
|
276
|
+
${t}`)}return r}function La(e,t={}){let r=t.env??process.env,n=lp((0,iC.join)(t.cwd??process.cwd(),".env")).GODD_REGISTRY_URL,o=t.savedRegistries??[],i=e?.trim()||r.GODD_REGISTRY_URL?.trim()||n?.trim()||(o.length===1?o[0]:void 0)||ln;return Jr(i)}function cC(e){let t=new Map;for(let r of e){let n=[];try{n=un([r])}catch{}for(let o of n){let i=rt(o.registry_url);t.has(i)||t.set(i,o)}}return[...t.values()]}function uC(e,t){for(let r of t)try{let n=Ro(e,[r]);if(n)return n}catch{}return null}function Ay(e){return e.credentialsPath?[e.credentialsPath]:wr(e.env)}async function fp(e,t={}){let r=t.log??(u=>console.log(u)),n=t.credentialsPath??On(t.env),o=Jr(e.registryUrl),i=uC(o,Ay(t)),s=Ty(e.deviceName??(t.defaultDeviceName??oC.hostname)()),a=await rC({registryUrl:o,deviceName:s,drive:e.drive,noBrowser:e.noBrowser},t),c={registry_url:o,access_token:a.access_token,expires_at:a.expires_at,email:a.email,license_id:a.license_id,device_name:s,drive_authorized:a.drive_authorized,saved_at:(t.now??(()=>new Date))().toISOString()};if(Dx(c,n),i&&i.credentials.access_token!==c.access_token){if(i.path!==n)try{xf(o,i.path)}catch{}await Cy(o,i.credentials.access_token,t.fetch).catch(()=>{r(" \uFF08\u524D\u56DE\u306E\u7AEF\u672B\u30C8\u30FC\u30AF\u30F3\u306E\u5931\u52B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u671F\u9650\u304C\u6765\u308B\u304B\u7BA1\u7406\u753B\u9762\u3067\u5931\u52B9\u3055\u308C\u308B\u307E\u3067\u6709\u52B9\u3067\u3059\uFF09")})}return{credentials:c,driveError:a.drive_error}}function lC(e,t,r,n=null){let o=[`\u2713 \u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F: ${e.email??"\uFF08\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E\uFF09"}`,` \u30E9\u30A4\u30BB\u30F3\u30B9: ${e.license_id??"\uFF08\u4E0D\u660E\uFF09"}`,` \u7AEF\u672B\u540D: ${e.device_name}`,` \u6709\u52B9\u671F\u9650: ${e.expires_at??"\u306A\u3057\uFF08\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u671F\u9650\u306B\u5F93\u3044\u307E\u3059\uFF09"}`,` Registry: ${e.registry_url}`,` \u4FDD\u5B58\u5148: ${t}`];return e.drive_authorized?o.push(" Drive: \u672C\u4EBA\u306E\u6A29\u9650\u3067\u306E\u8AAD\u307F\u53D6\u308A\u3092\u8A31\u53EF\u3057\u307E\u3057\u305F\uFF08Google \u306E\u540C\u610F\u753B\u9762\u304C\u30C6\u30B9\u30C8\u4E2D\u306E\u9593\u306F 7 \u65E5\u3067\u30ED\u30B0\u30A4\u30F3\u304C\u5207\u308C\u307E\u3059\u3002\u5207\u308C\u305F\u3089 godd login --drive \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF09"):n==="not_granted"?o.push(" \u26A0 Drive \u306E\u8AAD\u307F\u53D6\u308A\u304C\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u540C\u610F\u753B\u9762\u3067 Google \u30C9\u30E9\u30A4\u30D6\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5165\u308C\u3066 godd login --drive \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"):n==="not_configured"?o.push(" \u26A0 Registry \u5074\u3067 Drive \u306E\u8A31\u53EF\u3092\u4FDD\u5B58\u3059\u308B\u8A2D\u5B9A\u304C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u3084\u308A\u76F4\u3057\u3066\u3082\u76F4\u308A\u307E\u305B\u3093\uFF09\u3002"):r&&o.push(" \u26A0 Drive \u306E\u8AAD\u307F\u53D6\u308A\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002Google \u306E\u753B\u9762\u3067 Drive \u3078\u306E\u30A2\u30AF\u30BB\u30B9\u3092\u8A31\u53EF\u3057\u3066 godd login --drive \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),o.push(""),o.push("\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u8A2D\u5B9A\u3057\u3066\u3044\u306A\u3044\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067\u306F\u3001\u3053\u306E\u30ED\u30B0\u30A4\u30F3\u304C\u4F7F\u308F\u308C\u307E\u3059\u3002"),o.push("IDE / Claude Code / Codex \u306E MCP \u30B5\u30FC\u30D0\u30FC\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u518D\u8D77\u52D5\u3059\u308B\u307E\u3067\u306F\u524D\u306E\u30ED\u30B0\u30A4\u30F3\u306E\u307E\u307E\u3067\u3059\uFF09\u3002"),o}async function iq(e,t={}){let r=t.log??(o=>console.log(o)),n=t.credentialsPath??On(t.env);try{let o=sC(e),i=cC(Ay(t)).map(u=>u.registry_url),s=La(o.registryUrl,{env:t.env,cwd:t.cwd,savedRegistries:i});r(`GoDD \u306B Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3059\uFF08Registry: ${s}\uFF09`),o.drive&&r("Drive \u306E\u8AAD\u307F\u53D6\u308A\uFF08\u672C\u4EBA\u306E\u6A29\u9650\uFF09\u3082\u8A31\u53EF\u3092\u6C42\u3081\u307E\u3059\u3002");let{credentials:a,driveError:c}=await fp({...o,registryUrl:s},{...t,credentialsPath:n});for(let u of lC(a,n,o.drive,c))r(u)}catch(o){console.error(`\u30A8\u30E9\u30FC: ${o instanceof Error?o.message:String(o)}`),process.exitCode=1}}async function sq(e,t={}){let r=t.log??(c=>console.log(c)),n=Ay(t),o,i;try{let c=aC(e);i=cC(n),o=c.registryUrl?rt(c.registryUrl):i.length===1?rt(i[0].registry_url):La(void 0,{env:t.env,cwd:t.cwd})}catch(c){console.error(`\u30A8\u30E9\u30FC: ${c instanceof Error?c.message:String(c)}`),process.exitCode=1;return}let s=uC(o,n);if(s)try{await Cy(o,s.credentials.access_token,t.fetch),r("\u2713 Registry \u3067\u3053\u306E\u7AEF\u672B\u306E\u30C8\u30FC\u30AF\u30F3\u3092\u5931\u52B9\u3057\u307E\u3057\u305F")}catch(c){r(`\u26A0 Registry \u3067\u306E\u5931\u52B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${c instanceof Error?c.message:String(c)}\uFF09\u3002\u30ED\u30FC\u30AB\u30EB\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306F\u524A\u9664\u3057\u307E\u3059\u3002\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u753B\u9762\u3067\u7AEF\u672B\u30C8\u30FC\u30AF\u30F3\u3092\u5931\u52B9\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}let a=!1;for(let c of n)try{xf(o,c)&&(a=!0,r(`\u2713 \u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u3092\u524A\u9664\u3057\u307E\u3057\u305F\uFF08Registry: ${o}\uFF09: ${c}`))}catch{(0,nC.rmSync)(c,{force:!0}),a=!0,r(`\u2713 \u8AAD\u307F\u8FBC\u3081\u306A\u3044\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u524A\u9664\u3057\u307E\u3057\u305F: ${c}`)}if(!a){r(`\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u307E\u305B\u3093\uFF08Registry: ${o} \u306E\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002`);let c=i.filter(u=>rt(u.registry_url)!==o);c.length>0&&r(` \u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3: ${c.map(u=>u.registry_url).join(", ")}\uFF08godd logout --registry-url <url> \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`)}}var nC,oC,iC,Za=b(()=>{"use strict";nC=require("node:fs"),oC=require("node:os"),iC=require("node:path");$i();dp();Nn();wy()});var eT={};Xt(eT,{BUILTIN_COMPONENTS:()=>Iy,CATEGORY_LABELS:()=>zy,DEFAULT_GOOGLE_MCP_URL:()=>pp,GOOGLE_ACCESS_TIMEOUT_MS:()=>MC,GOOGLE_MCP_SERVER_NAME:()=>Ot,buildAgentBrowserMcpServerEntry:()=>NC,buildGoddMcpEnv:()=>QC,buildGoogleMcpServerEntry:()=>ZC,buildHeadroomMcpServerEntry:()=>DC,buildLicenseKeyPrompt:()=>KC,buildMcpServerEntry:()=>Dy,buildMcpTargets:()=>BC,buildProjectUrlPrompt:()=>vC,buildTypeUiMcpServerEntry:()=>jC,ensureInitGitignoreEntries:()=>xC,fetchGoogleAccess:()=>LC,findSavedLogin:()=>JC,formatGoogleMcpMessage:()=>FC,getCategoryShortLabel:()=>EC,getHeadroomInstallNote:()=>OC,getProjectUrlDefaultMessage:()=>bC,groupByCategory:()=>PC,isGoogleRelayServerEntry:()=>UC,loadExistingConfigSafe:()=>TC,mergeMcpServers:()=>GC,resolveGoogleMcp:()=>qC,resolveGoogleMcpSettings:()=>xy,resolveInitAuthChoice:()=>WC,resolveInitDeviceLogin:()=>YC,resolveProjectUrl:()=>wC,runInit:()=>XC,toClaudeCodeMcpServers:()=>VC,writeCodexMcpConfigFile:()=>$C,writeEnvFile:()=>IC,writeGoddDevCommandFiles:()=>kC,writeGoddDevSkillFile:()=>SC,writeMcpJsonFile:()=>HC});function Ir(e){return new Promise(t=>{_C.question(e,r=>t(r.trim()))})}function vC(e,t){return`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8URL\uFF08GoDD Admin Console \u3068\u9023\u643A\u3057\u3066\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u53D6\u5F97\u3059\u308B Registry API \u306E\u63A5\u7D9A\u5148\u3002Enter \u3067${t?"\u65E2\u5B58\u5024\u3092\u4FDD\u6301":"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u3092\u4F7F\u7528"}: ${e}\uFF09: `}function wC(e,t){let r=e.trim();return r?{url:Jr(r),usedDefault:!1}:{url:Jr(t),usedDefault:!0}}function bC(e,t){return` \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8URL\u306F${t?"\u65E2\u5B58\u306E\u8A2D\u5B9A\u5024":"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024"}\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e}`}function xC(e){return cp(e,aq)}function kC(e){let t=[];for(let r of lq){let n=(0,fe.join)(e,r);(!(0,ye.existsSync)(n)||(0,ye.readFileSync)(n,"utf-8").includes(gC))&&((0,ye.mkdirSync)((0,fe.dirname)(n),{recursive:!0}),(0,ye.writeFileSync)(n,cq,"utf-8"),t.push(n))}return t}function SC(e){let t=(0,fe.join)(e,".agents","skills","godd-dev","SKILL.md");if(!(0,ye.existsSync)(t)||(0,ye.readFileSync)(t,"utf-8").includes(yC))return(0,ye.mkdirSync)((0,fe.dirname)(t),{recursive:!0}),(0,ye.writeFileSync)(t,uq,"utf-8"),t}function $C(e,t,r){let n=(0,fe.join)(e,".codex","config.toml");if(!(!(0,ye.existsSync)(n)||(0,ye.readFileSync)(n,"utf-8").includes(pC)))return;let i=Dy(t,r),s=typeof i.command=="string"?i.command:"godd",a=Array.isArray(i.args)?i.args.filter(p=>typeof p=="string"):["server"],c=i.env&&typeof i.env=="object"?i.env:{},u=[pC,"GODD_LICENSE_KEY"in c?"# This file contains the license key; keep it out of version control.":"# The license is read from the `godd login` credentials (no key in this file).","","[mcp_servers.godd]",`command = ${JSON.stringify(s)}`,`args = [${a.map(p=>JSON.stringify(p)).join(", ")}]`,"","[mcp_servers.godd.env]",...Object.entries(c).map(([p,l])=>`${p} = ${JSON.stringify(String(l))}`),""];return(0,ye.mkdirSync)((0,fe.dirname)(n),{recursive:!0}),(0,ye.writeFileSync)(n,u.join(`
|
|
277
|
+
`),"utf-8"),n}function PC(e){let t=new Map;for(let n of e){let o=dq[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 EC(e){return(zy[e]??e).replace(/([^)]*)$/,"")}function fq(e,t){let r=pq[e];return r===void 0||r.length===0?!0:r.some(n=>t.has(n))}function hq(){return!!process.pkg}async function mq(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 CC(e){return e.length<=8?"****":`${e.slice(0,4)}****${e.slice(-4)}`}function TC(e){let t=(0,fe.join)((0,fe.dirname)(e),".env"),r=lp(t),n={};if((0,ye.existsSync)(e))try{let c=(0,ye.readFileSync)(e,"utf-8"),u=_r.load(c);u&&typeof u=="object"&&(n=u)}catch{}if(Object.keys(n).length===0&&Object.keys(r).length===0)return null;let o={},i=r.GODD_LICENSE_KEY??(typeof n.license_key=="string"?n.license_key:void 0);i&&(o.license_key=i);let s=r.GODD_LANGUAGE??(typeof n.language=="string"?n.language:void 0);s&&(o.language=s);let a=r.GODD_REGISTRY_URL??(typeof n.registry_url=="string"?n.registry_url:void 0);return a&&(o.registry_url=a),Array.isArray(n.components)&&n.components.every(c=>typeof c=="string")&&(o.components=n.components),typeof n.stack_profile=="string"&&(o.stack_profile=n.stack_profile),o}function gq(e){return["# GoDD MCP Server Configuration","# Generated by godd-init","","# \u6280\u8853\u30B9\u30BF\u30C3\u30AF\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8","components:",...e.map(r=>` - ${r}`),""].join(`
|
|
278
|
+
`)}function IC(e,t,r,n){let o=new Set(["GODD_LICENSE_KEY","GODD_LANGUAGE","GODD_REGISTRY_URL"]),i=[];if((0,ye.existsSync)(e)){let c=(0,ye.readFileSync)(e,"utf-8");for(let u of c.split(`
|
|
279
|
+
`)){let p=u.trim();if(yq.has(p))continue;let l=p.indexOf("="),d=l>0?p.slice(0,l).trim():"";o.has(d)||i.push(u)}for(;i.length>0&&i[i.length-1].trim()==="";)i.pop()}let s=["",AC,t!==null?`GODD_LICENSE_KEY="${t}"`:RC,`GODD_LANGUAGE="${r}"`,`GODD_REGISTRY_URL="${n}"`,""],a=[...i,...s].join(`
|
|
280
|
+
`);(0,ye.writeFileSync)(e,a,"utf-8")}function zC(){if(hq())return{command:"godd",args:[]};let e;try{e=(0,hC.fileURLToPath)(__goddBundleUrl)}catch{typeof __filename<"u"?e=__filename:(e=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: ${e}`))}let t=(0,fe.dirname)(e),r=e.includes("src")?(0,fe.resolve)(t,"..","..","dist","godd.js"):(0,fe.resolve)(t,"godd.js");return{command:process.execPath,args:[r]}}function Dy(e,t){let r={GODD_CONFIG:e,...t},{command:n,args:o}=zC();return{command:n,args:[...o,"server"],env:r}}function DC(e){let t=["mcp","serve"];return e&&t.push("--proxy-url",e),{type:"stdio",command:"headroom",args:t}}function OC(e=process.platform){let t="pipx/venv \u306E headroom \u304C Cursor \u304B\u3089\u898B\u3048\u306A\u3044\u5834\u5408\u306F .cursor/mcp.json \u306E command \u3092\u7D76\u5BFE\u30D1\u30B9\u306B\u5909\u66F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002";return e==="darwin"?"macOS + Homebrew Python \u3067\u306F PEP 668 \u306B\u3088\u308A bare pip install \u304C\u5931\u6557\u3059\u308B\u305F\u3081\u3001venv \u307E\u305F\u306F pipx \u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+t:"\u4E8B\u524D\u306B venv/pipx \u7B49\u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+t}function NC(e="core"){return{type:"stdio",command:"agent-browser",args:["mcp","--tools",e]}}function jC(e="https://mcp.typeui.sh",t){let r=t?.trim();return r?{url:e,headers:{Authorization:`Bearer ${r}`}}:{url:e}}async function LC(e,t,r={}){let n=r.fetchImpl??fetch,o=r.timeoutMs??MC,i=`${e.replace(/\/+$/,"")}/v1/google/access`,s;try{s=await n(i,{headers:{Authorization:`Bearer ${t}`},signal:AbortSignal.timeout(o)})}catch(u){let p=u instanceof Error?u.name:"";return{status:"unavailable",reason:p==="TimeoutError"||p==="AbortError"?"\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8":"\u901A\u4FE1\u30A8\u30E9\u30FC"}}if(s.status===401||s.status===403)return{status:"unauthorized",httpStatus:s.status};if(s.status===404)return{status:"unsupported"};if(!s.ok)return{status:"unavailable",reason:`HTTP ${s.status}`};let a;try{a=await s.json()}catch{return{status:"unavailable",reason:"\u5FDC\u7B54\u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093"}}let c=a&&typeof a=="object"?a.projects:void 0;return Array.isArray(c)?c.length===0?{status:"none"}:{status:"granted",projectCount:c.length}:{status:"unavailable",reason:"\u5FDC\u7B54\u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093"}}function ZC(e,t){return{url:e,headers:{Authorization:`Bearer ${t}`}}}function _q(e,t){let{command:r,args:n}=zC(),o={GODD_REGISTRY_URL:e};return t!==pp&&(o.GODD_GOOGLE_MCP_URL=t),{command:r,args:[...n,"google-relay"],env:o}}function UC(e){if(!e||typeof e!="object")return!1;let{url:t,headers:r,args:n,env:o}=e;return t!==void 0||r!==void 0||!Array.isArray(n)||n[n.length-1]!=="google-relay"?!1:!(o&&typeof o=="object"&&"GODD_LICENSE_KEY"in o)}function dC(e,t,r,n,o=!1){let i=vq(e,t,r);return o?i.action==="add"&&e.enabled?{action:"add",entry:_q(n,e.url),projectCount:i.projectCount,relay:!0}:i.action==="keep"&&i.reason!=="disabled"?{action:"remove",reason:"device-token",cause:i.reason,detail:i.detail}:i:i}function vq(e,t,r){if(!e.enabled)return{action:"keep",reason:e.reason};if(!t)return{action:"keep",reason:"unavailable"};switch(t.status){case"granted":return{action:"add",entry:ZC(e.url,r),projectCount:t.projectCount};case"none":return{action:"remove",reason:"no-projects"};case"unauthorized":return{action:"remove",reason:"unauthorized"};case"unsupported":return{action:"keep",reason:"unsupported"};case"unavailable":return{action:"keep",reason:"unavailable",detail:t.reason}}}async function qC(e,t,r={}){let n=xy(r.env);if(!n.enabled)return dC(n,null,t,e,r.deviceToken);let o=await LC(e,t,{fetchImpl:r.fetchImpl,timeoutMs:r.timeoutMs});return dC(n,o,t,e,r.deviceToken)}function FC(e,t,r){switch(e.action){case"add":return t.written?e.relay?`\u2713 ${Ot}\uFF08Google \u9023\u643A MCP\uFF09\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F\uFF08\u5272\u5F53\u6848\u4EF6 ${e.projectCount} \u4EF6\u3001godd google-relay \u7D4C\u7531\u3002\u30ED\u30B0\u30A4\u30F3\u306E\u30C8\u30FC\u30AF\u30F3\u306F MCP \u8A2D\u5B9A\u306B\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\uFF09`:`\u2713 ${Ot}\uFF08Google \u9023\u643A MCP\uFF09\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F\uFF08\u5272\u5F53\u6848\u4EF6 ${e.projectCount} \u4EF6\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC ${CC(r)}\uFF09`:null;case"remove":if(e.reason==="device-token"){if(e.cause==="unsupported")return t.removed&&!t.kept?`\u2713 Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u305F\u3081\u3001\u65E2\u5B58\u306E ${Ot}\uFF08Google \u9023\u643A MCP\uFF09\u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F\uFF08\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u5E73\u6587\u3067\u66F8\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u305F\u3081\uFF09`:null;let n=e.cause==="invalid-url"?"GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u306A\u3044\u305F\u3081":`Google \u9023\u643A\u306E\u5272\u5F53\u3092\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\uFF08${e.detail??"\u901A\u4FE1\u30A8\u30E9\u30FC"}\uFF09`;return t.kept&&!t.removed?`\u26A0 ${n}\u3001${Ot} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u65E2\u5B58\u306E godd google-relay \u7D4C\u7531\u306E\u8A2D\u5B9A\u306F\u305D\u306E\u307E\u307E\u6B8B\u3057\u307E\u3057\u305F\uFF09`:`\u26A0 ${n}\u3001${Ot} \u3092\u8A2D\u5B9A\u3057\u307E\u305B\u3093\u3067\u3057\u305F`+(t.removed?"\u3002Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u305F\u3081\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u5E73\u6587\u3067\u66F8\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u65E2\u5B58\u306E\u8A2D\u5B9A\u306F\u524A\u9664\u3057\u307E\u3057\u305F":"")+"\u3002\u63A5\u7D9A\u3067\u304D\u308B\u72B6\u614B\u3067 godd init \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044"}return t.removed?e.reason==="no-projects"?`\u2713 Google \u9023\u643A\u306E\u5272\u5F53\u6848\u4EF6\u304C\u7121\u3044\u305F\u3081\u3001${Ot} \u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F`:`\u2713 \u30E9\u30A4\u30BB\u30F3\u30B9\u3067 Google \u9023\u643A\u3092\u5229\u7528\u3067\u304D\u306A\u3044\u305F\u3081\uFF08\u7121\u52B9\u307E\u305F\u306F\u671F\u9650\u5207\u308C\uFF09\u3001${Ot} \u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F`:null;case"keep":return e.reason==="disabled"?` GODD_GOOGLE_MCP \u306E\u6307\u5B9A\u306B\u3088\u308A ${Ot} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`:e.reason==="invalid-url"?`\u26A0 GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u306A\u3044\u305F\u3081\u3001${Ot} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`:e.reason==="unsupported"?null:`\u26A0 Google \u9023\u643A\u306E\u5272\u5F53\u3092\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\uFF08${e.detail??"\u901A\u4FE1\u30A8\u30E9\u30FC"}\uFF09\u3001${Ot} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`}}function GC(e,t,r=[]){let n=e?{...e}:{},i={...typeof n.mcpServers=="object"&&n.mcpServers!==null?n.mcpServers:{},...t};for(let s of r)s in t||delete i[s];return n.mcpServers=i,n}function VC(e){let t={};for(let[r,n]of Object.entries(e))t[r]="url"in n&&!("type"in n)?{type:"http",...n}:n;return t}function BC(e,t,r=(0,mC.homedir)()){return[{label:".cursor/mcp.json\uFF08Cursor \u7528\uFF09",path:(0,fe.resolve)((0,fe.join)(e,".cursor","mcp.json")),userGlobalPath:(0,fe.resolve)((0,fe.join)(r,".cursor","mcp.json")),servers:t},{label:".mcp.json\uFF08Claude Code \u7528\uFF09",path:(0,fe.resolve)((0,fe.join)(e,".mcp.json")),userGlobalPath:(0,fe.resolve)((0,fe.join)(r,".mcp.json")),servers:VC(t)}]}function HC(e,t,r=[],n){let o=null,i;if((0,ye.existsSync)(e)){let l=(0,ye.readFileSync)(e,"utf-8");try{o=JSON.parse(l)}catch{i=`${e}.bak`,(0,ye.writeFileSync)(i,l,"utf-8")}}else{let l=(0,fe.dirname)(e);(0,ye.existsSync)(l)||(0,ye.mkdirSync)(l,{recursive:!0})}let s=o&&typeof o.mcpServers=="object"&&o.mcpServers!==null?o.mcpServers:{},a=r.filter(l=>l in s&&!(l in t)),c=n?a.filter(l=>n(s[l])):[],u=a.filter(l=>!c.includes(l)),p=GC(o,t,u);return(0,ye.writeFileSync)(e,JSON.stringify(p,null,2),"utf-8"),{backupPath:i,removed:u,kept:c}}function WC(e,t,r){let n=e.trim();return wq.has(n.toLowerCase())?{mode:"google"}:n?{mode:"license_key",licenseKey:n}:t?{mode:"license_key",licenseKey:t}:r?{mode:"google"}:{mode:"missing"}}function KC(e,t){return e?`\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08Enter \u3067\u65E2\u5B58\u3092\u4FDD\u6301 [${CC(e)}]\u3002Google \u3067\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5834\u5408\u306F google\uFF09: `:t?`\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08Enter \u3067\u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3 [${t.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"} / ${t.registry_url}] \u3092\u4F7F\u7528\uFF09: `:"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5834\u5408\u306F google\uFF09: "}function JC(e,t=wr()){try{return Ro(e,t)?.credentials??un(t)[0]??null}catch{return null}}async function YC(e,t={}){let r=t.log??(c=>console.log(c)),n=t.credentialsPath?[t.credentialsPath]:wr(),o=null,i=[];try{o=Ro(e,n)?.credentials??null,i=un(n).filter(c=>rt(c.registry_url)!==rt(e))}catch{}if(o)return r(`\u2713 \u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3\u3092\u4F7F\u3044\u307E\u3059: ${o.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}`),lu(o,t.now)&&r(` \u26A0 \u624B\u5143\u306E\u8A18\u9332\u3067\u306F\u6709\u52B9\u671F\u9650\uFF08${o.expires_at}\uFF09\u3092\u904E\u304E\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u304C\u5EF6\u9577\u3057\u3066\u3044\u308C\u3070\u305D\u306E\u307E\u307E\u4F7F\u3048\u307E\u3059\u3002\u62D2\u5426\u3055\u308C\u305F\u5834\u5408\u306F godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),o;if(i.length>0){let c=i.map(u=>u.registry_url).join(", ");r(`
|
|
286
281
|
\u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3\u306F\u5225\u306E Registry\uFF08${c}\uFF09\u5411\u3051\u3067\u3059\u3002${rt(e)} \u306B\u65B0\u3057\u304F\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3059\uFF08${c} \u306E\u30ED\u30B0\u30A4\u30F3\u306F\u305D\u306E\u307E\u307E\u6B8B\u308A\u307E\u3059\uFF09\u3002`)}r(`
|
|
287
|
-
Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3059\u3002`);let a=await(t.login??(c=>
|
|
288
|
-
\u30A8\u30E9\u30FC: Google \u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002${oe instanceof Error?oe.message:String(oe)}`),process.exit(1)}g=
|
|
282
|
+
Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3059\u3002`);let a=await(t.login??(c=>fp({drive:!1,noBrowser:!1,registryUrl:c},{credentialsPath:t.credentialsPath,log:r}).then(u=>u.credentials)))(e);return r(`\u2713 \u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F: ${a.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}`),a}function QC(e,t,r){return{...e!==null?{GODD_LICENSE_KEY:e}:{},GODD_LANGUAGE:t,GODD_REGISTRY_URL:r}}async function XC(){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=process.cwd(),t=(0,fe.join)(e,"config.godd"),r=TC(t);r&&(console.log("\u65E2\u5B58\u306E config.godd \u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u5909\u66F4\u3059\u308B\u9805\u76EE\u306E\u307F\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08Enter \u3067\u30B9\u30AD\u30C3\u30D7\uFF09\u3002"),r.components?.length&&console.log(` \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8: ${r.components.join(", ")} (${r.components.length} \u4EF6)`),r.language&&console.log(` \u8A00\u8A9E: ${r.language}`),console.log(""));let n=JC(r?.registry_url??ln),o=await Ir(KC(r?.license_key,n)),i=WC(o,r?.license_key,n!==null);i.mode==="missing"&&(console.error("\u30A8\u30E9\u30FC: \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306F\u5FC5\u9808\u3067\u3059\u3002Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u4F7F\u3046\u5834\u5408\u306F google \u3068\u5165\u529B\u3059\u308B\u304B\u3001\u5148\u306B godd login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let s=i.mode==="google",a=r?.language??"ja",u=await Ir(`\u4F7F\u7528\u8A00\u8A9E\u3092\u9078\u629E [ja/en/zh/ru/kz/tr] (default: ${a}): `)||a,p=!!r?.registry_url,l=r?.registry_url??ln,d=await Ir(vC(l,p)),f;try{f=wC(d,l)}catch(oe){console.error(`\u30A8\u30E9\u30FC: ${oe instanceof Error?oe.message:String(oe)}`),process.exit(1)}let h=f.url;f.usedDefault&&console.log(bC(h,p));let g,y=null;if(i.mode==="google"){try{y=await YC(h)}catch(oe){console.error(`
|
|
283
|
+
\u30A8\u30E9\u30FC: Google \u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002${oe instanceof Error?oe.message:String(oe)}`),process.exit(1)}g=y.access_token}else g=i.licenseKey;let v=ya();v||(console.error(`
|
|
289
284
|
\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(`
|
|
290
|
-
\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u767B\u9332\u4E2D: ${v}`);try{let oe=await fetch(`${
|
|
291
|
-
\u30A8\u30E9\u30FC: \u30EA\u30DD\u30B8\u30C8\u30EA\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002`),console.error(` ${Pe.detail??oe.statusText}`);let
|
|
292
|
-
\u30A8\u30E9\u30FC: Registry API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002`),console.error(` ${
|
|
293
|
-
\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u4E2D...`);let w=await
|
|
294
|
-
\u3010${
|
|
295
|
-
\u2713 \u65E2\u5B58\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u8A2D\u5B9A\u3092\u5F15\u304D\u7D99\u304E\u307E\u3057\u305F\uFF08${k.size} \u4EF6\uFF09`)}if(!
|
|
285
|
+
\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u767B\u9332\u4E2D: ${v}`);try{let oe=await fetch(`${h}/v1/repos/register`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${g}`},body:JSON.stringify({remote_url:v}),signal:AbortSignal.timeout(1e4)});if(!oe.ok){let Pe=await oe.json().catch(()=>({detail:oe.statusText}));console.error(`
|
|
286
|
+
\u30A8\u30E9\u30FC: \u30EA\u30DD\u30B8\u30C8\u30EA\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002`),console.error(` ${Pe.detail??oe.statusText}`);let xt=tt(oe.status,String(Pe.detail??""));xt?console.error(` ${xt}`):oe.status===401?console.error(s?" \u30ED\u30B0\u30A4\u30F3\u304C\u7121\u52B9\u3067\u3059\u3002godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002":" \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002"):oe.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(`
|
|
287
|
+
\u30A8\u30E9\u30FC: Registry API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002`),console.error(` ${h} \u304C\u8D77\u52D5\u3057\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),process.exit(1)}console.log(`
|
|
288
|
+
\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u4E2D...`);let w=await mq(h,g)??Iy;console.log(w===Iy?" 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":` ${w.length} \u4EF6\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u3057\u307E\u3057\u305F\u3002`);let x=PC(w),k=new Set,P=new Set;function q(oe){return x.find(Pe=>Pe.category===oe)}async function Z(oe,Pe){let xt=zy[oe.category]??oe.category,kt=Pe?oe.components.filter($t=>fq($t.name,P)):oe.components;if(kt.length===0){console.log(` \u3010${xt}\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(`
|
|
289
|
+
\u3010${xt}\u3011`),kt.forEach(($t,hr)=>{console.log(` ${String(hr+1).padStart(2)}. ${$t.label.padEnd(25)} ${$t.description}`)});let St=await Ir(" \u9078\u629E (\u4F8B: 1,3): ");if(St.toLowerCase()==="all")for(let $t of kt)k.add($t.name);else if(St){let $t=St.split(",").map(hr=>parseInt(hr.trim(),10));for(let hr of $t)hr>=1&&hr<=kt.length&&k.add(kt[hr-1].name)}}let qe=!1;if(r?.components&&r.components.length>0&&(await Ir("\u65E2\u5B58\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u8A2D\u5B9A\u3092\u5F15\u304D\u7D99\u304E\u307E\u3059\u304B\uFF1F [Y/n]: ")).toLowerCase()!=="n"){for(let Pe of r.components)k.add(Pe);qe=!0,console.log(`
|
|
290
|
+
\u2713 \u65E2\u5B58\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u8A2D\u5B9A\u3092\u5F15\u304D\u7D99\u304E\u307E\u3057\u305F\uFF08${k.size} \u4EF6\uFF09`)}if(!qe){let oe=[{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 / ${EC("runtime")}\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"]}],Pe=oe.length;console.log(`
|
|
296
291
|
\u2501\u2501\u2501 \u6280\u8853\u30B9\u30BF\u30C3\u30AF\u9078\u629E\uFF08${Pe} \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
|
|
297
|
-
`);for(let
|
|
298
|
-
\u2554\u2500 Step ${
|
|
292
|
+
`);for(let kt of oe){console.log(`
|
|
293
|
+
\u2554\u2500 Step ${kt.step}/${Pe}: ${kt.title}`);for(let St of kt.categories){let $t=q(St);$t&&await Z($t,kt.step!==1)}if(kt.step===1){let St=q("language");if(St)for(let $t of St.components)k.has($t.name)&&P.add($t.name);P.size===0&&(console.error(`
|
|
299
294
|
\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(`
|
|
300
|
-
\u2192 \u9078\u629E\u8A00\u8A9E: ${[...P].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 ${
|
|
301
|
-
\u2714 \u8A2D\u8A08\u30D1\u30BF\u30FC\u30F3\u3092\u81EA\u52D5\u8A2D\u5B9A\u3057\u307E\u3057\u305F: ${
|
|
295
|
+
\u2192 \u9078\u629E\u8A00\u8A9E: ${[...P].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 ${kt.step} \u5B8C\u4E86`)}let xt=q("architecture");if(xt){for(let St of xt.components)k.add(St.name);let kt=xt.components.map(St=>St.label).join(", ");console.log(`
|
|
296
|
+
\u2714 \u8A2D\u8A08\u30D1\u30BF\u30FC\u30F3\u3092\u81EA\u52D5\u8A2D\u5B9A\u3057\u307E\u3057\u305F: ${kt}`)}k.size===0&&(console.error(`
|
|
302
297
|
\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(`
|
|
303
|
-
\u2501\u2501\u2501 \u9078\u629E\u3055\u308C\u305F\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8 (${k.size} \u4EF6) \u2501\u2501\u2501`);for(let oe of k){let Pe=w.find(
|
|
304
|
-
config.godd \u306E\u4FDD\u5B58\u5148 (default: ${t}): `)||t,
|
|
305
|
-
\u2713 config.godd \u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${ie}`);let
|
|
298
|
+
\u2501\u2501\u2501 \u9078\u629E\u3055\u308C\u305F\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8 (${k.size} \u4EF6) \u2501\u2501\u2501`);for(let oe of k){let Pe=w.find(xt=>xt.name===oe);console.log(` \u2713 ${Pe?.label??oe}`)}let ie=await Ir(`
|
|
299
|
+
config.godd \u306E\u4FDD\u5B58\u5148 (default: ${t}): `)||t,Fe=gq([...k]);(0,ye.writeFileSync)(ie,Fe,"utf-8"),console.log(`
|
|
300
|
+
\u2713 config.godd \u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${ie}`);let Ge=(0,fe.join)((0,fe.dirname)(ie),".env");IC(Ge,s?null:g,u,h),console.log(`\u2713 .env \u3092\u66F4\u65B0\u3057\u307E\u3057\u305F: ${Ge}`),xC(e)?console.log("\u2713 GoDD \u306E\u79D8\u5BC6\u8A2D\u5B9A\u3092 .gitignore \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F"):console.log("\u2713 GoDD \u306E\u79D8\u5BC6\u8A2D\u5B9A\u306F .gitignore \u306B\u8FFD\u52A0\u6E08\u307F\u3067\u3059");let $n=!1;if((await Ir(".cursor/mcp.json / .mcp.json / .codex/config.toml\uFF08\u5BFE\u5FDC\u5A92\u4F53\u306E MCP \u8A2D\u5B9A\uFF09\u3092\u751F\u6210\u3057\u307E\u3059\u304B\uFF1F [Y/n]: ")).toLowerCase()!=="n"){let oe=QC(s?null:g,u,h),xt=(await Ir("Headroom\uFF08\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u5727\u7E2E MCP\uFF09\u3082\u767B\u9332\u3057\u307E\u3059\u304B\uFF1F \u4E8B\u524D\u306B venv/pipx \u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044 [y/N]: ")).toLowerCase()==="y";xt&&console.log(` \u6CE8\u610F: ${OC()}`);let St=(await Ir("agent-browser\uFF08\u30D6\u30E9\u30A6\u30B6\u64CD\u4F5C MCP\uFF09\u3082\u767B\u9332\u3057\u307E\u3059\u304B\uFF1F \u30D6\u30E9\u30A6\u30B6\u81EA\u52D5\u64CD\u4F5C\u306B\u52A0\u3048 JavaScript \u5B9F\u884C\uFF08eval, \u8A8D\u8A3C\u6E08\u307F\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u4F5C\u7528\uFF09\u3092\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3078\u8A31\u53EF\u3057\u307E\u3059\u3002\u4E8B\u524D\u306B `npm install -g agent-browser && agent-browser install` \u304C\u5FC5\u8981\u3067\u3059 [y/N]: ")).toLowerCase()==="y",hr=(await Ir("TypeUI\uFF08\u30C7\u30B6\u30A4\u30F3\u30B9\u30AD\u30EB / UI \u30D7\u30ED\u30F3\u30D7\u30C8 MCP\uFF09\u3082\u767B\u9332\u3057\u307E\u3059\u304B\uFF1F UI \u751F\u6210\u54C1\u8CEA\uFF08\u8131\u30FBAI \u611F\uFF09\u3092\u9AD8\u3081\u308B\u30C7\u30B6\u30A4\u30F3\u30AC\u30A4\u30C0\u30F3\u30B9\u3092\u6CE8\u5165\u3057\u307E\u3059\u3002\u30DB\u30B9\u30C8\u578B\u30B5\u30FC\u30D0\u30FC\uFF08https://mcp.typeui.sh\uFF09\u3067\u3001\u521D\u56DE\u5229\u7528\u6642\u306B TypeUI \u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u304C\u5FC5\u8981\u3067\u3059 [y/N]: ")).toLowerCase()==="y",Ep="";hr&&(Ep=await Ir(" TypeUI \u3092\u72EC\u81EA\u30DB\u30B9\u30C8/\u30C8\u30FC\u30AF\u30F3\u8A8D\u8A3C\u3067\u4F7F\u3046\u5834\u5408\u306F Bearer \u30C8\u30FC\u30AF\u30F3\u3092\u5165\u529B \uFF08\u901A\u5E38\u306F\u7A7A Enter \u3067 OAuth \u5BFE\u8A71\u30B5\u30A4\u30F3\u30A4\u30F3\uFF09: "));let ss={godd:Dy((0,fe.resolve)(ie),oe)};xt&&(ss.headroom=DC()),St&&(ss["agent-browser"]=NC()),hr&&(ss.typeui=jC(void 0,Ep));let io=await qC(h,g,{deviceToken:s});io.action==="add"&&(ss[Ot]=io.entry);let zA=io.action==="remove"?[Ot]:[],DA=io.action==="remove"&&io.reason==="device-token"?UC:void 0,Cp=!1,r_=!1,n_=!1,OA=BC(e,ss),o_=0;for(let Qt of OA){if(Qt.path===Qt.userGlobalPath){console.log(`
|
|
306
301
|
\u26A0 \u30E6\u30FC\u30B6\u30FC\u30B0\u30ED\u30FC\u30D0\u30EB\u306E MCP \u8A2D\u5B9A\u3092\u4E0A\u66F8\u304D\u3057\u306A\u3044\u305F\u3081\u3001${Qt.label} \u306B\u306F\u66F8\u304D\u8FBC\u307F\u307E\u305B\u3093\u3002`),console.log(` \u4EE5\u4E0B\u306E\u30D6\u30ED\u30C3\u30AF\u3092\u624B\u52D5\u3067 ${Qt.userGlobalPath} \u306E mcpServers \u306B\u8FFD\u8A18\u3057\u3066\u304F\u3060\u3055\u3044:
|
|
307
|
-
`),console.log(JSON.stringify(Qt.servers,null,2)),console.log("");continue}let{backupPath:
|
|
308
|
-
\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. Claude Code: \u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067 `claude` \u3092\u8D77\u52D5\u3057\u3001"),console.log(" \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30B9\u30B3\u30FC\u30D7 MCP\uFF08.mcp.json\uFF09\u306E\u627F\u8A8D\u30C0\u30A4\u30A2\u30ED\u30B0\u3067 godd \u3092\u627F\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" \uFF08\u521D\u56DE\u306F\u627F\u8A8D\u3059\u308B\u307E\u3067\u6709\u52B9\u5316\u3055\u308C\u307E\u305B\u3093\u3002`claude mcp list` \u3067\u72B6\u614B\u3092\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF09"),console.log(" 3. Codex: `/mcp` \u3067 godd \u304C\u63A5\u7D9A\u6E08\u307F\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" 4. \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-dev: Cursor / Claude Code \u5171\u901A\u306E\u76F4\u63A5\u30B3\u30DE\u30F3\u30C9"),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"),Pn&&(console.log(` 5. Google \u9023\u643A: IDE / Claude Code \u3092\u518D\u8D77\u52D5\u3057\u3001/mcp \u3067 ${Ot} \u304C connected \u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`),console.log(` \uFF08Claude Code \u306F godd \u3068\u540C\u3058\u304F\u521D\u56DE\u306B ${Ot} \u306E\u627F\u8A8D\u304C\u5FC5\u8981\u3067\u3059\uFF09`)),_&&(console.log(""),console.log(`\u30ED\u30B0\u30A4\u30F3: Google\uFF08${_.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}\uFF09\u3002\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306F .env / MCP \u8A2D\u5B9A\u306B\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\u3002`),console.log(` \u30ED\u30B0\u30A4\u30F3\u60C5\u5831: ${Nn()}`),console.log(" \u30ED\u30B0\u30A4\u30F3\u304C\u5207\u308C\u305F\u3089 godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002Drive \u3092\u672C\u4EBA\u306E\u6A29\u9650\u3067\u8AAD\u3080\u5834\u5408\u306F godd login --drive \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002")),console.log(""),console.log("\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u63A8\u5968\u8A2D\u5B9A:"),console.log(" \u79D8\u5BC6\u60C5\u5831\u6F0F\u6D29\u9632\u6B62\u306E\u305F\u3081\u3001\u500B\u4EBA\u306E ~/.gitignore_global \u306B\u4EE5\u4E0B\u3092\u8A2D\u5B9A\u3059\u308B\u3053\u3068\u3092\u63A8\u5968\u3057\u307E\u3059:"),console.log(" git config --global core.excludesFile ~/.gitignore_global"),console.log(" echo '.cursor/mcp.json' >> ~/.gitignore_global"),console.log(" echo '.cursor/mcp.json.bak' >> ~/.gitignore_global"),console.log(" echo '.mcp.json' >> ~/.gitignore_global"),console.log(" echo '.mcp.json.bak' >> ~/.gitignore_global"),console.log(""),SC.close()}function Rq(){try{return __goddBundleUrl}catch{return}}var vC,_e,he,wC,bC,A_,gq,xC,_q,kC,yq,vq,SC,_C,I_,wq,bq,NC,jC,Pq,Ot,GC,Tq,aT=b(()=>{"use strict";vC=mt(require("node:readline"),1),_e=require("node:fs"),he=require("node:path"),wC=require("node:url"),bC=require("node:os");js();kf();ng();y_();v_();jn();x_();Pi();pp();Tr();Ua();A_=[{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:"emotion",category:"frontend",label:"Emotion",description:"CSS-in-JS \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"styled-components",category:"frontend",label:"styled-components",description:"CSS-in-JS \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"mui",category:"frontend",label:"MUI",description:"React UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"chakra-ui",category:"frontend",label:"Chakra UI",description:"React UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA"},{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:"config.godd \u767B\u9332\u7528\u306E JavaScript \u5B9F\u884C\u74B0\u5883\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"},{id:"",name:"agent-stdio",category:"runtime",label:"Agent Stdio",description:"config.godd \u767B\u9332\u7528\u306E MCP Agent stdio \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"},{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"}],gq=[".cursor/mcp.json",".cursor/mcp.json.bak",".mcp.json",".mcp.json.bak",".codex/config.toml",".codex/config.toml.bak",".env",".cursor/commands/godd-dev.md",".claude/commands/godd-dev.md",".agents/skills/godd-dev/SKILL.md"],xC="<!-- GoDD managed command: godd-dev -->",_q=`${xC}
|
|
302
|
+
`),console.log(JSON.stringify(Qt.servers,null,2)),console.log("");continue}let{backupPath:c_,removed:NA,kept:jA}=HC(Qt.path,Qt.servers,zA,DA);io.action==="add"&&(Cp=!0),NA.length>0&&(r_=!0),jA.length>0&&(n_=!0),c_&&(console.warn(`\u26A0 \u65E2\u5B58\u306E ${Qt.path} \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u3092\u9000\u907F\u3057\u3001\u9078\u629E\u3057\u305F MCP \u30A8\u30F3\u30C8\u30EA\u306E\u307F\u3067\u518D\u751F\u6210\u3057\u307E\u3059\u3002`),console.warn(` \u9000\u907F\u5148: ${c_}\uFF08\u5FC5\u8981\u306A\u30A8\u30F3\u30C8\u30EA\u306F\u624B\u52D5\u3067\u30DE\u30FC\u30B8\u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`)),console.log(`\u2713 ${Qt.label} \u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${Qt.path}`),o_+=1}let i_=$C(e,(0,fe.resolve)(ie),oe);console.log(i_?`\u2713 Codex MCP \u8A2D\u5B9A\u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${i_}`:"\u2713 \u65E2\u5B58\u306E Codex config.toml \u306F\u4E0A\u66F8\u304D\u3057\u307E\u305B\u3093\u3067\u3057\u305F");let s_=kC(e);if(s_.length>0)for(let Qt of s_)console.log(`\u2713 /godd-dev \u30B3\u30DE\u30F3\u30C9\u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${Qt}`);else console.log("\u2713 /godd-dev \u30B3\u30DE\u30F3\u30C9\u306F\u65E2\u5B58\u306E\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u3092\u4FDD\u6301\u3057\u307E\u3057\u305F");let a_=SC(e);console.log(a_?`\u2713 Codex \u30B9\u30AD\u30EB\u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${a_}`:"\u2713 \u65E2\u5B58\u306E Codex godd-dev \u30B9\u30AD\u30EB\u306F\u4E0A\u66F8\u304D\u3057\u307E\u305B\u3093\u3067\u3057\u305F"),o_>0&&(xt&&console.log("\u2713 Headroom MCP \u3092\u767B\u9332\u3057\u307E\u3057\u305F\uFF08proxy \u9023\u643A\u306F\u4EFB\u610F\uFF09"),St&&console.log("\u2713 agent-browser MCP \u3092\u767B\u9332\u3057\u307E\u3057\u305F\uFF08\u8981 `npm install -g agent-browser && agent-browser install`\uFF09"),hr&&console.log(Ep?"\u2713 TypeUI MCP \u3092\u767B\u9332\u3057\u307E\u3057\u305F\uFF08\u30DB\u30B9\u30C8\u578B\u30FBAuthorization: Bearer \u30D8\u30C3\u30C0\u3067\u8A8D\u8A3C\uFF09":"\u2713 TypeUI MCP \u3092\u767B\u9332\u3057\u307E\u3057\u305F\uFF08\u30DB\u30B9\u30C8\u578B\u30FB\u521D\u56DE\u5229\u7528\u6642\u306B OAuth \u3067 TypeUI \u30A2\u30AB\u30A6\u30F3\u30C8\u3078\u30B5\u30A4\u30F3\u30A4\u30F3\uFF09"));let ic=FC(io,{written:Cp,removed:r_,kept:n_},g);ic&&(ic.startsWith("\u26A0")?console.warn(ic):console.log(ic)),$n=Cp}console.log(`
|
|
303
|
+
\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. Claude Code: \u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067 `claude` \u3092\u8D77\u52D5\u3057\u3001"),console.log(" \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30B9\u30B3\u30FC\u30D7 MCP\uFF08.mcp.json\uFF09\u306E\u627F\u8A8D\u30C0\u30A4\u30A2\u30ED\u30B0\u3067 godd \u3092\u627F\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" \uFF08\u521D\u56DE\u306F\u627F\u8A8D\u3059\u308B\u307E\u3067\u6709\u52B9\u5316\u3055\u308C\u307E\u305B\u3093\u3002`claude mcp list` \u3067\u72B6\u614B\u3092\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF09"),console.log(" 3. Codex: `/mcp` \u3067 godd \u304C\u63A5\u7D9A\u6E08\u307F\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" 4. \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-dev: Cursor / Claude Code \u5171\u901A\u306E\u76F4\u63A5\u30B3\u30DE\u30F3\u30C9"),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"),$n&&(console.log(` 5. Google \u9023\u643A: IDE / Claude Code \u3092\u518D\u8D77\u52D5\u3057\u3001/mcp \u3067 ${Ot} \u304C connected \u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`),console.log(` \uFF08Claude Code \u306F godd \u3068\u540C\u3058\u304F\u521D\u56DE\u306B ${Ot} \u306E\u627F\u8A8D\u304C\u5FC5\u8981\u3067\u3059\uFF09`)),y&&(console.log(""),console.log(`\u30ED\u30B0\u30A4\u30F3: Google\uFF08${y.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}\uFF09\u3002\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306F .env / MCP \u8A2D\u5B9A\u306B\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\u3002`),console.log(` \u30ED\u30B0\u30A4\u30F3\u60C5\u5831: ${On()}`),console.log(" \u30ED\u30B0\u30A4\u30F3\u304C\u5207\u308C\u305F\u3089 godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002Drive \u3092\u672C\u4EBA\u306E\u6A29\u9650\u3067\u8AAD\u3080\u5834\u5408\u306F godd login --drive \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002")),console.log(""),console.log("\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u63A8\u5968\u8A2D\u5B9A:"),console.log(" \u79D8\u5BC6\u60C5\u5831\u6F0F\u6D29\u9632\u6B62\u306E\u305F\u3081\u3001\u500B\u4EBA\u306E ~/.gitignore_global \u306B\u4EE5\u4E0B\u3092\u8A2D\u5B9A\u3059\u308B\u3053\u3068\u3092\u63A8\u5968\u3057\u307E\u3059:"),console.log(" git config --global core.excludesFile ~/.gitignore_global"),console.log(" echo '.cursor/mcp.json' >> ~/.gitignore_global"),console.log(" echo '.cursor/mcp.json.bak' >> ~/.gitignore_global"),console.log(" echo '.mcp.json' >> ~/.gitignore_global"),console.log(" echo '.mcp.json.bak' >> ~/.gitignore_global"),console.log(""),_C.close()}function bq(){try{return __goddBundleUrl}catch{return}}var fC,ye,fe,hC,mC,Iy,aq,gC,cq,yC,uq,lq,_C,pC,zy,pq,dq,AC,RC,yq,Ot,MC,wq,tT=b(()=>{"use strict";fC=ht(require("node:readline"),1),ye=require("node:fs"),fe=require("node:path"),hC=require("node:url"),mC=require("node:os");Ns();Sf();og();vy();wy();Nn();ky();$i();dp();Br();Za();Iy=[{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:"emotion",category:"frontend",label:"Emotion",description:"CSS-in-JS \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"styled-components",category:"frontend",label:"styled-components",description:"CSS-in-JS \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"mui",category:"frontend",label:"MUI",description:"React UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"chakra-ui",category:"frontend",label:"Chakra UI",description:"React UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA"},{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:"config.godd \u767B\u9332\u7528\u306E JavaScript \u5B9F\u884C\u74B0\u5883\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"},{id:"",name:"agent-stdio",category:"runtime",label:"Agent Stdio",description:"config.godd \u767B\u9332\u7528\u306E MCP Agent stdio \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"},{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"}],aq=[".cursor/mcp.json",".cursor/mcp.json.bak",".mcp.json",".mcp.json.bak",".codex/config.toml",".codex/config.toml.bak",".env",".cursor/commands/godd-dev.md",".claude/commands/godd-dev.md",".agents/skills/godd-dev/SKILL.md"],gC="<!-- GoDD managed command: godd-dev -->",cq=`${gC}
|
|
309
304
|
# GoDD \u958B\u767A
|
|
310
305
|
|
|
311
306
|
\u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u6B63\u5F0F\u306A\u958B\u767A\u5165\u53E3\u3067\u3059\u3002
|
|
@@ -313,36 +308,36 @@ config.godd \u306E\u4FDD\u5B58\u5148 (default: ${t}): `)||t,Ge=$q([...k]);(0,_e.
|
|
|
313
308
|
\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u306E\u5F8C\u306B\u5165\u529B\u3055\u308C\u305F\u30E6\u30FC\u30B6\u30FC\u306E\u4F9D\u983C\u3092 \`task\` \u3068\u3057\u3066\u3001GoDD MCP Server \u306E \`godd-dev\` \u30C4\u30FC\u30EB\uFF08\u30E1\u30F3\u30B7\u30E7\u30F3\u8868\u8A18: \`@godd-dev\`\uFF09\u3078\u76F4\u3061\u306B\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002MCP \u30C4\u30FC\u30EB\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u304C\u8FD4\u308B\u524D\u306B\u3001\u81EA\u5206\u3067\u5B9F\u88C5\u30FB\u7DE8\u96C6\u30FB\u30D6\u30E9\u30F3\u30C1\u4F5C\u6210\u3092\u59CB\u3081\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
|
|
314
309
|
|
|
315
310
|
Issue \u756A\u53F7\u3001\u5B8C\u4E86\u6761\u4EF6\u3001\u5236\u7D04\u3001\u56DE\u7B54\u306A\u3069\u3001\u30B3\u30DE\u30F3\u30C9\u306E\u5F8C\u306B\u5165\u529B\u3055\u308C\u305F\u5185\u5BB9\u306F\u7701\u7565\u305B\u305A\u305D\u306E\u307E\u307E \`task\` \u306B\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\`godd-dev\` \u306E\u8FD4\u3057\u305F\u958B\u767A\u30D5\u30ED\u30FC\uFF08\u4ED5\u69D8\u78BA\u8A8D\u3001ATDD\u3001\u5B9F\u88C5\u3001\u54C1\u8CEA\u30B2\u30FC\u30C8\u3001\u8CAC\u52D9\u5225\u30B3\u30DF\u30C3\u30C8\uFF09\u306B\u5F93\u3063\u3066\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
316
|
-
`,
|
|
311
|
+
`,yC="<!-- GoDD managed skill: godd-dev -->",uq=`---
|
|
317
312
|
name: godd-dev
|
|
318
313
|
description: Run the GoDD development workflow for an Issue or implementation request. Use when the user asks to implement an Issue, start development with GoDD, or invokes /godd-dev or $godd-dev.
|
|
319
314
|
---
|
|
320
315
|
|
|
321
|
-
${
|
|
316
|
+
${yC}
|
|
322
317
|
# GoDD \u958B\u767A
|
|
323
318
|
|
|
324
319
|
Codex \u306E\u6B63\u5F0F\u306A GoDD \u958B\u767A\u5165\u53E3\u3067\u3059\u3002\u30E6\u30FC\u30B6\u30FC\u306E\u4F9D\u983C\u3092 \`task\` \u3068\u3057\u3066\u3001GoDD MCP Server \u306E \`godd-dev\` \u30C4\u30FC\u30EB\u3092\u6700\u521D\u306B\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002MCP \u30C4\u30FC\u30EB\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u304C\u8FD4\u308B\u524D\u306B\u3001\u81EA\u5206\u3067\u5B9F\u88C5\u30FB\u7DE8\u96C6\u30FB\u30D6\u30E9\u30F3\u30C1\u4F5C\u6210\u3092\u59CB\u3081\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
|
|
325
320
|
|
|
326
321
|
Issue \u756A\u53F7\u3001\u5B8C\u4E86\u6761\u4EF6\u3001\u5236\u7D04\u3001\u56DE\u7B54\u306A\u3069\u3001\u30E6\u30FC\u30B6\u30FC\u304C\u5165\u529B\u3057\u305F\u5185\u5BB9\u306F\u7701\u7565\u305B\u305A \`task\` \u306B\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\`godd-dev\` \u306E\u8FD4\u3057\u305F\u958B\u767A\u30D5\u30ED\u30FC\uFF08\u4ED5\u69D8\u78BA\u8A8D\u3001ATDD\u3001\u5B9F\u88C5\u3001\u54C1\u8CEA\u30B2\u30FC\u30C8\u3001\u8CAC\u52D9\u5225\u30B3\u30DF\u30C3\u30C8\uFF09\u306B\u5F93\u3063\u3066\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
327
|
-
`,vq=[(0,he.join)(".cursor","commands","godd-dev.md"),(0,he.join)(".claude","commands","godd-dev.md")],SC=vC.createInterface({input:process.stdin,output:process.stdout});_C="# GoDD managed Codex MCP configuration";I_={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:"\u5B9F\u884C\u74B0\u5883\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\uFF08\u4EFB\u610F\u30FB\u8907\u6570\u53EF\uFF09",database:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9",infra:"\u30A4\u30F3\u30D5\u30E9",architecture:"\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3"};wq={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"],emotion:["typescript","javascript"],"styled-components":["typescript","javascript"],mui:["typescript","javascript"],"chakra-ui":["typescript","javascript"],tailwind:[],sass:[],node:["typescript","javascript"],"agent-stdio":[]},bq={react:"frontend-ui",nextjs:"frontend-ui",vue:"frontend-ui",angular:"frontend-ui",svelte:"frontend-ui",electron:"frontend-ui",mui:"frontend-ui","chakra-ui":"frontend-ui",tailwind:"frontend-css",sass:"frontend-css",emotion:"frontend-css","styled-components":"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"};NC="# GoDD MCP Server (managed by godd init)",jC="# GODD_LICENSE_KEY \u306F\u672A\u8A2D\u5B9A\uFF08godd login \u3067\u4FDD\u5B58\u3057\u305F\u30ED\u30B0\u30A4\u30F3\u3092\u4F7F\u7528\uFF09",Pq=new Set([NC,jC]);Ot="ripla-google",GC=5e3;Tq=new Set(["google","g"]);fl(process.env,process.argv[1],Rq())&&iT().catch(e=>{console.error("\u30A8\u30E9\u30FC:",e),process.exit(1)})});function fp(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function cT(e=fetch,t){return t?async(r,n)=>{let o={...t,...n,headers:n?.headers?{...fp(t.headers),...fp(n.headers)}:t.headers};return e(r,o)}:e}var lT=b(()=>{});async function Aq(e){return(await D_).getRandomValues(new Uint8Array(e))}async function Iq(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%t.length,n="";for(;n.length<e;){let o=await Aq(e-n.length);for(let i of o)i<r&&(n+=t[i%t.length])}return n}async function zq(e){return await Iq(e)}async function Dq(e){let t=await(await D_).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function O_(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await zq(e),r=await Dq(t);return{code_verifier:t,code_challenge:r}}var D_,uT=b(()=>{D_=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(e=>e.webcrypto)});var ht,dT,N_,Oq,fT,hT,mT,pT,Nq,jq,gT,pee,dee,j_=b(()=>{Ad();ht=Tb().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Zb.custom,message:"URL must be parseable",fatal:!0}),uc}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),dT=Xe({resource:y().url(),authorization_servers:T(ht).optional(),jwks_uri:y().url().optional(),scopes_supported:T(y()).optional(),bearer_methods_supported:T(y()).optional(),resource_signing_alg_values_supported:T(y()).optional(),resource_name:y().optional(),resource_documentation:y().optional(),resource_policy_uri:y().url().optional(),resource_tos_uri:y().url().optional(),tls_client_certificate_bound_access_tokens:we().optional(),authorization_details_types_supported:T(y()).optional(),dpop_signing_alg_values_supported:T(y()).optional(),dpop_bound_access_tokens_required:we().optional()}),N_=Xe({issuer:y(),authorization_endpoint:ht,token_endpoint:ht,registration_endpoint:ht.optional(),scopes_supported:T(y()).optional(),response_types_supported:T(y()),response_modes_supported:T(y()).optional(),grant_types_supported:T(y()).optional(),token_endpoint_auth_methods_supported:T(y()).optional(),token_endpoint_auth_signing_alg_values_supported:T(y()).optional(),service_documentation:ht.optional(),revocation_endpoint:ht.optional(),revocation_endpoint_auth_methods_supported:T(y()).optional(),revocation_endpoint_auth_signing_alg_values_supported:T(y()).optional(),introspection_endpoint:y().optional(),introspection_endpoint_auth_methods_supported:T(y()).optional(),introspection_endpoint_auth_signing_alg_values_supported:T(y()).optional(),code_challenge_methods_supported:T(y()).optional(),client_id_metadata_document_supported:we().optional()}),Oq=Xe({issuer:y(),authorization_endpoint:ht,token_endpoint:ht,userinfo_endpoint:ht.optional(),jwks_uri:ht,registration_endpoint:ht.optional(),scopes_supported:T(y()).optional(),response_types_supported:T(y()),response_modes_supported:T(y()).optional(),grant_types_supported:T(y()).optional(),acr_values_supported:T(y()).optional(),subject_types_supported:T(y()),id_token_signing_alg_values_supported:T(y()),id_token_encryption_alg_values_supported:T(y()).optional(),id_token_encryption_enc_values_supported:T(y()).optional(),userinfo_signing_alg_values_supported:T(y()).optional(),userinfo_encryption_alg_values_supported:T(y()).optional(),userinfo_encryption_enc_values_supported:T(y()).optional(),request_object_signing_alg_values_supported:T(y()).optional(),request_object_encryption_alg_values_supported:T(y()).optional(),request_object_encryption_enc_values_supported:T(y()).optional(),token_endpoint_auth_methods_supported:T(y()).optional(),token_endpoint_auth_signing_alg_values_supported:T(y()).optional(),display_values_supported:T(y()).optional(),claim_types_supported:T(y()).optional(),claims_supported:T(y()).optional(),service_documentation:y().optional(),claims_locales_supported:T(y()).optional(),ui_locales_supported:T(y()).optional(),claims_parameter_supported:we().optional(),request_parameter_supported:we().optional(),request_uri_parameter_supported:we().optional(),require_request_uri_registration:we().optional(),op_policy_uri:ht.optional(),op_tos_uri:ht.optional(),client_id_metadata_document_supported:we().optional()}),fT=R({...Oq.shape,...N_.pick({code_challenge_methods_supported:!0}).shape}),hT=R({access_token:y(),id_token:y().optional(),token_type:y(),expires_in:Ic.number().optional(),scope:y().optional(),refresh_token:y().optional()}).strip(),mT=R({error:y(),error_description:y().optional(),error_uri:y().optional()}),pT=ht.optional().or(O("").transform(()=>{})),Nq=R({redirect_uris:T(ht),token_endpoint_auth_method:y().optional(),grant_types:T(y()).optional(),response_types:T(y()).optional(),client_name:y().optional(),client_uri:ht.optional(),logo_uri:pT,scope:y().optional(),contacts:T(y()).optional(),tos_uri:pT,policy_uri:y().optional(),jwks_uri:ht.optional(),jwks:Ab().optional(),software_id:y().optional(),software_version:y().optional(),software_statement:y().optional()}).strip(),jq=R({client_id:y(),client_secret:y().optional(),client_id_issued_at:de().optional(),client_secret_expires_at:de().optional()}).strip(),gT=Nq.merge(jq),pee=R({error:y(),error_description:y().optional()}).strip(),dee=R({token:y(),token_type_hint:y().optional()}).strip()});function _T(e){let t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function yT({requestedResource:e,configuredResource:t}){let r=typeof e=="string"?new URL(e):new URL(e.href),n=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;let o=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return o.startsWith(i)}var vT=b(()=>{});var qe,qa,Jo,Yo,Qo,Fa,Ga,Va,kn,Ba,Ha,Ka,Wa,Ja,Ya,Xo,Qa,Xa,wT,bT=b(()=>{qe=class extends Error{constructor(t,r){super(t),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}},qa=class extends qe{};qa.errorCode="invalid_request";Jo=class extends qe{};Jo.errorCode="invalid_client";Yo=class extends qe{};Yo.errorCode="invalid_grant";Qo=class extends qe{};Qo.errorCode="unauthorized_client";Fa=class extends qe{};Fa.errorCode="unsupported_grant_type";Ga=class extends qe{};Ga.errorCode="invalid_scope";Va=class extends qe{};Va.errorCode="access_denied";kn=class extends qe{};kn.errorCode="server_error";Ba=class extends qe{};Ba.errorCode="temporarily_unavailable";Ha=class extends qe{};Ha.errorCode="unsupported_response_type";Ka=class extends qe{};Ka.errorCode="unsupported_token_type";Wa=class extends qe{};Wa.errorCode="invalid_token";Ja=class extends qe{};Ja.errorCode="method_not_allowed";Ya=class extends qe{};Ya.errorCode="too_many_requests";Xo=class extends qe{};Xo.errorCode="invalid_client_metadata";Qa=class extends qe{};Qa.errorCode="insufficient_scope";Xa=class extends qe{};Xa.errorCode="invalid_target";wT={[qa.errorCode]:qa,[Jo.errorCode]:Jo,[Yo.errorCode]:Yo,[Qo.errorCode]:Qo,[Fa.errorCode]:Fa,[Ga.errorCode]:Ga,[Va.errorCode]:Va,[kn.errorCode]:kn,[Ba.errorCode]:Ba,[Ha.errorCode]:Ha,[Ka.errorCode]:Ka,[Wa.errorCode]:Wa,[Ja.errorCode]:Ja,[Ya.errorCode]:Ya,[Xo.errorCode]:Xo,[Qa.errorCode]:Qa,[Xa.errorCode]:Xa}});function Mq(e){return["client_secret_basic","client_secret_post","none"].includes(e)}function Lq(e,t){let r=e.client_secret!==void 0;return t.length===0?r?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Mq(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function Zq(e,t,r,n){let{client_id:o,client_secret:i}=t;switch(e){case"client_secret_basic":Uq(o,i,r);return;case"client_secret_post":qq(o,i,n);return;case"none":Fq(o,n);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function Uq(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");let n=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${n}`)}function qq(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function Fq(e,t){t.set("client_id",e)}async function kT(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let n=mT.parse(JSON.parse(r)),{error:o,error_description:i,error_uri:s}=n,a=wT[o]||kn;return new a(i||"",s)}catch(n){let o=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${n}. Raw body: ${r}`;return new kn(o)}}async function ec(e,t){try{return await Z_(e,t)}catch(r){if(r instanceof Jo||r instanceof Qo)return await e.invalidateCredentials?.("all"),await Z_(e,t);if(r instanceof Yo)return await e.invalidateCredentials?.("tokens"),await Z_(e,t);throw r}}async function Z_(e,{serverUrl:t,authorizationCode:r,scope:n,resourceMetadataUrl:o,fetchFn:i}){let s,a;try{s=await Bq(t,{resourceMetadataUrl:o},i),s.authorization_servers&&s.authorization_servers.length>0&&(a=s.authorization_servers[0])}catch{}a||(a=new URL("/",t));let c=await Vq(t,e,s),l=await Yq(a,{fetchFn:i}),p=await Promise.resolve(e.clientInformation());if(!p){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let _=l?.client_id_metadata_document_supported===!0,v=e.clientMetadataUrl;if(v&&!Gq(v))throw new Xo(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${v}`);if(_&&v)p={client_id:v},await e.saveClientInformation?.(p);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let x=await rF(a,{metadata:l,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(x),p=x}}let u=!e.redirectUrl;if(r!==void 0||u){let _=await tF(e,a,{metadata:l,resource:c,authorizationCode:r,fetchFn:i});return await e.saveTokens(_),"AUTHORIZED"}let d=await e.tokens();if(d?.refresh_token)try{let _=await eF(a,{metadata:l,clientInformation:p,refreshToken:d.refresh_token,resource:c,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(_),"AUTHORIZED"}catch(_){if(!(!(_ instanceof qe)||_ instanceof kn))throw _}let h=e.state?await e.state():void 0,{authorizationUrl:m,codeVerifier:g}=await Qq(a,{metadata:l,clientInformation:p,state:h,redirectUrl:e.redirectUrl,scope:n||s?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:c});return await e.saveCodeVerifier(g),await e.redirectToAuthorization(m),"REDIRECT"}function Gq(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function Vq(e,t,r){let n=_T(e);if(t.validateResourceURL)return await t.validateResourceURL(n,r?.resource);if(r){if(!yT({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}}function q_(e){let t=e.headers.get("WWW-Authenticate");if(!t)return{};let[r,n]=t.split(" ");if(r.toLowerCase()!=="bearer"||!n)return{};let o=U_(e,"resource_metadata")||void 0,i;if(o)try{i=new URL(o)}catch{}let s=U_(e,"scope")||void 0,a=U_(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:a}}function U_(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let n=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),o=r.match(n);return o?o[1]||o[2]:null}async function Bq(e,t,r=fetch){let n=await Wq(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!n||n.status===404)throw await n?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw await n.body?.cancel(),new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return dT.parse(await n.json())}async function F_(e,t,r=fetch){try{return await r(e,{headers:t})}catch(n){if(n instanceof TypeError)return t?F_(e,void 0,r):void 0;throw n}}function Hq(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function xT(e,t,r=fetch){return await F_(e,{"MCP-Protocol-Version":t},r)}function Kq(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function Wq(e,t,r,n){let o=new URL(e),i=n?.protocolVersion??ci,s;if(n?.metadataUrl)s=new URL(n.metadataUrl);else{let c=Hq(t,o.pathname);s=new URL(c,n?.metadataServerUrl??o),s.search=o.search}let a=await xT(s,i,r);if(!n?.metadataUrl&&Kq(a,o.pathname)){let c=new URL(`/.well-known/${t}`,o);a=await xT(c,i,r)}return a}function Jq(e){let t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),n;let o=t.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,t.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,t.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,t.origin),type:"oidc"}),n}async function Yq(e,{fetchFn:t=fetch,protocolVersion:r=ci}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=Jq(e);for(let{url:i,type:s}of o){let a=await F_(i,n,t);if(a){if(!a.ok){if(await a.body?.cancel(),a.status>=400&&a.status<500)continue;throw new Error(`HTTP ${a.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?N_.parse(await a.json()):fT.parse(await a.json())}}}async function Qq(e,{metadata:t,clientInformation:r,redirectUrl:n,scope:o,state:i,resource:s}){let a;if(t){if(a=new URL(t.authorization_endpoint),!t.response_types_supported.includes(M_))throw new Error(`Incompatible auth server: does not support response type ${M_}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(L_))throw new Error(`Incompatible auth server: does not support code challenge method ${L_}`)}else a=new URL("/authorize",e);let c=await O_(),l=c.code_verifier,p=c.code_challenge;return a.searchParams.set("response_type",M_),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",p),a.searchParams.set("code_challenge_method",L_),a.searchParams.set("redirect_uri",String(n)),i&&a.searchParams.set("state",i),o&&a.searchParams.set("scope",o),o?.includes("offline_access")&&a.searchParams.append("prompt","consent"),s&&a.searchParams.set("resource",s.href),{authorizationUrl:a,codeVerifier:l}}function Xq(e,t,r){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(r)})}async function ST(e,{metadata:t,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:i,fetchFn:s}){let a=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&r.set("resource",i.href),o)await o(c,r,a,t);else if(n){let p=t?.token_endpoint_auth_methods_supported??[],u=Lq(n,p);Zq(u,n,c,r)}let l=await(s??fetch)(a,{method:"POST",headers:c,body:r});if(!l.ok)throw await kT(l);return hT.parse(await l.json())}async function eF(e,{metadata:t,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:i,fetchFn:s}){let a=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),c=await ST(e,{metadata:t,tokenRequestParams:a,clientInformation:r,addClientAuthentication:i,resource:o,fetchFn:s});return{refresh_token:n,...c}}async function tF(e,t,{metadata:r,resource:n,authorizationCode:o,fetchFn:i}={}){let s=e.clientMetadata.scope,a;if(e.prepareTokenRequest&&(a=await e.prepareTokenRequest(s)),!a){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let l=await e.codeVerifier();a=Xq(o,l,e.redirectUrl)}let c=await e.clientInformation();return ST(t,{metadata:r,tokenRequestParams:a,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:n,fetchFn:i})}async function rF(e,{metadata:t,clientMetadata:r,fetchFn:n}){let o;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");o=new URL(t.registration_endpoint)}else o=new URL("/register",e);let i=await(n??fetch)(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw await kT(i);return gT.parse(await i.json())}var Sn,M_,L_,$T=b(()=>{uT();Tn();j_();j_();vT();bT();Sn=class extends Error{constructor(t){super(t??"Unauthorized")}};M_="code",L_="S256"});function G_(e){}function PT(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=G_,onError:r=G_,onRetry:n=G_,onComment:o}=e,i="",s=!0,a,c="",l="";function p(g){let _=s?g.replace(/^\xEF\xBB\xBF/,""):g,[v,w]=nF(`${i}${_}`);for(let x of v)u(x);i=w,s=!1}function u(g){if(g===""){h();return}if(g.startsWith(":")){o&&o(g.slice(g.startsWith(": ")?2:1));return}let _=g.indexOf(":");if(_!==-1){let v=g.slice(0,_),w=g[_+1]===" "?2:1,x=g.slice(_+w);d(v,x,g);return}d(g,"",g)}function d(g,_,v){switch(g){case"event":l=_;break;case"data":c=`${c}${_}
|
|
328
|
-
`;break;case"id":a=
|
|
329
|
-
`)?c.slice(0,-1):c}),a=void 0,c="",
|
|
322
|
+
`,lq=[(0,fe.join)(".cursor","commands","godd-dev.md"),(0,fe.join)(".claude","commands","godd-dev.md")],_C=fC.createInterface({input:process.stdin,output:process.stdout});pC="# GoDD managed Codex MCP configuration";zy={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:"\u5B9F\u884C\u74B0\u5883\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\uFF08\u4EFB\u610F\u30FB\u8907\u6570\u53EF\uFF09",database:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9",infra:"\u30A4\u30F3\u30D5\u30E9",architecture:"\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3"};pq={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"],emotion:["typescript","javascript"],"styled-components":["typescript","javascript"],mui:["typescript","javascript"],"chakra-ui":["typescript","javascript"],tailwind:[],sass:[],node:["typescript","javascript"],"agent-stdio":[]},dq={react:"frontend-ui",nextjs:"frontend-ui",vue:"frontend-ui",angular:"frontend-ui",svelte:"frontend-ui",electron:"frontend-ui",mui:"frontend-ui","chakra-ui":"frontend-ui",tailwind:"frontend-css",sass:"frontend-css",emotion:"frontend-css","styled-components":"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"};AC="# GoDD MCP Server (managed by godd init)",RC="# GODD_LICENSE_KEY \u306F\u672A\u8A2D\u5B9A\uFF08godd login \u3067\u4FDD\u5B58\u3057\u305F\u30ED\u30B0\u30A4\u30F3\u3092\u4F7F\u7528\uFF09",yq=new Set([AC,RC]);Ot="ripla-google",MC=5e3;wq=new Set(["google","g"]);du(process.env,process.argv[1],bq())&&XC().catch(e=>{console.error("\u30A8\u30E9\u30FC:",e),process.exit(1)})});function hp(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function rT(e=fetch,t){return t?async(r,n)=>{let o={...t,...n,headers:n?.headers?{...hp(t.headers),...hp(n.headers)}:t.headers};return e(r,o)}:e}var nT=b(()=>{});async function xq(e){return(await Oy).getRandomValues(new Uint8Array(e))}async function kq(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%t.length,n="";for(;n.length<e;){let o=await xq(e-n.length);for(let i of o)i<r&&(n+=t[i%t.length])}return n}async function Sq(e){return await kq(e)}async function $q(e){let t=await(await Oy).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Ny(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await Sq(e),r=await $q(t);return{code_verifier:t,code_challenge:r}}var Oy,oT=b(()=>{Oy=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(e=>e.webcrypto)});var ft,sT,jy,Pq,aT,cT,uT,iT,Eq,Cq,lT,YX,QX,My=b(()=>{Id();ft=Ab().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Ub.custom,message:"URL must be parseable",fatal:!0}),uc}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),sT=Ye({resource:_().url(),authorization_servers:T(ft).optional(),jwks_uri:_().url().optional(),scopes_supported:T(_()).optional(),bearer_methods_supported:T(_()).optional(),resource_signing_alg_values_supported:T(_()).optional(),resource_name:_().optional(),resource_documentation:_().optional(),resource_policy_uri:_().url().optional(),resource_tos_uri:_().url().optional(),tls_client_certificate_bound_access_tokens:we().optional(),authorization_details_types_supported:T(_()).optional(),dpop_signing_alg_values_supported:T(_()).optional(),dpop_bound_access_tokens_required:we().optional()}),jy=Ye({issuer:_(),authorization_endpoint:ft,token_endpoint:ft,registration_endpoint:ft.optional(),scopes_supported:T(_()).optional(),response_types_supported:T(_()),response_modes_supported:T(_()).optional(),grant_types_supported:T(_()).optional(),token_endpoint_auth_methods_supported:T(_()).optional(),token_endpoint_auth_signing_alg_values_supported:T(_()).optional(),service_documentation:ft.optional(),revocation_endpoint:ft.optional(),revocation_endpoint_auth_methods_supported:T(_()).optional(),revocation_endpoint_auth_signing_alg_values_supported:T(_()).optional(),introspection_endpoint:_().optional(),introspection_endpoint_auth_methods_supported:T(_()).optional(),introspection_endpoint_auth_signing_alg_values_supported:T(_()).optional(),code_challenge_methods_supported:T(_()).optional(),client_id_metadata_document_supported:we().optional()}),Pq=Ye({issuer:_(),authorization_endpoint:ft,token_endpoint:ft,userinfo_endpoint:ft.optional(),jwks_uri:ft,registration_endpoint:ft.optional(),scopes_supported:T(_()).optional(),response_types_supported:T(_()),response_modes_supported:T(_()).optional(),grant_types_supported:T(_()).optional(),acr_values_supported:T(_()).optional(),subject_types_supported:T(_()),id_token_signing_alg_values_supported:T(_()),id_token_encryption_alg_values_supported:T(_()).optional(),id_token_encryption_enc_values_supported:T(_()).optional(),userinfo_signing_alg_values_supported:T(_()).optional(),userinfo_encryption_alg_values_supported:T(_()).optional(),userinfo_encryption_enc_values_supported:T(_()).optional(),request_object_signing_alg_values_supported:T(_()).optional(),request_object_encryption_alg_values_supported:T(_()).optional(),request_object_encryption_enc_values_supported:T(_()).optional(),token_endpoint_auth_methods_supported:T(_()).optional(),token_endpoint_auth_signing_alg_values_supported:T(_()).optional(),display_values_supported:T(_()).optional(),claim_types_supported:T(_()).optional(),claims_supported:T(_()).optional(),service_documentation:_().optional(),claims_locales_supported:T(_()).optional(),ui_locales_supported:T(_()).optional(),claims_parameter_supported:we().optional(),request_parameter_supported:we().optional(),request_uri_parameter_supported:we().optional(),require_request_uri_registration:we().optional(),op_policy_uri:ft.optional(),op_tos_uri:ft.optional(),client_id_metadata_document_supported:we().optional()}),aT=A({...Pq.shape,...jy.pick({code_challenge_methods_supported:!0}).shape}),cT=A({access_token:_(),id_token:_().optional(),token_type:_(),expires_in:Rc.number().optional(),scope:_().optional(),refresh_token:_().optional()}).strip(),uT=A({error:_(),error_description:_().optional(),error_uri:_().optional()}),iT=ft.optional().or(O("").transform(()=>{})),Eq=A({redirect_uris:T(ft),token_endpoint_auth_method:_().optional(),grant_types:T(_()).optional(),response_types:T(_()).optional(),client_name:_().optional(),client_uri:ft.optional(),logo_uri:iT,scope:_().optional(),contacts:T(_()).optional(),tos_uri:iT,policy_uri:_().optional(),jwks_uri:ft.optional(),jwks:Ib().optional(),software_id:_().optional(),software_version:_().optional(),software_statement:_().optional()}).strip(),Cq=A({client_id:_(),client_secret:_().optional(),client_id_issued_at:de().optional(),client_secret_expires_at:de().optional()}).strip(),lT=Eq.merge(Cq),YX=A({error:_(),error_description:_().optional()}).strip(),QX=A({token:_(),token_type_hint:_().optional()}).strip()});function pT(e){let t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function dT({requestedResource:e,configuredResource:t}){let r=typeof e=="string"?new URL(e):new URL(e.href),n=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;let o=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return o.startsWith(i)}var fT=b(()=>{});var Ue,Ua,Ko,Jo,Yo,qa,Fa,Ga,xn,Va,Ba,Ha,Wa,Ka,Ja,Qo,Ya,Qa,hT,mT=b(()=>{Ue=class extends Error{constructor(t,r){super(t),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}},Ua=class extends Ue{};Ua.errorCode="invalid_request";Ko=class extends Ue{};Ko.errorCode="invalid_client";Jo=class extends Ue{};Jo.errorCode="invalid_grant";Yo=class extends Ue{};Yo.errorCode="unauthorized_client";qa=class extends Ue{};qa.errorCode="unsupported_grant_type";Fa=class extends Ue{};Fa.errorCode="invalid_scope";Ga=class extends Ue{};Ga.errorCode="access_denied";xn=class extends Ue{};xn.errorCode="server_error";Va=class extends Ue{};Va.errorCode="temporarily_unavailable";Ba=class extends Ue{};Ba.errorCode="unsupported_response_type";Ha=class extends Ue{};Ha.errorCode="unsupported_token_type";Wa=class extends Ue{};Wa.errorCode="invalid_token";Ka=class extends Ue{};Ka.errorCode="method_not_allowed";Ja=class extends Ue{};Ja.errorCode="too_many_requests";Qo=class extends Ue{};Qo.errorCode="invalid_client_metadata";Ya=class extends Ue{};Ya.errorCode="insufficient_scope";Qa=class extends Ue{};Qa.errorCode="invalid_target";hT={[Ua.errorCode]:Ua,[Ko.errorCode]:Ko,[Jo.errorCode]:Jo,[Yo.errorCode]:Yo,[qa.errorCode]:qa,[Fa.errorCode]:Fa,[Ga.errorCode]:Ga,[xn.errorCode]:xn,[Va.errorCode]:Va,[Ba.errorCode]:Ba,[Ha.errorCode]:Ha,[Wa.errorCode]:Wa,[Ka.errorCode]:Ka,[Ja.errorCode]:Ja,[Qo.errorCode]:Qo,[Ya.errorCode]:Ya,[Qa.errorCode]:Qa}});function Tq(e){return["client_secret_basic","client_secret_post","none"].includes(e)}function Aq(e,t){let r=e.client_secret!==void 0;return t.length===0?r?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Tq(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function Rq(e,t,r,n){let{client_id:o,client_secret:i}=t;switch(e){case"client_secret_basic":Iq(o,i,r);return;case"client_secret_post":zq(o,i,n);return;case"none":Dq(o,n);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function Iq(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");let n=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${n}`)}function zq(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function Dq(e,t){t.set("client_id",e)}async function yT(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let n=uT.parse(JSON.parse(r)),{error:o,error_description:i,error_uri:s}=n,a=hT[o]||xn;return new a(i||"",s)}catch(n){let o=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${n}. Raw body: ${r}`;return new xn(o)}}async function Xa(e,t){try{return await Uy(e,t)}catch(r){if(r instanceof Ko||r instanceof Yo)return await e.invalidateCredentials?.("all"),await Uy(e,t);if(r instanceof Jo)return await e.invalidateCredentials?.("tokens"),await Uy(e,t);throw r}}async function Uy(e,{serverUrl:t,authorizationCode:r,scope:n,resourceMetadataUrl:o,fetchFn:i}){let s,a;try{s=await jq(t,{resourceMetadataUrl:o},i),s.authorization_servers&&s.authorization_servers.length>0&&(a=s.authorization_servers[0])}catch{}a||(a=new URL("/",t));let c=await Nq(t,e,s),u=await qq(a,{fetchFn:i}),p=await Promise.resolve(e.clientInformation());if(!p){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let y=u?.client_id_metadata_document_supported===!0,v=e.clientMetadataUrl;if(v&&!Oq(v))throw new Qo(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${v}`);if(y&&v)p={client_id:v},await e.saveClientInformation?.(p);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let x=await Hq(a,{metadata:u,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(x),p=x}}let l=!e.redirectUrl;if(r!==void 0||l){let y=await Bq(e,a,{metadata:u,resource:c,authorizationCode:r,fetchFn:i});return await e.saveTokens(y),"AUTHORIZED"}let d=await e.tokens();if(d?.refresh_token)try{let y=await Vq(a,{metadata:u,clientInformation:p,refreshToken:d.refresh_token,resource:c,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(y),"AUTHORIZED"}catch(y){if(!(!(y instanceof Ue)||y instanceof xn))throw y}let f=e.state?await e.state():void 0,{authorizationUrl:h,codeVerifier:g}=await Fq(a,{metadata:u,clientInformation:p,state:f,redirectUrl:e.redirectUrl,scope:n||s?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:c});return await e.saveCodeVerifier(g),await e.redirectToAuthorization(h),"REDIRECT"}function Oq(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function Nq(e,t,r){let n=pT(e);if(t.validateResourceURL)return await t.validateResourceURL(n,r?.resource);if(r){if(!dT({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}}function Fy(e){let t=e.headers.get("WWW-Authenticate");if(!t)return{};let[r,n]=t.split(" ");if(r.toLowerCase()!=="bearer"||!n)return{};let o=qy(e,"resource_metadata")||void 0,i;if(o)try{i=new URL(o)}catch{}let s=qy(e,"scope")||void 0,a=qy(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:a}}function qy(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let n=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),o=r.match(n);return o?o[1]||o[2]:null}async function jq(e,t,r=fetch){let n=await Zq(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!n||n.status===404)throw await n?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw await n.body?.cancel(),new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return sT.parse(await n.json())}async function Gy(e,t,r=fetch){try{return await r(e,{headers:t})}catch(n){if(n instanceof TypeError)return t?Gy(e,void 0,r):void 0;throw n}}function Mq(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function gT(e,t,r=fetch){return await Gy(e,{"MCP-Protocol-Version":t},r)}function Lq(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function Zq(e,t,r,n){let o=new URL(e),i=n?.protocolVersion??ai,s;if(n?.metadataUrl)s=new URL(n.metadataUrl);else{let c=Mq(t,o.pathname);s=new URL(c,n?.metadataServerUrl??o),s.search=o.search}let a=await gT(s,i,r);if(!n?.metadataUrl&&Lq(a,o.pathname)){let c=new URL(`/.well-known/${t}`,o);a=await gT(c,i,r)}return a}function Uq(e){let t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),n;let o=t.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,t.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,t.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,t.origin),type:"oidc"}),n}async function qq(e,{fetchFn:t=fetch,protocolVersion:r=ai}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=Uq(e);for(let{url:i,type:s}of o){let a=await Gy(i,n,t);if(a){if(!a.ok){if(await a.body?.cancel(),a.status>=400&&a.status<500)continue;throw new Error(`HTTP ${a.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?jy.parse(await a.json()):aT.parse(await a.json())}}}async function Fq(e,{metadata:t,clientInformation:r,redirectUrl:n,scope:o,state:i,resource:s}){let a;if(t){if(a=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Ly))throw new Error(`Incompatible auth server: does not support response type ${Ly}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(Zy))throw new Error(`Incompatible auth server: does not support code challenge method ${Zy}`)}else a=new URL("/authorize",e);let c=await Ny(),u=c.code_verifier,p=c.code_challenge;return a.searchParams.set("response_type",Ly),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",p),a.searchParams.set("code_challenge_method",Zy),a.searchParams.set("redirect_uri",String(n)),i&&a.searchParams.set("state",i),o&&a.searchParams.set("scope",o),o?.includes("offline_access")&&a.searchParams.append("prompt","consent"),s&&a.searchParams.set("resource",s.href),{authorizationUrl:a,codeVerifier:u}}function Gq(e,t,r){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(r)})}async function _T(e,{metadata:t,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:i,fetchFn:s}){let a=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&r.set("resource",i.href),o)await o(c,r,a,t);else if(n){let p=t?.token_endpoint_auth_methods_supported??[],l=Aq(n,p);Rq(l,n,c,r)}let u=await(s??fetch)(a,{method:"POST",headers:c,body:r});if(!u.ok)throw await yT(u);return cT.parse(await u.json())}async function Vq(e,{metadata:t,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:i,fetchFn:s}){let a=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),c=await _T(e,{metadata:t,tokenRequestParams:a,clientInformation:r,addClientAuthentication:i,resource:o,fetchFn:s});return{refresh_token:n,...c}}async function Bq(e,t,{metadata:r,resource:n,authorizationCode:o,fetchFn:i}={}){let s=e.clientMetadata.scope,a;if(e.prepareTokenRequest&&(a=await e.prepareTokenRequest(s)),!a){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let u=await e.codeVerifier();a=Gq(o,u,e.redirectUrl)}let c=await e.clientInformation();return _T(t,{metadata:r,tokenRequestParams:a,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:n,fetchFn:i})}async function Hq(e,{metadata:t,clientMetadata:r,fetchFn:n}){let o;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");o=new URL(t.registration_endpoint)}else o=new URL("/register",e);let i=await(n??fetch)(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw await yT(i);return lT.parse(await i.json())}var kn,Ly,Zy,vT=b(()=>{oT();Cn();My();My();fT();mT();kn=class extends Error{constructor(t){super(t??"Unauthorized")}};Ly="code",Zy="S256"});function Vy(e){}function wT(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=Vy,onError:r=Vy,onRetry:n=Vy,onComment:o}=e,i="",s=!0,a,c="",u="";function p(g){let y=s?g.replace(/^\xEF\xBB\xBF/,""):g,[v,w]=Wq(`${i}${y}`);for(let x of v)l(x);i=w,s=!1}function l(g){if(g===""){f();return}if(g.startsWith(":")){o&&o(g.slice(g.startsWith(": ")?2:1));return}let y=g.indexOf(":");if(y!==-1){let v=g.slice(0,y),w=g[y+1]===" "?2:1,x=g.slice(y+w);d(v,x,g);return}d(g,"",g)}function d(g,y,v){switch(g){case"event":u=y;break;case"data":c=`${c}${y}
|
|
323
|
+
`;break;case"id":a=y.includes("\0")?void 0:y;break;case"retry":/^\d+$/.test(y)?n(parseInt(y,10)):r(new mp(`Invalid \`retry\` value: "${y}"`,{type:"invalid-retry",value:y,line:v}));break;default:r(new mp(`Unknown field "${g.length>20?`${g.slice(0,20)}\u2026`:g}"`,{type:"unknown-field",field:g,value:y,line:v}));break}}function f(){c.length>0&&t({id:a,event:u||void 0,data:c.endsWith(`
|
|
324
|
+
`)?c.slice(0,-1):c}),a=void 0,c="",u=""}function h(g={}){i&&g.consume&&l(i),s=!0,a=void 0,c="",u="",i=""}return{feed:p,reset:h}}function Wq(e){let t=[],r="",n=0;for(;n<e.length;){let o=e.indexOf("\r",n),i=e.indexOf(`
|
|
330
325
|
`,n),s=-1;if(o!==-1&&i!==-1?s=Math.min(o,i):o!==-1?o===e.length-1?s=-1:s=o:i!==-1&&(s=i),s===-1){r=e.slice(n);break}else{let a=e.slice(n,s);t.push(a),n=s+1,e[n-1]==="\r"&&e[n]===`
|
|
331
|
-
`&&n++}}return[t,r]}var hp,ET=b(()=>{hp=class extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}});var mp,CT=b(()=>{ET();mp=class extends TransformStream{constructor({onError:t,onRetry:r,onComment:n}={}){let o;super({start(i){o=PT({onEvent:s=>{i.enqueue(s)},onError(s){t==="terminate"?i.error(s):typeof t=="function"&&t(s)},onRetry:r,onComment:n})},transform(i){o.feed(i)}})}}});var oF,ro,gp,TT=b(()=>{lT();Tn();$T();CT();oF={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},ro=class extends Error{constructor(t,r){super(`Streamable HTTP error: ${r}`),this.code=t}},gp=class{constructor(t,r){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=cT(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??oF}async _authThenStart(){if(!this._authProvider)throw new Sn("No auth provider");let t;try{t=await ec(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(t!=="AUTHORIZED")throw new Sn;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let t={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(t.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=fp(this._requestInit?.headers);return new Headers({...t,...r})}async _startOrAuthSse(t){let{resumptionToken:r}=t;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new ro(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,t,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,t),o)}_scheduleReconnection(t,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,r+1)})},o)}_handleSseStream(t,r,n){if(!t)return;let{onresumptiontoken:o,replayMessageId:i}=r,s,a=!1,c=!1;(async()=>{try{let p=t.pipeThrough(new TextDecoderStream).pipeThrough(new mp({onRetry:h=>{this._serverRetryMs=h}})).getReader();for(;;){let{value:h,done:m}=await p.read();if(m)break;if(h.id&&(s=h.id,a=!0,o?.(h.id)),!!h.data&&(!h.event||h.event==="message"))try{let g=li.parse(JSON.parse(h.data));fo(g)&&(c=!0,i!==void 0&&(g.id=i)),this.onmessage?.(g)}catch(g){this.onerror?.(g)}}(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(p){if(this.onerror?.(new Error(`SSE stream disconnected: ${p}`)),(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(h){this.onerror?.(new Error(`Failed to reconnect: ${h instanceof Error?h.message:String(h)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new Sn("No auth provider");if(await ec(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Sn("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:po(t)?t.id:void 0}).catch(d=>this.onerror?.(d));return}let i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");let s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._url,s),c=a.headers.get("mcp-session-id");if(c&&(this._sessionId=c),!a.ok){let d=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new ro(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:h,scope:m}=q_(a);if(this._resourceMetadataUrl=h,this._scope=m,await ec(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Sn;return this._hasCompletedAuthFlow=!0,this.send(t)}if(a.status===403&&this._authProvider){let{resourceMetadataUrl:h,scope:m,error:g}=q_(a);if(g==="insufficient_scope"){let _=a.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===_)throw new ro(403,"Server returned 403 after trying upscoping");if(m&&(this._scope=m),h&&(this._resourceMetadataUrl=h),this._lastUpscopingHeader=_??void 0,await ec(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new Sn;return this.send(t)}}throw new ro(a.status,`Error POSTing to endpoint: ${d}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,a.status===202){await a.body?.cancel(),t0(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(d=>this.onerror?.(d));return}let p=(Array.isArray(t)?t:[t]).filter(d=>"method"in d&&"id"in d&&d.id!==void 0).length>0,u=a.headers.get("content-type");if(p)if(u?.includes("text/event-stream"))this._handleSseStream(a.body,{onresumptiontoken:o},!1);else if(u?.includes("application/json")){let d=await a.json(),h=Array.isArray(d)?d.map(m=>li.parse(m)):[li.parse(d)];for(let m of h)this.onmessage?.(m)}else throw await a.body?.cancel(),new ro(-1,`Unexpected content type: ${u}`);else await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let t=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new ro(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,r){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:r?.onresumptiontoken})}}});var zT={};Xt(zT,{RelayAuthError:()=>no,resolveRelayToken:()=>RT,resolveRelayUrl:()=>AT,runGoogleRelay:()=>cF,startGoogleRelay:()=>IT});function RT(e={}){let t=e.env??process.env,r=t.GODD_LICENSE_KEY?.trim();if(r)return{value:r,source:"license_key"};let n=e.paths??br(t),o=[];try{o=un(n).map(i=>i.registry_url)}catch{}try{let i=Za(void 0,{env:t,cwd:e.cwd,savedRegistries:o});return{value:xf(i,{paths:n,warn:e.warn}),source:"device_token"}}catch(i){throw i instanceof Ye||i instanceof Error&&i.constructor===Error?new no(i.message):i}}function AT(e=process.env){let t=w_(e);if(!t)return{error:"GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF08http \u306F localhost / 127.0.0.1 / [::1] \u306E\u307F\uFF09\u3002"};let{hostname:r}=new URL(t);return iF.has(r)||r==="ripla.co.jp"||r.endsWith(".ripla.co.jp")?{url:t}:{error:`GODD_GOOGLE_MCP_URL \u306E\u63A5\u7D9A\u5148\uFF08${r}\uFF09\u306B\u306F\u4E2D\u7D99\u3057\u307E\u305B\u3093\u3002\u30ED\u30B0\u30A4\u30F3\u306E\u30C8\u30FC\u30AF\u30F3\u3092\u9001\u308B\u306E\u306F ripla.co.jp\uFF08\u3068\u305D\u306E\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF09\u3068\u3001\u3053\u306E\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u30FC\uFF08localhost / 127.0.0.1 / [::1]\uFF09\u3060\u3051\u3067\u3059\u3002`}}function sF(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"){let{error:r,detail:n}=t;if(typeof r=="string")return r;if(typeof n=="string")return n}}catch{}return e.trim().slice(0,200)}function aF(e,t,r){let n=`ripla-google \u304C\u63A5\u7D9A\u3092\u62D2\u5426\u3057\u307E\u3057\u305F\uFF08HTTP ${e}${t?`: ${t}`:""}\uFF09\u3002`;return r==="device_token"?`${n}godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4E2D\u7D99\u306E\u518D\u8D77\u52D5\u306F\u4E0D\u8981\u3067\u3059\uFF09\u3002`:`${n}GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}async function IT(e){let t=e.log??(u=>console.error(u)),r=e.fetchImpl??fetch,{local:n}=e,o=null,i=u=>o?u.split(o).join("***"):u,s=null,a=u=>{u!==s&&(s=u,t(`${os} ${u}`))},c=async(u,d)=>{let h=e.resolveToken();o=h.value;let m=new Headers(d?.headers);m.set("Authorization",`Bearer ${h.value}`);let g=await r(u,{...d,headers:m});if(g.status===401||g.status===403){let _=sF(await g.text().catch(()=>""));throw new no(i(aF(g.status,_,h.source)))}return g.ok&&(s=null),g},l=new gp(new URL(e.url),{fetch:c}),p=new Set;return l.onmessage=u=>{let d="id"in u?u.id:void 0;if(d!==void 0&&p.has(d)&&(p.delete(d),"result"in u)){let h=u.result.protocolVersion;typeof h=="string"&&l.setProtocolVersion(h)}n.send(u).catch(h=>{t(`${os} IDE \u3078\u306E\u5FDC\u7B54\u306E\u9001\u4FE1\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${h instanceof Error?h.message:String(h)}`)})},l.onerror=u=>{u instanceof no?a(u.message):t(`${os} ripla-google \u3068\u306E\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: ${i(u.message)}`)},n.onmessage=u=>{let d=po(u)?u:null;d?.method==="initialize"&&p.add(d.id),l.send(u).catch(h=>{if(!d)return;p.delete(d.id);let m=h instanceof no?h.message:`ripla-google \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${i(h instanceof Error?h.message:String(h))}`;n.send({jsonrpc:"2.0",id:d.id,error:{code:X.InternalError,message:m}}).catch(()=>{})})},n.onerror=u=>{t(`${os} IDE \u304B\u3089\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8AAD\u3081\u307E\u305B\u3093\u3067\u3057\u305F: ${u.message}`)},await l.start(),await n.start(),{close:async()=>{await l.close().catch(()=>{}),await n.close().catch(()=>{})}}}async function cF(){let e=AT(process.env);"error"in e&&(console.error(`${os} ${e.error}`),process.exit(1));let{url:t}=e,r=new Set,n=a=>{r.has(a)||(r.add(a),console.error(a))},o=()=>RT({warn:n});try{o()}catch(a){if(!(a instanceof no))throw a;console.error(`${os} ${a.message}\uFF08\u30ED\u30B0\u30A4\u30F3\u5F8C\u306B IDE \u3067 MCP \u3092\u518D\u63A5\u7D9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002Claude Code \u306A\u3089 /mcp\uFF09`)}let i=await IT({url:t,local:new di,resolveToken:o}),s=()=>{i.close().finally(()=>process.exit(0))};process.stdin.once("end",s),process.stdin.once("close",s)}var os,no,iF,DT=b(()=>{"use strict";TT();Xd();Tn();Pi();pp();x_();jn();Ua();os="[GoDD google-relay]",no=class extends Error{name="RelayAuthError"};iF=new Set(["localhost","127.0.0.1","[::1]"])});var MT={};Xt(MT,{runInstall:()=>fF});function lF(){if(process.platform==="win32"){let e=process.env.LOCALAPPDATA??(0,oo.join)((0,_p.homedir)(),"AppData","Local");return(0,oo.join)(e,"GoDD")}return(0,oo.join)((0,_p.homedir)(),".godd","bin")}function uF(){return process.platform==="win32"?"godd.exe":"godd"}function jT(e){let t=process.env.PATH??"",r=process.platform==="win32"?";":":";return t.split(r).map(o=>o.replace(/[\\/]+$/,"").toLowerCase()).includes(e.replace(/[\\/]+$/,"").toLowerCase())}function pF(e){if(jT(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,OT.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:
|
|
332
|
-
${e}`)}}function
|
|
326
|
+
`&&n++}}return[t,r]}var mp,bT=b(()=>{mp=class extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}});var gp,xT=b(()=>{bT();gp=class extends TransformStream{constructor({onError:t,onRetry:r,onComment:n}={}){let o;super({start(i){o=wT({onEvent:s=>{i.enqueue(s)},onError(s){t==="terminate"?i.error(s):typeof t=="function"&&t(s)},onRetry:r,onComment:n})},transform(i){o.feed(i)}})}}});var Kq,to,yp,kT=b(()=>{nT();Cn();vT();xT();Kq={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},to=class extends Error{constructor(t,r){super(`Streamable HTTP error: ${r}`),this.code=t}},yp=class{constructor(t,r){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=rT(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??Kq}async _authThenStart(){if(!this._authProvider)throw new kn("No auth provider");let t;try{t=await Xa(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(t!=="AUTHORIZED")throw new kn;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let t={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(t.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=hp(this._requestInit?.headers);return new Headers({...t,...r})}async _startOrAuthSse(t){let{resumptionToken:r}=t;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new to(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,t,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,t),o)}_scheduleReconnection(t,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,r+1)})},o)}_handleSseStream(t,r,n){if(!t)return;let{onresumptiontoken:o,replayMessageId:i}=r,s,a=!1,c=!1;(async()=>{try{let p=t.pipeThrough(new TextDecoderStream).pipeThrough(new gp({onRetry:f=>{this._serverRetryMs=f}})).getReader();for(;;){let{value:f,done:h}=await p.read();if(h)break;if(f.id&&(s=f.id,a=!0,o?.(f.id)),!!f.data&&(!f.event||f.event==="message"))try{let g=ci.parse(JSON.parse(f.data));po(g)&&(c=!0,i!==void 0&&(g.id=i)),this.onmessage?.(g)}catch(g){this.onerror?.(g)}}(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(p){if(this.onerror?.(new Error(`SSE stream disconnected: ${p}`)),(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(f){this.onerror?.(new Error(`Failed to reconnect: ${f instanceof Error?f.message:String(f)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new kn("No auth provider");if(await Xa(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new kn("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:lo(t)?t.id:void 0}).catch(d=>this.onerror?.(d));return}let i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");let s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._url,s),c=a.headers.get("mcp-session-id");if(c&&(this._sessionId=c),!a.ok){let d=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new to(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:f,scope:h}=Fy(a);if(this._resourceMetadataUrl=f,this._scope=h,await Xa(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new kn;return this._hasCompletedAuthFlow=!0,this.send(t)}if(a.status===403&&this._authProvider){let{resourceMetadataUrl:f,scope:h,error:g}=Fy(a);if(g==="insufficient_scope"){let y=a.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===y)throw new to(403,"Server returned 403 after trying upscoping");if(h&&(this._scope=h),f&&(this._resourceMetadataUrl=f),this._lastUpscopingHeader=y??void 0,await Xa(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new kn;return this.send(t)}}throw new to(a.status,`Error POSTing to endpoint: ${d}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,a.status===202){await a.body?.cancel(),r0(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(d=>this.onerror?.(d));return}let p=(Array.isArray(t)?t:[t]).filter(d=>"method"in d&&"id"in d&&d.id!==void 0).length>0,l=a.headers.get("content-type");if(p)if(l?.includes("text/event-stream"))this._handleSseStream(a.body,{onresumptiontoken:o},!1);else if(l?.includes("application/json")){let d=await a.json(),f=Array.isArray(d)?d.map(h=>ci.parse(h)):[ci.parse(d)];for(let h of f)this.onmessage?.(h)}else throw await a.body?.cancel(),new to(-1,`Unexpected content type: ${l}`);else await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let t=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new to(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,r){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:r?.onresumptiontoken})}}});var ET={};Xt(ET,{RelayAuthError:()=>ro,resolveRelayToken:()=>ST,resolveRelayUrl:()=>$T,runGoogleRelay:()=>Xq,startGoogleRelay:()=>PT});function ST(e={}){let t=e.env??process.env,r=t.GODD_LICENSE_KEY?.trim();if(r)return{value:r,source:"license_key"};let n=e.paths??wr(t),o=[];try{o=un(n).map(i=>i.registry_url)}catch{}try{let i=La(void 0,{env:t,cwd:e.cwd,savedRegistries:o});return{value:kf(i,{paths:n,warn:e.warn}),source:"device_token"}}catch(i){throw i instanceof Ke||i instanceof Error&&i.constructor===Error?new ro(i.message):i}}function $T(e=process.env){let t=by(e);if(!t)return{error:"GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF08http \u306F localhost / 127.0.0.1 / [::1] \u306E\u307F\uFF09\u3002"};let{hostname:r}=new URL(t);return Jq.has(r)||r==="ripla.co.jp"||r.endsWith(".ripla.co.jp")?{url:t}:{error:`GODD_GOOGLE_MCP_URL \u306E\u63A5\u7D9A\u5148\uFF08${r}\uFF09\u306B\u306F\u4E2D\u7D99\u3057\u307E\u305B\u3093\u3002\u30ED\u30B0\u30A4\u30F3\u306E\u30C8\u30FC\u30AF\u30F3\u3092\u9001\u308B\u306E\u306F ripla.co.jp\uFF08\u3068\u305D\u306E\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF09\u3068\u3001\u3053\u306E\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u30FC\uFF08localhost / 127.0.0.1 / [::1]\uFF09\u3060\u3051\u3067\u3059\u3002`}}function Yq(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"){let{error:r,detail:n}=t;if(typeof r=="string")return r;if(typeof n=="string")return n}}catch{}return e.trim().slice(0,200)}function Qq(e,t,r){let n=`ripla-google \u304C\u63A5\u7D9A\u3092\u62D2\u5426\u3057\u307E\u3057\u305F\uFF08HTTP ${e}${t?`: ${t}`:""}\uFF09\u3002`;return r==="device_token"?`${n}godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4E2D\u7D99\u306E\u518D\u8D77\u52D5\u306F\u4E0D\u8981\u3067\u3059\uFF09\u3002`:`${n}GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}async function PT(e){let t=e.log??(l=>console.error(l)),r=e.fetchImpl??fetch,{local:n}=e,o=null,i=l=>o?l.split(o).join("***"):l,s=null,a=l=>{l!==s&&(s=l,t(`${ns} ${l}`))},c=async(l,d)=>{let f=e.resolveToken();o=f.value;let h=new Headers(d?.headers);h.set("Authorization",`Bearer ${f.value}`);let g=await r(l,{...d,headers:h});if(g.status===401||g.status===403){let y=Yq(await g.text().catch(()=>""));throw new ro(i(Qq(g.status,y,f.source)))}return g.ok&&(s=null),g},u=new yp(new URL(e.url),{fetch:c}),p=new Set;return u.onmessage=l=>{let d="id"in l?l.id:void 0;if(d!==void 0&&p.has(d)&&(p.delete(d),"result"in l)){let f=l.result.protocolVersion;typeof f=="string"&&u.setProtocolVersion(f)}n.send(l).catch(f=>{t(`${ns} IDE \u3078\u306E\u5FDC\u7B54\u306E\u9001\u4FE1\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${f instanceof Error?f.message:String(f)}`)})},u.onerror=l=>{l instanceof ro?a(l.message):t(`${ns} ripla-google \u3068\u306E\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: ${i(l.message)}`)},n.onmessage=l=>{let d=lo(l)?l:null;d?.method==="initialize"&&p.add(d.id),u.send(l).catch(f=>{if(!d)return;p.delete(d.id);let h=f instanceof ro?f.message:`ripla-google \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${i(f instanceof Error?f.message:String(f))}`;n.send({jsonrpc:"2.0",id:d.id,error:{code:X.InternalError,message:h}}).catch(()=>{})})},n.onerror=l=>{t(`${ns} IDE \u304B\u3089\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8AAD\u3081\u307E\u305B\u3093\u3067\u3057\u305F: ${l.message}`)},await u.start(),await n.start(),{close:async()=>{await u.close().catch(()=>{}),await n.close().catch(()=>{})}}}async function Xq(){let e=$T(process.env);"error"in e&&(console.error(`${ns} ${e.error}`),process.exit(1));let{url:t}=e,r=new Set,n=a=>{r.has(a)||(r.add(a),console.error(a))},o=()=>ST({warn:n});try{o()}catch(a){if(!(a instanceof ro))throw a;console.error(`${ns} ${a.message}\uFF08\u30ED\u30B0\u30A4\u30F3\u5F8C\u306B IDE \u3067 MCP \u3092\u518D\u63A5\u7D9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002Claude Code \u306A\u3089 /mcp\uFF09`)}let i=await PT({url:t,local:new pi,resolveToken:o}),s=()=>{i.close().finally(()=>process.exit(0))};process.stdin.once("end",s),process.stdin.once("close",s)}var ns,ro,Jq,CT=b(()=>{"use strict";kT();ef();Cn();$i();dp();ky();Nn();Za();ns="[GoDD google-relay]",ro=class extends Error{name="RelayAuthError"};Jq=new Set(["localhost","127.0.0.1","[::1]"])});var IT={};Xt(IT,{runInstall:()=>oF});function eF(){if(process.platform==="win32"){let e=process.env.LOCALAPPDATA??(0,no.join)((0,_p.homedir)(),"AppData","Local");return(0,no.join)(e,"GoDD")}return(0,no.join)((0,_p.homedir)(),".godd","bin")}function tF(){return process.platform==="win32"?"godd.exe":"godd"}function RT(e){let t=process.env.PATH??"",r=process.platform==="win32"?";":":";return t.split(r).map(o=>o.replace(/[\\/]+$/,"").toLowerCase()).includes(e.replace(/[\\/]+$/,"").toLowerCase())}function rF(e){if(RT(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,TT.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:
|
|
327
|
+
${e}`)}}function nF(e){if(RT(e)){console.log(" PATH: \u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002");return}let t=`
|
|
333
328
|
# GoDD CLI
|
|
334
329
|
export PATH="${e}:$PATH"
|
|
335
|
-
`,r=(0,_p.homedir)(),n=[],o=(0,
|
|
336
|
-
${
|
|
337
|
-
${
|
|
330
|
+
`,r=(0,_p.homedir)(),n=[],o=(0,no.join)(r,".zshrc"),i=(0,no.join)(r,".bashrc"),s=(0,no.join)(r,".bash_profile");if((0,zr.existsSync)(o)&&n.push(o),(0,zr.existsSync)(i)?n.push(i):(0,zr.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,vp.readFileSync)(a,"utf-8").includes(e)){console.log(` PATH: ${a} \u306B\u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002`);continue}}catch{}(0,vp.appendFileSync)(a,t,"utf-8"),console.log(` PATH: ${a} \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002`)}}async function oF(){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=eF(),t=tF(),r=(0,no.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,zr.existsSync)(e)||((0,zr.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,zr.copyFileSync)(n,r),console.log("\u2713 \u30D0\u30A4\u30CA\u30EA\u3092\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F\u3002"),process.platform!=="win32"&&(0,zr.chmodSync)(r,493)),console.log(""),process.platform==="win32"?rF(e):nF(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=AT.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 zr,no,_p,TT,vp,AT,zT=b(()=>{"use strict";zr=require("node:fs"),no=require("node:path"),_p=require("node:os"),TT=require("node:child_process"),vp=require("node:fs"),AT=ht(require("node:readline"),1)});function cF(e){return!(0,DT.existsSync)((0,OT.join)(e,"node_modules"))}function uF(e,t){cF(e)&&t("pnpm",[...iF],{cwd:e,label:"\u4F9D\u5B58\u95A2\u4FC2\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB"}),t("pnpm",[...sF],{cwd:e,label:"esbuild \u30D3\u30EB\u30C9\u30B9\u30AF\u30EA\u30D7\u30C8\u5B9F\u884C"})}function ec(e,t){uF(e,t),t("pnpm",[...aF],{cwd:e,label:"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9",nonInteractive:!0})}var DT,OT,iF,sF,aF,By=b(()=>{"use strict";DT=require("node:fs"),OT=require("node:path"),iF=["install","--frozen-lockfile","--ignore-scripts"],sF=["rebuild","esbuild"],aF=["exec","vite","build","--logLevel","info"]});function dF(e){let t=e.containerDefinitions;return Array.isArray(t)?{...e,containerDefinitions:t.map(r=>Array.isArray(r.secrets)?{...r,secrets:r.secrets.filter(n=>typeof n.name!="string"||!pF.has(n.name))}:r)}:e}function NT(e,t){let r={...e};for(let o of lF)delete r[o];let n=dF(r);if(t?.image&&Array.isArray(n.containerDefinitions)){let[o,...i]=n.containerDefinitions;o&&(n.containerDefinitions=[{...o,image:t.image},...i])}return n}var lF,pF,jT=b(()=>{"use strict";lF=["taskDefinitionArn","revision","status","requiresAttributes","compatibilities","registeredAt","registeredBy"],pF=new Set(["GITHUB_TOKEN"])});function hF(e){return process.platform!=="win32"?!1:ZT.has((0,tc.extname)(e).toLowerCase())}function yF(e){let t=[],r=!1;for(let n of e){if(r){t.push("***"),r=!1;continue}let o=mF.exec(n);if(o){t.push(`${o[1]}=***`);continue}if(gF.test(n)){t.push(n),r=!0;continue}t.push(n)}return t.join(" ")}function _F(e,t){let r=t.findIndex(o=>MT.test(o));if(r===-1)return;let[n]=MT.exec(t[r])??[];throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5F15\u6570\u306B Windows shell \u4E88\u7D04\u6587\u5B57\uFF08${JSON.stringify(n)}\uFF09\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u305F\u3081\u5B9F\u884C\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\uFF08\u30B3\u30DE\u30F3\u30C9\u30A4\u30F3\u30B8\u30A7\u30AF\u30B7\u30E7\u30F3\u5BFE\u7B56\uFF09: ${e} \u306E\u7B2C${r+1}\u5F15\u6570`)}function wF(e){if(process.platform!=="win32")return e;let t=(0,tc.extname)(e);if(t&&fF.has(t.toLowerCase()))return e;let r=(0,tc.basename)(e).toLowerCase();return vF.has(r)?`${e}.cmd`:e}function je(e,t,r={}){xF(e,t,r)}function bF(e=process.env){return{...e,CI:"true",FORCE_COLOR:"0",npm_config_color:"false"}}function xF(e,t,r={}){let{cwd:n,label:o,env:i,stdin:s="ignore",nonInteractive:a=!1}=r;o&&console.log(` ${o}...`);let c=a?bF(i??process.env):i??process.env,u=wF(e),p=hF(u);p&&_F(u,t);let l=(0,LT.spawnSync)(u,[...t],{cwd:n,stdio:[s,"inherit","inherit"],env:c,windowsHide:!0,shell:p});if(l.error)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u8D77\u52D5\u5931\u6557: ${e}
|
|
331
|
+
${ge(l.error)}`);if(l.status!==0)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5931\u6557 (exit ${l.status}): ${e} ${yF(t)}`)}var LT,tc,ZT,fF,MT,mF,gF,vF,Hy=b(()=>{"use strict";LT=require("node:child_process"),tc=require("node:path");Yt();ZT=new Set([".cmd",".bat"]),fF=new Set([...ZT,".exe"]);MT=/[&|()<>^"%!\r\n]/,mF=/^(--?[\w-]*(?:token|secret|password|apikey|api-key|credential)[\w-]*)=(.+)$/i,gF=/^--?[\w-]*(?:token|secret|password|apikey|api-key|credential)[\w-]*$/i;vF=new Set(["pnpm","npm","npx","yarn","yarnpkg","corepack","vercel","railway"])});var KT={};Xt(KT,{SUPPORTED_DEPLOY_PROVIDERS:()=>VT,assertValidDeployEnv:()=>WT,executeAzureDeploy:()=>OF,executeGcpDeploy:()=>DF,executeVercelRailwayDeploy:()=>NF,extractAzureStorageAccountFromWebEndpoint:()=>HT,extractGcsBucketFromAppUrl:()=>BT,getTerraformDir:()=>wp,parseTerraformOutputValues:()=>bp,resolveDeployProvider:()=>SF});function SF(e){return e&&VT.includes(e)?e:null}function wp(e,t){let r=t.env??"dev",n=t.outputDir??e;return(0,GT.join)(n,"terraform","godd-notes",r)}function bp(e,t){if(!(0,Ky.existsSync)(e))throw new Error(`Terraform \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${e}`);let r;try{r=Wy.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
|
|
332
|
+
${ge(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${r.slice(0,200)}`)}let o=t.filter(s=>!n[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 t)i[s]=n[s].value;return i}function BT(e){return e.match(/^https:\/\/storage\.googleapis\.com\/([^/]+)\//)?.[1]??null}function HT(e){try{let r=new URL(e).hostname.split(".")[0];return r.length>0?r:null}catch{return null}}function Yr(e,t,r){try{Wy.execSync(e,{stdio:"pipe",timeout:kF})}catch{r.push(t)}}function $F(){let e=[];return Yr("gcloud --version","gcloud CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://cloud.google.com/sdk/docs/install",e),Yr("gcloud auth print-access-token","GCP \u8A8D\u8A3C\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002gcloud auth login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e),Yr("docker --version","Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",e),Yr("pnpm --version","pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm",e),{ok:e.length===0,errors:e}}function PF(){let e=[];return Yr("az --version","Azure CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://learn.microsoft.com/cli/azure/install-azure-cli",e),Yr("az account show","Azure \u8A8D\u8A3C\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002az login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e),Yr("docker --version","Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",e),Yr("pnpm --version","pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm",e),{ok:e.length===0,errors:e}}function EF(){let e=[];return Yr("vercel --version","Vercel CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g vercel",e),Yr("railway --version","Railway CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g @railway/cli",e),process.env.VERCEL_TOKEN||e.push("VERCEL_TOKEN \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),process.env.RAILWAY_TOKEN||e.push("RAILWAY_TOKEN \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),{ok:e.length===0,errors:e}}function CF(e){let t=bp(e,["cloud_run_url","notes_app_url","artifact_registry"]),r=BT(t.notes_app_url);if(!r)throw new Error(`notes_app_url \u304B\u3089 GCS \u30D0\u30B1\u30C3\u30C8\u540D\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${t.notes_app_url}`);return{cloud_run_url:t.cloud_run_url,notes_app_url:t.notes_app_url,artifact_registry:t.artifact_registry,gcs_bucket:r}}function TF(e,t){let r=bp(e,["container_app_url","notes_app_url","cdn_endpoint","acr_login_server"]),n=HT(r.notes_app_url);if(!n)throw new Error(`notes_app_url \u304B\u3089 Storage Account \u540D\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${r.notes_app_url}`);return{container_app_url:r.container_app_url,notes_app_url:r.notes_app_url,cdn_endpoint:r.cdn_endpoint,acr_login_server:r.acr_login_server,resource_group:`godd-notes-${t}`,storage_account:n}}function AF(e){let t=bp(e,["vercel_url","vercel_project_id","railway_api_url"]);return{vercel_url:t.vercel_url,vercel_project_id:t.vercel_project_id,railway_api_url:t.railway_api_url}}async function Jy(e,t){if(t)return!0;let r=FT.createInterface({input:process.stdin,output:process.stdout});try{return(await new Promise(o=>{r.question(e,i=>o(i.trim()))})).toLowerCase()==="n"?(console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002"),!1):!0}finally{r.close()}}async function RF(e,t,r){let n=t.region??"asia-northeast1",o=t.projectId;if(!o)throw new Error("GCP \u30C7\u30D7\u30ED\u30A4\u306B\u306F .godd-notes-infra.json \u306E projectId \u304C\u5FC5\u8981\u3067\u3059\u3002");let i=`${e.artifact_registry}/notes-api:latest`;console.log(`
|
|
338
333
|
\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
|
|
339
334
|
\u2551 GoDD Notes \u2014 GCP \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
|
|
340
335
|
\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
|
|
341
|
-
`),console.log(` \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8: ${o}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${n}`),console.log(` Cloud Run: ${
|
|
336
|
+
`),console.log(` \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8: ${o}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${n}`),console.log(` Cloud Run: ${UT}`),console.log(` GCS \u30D0\u30B1\u30C3\u30C8: ${e.gcs_bucket}`),console.log(),console.log("[1/5] Artifact Registry \u7528 Docker \u8A8D\u8A3C..."),je("gcloud",["auth","configure-docker",`${n}-docker.pkg.dev`,"--quiet"]),console.log(" \u2713 \u8A8D\u8A3C\u5B8C\u4E86"),console.log(`
|
|
342
337
|
[2/5] Notes API \u306E Docker \u30A4\u30E1\u30FC\u30B8\u3092\u30D3\u30EB\u30C9...`),je("docker",["build","-t",i,"-f","docker/Dockerfile","."],{cwd:r.apiDir}),console.log(" \u2713 \u30A4\u30E1\u30FC\u30B8\u30D3\u30EB\u30C9\u5B8C\u4E86"),console.log(`
|
|
343
338
|
[3/5] Artifact Registry \u306B\u30D7\u30C3\u30B7\u30E5...`),je("docker",["push",i]),console.log(" \u2713 \u30D7\u30C3\u30B7\u30E5\u5B8C\u4E86"),console.log(`
|
|
344
|
-
[4/5] Cloud Run \u306B\u30C7\u30D7\u30ED\u30A4...`),je("gcloud",["run","deploy",
|
|
345
|
-
[5/5] Notes App \u3092\u30D3\u30EB\u30C9\u3057\u3066 GCS \u306B\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9...`),
|
|
339
|
+
[4/5] Cloud Run \u306B\u30C7\u30D7\u30ED\u30A4...`),je("gcloud",["run","deploy",UT,`--image=${i}`,`--region=${n}`,"--platform=managed",`--project=${o}`,"--allow-unauthenticated"]),console.log(" \u2713 Cloud Run \u30C7\u30D7\u30ED\u30A4\u5B8C\u4E86"),console.log(`
|
|
340
|
+
[5/5] Notes App \u3092\u30D3\u30EB\u30C9\u3057\u3066 GCS \u306B\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9...`),ec(r.appDir,je),je("gsutil",["-m","rsync","-r","-d","dist/",`gs://${e.gcs_bucket}/`],{cwd:r.appDir,label:"GCS \u30A2\u30C3\u30D7\u30ED\u30FC\u30C9"}),console.log(" \u2713 GCS \u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u5B8C\u4E86\uFF08CDN \u306F\u6570\u5206\u3067\u53CD\u6620\u3055\u308C\u307E\u3059\uFF09"),console.log(`
|
|
346
341
|
\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
|
|
347
342
|
\u2551 GoDD Notes \u2014 GCP \u30C7\u30D7\u30ED\u30A4\u5B8C\u4E86 \u2551
|
|
348
343
|
\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
|
|
@@ -351,15 +346,15 @@ ${fe(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
|
|
|
351
346
|
\u2551 Notes API: ${e.cloud_run_url.padEnd(35)}\u2551
|
|
352
347
|
\u2551 \u2551
|
|
353
348
|
\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
|
|
354
|
-
`)}async function
|
|
349
|
+
`)}async function IF(e,t,r){let n=`${e.acr_login_server}/notes-api:latest`;console.log(`
|
|
355
350
|
\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
|
|
356
351
|
\u2551 GoDD Notes \u2014 Azure \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
|
|
357
352
|
\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
|
|
358
|
-
`),console.log(` \u30EA\u30BD\u30FC\u30B9\u30B0\u30EB\u30FC\u30D7: ${e.resource_group}`),console.log(` Container App: ${
|
|
353
|
+
`),console.log(` \u30EA\u30BD\u30FC\u30B9\u30B0\u30EB\u30FC\u30D7: ${e.resource_group}`),console.log(` Container App: ${qT}`),console.log(` Storage Account: ${e.storage_account}`),console.log(),console.log("[1/6] Azure Container Registry \u306B\u30ED\u30B0\u30A4\u30F3...");let o=e.acr_login_server.split(".")[0];je("az",["acr","login","--name",o]),console.log(" \u2713 ACR \u30ED\u30B0\u30A4\u30F3\u5B8C\u4E86"),console.log(`
|
|
359
354
|
[2/6] Notes API \u306E Docker \u30A4\u30E1\u30FC\u30B8\u3092\u30D3\u30EB\u30C9...`),je("docker",["build","-t",n,"-f","docker/Dockerfile","."],{cwd:r.apiDir}),console.log(" \u2713 \u30A4\u30E1\u30FC\u30B8\u30D3\u30EB\u30C9\u5B8C\u4E86"),console.log(`
|
|
360
355
|
[3/6] ACR \u306B\u30D7\u30C3\u30B7\u30E5...`),je("docker",["push",n]),console.log(" \u2713 \u30D7\u30C3\u30B7\u30E5\u5B8C\u4E86"),console.log(`
|
|
361
|
-
[4/6] Container App \u3092\u66F4\u65B0...`),je("az",["containerapp","update","--name",
|
|
362
|
-
[5/6] Notes App \u3092\u30D3\u30EB\u30C9\u3057\u3066 Blob Storage \u306B\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9...`),
|
|
356
|
+
[4/6] Container App \u3092\u66F4\u65B0...`),je("az",["containerapp","update","--name",qT,"--resource-group",e.resource_group,"--image",n]),console.log(" \u2713 Container App \u66F4\u65B0\u5B8C\u4E86"),console.log(`
|
|
357
|
+
[5/6] Notes App \u3092\u30D3\u30EB\u30C9\u3057\u3066 Blob Storage \u306B\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9...`),ec(r.appDir,je),je("az",["storage","blob","upload-batch","--account-name",e.storage_account,"--source","dist/","--destination","$web","--overwrite"],{cwd:r.appDir,label:"Blob Storage \u30A2\u30C3\u30D7\u30ED\u30FC\u30C9"}),console.log(" \u2713 Blob Storage \u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u5B8C\u4E86"),console.log(`
|
|
363
358
|
[6/6] CDN \u30AD\u30E3\u30C3\u30B7\u30E5\u3092\u30D1\u30FC\u30B8...`),je("az",["cdn","endpoint","purge","--resource-group",e.resource_group,"--profile-name","godd-notes-cdn","--name","godd-notes-app","--content-paths","/*"]),console.log(" \u2713 CDN \u30D1\u30FC\u30B8\u5B8C\u4E86"),console.log(`
|
|
364
359
|
\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
|
|
365
360
|
\u2551 GoDD Notes \u2014 Azure \u30C7\u30D7\u30ED\u30A4\u5B8C\u4E86 \u2551
|
|
@@ -370,7 +365,7 @@ ${fe(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
|
|
|
370
365
|
\u2551 CDN: ${e.cdn_endpoint.padEnd(35)}\u2551
|
|
371
366
|
\u2551 \u2551
|
|
372
367
|
\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
|
|
373
|
-
`)}function
|
|
368
|
+
`)}function WT(e){if(e==="dev"||e==="prod")return e;throw new Error(`.godd-notes-infra.json \u306E env \u306F "dev" \u307E\u305F\u306F "prod" \u306E\u307F\u8A31\u53EF\u3055\u308C\u307E\u3059\uFF08\u5B9F\u969B: ${JSON.stringify(e)}\uFF09`)}async function zF(e,t,r){let n=WT(t.env??"dev"),o=process.env.VERCEL_TOKEN??"";console.log(`
|
|
374
369
|
\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
|
|
375
370
|
\u2551 GoDD Notes \u2014 Vercel \xD7 Railway \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
|
|
376
371
|
\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
|
|
@@ -384,47 +379,47 @@ ${fe(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
|
|
|
384
379
|
\u2551 Notes API: ${e.railway_api_url.padEnd(35)}\u2551
|
|
385
380
|
\u2551 \u2551
|
|
386
381
|
\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
|
|
387
|
-
`)}async function
|
|
388
|
-
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o
|
|
382
|
+
`)}async function DF(e,t,r,n){console.log(`
|
|
383
|
+
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=$F();if(!o.ok){console.error(`
|
|
389
384
|
\u30A8\u30E9\u30FC: GCP \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let a of o.errors)console.error(` - ${a}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
|
|
390
|
-
`);let i=
|
|
391
|
-
`),console.log("--- GCP \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` Cloud Run: ${s.cloud_run_url}`),console.log(` GCS: ${s.gcs_bucket}`),console.log(` App URL: ${s.notes_app_url}`),await
|
|
392
|
-
\u3053\u306E\u8A2D\u5B9A\u3067 GCP \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await
|
|
393
|
-
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=
|
|
385
|
+
`);let i=wp(t,e);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${i})`);let s=CF(i);console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
|
|
386
|
+
`),console.log("--- GCP \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` Cloud Run: ${s.cloud_run_url}`),console.log(` GCS: ${s.gcs_bucket}`),console.log(` App URL: ${s.notes_app_url}`),await Jy(`
|
|
387
|
+
\u3053\u306E\u8A2D\u5B9A\u3067 GCP \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await RF(s,e,r)}async function OF(e,t,r,n){console.log(`
|
|
388
|
+
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=PF();if(!o.ok){console.error(`
|
|
394
389
|
\u30A8\u30E9\u30FC: Azure \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let c of o.errors)console.error(` - ${c}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
|
|
395
|
-
`);let i=e.env??"dev",s=
|
|
396
|
-
`),console.log("--- Azure \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` Container App: ${a.container_app_url}`),console.log(` Storage: ${a.storage_account}`),console.log(` App URL: ${a.notes_app_url}`),await
|
|
397
|
-
\u3053\u306E\u8A2D\u5B9A\u3067 Azure \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await
|
|
398
|
-
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=
|
|
390
|
+
`);let i=e.env??"dev",s=wp(t,e);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${s})`);let a=TF(s,i);console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
|
|
391
|
+
`),console.log("--- Azure \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` Container App: ${a.container_app_url}`),console.log(` Storage: ${a.storage_account}`),console.log(` App URL: ${a.notes_app_url}`),await Jy(`
|
|
392
|
+
\u3053\u306E\u8A2D\u5B9A\u3067 Azure \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await IF(a,e,r)}async function NF(e,t,r,n){console.log(`
|
|
393
|
+
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=EF();if(!o.ok){console.error(`
|
|
399
394
|
\u30A8\u30E9\u30FC: Vercel \xD7 Railway \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let a of o.errors)console.error(` - ${a}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
|
|
400
|
-
`);let i=
|
|
395
|
+
`);let i=wp(t,e),s;(0,Ky.existsSync)(i)?(console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${i})`),s=AF(i),console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
|
|
401
396
|
`)):(s={vercel_url:"(vercel deploy \u5F8C\u306B\u78BA\u5B9A)",vercel_project_id:process.env.VERCEL_PROJECT_ID??"(\u672A\u8A2D\u5B9A)",railway_api_url:e.railwayApiUrl??"(Railway \u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u3067\u78BA\u8A8D)"},console.log(` \u2139 Terraform output \u306A\u3057 \u2014 CLI \u30C7\u30D7\u30ED\u30A4\u306E\u307F\u5B9F\u884C\u3057\u307E\u3059
|
|
402
|
-
`)),console.log("--- Vercel \xD7 Railway \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` Vercel: ${s.vercel_url}`),console.log(` Railway: ${s.railway_api_url}`),await
|
|
403
|
-
\u3053\u306E\u8A2D\u5B9A\u3067 Vercel \xD7 Railway \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await
|
|
404
|
-
\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,G.join)(e,"notes-api"),exclude:
|
|
405
|
-
[\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,
|
|
406
|
-
`,"utf-8")}async function
|
|
407
|
-
--- \u30AF\u30E9\u30A6\u30C9\u30D7\u30ED\u30D0\u30A4\u30C0\u9078\u629E ---`);let r=Object.entries(
|
|
408
|
-
\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
|
|
397
|
+
`)),console.log("--- Vercel \xD7 Railway \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` Vercel: ${s.vercel_url}`),console.log(` Railway: ${s.railway_api_url}`),await Jy(`
|
|
398
|
+
\u3053\u306E\u8A2D\u5B9A\u3067 Vercel \xD7 Railway \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await zF(s,e,r)}var Wy,FT,Ky,GT,kF,UT,qT,VT,JT=b(()=>{"use strict";Wy=ht(require("node:child_process"),1),FT=ht(require("node:readline"),1),Ky=require("node:fs"),GT=require("node:path");Yt();By();Hy();kF=1e4,UT="godd-notes-api",qT="godd-notes-api",VT=["aws","gcp","azure","vercel-railway"]});var lA={};Xt(lA,{PROVIDER_LABELS:()=>xp,formatAwsProfileExportLines:()=>uA,runNotesInfra:()=>XF,saveProjectConfig:()=>cA,scaffoldNotesApplicationSources:()=>sA,shouldExcludeNotesSourceEntry:()=>oA,validateSavedInfraConfig:()=>nA});function nA(e){if(!e)return{ok:!1,error:`${wn} \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002--yes \u306B\u306F\u4FDD\u5B58\u6E08\u307F\u8A2D\u5B9A\u304C\u5FC5\u8981\u3067\u3059\u3002\u307E\u305A\u5BFE\u8A71\u30E2\u30FC\u30C9\u3067 godd notes infra \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`};let t=e.provider;if(!t||!(t in xp))return{ok:!1,error:`${wn} \u306E provider \u304C\u4E0D\u6B63\u3067\u3059: ${String(t)}`};let r=e,o=[...jF,...MF[t]].filter(i=>{let s=r[i];return typeof s=="string"?s==="":typeof s=="number"?!Number.isFinite(s):s==null});return o.length>0?{ok:!1,error:`${wn} \u306B\u5FC5\u9808\u30AD\u30FC\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u307E\u3059: ${o.join(", ")}\u3002\u5BFE\u8A71\u30E2\u30FC\u30C9\u3067 godd notes infra \u3092\u518D\u5B9F\u884C\u3057\u3066\u8A2D\u5B9A\u3092\u4FDD\u5B58\u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}:{ok:!0,config:e}}function LF(){return eA.createInterface({input:process.stdin,output:process.stdout})}function ne(e,t){return new Promise(r=>{e.question(t,n=>r(n.trim()))})}function ZF(){try{return(0,G.dirname)((0,tA.fileURLToPath)(__goddBundleUrl))}catch{return(0,G.dirname)(process.execPath)}}function UF(e){let t=ZF(),r=[(0,G.resolve)(t,".."),(0,G.resolve)(t,"..","..")];for(let n of r){let o=(0,G.join)(n,"templates","terraform",e),i=(0,G.join)(n,"templates","github-actions",e);if((0,K.existsSync)(o)&&(0,K.existsSync)(i))return{terraformDir:o,ghaDir:i}}return null}function oA(e,t){return e===".env"||e.startsWith(".env.")&&e!==".env.example"||e.endsWith(".pyc")||e.endsWith(".tsbuildinfo")?!0:qF.has(e)||t.has(e)}function iA(e,t,r){(0,K.mkdirSync)(t,{recursive:!0});for(let n of(0,K.readdirSync)(e)){if(oA(n,r))continue;let o=(0,G.join)(e,n),i=(0,G.join)(t,n);(0,K.statSync)(o).isDirectory()?iA(o,i,r):(0,K.copyFileSync)(o,i)}}function sA(e){let t=Yl();if(!t)return console.warn(`
|
|
399
|
+
\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,G.join)(e,"notes-api"),exclude:GF},{label:"notes-app",src:t.appDir,dest:(0,G.join)(e,"notes-app"),exclude:FF}];console.log(`
|
|
400
|
+
[\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,K.existsSync)(o.dest)?"\u66F4\u65B0":"\u914D\u7F6E";iA(o.src,o.dest,o.exclude),r.push(o.label),console.log(` \u2713 ${o.label}/ \u3092${i}`)}return r}function aA(e){return Ql(e)}function cA(e){let t=(0,G.join)(e.outputDir,wn),r={...e,outputDir:"."};(0,K.writeFileSync)(t,JSON.stringify(r,null,2)+`
|
|
401
|
+
`,"utf-8")}async function VF(e,t){console.log(`
|
|
402
|
+
--- \u30AF\u30E9\u30A6\u30C9\u30D7\u30ED\u30D0\u30A4\u30C0\u9078\u629E ---`);let r=Object.entries(xp);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,`
|
|
403
|
+
\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 BF(e,t){console.log(`
|
|
409
404
|
--- 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(`
|
|
410
405
|
--- 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(`
|
|
411
406
|
--- \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(`
|
|
412
|
-
--- \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",
|
|
413
|
-
--- \u51FA\u529B\u5148 ---`);let
|
|
407
|
+
--- \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(`
|
|
408
|
+
--- \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,G.resolve)(l)}}async function HF(e,t){console.log(`
|
|
414
409
|
--- 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(`
|
|
415
410
|
--- 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(`
|
|
416
411
|
--- \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(`
|
|
417
|
-
--- \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",
|
|
418
|
-
--- \u51FA\u529B\u5148 ---`);let
|
|
412
|
+
--- \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(`
|
|
413
|
+
--- \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,G.resolve)(l)}}async function WF(e,t){console.log(`
|
|
419
414
|
--- 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(`
|
|
420
415
|
--- 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(`
|
|
421
416
|
--- \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(`
|
|
422
|
-
--- \u30EA\u30BD\u30FC\u30B9\u30B5\u30A4\u30BA ---`);let c=await ne(e,`PostgreSQL SKU [${t.dbSku??"B_Standard_B1ms"}]: `)||t.dbSku||"B_Standard_B1ms",
|
|
423
|
-
--- \u51FA\u529B\u5148 ---`);let
|
|
417
|
+
--- \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(`
|
|
418
|
+
--- \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,G.resolve)(l)}}async function KF(e,t){console.log(`
|
|
424
419
|
--- Vercel + Railway \u8A2D\u5B9A ---`);let r=await ne(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
|
|
425
420
|
--- 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(`
|
|
426
421
|
--- 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(`
|
|
427
|
-
--- \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,G.resolve)(s)}}async function
|
|
422
|
+
--- \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,G.resolve)(s)}}async function JF(e){console.log(`
|
|
428
423
|
\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
|
|
429
424
|
\u2551 GoDD Notes \u30A4\u30F3\u30D5\u30E9\u69CB\u7BC9\u30A6\u30A3\u30B6\u30FC\u30C9 \u2551
|
|
430
425
|
\u2551 \u30A2\u30D7\u30EA + Terraform + GitHub Actions \u81EA\u52D5\u751F\u6210 \u2551
|
|
@@ -432,17 +427,17 @@ ${fe(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
|
|
|
432
427
|
\u2551 \u5BFE\u5FDC\u30D7\u30ED\u30D0\u30A4\u30C0: \u2551
|
|
433
428
|
\u2551 AWS / GCP / Azure / Vercel\xD7Railway \u2551
|
|
434
429
|
\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
|
|
435
|
-
`);let t=
|
|
436
|
-
--- \u8A2D\u5B9A\u306E\u78BA\u8A8D ---`),console.log(` \u30D7\u30ED\u30D0\u30A4\u30C0: ${
|
|
437
|
-
\u2713 \u8A2D\u5B9A\u3092 ${(0,G.join)(e.outputDir,
|
|
438
|
-
[1/${
|
|
439
|
-
[2/${
|
|
440
|
-
[3/${
|
|
441
|
-
[4/${
|
|
442
|
-
\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: `+
|
|
443
|
-
\u26A0 \u30B9\u30AD\u30C3\u30D7\u3055\u308C\u305F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 (${
|
|
444
|
-
[1/2] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let c of s){let
|
|
445
|
-
[2/2] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${i}`);let a=(0,
|
|
430
|
+
`);let t=aA(process.cwd());switch(await VF(e,t?.provider)){case"aws":return BF(e,t??{});case"gcp":return HF(e,t??{});case"azure":return WF(e,t??{});case"vercel-railway":return KF(e,t??{})}}function Sn(e,t){let r;try{r=(0,K.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 ${ge(n)}`,{cause:n})}try{return rA.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 ${ge(n)}`,{cause:n})}}function YT(e){switch(console.log(`
|
|
431
|
+
--- \u8A2D\u5B9A\u306E\u78BA\u8A8D ---`),console.log(` \u30D7\u30ED\u30D0\u30A4\u30C0: ${xp[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 QT(e){let t=UF(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"?YF(r,n,e,o):QF(r,n,e,o),sA(e.outputDir),cA(e),console.log(`
|
|
432
|
+
\u2713 \u8A2D\u5B9A\u3092 ${(0,G.join)(e.outputDir,wn)} \u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F`)}function YF(e,t,r,n){let o=(0,G.join)(r.outputDir,"terraform","godd-notes",r.env),i=(0,G.join)(r.outputDir,"terraform","godd-notes",`${r.env}-iam`),s=(0,G.join)(r.outputDir,".github","workflows");(0,K.mkdirSync)(o,{recursive:!0}),(0,K.mkdirSync)(i,{recursive:!0}),(0,K.mkdirSync)(s,{recursive:!0});let a=(0,K.readdirSync)(e).filter(x=>x.endsWith(".tf.hbs")),c=["iam.tf.hbs"],u=a.filter(x=>!c.includes(x)),p=(0,G.resolve)(e,"..","..","scripts","aws"),l=(0,G.join)(p,"terraform-backend-setup.sh.hbs"),d=(0,K.existsSync)(l),f=d?4:3,h=[];console.log(`
|
|
433
|
+
[1/${f}] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let x of u){let k=x.replace(".hbs",""),P=Sn((0,G.join)(e,x),n);(0,K.writeFileSync)((0,G.join)(o,k),P,"utf-8"),console.log(` \u2713 ${k}`)}console.log(`
|
|
434
|
+
[2/${f}] IAM Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${i}`);for(let x of c){let k=x.replace(".hbs",""),P=Sn((0,G.join)(e,x),n);(0,K.writeFileSync)((0,G.join)(i,k),P,"utf-8"),console.log(` \u2713 ${k}`)}let g=(0,G.join)(e,"local.tf.hbs");if((0,K.existsSync)(g)){let x=Sn(g,n);(0,K.writeFileSync)((0,G.join)(i,"local.tf"),x,"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,G.join)(e,"provider.tf.hbs");if((0,K.existsSync)(y)){let x=Sn(y,n);(0,K.writeFileSync)((0,G.join)(i,"provider.tf"),x,"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 v=(0,G.join)(e,"backend.tf.hbs");if((0,K.existsSync)(v)){let x=Sn(v,{...n,env:`${r.env}-iam`});(0,K.writeFileSync)((0,G.join)(i,"backend.tf"),x,"utf-8"),console.log(" \u2713 backend.tf")}else console.warn(` \u26A0 backend.tf.hbs \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${v}`),h.push("backend.tf.hbs");console.log(`
|
|
435
|
+
[3/${f}] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${s}`);let w=(0,K.readdirSync)(t).filter(x=>x.endsWith(".yml.hbs"));for(let x of w){let k=x.replace(".hbs",""),P=Sn((0,G.join)(t,x),n);(0,K.writeFileSync)((0,G.join)(s,k),P,"utf-8"),console.log(` \u2713 ${k}`)}if(d){let x=(0,G.join)(r.outputDir,"scripts");(0,K.mkdirSync)(x,{recursive:!0}),console.log(`
|
|
436
|
+
[4/${f}] \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u751F\u6210: ${x}`);let k=Sn(l,n),P=(0,G.join)(x,"terraform-backend-setup.sh");(0,K.writeFileSync)(P,k,"utf-8");try{(0,K.chmodSync)(P,493)}catch{}console.log(" \u2713 terraform-backend-setup.sh")}else console.warn(`
|
|
437
|
+
\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(`
|
|
438
|
+
\u26A0 \u30B9\u30AD\u30C3\u30D7\u3055\u308C\u305F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 (${h.length} \u4EF6):`);for(let x of h)console.warn(` - ${x}`)}}function QF(e,t,r,n){let o=(0,G.join)(r.outputDir,"terraform","godd-notes",r.env),i=(0,G.join)(r.outputDir,".github","workflows");(0,K.mkdirSync)(o,{recursive:!0}),(0,K.mkdirSync)(i,{recursive:!0});let s=(0,K.readdirSync)(e).filter(c=>c.endsWith(".tf.hbs"));console.log(`
|
|
439
|
+
[1/2] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let c of s){let u=c.replace(".hbs",""),p=Sn((0,G.join)(e,c),n);(0,K.writeFileSync)((0,G.join)(o,u),p,"utf-8"),console.log(` \u2713 ${u}`)}console.log(`
|
|
440
|
+
[2/2] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${i}`);let a=(0,K.readdirSync)(t).filter(c=>c.endsWith(".yml.hbs"));for(let c of a){let u=c.replace(".hbs",""),p=Sn((0,G.join)(t,c),n);(0,K.writeFileSync)((0,G.join)(i,u),p,"utf-8"),console.log(` \u2713 ${u}`)}}function uA(){return["export AWS_PROFILE=<PROFILE>",'$env:AWS_PROFILE="<PROFILE>"']}function XT(e){let[t,r]=uA();switch(e.provider){case"aws":console.log(`
|
|
446
441
|
\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
|
|
447
442
|
\u2551 AWS \u30A4\u30F3\u30D5\u30E9\u30D5\u30A1\u30A4\u30EB\u751F\u6210\u5B8C\u4E86 \u2551
|
|
448
443
|
\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
|
|
@@ -553,7 +548,7 @@ ${fe(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
|
|
|
553
548
|
\u2551 godd notes deploy -y \u2551
|
|
554
549
|
\u2551 \u2551
|
|
555
550
|
\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
|
|
556
|
-
`);break}}async function
|
|
551
|
+
`);break}}async function XF(e){if(e.includes("--help")||e.includes("-h")){console.log(`
|
|
557
552
|
GoDD Notes Infra \u2014 \u30A2\u30D7\u30EA + \u30DE\u30EB\u30C1\u30AF\u30E9\u30A6\u30C9 \u30A4\u30F3\u30D5\u30E9\u81EA\u52D5\u751F\u6210
|
|
558
553
|
|
|
559
554
|
Usage: godd notes infra [options]
|
|
@@ -572,17 +567,17 @@ Options:
|
|
|
572
567
|
--yes, -y \u4FDD\u5B58\u6E08\u307F\u8A2D\u5B9A (.godd-notes-infra.json) \u3092\u5168\u9762\u63A1\u7528\u3057\u3066
|
|
573
568
|
\u975E\u5BFE\u8A71\u3067\u30D5\u30A1\u30A4\u30EB\u751F\u6210\u3059\u308B\uFF08CI / AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u5411\u3051\uFF09
|
|
574
569
|
--help, -h \u3053\u306E\u30D8\u30EB\u30D7\u3092\u8868\u793A
|
|
575
|
-
`);return}if(e.includes("--yes")||e.includes("-y")){let r=
|
|
576
|
-
\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}
|
|
577
|
-
${
|
|
570
|
+
`);return}if(e.includes("--yes")||e.includes("-y")){let r=aA(process.cwd()),n=nA(r);n.ok||(console.error(`\u30A8\u30E9\u30FC: ${n.error}`),process.exit(1)),console.log(`--yes: \u4FDD\u5B58\u6E08\u307F\u8A2D\u5B9A (${wn}) \u3092\u4F7F\u7528\u3057\u3066\u975E\u5BFE\u8A71\u3067\u751F\u6210\u3057\u307E\u3059\u3002`),YT(n.config),QT(n.config),XT(n.config);return}process.stdin.isTTY||console.warn("\u26A0 \u975E\u5BFE\u8A71\u74B0\u5883\uFF08stdin \u304C TTY \u3067\u306F\u306A\u3044\uFF09\u3092\u691C\u51FA\u3057\u307E\u3057\u305F\u3002\u30D1\u30A4\u30D7\u5165\u529B\u306F\u53D6\u308A\u3053\u307C\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002CI / AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304B\u3089\u306E\u5B9F\u884C\u306B\u306F --yes \u3092\u63A8\u5968\u3057\u307E\u3059\u3002");let t=LF();try{let r=await JF(t);if(YT(r),(await ne(t,`
|
|
571
|
+
\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}QT(r),XT(r)}finally{t.close()}}var eA,K,G,tA,rA,xp,jF,MF,qF,FF,GF,pA=b(()=>{"use strict";eA=ht(require("node:readline"),1),K=require("node:fs"),G=require("node:path"),tA=require("node:url"),rA=ht(Kl(),1);Yt();Xl();xp={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)"},jF=["env","githubOwner","githubRepo","outputDir"],MF={aws:["accountId","region","vpcCidr","rdsInstanceClass","ecsCpu","ecsMemory"],gcp:["projectId","region","vpcCidr","dbTier","cpuLimit","memoryLimit"],azure:["subscriptionId","region","vpcCidr","dbSku","cpuLimit","memoryLimit"],"vercel-railway":["railwayApiUrl"]};qF=new Set([".git","coverage","dist","node_modules"]),FF=new Set(["playwright-report","test-results"]),GF=new Set([".pytest_cache",".ruff_cache",".venv","__pycache__"])});var TA={};Xt(TA,{checkAwsPrerequisites:()=>vA,checkDocker:()=>Qy,ensureNotesComposeGitignoreEntries:()=>PA,generateEnvFile:()=>bA,generateSecret:()=>Qr,getTerraformOutputs:()=>Sp,hasGithubReadAuth:()=>eG,loadComposeConfig:()=>$A,loadInfraConfig:()=>Xy,parseDeployFlags:()=>kA,resolveComposeDeployDir:()=>SA,runNotes:()=>dG,saveComposeConfig:()=>CA,toComposeEnvValue:()=>wA});function yA(){return mA.createInterface({input:process.stdin,output:process.stdout})}function Vt(e,t){return new Promise(r=>{e.question(t,n=>r(n.trim()))})}function Qr(e=48){return gA.randomBytes(e).toString("base64url").slice(0,e)}function _A(e){return!!(e.githubAppId&&e.githubAppPrivateKey&&e.githubAppInstallationId)}function eG(e){return _A(e)}async function rc(e,t,r){for(;;){let n=await Vt(e,t);if(n)return n;console.log(r)}}function Qy(){try{return nt.execSync("docker --version",{stdio:"ignore",timeout:os}),nt.execSync("docker compose version",{stdio:"ignore",timeout:os}),!0}catch{return!1}}function Yy(e,t){(0,Oe.mkdirSync)(t,{recursive:!0});for(let r of(0,Oe.readdirSync)(e)){if(tG.has(r)||r.endsWith(".pyc")||r.endsWith(".tsbuildinfo"))continue;let n=(0,_e.join)(e,r),o=(0,_e.join)(t,r);(0,Oe.statSync)(n).isDirectory()?Yy(n,o):(0,Oe.copyFileSync)(n,o)}}function rG(e,t){return new Promise((r,n)=>{let o=nt.spawn("docker",["compose",...t],{cwd:e,stdio:"inherit"});o.on("error",i=>n(i)),o.on("close",i=>r(i??1))})}async function dA(e){return new Promise(t=>{let r=$p.get(e,{timeout:3e3},n=>{let o="";n.on("data",i=>{o+=i.toString("utf-8")}),n.on("end",()=>{if(n.statusCode!==200){t(null);return}try{t(JSON.parse(o))}catch{t(null)}})});r.on("error",()=>t(null)),r.on("timeout",()=>{r.destroy(),t(null)})})}async function fA(e){let r=`${e.replace(/\/api\/health\/?$/,"")}/api/health/github-app`;return new Promise(n=>{let o=$p.get(r,{timeout:1e4},i=>{i.resume(),n(i.statusCode===200)});o.on("error",()=>n(!1)),o.on("timeout",()=>{o.destroy(),n(!1)})})}function hA(e,t,r){if(console.log(` ${e}:`),!t){console.log(" \u2717 \u5FDC\u7B54\u306A\u3057");return}console.log(` status: ${t.status}`),console.log(` github_app_configured: ${t.github_app_configured?"yes":"no"}`),console.log(` github_write_author: ${t.github_write_author??"unknown"}`),t.github_write_author==="bot"?r===!0?console.log(" installation token refresh: \u2713 OK"):r===!1&&console.log(" installation token refresh: \u2717 \u5931\u6557\uFF08credentials \u307E\u305F\u306F Installation ID \u3092\u78BA\u8A8D\uFF09"):(console.log(" \u26A0 \u30E2\u30C3\u30AF\u30E2\u30FC\u30C9\uFF08GitHub App \u672A\u8A2D\u5B9A\uFF09\u3002PAT \u306F\u7981\u6B62\u3067\u3059\u3002GitHub App 3\u5909\u6570\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),console.log(" \u624B\u9806: docs/007_guides/bot-token-setup.md"))}async function nG(e,t=12e4){let r=Date.now(),n=3e3;for(;Date.now()-r<t;){if(await new Promise(i=>{let s=$p.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 Xy(e){return Ql(e)}function Sp(e){if(!(0,Oe.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=nt.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
|
|
572
|
+
${ge(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 vA(){let e=[];try{nt.execSync("aws --version",{stdio:"pipe",timeout:os})}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{nt.execSync("aws sts get-caller-identity",{stdio:"pipe",timeout:os})}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{nt.execSync("docker --version",{stdio:"pipe",timeout:os})}catch{e.push("Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002")}try{nt.execSync("pnpm --version",{stdio:"pipe",timeout:os})}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}}async function oG(e,t,r){let n=t.region??"ap-northeast-1",i=`${t.accountId??""}.dkr.ecr.${n}.amazonaws.com`;console.log(`
|
|
578
573
|
\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
|
|
579
574
|
\u2551 GoDD Notes \u2014 AWS \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
|
|
580
575
|
\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
|
|
581
576
|
`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${n}`),console.log(` ECR: ${e.ecr_repository_url}`),console.log(` ECS \u30AF\u30E9\u30B9\u30BF: ${e.ecs_cluster_name}`),console.log(` S3 \u30D0\u30B1\u30C3\u30C8: ${e.s3_bucket_name}`),console.log(` CloudFront: ${e.cloudfront_distribution_id}`),console.log(),console.log("[1/6] ECR \u306B\u30ED\u30B0\u30A4\u30F3...");{let a=nt.spawnSync("aws",["ecr","get-login-password","--region",n],{encoding:"utf-8"});if(a.status!==0||!a.stdout)throw new Error(`ECR \u30ED\u30B0\u30A4\u30F3\u30D1\u30B9\u30EF\u30FC\u30C9\u53D6\u5F97\u5931\u6557: ${a.stderr??""}`);if(nt.spawnSync("docker",["login","--username","AWS","--password-stdin",i],{input:a.stdout,stdio:["pipe","inherit","inherit"]}).status!==0)throw new Error("docker login \u5931\u6557")}console.log(" \u2713 ECR \u30ED\u30B0\u30A4\u30F3\u5B8C\u4E86"),console.log(`
|
|
582
577
|
[2/6] Notes API \u306E Docker \u30A4\u30E1\u30FC\u30B8\u3092\u30D3\u30EB\u30C9...`);let s=`${e.ecr_repository_url}:latest`;je("docker",["build","--platform","linux/arm64","-t",s,"-f","docker/Dockerfile","."],{cwd:r.apiDir}),console.log(" \u2713 \u30A4\u30E1\u30FC\u30B8\u30D3\u30EB\u30C9\u5B8C\u4E86"),console.log(`
|
|
583
578
|
[3/6] ECR \u306B\u30D7\u30C3\u30B7\u30E5...`),je("docker",["push",s]),console.log(" \u2713 ECR \u30D7\u30C3\u30B7\u30E5\u5B8C\u4E86"),console.log(`
|
|
584
|
-
[4/6] ECS \u30BF\u30B9\u30AF\u5B9A\u7FA9\u3092\u66F4\u65B0\u3057\u3066\u30B5\u30FC\u30D3\u30B9\u3092\u30C7\u30D7\u30ED\u30A4...`);{let a=nt.spawnSync("aws",["ecs","describe-services","--cluster",e.ecs_cluster_name,"--services",e.ecs_service_name,"--region",n,"--query","services[0].taskDefinition","--output","text"],{encoding:"utf-8"});if(a.status!==0||!a.stdout?.trim())throw new Error(`ECS \u30B5\u30FC\u30D3\u30B9\u53D6\u5F97\u5931\u6557: ${a.stderr??a.stdout??""}`);let c=a.stdout.trim(),
|
|
585
|
-
[5/6] Notes App \u3092\u30D3\u30EB\u30C9\u3057\u3066 S3 \u306B\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9...`),
|
|
579
|
+
[4/6] ECS \u30BF\u30B9\u30AF\u5B9A\u7FA9\u3092\u66F4\u65B0\u3057\u3066\u30B5\u30FC\u30D3\u30B9\u3092\u30C7\u30D7\u30ED\u30A4...`);{let a=nt.spawnSync("aws",["ecs","describe-services","--cluster",e.ecs_cluster_name,"--services",e.ecs_service_name,"--region",n,"--query","services[0].taskDefinition","--output","text"],{encoding:"utf-8"});if(a.status!==0||!a.stdout?.trim())throw new Error(`ECS \u30B5\u30FC\u30D3\u30B9\u53D6\u5F97\u5931\u6557: ${a.stderr??a.stdout??""}`);let c=a.stdout.trim(),u=nt.spawnSync("aws",["ecs","describe-task-definition","--task-definition",c,"--region",n,"--query","taskDefinition","--output","json"],{encoding:"utf-8"});if(u.status!==0||!u.stdout?.trim())throw new Error(`ECS \u30BF\u30B9\u30AF\u5B9A\u7FA9\u53D6\u5F97\u5931\u6557: ${u.stderr??u.stdout??""}`);let p;try{p=JSON.parse(u.stdout)}catch(h){throw new Error(`ECS \u30BF\u30B9\u30AF\u5B9A\u7FA9 JSON \u306E\u89E3\u6790\u306B\u5931\u6557: ${ge(h)}`)}if(!p||typeof p!="object")throw new Error("ECS \u30BF\u30B9\u30AF\u5B9A\u7FA9\u306E\u5F62\u5F0F\u304C\u4E0D\u6B63\u3067\u3059");let l=NT(p,{image:s}),d=nt.spawnSync("aws",["ecs","register-task-definition","--cli-input-json",JSON.stringify(l),"--region",n,"--query","taskDefinition.taskDefinitionArn","--output","text"],{encoding:"utf-8"});if(d.status!==0||!d.stdout?.trim())throw new Error(`ECS \u30BF\u30B9\u30AF\u5B9A\u7FA9\u767B\u9332\u5931\u6557: ${d.stderr??d.stdout??""}`);let f=d.stdout.trim();je("aws",["ecs","update-service","--cluster",e.ecs_cluster_name,"--service",e.ecs_service_name,"--task-definition",f,"--force-new-deployment","--region",n])}console.log(" \u2713 ECS \u30C7\u30D7\u30ED\u30A4\u958B\u59CB\uFF08\u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u3067\u5B89\u5B9A\u5316\u5F85\u3061\uFF09"),console.log(`
|
|
580
|
+
[5/6] Notes App \u3092\u30D3\u30EB\u30C9\u3057\u3066 S3 \u306B\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9...`),ec(r.appDir,je),je("aws",["s3","sync","dist/",`s3://${e.s3_bucket_name}`,"--delete","--region",n],{cwd:r.appDir,label:"S3 \u30A2\u30C3\u30D7\u30ED\u30FC\u30C9"}),console.log(" \u2713 S3 \u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u5B8C\u4E86"),console.log(`
|
|
586
581
|
[6/6] CloudFront \u30AD\u30E3\u30C3\u30B7\u30E5\u3092\u7121\u52B9\u5316...`),je("aws",["cloudfront","create-invalidation","--distribution-id",e.cloudfront_distribution_id,"--paths","/*"]),console.log(" \u2713 CloudFront \u7121\u52B9\u5316\u30EA\u30AF\u30A8\u30B9\u30C8\u9001\u4FE1"),console.log(`
|
|
587
582
|
\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
|
|
588
583
|
\u2551 GoDD Notes \u2014 AWS \u30C7\u30D7\u30ED\u30A4\u5B8C\u4E86 \u2551
|
|
@@ -598,31 +593,31 @@ ${fe(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u3
|
|
|
598
593
|
\u2551 --services ${e.ecs_service_name.padEnd(32)}\u2551
|
|
599
594
|
\u2551 \u2551
|
|
600
595
|
\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
|
|
601
|
-
`)}async function
|
|
596
|
+
`)}async function iG(e){console.log(`
|
|
602
597
|
\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
|
|
603
598
|
\u2551 GoDD Notes \u30C7\u30D7\u30ED\u30A4\u30A6\u30A3\u30B6\u30FC\u30C9 \u2551
|
|
604
599
|
\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
|
|
605
|
-
`);let t=await
|
|
606
|
-
--- PostgreSQL \u8A2D\u5B9A ---`);let r=await
|
|
607
|
-
--- \u30DD\u30FC\u30C8\u8A2D\u5B9A ---`);let s=await
|
|
608
|
-
--- GitHub \u9023\u643A ---`),console.log(" PR / Issue \u4F5C\u6210\u306B\u306F GitHub App \u8A2D\u5B9A\u304C\u5FC5\u9808\u3067\u3059\uFF08Bot author\uFF09\u3002"),console.log(" \u624B\u9806: docs/007_guides/bot-token-setup.md \u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),console.log(" Private Key \u306F1\u884C\u5165\u529B\u3067\u3059\u3002\u8907\u6570\u884C PEM \u306F \\n \u306B\u7F6E\u63DB\u3057\u3066\u8CBC\u308B\u304B\u3001--auto / --config \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002");let c=await
|
|
609
|
-
--- \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3 ---`);let
|
|
610
|
-
--- \u7BA1\u7406\u8005\u30A2\u30AB\u30A6\u30F3\u30C8 ---`);let g=await
|
|
600
|
+
`);let t=await Vt(e,"\u30C7\u30D7\u30ED\u30A4\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [./godd-notes]: ")||"./godd-notes";console.log(`
|
|
601
|
+
--- PostgreSQL \u8A2D\u5B9A ---`);let r=await Vt(e,"DB \u30E6\u30FC\u30B6\u30FC [app_user]: ")||"app_user",n=await Vt(e,"DB \u30D1\u30B9\u30EF\u30FC\u30C9 [\u81EA\u52D5\u751F\u6210]: ")||Qr(24),o=await Vt(e,"DB \u540D [godd_notes]: ")||"godd_notes",i=await Vt(e,"PostgreSQL \u30DD\u30FC\u30C8 [5432]: ")||"5432";console.log(`
|
|
602
|
+
--- \u30DD\u30FC\u30C8\u8A2D\u5B9A ---`);let s=await Vt(e,"Notes API \u30DD\u30FC\u30C8 [3100]: ")||"3100",a=await Vt(e,"Notes App \u30DD\u30FC\u30C8 [5175]: ")||"5175";console.log(`
|
|
603
|
+
--- GitHub \u9023\u643A ---`),console.log(" PR / Issue \u4F5C\u6210\u306B\u306F GitHub App \u8A2D\u5B9A\u304C\u5FC5\u9808\u3067\u3059\uFF08Bot author\uFF09\u3002"),console.log(" \u624B\u9806: docs/007_guides/bot-token-setup.md \u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),console.log(" Private Key \u306F1\u884C\u5165\u529B\u3067\u3059\u3002\u8907\u6570\u884C PEM \u306F \\n \u306B\u7F6E\u63DB\u3057\u3066\u8CBC\u308B\u304B\u3001--auto / --config \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002");let c=await rc(e,"GitHub App ID: "," GitHub App ID \u306F\u5FC5\u9808\u3067\u3059\u3002"),u=await rc(e,"GitHub App Private Key PEM (\\n 1\u884C\u53EF): "," GitHub App Private Key \u306F\u5FC5\u9808\u3067\u3059\u3002"),p=await rc(e,"GitHub App Installation ID: "," GitHub App Installation ID \u306F\u5FC5\u9808\u3067\u3059\u3002"),l=await rc(e,"GitHub Owner (\u7D44\u7E54 or \u30E6\u30FC\u30B6\u30FC\u540D): "," GitHub Owner \u306F\u5FC5\u9808\u3067\u3059\u3002"),d=await rc(e,"GitHub Repo (\u30EA\u30DD\u30B8\u30C8\u30EA\u540D): "," GitHub Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),f=await Vt(e,"GitHub Branch [main]: ")||"main";console.log(`
|
|
604
|
+
--- \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3 ---`);let h=await Vt(e,"JWT \u30B7\u30FC\u30AF\u30EC\u30C3\u30C8 [\u81EA\u52D5\u751F\u6210]: ")||Qr(48);console.log(`
|
|
605
|
+
--- \u7BA1\u7406\u8005\u30A2\u30AB\u30A6\u30F3\u30C8 ---`);let g=await Vt(e,"\u7BA1\u7406\u8005\u30E6\u30FC\u30B6\u30FC\u540D [admin]: ")||"admin",y=await Vt(e,"\u7BA1\u7406\u8005\u30D1\u30B9\u30EF\u30FC\u30C9: ")||Qr(16);return{deployDir:(0,_e.resolve)(t),postgresUser:r,postgresPassword:n,postgresDb:o,postgresPort:i,notesApiPort:s,notesAppPort:a,githubAppId:c,githubAppPrivateKey:u,githubAppInstallationId:p,githubOwner:l,githubRepo:d,githubBranch:f,jwtSecret:h,adminUsername:g,adminPassword:y}}function wA(e){return e.replace(/\r\n/g,`
|
|
611
606
|
`).replace(/\r/g,`
|
|
612
|
-
`).replace(/\n/g,"\\n")}function
|
|
613
|
-
`)}async function
|
|
614
|
-
[1/5] \u30C7\u30D7\u30ED\u30A4\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6E96\u5099: ${e.deployDir}`),(0,Oe.mkdirSync)(e.deployDir,{recursive:!0}),console.log("[2/5] notes-api \u3092\u30B3\u30D4\u30FC..."),
|
|
615
|
-
\u30A8\u30E9\u30FC: \u30D5\u30A1\u30A4\u30EB\u64CD\u4F5C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${
|
|
607
|
+
`).replace(/\n/g,"\\n")}function bA(e){return["# GoDD 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_APP_ID=${e.githubAppId}`,`GITHUB_APP_PRIVATE_KEY=${wA(e.githubAppPrivateKey)}`,`GITHUB_APP_INSTALLATION_ID=${e.githubAppInstallationId}`,`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(`
|
|
608
|
+
`)}async function xA(e){let t=j2({preferredRoots:[process.cwd()]});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(`
|
|
609
|
+
[1/5] \u30C7\u30D7\u30ED\u30A4\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6E96\u5099: ${e.deployDir}`),(0,Oe.mkdirSync)(e.deployDir,{recursive:!0}),console.log("[2/5] notes-api \u3092\u30B3\u30D4\u30FC..."),Yy(r,(0,_e.join)(e.deployDir,"notes-api")),console.log("[3/5] notes-app \u3092\u30B3\u30D4\u30FC..."),Yy(n,(0,_e.join)(e.deployDir,"notes-app")),console.log("[4/5] docker-compose.yml \u3068 .env \u3092\u751F\u6210...");let p=(0,Oe.readFileSync)(o,"utf-8");(0,Oe.writeFileSync)((0,_e.join)(e.deployDir,"docker-compose.yml"),p,"utf-8"),(0,Oe.writeFileSync)((0,_e.join)(e.deployDir,".env"),bA(e),"utf-8")}catch(p){let l=p instanceof Error?p.message:String(p);console.error(`
|
|
610
|
+
\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 rG(e.deployDir,["up","-d","--build"])!==0&&(console.error(`
|
|
616
611
|
\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(`
|
|
617
|
-
\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u5F85\u6A5F\u4E2D...`);let s=`http://localhost:${e.notesApiPort}/api/health`;await
|
|
618
|
-
\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}`,
|
|
612
|
+
\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u5F85\u6A5F\u4E2D...`);let s=`http://localhost:${e.notesApiPort}/api/health`;await nG(s)||(console.warn(`
|
|
613
|
+
\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(`
|
|
619
614
|
\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
|
|
620
615
|
\u2551 GoDD Notes \u30C7\u30D7\u30ED\u30A4\u5B8C\u4E86 \u2551
|
|
621
616
|
\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
|
|
622
617
|
\u2551 \u2551
|
|
623
618
|
\u2551 Notes App: ${c.padEnd(35)}\u2551
|
|
624
|
-
\u2551 Notes API: ${
|
|
625
|
-
\u2551 API Docs: ${(
|
|
619
|
+
\u2551 Notes API: ${u.padEnd(35)}\u2551
|
|
620
|
+
\u2551 API Docs: ${(u+"/docs").padEnd(35)}\u2551
|
|
626
621
|
\u2551 \u2551
|
|
627
622
|
\u2551 \u30C7\u30D7\u30ED\u30A4\u5148: ${e.deployDir.slice(0,33).padEnd(35)}\u2551
|
|
628
623
|
\u2551 \u2551
|
|
@@ -638,12 +633,12 @@ ${fe(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u3
|
|
|
638
633
|
docker compose stop # \u505C\u6B62
|
|
639
634
|
docker compose start # \u518D\u958B
|
|
640
635
|
docker compose down -v # \u5B8C\u5168\u524A\u9664
|
|
641
|
-
`)}async function
|
|
642
|
-
--- \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(" GitHub App: \u8A2D\u5B9A\u6E08\u307F (Bot author)"),console.log(` \u7BA1\u7406\u8005: ${t.adminUsername}`),(await
|
|
643
|
-
\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}
|
|
644
|
-
`,"utf-8")}async function
|
|
636
|
+
`)}async function sG(e){Qy()||(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 iG(e);if(console.log(`
|
|
637
|
+
--- \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(" GitHub App: \u8A2D\u5B9A\u6E08\u307F (Bot author)"),console.log(` \u7BA1\u7406\u8005: ${t.adminUsername}`),(await Vt(e,`
|
|
638
|
+
\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}EA(),await xA(t)}function kA(e){let t=!1;for(let r=0;r<e.length;r++)(e[r]==="--yes"||e[r]==="-y")&&(t=!0);return{yes:t}}function aG(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 SA(e,t){let r=(0,_e.resolve)(t,"godd-notes");return typeof e!="string"||e===""?r:Xg(e)?(0,Oe.existsSync)(e)?(0,_e.resolve)(e):(console.warn(` \u26A0 ${e_} \u306E deployDir \u304C\u3053\u306E\u30DE\u30B7\u30F3\u306B\u5B58\u5728\u3057\u306A\u3044\u305F\u3081\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e} \u2192 ${r}`),r):(0,_e.resolve)(t,e)}function $A(e){if(!(0,Oe.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,Oe.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:SA(t.deployDir,(0,_e.dirname)((0,_e.resolve)(e))),postgresUser:t.postgresUser??"app_user",postgresPassword:t.postgresPassword??Qr(24),postgresDb:t.postgresDb??"godd_notes",postgresPort:t.postgresPort??"5432",notesApiPort:t.notesApiPort??"3100",notesAppPort:t.notesAppPort??"5175",githubAppId:t.githubAppId??"",githubAppPrivateKey:t.githubAppPrivateKey??"",githubAppInstallationId:t.githubAppInstallationId??"",githubOwner:t.githubOwner??"",githubRepo:t.githubRepo??"",githubBranch:t.githubBranch??"main",jwtSecret:t.jwtSecret??Qr(48),adminUsername:t.adminUsername??"admin",adminPassword:t.adminPassword??Qr(16)}}function cG(){return{deployDir:(0,_e.resolve)("./godd-notes"),postgresUser:"app_user",postgresPassword:Qr(24),postgresDb:"godd_notes",postgresPort:"5432",notesApiPort:"3100",notesAppPort:"5175",githubAppId:process.env.GITHUB_APP_ID??"",githubAppPrivateKey:process.env.GITHUB_APP_PRIVATE_KEY??"",githubAppInstallationId:process.env.GITHUB_APP_INSTALLATION_ID??"",githubOwner:process.env.GITHUB_OWNER??"",githubRepo:process.env.GITHUB_REPO??"",githubBranch:process.env.GITHUB_BRANCH??"main",jwtSecret:Qr(48),adminUsername:"admin",adminPassword:Qr(16)}}function PA(e=process.cwd()){return cp(e,uG)}function EA(e=process.cwd()){PA(e)?console.log("\u2713 Notes compose \u751F\u6210\u7269\u3092 .gitignore \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F"):console.log("\u2713 Notes compose \u751F\u6210\u7269\u306F .gitignore \u306B\u8FFD\u52A0\u6E08\u307F\u3067\u3059")}function CA(e,t=process.cwd()){let{postgresPassword:r,jwtSecret:n,adminPassword:o,githubAppPrivateKey:i,...s}=e,a=(0,_e.relative)(t,e.deployDir),c=a===""?".":!a.startsWith("..")&&!(0,_e.isAbsolute)(a)?a:e.deployDir;(0,Oe.writeFileSync)((0,_e.join)(t,e_),JSON.stringify({...s,deployDir:c},null,2)+`
|
|
639
|
+
`,"utf-8")}async function lG(){let e=process.cwd(),t=Xy(e);console.log(`
|
|
645
640
|
--- GoDD Notes \u30B9\u30C6\u30FC\u30BF\u30B9\u78BA\u8A8D ---
|
|
646
|
-
`);let r=(0,Oe.existsSync)((0,
|
|
641
|
+
`);let r=(0,Oe.existsSync)((0,_e.join)(e,"godd-notes"))?(0,_e.join)(e,"godd-notes"):e;if((0,Oe.existsSync)((0,_e.join)(r,"docker-compose.yml"))){console.log("[Docker Compose]");try{nt.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 u=t.region??"ap-northeast-1";try{let p=t.env??"dev",l=(0,_e.join)(t.outputDir??e,"terraform","godd-notes",p),d=Sp(l);nt.spawnSync("aws",["ecs","describe-services","--cluster",d.ecs_cluster_name,"--services",d.ecs_service_name,"--region",u,"--query","services[0].{status:status,running:runningCount,desired:desiredCount,deployments:length(deployments)}","--output","table"],{stdio:"inherit"})}catch(p){console.log(` ECS \u30B9\u30C6\u30FC\u30BF\u30B9\u53D6\u5F97\u306B\u5931\u6557: ${ge(p)}`)}console.log()}let o=(0,_e.join)(e,e_),s=((0,Oe.existsSync)(o)?(()=>{try{return JSON.parse((0,Oe.readFileSync)(o,"utf-8"))}catch{return null}})():null)?.notesApiPort??"3100",a=[s,...s!=="8000"?["8000"]:[]];console.log("[\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF / GitHub App \u2014 #829]");let c=new Set;for(let u of a){let p=`http://localhost:${u}/api/health`,l=await dA(p),d=p.replace(/\/api\/health\/?$/,""),f=null;l?.github_app_configured&&(f=await fA(d)),hA(p,l,f),c.add(d),console.log()}if(t?.provider==="aws")try{let u=t.env??"dev",p=(0,_e.join)(t.outputDir??e,"terraform","godd-notes",u),d=`https://${Sp(p).cloudfront_domain}`;if(!c.has(d)){let f=`${d}/api/health`,h=await dA(f),g=null;h?.github_app_configured&&(g=await fA(d)),hA(f,h,g),console.log()}}catch{}}function kp(){console.log(`
|
|
647
642
|
GoDD Notes \u30C7\u30D7\u30ED\u30A4\u7BA1\u7406
|
|
648
643
|
|
|
649
644
|
Usage: godd notes <command> [options]
|
|
@@ -696,14 +691,14 @@ AI \u9023\u643A:
|
|
|
696
691
|
\u8A2D\u5B9A\u306E\u6C38\u7D9A\u5316:
|
|
697
692
|
infra \u30B3\u30DE\u30F3\u30C9\u306F .godd-notes-infra.json \u3092\u4FDD\u5B58\u3057\u518D\u5229\u7528\u3002
|
|
698
693
|
compose --config/--auto \u306F .godd-notes-compose.json \u3092\u4FDD\u5B58\u3057\u518D\u5229\u7528\u3002
|
|
699
|
-
`)}async function
|
|
700
|
-
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o
|
|
701
|
-
\u30A8\u30E9\u30FC: AWS \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let
|
|
702
|
-
`);let i=e.env??"dev",s=e.outputDir??t,a=(0,
|
|
703
|
-
`),console.log("--- AWS \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` ECR: ${c.ecr_repository_url}`),console.log(` ECS: ${c.ecs_cluster_name} / ${c.ecs_service_name}`),console.log(` S3: ${c.s3_bucket_name}`),console.log(` CloudFront: ${c.cloudfront_distribution_id}`),console.log(` App URL: ${c.notes_app_url}`),!n){let
|
|
704
|
-
\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{
|
|
705
|
-
--- \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(" GitHub App: \u8A2D\u5B9A\u6E08\u307F (Bot author)"),console.log(` \u7BA1\u7406\u8005: ${n.adminUsername}`),
|
|
706
|
-
GoDD CLI v${
|
|
694
|
+
`)}async function pG(e,t,r,n){console.log(`
|
|
695
|
+
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=vA();if(!o.ok){console.error(`
|
|
696
|
+
\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 o.errors)console.error(` - ${u}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
|
|
697
|
+
`);let i=e.env??"dev",s=e.outputDir??t,a=(0,_e.join)(s,"terraform","godd-notes",i);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${a})`);let c=Sp(a);if(console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
|
|
698
|
+
`),console.log("--- AWS \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` ECR: ${c.ecr_repository_url}`),console.log(` ECS: ${c.ecs_cluster_name} / ${c.ecs_service_name}`),console.log(` S3: ${c.s3_bucket_name}`),console.log(` CloudFront: ${c.cloudfront_distribution_id}`),console.log(` App URL: ${c.notes_app_url}`),!n){let u=yA();try{if((await Vt(u,`
|
|
699
|
+
\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 oG(c,e,r)}async function dG(e){let t=e[0]??"help";switch(t){case"compose":{if(e.includes("--help")||e.includes("-h")){kp();return}Qy()||(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=aG(e.slice(1));if(r.auto||r.configPath){let n=r.configPath?$A(r.configPath):cG();_A(n)||(console.error("\u30A8\u30E9\u30FC: GitHub App \u8A8D\u8A3C\u60C5\u5831\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),console.error("PR / Issue \u4F5C\u6210\u306B\u306F GITHUB_APP_ID / GITHUB_APP_PRIVATE_KEY / GITHUB_APP_INSTALLATION_ID \u304C\u5FC5\u9808\u3067\u3059\u3002"),console.error("\u624B\u9806: docs/007_guides/bot-token-setup.md"),process.exit(1)),(!n.githubOwner||!n.githubRepo)&&(console.error("\u30A8\u30E9\u30FC: GITHUB_OWNER \u3068 GITHUB_REPO \u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)),console.log(`
|
|
700
|
+
--- \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(" GitHub App: \u8A2D\u5B9A\u6E08\u307F (Bot author)"),console.log(` \u7BA1\u7406\u8005: ${n.adminUsername}`),EA(),CA(n),await xA(n)}else{let n=yA();try{await sG(n)}finally{n.close()}}break}case"deploy":{if(e.includes("--help")||e.includes("-h")){kp();return}let{yes:r}=kA(e),n=process.cwd(),o=Xy(n);o||(console.error("\u30A8\u30E9\u30FC: .godd-notes-infra.json \u304C\u898B\u3064\u304B\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));let{resolveDeployProvider:i,executeGcpDeploy:s,executeAzureDeploy:a,executeVercelRailwayDeploy:c}=await Promise.resolve().then(()=>(JT(),KT)),u=i(o.provider);u||(console.error(`\u30A8\u30E9\u30FC: \u4E0D\u660E\u306A provider \u3067\u3059: ${o.provider}`),console.error("\u5148\u306B godd notes infra \u3092\u5B9F\u884C\u3057\u3001AWS / GCP / Azure / Vercel\xD7Railway \u306E\u3044\u305A\u308C\u304B\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let p=o.outputDir??n,l=Yl({preferredRoots:[p,n]});switch(l||(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)),M2(l),u){case"aws":await pG(o,n,l,r);break;case"gcp":await s(o,n,l,r);break;case"azure":await a(o,n,l,r);break;case"vercel-railway":await c(o,n,l,r);break}break}case"infra":{let{runNotesInfra:r}=await Promise.resolve().then(()=>(pA(),lA));await r(e.slice(1));break}case"status":{await lG();break}case"help":case"--help":case"-h":kp();break;default:console.error(`\u4E0D\u660E\u306A\u30B5\u30D6\u30B3\u30DE\u30F3\u30C9: ${t}`),kp(),process.exit(1)}}var mA,gA,Oe,_e,nt,$p,os,tG,e_,uG,AA=b(()=>{"use strict";mA=ht(require("node:readline"),1),gA=ht(require("node:crypto"),1),Oe=require("node:fs"),_e=require("node:path"),nt=ht(require("node:child_process"),1),$p=ht(require("node:http"),1);Yt();vy();By();Xl();jT();Hy();os=1e4;tG=new Set([".venv","__pycache__",".pytest_cache",".ruff_cache","node_modules",".git",".env","dist"]);e_=".godd-notes-compose.json",uG=["/godd-notes/",".godd-notes-*.json"]});var IA=require("node:fs"),nc=require("node:path"),t_=require("node:os");Xo();Rp();process.env.__GODD_CLI__="1";var is=Xr();function fG(){return is==="0.0.0"?`${is} (development)`:`${is} (${mr(is)?.channel??"unknown"})`}function hG(){let e=process.platform==="win32"?"godd.exe":"godd",t=process.platform==="win32"?(0,nc.join)(process.env.LOCALAPPDATA??(0,nc.join)((0,t_.homedir)(),"AppData","Local"),"GoDD"):(0,nc.join)((0,t_.homedir)(),".godd","bin");return(0,IA.existsSync)((0,nc.join)(t,e))}var mG={i:"install",s:"server",n:"notes",v:"version",h:"help"};function gG(){return hG()?"help":"install"}var Pp=process.argv[2],oc=Pp?mG[Pp]??Pp:gG();function RA(){console.log(`
|
|
701
|
+
GoDD CLI v${is}
|
|
707
702
|
|
|
708
703
|
Usage: godd <command>
|
|
709
704
|
|
|
@@ -729,7 +724,7 @@ Examples:
|
|
|
729
724
|
godd notes deploy \u30AF\u30E9\u30A6\u30C9\u306B\u30C7\u30D7\u30ED\u30A4\uFF08infra \u306E provider \u306B\u5F93\u3046\uFF09
|
|
730
725
|
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
|
|
731
726
|
godd version \u30D0\u30FC\u30B8\u30E7\u30F3\u78BA\u8A8D
|
|
732
|
-
`)}async function
|
|
727
|
+
`)}async function yG(){switch(oc){case"server":{let{startServer:e}=await Promise.resolve().then(()=>(JE(),KE));await e();break}case"init":{let{runInit:e}=await Promise.resolve().then(()=>(tT(),eT));await e();break}case"login":{let{runLogin:e}=await Promise.resolve().then(()=>(Za(),Ry));await e(process.argv.slice(3));break}case"logout":{let{runLogout:e}=await Promise.resolve().then(()=>(Za(),Ry));await e(process.argv.slice(3));break}case"google-relay":{let{runGoogleRelay:e}=await Promise.resolve().then(()=>(CT(),ET));await e();break}case"install":{let{runInstall:e}=await Promise.resolve().then(()=>(zT(),IT));await e();break}case"notes":{let{runNotes:e}=await Promise.resolve().then(()=>(AA(),TA));await e(process.argv.slice(3));break}case"version":console.log(`GoDD CLI v${fG()}`);break;case"help":RA();break;default:console.error(`\u4E0D\u660E\u306A\u30B3\u30DE\u30F3\u30C9: ${Pp}`),RA(),process.exit(1)}}var _G=oc==="server"||oc==="google-relay"?Promise.resolve(""):ac({version:is})();yG().then(async()=>{if(oc==="server"||oc==="google-relay")return;let e=await _G;e&&console.log(`
|
|
733
728
|
${e}`)}).catch(e=>{console.error("GoDD CLI \u30A8\u30E9\u30FC:",e),process.exit(1)});
|
|
734
729
|
/*! Bundled license information:
|
|
735
730
|
|