forge-terminal 0.3.3 → 0.3.5

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.
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __forgeCreateRequire } from 'node:module';
2
2
  const require = __forgeCreateRequire(import.meta.url);
3
- import{f as Rd}from"./chunk-PBIS2ONZ.js";import{a as zd,c as $d}from"./chunk-DG4IXNWJ.js";import{o as yd,p as vd,t as bd}from"./chunk-WFD6OWQY.js";import"./chunk-BZXDNDPG.js";import{a as ac}from"./chunk-U5TEGDGH.js";import"./chunk-QVACE4IE.js";import{d as pd,f as md,h as fd}from"./chunk-LW2QEXDT.js";import{c as hd,d as gd,e as _d,f as Sd}from"./chunk-3GVFOZ7M.js";import"./chunk-GGBNT4WI.js";import{k as dd}from"./chunk-GNLE6JXL.js";import"./chunk-32VJ2RDH.js";import{a as ar}from"./chunk-G4DU5ADF.js";import{I as ct,g as cc}from"./chunk-MMRDELHW.js";import{d as ld}from"./chunk-J7FLFHQJ.js";import{b as uc}from"./chunk-H2IUSPAK.js";import"./chunk-HON4OV7M.js";import{d as ic}from"./chunk-TMUK2DD3.js";var oS=Object.create,ss=Object.defineProperty,nS=Object.getOwnPropertyDescriptor,sS=Object.getOwnPropertyNames,iS=Object.getPrototypeOf,aS=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),wd=(e,t)=>{let r={};for(var o in e)ss(r,o,{get:e[o],enumerable:!0});return t&&ss(r,Symbol.toStringTag,{value:"Module"}),r},cS=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=sS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!aS.call(e,c)&&c!==r&&ss(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=nS(t,c))||o.enumerable});return e},is=(e,t,r)=>(r=e!=null?oS(iS(e)):{},cS(t||!e||!e.__esModule?ss(r,"default",{value:e,enumerable:!0}):r,e));var uS=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Pd=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),lS=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),dS=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Ed(e){return typeof e=="string"&&Pd.has(e.replace(/#$/,""))}function Td(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(uS.has(r))return"2020-12";if(Pd.has(r))return"2019-09";if(lS.has(r)||dS.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var ae={};ic(ae,{BIGINT_FORMAT_RANGES:()=>ls,CONSTANT_CATCH:()=>Ld,Class:()=>pc,NUMBER_FORMAT_RANGES:()=>Mo,aborted:()=>ut,allowsEval:()=>Sc,assert:()=>gS,assertEqual:()=>pS,assertIs:()=>fS,assertNever:()=>hS,assertNotEqual:()=>mS,assignProp:()=>Ye,attachSchema:()=>ps,base64ToUint8Array:()=>qd,base64urlToUint8Array:()=>xS,cached:()=>Nr,captureStackTrace:()=>cs,cleanEnum:()=>jS,cleanRegex:()=>qo,clone:()=>st,cloneDef:()=>yS,codePointLength:()=>Lo,constantCatch:()=>Dd,createTransparentProxy:()=>wS,defineLazy:()=>hc,defineLazyInternal:()=>ge,derived:()=>LS,esc:()=>gc,escapeRegex:()=>St,explicitlyAborted:()=>bc,extend:()=>TS,finalizeIssue:()=>lt,floatSafeRemainder:()=>fc,getElementAtPath:()=>vS,getEnumValues:()=>Ir,getLengthableOrigin:()=>Do,getParsedType:()=>$S,getSizableOrigin:()=>Ad,hexToUint8Array:()=>qS,hide:()=>ms,installLazyProp:()=>VS,isObject:()=>ur,isPlainObject:()=>At,issue:()=>xr,joinValues:()=>as,jsonStringifyReplacer:()=>Or,members:()=>Rc,merge:()=>CS,mergeDefs:()=>_t,normalizeParams:()=>te,nullish:()=>mc,numKeys:()=>RS,objectClone:()=>_S,omit:()=>ES,optionalKeys:()=>vc,own:()=>xt,parsedType:()=>zc,partial:()=>IS,pick:()=>PS,prefixIssues:()=>yt,primitiveTypes:()=>jd,promiseAllObject:()=>bS,propertyKeyTypes:()=>yc,randomString:()=>zS,rawShape:()=>jr,required:()=>OS,safeExtend:()=>kS,shallowClone:()=>Nd,slugify:()=>_c,stringifyPrimitive:()=>us,toZod:()=>Cd,uint8ArrayToBase64:()=>Md,uint8ArrayToBase64url:()=>AS,uint8ArrayToHex:()=>MS,unwrapMessage:()=>Cr});function pS(e){return e}function mS(e){return e}function Cd(){return e=>e}function fS(e){}function hS(e){throw new Error("Unexpected value in exhaustive check")}function gS(e){}function Ir(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function as(e,t="|"){return e.map(r=>us(r)).join(t)}function Or(e,t){return typeof t=="bigint"?t.toString():t}var dc=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Nr(e){return new dc(e)}function mc(e){return e==null}function qo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function fc(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var kd=Symbol("evaluating");function hc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==kd)return o===void 0&&(o=kd,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function _S(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ye(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function jr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function gt(e){return jr(e._zod.def)??e._zod.def.shape}function Id(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function Od(e,t,r){t in e?Ye(e,t,r):e[t]=r}function cr(e,t,r,o){let n=gt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Id(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):Od(e,s,o?o(i.value,s):i.value))}}function SS(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Id(e,r,()=>t[r]):Od(e,r,o.value))}}function _t(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function yS(e){return _t(e._zod.def)}function vS(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function bS(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function zS(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function gc(e){return JSON.stringify(e)}function _c(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var cs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Sc=Nr(()=>{if(Xe.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function At(e){if(ur(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ur(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Nd(e){return At(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function RS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var $S=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}`)}},yc=new Set(["string","number","symbol"]),jd=new Set(["string","number","bigint","boolean","symbol","undefined"]);function St(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function st(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function te(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 wS(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function us(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function vc(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Mo={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]},ls={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function PS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return cr(s,e,ds(e,t)),st(e,_t(r,{shape:s,checks:[]}))}function ds(e,t){let r=gt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);t[n]&&o.push(n)}return o}function ES(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(ds(e,t)),i={};return cr(i,e,Reflect.ownKeys(gt(e)).filter(c=>!s.has(c))),st(e,_t(r,{shape:i,checks:[]}))}function TS(e,t){if(!At(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=gt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return st(e,_t(e._zod.def,{shape:xd(e,t)}))}function xd(e,t){let r={};return cr(r,e,Reflect.ownKeys(gt(e))),SS(r,t),r}function kS(e,t){if(!At(t))throw new Error("Invalid input to safeExtend: expected a plain object");return st(e,_t(e._zod.def,{shape:xd(e,t)}))}function CS(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};cr(r,e,Reflect.ownKeys(gt(e))),cr(r,t,Reflect.ownKeys(gt(t)));let o=_t(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return st(e,o)}function IS(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(ds(t,r)):void 0,a={};return cr(a,t,Reflect.ownKeys(gt(t)),e&&((u,d)=>c&&!c.has(d)?u:new e({type:"optional",innerType:u}))),st(t,_t(t._zod.def,{shape:a,checks:[]}))}function OS(e,t,r){let o=r?new Set(ds(t,r)):void 0,n={};return cr(n,t,Reflect.ownKeys(gt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),st(t,_t(t._zod.def,{shape:n}))}function ut(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function bc(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function yt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Cr(e){return typeof e=="string"?e:e?.message}function ps(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function lt(e,t,r){var o;let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Cr(e.inst?._zod.def?.error?.(e))??Cr(s?.(e))??Cr(t?.error?.(e))??Cr(r.customError?.(e))??Cr(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(c[a]=e[a]);return c.path??(c.path=[]),c.message=i,t?.reportInput&&(c.input=e.input),c}function Ad(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var NS=/[\uD800-\uDBFF]/;function Lo(e){let t=e.length;if(!NS.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(r--,o++);return r}function Do(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function zc(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function xr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function jS(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function qd(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Md(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function xS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return qd(t+r)}function AS(e){return Md(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function qS(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function MS(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var pc=class{constructor(...t){}};function Rc(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):DS(e,r,o.value)}}function xt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function ms(e,t,r){return xt(e,t,r,!1)}function LS(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return xt(this,r,o(this))},set(n){xt(this,r,n)}})}return t}function DS(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:xt(this,t,r.bind(this))},set(o){xt(this,t,o)}})}function ZS(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var lc,jt=!1,US={configurable:!0,get(){jt=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&lc!==e._zod){lc=void 0;return}lc=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,US);let n=jt;jt=!1;try{let s=r(this);return jt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),jt=jt||n,s}catch(s){throw delete this[t],jt=jt||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function VS(e,t,r,o){let n=ZS(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var Ld="~constantCatch";function Dd(e){let t=()=>e;return t[Ld]=!0,t}var Zd,wc=Object.freeze({status:"aborted"}),$c={value:void 0,enumerable:!1},Ud="captureStackTrace"in Error?Error:null;function FS(e){let t=Ud;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Ud=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function q(e,t,r,o){let n={};function s(g){this.def=g,this.constr=m,this.traits=new Set}s.prototype=n;let i=r,c=i&&new WeakSet;function a(g,v){if(g._zod){if(g._zod.traits.has(e))return}else{$c.value=new s(v);try{Object.defineProperty(g,"_zod",$c)}finally{$c.value=void 0}}if(g._zod.traits.add(e),t(g,v),c){let _=Object.getPrototypeOf(g),h=g._zod.constr.prototype,f=_;for(;f&&f!==h;)f=Object.getPrototypeOf(f);let z=f??_;c.has(z)||(c.add(z),Rc(z,i))}let p=m.prototype;for(let _ in p)Object.prototype.hasOwnProperty.call(p,_)&&(_ in g||(g[_]=p[_].bind(g)))}let u=o?.Parent??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function m(g){let v=o?.Parent?FS(d):this;a(v,g);let p=v._zod.deferred;if(p){for(let h of p)h();v._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(v),v}return Object.defineProperty(m,"init",{value:a}),Object.defineProperty(m,Symbol.hasInstance,{value:g=>o?.Parent&&g instanceof o.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}var dt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ar=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Zd=globalThis).__zod_globalConfig??(Zd.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function HS(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Or,2)),e.message}function JS(e){this._zod.message=e}var BS={get:HS,set:JS,enumerable:!0,configurable:!0},Ec={value:void 0,enumerable:!1},Vd=new WeakSet([Object.prototype,Error.prototype]),Fd=(e,t)=>{e.name="$ZodError",Ec.value=t,Object.defineProperty(e,"issues",Ec),Ec.value=void 0,Object.defineProperty(e,"message",BS);let r=Object.getPrototypeOf(e);Vd.has(r)||(Vd.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Hd=q("$ZodError",Fd),dR=q("$ZodError",Fd,void 0,{Parent:Error});function KS(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Tc(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?KS(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function kc(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>o({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)r._errors.push(t(i));else{let a=r,u=0;for(;u<c.length;){let d=c[u],m=u===c.length-1;if(d==="_errors"){m&&a._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(a,d)||Object.defineProperty(a,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=a[d];m&&g._errors.push(t(i)),a=g,u++}}}};return o(e),r}function fs(e,t){return{callee:t?.callee??e,Err:t?.Err}}var hs=e=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)throw new dt;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>lt(u,i,Qe())));throw cs(a,s?.callee??t),a}return c.value};return t};var gs=e=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>lt(u,i,Qe())));throw cs(a,s?.callee??t),a}return c.value};return t};var _s=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new dt;return s.issues.length?Jd(e,s.issues,n):{success:!0,data:s.value}};function Jd(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>lt(n,r,Qe()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var Ss=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?Jd(e,s.issues,n):{success:!0,data:s.value}};var GS=Symbol.for("zod.compile.invalid"),WS=Symbol.for("zod.compile.fallback"),Cc=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==GS)return!0;if(o.definite===!0&&r===void 0)return!1}return YS(e,t,r)});function YS(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[WS]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new dt;return s.issues.length===0}var Ic=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);return n instanceof Promise&&(n=await n),n.issues.length===0},Bd=e=>{let t=hs(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,fs(r,i))};return r};var Kd=e=>{let t=hs(e),r=(o,n,s,i)=>t(o,n,s,fs(r,i));return r};var Gd=e=>{let t=gs(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,fs(r,i))};return r};var Wd=e=>{let t=gs(e),r=async(o,n,s,i)=>await t(o,n,s,fs(r,i));return r};var Yd=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return _s(e)(t,r,n)};var Xd=e=>(t,r,o)=>_s(e)(t,r,o);var Qd=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ss(e)(t,r,n)};var ep=e=>async(t,r,o)=>Ss(e)(t,r,o);var tp=/^[cC][0-9a-z]{6,}$/,rp=/^[0-9a-z]+$/,op=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,np=/^[0-9a-vA-V]{20}$/,sp=/^[A-Za-z0-9]{27}$/,ip=/^[a-zA-Z0-9_-]{21}$/;function ap(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var cp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var up=/^([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})$/,Nc=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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var lp=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var XS="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function dp(){return new RegExp(XS,"u")}var pp=/^(?:(?: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])$/,mp=/^(([0-9a-fA-F]{1,4}:){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}|:))$/;var fp=/^((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])$/,hp=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_p=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Sp=/^https?$/,yp=/^\+[1-9]\d{6,14}$/;var vp="(?:(?:\\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])))";function QS(e){return new RegExp(`^${e}$`)}var bp=QS(vp);function Oc(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function zp(e){return new RegExp(`^${Oc(e)}$`)}function Rp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Oc({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Oc({precision:e.precision})}`:r;return new RegExp(`^${vp}T(?:${o})$`)}var $p=/^[\s\S]{0,}$/;var wp=/^-?\d+n?$/,jc=/^-?\d+$/,Zo=/^-?\d+(?:\.\d+)?$/,Pp=/^(?:true|false)$/i,Ep=/^null$/i;var Tp=/^[^A-Z]*$/,kp=/^[^a-z]*$/;var Ze=q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var xc=e=>{let t=e.value;return!mc(t)&&t.length!==void 0},ys={number:"number",bigint:"bigint",object:"date"},Ac=q("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);let r=ys[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:ys[typeof o.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qc=q("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let r=ys[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:ys[typeof o.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Cp=q("$ZodCheckMultipleOf",(e,t)=>{Ze.init(e,t),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"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):fc(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})}}),Ip=q("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Mo[t.format];e._zod.check=i=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Op=q("$ZodCheckMaxLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=xc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Lo(n):s)<=t.maximum)return;let c=Do(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Np=q("$ZodCheckMinLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=xc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Lo(n):s)>=t.minimum)return;let c=Do(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),jp=q("$ZodCheckLengthEquals",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=xc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Lo(n):s;if(i===t.length)return;let c=Do(n),a=i>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Uo=q("$ZodCheckStringFormat",(e,t)=>{var r,o;Ze.init(e,t),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),xp=q("$ZodCheckRegex",(e,t)=>{Uo.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})}}),Ap=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Tp),Uo.init(e,t)}),qp=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=kp),Uo.init(e,t)}),Mp=q("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);let r=St(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Lp=q("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`^${St(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Dp=q("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`.*${St(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Zp=q("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var vs=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
3
+ import{f as Rd}from"./chunk-PBIS2ONZ.js";import{a as zd,c as $d}from"./chunk-DQ3EVU4Q.js";import{o as yd,p as vd,t as bd}from"./chunk-WFD6OWQY.js";import"./chunk-BZXDNDPG.js";import{a as ac}from"./chunk-U5TEGDGH.js";import"./chunk-QVACE4IE.js";import{d as pd,f as md,h as fd}from"./chunk-LW2QEXDT.js";import{c as hd,d as gd,e as _d,f as Sd}from"./chunk-3GVFOZ7M.js";import"./chunk-GGBNT4WI.js";import{k as dd}from"./chunk-GNLE6JXL.js";import"./chunk-32VJ2RDH.js";import{a as ar}from"./chunk-2BCNTUEO.js";import{I as ct,g as cc}from"./chunk-MMRDELHW.js";import{d as ld}from"./chunk-J7FLFHQJ.js";import{b as uc}from"./chunk-H2IUSPAK.js";import"./chunk-HON4OV7M.js";import{d as ic}from"./chunk-TMUK2DD3.js";var oS=Object.create,ss=Object.defineProperty,nS=Object.getOwnPropertyDescriptor,sS=Object.getOwnPropertyNames,iS=Object.getPrototypeOf,aS=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),wd=(e,t)=>{let r={};for(var o in e)ss(r,o,{get:e[o],enumerable:!0});return t&&ss(r,Symbol.toStringTag,{value:"Module"}),r},cS=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=sS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!aS.call(e,c)&&c!==r&&ss(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=nS(t,c))||o.enumerable});return e},is=(e,t,r)=>(r=e!=null?oS(iS(e)):{},cS(t||!e||!e.__esModule?ss(r,"default",{value:e,enumerable:!0}):r,e));var uS=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Pd=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),lS=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),dS=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Ed(e){return typeof e=="string"&&Pd.has(e.replace(/#$/,""))}function Td(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(uS.has(r))return"2020-12";if(Pd.has(r))return"2019-09";if(lS.has(r)||dS.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var ae={};ic(ae,{BIGINT_FORMAT_RANGES:()=>ls,CONSTANT_CATCH:()=>Ld,Class:()=>pc,NUMBER_FORMAT_RANGES:()=>Mo,aborted:()=>ut,allowsEval:()=>Sc,assert:()=>gS,assertEqual:()=>pS,assertIs:()=>fS,assertNever:()=>hS,assertNotEqual:()=>mS,assignProp:()=>Ye,attachSchema:()=>ps,base64ToUint8Array:()=>qd,base64urlToUint8Array:()=>xS,cached:()=>Nr,captureStackTrace:()=>cs,cleanEnum:()=>jS,cleanRegex:()=>qo,clone:()=>st,cloneDef:()=>yS,codePointLength:()=>Lo,constantCatch:()=>Dd,createTransparentProxy:()=>wS,defineLazy:()=>hc,defineLazyInternal:()=>ge,derived:()=>LS,esc:()=>gc,escapeRegex:()=>St,explicitlyAborted:()=>bc,extend:()=>TS,finalizeIssue:()=>lt,floatSafeRemainder:()=>fc,getElementAtPath:()=>vS,getEnumValues:()=>Ir,getLengthableOrigin:()=>Do,getParsedType:()=>$S,getSizableOrigin:()=>Ad,hexToUint8Array:()=>qS,hide:()=>ms,installLazyProp:()=>VS,isObject:()=>ur,isPlainObject:()=>At,issue:()=>xr,joinValues:()=>as,jsonStringifyReplacer:()=>Or,members:()=>Rc,merge:()=>CS,mergeDefs:()=>_t,normalizeParams:()=>te,nullish:()=>mc,numKeys:()=>RS,objectClone:()=>_S,omit:()=>ES,optionalKeys:()=>vc,own:()=>xt,parsedType:()=>zc,partial:()=>IS,pick:()=>PS,prefixIssues:()=>yt,primitiveTypes:()=>jd,promiseAllObject:()=>bS,propertyKeyTypes:()=>yc,randomString:()=>zS,rawShape:()=>jr,required:()=>OS,safeExtend:()=>kS,shallowClone:()=>Nd,slugify:()=>_c,stringifyPrimitive:()=>us,toZod:()=>Cd,uint8ArrayToBase64:()=>Md,uint8ArrayToBase64url:()=>AS,uint8ArrayToHex:()=>MS,unwrapMessage:()=>Cr});function pS(e){return e}function mS(e){return e}function Cd(){return e=>e}function fS(e){}function hS(e){throw new Error("Unexpected value in exhaustive check")}function gS(e){}function Ir(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function as(e,t="|"){return e.map(r=>us(r)).join(t)}function Or(e,t){return typeof t=="bigint"?t.toString():t}var dc=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Nr(e){return new dc(e)}function mc(e){return e==null}function qo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function fc(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var kd=Symbol("evaluating");function hc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==kd)return o===void 0&&(o=kd,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function _S(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ye(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function jr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function gt(e){return jr(e._zod.def)??e._zod.def.shape}function Id(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function Od(e,t,r){t in e?Ye(e,t,r):e[t]=r}function cr(e,t,r,o){let n=gt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Id(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):Od(e,s,o?o(i.value,s):i.value))}}function SS(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Id(e,r,()=>t[r]):Od(e,r,o.value))}}function _t(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function yS(e){return _t(e._zod.def)}function vS(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function bS(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function zS(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function gc(e){return JSON.stringify(e)}function _c(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var cs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Sc=Nr(()=>{if(Xe.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function At(e){if(ur(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ur(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Nd(e){return At(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function RS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var $S=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}`)}},yc=new Set(["string","number","symbol"]),jd=new Set(["string","number","bigint","boolean","symbol","undefined"]);function St(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function st(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function te(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 wS(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function us(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function vc(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Mo={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]},ls={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function PS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return cr(s,e,ds(e,t)),st(e,_t(r,{shape:s,checks:[]}))}function ds(e,t){let r=gt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);t[n]&&o.push(n)}return o}function ES(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(ds(e,t)),i={};return cr(i,e,Reflect.ownKeys(gt(e)).filter(c=>!s.has(c))),st(e,_t(r,{shape:i,checks:[]}))}function TS(e,t){if(!At(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=gt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return st(e,_t(e._zod.def,{shape:xd(e,t)}))}function xd(e,t){let r={};return cr(r,e,Reflect.ownKeys(gt(e))),SS(r,t),r}function kS(e,t){if(!At(t))throw new Error("Invalid input to safeExtend: expected a plain object");return st(e,_t(e._zod.def,{shape:xd(e,t)}))}function CS(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};cr(r,e,Reflect.ownKeys(gt(e))),cr(r,t,Reflect.ownKeys(gt(t)));let o=_t(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return st(e,o)}function IS(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(ds(t,r)):void 0,a={};return cr(a,t,Reflect.ownKeys(gt(t)),e&&((u,d)=>c&&!c.has(d)?u:new e({type:"optional",innerType:u}))),st(t,_t(t._zod.def,{shape:a,checks:[]}))}function OS(e,t,r){let o=r?new Set(ds(t,r)):void 0,n={};return cr(n,t,Reflect.ownKeys(gt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),st(t,_t(t._zod.def,{shape:n}))}function ut(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function bc(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function yt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Cr(e){return typeof e=="string"?e:e?.message}function ps(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function lt(e,t,r){var o;let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Cr(e.inst?._zod.def?.error?.(e))??Cr(s?.(e))??Cr(t?.error?.(e))??Cr(r.customError?.(e))??Cr(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(c[a]=e[a]);return c.path??(c.path=[]),c.message=i,t?.reportInput&&(c.input=e.input),c}function Ad(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var NS=/[\uD800-\uDBFF]/;function Lo(e){let t=e.length;if(!NS.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(r--,o++);return r}function Do(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function zc(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function xr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function jS(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function qd(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Md(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function xS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return qd(t+r)}function AS(e){return Md(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function qS(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function MS(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var pc=class{constructor(...t){}};function Rc(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):DS(e,r,o.value)}}function xt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function ms(e,t,r){return xt(e,t,r,!1)}function LS(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return xt(this,r,o(this))},set(n){xt(this,r,n)}})}return t}function DS(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:xt(this,t,r.bind(this))},set(o){xt(this,t,o)}})}function ZS(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var lc,jt=!1,US={configurable:!0,get(){jt=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&lc!==e._zod){lc=void 0;return}lc=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,US);let n=jt;jt=!1;try{let s=r(this);return jt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),jt=jt||n,s}catch(s){throw delete this[t],jt=jt||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function VS(e,t,r,o){let n=ZS(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var Ld="~constantCatch";function Dd(e){let t=()=>e;return t[Ld]=!0,t}var Zd,wc=Object.freeze({status:"aborted"}),$c={value:void 0,enumerable:!1},Ud="captureStackTrace"in Error?Error:null;function FS(e){let t=Ud;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Ud=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function q(e,t,r,o){let n={};function s(g){this.def=g,this.constr=m,this.traits=new Set}s.prototype=n;let i=r,c=i&&new WeakSet;function a(g,v){if(g._zod){if(g._zod.traits.has(e))return}else{$c.value=new s(v);try{Object.defineProperty(g,"_zod",$c)}finally{$c.value=void 0}}if(g._zod.traits.add(e),t(g,v),c){let _=Object.getPrototypeOf(g),h=g._zod.constr.prototype,f=_;for(;f&&f!==h;)f=Object.getPrototypeOf(f);let z=f??_;c.has(z)||(c.add(z),Rc(z,i))}let p=m.prototype;for(let _ in p)Object.prototype.hasOwnProperty.call(p,_)&&(_ in g||(g[_]=p[_].bind(g)))}let u=o?.Parent??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function m(g){let v=o?.Parent?FS(d):this;a(v,g);let p=v._zod.deferred;if(p){for(let h of p)h();v._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(v),v}return Object.defineProperty(m,"init",{value:a}),Object.defineProperty(m,Symbol.hasInstance,{value:g=>o?.Parent&&g instanceof o.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}var dt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ar=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Zd=globalThis).__zod_globalConfig??(Zd.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function HS(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Or,2)),e.message}function JS(e){this._zod.message=e}var BS={get:HS,set:JS,enumerable:!0,configurable:!0},Ec={value:void 0,enumerable:!1},Vd=new WeakSet([Object.prototype,Error.prototype]),Fd=(e,t)=>{e.name="$ZodError",Ec.value=t,Object.defineProperty(e,"issues",Ec),Ec.value=void 0,Object.defineProperty(e,"message",BS);let r=Object.getPrototypeOf(e);Vd.has(r)||(Vd.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Hd=q("$ZodError",Fd),dR=q("$ZodError",Fd,void 0,{Parent:Error});function KS(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Tc(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?KS(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function kc(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>o({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)r._errors.push(t(i));else{let a=r,u=0;for(;u<c.length;){let d=c[u],m=u===c.length-1;if(d==="_errors"){m&&a._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(a,d)||Object.defineProperty(a,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=a[d];m&&g._errors.push(t(i)),a=g,u++}}}};return o(e),r}function fs(e,t){return{callee:t?.callee??e,Err:t?.Err}}var hs=e=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)throw new dt;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>lt(u,i,Qe())));throw cs(a,s?.callee??t),a}return c.value};return t};var gs=e=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>lt(u,i,Qe())));throw cs(a,s?.callee??t),a}return c.value};return t};var _s=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new dt;return s.issues.length?Jd(e,s.issues,n):{success:!0,data:s.value}};function Jd(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>lt(n,r,Qe()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var Ss=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?Jd(e,s.issues,n):{success:!0,data:s.value}};var GS=Symbol.for("zod.compile.invalid"),WS=Symbol.for("zod.compile.fallback"),Cc=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==GS)return!0;if(o.definite===!0&&r===void 0)return!1}return YS(e,t,r)});function YS(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[WS]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new dt;return s.issues.length===0}var Ic=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);return n instanceof Promise&&(n=await n),n.issues.length===0},Bd=e=>{let t=hs(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,fs(r,i))};return r};var Kd=e=>{let t=hs(e),r=(o,n,s,i)=>t(o,n,s,fs(r,i));return r};var Gd=e=>{let t=gs(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,fs(r,i))};return r};var Wd=e=>{let t=gs(e),r=async(o,n,s,i)=>await t(o,n,s,fs(r,i));return r};var Yd=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return _s(e)(t,r,n)};var Xd=e=>(t,r,o)=>_s(e)(t,r,o);var Qd=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ss(e)(t,r,n)};var ep=e=>async(t,r,o)=>Ss(e)(t,r,o);var tp=/^[cC][0-9a-z]{6,}$/,rp=/^[0-9a-z]+$/,op=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,np=/^[0-9a-vA-V]{20}$/,sp=/^[A-Za-z0-9]{27}$/,ip=/^[a-zA-Z0-9_-]{21}$/;function ap(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var cp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var up=/^([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})$/,Nc=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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var lp=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var XS="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function dp(){return new RegExp(XS,"u")}var pp=/^(?:(?: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])$/,mp=/^(([0-9a-fA-F]{1,4}:){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}|:))$/;var fp=/^((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])$/,hp=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_p=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Sp=/^https?$/,yp=/^\+[1-9]\d{6,14}$/;var vp="(?:(?:\\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])))";function QS(e){return new RegExp(`^${e}$`)}var bp=QS(vp);function Oc(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function zp(e){return new RegExp(`^${Oc(e)}$`)}function Rp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Oc({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Oc({precision:e.precision})}`:r;return new RegExp(`^${vp}T(?:${o})$`)}var $p=/^[\s\S]{0,}$/;var wp=/^-?\d+n?$/,jc=/^-?\d+$/,Zo=/^-?\d+(?:\.\d+)?$/,Pp=/^(?:true|false)$/i,Ep=/^null$/i;var Tp=/^[^A-Z]*$/,kp=/^[^a-z]*$/;var Ze=q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var xc=e=>{let t=e.value;return!mc(t)&&t.length!==void 0},ys={number:"number",bigint:"bigint",object:"date"},Ac=q("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);let r=ys[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:ys[typeof o.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qc=q("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let r=ys[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:ys[typeof o.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Cp=q("$ZodCheckMultipleOf",(e,t)=>{Ze.init(e,t),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"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):fc(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})}}),Ip=q("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Mo[t.format];e._zod.check=i=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Op=q("$ZodCheckMaxLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=xc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Lo(n):s)<=t.maximum)return;let c=Do(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Np=q("$ZodCheckMinLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=xc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Lo(n):s)>=t.minimum)return;let c=Do(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),jp=q("$ZodCheckLengthEquals",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=xc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Lo(n):s;if(i===t.length)return;let c=Do(n),a=i>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Uo=q("$ZodCheckStringFormat",(e,t)=>{var r,o;Ze.init(e,t),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),xp=q("$ZodCheckRegex",(e,t)=>{Uo.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})}}),Ap=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Tp),Uo.init(e,t)}),qp=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=kp),Uo.init(e,t)}),Mp=q("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);let r=St(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Lp=q("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`^${St(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Dp=q("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`.*${St(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Zp=q("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var vs=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
4
4
  `).filter(i=>i),n=Math.min(...o.map(i=>i.length-i.trimStart().length)),s=o.map(i=>i.slice(n)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
5
5
  ${r.join(`
6
6
  `)}
@@ -68,6 +68,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
68
68
  deps: ${d}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(a){let[u,d]=s(a);i(a,u),c(a,d)}};function s({schema:a}){let u={},d={};for(let m in a){if(m==="__proto__")continue;let g=Array.isArray(a[m])?u:d;g[m]=a[m]}return[u,d]}function i(a,u=a.schema){let{gen:d,data:m,it:g}=a;if(Object.keys(u).length===0)return;let v=d.let("missing");for(let p in u){let _=u[p];if(_.length===0)continue;let h=(0,o.propertyInData)(d,m,p,g.opts.ownProperties);a.setParams({property:p,depsCount:_.length,deps:_.join(", ")}),g.allErrors?d.if(h,()=>{for(let f of _)(0,o.checkReportMissingProp)(a,f)}):(d.if((0,t._)`${h} && (${(0,o.checkMissingProp)(a,_,v)})`),(0,o.reportMissingProp)(a,v),d.else())}}e.validatePropertyDeps=i;function c(a,u=a.schema){let{gen:d,data:m,keyword:g,it:v}=a,p=d.name("valid");for(let _ in u)(0,r.alwaysValidSchema)(v,u[_])||(d.if((0,o.propertyInData)(d,m,_,v.opts.ownProperties),()=>{let h=a.subschema({keyword:g,schemaProp:_},p);a.mergeValidEvaluated(h,p)},()=>d.var(p,!0)),a.ok(p))}e.validateSchemaDeps=c,e.default=n})),Cz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,t._)`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:i,data:c,it:a}=n;if((0,r.alwaysValidSchema)(a,i))return;let u=s.name("valid");s.forIn("key",c,d=>{n.setParams({propertyName:d}),n.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},u),s.if((0,t.not)(u),()=>{n.error(!0),a.allErrors||s.break()})}),n.ok(u)}};e.default=o})),i_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mt(),r=le(),o=pt(),n=_e(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>(0,r._)`{additionalProperty: ${i.additionalProperty}}`},code(i){let{gen:c,schema:a,parentSchema:u,data:d,errsCount:m,it:g}=i;if(!m)throw new Error("ajv implementation error");let{allErrors:v,opts:p}=g;if(g.props=!0,p.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(g,a))return;let _=(0,t.allSchemaProperties)(u.properties),h=(0,t.allSchemaProperties)(u.patternProperties);f(),i.ok((0,r._)`${m} === ${o.default.errors}`);function f(){c.forIn("key",d,b=>{!_.length&&!h.length?R(b):c.if(z(b),()=>R(b))})}function z(b){let S;if(_.length>8){let E=(0,n.schemaRefOrVal)(g,u.properties,"properties");S=(0,t.isOwnProperty)(c,E,b)}else _.length?S=(0,r.or)(..._.map(E=>(0,r._)`${b} === ${E}`)):S=r.nil;return h.length&&(S=(0,r.or)(S,...h.map(E=>(0,r._)`${(0,t.usePattern)(i,E)}.test(${b})`))),(0,r.not)(S)}function y(b){c.code((0,r._)`delete ${d}[${b}]`)}function R(b){if(p.removeAdditional==="all"||p.removeAdditional&&a===!1){y(b);return}if(a===!1){i.setParams({additionalProperty:b}),i.error(),v||c.break();return}if(typeof a=="object"&&!(0,n.alwaysValidSchema)(g,a)){let S=c.name("valid");p.removeAdditional==="failing"?(w(b,S,!1),c.if((0,r.not)(S),()=>{i.reset(),y(b)})):(w(b,S),v||c.if((0,r.not)(S),()=>c.break()))}}function w(b,S,E){let j={keyword:"additionalProperties",dataProp:b,dataPropType:n.Type.Str};E===!1&&Object.assign(j,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(j,S)}}};e.default=s})),Iz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=io(),r=mt(),o=_e(),n=i_(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,parentSchema:u,data:d,it:m}=i;m.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(m,n.default,"additionalProperties"));let g=(0,r.allSchemaProperties)(a);for(let f of g)m.definedProperties.add(f);m.opts.unevaluated&&g.length&&m.props!==!0&&(m.props=o.mergeEvaluated.props(c,(0,o.toHash)(g),m.props));let v=g.filter(f=>!(0,o.alwaysValidSchema)(m,a[f]));if(v.length===0)return;let p=c.name("valid");for(let f of v)_(f)?h(f):(c.if((0,r.propertyInData)(c,d,f,m.opts.ownProperties)),h(f),m.allErrors||c.else().var(p,!0),c.endIf()),i.it.definedProperties.add(f),i.ok(p);function _(f){return m.opts.useDefaults&&!m.compositeRule&&a[f].default!==void 0}function h(f){i.subschema({keyword:"properties",schemaProp:f,dataProp:f},p)}}};e.default=s})),Oz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mt(),r=le(),o=_e(),n=_e(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,data:u,parentSchema:d,it:m}=i,{opts:g}=m,v=(0,t.allSchemaProperties)(a),p=v.filter(w=>(0,o.alwaysValidSchema)(m,a[w]));if(v.length===0||p.length===v.length&&(!m.opts.unevaluated||m.props===!0))return;let _=g.strictSchema&&!g.allowMatchingProperties&&d.properties,h=c.name("valid");m.props!==!0&&!(m.props instanceof r.Name)&&(m.props=(0,n.evaluatedPropsToName)(c,m.props));let{props:f}=m;z();function z(){for(let w of v)_&&y(w),m.allErrors?R(w):(c.var(h,!0),R(w),c.if(h))}function y(w){for(let b in _)new RegExp(w).test(b)&&(0,o.checkStrictMode)(m,`property ${b} matches pattern ${w} (use allowMatchingProperties)`)}function R(w){c.forIn("key",u,b=>{c.if((0,r._)`${(0,t.usePattern)(i,w)}.test(${b})`,()=>{let S=p.includes(w);S||i.subschema({keyword:"patternProperties",schemaProp:w,dataProp:b,dataPropType:n.Type.Str},h),m.opts.unevaluated&&f!==!0?c.assign((0,r._)`${f}[${b}]`,!0):!S&&!m.allErrors&&c.if((0,r.not)(h),()=>c.break())})})}}};e.default=s})),Nz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:i}=o;if((0,t.alwaysValidSchema)(i,s)){o.fail();return}let c=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},c),o.failResult(c,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r})),jz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:mt().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t})),xz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,t._)`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:i,parentSchema:c,it:a}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");if(a.opts.discriminator&&c.discriminator)return;let u=i,d=s.let("valid",!1),m=s.let("passing",null),g=s.name("_valid");n.setParams({passing:m}),s.block(v),n.result(d,()=>n.reset(),()=>n.error(!0));function v(){u.forEach((p,_)=>{let h;(0,r.alwaysValidSchema)(a,p)?s.var(g,!0):h=n.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},g),_>0&&s.if((0,t._)`${g} && ${d}`).assign(d,!1).assign(m,(0,t._)`[${m}, ${_}]`).else(),s.if(g,()=>{s.assign(d,!0),s.assign(m,_),h&&n.mergeEvaluated(h,t.Name)})})}}};e.default=o})),Az=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:i}=o;if(!Array.isArray(s))throw new Error("ajv implementation error");let c=n.name("valid");s.forEach((a,u)=>{if((0,t.alwaysValidSchema)(i,a))return;let d=o.subschema({keyword:"allOf",schemaProp:u},c);o.ok(c),o.mergeEvaluated(d)})}};e.default=r})),qz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,t.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,t._)`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:i,parentSchema:c,it:a}=s;c.then===void 0&&c.else===void 0&&(0,r.checkStrictMode)(a,'"if" without "then" and "else" is ignored');let u=n(a,"then"),d=n(a,"else");if(!u&&!d)return;let m=i.let("valid",!0),g=i.name("_valid");if(v(),s.reset(),u&&d){let _=i.let("ifClause");s.setParams({ifClause:_}),i.if(g,p("then",_),p("else",_))}else u?i.if(g,p("then")):i.if((0,t.not)(g),p("else"));s.pass(m,()=>s.error(!0));function v(){let _=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);s.mergeEvaluated(_)}function p(_,h){return()=>{let f=s.subschema({keyword:_},g);i.assign(m,g),s.mergeValidEvaluated(f,m),h?i.assign(h,(0,t._)`${_}`):s.setParams({ifClause:_})}}}};function n(s,i){let c=s.schema[i];return c!==void 0&&!(0,r.alwaysValidSchema)(s,c)}e.default=o})),Mz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){n.if===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r})),a_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n_(),r=Ez(),o=s_(),n=Tz(),s=kz(),i=rd(),c=Cz(),a=i_(),u=Iz(),d=Oz(),m=Nz(),g=jz(),v=xz(),p=Az(),_=qz(),h=Mz();function f(z=!1){let y=[m.default,g.default,v.default,p.default,_.default,h.default,c.default,a.default,i.default,u.default,d.default];return z?y.push(r.default,n.default):y.push(t.default,o.default),y.push(s.default),y}e.default=f})),Lz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must match format "${o}"`,params:({schemaCode:o})=>(0,t._)`{format: ${o}}`},code(o,n){let{gen:s,data:i,$data:c,schema:a,schemaCode:u,it:d}=o,{opts:m,errSchemaPath:g,schemaEnv:v,self:p}=d;if(!m.validateFormats)return;c?_():h();function _(){let f=s.scopeValue("formats",{ref:p.formats,code:m.code.formats}),z=s.const("fDef",(0,t._)`${f}[${u}]`),y=s.let("fType"),R=s.let("format");s.if((0,t._)`typeof ${z} == "object" && !(${z} instanceof RegExp)`,()=>s.assign(y,(0,t._)`${z}.type || "string"`).assign(R,(0,t._)`${z}.validate`),()=>s.assign(y,(0,t._)`"string"`).assign(R,z)),o.fail$data((0,t.or)(w(),b()));function w(){return m.strictSchema===!1?t.nil:(0,t._)`${u} && !${R}`}function b(){let S=v.$async?(0,t._)`(${z}.async ? await ${R}(${i}) : ${R}(${i}))`:(0,t._)`${R}(${i})`,E=(0,t._)`(typeof ${R} == "function" ? ${S} : ${R}.test(${i}))`;return(0,t._)`${R} && ${R} !== true && ${y} === ${n} && !${E}`}}function h(){let f=p.formats[a];if(!f){w();return}if(f===!0)return;let[z,y,R]=b(f);z===n&&o.pass(S());function w(){if(m.strictSchema===!1){p.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${a}" ignored in schema at path "${g}"`}}function b(E){let j=E instanceof RegExp?(0,t.regexpCode)(E):m.code.formats?(0,t._)`${m.code.formats}${(0,t.getProperty)(a)}`:void 0,F=s.scopeValue("formats",{key:a,ref:E,code:j});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,t._)`${F}.validate`]:["string",E,F]}function S(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!v.$async)throw new Error("async format in sync schema");return(0,t._)`await ${R}(${i})`}return typeof y=="function"?(0,t._)`${R}(${i})`:(0,t._)`${R}.test(${i})`}}}};e.default=r})),c_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[Lz().default];e.default=t})),u_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]})),l_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=r_(),r=o_(),o=a_(),n=c_(),s=u_(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i})),Dz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))})),od=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=Dz(),o=Xa(),n=ao(),s=_e(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:a}})=>c===r.DiscrError.Tag?`tag "${a}" must be string`:`value of tag "${a}" must be in oneOf`,params:({params:{discrError:c,tag:a,tagName:u}})=>(0,t._)`{error: ${c}, tag: ${u}, tagValue: ${a}}`},code(c){let{gen:a,data:u,schema:d,parentSchema:m,it:g}=c,{oneOf:v}=m;if(!g.opts.discriminator)throw new Error("discriminator: requires discriminator option");let p=d.propertyName;if(typeof p!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");let _=a.let("valid",!1),h=a.const("tag",(0,t._)`${u}${(0,t.getProperty)(p)}`);a.if((0,t._)`typeof ${h} == "string"`,()=>f(),()=>c.error(!1,{discrError:r.DiscrError.Tag,tag:h,tagName:p})),c.ok(_);function f(){let R=y();a.if(!1);for(let w in R)a.elseIf((0,t._)`${h} === ${w}`),a.assign(_,z(R[w]));a.else(),c.error(!1,{discrError:r.DiscrError.Mapping,tag:h,tagName:p}),a.endIf()}function z(R){let w=a.name("valid"),b=c.subschema({keyword:"oneOf",schemaProp:R},w);return c.mergeEvaluated(b,t.Name),w}function y(){var R;let w={},b=E(m),S=!0;for(let M=0;M<v.length;M++){let Z=v[M];if(Z?.$ref&&!(0,s.schemaHasRulesButRef)(Z,g.self.RULES)){let G=Z.$ref;if(Z=o.resolveRef.call(g.self,g.schemaEnv.root,g.baseId,G),Z instanceof o.SchemaEnv&&(Z=Z.schema),Z===void 0)throw new n.default(g.opts.uriResolver,g.baseId,G)}let Y=(R=Z?.properties)===null||R===void 0?void 0:R[p];if(typeof Y!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);S=S&&(b||E(Z)),j(Y,M)}if(!S)throw new Error(`discriminator: "${p}" must be required`);return w;function E({required:M}){return Array.isArray(M)&&M.includes(p)}function j(M,Z){if(M.const)F(M.const,Z);else if(M.enum)for(let Y of M.enum)F(Y,Z);else throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}function F(M,Z){if(typeof M!="string"||M in w)throw new Error(`discriminator: "${p}" values must be unique strings`);w[M]=Z}}}};e.default=i})),Zz=U(((e,t)=>{t.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}})),d_=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=Ql(),o=l_(),n=od(),s=Zz(),i=["/properties"],c="http://json-schema.org/draft-07/schema";var a=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let v=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(v,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv=a,t.exports=e=a,t.exports.Ajv=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var u=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var m=Mn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return m.default}});var g=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})),p_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=le(),r=pt(),o=Xa(),n=ed(),s={keyword:"$dynamicAnchor",schemaType:"string",code:a=>i(a,a.schema)};function i(a,u){let{gen:d,it:m}=a;m.schemaEnv.root.dynamicAnchors[u]=!0;let g=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,v=m.errSchemaPath==="#"?m.validateName:c(a);d.if((0,t._)`!${g}`,()=>d.assign(g,v))}e.dynamicAnchor=i;function c(a){let{schemaEnv:u,schema:d,self:m}=a.it,{root:g,baseId:v,localRefs:p,meta:_}=u.root,{schemaId:h}=m.opts,f=new o.SchemaEnv({schema:d,schemaId:h,root:g,baseId:v,localRefs:p,meta:_});return o.compileSchema.call(m,f),(0,n.getValidate)(a,f)}e.default=s})),m_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=le(),r=pt(),o=ed(),n={keyword:"$dynamicRef",schemaType:"string",code:i=>s(i,i.schema)};function s(i,c){let{gen:a,keyword:u,it:d}=i;if(c[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);let m=c.slice(1);if(d.allErrors)g();else{let p=a.let("valid",!1);g(p),i.ok(p)}function g(p){if(d.schemaEnv.root.dynamicAnchors[m]){let _=a.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(m)}`);a.if(_,v(_,p),v(d.validateName,p))}else v(d.validateName,p)()}function v(p,_){return _?()=>a.block(()=>{(0,o.callRef)(i,p),a.let(_,!0)}):()=>(0,o.callRef)(i,p)}}e.dynamicRef=s,e.default=n})),Uz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p_(),r=_e(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o})),Vz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=m_(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r})),f_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p_(),r=m_(),o=Uz(),n=Vz(),s=[t.default,r.default,o.default,n.default];e.default=s})),Fz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=rd(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:o=>(0,t.validatePropertyDeps)(o)};e.default=r})),Hz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=rd(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o=>(0,t.validateSchemaDeps)(o)};e.default=r})),Jz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){n.contains===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r})),h_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Fz(),r=Hz(),o=Jz(),n=[t.default,r.default,o.default];e.default=n})),Bz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=pt(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>(0,t._)`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:i,schema:c,data:a,errsCount:u,it:d}=s;if(!u)throw new Error("ajv implementation error");let{allErrors:m,props:g}=d;g instanceof t.Name?i.if((0,t._)`${g} !== true`,()=>i.forIn("key",a,h=>i.if(p(g,h),()=>v(h)))):g!==!0&&i.forIn("key",a,h=>g===void 0?v(h):i.if(_(g,h),()=>v(h))),d.props=!0,s.ok((0,t._)`${u} === ${o.default.errors}`);function v(h){if(c===!1){s.setParams({unevaluatedProperty:h}),s.error(),m||i.break();return}if(!(0,r.alwaysValidSchema)(d,c)){let f=i.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:h,dataPropType:r.Type.Str},f),m||i.if((0,t.not)(f),()=>i.break())}}function p(h,f){return(0,t._)`!${h} || !${h}[${f}]`}function _(h,f){let z=[];for(let y in h)h[y]===!0&&z.push((0,t._)`${f} !== ${y}`);return(0,t.and)(...z)}}};e.default=n})),Kz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>(0,t.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,t._)`{limit: ${n}}`},code(n){let{gen:s,schema:i,data:c,it:a}=n,u=a.items||0;if(u===!0)return;let d=s.const("len",(0,t._)`${c}.length`);if(i===!1)n.setParams({len:u}),n.fail((0,t._)`${d} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(a,i)){let g=s.var("valid",(0,t._)`${d} <= ${u}`);s.if((0,t.not)(g),()=>m(g,u)),n.ok(g)}a.items=!0;function m(g,v){s.forRange("i",v,d,p=>{n.subschema({keyword:"unevaluatedItems",dataProp:p,dataPropType:r.Type.Num},g),a.allErrors||s.if((0,t.not)(g),()=>s.break())})}}};e.default=o})),g_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Bz(),r=Kz(),o=[t.default,r.default];e.default=o})),Gz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}})),Wz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}})),Yz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}})),Xz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}})),Qz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}})),e0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}})),t0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}})),r0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Gz(),r=Wz(),o=Yz(),n=Xz(),s=Qz(),i=e0(),c=t0(),a=["/properties"];function u(d){return[t,r,o,n,m(this,s),i,m(this,c)].forEach(g=>this.addMetaSchema(g,void 0,!1)),this;function m(g,v){return d?g.$dataMetaSchema(v,a):v}}e.default=u})),o0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=Ql(),o=l_(),n=f_(),s=h_(),i=g_(),c=od(),a=r0(),u="https://json-schema.org/draft/2019-09/schema";var d=class extends r.default{constructor(_={}){super({..._,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach(_=>this.addVocabulary(_)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator&&this.addKeyword(c.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:_,meta:h}=this.opts;h&&(a.default.call(this,_),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=d,t.exports=e=d,t.exports.Ajv2019=d,Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var m=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return m.KeywordCxt}});var g=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return g.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return g.CodeGen}});var v=Mn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return v.default}});var p=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})),n0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=r_(),r=o_(),o=a_(),n=f_(),s=h_(),i=g_(),c=c_(),a=u_(),u=[n.default,t.default,r.default,(0,o.default)(!0),c.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];e.default=u})),s0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}})),i0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}})),a0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}})),c0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}})),u0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}})),l0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}})),d0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}})),p0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}})),m0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=s0(),r=i0(),o=a0(),n=c0(),s=u0(),i=l0(),c=d0(),a=p0(),u=["/properties"];function d(m){return[t,r,o,n,s,g(this,i),c,g(this,a)].forEach(v=>this.addMetaSchema(v,void 0,!1)),this;function g(v,p){return m?v.$dataMetaSchema(p,u):p}}e.default=d})),f0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=Ql(),o=n0(),n=od(),s=m0(),i="https://json-schema.org/draft/2020-12/schema";var c=class extends r.default{constructor(g={}){super({...g,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:g,meta:v}=this.opts;v&&(s.default.call(this,g),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv2020=c,t.exports=e=c,t.exports.Ajv2020=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var a=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return a.KeywordCxt}});var u=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=Mn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var m=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})),h0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(M,Z){return{validate:M,compare:Z}}e.fullFormats={date:t(s,i),time:t(a(!0),u),"date-time":t(g(!0),v),"iso-time":t(a(),d),"iso-date-time":t(g(),p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:f,"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:F,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:y,int32:{type:"number",validate:b},int64:{type:"number",validate:S},float:{type:"number",validate:E},double:{type:"number",validate:E},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\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,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"iso-date-time":t(/^\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,p),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},e.formatNames=Object.keys(e.fullFormats);function r(M){return M%4===0&&(M%100!==0||M%400===0)}let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(M){let Z=o.exec(M);if(!Z)return!1;let Y=+Z[1],G=+Z[2],fe=+Z[3];return G>=1&&G<=12&&fe>=1&&fe<=(G===2&&r(Y)?29:n[G])}function i(M,Z){if(M&&Z)return M>Z?1:M<Z?-1:0}let c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function a(M){return function(Y){let G=c.exec(Y);if(!G)return!1;let fe=+G[1],$e=+G[2],be=+G[3],Oe=G[4],he=G[5]==="-"?-1:1,C=+(G[6]||0),x=+(G[7]||0);if(C>23||x>59||M&&!Oe)return!1;if(fe<=23&&$e<=59&&be<60)return!0;let V=$e-x*he,$=fe-C*he-(V<0?1:0);return($===23||$===-1)&&(V===59||V===-1)&&be<61}}function u(M,Z){if(!(M&&Z))return;let Y=new Date("2020-01-01T"+M).valueOf(),G=new Date("2020-01-01T"+Z).valueOf();if(Y&&G)return Y-G}function d(M,Z){if(!(M&&Z))return;let Y=c.exec(M),G=c.exec(Z);if(Y&&G)return M=Y[1]+Y[2]+Y[3],Z=G[1]+G[2]+G[3],M>Z?1:M<Z?-1:0}let m=/t|\s/i;function g(M){let Z=a(M);return function(G){let fe=G.split(m);return fe.length===2&&s(fe[0])&&Z(fe[1])}}function v(M,Z){if(!(M&&Z))return;let Y=new Date(M).valueOf(),G=new Date(Z).valueOf();if(Y&&G)return Y-G}function p(M,Z){if(!(M&&Z))return;let[Y,G]=M.split(m),[fe,$e]=Z.split(m),be=i(Y,fe);if(be!==void 0)return be||u(G,$e)}let _=/\/|:/,h=/^(?:[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 f(M){return _.test(M)&&h.test(M)}let z=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(M){return z.lastIndex=0,z.test(M)}let R=-(2**31),w=2**31-1;function b(M){return Number.isInteger(M)&&M<=w&&M>=R}function S(M){return Number.isInteger(M)}function E(){return!0}let j=/[^\\]\\Z/;function F(M){if(j.test(M))return!1;try{return new RegExp(M),!0}catch{return!1}}})),g0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=d_(),r=le(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:c,schemaCode:a})=>(0,r.str)`should be ${n[c].okStr} ${a}`,params:({keyword:c,schemaCode:a})=>(0,r._)`{comparison: ${n[c].okStr}, limit: ${a}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(c){let{gen:a,data:u,schemaCode:d,keyword:m,it:g}=c,{opts:v,self:p}=g;if(!v.validateFormats)return;let _=new t.KeywordCxt(g,p.RULES.all.format.definition,"format");_.$data?h():f();function h(){let y=a.scopeValue("formats",{ref:p.formats,code:v.code.formats}),R=a.const("fmt",(0,r._)`${y}[${_.schemaCode}]`);c.fail$data((0,r.or)((0,r._)`typeof ${R} != "object"`,(0,r._)`${R} instanceof RegExp`,(0,r._)`typeof ${R}.compare != "function"`,z(R)))}function f(){let y=_.schema,R=p.formats[y];if(!R||R===!0)return;if(typeof R!="object"||R instanceof RegExp||typeof R.compare!="function")throw new Error(`"${m}": format "${y}" does not define "compare" function`);let w=a.scopeValue("formats",{key:y,ref:R,code:v.code.formats?(0,r._)`${v.code.formats}${(0,r.getProperty)(y)}`:void 0});c.fail$data(z(w))}function z(y){return(0,r._)`${y}.compare(${u}, ${d}) ${n[m].fail} 0`}},dependencies:["format"]};let i=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=i})),_0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=h0(),o=g0(),n=le(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),c=(u,d={keywords:!0})=>{if(Array.isArray(d))return a(u,d,r.fullFormats,s),u;let[m,g]=d.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];return a(u,d.formats||r.formatNames,m,g),d.keywords&&(0,o.default)(u),u};c.get=(u,d="full")=>{let m=(d==="fast"?r.fastFormats:r.fullFormats)[u];if(!m)throw new Error(`Unknown format "${u}"`);return m};function a(u,d,m,g){var v,p;(v=(p=u.opts.code).formats)!==null&&v!==void 0||(p.formats=(0,n._)`require("ajv-formats/dist/formats").${g}`);for(let _ of d)u.addFormat(_,m[_])}t.exports=e=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c})),__=d_(),S0=o0(),y0=f0(),v0=is(_0(),1),b0=v0.default;function Xl(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return b0(t),t}var Qa=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=Xl(y0.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Td(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return t==="2020-12"?this.ajv:t==="2019-09"?this._ajv2019??=Xl(S0.Ajv2019):this._ajvDraft7??=Xl(__.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&typeof e.$id=="string"?t.getSchema(e.$id)??t.compile(e):t.compile(e);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}},Jw=__.Ajv;import nd from"node:process";var w_=Symbol.for("mcp.completable");function id(e){return!!e&&typeof e=="object"&&w_ in e}function $0(e){return e[w_]?.complete}var qP=2**31-1;function w0(e){return typeof e=="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver=="function"}var P0=8,E0=6e5;function T0(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??P0,roundTimeoutMs:e?.roundTimeoutMs??E0,legacyShim:e?.legacyShim??!0}}function P_(e,t,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new oe(B.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=r,n=bg(o);if(n===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:n}}function k0(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=[...t].map(o=>o.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function sd(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new oe(B.InternalError,t)}var C0=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:i}=this._host,c=o.mcpReq.signal,a=n,u=0;for(;;){if(u+=1,u>s)return sd(e,Ug(e,s));let d=a.inputRequests,m=d!=null&&Object.keys(d).length>0,g=typeof a.requestState=="string"?a.requestState:void 0;if(!m&&g===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let v;if(m){let h=this._host.resolvedClientCapabilities(o),f=[];for(let[y,R]of Object.entries(d)){let{embedded:w,required:b}=P_(e,y,R);if(w.method!=="roots/list"&&w.params===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input request '${y}' of kind '${w.method}' without params`);if(Za(b,h)!==void 0)return sd(e,`Cannot request input '${y}' (${w.method}): the client on this 2025-era connection did not declare the required capability${h===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);f.push([y,w])}let z=Fg(c);try{let y={relatedRequestId:o.mcpReq.id,timeout:i,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:z.signal},R=await Promise.all(f.map(async([w,b])=>{try{return[w,await this._dispatchLeg(b,y)]}catch(S){throw z.abort(S),S}}));v=Object.fromEntries(R)}catch(y){if(c.aborted)throw y;return sd(e,`Fulfilling input required by '${e}' failed: ${y instanceof Error?y.message:String(y)}`)}finally{z.dispose()}}else await Vg(Zg,c);let p={...o,mcpReq:{...o.mcpReq,inputResponses:v,droppedInputResponseKeys:void 0,requestState:qn(g)}};if(g!==void 0){let h=await this._host.verifyRequestState(g,p,e);h!==void 0&&(p=Jl(p,h))}let _=await t(r,p);if(!Tt(_))return _;a=_}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;return r.mode==="url"&&r.elicitationId===void 0&&(r={...r,elicitationId:k0()}),await this._host.sendElicitation(r,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},I0=new Set(["tools/call","prompts/get","resources/read"]),O0,N0,j0;var E_=class extends Bl{_clientCapabilities;_clientVersion;static{O0=(e,t)=>{t.clientCapabilities!==void 0&&(e._clientCapabilities=t.clientCapabilities),t.clientInfo!==void 0&&(e._clientVersion=t.clientInfo)},N0=(e,t)=>{let r=t.filter(o=>!e._supportedProtocolVersions.includes(o));r.length>0&&(e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r]),e.setRequestHandler("server/discover",()=>e._ondiscover())},j0=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new C0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:e=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){if(super(t),this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Qa,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=T0(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&jl(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),Tl(this._supportedProtocolVersions).length>0&&this.setRequestHandler("server/discover",()=>this._ondiscover()),this._capabilities.logging&&this._registerLoggingHandler()}async connect(e){if(this.transport!==void 0)throw new ue(me.AlreadyConnected,"Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");await super.connect(e)}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let r=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,n=Ha(Bt,o);return n.success&&this._loggingLevels.set(r,n.data),{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let i;if(this._servedModernEra()){if(i=e.mcpReq.envelope?.[Zt],i===void 0)return Promise.resolve()}else i=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);return i!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i)?Promise.resolve():e.mcpReq.notify({method:"notifications/message",params:{level:o,data:n,logger:s}})},elicitInput:(o,n)=>this.elicitInput(o,n),requestSampling:(o,n)=>this.createMessage(o,n)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(Bt.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new ue(me.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;this._capabilities=Kl(this._capabilities,e),!t&&this._capabilities.logging&&this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=I0.has(e);return r===void 0&&!o?async(n,s)=>{let i=await t(n,s);if(Tt(i))throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}:async(n,s)=>{let i=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(Tt(i)){if(!o)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}return r===void 0?i:Ua(i,r)}}return async(r,o)=>{let n=no(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new oe(s.reason==="not-in-era"?B.InternalError:B.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let i=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(Tt(i))return i;let c=kl(i),a=n.validateResult("tools/call",c);if(!a.ok)throw new oe(a.reason==="not-in-era"?B.InternalError:B.InvalidParams,a.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${a.message}`);return a.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&An(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,r,o){let n=this._servedModernEra(),s=o.mcpReq.requestState();if(s!==void 0&&typeof s!="string")throw new oe(B.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let i=o;if(typeof s=="string"){let m=await this._verifyRequestState(s,o,e);m!==void 0&&(i=Jl(o,m))}let c;try{c=await t(r,i)}catch(m){throw m instanceof oe&&m.code===B.UrlElicitationRequired&&n?new oe(B.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`):m}if(!Tt(c))return c;if(!n){if(!this._inputRequiredServing.legacyShim)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??mr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,i,c)}let a=c.inputRequests,u=a!=null&&Object.keys(a).length>0,d=typeof c.requestState=="string";if(!u&&!d)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let m=this._inputRequestCapabilityView(o);for(let[g,v]of Object.entries(a)){let{embedded:p,required:_}=P_(e,g,v),h=Za(_,m);if(h!==void 0)throw new Fa({requiredCapabilities:h},`Cannot request input '${g}' (${p.method}): the request's client capabilities do not declare the required capability`)}}return c}async _verifyRequestState(e,t,r){if(this._requestStateVerify!==void 0)try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(new Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new oe(B.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[Pt]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new ue(me.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new ue(me.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new ue(me.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new ue(me.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new ue(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new ue(me.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new ue(me.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new ue(me.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new ue(me.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new ue(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new ue(me.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new ue(me.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new ue(me.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=zg(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??mr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:Tl(this._supportedProtocolVersions),capabilities:x0(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new ue(me.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),i=Array.isArray(s.content)?s.content:[s.content],c=i.some(m=>m.type==="tool_result"),a=e.messages.length>1?e.messages.at(-2):void 0,u=a?Array.isArray(a.content)?a.content:[a.content]:[],d=u.some(m=>m.type==="tool_use");if(c){if(i.some(m=>m.type!=="tool_result"))throw new oe(B.InvalidParams,"The last message must contain only tool_result content if any is present");if(!d)throw new oe(B.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(d){let m=new Set(u.filter(v=>v.type==="tool_use").map(v=>v.id)),g=new Set(i.filter(v=>v.type==="tool_result").map(v=>v.toolUseId));if(m.size!==g.size||![...m].every(v=>g.has(v)))throw new oe(B.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=!!(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),n=this._wireCodec().samplingResultVariant(r,o);if(!n.ok)throw new ue(me.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new ue(me.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let o=e.mode??"form",n=r?.validateAcceptedContent??!0;switch(o){case"url":{let s=e;return this.request({method:"elicitation/create",params:s},t)}case"form":{let s=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:s},t);if(n&&i.action==="accept"&&i.content&&s.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(s.requestedSchema)(i.content);if(!c.valid)throw new oe(B.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(c){throw c instanceof oe?c:new oe(B.InternalError,`Error validating elicitation response: ${c instanceof Error?c.message:String(c)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}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 x0(e){return{...e}}function A0(e,t){let r=0,o=[e];for(;o.length>0;){let n=o.pop();if(!(n===null||typeof n!="object"))if(Array.isArray(n))for(let s of n){if(++r>t)return r;s!==null&&typeof s=="object"&&o.push(s)}else for(let s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;if(++r>t)return r;let i=n[s];i!==null&&typeof i=="object"&&o.push(i)}}return r}function q0(e){if(!(e===void 0||e===1/0)){if(typeof e!="number"||Number.isNaN(e)||e<1)throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(e)}`);return e}}var ec=class{server;_maxToolInputElements;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(!(t===void 0||!t.enabled)){if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return y_;try{let r=Sr(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new E_(e,t),this._maxToolInputElements=q0(t?.maxToolInputElements),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return w0(e)&&e.setScopeChallengeResolver(t=>this.resolveScopeChallenge(t)),await this.server.connect(e)}async close(){await this.server.close()}resolveScopeChallenge=e=>{switch(e.request.method){case"tools/call":{let t=e.request.params?.name;if(typeof t!="string")return;let r=this._registeredTools[t];return r===void 0||!r.enabled?void 0:r.scopeChallenge?.(e)}case"resources/read":{let t=e.request.params?.uri;if(typeof t!="string")return;let r;try{r=new URL(t)}catch{return}let o=this._registeredResources[r.toString()];if(o!==void 0)return o.enabled?o.scopeChallenge?.(e):void 0;for(let n of Object.values(this._registeredResourceTemplates))if(n.resourceTemplate.uriTemplate.match(r.toString()))return n.enabled?n.scopeChallenge?.(e):void 0;return}case"prompts/get":{let t=e.request.params?.name;if(typeof t!="string")return;let r=this._registeredPrompts[t];return r===void 0||!r.enabled?void 0:r.scopeChallenge?.(e)}default:return}};_toolHandlersInitialized=!1;setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?M0(e,t.inputSchema):y_,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};return t.outputSchema&&(r.outputSchema=Sr(t.outputSchema,"output")),r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new oe(B.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(r,e.params.arguments,e.params.name),n=await this.executeToolHandler(r,o,t);return await this.validateToolOutput(r,n,e.params.name),Tt(n)?n:this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof oe&&o.code===B.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(this._maxToolInputElements!==void 0&&A0(t,this._maxToolInputElements)>this._maxToolInputElements)throw new oe(B.InvalidParams,`Invalid arguments for tool ${r}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!e.inputSchema)return;let o=await _r(e.inputSchema,t??{});if(!o.success)throw new oe(B.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema||Tt(t)||t.isError)return;if(t.structuredContent===void 0)throw new oe(B.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await _r(e.outputSchema,t.structuredContent);if(!o.success)throw new oe(B.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${o.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async e=>{switch(e.params.ref.type){case"ref/prompt":return Ul(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Vl(e),this.handleResourceCompletion(e,e.params.ref);default:throw new oe(B.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new oe(B.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Ln;let o=$_(R_(r.argsSchema)?.[e.params.argument.name]);if(!id(o))return Ln;let n=$0(o);return n?z_(await n(e.params.argument.value,e.params.context)):Ln}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find(n=>n.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return Ln;throw new oe(B.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?z_(await o(e.params.argument.value,e.params.context)):Ln}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),o=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(t);for(let i of s.resources)o.push({...n.metadata,...i})}return{resources:[...r,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new oe(B.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[r.toString()];if(o){if(!o.enabled)throw new oe(B.InvalidParams,`Resource ${r} disabled`);return Ua(await o.readCallback(r,t),o.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s){if(!n.enabled)throw new oe(B.InvalidParams,`Resource template ${n.resourceTemplate.uriTemplate} disabled`);return Ua(await n.readCallback(r,s,t),n.cacheHint)}}throw new Va(e.params.uri)}),this._resourceHandlersInitialized=!0)}_promptHandlersInitialized=!1;setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?Dg(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new oe(B.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0)}registerResource(e,t,r,o){let{cacheHint:n,scopeChallenge:s,...i}=r,c=i;if(n!==void 0&&jl(n,`resource ${e}`),typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let a=this._createRegisteredResource(e,r.title,t,c,s,o);return n!==void 0&&(a.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let a=this._createRegisteredResourceTemplate(e,r.title,t,c,s,o);return n!==void 0&&(a.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}_createRegisteredResource(e,t,r,o,n,s){let i={name:e,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:c=>{c.uri!==void 0&&c.uri!==r&&(delete this._registeredResources[r],c.uri&&(this._registeredResources[c.uri]=i)),c.name!==void 0&&(i.name=c.name),c.title!==void 0&&(i.title=c.title),c.metadata!==void 0&&(i.metadata=c.metadata),c.callback!==void 0&&(i.readCallback=c.callback),c.scopeChallenge!==void 0&&(i.scopeChallenge=c.scopeChallenge===null?void 0:c.scopeChallenge),c.enabled!==void 0&&(i.enabled=c.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=i,i}_createRegisteredResourceTemplate(e,t,r,o,n,s){let i={resourceTemplate:r,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:a=>{a.name!==void 0&&a.name!==e&&(delete this._registeredResourceTemplates[e],a.name&&(this._registeredResourceTemplates[a.name]=i)),a.title!==void 0&&(i.title=a.title),a.template!==void 0&&(i.resourceTemplate=a.template),a.metadata!==void 0&&(i.metadata=a.metadata),a.callback!==void 0&&(i.readCallback=a.callback),a.scopeChallenge!==void 0&&(i.scopeChallenge=a.scopeChallenge===null?void 0:a.scopeChallenge),a.enabled!==void 0&&(i.enabled=a.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let c=r.uriTemplate.variableNames;return Array.isArray(c)&&c.some(a=>!!r.completeCallback(a))&&this.setCompletionRequestHandler(),i}_createRegisteredPrompt(e,t,r,o,n,s,i,c){let a=o,u=n,d={title:t,description:r,argsSchema:o,icons:s,scopeChallenge:i,_meta:c,handler:b_(e,o,n),enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:m=>{m.name!==void 0&&m.name!==e&&(delete this._registeredPrompts[e],m.name&&(this._registeredPrompts[m.name]=d)),m.title!==void 0&&(d.title=m.title),m.description!==void 0&&(d.description=m.description),m.icons!==void 0&&(d.icons=m.icons),m.scopeChallenge!==void 0&&(d.scopeChallenge=m.scopeChallenge===null?void 0:m.scopeChallenge),m._meta!==void 0&&(d._meta=m._meta);let g=!1;m.argsSchema!==void 0&&(d.argsSchema=m.argsSchema,a=m.argsSchema,g=!0),m.callback!==void 0&&(u=m.callback,g=!0),g&&(d.handler=b_(e,a,u)),m.enabled!==void 0&&(d.enabled=m.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=d,o){let m=R_(o);m&&Object.values(m).some(g=>id($_(g)))&&this.setCompletionRequestHandler()}return d}_createRegisteredTool(e,t,r,o,n,s,i,c,a,u,d){Yl(e);let m=d,g,v={title:t,description:r,inputSchema:o,outputSchema:n,get outputSchemaJson(){return g??=v_(v.outputSchema)},set outputSchemaJson(p){g=p},annotations:s,icons:i,execution:c,scopeChallenge:a,_meta:u,handler:d,executor:S_(o,d),enabled:!0,disable:()=>v.update({enabled:!1}),enable:()=>v.update({enabled:!0}),remove:()=>v.update({name:null}),update:p=>{p.name!==void 0&&p.name!==e&&(typeof p.name=="string"&&Yl(p.name),delete this._registeredTools[e],delete this._toolInputSchemaJson[e],p.name&&(delete this._toolInputSchemaJson[p.name],this._registeredTools[p.name]=v,e=p.name)),p.title!==void 0&&(v.title=p.title),p.description!==void 0&&(v.description=p.description);let _=!1;p.paramsSchema!==void 0&&(v.inputSchema=p.paramsSchema,delete this._toolInputSchemaJson[e],_=!0),p.callback!==void 0&&(v.handler=p.callback,m=p.callback,_=!0),_&&(v.executor=S_(v.inputSchema,m)),p.outputSchema!==void 0&&(v.outputSchema=p.outputSchema,v.outputSchemaJson=v_(p.outputSchema)),p.annotations!==void 0&&(v.annotations=p.annotations),p.icons!==void 0&&(v.icons=p.icons),p.scopeChallenge!==void 0&&(v.scopeChallenge=p.scopeChallenge===null?void 0:p.scopeChallenge),p._meta!==void 0&&(v._meta=p._meta),p.enabled!==void 0&&(v.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=v,this.setToolRequestHandlers(),this.sendToolListChanged(),v}registerTool(e,t,r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:s,outputSchema:i,annotations:c,icons:a,scopeChallenge:u,_meta:d}=t;return this._createRegisteredTool(e,o,n,Ja(s),Ja(i),c,a,void 0,u,d,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:s,icons:i,scopeChallenge:c,_meta:a}=t,u=this._createRegisteredPrompt(e,o,n,Ja(s),r,i,c,a);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),u}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};function S_(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var y_={type:"object",properties:{}};function M0(e,t){let r=Sr(t,"input"),o=Fl(r);return o.valid||console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${o.reason}`),r}function v_(e){if(e!==void 0)try{return Sr(e,"output")}catch{return}}function b_(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await _r(t,n??{});if(!i.success)throw new oe(B.InvalidParams,`Invalid arguments for prompt ${e}: ${i.error}`);return o(i.data,s)}}else{let o=r;return async(n,s)=>o(s)}}function z_(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Ln={completion:{values:[],hasMore:!1}};function R_(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function L0(e){return e?.type==="optional"}function $_(e){return L0(e)?e.def?.innerType??e:e}var IE=4*1024*1024;var T_=Symbol("swallowsErrorsAfterClose"),k_=class{_readBuffer;_started=!1;_closed=!1;constructor(e=nd.stdin,t=nd.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new Gl({maxBufferSize:r?.maxBufferSize})}onclose;onerror;onmessage;_ondata=e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(t){this.onerror?.(t),this.close().catch(()=>{})}};_onerror=e=>{this.onerror?.(e)};_onstdouterror=e=>{this._closed||(this.onerror?.(e),this.close().catch(()=>{}))};_onstdinclose=()=>{this.close().catch(()=>{})};async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0;for(let e of this._stdout.listeners("error"))e[T_]&&this._stdout.off("error",e);(this._stdin.readableEnded||this._stdin.destroyed)&&setImmediate(this._onstdinclose),this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdin.on("end",this._onstdinclose),this._stdin.on("close",this._onstdinclose),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._closed||(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.off("end",this._onstdinclose),this._stdin.off("close",this._onstdinclose),this._onstdouterror[T_]=!0,this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.())}send(e){return this._closed?Promise.reject(new Error("StdioServerTransport is closed")):new Promise((t,r)=>{let o=Wl(e),n=!1,s=c=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),r(c))},i=()=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),t())};if(this._stdout.once("error",s),this._stdout.write(o)){if(n)return;n=!0,this._stdout.off("error",s),t()}else n||this._stdout.once("drain",i)})}};import{isAbsolute as B0}from"node:path";function C_(e,t){let r=e.find(o=>o.id===t);if(r?.kind!=="select")throw new Error(`no select option "${t}"`);return r.choices.map(o=>o.value)}var I_={kind:"document",path:"/forge.pdf",format:"pdf",bytes:0,pages:2,encrypted:!1},K0=pd(),G0=bd.map(e=>e.id),W0=C_(yd.options([I_],{},uc),"degrees").map(Number),GE=C_(vd.options([I_],{},uc),"mode");var tc=l().refine(B0,"must be an absolute path").describe("An absolute path."),rc=I(tc).min(1),Y0=Lt("mode",[P({mode:O("every-page")}),P({mode:O("every-n"),n:L().int().min(1)}),P({mode:O("points"),after:I(L().int().min(1)).min(1).describe("Cut after these pages (1-based).")})]).describe("How to split: every page, every N pages, or after the given pages."),O_=P({paths:rc.describe("Absolute paths of files (or folders) to inspect.")}),N_=P({}),j_=P({paths:rc.describe("Absolute paths of files, folders or globs to convert."),to:ce(K0).optional().describe(`Target format id. Use "jpeg" for JPG. Required, except with trim, crop or resize, which keep each image's own format when it is omitted.`),output:tc.optional().describe("A folder (or, for one input, a file) to write to. Default: beside each source."),quality:L().int().min(1).max(100).optional().describe("For lossy targets, 1-100."),dpi:L().int().min(36).max(600).optional().describe("PDF \u2192 image resolution. Default 150."),pages:l().optional().describe('PDF \u2192 image page selection, e.g. "3-7,12". Default all.'),background:l().optional().describe("Fill colour when transparency must be flattened. Default #ffffff."),keepMetadata:H().optional().describe("Keep EXIF and GPS data. Default false."),password:l().optional().describe("Password for an encrypted PDF. Never echoed back."),overwrite:H().optional().describe("Replace existing outputs. Default false \u2014 only when the user asked."),recursive:H().optional().describe("Descend into subfolders of a folder input."),trim:H().optional().describe("Images only: cut transparent or solid-colour edges, writing name-trimmed. Keeps the format unless `to` is given. Refused for animated images and when nothing would be trimmed (unless also resizing)."),crop:l().optional().describe('Images only: cut to a shape W:H (e.g. "1:1", "4:5", "16:9", "9:16"; whole numbers 1-100), the largest box that fits, placed to keep the subject; writes name-cropped-1x1, or name-cropped-1x1-<W>x<H> with resize, which then applies to the cropped image. Keeps the format unless `to` is given. Refused for animated images and when the image already has that shape (unless also resizing). Not with trim.'),resize:W([Me({percent:L().min(1).max(fd)}),Me({width:L().int().min(1)}),Me({height:L().int().min(1)})]).optional().describe("Images only: resize to { percent } of the size (1-200), or an exact { width } or { height } with the other side following. Writes name-<W>x<H>; with trim, name-trimmed-<50pct|1200w|900h>. Keeps the format unless `to` is given. No side over 16384 px, no more than 100 MP."),sharpen:H().optional().describe("Images only: sharpen at the same size with the optional boost extension, writing name-sharp. `to` is then the output format. Fails with extension-missing when it is not installed; the fix is `forge extensions add boost`."),boost:W([O(2),O(3),O(4)]).optional().describe("Images only: enlarge 2, 3 or 4 times with the optional boost extension, writing name-2x / name-3x / name-4x. `to` is then the output format (png keeps transparency). Fails with extension-missing when it is not installed; the fix is `forge extensions add boost`. 3 needs boost 1.1.0 or later: an older install fails with extension-outdated, fixed by the same command; while no released boost makes 3 it fails with invalid-arguments naming the factors that work."),removeBackground:H().optional().describe("Images only: cut out the subject with the optional remove-background extension, writing name-cutout. `to` must carry transparency (png, webp, avif, tiff). Fails with extension-missing when it is not installed; the fix is `forge extensions add remove-background`.")}),x_=P({paths:rc.describe("Absolute paths of files to compress."),quality:L().int().min(1).max(100).optional().describe("Compress to this quality."),maxSize:l().optional().describe('Compress until it fits, e.g. "500kb" or "2mb".'),dpi:L().int().min(36).max(600).optional().describe("For a PDF: image resolution."),output:tc.optional().describe("A folder or file to write to."),overwrite:H().optional().describe("Replace existing outputs. Default false.")}).refine(e=>e.quality===void 0!=(e.maxSize===void 0),{message:"Give exactly one of quality or maxSize."}),A_=P({op:ce(G0).describe("The page operation."),paths:rc.describe("Absolute PDF paths. merge takes two or more, in order; the others take one."),pages:l().optional().describe('extract / delete: which pages, e.g. "3-7,12".'),separate:H().optional().describe("extract: one file per page."),degrees:O(W0).optional().describe("rotate: degrees clockwise."),split:Y0.optional(),overwrite:H().optional().describe("Replace existing outputs. Default false.")}),Dn=Me({path:l().optional(),code:l(),title:l(),detail:l(),hint:l().optional()}),X0=Me({op:l(),source:l(),sources:I(l()),outputs:I(l()),inputBytes:L(),outputBytes:L(),warnings:I(Me({code:l(),message:l()}))}),oc=Me({forge:l(),ok:H(),results:I(X0),failures:I(Dn)}),q_=Me({forge:l(),ok:H(),probes:I(Me({path:l(),kind:ce(["image","document"]),format:l(),bytes:L(),width:L().optional(),height:L().optional(),pages:L().optional(),encrypted:H().optional(),targets:I(l()),actions:I(l())})),failures:I(Dn)}),M_=Me({forge:l(),ok:H(),formats:I(Me({id:l(),label:l(),extensions:I(l()),read:H(),write:H(),lossy:H()})),failures:I(Dn)}),L_=l().describe("A colour: #RRGGBB, #RGB (or without the #), rgb(), hsl(), oklch(), or a CSS or common colour name"),D_=P({path:tc.describe("An image file (absolute path): a photo, a screenshot or artwork"),inside:L_.optional().describe("Show the shades of the palette colour nearest this one")}),Z_=P({colour:L_}),U_=Me({forge:l(),ok:H(),palette:Me({source:l(),inside:l().optional(),colours:I(Me({hex:l(),rgb:l(),oklch:l(),share:L()}))}),failures:I(Dn)}),V_=Me({forge:l(),ok:H(),scale:Me({reference:l(),steps:I(Me({step:L(),hex:l(),oklch:l(),white:L(),black:L()}))}),failures:I(Dn)});import{Writable as Q0}from"node:stream";function F_(e=process.stdout,t=process.stderr){let r=e.write.bind(e);return e.write=t.write.bind(t),new Q0({write(o,n,s){r(o,n,s)}})}import{basename as eR}from"node:path";import{pathToFileURL as tR}from"node:url";var H_={interactive:!1},J_=Promise.resolve();function rR(e){let t=J_.then(e,e);return J_=t.catch(()=>{}),t}var Zn=(e,t)=>rR(()=>$d(e,t===void 0?H_:{...H_,signal:t}));function B_(e){let t=e.path===void 0?"":` (${e.path})`,r=e.hint===void 0?"":` ${e.hint}`;return`\u2715 ${e.title}${t}: ${e.detail}${r}`}function K_(e){let t=e.results.map(o=>`\u2713 ${o.source} \u2192 ${o.outputs.join(", ")}`);t.push(...e.failures.map(B_));let r=e.results.flatMap(o=>o.outputs).map(o=>({type:"resource_link",uri:tR(o).href,name:eR(o)}));return{content:[{type:"text",text:t.join(`
69
69
  `)||"Nothing to do."},...r],structuredContent:{...e},isError:!e.ok}}var Un=e=>K_(hd(ar,e)),Wt=e=>K_(gd(ar,e));async function G_(e){let t=Sd(ar,await zd(e.paths)),r=t.probes.map(o=>{let n=o.pages===void 0?`${o.width}\xD7${o.height}`:`${o.pages} pages`;return`${o.path}: ${o.format}, ${o.bytes} bytes, ${n}${o.encrypted?", password-protected":""}. Can become: ${o.targets.join(", ")}. Actions: ${o.actions.join(", ")}.`});return r.push(...t.failures.map(B_)),{content:[{type:"text",text:r.join(`
70
70
  `)}],structuredContent:{...t},isError:!t.ok}}function W_(){let e=_d(ar,md());return{content:[{type:"text",text:e.formats.map(r=>{let o=r.read&&r.write?"read and write":r.read?"read only":"write only";return`${r.id} (${r.extensions.join(" ")}): ${o}`}).join(`
71
- `)}],structuredContent:{...e}}}async function Y_(e,t){let r=[...e.sharpen===!0?["sharpen"]:[],...e.boost!==void 0?["boost"]:[],...e.removeBackground===!0?["removeBackground"]:[]];if(e.trim===!0||e.crop!==void 0||e.resize!==void 0){let i=e.crop!==void 0?"crop":e.trim===!0?"trim":"resize",c=[...e.crop!==void 0&&e.trim===!0?["trim"]:[],...r,...e.pages!==void 0?["pages"]:[]][0];if(c!==void 0)return Wt(ct(`${i} cannot be combined with ${c}.`,"Run them one after the other."));let a;if(e.crop!==void 0)try{a={aspect:dd(e.crop)}}catch(d){if(!cc(d))throw d;return Wt(ct(d.detail,'Try crop "1:1" or "16:9".'))}let u={kind:"edit",inputs:e.paths,trim:e.trim===!0,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...a===void 0?{}:{crop:a},...e.resize===void 0?{}:{resize:e.resize},...e.to===void 0?{}:{target:e.to},...e.output===void 0?{}:{output:e.output}};return Un(await Zn(u))}if(e.to===void 0)return Wt(ct("forge_convert needs `to`, the target format.","Only trim, crop and resize may leave it out, to keep each image's own format."));let n=e.to;if(r.length>0){if(r.length>1)return Wt(ct(`Use one operation at a time \u2014 got ${r.join(" and ")}.`));let i=e.sharpen===!0?1:e.boost,c={kind:"extension-op",op:i!==void 0?"boost":"remove-background",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...i===void 0?{}:{scale:i},...e.output===void 0?{}:{output:e.output}};return Un(await Zn(c,t))}let s={kind:"convert",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,dpi:e.dpi??150,passwordStdin:!1,...e.output===void 0?{}:{output:e.output},...e.pages===void 0?{}:{pages:e.pages},...e.password===void 0?{}:{password:e.password}};return Un(await Zn(s))}async function X_(e){let t={kind:"compress",inputs:e.paths,options:{background:"#ffffff",keepMetadata:!1},force:e.overwrite??!1,recursive:!1,debug:!1};if(e.quality!==void 0&&(t.quality=e.quality),e.maxSize!==void 0){let r=ld(e.maxSize);if(r===void 0)return Wt(ct(`${e.maxSize} is not a size.`,"Try a number with a unit, for example 500kb, 2mb or 1.5mb."));t.maxBytes=r}return e.dpi!==void 0&&(t.dpi=e.dpi),e.output!==void 0&&(t.output=e.output),Un(await Zn(t))}async function Q_(e){let t={kind:"pageop",action:e.op,inputs:e.paths,force:e.overwrite??!1,debug:!1};if(e.op==="extract"||e.op==="delete"){if(e.pages===void 0)return Wt(ct(`${e.op} needs pages, for example "3-7,12".`));t.pages=e.pages,e.op==="extract"&&e.separate===!0&&(t.separate=!0)}if(e.op==="rotate"){if(e.degrees===void 0)return Wt(ct("rotate needs degrees: 90, 180 or 270."));t.rotate=e.degrees}if(e.op==="split"){if(e.split===void 0)return Wt(ct("split needs a split mode: every-page, every-n or points."));t.split=e.split}return Un(await Zn(t))}function ad(e){return{content:[{type:"text",text:e}],isError:!0}}async function eS(e){let t=e.inside===void 0?void 0:ac(e.inside)?.rgb;if(e.inside!==void 0&&!t)return ad(`${e.inside} is not a colour. Try #RRGGBB.`);try{let{runPalette:r}=await import("./colour-D7L5VGQC.js"),o=await r({kind:"palette",input:e.path,svg:!1,...t?{inside:t}:{}},{json:!0,colour:!1}),n=JSON.parse(o.stdout[0]??"{}"),s=Rd(n.palette.colours.map(c=>c.share));return{content:[{type:"text",text:n.palette.colours.map((c,a)=>`${c.hex} ${s[a]}%`).join(`
72
- `)}],structuredContent:{...n}}}catch(r){if(cc(r))return ad(`${r.title}: ${r.detail}${r.hint?` ${r.hint}`:""}`);throw r}}async function tS(e){let t=ac(e.colour)?.rgb;if(!t)return ad(`${e.colour} is not a colour. Try #RRGGBB, rgb(), hsl(), oklch() or a colour name.`);let{runScale:r}=await import("./colour-D7L5VGQC.js"),o=await r({kind:"scale",colour:t,svg:!1},{json:!0,colour:!1}),n=JSON.parse(o.stdout[0]??"{}");return{content:[{type:"text",text:n.scale.steps.map(i=>`${i.step} ${i.hex} white ${i.white} black ${i.black}`).join(`
71
+ `)}],structuredContent:{...e}}}async function Y_(e,t){let r=[...e.sharpen===!0?["sharpen"]:[],...e.boost!==void 0?["boost"]:[],...e.removeBackground===!0?["removeBackground"]:[]];if(e.trim===!0||e.crop!==void 0||e.resize!==void 0){let i=e.crop!==void 0?"crop":e.trim===!0?"trim":"resize",c=[...e.crop!==void 0&&e.trim===!0?["trim"]:[],...r,...e.pages!==void 0?["pages"]:[]][0];if(c!==void 0)return Wt(ct(`${i} cannot be combined with ${c}.`,"Run them one after the other."));let a;if(e.crop!==void 0)try{a={aspect:dd(e.crop)}}catch(d){if(!cc(d))throw d;return Wt(ct(d.detail,'Try crop "1:1" or "16:9".'))}let u={kind:"edit",inputs:e.paths,trim:e.trim===!0,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...a===void 0?{}:{crop:a},...e.resize===void 0?{}:{resize:e.resize},...e.to===void 0?{}:{target:e.to},...e.output===void 0?{}:{output:e.output}};return Un(await Zn(u))}if(e.to===void 0)return Wt(ct("forge_convert needs `to`, the target format.","Only trim, crop and resize may leave it out, to keep each image's own format."));let n=e.to;if(r.length>0){if(r.length>1)return Wt(ct(`Use one operation at a time \u2014 got ${r.join(" and ")}.`));let i=e.sharpen===!0?1:e.boost,c={kind:"extension-op",op:i!==void 0?"boost":"remove-background",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...i===void 0?{}:{scale:i},...e.output===void 0?{}:{output:e.output}};return Un(await Zn(c,t))}let s={kind:"convert",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,dpi:e.dpi??150,passwordStdin:!1,...e.output===void 0?{}:{output:e.output},...e.pages===void 0?{}:{pages:e.pages},...e.password===void 0?{}:{password:e.password}};return Un(await Zn(s))}async function X_(e){let t={kind:"compress",inputs:e.paths,options:{background:"#ffffff",keepMetadata:!1},force:e.overwrite??!1,recursive:!1,debug:!1};if(e.quality!==void 0&&(t.quality=e.quality),e.maxSize!==void 0){let r=ld(e.maxSize);if(r===void 0)return Wt(ct(`${e.maxSize} is not a size.`,"Try a number with a unit, for example 500kb, 2mb or 1.5mb."));t.maxBytes=r}return e.dpi!==void 0&&(t.dpi=e.dpi),e.output!==void 0&&(t.output=e.output),Un(await Zn(t))}async function Q_(e){let t={kind:"pageop",action:e.op,inputs:e.paths,force:e.overwrite??!1,debug:!1};if(e.op==="extract"||e.op==="delete"){if(e.pages===void 0)return Wt(ct(`${e.op} needs pages, for example "3-7,12".`));t.pages=e.pages,e.op==="extract"&&e.separate===!0&&(t.separate=!0)}if(e.op==="rotate"){if(e.degrees===void 0)return Wt(ct("rotate needs degrees: 90, 180 or 270."));t.rotate=e.degrees}if(e.op==="split"){if(e.split===void 0)return Wt(ct("split needs a split mode: every-page, every-n or points."));t.split=e.split}return Un(await Zn(t))}function ad(e){return{content:[{type:"text",text:e}],isError:!0}}async function eS(e){let t=e.inside===void 0?void 0:ac(e.inside)?.rgb;if(e.inside!==void 0&&!t)return ad(`${e.inside} is not a colour. Try #RRGGBB.`);try{let{runPalette:r}=await import("./colour-VIZLKX46.js"),o=await r({kind:"palette",input:e.path,svg:!1,...t?{inside:t}:{}},{json:!0,colour:!1}),n=JSON.parse(o.stdout[0]??"{}"),s=Rd(n.palette.colours.map(c=>c.share));return{content:[{type:"text",text:n.palette.colours.map((c,a)=>`${c.hex} ${s[a]}%`).join(`
72
+ `)}],structuredContent:{...n}}}catch(r){if(cc(r))return ad(`${r.title}: ${r.detail}${r.hint?` ${r.hint}`:""}`);throw r}}async function tS(e){let t=ac(e.colour)?.rgb;if(!t)return ad(`${e.colour} is not a colour. Try #RRGGBB, rgb(), hsl(), oklch() or a colour name.`);let{runScale:r}=await import("./colour-VIZLKX46.js"),o=await r({kind:"scale",colour:t,svg:!1},{json:!0,colour:!1}),n=JSON.parse(o.stdout[0]??"{}");return{content:[{type:"text",text:n.scale.steps.map(i=>`${i.step} ${i.hex} white ${i.white} black ${i.black}`).join(`
73
73
  `)}],structuredContent:{...n}}}function oR(e=process.platform){return[`Forge converts, compresses and edits files on this ${e==="win32"?"PC":"Mac"}, locally.`,"Every path must be absolute.","Call forge_probe first: it says what a file is, every format it can become, and every action that applies.","Nothing is overwritten unless you pass overwrite: true \u2014 only do that when the user asked to replace a file.","A failure hint that mentions --force means overwrite: true here; --output means the output argument; --password-stdin means the password argument."].join(" ")}var nR=oR(),nc={readOnlyHint:!0,openWorldHint:!1},cd={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1};function sR(){let e=new ec({name:"forge",version:ar},{instructions:nR});return e.registerTool("forge_probe",{title:"Inspect files",description:"What each file is and what Forge can do with it: format (read from content, not the extension), size, pages or dimensions, whether it is password-protected, every format it can become, and every action that applies. Writes nothing.",inputSchema:O_,outputSchema:q_,annotations:nc},t=>G_(t)),e.registerTool("forge_formats",{title:"List formats",description:"Every format Forge reads and writes. Writes nothing.",inputSchema:N_,outputSchema:M_,annotations:nc},()=>W_()),e.registerTool("forge_convert",{title:"Convert files",description:"Convert files to another format, beside each source unless output is given. A PDF becomes one image per page (choose pages and dpi); Word documents become PDF; images convert between formats; with trim, crop (to a shape such as 1:1, keeping the subject) or resize they keep their format unless `to` is given. Returns every output path and a file:// link to each.",inputSchema:j_,outputSchema:oc,annotations:cd},(t,r)=>Y_(t,r.mcpReq.signal)),e.registerTool("forge_compress",{title:"Compress files",description:'Make files smaller without changing their format: by quality (1-100) or to fit a size such as "500kb". Writes <name>-small.<ext> beside the source unless output is given. A lossless format such as PNG cannot be compressed; convert it instead.',inputSchema:x_,outputSchema:oc,annotations:cd},t=>X_(t)),e.registerTool("forge_pdf",{title:"PDF page operations",description:"merge (two or more PDFs, in order), split, extract, delete or rotate pages. Writes new files beside the source and never edits the original. Password-protected PDFs are refused.",inputSchema:A_,outputSchema:oc,annotations:cd},t=>Q_(t)),e.registerTool("forge_palette",{title:"Colours of an image",description:"An image's main colours, most of the image first, each as hex, rgb and OKLCH with its share. With inside, the shades that one colour is made of. Writes nothing.",inputSchema:D_,outputSchema:U_,annotations:nc},t=>eS(t)),e.registerTool("forge_scale",{title:"Tonal scale",description:"A 50\u2013950 tonal scale built in OKLCH with the given colour at 500, each step with its contrast against white and black text. Writes nothing.",inputSchema:Z_,outputSchema:V_,annotations:nc},t=>tS(t)),e}async function yT(e){if(e.length>0)throw ct(`forge mcp takes no arguments, got: ${e.join(" ")}.`,"Register it with your agent, for example: claude mcp add forge -- forge mcp");let t=F_();await sR().connect(new k_(process.stdin,t))}export{nR as INSTRUCTIONS,sR as createForgeServer,oR as instructionsFor,yT as runMcpServer};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __forgeCreateRequire } from 'node:module';
2
2
  const require = __forgeCreateRequire(import.meta.url);
3
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v}from"./chunk-G4DU5ADF.js";import"./chunk-TMUK2DD3.js";export{t as BAR,c as DARK,d as LIGHT,g as MODE_KEYS,j as MODE_MARKERS,f as MODE_ORDER,e as NEUTRAL,b as SYMBOLS,a as VERSION,v as applyColourPreference,u as colourEnabled,s as colourProp,o as commandsPalette,n as dotGradient,k as modeColours,i as modeForKey,l as modeGradient,p as modePalette,m as modeWash,q as paintsCanvas,r as paletteFor,h as tabStep};
3
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v}from"./chunk-2BCNTUEO.js";import"./chunk-TMUK2DD3.js";export{t as BAR,c as DARK,d as LIGHT,g as MODE_KEYS,j as MODE_MARKERS,f as MODE_ORDER,e as NEUTRAL,b as SYMBOLS,a as VERSION,v as applyColourPreference,u as colourEnabled,s as colourProp,o as commandsPalette,n as dotGradient,k as modeColours,i as modeForKey,l as modeGradient,p as modePalette,m as modeWash,q as paintsCanvas,r as paletteFor,h as tabStep};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __forgeCreateRequire } from 'node:module';
2
2
  const require = __forgeCreateRequire(import.meta.url);
3
- import{b as m,c as w,d as h,f as l,g as p,h as b}from"./chunk-X54KIHCN.js";import{c as u,d as $}from"./chunk-G4DU5ADF.js";import{e as g}from"./chunk-H2IUSPAK.js";import"./chunk-HON4OV7M.js";import"./chunk-TMUK2DD3.js";import{spawn as x}from"node:child_process";var P=60;function v(t,n){let e=Number.parseInt(t.slice(1),16);return`\x1B[${n};2;${e>>16&255};${e>>8&255};${e&255}m`}function C(t,n,e){let i=[" \u2191 ",`Forge ${t} is available`,` \xB7 your version ${n}`],r=[" In terminal: ","forge update"];if(e===void 0)return[i.join(""),r.join("")];let s=v(e.newTagBg,48),o=f=>v(f,38),c="\x1B[1m",a="\x1B[0m",d=f=>" ".repeat(Math.max(0,P-f.join("").length));return[`${s}${o(e.newTag)}${c}${i[0]}${o(e.fg)}${i[1]}${a}${s}${o(e.dim)}${i[2]}${d(i)}${a}`,`${s}${o(e.dim)}${r[0]}${o(e.fg)}${c}${r[1]}${a}${s}${d(r)}${a}`]}async function I(t,n){let e=n.now??Date.now(),{prefs:i}=await g();if(!h(i,n.env??process.env))return[];let r=await l();b(r,e)&&n.refresh();let s=r?.latest;if(r===void 0||s===void 0||!w(s,t))return[];let o=r.notifiedAt;if(o!==void 0&&o<=e&&e-o<=m)return[];await p({...r,notifiedAt:e}).catch(()=>{});let c=n.colour?i.theme==="light"?$:u:void 0;return C(s,t,c)}function N(t,n=process.platform,e=x){if(t!==void 0)try{e(process.execPath,[...process.execArgv,t,"__update-check"],{detached:!0,stdio:"ignore",...n==="win32"?{windowsHide:!0}:{}}).unref()}catch{}}export{I as afterCommand,C as noteLines,N as spawnRefresh};
3
+ import{b as m,c as w,d as h,f as l,g as p,h as b}from"./chunk-X54KIHCN.js";import{c as u,d as $}from"./chunk-2BCNTUEO.js";import{e as g}from"./chunk-H2IUSPAK.js";import"./chunk-HON4OV7M.js";import"./chunk-TMUK2DD3.js";import{spawn as x}from"node:child_process";var P=60;function v(t,n){let e=Number.parseInt(t.slice(1),16);return`\x1B[${n};2;${e>>16&255};${e>>8&255};${e&255}m`}function C(t,n,e){let i=[" \u2191 ",`Forge ${t} is available`,` \xB7 your version ${n}`],r=[" In terminal: ","forge update"];if(e===void 0)return[i.join(""),r.join("")];let s=v(e.newTagBg,48),o=f=>v(f,38),c="\x1B[1m",a="\x1B[0m",d=f=>" ".repeat(Math.max(0,P-f.join("").length));return[`${s}${o(e.newTag)}${c}${i[0]}${o(e.fg)}${i[1]}${a}${s}${o(e.dim)}${i[2]}${d(i)}${a}`,`${s}${o(e.dim)}${r[0]}${o(e.fg)}${c}${r[1]}${a}${s}${d(r)}${a}`]}async function I(t,n){let e=n.now??Date.now(),{prefs:i}=await g();if(!h(i,n.env??process.env))return[];let r=await l();b(r,e)&&n.refresh();let s=r?.latest;if(r===void 0||s===void 0||!w(s,t))return[];let o=r.notifiedAt;if(o!==void 0&&o<=e&&e-o<=m)return[];await p({...r,notifiedAt:e}).catch(()=>{});let c=n.colour?i.theme==="light"?$:u:void 0;return C(s,t,c)}function N(t,n=process.platform,e=x){if(t!==void 0)try{e(process.execPath,[...process.execArgv,t,"__update-check"],{detached:!0,stdio:"ignore",...n==="win32"?{windowsHide:!0}:{}}).unref()}catch{}}export{I as afterCommand,C as noteLines,N as spawnRefresh};
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __forgeCreateRequire } from 'node:module';
3
3
  const require = __forgeCreateRequire(import.meta.url);
4
- import{a as U}from"./chunks/chunk-U5TEGDGH.js";import{b as W,d as B}from"./chunks/chunk-IBPGC4N2.js";import"./chunks/chunk-QVACE4IE.js";import{h as j}from"./chunks/chunk-LW2QEXDT.js";import{d as G}from"./chunks/chunk-3GVFOZ7M.js";import"./chunks/chunk-GGBNT4WI.js";import{k as X,m as Q}from"./chunks/chunk-GNLE6JXL.js";import"./chunks/chunk-32VJ2RDH.js";import{a as v}from"./chunks/chunk-G4DU5ADF.js";import{a as D}from"./chunks/chunk-I6QBBRCE.js";import{I as d,L as P,e as J,ea as K,fa as T,g as E}from"./chunks/chunk-MMRDELHW.js";import{d as Y}from"./chunks/chunk-J7FLFHQJ.js";import"./chunks/chunk-H2IUSPAK.js";import"./chunks/chunk-HON4OV7M.js";import"./chunks/chunk-TMUK2DD3.js";import*as ue from"node:module";var O=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},y=class extends O{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var S=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new y(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function H(s){let e=s.name()+(s.variadic===!0?"...":"");return s.required?"<"+e+">":"["+e+"]"}import{EventEmitter as me}from"node:events";import q from"node:child_process";import C from"node:path";import V from"node:fs";import g from"node:process";import{stripVTControlCharacters as ge}from"node:util";import{stripVTControlCharacters as pe}from"node:util";var $=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((i,o)=>i.name().localeCompare(o.name())),t}compareOptions(e,t){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?t.push(n):n.long&&!o?t.push(e.createOption(n.long,n.description)):n.short&&!i&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>H(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,""]}groupItems(e,t,n){let i=new Map;return e.forEach(o=>{let r=n(o);i.has(r)||i.set(r,[])}),t.forEach(o=>{let r=n(o);i.has(r)||i.set(r,[]),i.get(r).push(o)}),i}formatHelp(e,t){let n=t.padWidth(e,t),i=t.helpWidth??80;function o(a,p){return t.formatItem(a,n,p,t)}let r=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],u=t.commandDescription(e);u.length>0&&(r=r.concat([t.boxWrap(t.styleCommandDescription(u),i),""]));let h=t.visibleArguments(e).map(a=>o(t.styleArgumentTerm(t.argumentTerm(a)),t.styleArgumentDescription(t.argumentDescription(a))));if(r=r.concat(this.formatItemList("Arguments:",h,t)),this.groupItems(e.options,t.visibleOptions(e),a=>a.helpGroupHeading??"Options:").forEach((a,p)=>{let f=a.map(m=>o(t.styleOptionTerm(t.optionTerm(m)),t.styleOptionDescription(t.optionDescription(m))));r=r.concat(this.formatItemList(p,f,t))}),t.showGlobalOptions){let a=t.visibleGlobalOptions(e).map(p=>o(t.styleOptionTerm(t.optionTerm(p)),t.styleOptionDescription(t.optionDescription(p))));r=r.concat(this.formatItemList("Global Options:",a,t))}return this.groupItems(e.commands,t.visibleCommands(e),a=>a.helpGroup()||"Commands:").forEach((a,p)=>{let f=a.map(m=>o(t.styleSubcommandTerm(t.subcommandTerm(m)),t.styleSubcommandDescription(t.subcommandDescription(m))));r=r.concat(this.formatItemList(p,f,t))}),r.join(`
4
+ import{a as U}from"./chunks/chunk-U5TEGDGH.js";import{b as W,d as B}from"./chunks/chunk-IBPGC4N2.js";import"./chunks/chunk-QVACE4IE.js";import{h as j}from"./chunks/chunk-LW2QEXDT.js";import{d as G}from"./chunks/chunk-3GVFOZ7M.js";import"./chunks/chunk-GGBNT4WI.js";import{k as X,m as Q}from"./chunks/chunk-GNLE6JXL.js";import"./chunks/chunk-32VJ2RDH.js";import{a as v}from"./chunks/chunk-2BCNTUEO.js";import{a as D}from"./chunks/chunk-I6QBBRCE.js";import{I as d,L as P,e as J,ea as K,fa as T,g as E}from"./chunks/chunk-MMRDELHW.js";import{d as Y}from"./chunks/chunk-J7FLFHQJ.js";import"./chunks/chunk-H2IUSPAK.js";import"./chunks/chunk-HON4OV7M.js";import"./chunks/chunk-TMUK2DD3.js";import*as ue from"node:module";var O=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},y=class extends O{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var S=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new y(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function H(s){let e=s.name()+(s.variadic===!0?"...":"");return s.required?"<"+e+">":"["+e+"]"}import{EventEmitter as me}from"node:events";import q from"node:child_process";import C from"node:path";import V from"node:fs";import g from"node:process";import{stripVTControlCharacters as ge}from"node:util";import{stripVTControlCharacters as pe}from"node:util";var $=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((i,o)=>i.name().localeCompare(o.name())),t}compareOptions(e,t){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?t.push(n):n.long&&!o?t.push(e.createOption(n.long,n.description)):n.short&&!i&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>H(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,""]}groupItems(e,t,n){let i=new Map;return e.forEach(o=>{let r=n(o);i.has(r)||i.set(r,[])}),t.forEach(o=>{let r=n(o);i.has(r)||i.set(r,[]),i.get(r).push(o)}),i}formatHelp(e,t){let n=t.padWidth(e,t),i=t.helpWidth??80;function o(a,p){return t.formatItem(a,n,p,t)}let r=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],u=t.commandDescription(e);u.length>0&&(r=r.concat([t.boxWrap(t.styleCommandDescription(u),i),""]));let h=t.visibleArguments(e).map(a=>o(t.styleArgumentTerm(t.argumentTerm(a)),t.styleArgumentDescription(t.argumentDescription(a))));if(r=r.concat(this.formatItemList("Arguments:",h,t)),this.groupItems(e.options,t.visibleOptions(e),a=>a.helpGroupHeading??"Options:").forEach((a,p)=>{let f=a.map(m=>o(t.styleOptionTerm(t.optionTerm(m)),t.styleOptionDescription(t.optionDescription(m))));r=r.concat(this.formatItemList(p,f,t))}),t.showGlobalOptions){let a=t.visibleGlobalOptions(e).map(p=>o(t.styleOptionTerm(t.optionTerm(p)),t.styleOptionDescription(t.optionDescription(p))));r=r.concat(this.formatItemList("Global Options:",a,t))}return this.groupItems(e.commands,t.visibleCommands(e),a=>a.helpGroup()||"Commands:").forEach((a,p)=>{let f=a.map(m=>o(t.styleSubcommandTerm(t.subcommandTerm(m)),t.styleSubcommandDescription(t.subcommandDescription(m))));r=r.concat(this.formatItemList(p,f,t))}),r.join(`
5
5
  `)}displayWidth(e){return pe(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,i){let r=" ".repeat(2);if(!n)return r+e;let u=e.padEnd(t+e.length-i.displayWidth(e)),h=2,l=(this.helpWidth??80)-t-h-2,a;return l<this.minWidthToWrap||i.preformatted(n)?a=n:a=i.boxWrap(n,l).replace(/\n/g,`
6
6
  `+" ".repeat(t+h)),r+u+" ".repeat(h)+a.replace(/\n/g,`
7
7
  ${r}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return n.forEach(r=>{let u=r.match(i);if(u===null){o.push("");return}let h=[u.shift()],c=this.displayWidth(h[0]);u.forEach(l=>{let a=this.displayWidth(l);if(c+a<=t){h.push(l),c+=a;return}o.push(h.join(""));let p=l.trimStart();h=[p],c=this.displayWidth(p)}),o.push(h.join(""))}),o.join(`
@@ -53,14 +53,14 @@ An image's main colours, most of the image first.
53
53
  ${Oe}`).configureOutput({outputError:()=>{}}).exitOverride().allowExcessArguments(!1);try{t.parse(s,{from:"user"})}catch(f){if(f instanceof O&&f.code!=="commander.helpDisplayed"&&f.code!=="commander.version"){let[m="",..._]=f.message.replace(/^error: /,"").split(`
54
54
  `),b=_.join(" ").trim().replace(/^\((.*)\)\.?$/,"$1");throw d(`${m.charAt(0).toUpperCase()}${m.slice(1).replace(/\.$/,"")}.`,b||"Run forge --help to see what Forge accepts.")}throw f}let n=t.opts(),i=t.args;if(n.formats)return{kind:"formats"};if(n.pages!==void 0&&n.to===void 0)throw d("--pages needs --to: it chooses which pages to render.");let o=["merge","split","extract","delete","rotate"].filter(f=>n[f]!==void 0);if(o.length>1)throw d(`Use one operation at a time \u2014 got ${o.map(f=>`--${f}`).join(" and ")}.`);let r=[...n.sharpen?["--sharpen"]:[],...e!==void 0?["--boost"]:[],...n.removeBg?["--remove-bg"]:[]],u=[...n.resize!==void 0?["--resize"]:[],...n.width!==void 0?["--width"]:[],...n.height!==void 0?["--height"]:[]];if(n.trim||n.crop!==void 0||u.length>0){if(u.length>1)throw d(`Use one of --resize, --width and --height \u2014 got ${u.join(" and ")}.`);let f=n.crop!==void 0?"--crop":u[0]??"--trim",m=[...n.crop!==void 0&&n.trim?["--trim"]:[],...r,...n.maxSize!==void 0?["--max-size"]:[],...n.pages!==void 0?["--pages"]:[],...o.map(ce=>`--${ce}`)][0];if(m!==void 0)throw d(`${f} cannot be combined with ${m}.`,m!=="--max-size"?"Run them one after the other.":f==="--crop"?"Crop first, then compress the result: forge photo-cropped-1x1.jpg --max-size 500kb":"Resize first, then compress the result: forge photo-1200x900.jpg --max-size 500kb");let _=n.crop!==void 0?{aspect:X(String(n.crop))}:void 0,b=n.resize!==void 0?{percent:we(n.resize)}:n.width!==void 0?{width:ne("--width",n.width)}:n.height!==void 0?{height:ne("--height",n.height)}:void 0;if(i.length===0)throw d("No files given.","Name an image, for example: forge photo.jpg --resize 50%");let x={background:String(n.background),keepMetadata:!!n.keepMetadata};n.quality!==void 0&&(x.quality=N(String(n.quality)));let w={kind:"edit",inputs:i,trim:!!n.trim,options:x,force:!!n.force,recursive:!!n.recursive,debug:!!n.debug};return _!==void 0&&(w.crop=_),b!==void 0&&(w.resize=b),n.to&&(w.target=z(String(n.to))),n.output!==void 0&&(w.output=String(n.output)),n.concurrency!==void 0&&(w.concurrency=F(String(n.concurrency))),w}let h=n.sharpen?1:e,c=h!==void 0?"boost":n.removeBg?"remove-background":null;if(c!==null){if(r.length>1)throw d(`Use one operation at a time \u2014 got ${r.join(" and ")}.`);let f=r[0];if(o.length>0)throw d(`${f} cannot be combined with --${o[0]}.`);if(n.maxSize!==void 0||n.pages!==void 0)throw d(`${f} cannot be combined with ${n.maxSize!==void 0?"--max-size":"--pages"}.`);if(i.length===0)throw d("No files given.",`Name an image, for example: forge photo.jpg ${f}`);let m=n.to?z(String(n.to)):"png";if(c==="remove-background"){let x=Q(m);if(x)throw x}let _={background:String(n.background),keepMetadata:!!n.keepMetadata};n.quality!==void 0&&(_.quality=N(String(n.quality)));let b={kind:"extension-op",op:c,inputs:i,target:m,options:_,force:!!n.force,recursive:!!n.recursive,debug:!!n.debug};return h!==void 0&&(b.scale=h),n.output!==void 0&&(b.output=String(n.output)),n.concurrency!==void 0&&(b.concurrency=F(String(n.concurrency))),b}if(o.length===1){let f=o[0];if(i.length===0)throw d("No files given.",`Name a PDF, for example: forge doc.pdf --${f}`);if(n.separate&&f!=="extract")throw d(`--separate only applies to --extract, not --${f}.`);if(n.output!==void 0)throw d(`--output does not apply to --${f}.`,"Page operations name their own outputs, beside the source. Rename the result afterwards.");let m={kind:"pageop",action:f,inputs:i,force:!!n.force,debug:!!n.debug};if(f==="rotate"){let _=Number(n.rotate);if(!Number.isInteger(_)||_%90!==0||_===0||_>=360)throw d(`--rotate takes a multiple of 90 below 360, not "${n.rotate}".`);m.rotate=_}if((f==="extract"||f==="delete")&&(m.pages=String(n[f]),f==="extract"&&n.separate&&(m.separate=!0)),f==="split"){let _=String(n.split),b=_.match(/^every=(\d+)$/),x=_.match(/^at=([\d,\s]+)$/);if(_==="every-page")m.split={mode:"every-page"};else if(b?.[1]!==void 0){let w=Number(b[1]);if(!Number.isInteger(w)||w<1)throw d(`--split every=N takes a whole number of pages, at least 1, not "${b[1]}".`);m.split={mode:"every-n",n:w}}else if(x?.[1])m.split={mode:"points",after:x[1].split(",").map(w=>Number(w.trim()))};else throw d(`--split takes every-page, every=N or at=N,N \u2014 not "${_}".`)}return m}if(i.length===0&&!n.to&&n.quality===void 0&&n.maxSize===void 0)return{kind:"shell"};if(n.quality!==void 0&&n.maxSize!==void 0)throw d("Use either --quality or --max-size, not both.","They are two ways of asking for the same thing, and Forge will not guess which wins.");if(!n.to&&(n.quality!==void 0||n.maxSize!==void 0)){if(i.length===0)throw d("No files given.","Name a file, for example: forge photo.jpg --max-size 500kb");let f={background:String(n.background),keepMetadata:!!n.keepMetadata},m={kind:"compress",inputs:i,options:f,force:!!n.force,recursive:!!n.recursive,debug:!!n.debug};if(n.quality!==void 0&&(m.quality=N(String(n.quality))),n.maxSize!==void 0&&(m.maxBytes=ie(n.maxSize)),n.output!==void 0&&(m.output=String(n.output)),t.getOptionValueSource("dpi")==="cli"){let _=Number(n.dpi);if(!Number.isInteger(_)||_<36||_>600)throw P(n.dpi);m.dpi=_}return n.concurrency!==void 0&&(m.concurrency=F(String(n.concurrency))),m}if(!n.to)throw d("No target format given.","Add --to <format>, for example: forge photo.jpg --to webp");if(i.length===0)throw d("No files given.","Name a file, a folder or a glob, for example: forge photo.jpg --to webp");let l={background:String(n.background),keepMetadata:!!n.keepMetadata};n.quality!==void 0&&(l.quality=N(String(n.quality)));let a=Number(n.dpi);if(!Number.isInteger(a)||a<36||a>600)throw P(n.dpi);let p={kind:"convert",inputs:i,target:z(String(n.to)),options:l,force:!!n.force,recursive:!!n.recursive,debug:!!n.debug,dpi:a,passwordStdin:!!n.passwordStdin};return n.output!==void 0&&(p.output=String(n.output)),n.pages!==void 0&&(p.pages=String(n.pages)),n.maxSize!==void 0&&(p.maxBytes=ie(n.maxSize)),n.concurrency!==void 0&&(p.concurrency=F(String(n.concurrency))),p}function L(s){return E(s)?s:K(s)}function se(s,e){return T(L(s),{debug:e})}function ae(s,e){process.once("beforeExit",()=>{s()||(e(new Error("Forge stopped before it finished: it was waiting for input that never came.")),process.exitCode=1)})}ue.enableCompileCache?.();function Ee({completed:s,total:e}){s===0?process.stderr.write(`Converting ${e} files
55
55
  `):process.stderr.write(` ${s}/${e}
56
- `)}async function Te(){let s=process.argv.slice(2),e=s.includes("--debug"),t=R(s);try{if(s[0]==="__update-check"){let{checkNow:a}=await import("./chunks/check-BRP6EKSA.js");await a();return}if(s[0]==="mcp"){let{runMcpServer:a}=await import("./chunks/server-3VV7IJPS.js");await a(s.slice(1));return}let n=re(s);if(n.kind==="shell"){if(t)throw d("No files given.","Name a file, for example: forge photo.jpg --to webp --json");if(!process.stdout.isTTY||!process.stdin.isTTY){process.stderr.write(`Forge needs a file and a target format.
56
+ `)}async function Te(){let s=process.argv.slice(2),e=s.includes("--debug"),t=R(s);try{if(s[0]==="__update-check"){let{checkNow:a}=await import("./chunks/check-BRP6EKSA.js");await a();return}if(s[0]==="mcp"){let{runMcpServer:a}=await import("./chunks/server-YOFF2XLI.js");await a(s.slice(1));return}let n=re(s);if(n.kind==="shell"){if(t)throw d("No files given.","Name a file, for example: forge photo.jpg --to webp --json");if(!process.stdout.isTTY||!process.stdin.isTTY){process.stderr.write(`Forge needs a file and a target format.
57
57
  Try: forge photo.jpg --to webp
58
- `),process.exitCode=2;return}let{applyColourPreference:a}=await import("./chunks/theme-RVWVYUCH.js");a();let{bootShell:p}=await import("./chunks/boot-NP6SNVTV.js");await p();return}let{execute:i}=await import("./chunks/execute-75YNMBFF.js"),o,r=0,u=(a,p)=>{let f=Date.now();if(a<p&&f-r<100)return;r=f;let m=_=>(_/1e6).toFixed(1);process.stderr.write(`\r downloading ${m(a)} / ${m(p)} MB${a>=p?`
58
+ `),process.exitCode=2;return}let{applyColourPreference:a}=await import("./chunks/theme-U2TFE5KM.js");a();let{bootShell:p}=await import("./chunks/boot-ZJ2V3EYW.js");await p();return}let{execute:i}=await import("./chunks/execute-EJYOG2OA.js"),o,r=0,u=(a,p)=>{let f=Date.now();if(a<p&&f-r<100)return;r=f;let m=_=>(_/1e6).toFixed(1);process.stderr.write(`\r downloading ${m(a)} / ${m(p)} MB${a>=p?`
59
59
  `:""}`)},h=!!process.stderr.isTTY&&!t,c=new AbortController;n.kind==="extension-op"&&process.once("SIGINT",()=>c.abort());let l=await i(n,{json:t,...h?{onInstalling:a=>{o=W(process.stderr,`installing Forge ${a}`)}}:{},signal:c.signal,...h?{onDownload:u}:{},colour:!!process.stdout.isTTY&&!t&&B(),onProgress:h?a=>{a.completed>0&&o?.stop(),Ee(a)}:void 0,...h?{onSearch:a=>{o??=W(process.stderr,"finding the smallest that fits"),o.update(a)}}:{}});if(o?.stop(),l.stdout.length>0&&process.stdout.write(`${l.stdout.join(`
60
60
  `)}
61
61
  `),l.stderr.length>0&&process.stderr.write(`${l.stderr.join(`
62
62
  `)}
63
- `),process.exitCode=c.signal.aborted?130:l.exitCode,h&&process.stdout.isTTY&&n.kind!=="update")try{let{afterCommand:a,spawnRefresh:p}=await import("./chunks/update-note-UA3267X2.js"),{runningScript:f}=await import("./chunks/install-YG43OJ7P.js"),m=await a(v,{refresh:()=>p(f(process.argv[1])),colour:B()});m.length>0&&process.stderr.write(`
63
+ `),process.exitCode=c.signal.aborted?130:l.exitCode,h&&process.stdout.isTTY&&n.kind!=="update")try{let{afterCommand:a,spawnRefresh:p}=await import("./chunks/update-note-A7SJ6DEZ.js"),{runningScript:f}=await import("./chunks/install-YG43OJ7P.js"),m=await a(v,{refresh:()=>p(f(process.argv[1])),colour:B()});m.length>0&&process.stderr.write(`
64
64
  ${m.join(`
65
65
  `)}
66
66
  `)}catch{}}catch(n){if(E(n)){t?process.stdout.write(`${JSON.stringify(G(v,n))}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forge-terminal",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "A terminal-native file converter for macOS and Windows",
5
5
  "keywords": [
6
6
  "convert",