@vercel/cli-config 0.3.5 → 0.3.6-snapshot-b8e5bb846796
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +54 -17
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,21 +1,58 @@
|
|
|
1
|
-
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var require_lib=__commonJS({"../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js"(exports,module2){"use strict";var os=require("os"),paths=require("path"),isWinOS=/^win/i.test(process.platform);function normalize_path(path3){return paths.normalize(paths.join(path3,"."))}var base=()=>{let{env}=process,object2={};return object2.home=()=>normalize_path(os.homedir?os.homedir():env.HOME),object2.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TMPDIR||env.TEMP||env.TMP),object2},windows=()=>{let{env}=process,object2={};return object2.home=()=>normalize_path(os.homedir?os.homedir():env.USERPROFILE||paths.join(env.HOMEDRIVE,env.HOMEPATH)||env.HOME),object2.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TEMP||env.TMP||paths.join(env.LOCALAPPDATA||env.SystemRoot||env.windir,"Temp")),object2},_OSPaths=class __OSPaths{constructor(){let OSPaths=function(){return new __OSPaths};this._fn=OSPaths;let extension=isWinOS?windows():base();return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module2.exports=new _OSPaths}});var require_lib2=__commonJS({"../../node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js"(exports,module2){"use strict";var path3=require("path"),osPaths=require_lib(),linux=()=>{let object2={};return object2.cache=()=>process.env.XDG_CACHE_HOME||path3.join(osPaths.home()||osPaths.temp(),".cache"),object2.config=()=>process.env.XDG_CONFIG_HOME||path3.join(osPaths.home()||osPaths.temp(),".config"),object2.data=()=>process.env.XDG_DATA_HOME||path3.join(osPaths.home()||osPaths.temp(),".local","share"),object2.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object2.state=()=>process.env.XDG_STATE_HOME||path3.join(osPaths.home()||osPaths.temp(),".local","state"),object2},macos=()=>{let object2={};return object2.cache=()=>process.env.XDG_CACHE_HOME||path3.join(path3.join(osPaths.home()||osPaths.temp(),"Library"),"Caches"),object2.config=()=>process.env.XDG_CONFIG_HOME||path3.join(path3.join(osPaths.home()||osPaths.temp(),"Library"),"Preferences"),object2.data=()=>process.env.XDG_DATA_HOME||path3.join(path3.join(osPaths.home()||osPaths.temp(),"Library"),"Application Support"),object2.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object2.state=()=>process.env.XDG_STATE_HOME||path3.join(path3.join(osPaths.home()||osPaths.temp(),"Library"),"State"),object2},windows=()=>{let object2={};return object2.cache=()=>{let localAppData=process.env.LOCALAPPDATA||path3.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_CACHE_HOME||path3.join(localAppData,"xdg.cache")},object2.config=()=>{let appData=process.env.APPDATA||path3.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_CONFIG_HOME||path3.join(appData,"xdg.config")},object2.data=()=>{let appData=process.env.APPDATA||path3.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_DATA_HOME||path3.join(appData,"xdg.data")},object2.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object2.state=()=>{let localAppData=process.env.LOCALAPPDATA||path3.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_STATE_HOME||path3.join(localAppData,"xdg.state")},object2},_XDGPortable=()=>{let XDGPortable=function(){return _XDGPortable()},extension={};return/^darwin$/i.test(process.platform)?extension=macos():/^win/i.test(process.platform)?extension=windows():extension=linux(),extension.configDirs=()=>{let dirs=[];return dirs.push(extension.config()),process.env.XDG_CONFIG_DIRS&&dirs.push(...process.env.XDG_CONFIG_DIRS.split(path3.delimiter)),dirs},extension.dataDirs=()=>{let dirs=[];return dirs.push(extension.data()),process.env.XDG_DATA_DIRS&&dirs.push(...process.env.XDG_DATA_DIRS.split(path3.delimiter)),dirs},Object.keys(extension).forEach(key=>{XDGPortable[key]=extension[key]}),XDGPortable};module2.exports=_XDGPortable()}});var require_xdg_app_paths=__commonJS({"../../node_modules/.pnpm/xdg-app-paths@5.1.0/node_modules/xdg-app-paths/index.js"(exports,module2){"use strict";var path3=require("path"),os=require("os"),xdg=require_lib2(),isWinOS=/^win/i.test(process.platform);function _normalizeOptions(options,isolated){if(options=options||{},typeof options!="object"&&(options={isolated:options}),options.isolated=options.isolated===void 0||options.isolated===null?isolated:options.isolated,typeof options.isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof options.isolated}`);return options}var base=(name,isolated)=>{let object2={};return object2.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path3.join(xdg.cache(),options.isolated?name:"")),object2.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path3.join(xdg.config(),options.isolated?name:"")),object2.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path3.join(xdg.data(),options.isolated?name:"")),object2.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path3.join(xdg.runtime(),options.isolated?name:""):void 0),object2.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path3.join(xdg.state(),options.isolated?name:"")),object2.configDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.configDirs().map(s=>path3.join(s,options.isolated?name:""))),object2.dataDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.dataDirs().map(s=>path3.join(s,options.isolated?name:""))),object2},windows=(name,isolated)=>{let{env}=process,homedir2=os.homedir(),tmpdir=os.tmpdir(),appData=env.APPDATA||path3.join(homedir2||tmpdir,"AppData","Roaming"),localAppData=env.LOCALAPPDATA||path3.join(homedir2||tmpdir,"AppData","Local"),object2={};return object2.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CACHE_HOME?path3.join(xdg.cache(),options.isolated?name:""):path3.join(localAppData,options.isolated?name:"","Cache")),object2.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CONFIG_HOME?path3.join(xdg.config(),options.isolated?name:""):path3.join(appData,options.isolated?name:"","Config")),object2.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_DATA_HOME?path3.join(xdg.data(),options.isolated?name:""):path3.join(appData,options.isolated?name:"","Data")),object2.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path3.join(xdg.runtime(),options.isolated?name:""):void 0),object2.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_STATE_HOME?path3.join(xdg.state(),options.isolated?name:""):path3.join(localAppData,options.isolated?name:"","State")),object2.configDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object2.config(options)];return env.XDG_CONFIG_DIRS&&dirs.push(...env.XDG_CONFIG_DIRS.split(path3.delimiter).map(s=>path3.join(s,options.isolated?name:""))),dirs},object2.dataDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object2.data(options)];return env.XDG_DATA_DIRS&&dirs.push(...env.XDG_DATA_DIRS.split(path3.delimiter).map(s=>path3.join(s,options.isolated?name:""))),dirs},object2},_XDGAppPaths=class __XDGAppPaths{constructor(options={name:null,suffix:null,isolated:!0}){let XDGAppPaths=function(options2={name:null,suffix:null,isolated:!0}){return new __XDGAppPaths(options2)};this._fn=XDGAppPaths,options=options||{},typeof options!="object"&&(options={name:options});let name=options.name||"";if(typeof name!="string")throw new TypeError(`Expected string for "name" argument, got ${typeof name}`);let suffix=options.suffix||"";if(typeof suffix!="string")throw new TypeError(`Expected string for "suffix" argument, got ${typeof suffix}`);let isolated=options.isolated===void 0||options.isolated===null?!0:options.isolated;if(typeof isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof isolated}`);name||(name=path3.parse(process.pkg?process.execPath:require.main?require.main.filename:process.argv[0]).name),suffix&&(name+=suffix),this._fn.$name=()=>name,this._fn.$isolated=()=>isolated;let extension=isWinOS?windows(name,isolated):base(name,isolated);return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module2.exports=new _XDGAppPaths}});var src_exports={};__export(src_exports,{CRED_STORAGE_CONFIG_VALUES:()=>CRED_STORAGE_CONFIG_VALUES,CRED_STORAGE_VALUES:()=>CRED_STORAGE_VALUES,DEFAULT_CRED_STORAGE:()=>DEFAULT_CRED_STORAGE,authConfigHasUsableTokenData:()=>authConfigHasUsableTokenData,authConfigSchema:()=>authConfigSchema2,credStorageSchema:()=>credStorageSchema2,defaultAuthConfig:()=>defaultAuthConfig,defaultGlobalConfig:()=>defaultGlobalConfig,deleteAuthConfig:()=>deleteAuthConfig,deleteAuthConfigFile:()=>deleteAuthConfigFile,getAuthConfigFilePath:()=>getAuthConfigFilePath,getCachePath:()=>getCachePath,getConfigFilePath:()=>getConfigFilePath,getDataPath:()=>getDataPath,getDefaultAuthConfig:()=>getDefaultAuthConfig,getDpopAuthConfigFilePath:()=>getDpopAuthConfigFilePath,getGlobalPathConfig:()=>getGlobalPathConfig,getLikelyEffectiveCredStorage:()=>getLikelyEffectiveCredStorage,globalConfigSchema:()=>globalConfigSchema2,guidanceConfigSchema:()=>guidanceConfigSchema2,parseAuthConfig:()=>parseAuthConfig,parseAuthFileConfig:()=>parseAuthFileConfig,parseGlobalConfig:()=>parseGlobalConfig,readAuthConfig:()=>readAuthConfig,readAuthConfigFile:()=>readAuthConfigFile,readAuthFileConfig:()=>readAuthFileConfig,readConfigFile:()=>readConfigFile,readGlobalConfigFile:()=>readGlobalConfigFile,telemetryConfigSchema:()=>telemetryConfigSchema2,tryReadAuthConfig:()=>tryReadAuthConfig,updatesConfigSchema:()=>updatesConfigSchema2,writeAuthConfig:()=>writeAuthConfig,writeAuthConfigFile:()=>writeAuthConfigFile,writeConfigFile:()=>writeConfigFile,writeGlobalConfigFile:()=>writeGlobalConfigFile});module.exports=__toCommonJS(src_exports);var CRED_STORAGE_CONFIG_VALUES=["auto","file","keyring"],CRED_STORAGE_VALUES=CRED_STORAGE_CONFIG_VALUES.filter(storage=>storage!=="auto"),DEFAULT_CRED_STORAGE="file";var NEVER=Object.freeze({status:"aborted"});function $constructor(name,initializer3,params){function init(inst,def){var _a;Object.defineProperty(inst,"_zod",{value:inst._zod??{},enumerable:!1}),(_a=inst._zod).traits??(_a.traits=new Set),inst._zod.traits.add(name),initializer3(inst,def);for(let k in _.prototype)k in inst||Object.defineProperty(inst,k,{value:_.prototype[k].bind(inst)});inst._zod.constr=_,inst._zod.def=def}let Parent=params?.Parent??Object;class Definition extends Parent{}Object.defineProperty(Definition,"name",{value:name});function _(def){var _a;let inst=params?.Parent?new Definition:this;init(inst,def),(_a=inst._zod).deferred??(_a.deferred=[]);for(let fn of inst._zod.deferred)fn();return inst}return Object.defineProperty(_,"init",{value:init}),Object.defineProperty(_,Symbol.hasInstance,{value:inst=>params?.Parent&&inst instanceof params.Parent?!0:inst?._zod?.traits?.has(name)}),Object.defineProperty(_,"name",{value:name}),_}var $brand=Symbol("zod_brand"),$ZodAsyncError=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},$ZodEncodeError=class extends Error{constructor(name){super(`Encountered unidirectional transform during encode: ${name}`),this.name="ZodEncodeError"}},globalConfig={};function config(newConfig){return newConfig&&Object.assign(globalConfig,newConfig),globalConfig}var util_exports={};__export(util_exports,{BIGINT_FORMAT_RANGES:()=>BIGINT_FORMAT_RANGES,Class:()=>Class,NUMBER_FORMAT_RANGES:()=>NUMBER_FORMAT_RANGES,aborted:()=>aborted,allowsEval:()=>allowsEval,assert:()=>assert,assertEqual:()=>assertEqual,assertIs:()=>assertIs,assertNever:()=>assertNever,assertNotEqual:()=>assertNotEqual,assignProp:()=>assignProp,base64ToUint8Array:()=>base64ToUint8Array,base64urlToUint8Array:()=>base64urlToUint8Array,cached:()=>cached,captureStackTrace:()=>captureStackTrace,cleanEnum:()=>cleanEnum,cleanRegex:()=>cleanRegex,clone:()=>clone,cloneDef:()=>cloneDef,createTransparentProxy:()=>createTransparentProxy,defineLazy:()=>defineLazy,esc:()=>esc,escapeRegex:()=>escapeRegex,extend:()=>extend,finalizeIssue:()=>finalizeIssue,floatSafeRemainder:()=>floatSafeRemainder,getElementAtPath:()=>getElementAtPath,getEnumValues:()=>getEnumValues,getLengthableOrigin:()=>getLengthableOrigin,getParsedType:()=>getParsedType,getSizableOrigin:()=>getSizableOrigin,hexToUint8Array:()=>hexToUint8Array,isObject:()=>isObject,isPlainObject:()=>isPlainObject,issue:()=>issue,joinValues:()=>joinValues,jsonStringifyReplacer:()=>jsonStringifyReplacer,merge:()=>merge,mergeDefs:()=>mergeDefs,normalizeParams:()=>normalizeParams,nullish:()=>nullish,numKeys:()=>numKeys,objectClone:()=>objectClone,omit:()=>omit,optionalKeys:()=>optionalKeys,partial:()=>partial,pick:()=>pick,prefixIssues:()=>prefixIssues,primitiveTypes:()=>primitiveTypes,promiseAllObject:()=>promiseAllObject,propertyKeyTypes:()=>propertyKeyTypes,randomString:()=>randomString,required:()=>required,safeExtend:()=>safeExtend,shallowClone:()=>shallowClone,stringifyPrimitive:()=>stringifyPrimitive,uint8ArrayToBase64:()=>uint8ArrayToBase64,uint8ArrayToBase64url:()=>uint8ArrayToBase64url,uint8ArrayToHex:()=>uint8ArrayToHex,unwrapMessage:()=>unwrapMessage});function assertEqual(val){return val}function assertNotEqual(val){return val}function assertIs(_arg){}function assertNever(_x){throw new Error}function assert(_){}function getEnumValues(entries){let numericValues=Object.values(entries).filter(v=>typeof v=="number");return Object.entries(entries).filter(([k,_])=>numericValues.indexOf(+k)===-1).map(([_,v])=>v)}function joinValues(array2,separator="|"){return array2.map(val=>stringifyPrimitive(val)).join(separator)}function jsonStringifyReplacer(_,value){return typeof value=="bigint"?value.toString():value}function cached(getter){return{get value(){{let value=getter();return Object.defineProperty(this,"value",{value}),value}throw new Error("cached value already set")}}}function nullish(input){return input==null}function cleanRegex(source){let start=source.startsWith("^")?1:0,end=source.endsWith("$")?source.length-1:source.length;return source.slice(start,end)}function floatSafeRemainder(val,step){let valDecCount=(val.toString().split(".")[1]||"").length,stepString=step.toString(),stepDecCount=(stepString.split(".")[1]||"").length;if(stepDecCount===0&&/\d?e-\d?/.test(stepString)){let match=stepString.match(/\d?e-(\d?)/);match?.[1]&&(stepDecCount=Number.parseInt(match[1]))}let decCount=valDecCount>stepDecCount?valDecCount:stepDecCount,valInt=Number.parseInt(val.toFixed(decCount).replace(".","")),stepInt=Number.parseInt(step.toFixed(decCount).replace(".",""));return valInt%stepInt/10**decCount}var EVALUATING=Symbol("evaluating");function defineLazy(object2,key,getter){let value;Object.defineProperty(object2,key,{get(){if(value!==EVALUATING)return value===void 0&&(value=EVALUATING,value=getter()),value},set(v){Object.defineProperty(object2,key,{value:v})},configurable:!0})}function objectClone(obj){return Object.create(Object.getPrototypeOf(obj),Object.getOwnPropertyDescriptors(obj))}function assignProp(target,prop,value){Object.defineProperty(target,prop,{value,writable:!0,enumerable:!0,configurable:!0})}function mergeDefs(...defs){let mergedDescriptors={};for(let def of defs){let descriptors=Object.getOwnPropertyDescriptors(def);Object.assign(mergedDescriptors,descriptors)}return Object.defineProperties({},mergedDescriptors)}function cloneDef(schema){return mergeDefs(schema._zod.def)}function getElementAtPath(obj,path3){return path3?path3.reduce((acc,key)=>acc?.[key],obj):obj}function promiseAllObject(promisesObj){let keys=Object.keys(promisesObj),promises=keys.map(key=>promisesObj[key]);return Promise.all(promises).then(results=>{let resolvedObj={};for(let i=0;i<keys.length;i++)resolvedObj[keys[i]]=results[i];return resolvedObj})}function randomString(length=10){let chars="abcdefghijklmnopqrstuvwxyz",str="";for(let i=0;i<length;i++)str+=chars[Math.floor(Math.random()*chars.length)];return str}function esc(str){return JSON.stringify(str)}var captureStackTrace="captureStackTrace"in Error?Error.captureStackTrace:(..._args)=>{};function isObject(data){return typeof data=="object"&&data!==null&&!Array.isArray(data)}var allowsEval=cached(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let F=Function;return new F(""),!0}catch{return!1}});function isPlainObject(o){if(isObject(o)===!1)return!1;let ctor=o.constructor;if(ctor===void 0)return!0;let prot=ctor.prototype;return!(isObject(prot)===!1||Object.prototype.hasOwnProperty.call(prot,"isPrototypeOf")===!1)}function shallowClone(o){return isPlainObject(o)?{...o}:Array.isArray(o)?[...o]:o}function numKeys(data){let keyCount=0;for(let key in data)Object.prototype.hasOwnProperty.call(data,key)&&keyCount++;return keyCount}var getParsedType=data=>{let t=typeof data;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(data)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(data)?"array":data===null?"null":data.then&&typeof data.then=="function"&&data.catch&&typeof data.catch=="function"?"promise":typeof Map<"u"&&data instanceof Map?"map":typeof Set<"u"&&data instanceof Set?"set":typeof Date<"u"&&data instanceof Date?"date":typeof File<"u"&&data instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},propertyKeyTypes=new Set(["string","number","symbol"]),primitiveTypes=new Set(["string","number","bigint","boolean","symbol","undefined"]);function escapeRegex(str){return str.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function clone(inst,def,params){let cl=new inst._zod.constr(def??inst._zod.def);return(!def||params?.parent)&&(cl._zod.parent=inst),cl}function normalizeParams(_params){let params=_params;if(!params)return{};if(typeof params=="string")return{error:()=>params};if(params?.message!==void 0){if(params?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");params.error=params.message}return delete params.message,typeof params.error=="string"?{...params,error:()=>params.error}:params}function createTransparentProxy(getter){let target;return new Proxy({},{get(_,prop,receiver){return target??(target=getter()),Reflect.get(target,prop,receiver)},set(_,prop,value,receiver){return target??(target=getter()),Reflect.set(target,prop,value,receiver)},has(_,prop){return target??(target=getter()),Reflect.has(target,prop)},deleteProperty(_,prop){return target??(target=getter()),Reflect.deleteProperty(target,prop)},ownKeys(_){return target??(target=getter()),Reflect.ownKeys(target)},getOwnPropertyDescriptor(_,prop){return target??(target=getter()),Reflect.getOwnPropertyDescriptor(target,prop)},defineProperty(_,prop,descriptor){return target??(target=getter()),Reflect.defineProperty(target,prop,descriptor)}})}function stringifyPrimitive(value){return typeof value=="bigint"?value.toString()+"n":typeof value=="string"?`"${value}"`:`${value}`}function optionalKeys(shape){return Object.keys(shape).filter(k=>shape[k]._zod.optin==="optional"&&shape[k]._zod.optout==="optional")}var NUMBER_FORMAT_RANGES={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]},BIGINT_FORMAT_RANGES={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function pick(schema,mask){let currDef=schema._zod.def,def=mergeDefs(schema._zod.def,{get shape(){let newShape={};for(let key in mask){if(!(key in currDef.shape))throw new Error(`Unrecognized key: "${key}"`);mask[key]&&(newShape[key]=currDef.shape[key])}return assignProp(this,"shape",newShape),newShape},checks:[]});return clone(schema,def)}function omit(schema,mask){let currDef=schema._zod.def,def=mergeDefs(schema._zod.def,{get shape(){let newShape={...schema._zod.def.shape};for(let key in mask){if(!(key in currDef.shape))throw new Error(`Unrecognized key: "${key}"`);mask[key]&&delete newShape[key]}return assignProp(this,"shape",newShape),newShape},checks:[]});return clone(schema,def)}function extend(schema,shape){if(!isPlainObject(shape))throw new Error("Invalid input to extend: expected a plain object");let checks=schema._zod.def.checks;if(checks&&checks.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let def=mergeDefs(schema._zod.def,{get shape(){let _shape={...schema._zod.def.shape,...shape};return assignProp(this,"shape",_shape),_shape},checks:[]});return clone(schema,def)}function safeExtend(schema,shape){if(!isPlainObject(shape))throw new Error("Invalid input to safeExtend: expected a plain object");let def={...schema._zod.def,get shape(){let _shape={...schema._zod.def.shape,...shape};return assignProp(this,"shape",_shape),_shape},checks:schema._zod.def.checks};return clone(schema,def)}function merge(a,b){let def=mergeDefs(a._zod.def,{get shape(){let _shape={...a._zod.def.shape,...b._zod.def.shape};return assignProp(this,"shape",_shape),_shape},get catchall(){return b._zod.def.catchall},checks:[]});return clone(a,def)}function partial(Class2,schema,mask){let def=mergeDefs(schema._zod.def,{get shape(){let oldShape=schema._zod.def.shape,shape={...oldShape};if(mask)for(let key in mask){if(!(key in oldShape))throw new Error(`Unrecognized key: "${key}"`);mask[key]&&(shape[key]=Class2?new Class2({type:"optional",innerType:oldShape[key]}):oldShape[key])}else for(let key in oldShape)shape[key]=Class2?new Class2({type:"optional",innerType:oldShape[key]}):oldShape[key];return assignProp(this,"shape",shape),shape},checks:[]});return clone(schema,def)}function required(Class2,schema,mask){let def=mergeDefs(schema._zod.def,{get shape(){let oldShape=schema._zod.def.shape,shape={...oldShape};if(mask)for(let key in mask){if(!(key in shape))throw new Error(`Unrecognized key: "${key}"`);mask[key]&&(shape[key]=new Class2({type:"nonoptional",innerType:oldShape[key]}))}else for(let key in oldShape)shape[key]=new Class2({type:"nonoptional",innerType:oldShape[key]});return assignProp(this,"shape",shape),shape},checks:[]});return clone(schema,def)}function aborted(x,startIndex=0){if(x.aborted===!0)return!0;for(let i=startIndex;i<x.issues.length;i++)if(x.issues[i]?.continue!==!0)return!0;return!1}function prefixIssues(path3,issues){return issues.map(iss=>{var _a;return(_a=iss).path??(_a.path=[]),iss.path.unshift(path3),iss})}function unwrapMessage(message){return typeof message=="string"?message:message?.message}function finalizeIssue(iss,ctx,config2){let full={...iss,path:iss.path??[]};if(!iss.message){let message=unwrapMessage(iss.inst?._zod.def?.error?.(iss))??unwrapMessage(ctx?.error?.(iss))??unwrapMessage(config2.customError?.(iss))??unwrapMessage(config2.localeError?.(iss))??"Invalid input";full.message=message}return delete full.inst,delete full.continue,ctx?.reportInput||delete full.input,full}function getSizableOrigin(input){return input instanceof Set?"set":input instanceof Map?"map":input instanceof File?"file":"unknown"}function getLengthableOrigin(input){return Array.isArray(input)?"array":typeof input=="string"?"string":"unknown"}function issue(...args){let[iss,input,inst]=args;return typeof iss=="string"?{message:iss,code:"custom",input,inst}:{...iss}}function cleanEnum(obj){return Object.entries(obj).filter(([k,_])=>Number.isNaN(Number.parseInt(k,10))).map(el=>el[1])}function base64ToUint8Array(base642){let binaryString=atob(base642),bytes=new Uint8Array(binaryString.length);for(let i=0;i<binaryString.length;i++)bytes[i]=binaryString.charCodeAt(i);return bytes}function uint8ArrayToBase64(bytes){let binaryString="";for(let i=0;i<bytes.length;i++)binaryString+=String.fromCharCode(bytes[i]);return btoa(binaryString)}function base64urlToUint8Array(base64url2){let base642=base64url2.replace(/-/g,"+").replace(/_/g,"/"),padding="=".repeat((4-base642.length%4)%4);return base64ToUint8Array(base642+padding)}function uint8ArrayToBase64url(bytes){return uint8ArrayToBase64(bytes).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function hexToUint8Array(hex){let cleanHex=hex.replace(/^0x/,"");if(cleanHex.length%2!==0)throw new Error("Invalid hex string length");let bytes=new Uint8Array(cleanHex.length/2);for(let i=0;i<cleanHex.length;i+=2)bytes[i/2]=Number.parseInt(cleanHex.slice(i,i+2),16);return bytes}function uint8ArrayToHex(bytes){return Array.from(bytes).map(b=>b.toString(16).padStart(2,"0")).join("")}var Class=class{constructor(..._args){}};var initializer=(inst,def)=>{inst.name="$ZodError",Object.defineProperty(inst,"_zod",{value:inst._zod,enumerable:!1}),Object.defineProperty(inst,"issues",{value:def,enumerable:!1}),inst.message=JSON.stringify(def,jsonStringifyReplacer,2),Object.defineProperty(inst,"toString",{value:()=>inst.message,enumerable:!1})},$ZodError=$constructor("$ZodError",initializer),$ZodRealError=$constructor("$ZodError",initializer,{Parent:Error});function flattenError(error,mapper=issue2=>issue2.message){let fieldErrors={},formErrors=[];for(let sub of error.issues)sub.path.length>0?(fieldErrors[sub.path[0]]=fieldErrors[sub.path[0]]||[],fieldErrors[sub.path[0]].push(mapper(sub))):formErrors.push(mapper(sub));return{formErrors,fieldErrors}}function formatError(error,_mapper){let mapper=_mapper||function(issue2){return issue2.message},fieldErrors={_errors:[]},processError=error2=>{for(let issue2 of error2.issues)if(issue2.code==="invalid_union"&&issue2.errors.length)issue2.errors.map(issues=>processError({issues}));else if(issue2.code==="invalid_key")processError({issues:issue2.issues});else if(issue2.code==="invalid_element")processError({issues:issue2.issues});else if(issue2.path.length===0)fieldErrors._errors.push(mapper(issue2));else{let curr=fieldErrors,i=0;for(;i<issue2.path.length;){let el=issue2.path[i];i===issue2.path.length-1?(curr[el]=curr[el]||{_errors:[]},curr[el]._errors.push(mapper(issue2))):curr[el]=curr[el]||{_errors:[]},curr=curr[el],i++}}};return processError(error),fieldErrors}var _parse=_Err=>(schema,value,_ctx,_params)=>{let ctx=_ctx?Object.assign(_ctx,{async:!1}):{async:!1},result=schema._zod.run({value,issues:[]},ctx);if(result instanceof Promise)throw new $ZodAsyncError;if(result.issues.length){let e=new(_params?.Err??_Err)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())));throw captureStackTrace(e,_params?.callee),e}return result.value};var _parseAsync=_Err=>async(schema,value,_ctx,params)=>{let ctx=_ctx?Object.assign(_ctx,{async:!0}):{async:!0},result=schema._zod.run({value,issues:[]},ctx);if(result instanceof Promise&&(result=await result),result.issues.length){let e=new(params?.Err??_Err)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())));throw captureStackTrace(e,params?.callee),e}return result.value};var _safeParse=_Err=>(schema,value,_ctx)=>{let ctx=_ctx?{..._ctx,async:!1}:{async:!1},result=schema._zod.run({value,issues:[]},ctx);if(result instanceof Promise)throw new $ZodAsyncError;return result.issues.length?{success:!1,error:new(_Err??$ZodError)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())))}:{success:!0,data:result.value}},safeParse=_safeParse($ZodRealError),_safeParseAsync=_Err=>async(schema,value,_ctx)=>{let ctx=_ctx?Object.assign(_ctx,{async:!0}):{async:!0},result=schema._zod.run({value,issues:[]},ctx);return result instanceof Promise&&(result=await result),result.issues.length?{success:!1,error:new _Err(result.issues.map(iss=>finalizeIssue(iss,ctx,config())))}:{success:!0,data:result.value}},safeParseAsync=_safeParseAsync($ZodRealError),_encode=_Err=>(schema,value,_ctx)=>{let ctx=_ctx?Object.assign(_ctx,{direction:"backward"}):{direction:"backward"};return _parse(_Err)(schema,value,ctx)};var _decode=_Err=>(schema,value,_ctx)=>_parse(_Err)(schema,value,_ctx);var _encodeAsync=_Err=>async(schema,value,_ctx)=>{let ctx=_ctx?Object.assign(_ctx,{direction:"backward"}):{direction:"backward"};return _parseAsync(_Err)(schema,value,ctx)};var _decodeAsync=_Err=>async(schema,value,_ctx)=>_parseAsync(_Err)(schema,value,_ctx);var _safeEncode=_Err=>(schema,value,_ctx)=>{let ctx=_ctx?Object.assign(_ctx,{direction:"backward"}):{direction:"backward"};return _safeParse(_Err)(schema,value,ctx)};var _safeDecode=_Err=>(schema,value,_ctx)=>_safeParse(_Err)(schema,value,_ctx);var _safeEncodeAsync=_Err=>async(schema,value,_ctx)=>{let ctx=_ctx?Object.assign(_ctx,{direction:"backward"}):{direction:"backward"};return _safeParseAsync(_Err)(schema,value,ctx)};var _safeDecodeAsync=_Err=>async(schema,value,_ctx)=>_safeParseAsync(_Err)(schema,value,_ctx);var cuid=/^[cC][^\s-]{8,}$/,cuid2=/^[0-9a-z]+$/,ulid=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xid=/^[0-9a-vA-V]{20}$/,ksuid=/^[A-Za-z0-9]{27}$/,nanoid=/^[a-zA-Z0-9_-]{21}$/,duration=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var guid=/^([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})$/,uuid=version2=>version2?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version2}[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 email=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var _emoji="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function emoji(){return new RegExp(_emoji,"u")}var ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6=/^(([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}|:))$/,cidrv4=/^((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])$/,cidrv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,base64url=/^[A-Za-z0-9_-]*$/,hostname=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;var e164=/^\+(?:[0-9]){6,14}[0-9]$/,dateSource="(?:(?:\\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])))",date=new RegExp(`^${dateSource}$`);function timeSource(args){let hhmm="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof args.precision=="number"?args.precision===-1?`${hhmm}`:args.precision===0?`${hhmm}:[0-5]\\d`:`${hhmm}:[0-5]\\d\\.\\d{${args.precision}}`:`${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`}function time(args){return new RegExp(`^${timeSource(args)}$`)}function datetime(args){let time3=timeSource({precision:args.precision}),opts=["Z"];args.local&&opts.push(""),args.offset&&opts.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let timeRegex=`${time3}(?:${opts.join("|")})`;return new RegExp(`^${dateSource}T(?:${timeRegex})$`)}var string=params=>{let regex=params?`[\\s\\S]{${params?.minimum??0},${params?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${regex}$`)};var integer=/^-?\d+$/,number=/^-?\d+(?:\.\d+)?/,boolean=/^(?:true|false)$/i;var lowercase=/^[^A-Z]*$/,uppercase=/^[^a-z]*$/;var $ZodCheck=$constructor("$ZodCheck",(inst,def)=>{var _a;inst._zod??(inst._zod={}),inst._zod.def=def,(_a=inst._zod).onattach??(_a.onattach=[])}),numericOriginMap={number:"number",bigint:"bigint",object:"date"},$ZodCheckLessThan=$constructor("$ZodCheckLessThan",(inst,def)=>{$ZodCheck.init(inst,def);let origin=numericOriginMap[typeof def.value];inst._zod.onattach.push(inst2=>{let bag=inst2._zod.bag,curr=(def.inclusive?bag.maximum:bag.exclusiveMaximum)??Number.POSITIVE_INFINITY;def.value<curr&&(def.inclusive?bag.maximum=def.value:bag.exclusiveMaximum=def.value)}),inst._zod.check=payload=>{(def.inclusive?payload.value<=def.value:payload.value<def.value)||payload.issues.push({origin,code:"too_big",maximum:def.value,input:payload.value,inclusive:def.inclusive,inst,continue:!def.abort})}}),$ZodCheckGreaterThan=$constructor("$ZodCheckGreaterThan",(inst,def)=>{$ZodCheck.init(inst,def);let origin=numericOriginMap[typeof def.value];inst._zod.onattach.push(inst2=>{let bag=inst2._zod.bag,curr=(def.inclusive?bag.minimum:bag.exclusiveMinimum)??Number.NEGATIVE_INFINITY;def.value>curr&&(def.inclusive?bag.minimum=def.value:bag.exclusiveMinimum=def.value)}),inst._zod.check=payload=>{(def.inclusive?payload.value>=def.value:payload.value>def.value)||payload.issues.push({origin,code:"too_small",minimum:def.value,input:payload.value,inclusive:def.inclusive,inst,continue:!def.abort})}}),$ZodCheckMultipleOf=$constructor("$ZodCheckMultipleOf",(inst,def)=>{$ZodCheck.init(inst,def),inst._zod.onattach.push(inst2=>{var _a;(_a=inst2._zod.bag).multipleOf??(_a.multipleOf=def.value)}),inst._zod.check=payload=>{if(typeof payload.value!=typeof def.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof payload.value=="bigint"?payload.value%def.value===BigInt(0):floatSafeRemainder(payload.value,def.value)===0)||payload.issues.push({origin:typeof payload.value,code:"not_multiple_of",divisor:def.value,input:payload.value,inst,continue:!def.abort})}}),$ZodCheckNumberFormat=$constructor("$ZodCheckNumberFormat",(inst,def)=>{$ZodCheck.init(inst,def),def.format=def.format||"float64";let isInt=def.format?.includes("int"),origin=isInt?"int":"number",[minimum,maximum]=NUMBER_FORMAT_RANGES[def.format];inst._zod.onattach.push(inst2=>{let bag=inst2._zod.bag;bag.format=def.format,bag.minimum=minimum,bag.maximum=maximum,isInt&&(bag.pattern=integer)}),inst._zod.check=payload=>{let input=payload.value;if(isInt){if(!Number.isInteger(input)){payload.issues.push({expected:origin,format:def.format,code:"invalid_type",continue:!1,input,inst});return}if(!Number.isSafeInteger(input)){input>0?payload.issues.push({input,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst,origin,continue:!def.abort}):payload.issues.push({input,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst,origin,continue:!def.abort});return}}input<minimum&&payload.issues.push({origin:"number",input,code:"too_small",minimum,inclusive:!0,inst,continue:!def.abort}),input>maximum&&payload.issues.push({origin:"number",input,code:"too_big",maximum,inst})}});var $ZodCheckMaxLength=$constructor("$ZodCheckMaxLength",(inst,def)=>{var _a;$ZodCheck.init(inst,def),(_a=inst._zod.def).when??(_a.when=payload=>{let val=payload.value;return!nullish(val)&&val.length!==void 0}),inst._zod.onattach.push(inst2=>{let curr=inst2._zod.bag.maximum??Number.POSITIVE_INFINITY;def.maximum<curr&&(inst2._zod.bag.maximum=def.maximum)}),inst._zod.check=payload=>{let input=payload.value;if(input.length<=def.maximum)return;let origin=getLengthableOrigin(input);payload.issues.push({origin,code:"too_big",maximum:def.maximum,inclusive:!0,input,inst,continue:!def.abort})}}),$ZodCheckMinLength=$constructor("$ZodCheckMinLength",(inst,def)=>{var _a;$ZodCheck.init(inst,def),(_a=inst._zod.def).when??(_a.when=payload=>{let val=payload.value;return!nullish(val)&&val.length!==void 0}),inst._zod.onattach.push(inst2=>{let curr=inst2._zod.bag.minimum??Number.NEGATIVE_INFINITY;def.minimum>curr&&(inst2._zod.bag.minimum=def.minimum)}),inst._zod.check=payload=>{let input=payload.value;if(input.length>=def.minimum)return;let origin=getLengthableOrigin(input);payload.issues.push({origin,code:"too_small",minimum:def.minimum,inclusive:!0,input,inst,continue:!def.abort})}}),$ZodCheckLengthEquals=$constructor("$ZodCheckLengthEquals",(inst,def)=>{var _a;$ZodCheck.init(inst,def),(_a=inst._zod.def).when??(_a.when=payload=>{let val=payload.value;return!nullish(val)&&val.length!==void 0}),inst._zod.onattach.push(inst2=>{let bag=inst2._zod.bag;bag.minimum=def.length,bag.maximum=def.length,bag.length=def.length}),inst._zod.check=payload=>{let input=payload.value,length=input.length;if(length===def.length)return;let origin=getLengthableOrigin(input),tooBig=length>def.length;payload.issues.push({origin,...tooBig?{code:"too_big",maximum:def.length}:{code:"too_small",minimum:def.length},inclusive:!0,exact:!0,input:payload.value,inst,continue:!def.abort})}}),$ZodCheckStringFormat=$constructor("$ZodCheckStringFormat",(inst,def)=>{var _a,_b;$ZodCheck.init(inst,def),inst._zod.onattach.push(inst2=>{let bag=inst2._zod.bag;bag.format=def.format,def.pattern&&(bag.patterns??(bag.patterns=new Set),bag.patterns.add(def.pattern))}),def.pattern?(_a=inst._zod).check??(_a.check=payload=>{def.pattern.lastIndex=0,!def.pattern.test(payload.value)&&payload.issues.push({origin:"string",code:"invalid_format",format:def.format,input:payload.value,...def.pattern?{pattern:def.pattern.toString()}:{},inst,continue:!def.abort})}):(_b=inst._zod).check??(_b.check=()=>{})}),$ZodCheckRegex=$constructor("$ZodCheckRegex",(inst,def)=>{$ZodCheckStringFormat.init(inst,def),inst._zod.check=payload=>{def.pattern.lastIndex=0,!def.pattern.test(payload.value)&&payload.issues.push({origin:"string",code:"invalid_format",format:"regex",input:payload.value,pattern:def.pattern.toString(),inst,continue:!def.abort})}}),$ZodCheckLowerCase=$constructor("$ZodCheckLowerCase",(inst,def)=>{def.pattern??(def.pattern=lowercase),$ZodCheckStringFormat.init(inst,def)}),$ZodCheckUpperCase=$constructor("$ZodCheckUpperCase",(inst,def)=>{def.pattern??(def.pattern=uppercase),$ZodCheckStringFormat.init(inst,def)}),$ZodCheckIncludes=$constructor("$ZodCheckIncludes",(inst,def)=>{$ZodCheck.init(inst,def);let escapedRegex=escapeRegex(def.includes),pattern=new RegExp(typeof def.position=="number"?`^.{${def.position}}${escapedRegex}`:escapedRegex);def.pattern=pattern,inst._zod.onattach.push(inst2=>{let bag=inst2._zod.bag;bag.patterns??(bag.patterns=new Set),bag.patterns.add(pattern)}),inst._zod.check=payload=>{payload.value.includes(def.includes,def.position)||payload.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:def.includes,input:payload.value,inst,continue:!def.abort})}}),$ZodCheckStartsWith=$constructor("$ZodCheckStartsWith",(inst,def)=>{$ZodCheck.init(inst,def);let pattern=new RegExp(`^${escapeRegex(def.prefix)}.*`);def.pattern??(def.pattern=pattern),inst._zod.onattach.push(inst2=>{let bag=inst2._zod.bag;bag.patterns??(bag.patterns=new Set),bag.patterns.add(pattern)}),inst._zod.check=payload=>{payload.value.startsWith(def.prefix)||payload.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:def.prefix,input:payload.value,inst,continue:!def.abort})}}),$ZodCheckEndsWith=$constructor("$ZodCheckEndsWith",(inst,def)=>{$ZodCheck.init(inst,def);let pattern=new RegExp(`.*${escapeRegex(def.suffix)}$`);def.pattern??(def.pattern=pattern),inst._zod.onattach.push(inst2=>{let bag=inst2._zod.bag;bag.patterns??(bag.patterns=new Set),bag.patterns.add(pattern)}),inst._zod.check=payload=>{payload.value.endsWith(def.suffix)||payload.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:def.suffix,input:payload.value,inst,continue:!def.abort})}});var $ZodCheckOverwrite=$constructor("$ZodCheckOverwrite",(inst,def)=>{$ZodCheck.init(inst,def),inst._zod.check=payload=>{payload.value=def.tx(payload.value)}});var Doc=class{constructor(args=[]){this.content=[],this.indent=0,this&&(this.args=args)}indented(fn){this.indent+=1,fn(this),this.indent-=1}write(arg){if(typeof arg=="function"){arg(this,{execution:"sync"}),arg(this,{execution:"async"});return}let lines=arg.split(`
|
|
2
|
-
`).filter(x=>x),minIndent=Math.min(...lines.map(x=>x.length-x.trimStart().length)),dedented=lines.map(x=>x.slice(minIndent)).map(x=>" ".repeat(this.indent*2)+x);for(let line of dedented)this.content.push(line)}compile(){let F=Function,
|
|
3
|
-
`))}};var version={major:4,minor:1,patch:11};var $ZodType=$constructor("$ZodType",(inst,def)=>{var _a;inst??(inst={}),inst._zod.def=def,inst._zod.bag=inst._zod.bag||{},inst._zod.version=version;let checks=[...inst._zod.def.checks??[]];inst._zod.traits.has("$ZodCheck")&&checks.unshift(inst);for(let ch of checks)for(let fn of ch._zod.onattach)fn(inst);if(checks.length===0)(_a=inst._zod).deferred??(_a.deferred=[]),inst._zod.deferred?.push(()=>{inst._zod.run=inst._zod.parse});else{let runChecks=(payload,checks2,ctx)=>{let isAborted=aborted(payload),asyncResult;for(let ch of checks2){if(ch._zod.def.when){if(!ch._zod.def.when(payload))continue}else if(isAborted)continue;let currLen=payload.issues.length,_=ch._zod.check(payload);if(_ instanceof Promise&&ctx?.async===!1)throw new $ZodAsyncError;if(asyncResult||_ instanceof Promise)asyncResult=(asyncResult??Promise.resolve()).then(async()=>{await _,payload.issues.length!==currLen&&(isAborted||(isAborted=aborted(payload,currLen)))});else{if(payload.issues.length===currLen)continue;isAborted||(isAborted=aborted(payload,currLen))}}return asyncResult?asyncResult.then(()=>payload):payload},handleCanaryResult=(canary,payload,ctx)=>{if(aborted(canary))return canary.aborted=!0,canary;let checkResult=runChecks(payload,checks,ctx);if(checkResult instanceof Promise){if(ctx.async===!1)throw new $ZodAsyncError;return checkResult.then(checkResult2=>inst._zod.parse(checkResult2,ctx))}return inst._zod.parse(checkResult,ctx)};inst._zod.run=(payload,ctx)=>{if(ctx.skipChecks)return inst._zod.parse(payload,ctx);if(ctx.direction==="backward"){let canary=inst._zod.parse({value:payload.value,issues:[]},{...ctx,skipChecks:!0});return canary instanceof Promise?canary.then(canary2=>handleCanaryResult(canary2,payload,ctx)):handleCanaryResult(canary,payload,ctx)}let result=inst._zod.parse(payload,ctx);if(result instanceof Promise){if(ctx.async===!1)throw new $ZodAsyncError;return result.then(result2=>runChecks(result2,checks,ctx))}return runChecks(result,checks,ctx)}}inst["~standard"]={validate:value=>{try{let r=safeParse(inst,value);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return safeParseAsync(inst,value).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}}),$ZodString=$constructor("$ZodString",(inst,def)=>{$ZodType.init(inst,def),inst._zod.pattern=[...inst?._zod.bag?.patterns??[]].pop()??string(inst._zod.bag),inst._zod.parse=(payload,_)=>{if(def.coerce)try{payload.value=String(payload.value)}catch{}return typeof payload.value=="string"||payload.issues.push({expected:"string",code:"invalid_type",input:payload.value,inst}),payload}}),$ZodStringFormat=$constructor("$ZodStringFormat",(inst,def)=>{$ZodCheckStringFormat.init(inst,def),$ZodString.init(inst,def)}),$ZodGUID=$constructor("$ZodGUID",(inst,def)=>{def.pattern??(def.pattern=guid),$ZodStringFormat.init(inst,def)}),$ZodUUID=$constructor("$ZodUUID",(inst,def)=>{if(def.version){let v={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[def.version];if(v===void 0)throw new Error(`Invalid UUID version: "${def.version}"`);def.pattern??(def.pattern=uuid(v))}else def.pattern??(def.pattern=uuid());$ZodStringFormat.init(inst,def)}),$ZodEmail=$constructor("$ZodEmail",(inst,def)=>{def.pattern??(def.pattern=email),$ZodStringFormat.init(inst,def)}),$ZodURL=$constructor("$ZodURL",(inst,def)=>{$ZodStringFormat.init(inst,def),inst._zod.check=payload=>{try{let trimmed=payload.value.trim(),url=new URL(trimmed);def.hostname&&(def.hostname.lastIndex=0,def.hostname.test(url.hostname)||payload.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:hostname.source,input:payload.value,inst,continue:!def.abort})),def.protocol&&(def.protocol.lastIndex=0,def.protocol.test(url.protocol.endsWith(":")?url.protocol.slice(0,-1):url.protocol)||payload.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:def.protocol.source,input:payload.value,inst,continue:!def.abort})),def.normalize?payload.value=url.href:payload.value=trimmed;return}catch{payload.issues.push({code:"invalid_format",format:"url",input:payload.value,inst,continue:!def.abort})}}}),$ZodEmoji=$constructor("$ZodEmoji",(inst,def)=>{def.pattern??(def.pattern=emoji()),$ZodStringFormat.init(inst,def)}),$ZodNanoID=$constructor("$ZodNanoID",(inst,def)=>{def.pattern??(def.pattern=nanoid),$ZodStringFormat.init(inst,def)}),$ZodCUID=$constructor("$ZodCUID",(inst,def)=>{def.pattern??(def.pattern=cuid),$ZodStringFormat.init(inst,def)}),$ZodCUID2=$constructor("$ZodCUID2",(inst,def)=>{def.pattern??(def.pattern=cuid2),$ZodStringFormat.init(inst,def)}),$ZodULID=$constructor("$ZodULID",(inst,def)=>{def.pattern??(def.pattern=ulid),$ZodStringFormat.init(inst,def)}),$ZodXID=$constructor("$ZodXID",(inst,def)=>{def.pattern??(def.pattern=xid),$ZodStringFormat.init(inst,def)}),$ZodKSUID=$constructor("$ZodKSUID",(inst,def)=>{def.pattern??(def.pattern=ksuid),$ZodStringFormat.init(inst,def)}),$ZodISODateTime=$constructor("$ZodISODateTime",(inst,def)=>{def.pattern??(def.pattern=datetime(def)),$ZodStringFormat.init(inst,def)}),$ZodISODate=$constructor("$ZodISODate",(inst,def)=>{def.pattern??(def.pattern=date),$ZodStringFormat.init(inst,def)}),$ZodISOTime=$constructor("$ZodISOTime",(inst,def)=>{def.pattern??(def.pattern=time(def)),$ZodStringFormat.init(inst,def)}),$ZodISODuration=$constructor("$ZodISODuration",(inst,def)=>{def.pattern??(def.pattern=duration),$ZodStringFormat.init(inst,def)}),$ZodIPv4=$constructor("$ZodIPv4",(inst,def)=>{def.pattern??(def.pattern=ipv4),$ZodStringFormat.init(inst,def),inst._zod.onattach.push(inst2=>{let bag=inst2._zod.bag;bag.format="ipv4"})}),$ZodIPv6=$constructor("$ZodIPv6",(inst,def)=>{def.pattern??(def.pattern=ipv6),$ZodStringFormat.init(inst,def),inst._zod.onattach.push(inst2=>{let bag=inst2._zod.bag;bag.format="ipv6"}),inst._zod.check=payload=>{try{new URL(`http://[${payload.value}]`)}catch{payload.issues.push({code:"invalid_format",format:"ipv6",input:payload.value,inst,continue:!def.abort})}}}),$ZodCIDRv4=$constructor("$ZodCIDRv4",(inst,def)=>{def.pattern??(def.pattern=cidrv4),$ZodStringFormat.init(inst,def)}),$ZodCIDRv6=$constructor("$ZodCIDRv6",(inst,def)=>{def.pattern??(def.pattern=cidrv6),$ZodStringFormat.init(inst,def),inst._zod.check=payload=>{let parts=payload.value.split("/");try{if(parts.length!==2)throw new Error;let[address,prefix]=parts;if(!prefix)throw new Error;let prefixNum=Number(prefix);if(`${prefixNum}`!==prefix)throw new Error;if(prefixNum<0||prefixNum>128)throw new Error;new URL(`http://[${address}]`)}catch{payload.issues.push({code:"invalid_format",format:"cidrv6",input:payload.value,inst,continue:!def.abort})}}});function isValidBase64(data){if(data==="")return!0;if(data.length%4!==0)return!1;try{return atob(data),!0}catch{return!1}}var $ZodBase64=$constructor("$ZodBase64",(inst,def)=>{def.pattern??(def.pattern=base64),$ZodStringFormat.init(inst,def),inst._zod.onattach.push(inst2=>{inst2._zod.bag.contentEncoding="base64"}),inst._zod.check=payload=>{isValidBase64(payload.value)||payload.issues.push({code:"invalid_format",format:"base64",input:payload.value,inst,continue:!def.abort})}});function isValidBase64URL(data){if(!base64url.test(data))return!1;let base642=data.replace(/[-_]/g,c=>c==="-"?"+":"/"),padded=base642.padEnd(Math.ceil(base642.length/4)*4,"=");return isValidBase64(padded)}var $ZodBase64URL=$constructor("$ZodBase64URL",(inst,def)=>{def.pattern??(def.pattern=base64url),$ZodStringFormat.init(inst,def),inst._zod.onattach.push(inst2=>{inst2._zod.bag.contentEncoding="base64url"}),inst._zod.check=payload=>{isValidBase64URL(payload.value)||payload.issues.push({code:"invalid_format",format:"base64url",input:payload.value,inst,continue:!def.abort})}}),$ZodE164=$constructor("$ZodE164",(inst,def)=>{def.pattern??(def.pattern=e164),$ZodStringFormat.init(inst,def)});function isValidJWT(token,algorithm=null){try{let tokensParts=token.split(".");if(tokensParts.length!==3)return!1;let[header]=tokensParts;if(!header)return!1;let parsedHeader=JSON.parse(atob(header));return!("typ"in parsedHeader&&parsedHeader?.typ!=="JWT"||!parsedHeader.alg||algorithm&&(!("alg"in parsedHeader)||parsedHeader.alg!==algorithm))}catch{return!1}}var $ZodJWT=$constructor("$ZodJWT",(inst,def)=>{$ZodStringFormat.init(inst,def),inst._zod.check=payload=>{isValidJWT(payload.value,def.alg)||payload.issues.push({code:"invalid_format",format:"jwt",input:payload.value,inst,continue:!def.abort})}});var $ZodNumber=$constructor("$ZodNumber",(inst,def)=>{$ZodType.init(inst,def),inst._zod.pattern=inst._zod.bag.pattern??number,inst._zod.parse=(payload,_ctx)=>{if(def.coerce)try{payload.value=Number(payload.value)}catch{}let input=payload.value;if(typeof input=="number"&&!Number.isNaN(input)&&Number.isFinite(input))return payload;let received=typeof input=="number"?Number.isNaN(input)?"NaN":Number.isFinite(input)?void 0:"Infinity":void 0;return payload.issues.push({expected:"number",code:"invalid_type",input,inst,...received?{received}:{}}),payload}}),$ZodNumberFormat=$constructor("$ZodNumber",(inst,def)=>{$ZodCheckNumberFormat.init(inst,def),$ZodNumber.init(inst,def)}),$ZodBoolean=$constructor("$ZodBoolean",(inst,def)=>{$ZodType.init(inst,def),inst._zod.pattern=boolean,inst._zod.parse=(payload,_ctx)=>{if(def.coerce)try{payload.value=!!payload.value}catch{}let input=payload.value;return typeof input=="boolean"||payload.issues.push({expected:"boolean",code:"invalid_type",input,inst}),payload}});var $ZodUnknown=$constructor("$ZodUnknown",(inst,def)=>{$ZodType.init(inst,def),inst._zod.parse=payload=>payload}),$ZodNever=$constructor("$ZodNever",(inst,def)=>{$ZodType.init(inst,def),inst._zod.parse=(payload,_ctx)=>(payload.issues.push({expected:"never",code:"invalid_type",input:payload.value,inst}),payload)});function handleArrayResult(result,final,index){result.issues.length&&final.issues.push(...prefixIssues(index,result.issues)),final.value[index]=result.value}var $ZodArray=$constructor("$ZodArray",(inst,def)=>{$ZodType.init(inst,def),inst._zod.parse=(payload,ctx)=>{let input=payload.value;if(!Array.isArray(input))return payload.issues.push({expected:"array",code:"invalid_type",input,inst}),payload;payload.value=Array(input.length);let proms=[];for(let i=0;i<input.length;i++){let item=input[i],result=def.element._zod.run({value:item,issues:[]},ctx);result instanceof Promise?proms.push(result.then(result2=>handleArrayResult(result2,payload,i))):handleArrayResult(result,payload,i)}return proms.length?Promise.all(proms).then(()=>payload):payload}});function handlePropertyResult(result,final,key,input){result.issues.length&&final.issues.push(...prefixIssues(key,result.issues)),result.value===void 0?key in input&&(final.value[key]=void 0):final.value[key]=result.value}function normalizeDef(def){let keys=Object.keys(def.shape);for(let k of keys)if(!def.shape?.[k]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${k}": expected a Zod schema`);let okeys=optionalKeys(def.shape);return{...def,keys,keySet:new Set(keys),numKeys:keys.length,optionalKeys:new Set(okeys)}}function handleCatchall(proms,input,payload,ctx,def,inst){let unrecognized=[],keySet=def.keySet,_catchall=def.catchall._zod,t=_catchall.def.type;for(let key of Object.keys(input)){if(keySet.has(key))continue;if(t==="never"){unrecognized.push(key);continue}let r=_catchall.run({value:input[key],issues:[]},ctx);r instanceof Promise?proms.push(r.then(r2=>handlePropertyResult(r2,payload,key,input))):handlePropertyResult(r,payload,key,input)}return unrecognized.length&&payload.issues.push({code:"unrecognized_keys",keys:unrecognized,input,inst}),proms.length?Promise.all(proms).then(()=>payload):payload}var $ZodObject=$constructor("$ZodObject",(inst,def)=>{if($ZodType.init(inst,def),!Object.getOwnPropertyDescriptor(def,"shape")?.get){let sh=def.shape;Object.defineProperty(def,"shape",{get:()=>{let newSh={...sh};return Object.defineProperty(def,"shape",{value:newSh}),newSh}})}let _normalized=cached(()=>normalizeDef(def));defineLazy(inst._zod,"propValues",()=>{let shape=def.shape,propValues={};for(let key in shape){let field=shape[key]._zod;if(field.values){propValues[key]??(propValues[key]=new Set);for(let v of field.values)propValues[key].add(v)}}return propValues});let isObject2=isObject,catchall=def.catchall,value;inst._zod.parse=(payload,ctx)=>{value??(value=_normalized.value);let input=payload.value;if(!isObject2(input))return payload.issues.push({expected:"object",code:"invalid_type",input,inst}),payload;payload.value={};let proms=[],shape=value.shape;for(let key of value.keys){let r=shape[key]._zod.run({value:input[key],issues:[]},ctx);r instanceof Promise?proms.push(r.then(r2=>handlePropertyResult(r2,payload,key,input))):handlePropertyResult(r,payload,key,input)}return catchall?handleCatchall(proms,input,payload,ctx,_normalized.value,inst):proms.length?Promise.all(proms).then(()=>payload):payload}}),$ZodObjectJIT=$constructor("$ZodObjectJIT",(inst,def)=>{$ZodObject.init(inst,def);let superParse=inst._zod.parse,_normalized=cached(()=>normalizeDef(def)),generateFastpass=shape=>{let doc=new Doc(["shape","payload","ctx"]),normalized=_normalized.value,parseStr=key=>{let k=esc(key);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};doc.write("const input = payload.value;");let ids=Object.create(null),counter=0;for(let key of normalized.keys)ids[key]=`key_${counter++}`;doc.write("const newResult = {};");for(let key of normalized.keys){let id=ids[key],k=esc(key);doc.write(`const ${id} = ${parseStr(key)};`),doc.write(`
|
|
4
|
-
|
|
5
|
-
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var require_lib=__commonJS({"../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js"(exports,module2){"use strict";var os=require("os"),paths=require("path"),isWinOS=/^win/i.test(process.platform);function normalize_path(path3){return paths.normalize(paths.join(path3,"."))}var base=()=>{let{env}=process,object2={};return object2.home=()=>normalize_path(os.homedir?os.homedir():env.HOME),object2.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TMPDIR||env.TEMP||env.TMP),object2},windows=()=>{let{env}=process,object2={};return object2.home=()=>normalize_path(os.homedir?os.homedir():env.USERPROFILE||paths.join(env.HOMEDRIVE,env.HOMEPATH)||env.HOME),object2.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TEMP||env.TMP||paths.join(env.LOCALAPPDATA||env.SystemRoot||env.windir,"Temp")),object2},_OSPaths=class __OSPaths{constructor(){let OSPaths=function(){return new __OSPaths};this._fn=OSPaths;let extension=isWinOS?windows():base();return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module2.exports=new _OSPaths}});var require_lib2=__commonJS({"../../node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js"(exports,module2){"use strict";var path3=require("path"),osPaths=require_lib(),linux=()=>{let object2={};return object2.cache=()=>process.env.XDG_CACHE_HOME||path3.join(osPaths.home()||osPaths.temp(),".cache"),object2.config=()=>process.env.XDG_CONFIG_HOME||path3.join(osPaths.home()||osPaths.temp(),".config"),object2.data=()=>process.env.XDG_DATA_HOME||path3.join(osPaths.home()||osPaths.temp(),".local","share"),object2.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object2.state=()=>process.env.XDG_STATE_HOME||path3.join(osPaths.home()||osPaths.temp(),".local","state"),object2},macos=()=>{let object2={};return object2.cache=()=>process.env.XDG_CACHE_HOME||path3.join(path3.join(osPaths.home()||osPaths.temp(),"Library"),"Caches"),object2.config=()=>process.env.XDG_CONFIG_HOME||path3.join(path3.join(osPaths.home()||osPaths.temp(),"Library"),"Preferences"),object2.data=()=>process.env.XDG_DATA_HOME||path3.join(path3.join(osPaths.home()||osPaths.temp(),"Library"),"Application Support"),object2.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object2.state=()=>process.env.XDG_STATE_HOME||path3.join(path3.join(osPaths.home()||osPaths.temp(),"Library"),"State"),object2},windows=()=>{let object2={};return object2.cache=()=>{let localAppData=process.env.LOCALAPPDATA||path3.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_CACHE_HOME||path3.join(localAppData,"xdg.cache")},object2.config=()=>{let appData=process.env.APPDATA||path3.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_CONFIG_HOME||path3.join(appData,"xdg.config")},object2.data=()=>{let appData=process.env.APPDATA||path3.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_DATA_HOME||path3.join(appData,"xdg.data")},object2.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object2.state=()=>{let localAppData=process.env.LOCALAPPDATA||path3.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_STATE_HOME||path3.join(localAppData,"xdg.state")},object2},_XDGPortable=()=>{let XDGPortable=function(){return _XDGPortable()},extension={};return/^darwin$/i.test(process.platform)?extension=macos():/^win/i.test(process.platform)?extension=windows():extension=linux(),extension.configDirs=()=>{let dirs=[];return dirs.push(extension.config()),process.env.XDG_CONFIG_DIRS&&dirs.push(...process.env.XDG_CONFIG_DIRS.split(path3.delimiter)),dirs},extension.dataDirs=()=>{let dirs=[];return dirs.push(extension.data()),process.env.XDG_DATA_DIRS&&dirs.push(...process.env.XDG_DATA_DIRS.split(path3.delimiter)),dirs},Object.keys(extension).forEach(key=>{XDGPortable[key]=extension[key]}),XDGPortable};module2.exports=_XDGPortable()}});var require_xdg_app_paths=__commonJS({"../../node_modules/.pnpm/xdg-app-paths@5.1.0/node_modules/xdg-app-paths/index.js"(exports,module2){"use strict";var path3=require("path"),os=require("os"),xdg=require_lib2(),isWinOS=/^win/i.test(process.platform);function _normalizeOptions(options,isolated){if(options=options||{},typeof options!="object"&&(options={isolated:options}),options.isolated=options.isolated===void 0||options.isolated===null?isolated:options.isolated,typeof options.isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof options.isolated}`);return options}var base=(name,isolated)=>{let object2={};return object2.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path3.join(xdg.cache(),options.isolated?name:"")),object2.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path3.join(xdg.config(),options.isolated?name:"")),object2.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path3.join(xdg.data(),options.isolated?name:"")),object2.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path3.join(xdg.runtime(),options.isolated?name:""):void 0),object2.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path3.join(xdg.state(),options.isolated?name:"")),object2.configDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.configDirs().map(s=>path3.join(s,options.isolated?name:""))),object2.dataDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.dataDirs().map(s=>path3.join(s,options.isolated?name:""))),object2},windows=(name,isolated)=>{let{env}=process,homedir2=os.homedir(),tmpdir=os.tmpdir(),appData=env.APPDATA||path3.join(homedir2||tmpdir,"AppData","Roaming"),localAppData=env.LOCALAPPDATA||path3.join(homedir2||tmpdir,"AppData","Local"),object2={};return object2.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CACHE_HOME?path3.join(xdg.cache(),options.isolated?name:""):path3.join(localAppData,options.isolated?name:"","Cache")),object2.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CONFIG_HOME?path3.join(xdg.config(),options.isolated?name:""):path3.join(appData,options.isolated?name:"","Config")),object2.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_DATA_HOME?path3.join(xdg.data(),options.isolated?name:""):path3.join(appData,options.isolated?name:"","Data")),object2.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path3.join(xdg.runtime(),options.isolated?name:""):void 0),object2.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_STATE_HOME?path3.join(xdg.state(),options.isolated?name:""):path3.join(localAppData,options.isolated?name:"","State")),object2.configDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object2.config(options)];return env.XDG_CONFIG_DIRS&&dirs.push(...env.XDG_CONFIG_DIRS.split(path3.delimiter).map(s=>path3.join(s,options.isolated?name:""))),dirs},object2.dataDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object2.data(options)];return env.XDG_DATA_DIRS&&dirs.push(...env.XDG_DATA_DIRS.split(path3.delimiter).map(s=>path3.join(s,options.isolated?name:""))),dirs},object2},_XDGAppPaths=class __XDGAppPaths{constructor(options={name:null,suffix:null,isolated:!0}){let XDGAppPaths=function(options2={name:null,suffix:null,isolated:!0}){return new __XDGAppPaths(options2)};this._fn=XDGAppPaths,options=options||{},typeof options!="object"&&(options={name:options});let name=options.name||"";if(typeof name!="string")throw new TypeError(`Expected string for "name" argument, got ${typeof name}`);let suffix=options.suffix||"";if(typeof suffix!="string")throw new TypeError(`Expected string for "suffix" argument, got ${typeof suffix}`);let isolated=options.isolated===void 0||options.isolated===null?!0:options.isolated;if(typeof isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof isolated}`);name||(name=path3.parse(process.pkg?process.execPath:require.main?require.main.filename:process.argv[0]).name),suffix&&(name+=suffix),this._fn.$name=()=>name,this._fn.$isolated=()=>isolated;let extension=isWinOS?windows(name,isolated):base(name,isolated);return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module2.exports=new _XDGAppPaths}});var src_exports={};__export(src_exports,{CRED_STORAGE_CONFIG_VALUES:()=>CRED_STORAGE_CONFIG_VALUES,CRED_STORAGE_VALUES:()=>CRED_STORAGE_VALUES,DEFAULT_CRED_STORAGE:()=>DEFAULT_CRED_STORAGE,authConfigHasUsableTokenData:()=>authConfigHasUsableTokenData,authConfigSchema:()=>authConfigSchema2,credStorageSchema:()=>credStorageSchema2,defaultAuthConfig:()=>defaultAuthConfig,defaultGlobalConfig:()=>defaultGlobalConfig,deleteAuthConfig:()=>deleteAuthConfig,deleteAuthConfigFile:()=>deleteAuthConfigFile,getAuthConfigFilePath:()=>getAuthConfigFilePath,getCachePath:()=>getCachePath,getConfigFilePath:()=>getConfigFilePath,getDataPath:()=>getDataPath,getDefaultAuthConfig:()=>getDefaultAuthConfig,getDpopAuthConfigFilePath:()=>getDpopAuthConfigFilePath,getGlobalPathConfig:()=>getGlobalPathConfig,getLikelyEffectiveCredStorage:()=>getLikelyEffectiveCredStorage,globalConfigSchema:()=>globalConfigSchema2,guidanceConfigSchema:()=>guidanceConfigSchema2,parseAuthConfig:()=>parseAuthConfig,parseAuthFileConfig:()=>parseAuthFileConfig,parseGlobalConfig:()=>parseGlobalConfig,readAuthConfig:()=>readAuthConfig,readAuthConfigFile:()=>readAuthConfigFile,readAuthFileConfig:()=>readAuthFileConfig,readConfigFile:()=>readConfigFile,readGlobalConfigFile:()=>readGlobalConfigFile,telemetryConfigSchema:()=>telemetryConfigSchema2,tryReadAuthConfig:()=>tryReadAuthConfig,updatesConfigSchema:()=>updatesConfigSchema2,writeAuthConfig:()=>writeAuthConfig,writeAuthConfigFile:()=>writeAuthConfigFile,writeConfigFile:()=>writeConfigFile,writeGlobalConfigFile:()=>writeGlobalConfigFile});module.exports=__toCommonJS(src_exports);var CRED_STORAGE_CONFIG_VALUES=["auto","file","keyring"],CRED_STORAGE_VALUES=CRED_STORAGE_CONFIG_VALUES.filter(storage=>storage!=="auto"),DEFAULT_CRED_STORAGE="file";var util_exports={};__export(util_exports,{BIGINT_FORMAT_RANGES:()=>BIGINT_FORMAT_RANGES,CONSTANT_CATCH:()=>CONSTANT_CATCH,Class:()=>Class,NUMBER_FORMAT_RANGES:()=>NUMBER_FORMAT_RANGES,aborted:()=>aborted,allowsEval:()=>allowsEval,assert:()=>assert,assertEqual:()=>assertEqual,assertIs:()=>assertIs,assertNever:()=>assertNever,assertNotEqual:()=>assertNotEqual,assignProp:()=>assignProp,attachSchema:()=>attachSchema,base64ToUint8Array:()=>base64ToUint8Array,base64urlToUint8Array:()=>base64urlToUint8Array,cached:()=>cached,captureStackTrace:()=>captureStackTrace,cleanEnum:()=>cleanEnum,cleanRegex:()=>cleanRegex,clone:()=>clone,cloneDef:()=>cloneDef,codePointLength:()=>codePointLength,constantCatch:()=>constantCatch,createTransparentProxy:()=>createTransparentProxy,defineLazy:()=>defineLazy,defineLazyInternal:()=>defineLazyInternal,derived:()=>derived,esc:()=>esc,escapeRegex:()=>escapeRegex,explicitlyAborted:()=>explicitlyAborted,extend:()=>extend,finalizeIssue:()=>finalizeIssue,floatSafeRemainder:()=>floatSafeRemainder,getElementAtPath:()=>getElementAtPath,getEnumValues:()=>getEnumValues,getLengthableOrigin:()=>getLengthableOrigin,getParsedType:()=>getParsedType,getSizableOrigin:()=>getSizableOrigin,hexToUint8Array:()=>hexToUint8Array,hide:()=>hide,installLazyProp:()=>installLazyProp,isObject:()=>isObject,isPlainObject:()=>isPlainObject,issue:()=>issue,joinValues:()=>joinValues,jsonStringifyReplacer:()=>jsonStringifyReplacer,members:()=>members,merge:()=>merge,mergeDefs:()=>mergeDefs,normalizeParams:()=>normalizeParams,nullish:()=>nullish,numKeys:()=>numKeys,objectClone:()=>objectClone,omit:()=>omit,optionalKeys:()=>optionalKeys,own:()=>own,parsedType:()=>parsedType,partial:()=>partial,pick:()=>pick,prefixIssues:()=>prefixIssues,primitiveTypes:()=>primitiveTypes,promiseAllObject:()=>promiseAllObject,propertyKeyTypes:()=>propertyKeyTypes,randomString:()=>randomString,rawShape:()=>rawShape,required:()=>required,safeExtend:()=>safeExtend,shallowClone:()=>shallowClone,sizeCaps:()=>sizeCaps,slugify:()=>slugify,stringifyPrimitive:()=>stringifyPrimitive,toZod:()=>toZod,uint8ArrayToBase64:()=>uint8ArrayToBase64,uint8ArrayToBase64url:()=>uint8ArrayToBase64url,uint8ArrayToHex:()=>uint8ArrayToHex,unwrapMessage:()=>unwrapMessage});function assertEqual(val){return val}function assertNotEqual(val){return val}function toZod(){return schema=>schema}function assertIs(_arg){}function assertNever(_x){throw new Error("Unexpected value in exhaustive check")}function assert(_){}function getEnumValues(entries){let numericValues=Object.values(entries).filter(v=>typeof v=="number");return Object.entries(entries).filter(([k,_])=>numericValues.indexOf(+k)===-1).map(([_,v])=>v)}function joinValues(array2,separator="|"){return array2.map(val=>stringifyPrimitive(val)).join(separator)}function jsonStringifyReplacer(_,value){return typeof value=="bigint"?value.toString():value}var Cached=class{constructor(getter){this._getter=getter,this._value=void 0}get value(){let getter=this._getter;return getter!==void 0&&(this._value=getter(),this._getter=void 0),this._value}};function cached(getter){return new Cached(getter)}function nullish(input){return input==null}function cleanRegex(source){let start=source.startsWith("^")?1:0,end=source.endsWith("$")?source.length-1:source.length;return source.slice(start,end)}function floatSafeRemainder(val,step){let ratio=val/step,roundedRatio=Math.round(ratio),tolerance=4*Number.EPSILON*Math.max(Math.abs(ratio),1);return Math.abs(ratio-roundedRatio)<tolerance?0:ratio-roundedRatio}var EVALUATING=Symbol("evaluating");function defineLazy(object2,key,getter){let value;Object.defineProperty(object2,key,{get(){if(value!==EVALUATING)return value===void 0&&(value=EVALUATING,value=getter()),value},set(v){Object.defineProperty(object2,key,{value:v})},configurable:!0})}function objectClone(obj){return Object.create(Object.getPrototypeOf(obj),Object.getOwnPropertyDescriptors(obj))}function assignProp(target,prop,value){Object.defineProperty(target,prop,{value,writable:!0,enumerable:!0,configurable:!0})}function rawShape(def){let desc=Object.getOwnPropertyDescriptor(def,"shape");return desc?.get?desc.get.raw:desc?.value}function sourceShape(schema){return rawShape(schema._zod.def)??schema._zod.def.shape}function deferProp(target,key,getter){Object.defineProperty(target,key,{get(){let value=getter();return assignProp(this,key,value),value},enumerable:!0,configurable:!0})}function putProp(target,key,value){key in target?assignProp(target,key,value):target[key]=value}function mirrorShape(target,source,keys,wrap){let raw=sourceShape(source);for(let key of keys){let desc=Object.getOwnPropertyDescriptor(raw,key);desc.enumerable&&(desc.get?deferProp(target,key,()=>{let value=source._zod.def.shape[key];return wrap?wrap(value,key):value}):putProp(target,key,wrap?wrap(desc.value,key):desc.value))}}function mirrorProps(target,source){for(let key of Reflect.ownKeys(source)){let desc=Object.getOwnPropertyDescriptor(source,key);desc.enumerable&&(desc.get?deferProp(target,key,()=>source[key]):putProp(target,key,desc.value))}}function mergeDefs(...defs){let mergedDescriptors={};for(let def of defs){let descriptors=Object.getOwnPropertyDescriptors(def);Object.assign(mergedDescriptors,descriptors)}return Object.defineProperties({},mergedDescriptors)}function cloneDef(schema){return mergeDefs(schema._zod.def)}function getElementAtPath(obj,path3){return path3?path3.reduce((acc,key)=>acc?.[key],obj):obj}function promiseAllObject(promisesObj){let keys=Object.keys(promisesObj),promises=keys.map(key=>promisesObj[key]);return Promise.all(promises).then(results=>{let resolvedObj={};for(let i=0;i<keys.length;i++)resolvedObj[keys[i]]=results[i];return resolvedObj})}function randomString(length=10){let chars="abcdefghijklmnopqrstuvwxyz",str="";for(let i=0;i<length;i++)str+=chars[Math.floor(Math.random()*chars.length)];return str}function esc(str){return JSON.stringify(str)}function slugify(input){return input.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var captureStackTrace="captureStackTrace"in Error?Error.captureStackTrace:(..._args)=>{};function isObject(data){return typeof data=="object"&&data!==null&&!Array.isArray(data)}var allowsEval=cached(()=>{if(globalConfig.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let F=Function;return new F(""),!0}catch{return!1}});function isPlainObject(o){if(isObject(o)===!1)return!1;let ctor=o.constructor;if(ctor===void 0||typeof ctor!="function")return!0;let prot=ctor.prototype;return!(isObject(prot)===!1||Object.prototype.hasOwnProperty.call(prot,"isPrototypeOf")===!1)}function shallowClone(o){return isPlainObject(o)?{...o}:Array.isArray(o)?[...o]:o instanceof Map?new Map(o):o instanceof Set?new Set(o):o}function numKeys(data){let keyCount=0;for(let key in data)Object.prototype.hasOwnProperty.call(data,key)&&keyCount++;return keyCount}var getParsedType=data=>{let t=typeof data;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(data)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(data)?"array":data===null?"null":data.then&&typeof data.then=="function"&&data.catch&&typeof data.catch=="function"?"promise":typeof Map<"u"&&data instanceof Map?"map":typeof Set<"u"&&data instanceof Set?"set":typeof Date<"u"&&data instanceof Date?"date":typeof File<"u"&&data instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},propertyKeyTypes=new Set(["string","number","symbol"]),primitiveTypes=new Set(["string","number","bigint","boolean","symbol","undefined"]);function escapeRegex(str){return str.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function clone(inst,def,params){let cl=new inst._zod.constr(def??inst._zod.def);return(!def||params?.parent)&&(cl._zod.parent=inst),cl}function normalizeParams(_params){let params=_params;if(!params)return{};if(typeof params=="string")return{error:()=>params};if(params?.message!==void 0){if(params?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");params.error=params.message}return delete params.message,typeof params.error=="string"?{...params,error:()=>params.error}:params}function createTransparentProxy(getter){let target;return new Proxy({},{get(_,prop,receiver){return target??(target=getter()),Reflect.get(target,prop,receiver)},set(_,prop,value,receiver){return target??(target=getter()),Reflect.set(target,prop,value,receiver)},has(_,prop){return target??(target=getter()),Reflect.has(target,prop)},deleteProperty(_,prop){return target??(target=getter()),Reflect.deleteProperty(target,prop)},ownKeys(_){return target??(target=getter()),Reflect.ownKeys(target)},getOwnPropertyDescriptor(_,prop){return target??(target=getter()),Reflect.getOwnPropertyDescriptor(target,prop)},defineProperty(_,prop,descriptor){return target??(target=getter()),Reflect.defineProperty(target,prop,descriptor)}})}function stringifyPrimitive(value){return typeof value=="bigint"?value.toString()+"n":typeof value=="string"?`"${value}"`:`${value}`}function optionalKeys(shape){return Object.keys(shape).filter(k=>shape[k]._zod.optin!==void 0&&shape[k]._zod.optout==="optional")}var NUMBER_FORMAT_RANGES=(()=>({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]}))(),BIGINT_FORMAT_RANGES={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function pick(schema,mask){let currDef=schema._zod.def,checks=currDef.checks;if(checks&&checks.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let newShape={};return mirrorShape(newShape,schema,maskedKeys(schema,mask)),clone(schema,mergeDefs(currDef,{shape:newShape,checks:[]}))}function maskedKeys(schema,mask){let raw=sourceShape(schema),keys=[];for(let key of Reflect.ownKeys(mask)){if(!Object.getOwnPropertyDescriptor(raw,key)?.enumerable)throw new Error(`Unrecognized key: "${String(key)}"`);mask[key]&&keys.push(key)}return keys}function omit(schema,mask){let currDef=schema._zod.def,checks=currDef.checks;if(checks&&checks.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let omitted=new Set(maskedKeys(schema,mask)),newShape={};return mirrorShape(newShape,schema,Reflect.ownKeys(sourceShape(schema)).filter(key=>!omitted.has(key))),clone(schema,mergeDefs(currDef,{shape:newShape,checks:[]}))}function extend(schema,shape){if(!isPlainObject(shape))throw new Error("Invalid input to extend: expected a plain object");let checks=schema._zod.def.checks;if(checks&&checks.length>0){let existingShape=sourceShape(schema);for(let key of Reflect.ownKeys(shape))if(Object.getOwnPropertyDescriptor(existingShape,key)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return clone(schema,mergeDefs(schema._zod.def,{shape:extended(schema,shape)}))}function extended(schema,shape){let newShape={};return mirrorShape(newShape,schema,Reflect.ownKeys(sourceShape(schema))),mirrorProps(newShape,shape),newShape}function safeExtend(schema,shape){if(!isPlainObject(shape))throw new Error("Invalid input to safeExtend: expected a plain object");return clone(schema,mergeDefs(schema._zod.def,{shape:extended(schema,shape)}))}function merge(a,b){if(!b?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(a._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let newShape={};mirrorShape(newShape,a,Reflect.ownKeys(sourceShape(a))),mirrorShape(newShape,b,Reflect.ownKeys(sourceShape(b)));let def=mergeDefs(a._zod.def,{shape:newShape,get catchall(){return b._zod.def.catchall},checks:b._zod.def.checks??[]});return clone(a,def)}function partial(Class2,schema,mask,name="partial"){let checks=schema._zod.def.checks;if(checks&&checks.length>0)throw new Error(`.${name}() cannot be used on object schemas containing refinements`);let selected=mask?new Set(maskedKeys(schema,mask)):void 0,newShape={};return mirrorShape(newShape,schema,Reflect.ownKeys(sourceShape(schema)),Class2&&((value,key)=>selected&&!selected.has(key)?value:new Class2({type:"optional",innerType:value}))),clone(schema,mergeDefs(schema._zod.def,{shape:newShape,checks:[]}))}function required(Class2,schema,mask){let selected=mask?new Set(maskedKeys(schema,mask)):void 0,newShape={};return mirrorShape(newShape,schema,Reflect.ownKeys(sourceShape(schema)),(value,key)=>selected&&!selected.has(key)?value:new Class2({type:"nonoptional",innerType:value})),clone(schema,mergeDefs(schema._zod.def,{shape:newShape}))}function aborted(x,startIndex=0){if(x.aborted===!0)return!0;for(let i=startIndex;i<x.issues.length;i++)if(x.issues[i]?.continue!==!0)return!0;return!1}function explicitlyAborted(x,startIndex=0){if(x.aborted===!0)return!0;for(let i=startIndex;i<x.issues.length;i++)if(x.issues[i]?.continue===!1)return!0;return!1}function prefixIssues(path3,issues){return issues.map(iss=>{var _a3;return(_a3=iss).path??(_a3.path=[]),iss.path.unshift(path3),iss})}function unwrapMessage(message){return typeof message=="string"?message:message?.message}function sizeCaps(defChecks){let caps=[];for(let ch of defChecks??[]){let d=ch._zod.def;if(!/_(length|size)$|_equals$/.test(d.check))break;let max=d.maximum??d.length??d.size;max>=0&&caps.push([max,ch])}return caps}function attachSchema(issues,start,inst){var _a3;for(let i=start;i<issues.length;i++)(_a3=issues[i]).schema??(_a3.schema=inst)}function finalizeIssue(iss,ctx,config2){var _a3;let traits=iss.inst?._zod?.traits;traits?.has("$ZodType")&&(traits.has("$ZodCheck")?(_a3=iss).schema??(_a3.schema=iss.inst):iss.schema=iss.inst);let schemaError=iss.schema!==iss.inst?iss.schema?._zod.def?.error:void 0,message=iss.message?iss.message:unwrapMessage(iss.inst?._zod.def?.error?.(iss))??unwrapMessage(schemaError?.(iss))??unwrapMessage(ctx?.error?.(iss))??unwrapMessage(config2.customError?.(iss))??unwrapMessage(config2.localeError?.(iss))??"Invalid input",full={};for(let k of Object.keys(iss))k==="inst"||k==="schema"||k==="continue"||k==="input"||k==="__proto__"||(full[k]=iss[k]);return full.path??(full.path=[]),full.message=message,ctx?.reportInput&&(full.input=iss.input),full}function getSizableOrigin(input){return input instanceof Set?"set":input instanceof Map?"map":input instanceof File?"file":"unknown"}var highSurrogate=/[\uD800-\uDBFF]/;function codePointLength(str){let units=str.length;if(!highSurrogate.test(str))return units;let count=units;for(let i=0;i<units-1;i++)(str.charCodeAt(i)&64512)===55296&&(str.charCodeAt(i+1)&64512)===56320&&(count--,i++);return count}function getLengthableOrigin(input){return Array.isArray(input)?"array":typeof input=="string"?"string":"unknown"}function parsedType(data){let t=typeof data;switch(t){case"number":return Number.isNaN(data)?"nan":"number";case"object":{if(data===null)return"null";if(Array.isArray(data))return"array";let obj=data;if(obj&&Object.getPrototypeOf(obj)!==Object.prototype&&"constructor"in obj&&obj.constructor)return obj.constructor.name}}return t}function issue(...args){let[iss,input,inst]=args;return typeof iss=="string"?{message:iss,code:"custom",input,inst}:{...iss}}function cleanEnum(obj){return Object.entries(obj).filter(([k,_])=>Number.isNaN(Number.parseInt(k,10))).map(el=>el[1])}function base64ToUint8Array(base642){let binaryString=atob(base642),bytes=new Uint8Array(binaryString.length);for(let i=0;i<binaryString.length;i++)bytes[i]=binaryString.charCodeAt(i);return bytes}function uint8ArrayToBase64(bytes){let binaryString="";for(let i=0;i<bytes.length;i++)binaryString+=String.fromCharCode(bytes[i]);return btoa(binaryString)}function base64urlToUint8Array(base64url2){let base642=base64url2.replace(/-/g,"+").replace(/_/g,"/"),padding="=".repeat((4-base642.length%4)%4);return base64ToUint8Array(base642+padding)}function uint8ArrayToBase64url(bytes){return uint8ArrayToBase64(bytes).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function hexToUint8Array(hex){let cleanHex=hex.replace(/^0x/,"");if(cleanHex.length%2!==0)throw new Error("Invalid hex string length");let bytes=new Uint8Array(cleanHex.length/2);for(let i=0;i<cleanHex.length;i+=2)bytes[i/2]=Number.parseInt(cleanHex.slice(i,i+2),16);return bytes}function uint8ArrayToHex(bytes){return Array.from(bytes).map(b=>b.toString(16).padStart(2,"0")).join("")}var Class=class{constructor(..._args){}};function members(proto,table){for(let key in table){let desc=Object.getOwnPropertyDescriptor(table,key);desc.get?Object.defineProperty(proto,key,{...desc,enumerable:!1}):defineBound(proto,key,desc.value)}}function own(inst,key,value,enumerable=!0){return Object.defineProperty(inst,key,{configurable:!0,writable:!0,enumerable,value}),value}function hide(inst,key,value){return own(inst,key,value,!1)}function derived(computes,table){for(let key in computes){let compute=computes[key];Object.defineProperty(table,key,{configurable:!0,enumerable:!0,get(){return own(this,key,compute(this))},set(value){own(this,key,value)}})}return table}function defineBound(proto,key,fn){Object.defineProperty(proto,key,{configurable:!0,get(){return this==null?fn:own(this,key,fn.bind(this))},set(value){own(this,key,value)}})}function claim(inst,sentinel){let proto=Object.getPrototypeOf(inst);return sentinel in proto?void 0:proto}var installing,broke=!1,breaker={configurable:!0,get(){broke=!0}};function defineLazyInternal(inst,key,compute){let proto=Object.getPrototypeOf(inst._zod);if(key in proto&&installing!==inst._zod){installing=void 0;return}installing=inst._zod,Object.defineProperty(proto,key,{configurable:!0,get(){Object.defineProperty(this,key,breaker);let outer=broke;broke=!1;try{let value=compute(this);return broke?delete this[key]:Object.defineProperty(this,key,{configurable:!0,writable:!0,value}),broke=broke||outer,value}catch(err){throw delete this[key],broke=broke||outer,err}},set(value){Object.defineProperty(this,key,{configurable:!0,writable:!0,value})}})}function installLazyProp(inst,key,make,enumerable){let proto=claim(inst,key);proto&&Object.defineProperty(proto,key,{configurable:!0,get(){let desc={configurable:!0,writable:!0,enumerable,value:void 0};return Object.defineProperty(this,key,desc),desc.value=make(this),Object.defineProperty(this,key,desc),desc.value},set(value){Object.defineProperty(this,key,{configurable:!0,writable:!0,enumerable,value})}})}var CONSTANT_CATCH="~constantCatch";function constantCatch(value){let fn=()=>value;return fn[CONSTANT_CATCH]=!0,fn}var _a;var _zodDesc={value:void 0,enumerable:!1},_E="captureStackTrace"in Error?Error:null;function newError(Definition){let E=_E;if(E){let saved=E.stackTraceLimit;if(typeof saved=="number"){try{E.stackTraceLimit=0}catch{return _E=null,new Definition}try{return new Definition}finally{E.stackTraceLimit=saved}}}return new Definition}function $constructor(name,initializer3,proto,params){let zodProto={};function Internals(def){this.def=def,this.constr=_,this.traits=new Set}Internals.prototype=zodProto;let protoMembers=proto,initialized=protoMembers&&new WeakSet;function init(inst,def){if(inst._zod){if(inst._zod.traits.has(name))return}else{_zodDesc.value=new Internals(def);try{Object.defineProperty(inst,"_zod",_zodDesc)}finally{_zodDesc.value=void 0}}if(inst._zod.traits.add(name),initializer3(inst,def),initialized){let own2=Object.getPrototypeOf(inst),ctorProto=inst._zod.constr.prototype,up=own2;for(;up&&up!==ctorProto;)up=Object.getPrototypeOf(up);let target=up??own2;initialized.has(target)||(initialized.add(target),members(target,protoMembers))}let proto2=_.prototype;for(let k in proto2)Object.prototype.hasOwnProperty.call(proto2,k)&&(k in inst||(inst[k]=proto2[k].bind(inst)))}let Parent=params?.Parent??Object;class Definition extends Parent{}Object.defineProperty(Definition,"name",{value:name});function _(def){let inst=params?.Parent?newError(Definition):this;init(inst,def);let deferred=inst._zod.deferred;if(deferred){for(let fn of deferred)fn();inst._zod.deferred=void 0}let pp=globalThis.__zod_globalConfig?.postProcessor;return pp&&pp(inst),inst}return Object.defineProperty(_,"init",{value:init}),Object.defineProperty(_,Symbol.hasInstance,{value:inst=>params?.Parent&&inst instanceof params.Parent?!0:inst?._zod?.traits?.has(name)}),Object.defineProperty(_,"name",{value:name}),_}var $ZodAsyncError=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},$ZodEncodeError=class extends Error{constructor(name){super(`Encountered unidirectional transform during encode: ${name}`),this.name="ZodEncodeError"}};(_a=globalThis).__zod_globalConfig??(_a.__zod_globalConfig={});var globalConfig=globalThis.__zod_globalConfig;function config(newConfig){return newConfig&&Object.assign(globalConfig,newConfig),globalConfig}function _getMessage(){let internals=this._zod;return internals.message??(internals.message=JSON.stringify(internals.def,jsonStringifyReplacer,2)),internals.message}function _setMessage(value){this._zod.message=value}var _messageDesc={get:_getMessage,set:_setMessage,enumerable:!0,configurable:!0},_issuesDesc={value:void 0,enumerable:!1},_installedToString=new WeakSet([Object.prototype,Error.prototype]),initializer=(inst,def)=>{inst.name="$ZodError",_issuesDesc.value=def,Object.defineProperty(inst,"issues",_issuesDesc),_issuesDesc.value=void 0,Object.defineProperty(inst,"message",_messageDesc);let proto=Object.getPrototypeOf(inst);_installedToString.has(proto)||(_installedToString.add(proto),Object.defineProperty(proto,"toString",{configurable:!0,enumerable:!1,get(){let value=()=>this.message;return Object.defineProperty(this,"toString",{value,configurable:!0,writable:!0}),value},set(value){Object.defineProperty(this,"toString",{value,configurable:!0,writable:!0})}}))},$ZodError=$constructor("$ZodError",initializer),$ZodRealError=$constructor("$ZodError",initializer,void 0,{Parent:Error});function node(obj,key,make){return Object.prototype.hasOwnProperty.call(obj,key)||(key==="__proto__"?Object.defineProperty(obj,key,{value:make(),writable:!0,enumerable:!0,configurable:!0}):obj[key]=make()),obj[key]}function flattenError(error2,mapper=issue2=>issue2.message){let fieldErrors={},formErrors=[];for(let sub of error2.issues)sub.path.length>0?node(fieldErrors,sub.path[0],()=>[]).push(mapper(sub)):formErrors.push(mapper(sub));return{formErrors,fieldErrors}}function formatError(error2,mapper=issue2=>issue2.message){let fieldErrors={_errors:[]},processError=(error3,path3=[])=>{for(let issue2 of error3.issues)if(issue2.code==="invalid_union"&&issue2.errors.length)issue2.errors.map(issues=>processError({issues},[...path3,...issue2.path]));else if(issue2.code==="invalid_key")processError({issues:issue2.issues},[...path3,...issue2.path]);else if(issue2.code==="invalid_element")processError({issues:issue2.issues},[...path3,...issue2.path]);else{let fullpath=[...path3,...issue2.path];if(fullpath.length===0)fieldErrors._errors.push(mapper(issue2));else{let curr=fieldErrors,i=0;for(;i<fullpath.length;){let el=fullpath[i],terminal=i===fullpath.length-1;if(el==="_errors"){terminal&&curr._errors.push(mapper(issue2)),i++;continue}Object.prototype.hasOwnProperty.call(curr,el)||Object.defineProperty(curr,el,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let node2=curr[el];terminal&&node2._errors.push(mapper(issue2)),curr=node2,i++}}}};return processError(error2),fieldErrors}function finalizeParams(callee,params){return{callee:params?.callee??callee,Err:params?.Err}}var _parse=_Err=>{let fn=(schema,value,_ctx,_params)=>{let ctx=_ctx?{..._ctx,async:!1}:{async:!1},result=schema._zod.run({value,issues:[]},ctx);if(result instanceof Promise)throw new $ZodAsyncError;if(result.issues.length){let e=new(_params?.Err??_Err)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())));throw captureStackTrace(e,_params?.callee??fn),e}return result.value};return fn};var _parseAsync=_Err=>{let fn=async(schema,value,_ctx,params)=>{let ctx=_ctx?{..._ctx,async:!0}:{async:!0},result=schema._zod.run({value,issues:[]},ctx);if(result instanceof Promise&&(result=await result),result.issues.length){let e=new(params?.Err??_Err)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())));throw captureStackTrace(e,params?.callee??fn),e}return result.value};return fn};var _safeParse=_Err=>(schema,value,_ctx)=>{let ctx=_ctx?{..._ctx,async:!1}:{async:!1},result=schema._zod.run({value,issues:[]},ctx);if(result instanceof Promise)throw new $ZodAsyncError;return result.issues.length?failure(_Err,result.issues,ctx):{success:!0,data:result.value}};function failure(Err,issues,ctx){let error2;return{success:!1,get error(){return error2||(error2=new Err(issues.map(iss=>finalizeIssue(iss,ctx,config()))),issues=void 0,ctx=void 0),error2},set error(e){error2=e,issues=void 0,ctx=void 0}}}var _safeParseAsync=_Err=>async(schema,value,_ctx)=>{let ctx=_ctx?{..._ctx,async:!0}:{async:!0},result=schema._zod.run({value,issues:[]},ctx);return result instanceof Promise&&(result=await result),result.issues.length?failure(_Err,result.issues,ctx):{success:!0,data:result.value}};var COMPILE_INVALID=Symbol.for("zod.compile.invalid"),COMPILE_FALLBACK=Symbol.for("zod.compile.fallback"),validate=(schema,value,_ctx)=>{let validator=schema._zod.bag.validator;if(validator!==void 0){if(validator(value)!==COMPILE_INVALID)return!0;if(validator.definite===!0&&_ctx===void 0)return!1}return validateFallback(schema,value,_ctx)};function validateFallback(schema,value,_ctx){let ctx=_ctx?{..._ctx,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},fallbackRun=schema._zod.bag.fallbackRun,result;if(fallbackRun?(ctx[COMPILE_FALLBACK]=!0,result=fallbackRun({value,issues:[]},ctx)):result=schema._zod.run({value,issues:[]},ctx),result instanceof Promise)throw new $ZodAsyncError;return result.issues.length===0}var validateAsync=async(schema,value,_ctx)=>{let ctx=_ctx?{..._ctx,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},result=schema._zod.run({value,issues:[]},ctx);return result instanceof Promise&&(result=await result),result.issues.length===0},_encode=_Err=>{let parse2=_parse(_Err),fn=(schema,value,_ctx,_params)=>{let ctx=_ctx?{..._ctx,direction:"backward"}:{direction:"backward"};return parse2(schema,value,ctx,finalizeParams(fn,_params))};return fn};var _decode=_Err=>{let parse2=_parse(_Err),fn=(schema,value,_ctx,_params)=>parse2(schema,value,_ctx,finalizeParams(fn,_params));return fn};var _encodeAsync=_Err=>{let parseAsync2=_parseAsync(_Err),fn=async(schema,value,_ctx,_params)=>{let ctx=_ctx?{..._ctx,direction:"backward"}:{direction:"backward"};return await parseAsync2(schema,value,ctx,finalizeParams(fn,_params))};return fn};var _decodeAsync=_Err=>{let parseAsync2=_parseAsync(_Err),fn=async(schema,value,_ctx,_params)=>await parseAsync2(schema,value,_ctx,finalizeParams(fn,_params));return fn};var _safeEncode=_Err=>(schema,value,_ctx)=>{let ctx=_ctx?{..._ctx,direction:"backward"}:{direction:"backward"};return _safeParse(_Err)(schema,value,ctx)};var _safeDecode=_Err=>(schema,value,_ctx)=>_safeParse(_Err)(schema,value,_ctx);var _safeEncodeAsync=_Err=>async(schema,value,_ctx)=>{let ctx=_ctx?{..._ctx,direction:"backward"}:{direction:"backward"};return _safeParseAsync(_Err)(schema,value,ctx)};var _safeDecodeAsync=_Err=>async(schema,value,_ctx)=>_safeParseAsync(_Err)(schema,value,_ctx);var cuid=/^[cC][0-9a-z]{6,}$/,cuid2=/^[0-9a-z]+$/,ulid=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,xid=/^[0-9a-vA-V]{20}$/,ksuid=/^[A-Za-z0-9]{27}$/,nanoid=/^[a-zA-Z0-9_-]{21}$/;function nanoidOfLength(length){return new RegExp(`^[a-zA-Z0-9_-]{${length}}$`)}var duration=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var guid=/^([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})$/,uuid=version2=>version2?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version2}[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 email=/^(?:[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 _emoji="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function emoji(){return new RegExp(_emoji,"u")}var ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6=/^(([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 cidrv4=/^((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])$/,cidrv6=/^(([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])$/,base64=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,base64url=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var httpProtocol=/^https?$/,e164=/^\+[1-9]\d{6,14}$/;var dateSource="(?:(?:\\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 anchor(source){return new RegExp(`^${source}$`)}var date=anchor(dateSource);function timeSource(args){let hhmm="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof args.precision=="number"?args.precision===-1?`${hhmm}`:args.precision===0?`${hhmm}:[0-5]\\d`:`${hhmm}:[0-5]\\d\\.\\d{${args.precision}}`:args.seconds?`${hhmm}:[0-5]\\d(?:\\.\\d+)?`:`${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`}function time(args){return new RegExp(`^${timeSource(args)}$`)}function datetime(args){let opts=["Z"];args.offset&&opts.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let qualified=`${timeSource({precision:args.precision,seconds:!0})}(?:${opts.join("|")})`,timeRegex=args.local?`${qualified}|${timeSource({precision:args.precision})}`:qualified;return new RegExp(`^${dateSource}T(?:${timeRegex})$`)}var anyString=/^[\s\S]{0,}$/;var number=/^-?\d+(?:\.\d+)?$/,boolean=/^(?:true|false)$/i;var lowercase=/^[^A-Z]*$/,uppercase=/^[^a-z]*$/;var $ZodCheck=$constructor("$ZodCheck",(inst,def)=>{var _a3;inst._zod??(inst._zod={}),inst._zod.def=def,(_a3=inst._zod).onattach??(_a3.onattach=[])});var _whenHasLength=payload=>{let val=payload.value;return!nullish(val)&&val.length!==void 0},numericOriginMap={number:"number",bigint:"bigint",object:"date"},$ZodCheckLessThan=$constructor("$ZodCheckLessThan",(inst,def)=>{$ZodCheck.init(inst,def);let origin=numericOriginMap[typeof def.value];inst._zod.check=payload=>{(def.inclusive?payload.value<=def.value:payload.value<def.value)||payload.issues.push({origin:numericOriginMap[typeof payload.value]??origin,code:"too_big",maximum:typeof def.value=="object"?def.value.getTime():def.value,input:payload.value,inclusive:def.inclusive,inst,continue:!def.abort})}}),$ZodCheckGreaterThan=$constructor("$ZodCheckGreaterThan",(inst,def)=>{$ZodCheck.init(inst,def);let origin=numericOriginMap[typeof def.value];inst._zod.check=payload=>{(def.inclusive?payload.value>=def.value:payload.value>def.value)||payload.issues.push({origin:numericOriginMap[typeof payload.value]??origin,code:"too_small",minimum:typeof def.value=="object"?def.value.getTime():def.value,input:payload.value,inclusive:def.inclusive,inst,continue:!def.abort})}}),$ZodCheckMultipleOf=$constructor("$ZodCheckMultipleOf",(inst,def)=>{$ZodCheck.init(inst,def),inst._zod.check=payload=>{if(typeof payload.value!=typeof def.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof payload.value=="bigint"?def.value!==BigInt(0)&&payload.value%def.value===BigInt(0):floatSafeRemainder(payload.value,def.value)===0)||payload.issues.push({origin:typeof payload.value,code:"not_multiple_of",divisor:def.value,input:payload.value,inst,continue:!def.abort})}}),$ZodCheckNumberFormat=$constructor("$ZodCheckNumberFormat",(inst,def)=>{$ZodCheck.init(inst,def),def.format=def.format||"float64";let isInt=def.format?.includes("int"),origin=isInt?"int":"number",[minimum,maximum]=NUMBER_FORMAT_RANGES[def.format];inst._zod.check=payload=>{let input=payload.value;if(isInt){if(!Number.isInteger(input)){payload.issues.push({expected:origin,format:def.format,code:"invalid_type",continue:!1,input,inst});return}if(!Number.isSafeInteger(input)){input>0?payload.issues.push({input,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst,origin,inclusive:!0,continue:!def.abort}):payload.issues.push({input,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst,origin,inclusive:!0,continue:!def.abort});return}}input<minimum&&payload.issues.push({origin:"number",input,code:"too_small",minimum,inclusive:!0,inst,continue:!def.abort}),input>maximum&&payload.issues.push({origin:"number",input,code:"too_big",maximum,inclusive:!0,inst,continue:!def.abort})}});var $ZodCheckMaxLength=$constructor("$ZodCheckMaxLength",(inst,def)=>{var _a3;$ZodCheck.init(inst,def),(_a3=inst._zod.def).when??(_a3.when=_whenHasLength),inst._zod.check=payload=>{let input=payload.value,units=input.length;if((typeof input=="string"&&units>def.maximum?codePointLength(input):units)<=def.maximum)return;let origin=getLengthableOrigin(input);payload.issues.push({origin,code:"too_big",maximum:def.maximum,inclusive:!0,input,inst,continue:!def.abort})}}),$ZodCheckMinLength=$constructor("$ZodCheckMinLength",(inst,def)=>{var _a3;$ZodCheck.init(inst,def),(_a3=inst._zod.def).when??(_a3.when=_whenHasLength),inst._zod.check=payload=>{let input=payload.value,units=input.length;if((typeof input=="string"&&units>=def.minimum&&units<def.minimum*2?codePointLength(input):units)>=def.minimum)return;let origin=getLengthableOrigin(input);payload.issues.push({origin,code:"too_small",minimum:def.minimum,inclusive:!0,input,inst,continue:!def.abort})}}),$ZodCheckLengthEquals=$constructor("$ZodCheckLengthEquals",(inst,def)=>{var _a3;$ZodCheck.init(inst,def),(_a3=inst._zod.def).when??(_a3.when=_whenHasLength),inst._zod.check=payload=>{let input=payload.value,units=input.length,length=typeof input=="string"&&units>=def.length&&units<=def.length*2?codePointLength(input):units;if(length===def.length)return;let origin=getLengthableOrigin(input),tooBig=length>def.length;payload.issues.push({origin,...tooBig?{code:"too_big",maximum:def.length}:{code:"too_small",minimum:def.length},inclusive:!0,exact:!0,input:payload.value,inst,continue:!def.abort})}}),$ZodCheckStringFormat=$constructor("$ZodCheckStringFormat",(inst,def)=>{var _a3,_b;$ZodCheck.init(inst,def),def.pattern?(_a3=inst._zod).check??(_a3.check=payload=>{def.pattern.lastIndex=0,!def.pattern.test(payload.value)&&payload.issues.push({origin:"string",code:"invalid_format",format:def.format,input:payload.value,...def.pattern?{pattern:def.pattern.toString()}:{},inst,continue:!def.abort})}):(_b=inst._zod).check??(_b.check=()=>{})}),$ZodCheckRegex=$constructor("$ZodCheckRegex",(inst,def)=>{$ZodCheckStringFormat.init(inst,def),inst._zod.check=payload=>{def.pattern.lastIndex=0,!def.pattern.test(payload.value)&&payload.issues.push({origin:"string",code:"invalid_format",format:"regex",input:payload.value,pattern:def.pattern.toString(),inst,continue:!def.abort})}}),$ZodCheckLowerCase=$constructor("$ZodCheckLowerCase",(inst,def)=>{def.pattern??(def.pattern=lowercase),$ZodCheckStringFormat.init(inst,def)}),$ZodCheckUpperCase=$constructor("$ZodCheckUpperCase",(inst,def)=>{def.pattern??(def.pattern=uppercase),$ZodCheckStringFormat.init(inst,def)}),$ZodCheckIncludes=$constructor("$ZodCheckIncludes",(inst,def)=>{$ZodCheck.init(inst,def);let escapedRegex=escapeRegex(def.includes),pattern=new RegExp(typeof def.position=="number"?`^.{${def.position},}${escapedRegex}`:escapedRegex);def.pattern=pattern,inst._zod.check=payload=>{payload.value.includes(def.includes,def.position)||payload.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:def.includes,input:payload.value,inst,continue:!def.abort})}}),$ZodCheckStartsWith=$constructor("$ZodCheckStartsWith",(inst,def)=>{$ZodCheck.init(inst,def);let pattern=new RegExp(`^${escapeRegex(def.prefix)}.*`);def.pattern??(def.pattern=pattern),inst._zod.check=payload=>{payload.value.startsWith(def.prefix)||payload.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:def.prefix,input:payload.value,inst,continue:!def.abort})}}),$ZodCheckEndsWith=$constructor("$ZodCheckEndsWith",(inst,def)=>{$ZodCheck.init(inst,def);let pattern=new RegExp(`.*${escapeRegex(def.suffix)}$`);def.pattern??(def.pattern=pattern),inst._zod.check=payload=>{payload.value.endsWith(def.suffix)||payload.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:def.suffix,input:payload.value,inst,continue:!def.abort})}});var $ZodCheckOverwrite=$constructor("$ZodCheckOverwrite",(inst,def)=>{$ZodCheck.init(inst,def),inst._zod.check=payload=>{payload.value=def.tx(payload.value)}});var Doc=class{constructor(args=[],closed={}){this.content=[],this.indent=0,this.args=args,this.closed=closed}indented(fn){this.indent+=1;try{fn(this)}finally{this.indent-=1}}write(arg){if(typeof arg=="function"){arg(this,{execution:"sync"}),arg(this,{execution:"async"});return}let lines=arg.split(`
|
|
2
|
+
`).filter(x=>x),minIndent=Math.min(...lines.map(x=>x.length-x.trimStart().length)),dedented=lines.map(x=>x.slice(minIndent)).map(x=>" ".repeat(this.indent*2)+x);for(let line of dedented)this.content.push(line)}compile(){let F=Function,content=this?.content??[""];return new F(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
3
|
+
${content.join(`
|
|
4
|
+
`)}
|
|
5
|
+
};`)(...Object.values(this.closed))}};var version={major:4,minor:6,patch:7};var $ZodType=$constructor("$ZodType",(inst,def)=>{var _a3;inst??(inst={}),inst._zod.def=def,inst._zod.bag=inst._zod.bag||{},inst._zod.version=version;let defChecks=inst._zod.def.checks,checks=inst._zod.traits.has("$ZodCheck")?[inst,...defChecks??[]]:defChecks?.length?[...defChecks]:[];for(let ch of checks)for(let fn of ch._zod.onattach)fn(inst);if(checks.length===0)(_a3=inst._zod).deferred??(_a3.deferred=[]),inst._zod.deferred?.push(()=>{inst._zod.run=inst._zod.parse});else{let runChecks=(payload,checks2,ctx)=>{if(payload.memo)return payload;let isAborted=aborted(payload),asyncResult;for(let ch of checks2){if(ch._zod.def.when){if(explicitlyAborted(payload)||!ch._zod.def.when(payload))continue}else if(isAborted)continue;let currLen=payload.issues.length,_=ch._zod.check(payload);if(_ instanceof Promise&&ctx?.async===!1)throw new $ZodAsyncError;if(asyncResult||_ instanceof Promise)asyncResult=(asyncResult??Promise.resolve()).then(async()=>{await _,payload.issues.length!==currLen&&(attachSchema(payload.issues,currLen,inst),isAborted||(isAborted=aborted(payload,currLen)))});else{if(payload.issues.length===currLen)continue;attachSchema(payload.issues,currLen,inst),isAborted||(isAborted=aborted(payload,currLen))}}return asyncResult?asyncResult.then(()=>payload):payload},handleCanaryResult=(canary,payload,ctx)=>{if(aborted(canary))return canary.aborted=!0,canary;let checkResult=runChecks(payload,checks,ctx);if(checkResult instanceof Promise){if(ctx.async===!1)throw new $ZodAsyncError;return checkResult.then(checkResult2=>inst._zod.parse(checkResult2,ctx))}return inst._zod.parse(checkResult,ctx)};inst._zod.run=(payload,ctx)=>{if(ctx.skipChecks)return inst._zod.parse(payload,ctx);if(ctx.direction==="backward"){let canary=inst._zod.parse({value:payload.value,issues:[]},{...ctx,skipChecks:!0});return canary instanceof Promise?canary.then(canary2=>handleCanaryResult(canary2,payload,ctx)):handleCanaryResult(canary,payload,ctx)}let result=inst._zod.parse(payload,ctx);if(result instanceof Promise){if(ctx.async===!1)throw new $ZodAsyncError;return result.then(result2=>runChecks(result2,checks,ctx))}return runChecks(result,checks,ctx)}}},{get"~standard"(){return hide(this,"~standard",standardProps(this))},set"~standard"(value){own(this,"~standard",value)}}),toStandardResult=(r,ctx)=>r.issues.length?{issues:r.issues.map(iss=>finalizeIssue(iss,ctx,config()))}:{value:r.value};async function validateAsync2(inst,value){let ctx={async:!0};return toStandardResult(await inst._zod.run({value,issues:[]},ctx),ctx)}function standardProps(inst){return{validate:value=>{let ctx={async:!1};try{let r=inst._zod.run({value,issues:[]},ctx);if(!(r instanceof Promise))return toStandardResult(r,ctx)}catch{}return validateAsync2(inst,value)},vendor:"zod",version:1}}var $ZodString=$constructor("$ZodString",(inst,def)=>{$ZodType.init(inst,def),inst._zod.pattern=def.pattern??anyString,inst._zod.parse=(payload,_)=>{if(def.coerce)try{payload.value=String(payload.value)}catch{}return typeof payload.value=="string"||payload.issues.push({expected:"string",code:"invalid_type",input:payload.value,inst}),payload}}),$ZodStringFormat=$constructor("$ZodStringFormat",(inst,def)=>{$ZodCheckStringFormat.init(inst,def),$ZodString.init(inst,def)}),$ZodGUID=$constructor("$ZodGUID",(inst,def)=>{def.pattern??(def.pattern=guid),$ZodStringFormat.init(inst,def)}),$ZodUUID=$constructor("$ZodUUID",(inst,def)=>{if(def.version){let v={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[def.version];if(v===void 0)throw new Error(`Invalid UUID version: "${def.version}"`);def.pattern??(def.pattern=uuid(v))}else def.pattern??(def.pattern=uuid());$ZodStringFormat.init(inst,def)}),$ZodEmail=$constructor("$ZodEmail",(inst,def)=>{def.pattern??(def.pattern=email),$ZodStringFormat.init(inst,def)}),URL_BAD_FORMAT=1,URL_UNPARSEABLE=2;function canParseURL(input){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(input):(new URL(input),!0)}catch{return!1}}function validateURL(trimmed,def){return!("normalize"in def)&&!("hostname"in def)&&!("protocol"in def)?canParseURL(trimmed)||URL_UNPARSEABLE:parseURLObject(trimmed,def)}function parseURLObject(trimmed,def){if(!def.normalize&&def.protocol?.source===httpProtocol.source&&!/^https?:\/\//i.test(trimmed))return URL_BAD_FORMAT;try{if(typeof URL<"u"){let URLStatic=URL;if(typeof URLStatic.parse=="function")return URLStatic.parse(trimmed)??URL_UNPARSEABLE}return new URL(trimmed)}catch{return URL_UNPARSEABLE}}var asciiTabOrNewline=/[\t\n\r]/g;function stripTabAndNewline(value){return value.replace(asciiTabOrNewline,"")}function urlHostnameOk(url,hostname){return hostname.lastIndex=0,hostname.test(url.hostname)}function urlProtocolOk(url,protocol){return protocol.lastIndex=0,protocol.test(url.protocol.endsWith(":")?url.protocol.slice(0,-1):url.protocol)}var $ZodURL=$constructor("$ZodURL",(inst,def)=>{$ZodStringFormat.init(inst,def),inst._zod.check=payload=>{try{let trimmed=payload.value.trim(),url=validateURL(trimmed,def);if(url===URL_BAD_FORMAT){payload.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:payload.value,inst,continue:!def.abort});return}if(url===URL_UNPARSEABLE){payload.issues.push({code:"invalid_format",format:"url",input:payload.value,inst,continue:!def.abort});return}if(url===!0){payload.value=stripTabAndNewline(trimmed);return}def.hostname&&!urlHostnameOk(url,def.hostname)&&payload.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:def.hostname.source,input:payload.value,inst,continue:!def.abort}),def.protocol&&!urlProtocolOk(url,def.protocol)&&payload.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:def.protocol.source,input:payload.value,inst,continue:!def.abort}),payload.value=def.normalize?url.href:stripTabAndNewline(trimmed);return}catch{payload.issues.push({code:"invalid_format",format:"url",input:payload.value,inst,continue:!def.abort})}}}),$ZodEmoji=$constructor("$ZodEmoji",(inst,def)=>{def.pattern??(def.pattern=emoji()),$ZodStringFormat.init(inst,def)}),$ZodNanoID=$constructor("$ZodNanoID",(inst,def)=>{if(def.length!==void 0&&(!Number.isInteger(def.length)||def.length<1))throw new Error(`Invalid nanoid length: ${def.length}`);def.pattern??(def.pattern=def.length===void 0?nanoid:nanoidOfLength(def.length)),$ZodStringFormat.init(inst,def)}),$ZodCUID=$constructor("$ZodCUID",(inst,def)=>{def.pattern??(def.pattern=cuid),$ZodStringFormat.init(inst,def)}),$ZodCUID2=$constructor("$ZodCUID2",(inst,def)=>{def.pattern??(def.pattern=cuid2),$ZodStringFormat.init(inst,def)}),$ZodULID=$constructor("$ZodULID",(inst,def)=>{def.pattern??(def.pattern=ulid),$ZodStringFormat.init(inst,def)}),$ZodXID=$constructor("$ZodXID",(inst,def)=>{def.pattern??(def.pattern=xid),$ZodStringFormat.init(inst,def)}),$ZodKSUID=$constructor("$ZodKSUID",(inst,def)=>{def.pattern??(def.pattern=ksuid),$ZodStringFormat.init(inst,def)}),$ZodISODateTime=$constructor("$ZodISODateTime",(inst,def)=>{def.pattern??(def.pattern=datetime(def)),$ZodStringFormat.init(inst,def)}),$ZodISODate=$constructor("$ZodISODate",(inst,def)=>{def.pattern??(def.pattern=date),$ZodStringFormat.init(inst,def)}),$ZodISOTime=$constructor("$ZodISOTime",(inst,def)=>{def.pattern??(def.pattern=time(def)),$ZodStringFormat.init(inst,def)}),$ZodISODuration=$constructor("$ZodISODuration",(inst,def)=>{def.pattern??(def.pattern=duration),$ZodStringFormat.init(inst,def)}),$ZodIPv4=$constructor("$ZodIPv4",(inst,def)=>{def.pattern??(def.pattern=ipv4),$ZodStringFormat.init(inst,def)}),ipv6Alphabet=/^[0-9a-fA-F:.]+$/;function isValidIPv6(value){return ipv6Alphabet.test(value)?canParseURL(`http://[${value}]`):!1}var $ZodIPv6=$constructor("$ZodIPv6",(inst,def)=>{def.pattern??(def.pattern=ipv6),$ZodStringFormat.init(inst,def),inst._zod.check=payload=>{isValidIPv6(payload.value)||payload.issues.push({code:"invalid_format",format:"ipv6",input:payload.value,inst,continue:!def.abort})}});var $ZodCIDRv4=$constructor("$ZodCIDRv4",(inst,def)=>{def.pattern??(def.pattern=cidrv4),$ZodStringFormat.init(inst,def)});function isValidCIDRv6(value){let parts=value.split("/");if(parts.length!==2)return!1;let[address,prefix]=parts;if(!prefix)return!1;let prefixNum=Number(prefix);return`${prefixNum}`!==prefix||prefixNum<0||prefixNum>128?!1:isValidIPv6(address)}var $ZodCIDRv6=$constructor("$ZodCIDRv6",(inst,def)=>{def.pattern??(def.pattern=cidrv6),$ZodStringFormat.init(inst,def),inst._zod.check=payload=>{isValidCIDRv6(payload.value)||payload.issues.push({code:"invalid_format",format:"cidrv6",input:payload.value,inst,continue:!def.abort})}});function isValidBase64(data){if(data==="")return!0;if(/\s/.test(data)||data.length%4!==0)return!1;try{return atob(data),!0}catch{return!1}}var base64Charset=/^[0-9a-zA-Z+/]*={0,2}$/,$ZodBase64=$constructor("$ZodBase64",(inst,def)=>{def.pattern??(def.pattern=base64Charset),$ZodStringFormat.init(inst,def),inst._zod.check=payload=>{isValidBase64(payload.value)||payload.issues.push({code:"invalid_format",format:"base64",input:payload.value,inst,continue:!def.abort})}}),base64urlCharset=/^[A-Za-z0-9_-]*$/;function isValidBase64URL(data){if(!base64urlCharset.test(data))return!1;let base642=data.replace(/[-_]/g,c=>c==="-"?"+":"/"),padded=base642.padEnd(Math.ceil(base642.length/4)*4,"=");return isValidBase64(padded)}var $ZodBase64URL=$constructor("$ZodBase64URL",(inst,def)=>{def.pattern??(def.pattern=base64urlCharset),$ZodStringFormat.init(inst,def),inst._zod.check=payload=>{isValidBase64URL(payload.value)||payload.issues.push({code:"invalid_format",format:"base64url",input:payload.value,inst,continue:!def.abort})}}),$ZodE164=$constructor("$ZodE164",(inst,def)=>{def.pattern??(def.pattern=e164),$ZodStringFormat.init(inst,def)});function isValidJWT(token,algorithm=null){try{let tokensParts=token.split(".");if(tokensParts.length!==3)return!1;let[header]=tokensParts;if(!header)return!1;let parsedHeader=JSON.parse(atob(header));return!("typ"in parsedHeader&&parsedHeader?.typ!=="JWT"||!parsedHeader.alg||algorithm&&(!("alg"in parsedHeader)||parsedHeader.alg!==algorithm))}catch{return!1}}var $ZodJWT=$constructor("$ZodJWT",(inst,def)=>{$ZodStringFormat.init(inst,def),inst._zod.check=payload=>{isValidJWT(payload.value,def.alg)||payload.issues.push({code:"invalid_format",format:"jwt",input:payload.value,inst,continue:!def.abort})}});var $ZodNumber=$constructor("$ZodNumber",(inst,def)=>{$ZodType.init(inst,def),inst._zod.pattern=number,inst._zod.parse=(payload,_ctx)=>{if(def.coerce)try{payload.value=Number(payload.value)}catch{}let input=payload.value;if(typeof input=="number"&&!Number.isNaN(input)&&Number.isFinite(input))return payload;let received=typeof input=="number"?Number.isNaN(input)?"NaN":Number.isFinite(input)?void 0:String(input):void 0;return payload.issues.push({expected:"number",code:"invalid_type",input,inst,...received?{received}:{}}),payload}}),$ZodNumberFormat=$constructor("$ZodNumberFormat",(inst,def)=>{$ZodCheckNumberFormat.init(inst,def),$ZodNumber.init(inst,def)}),$ZodBoolean=$constructor("$ZodBoolean",(inst,def)=>{$ZodType.init(inst,def),inst._zod.pattern=boolean,inst._zod.parse=(payload,_ctx)=>{if(def.coerce)try{payload.value=!!payload.value}catch{}let input=payload.value;return typeof input=="boolean"||payload.issues.push({expected:"boolean",code:"invalid_type",input,inst}),payload}});var $ZodUnknown=$constructor("$ZodUnknown",(inst,def)=>{$ZodType.init(inst,def),inst._zod.parse=payload=>payload}),$ZodNever=$constructor("$ZodNever",(inst,def)=>{$ZodType.init(inst,def),inst._zod.parse=(payload,_ctx)=>(payload.issues.push({expected:"never",code:"invalid_type",input:payload.value,inst}),payload)});function capSize(inst,size){let caps=sizeCaps(inst._zod.def.checks);if(!caps.length)return;let cap=Math.min(...caps.map(c=>c[0])),parse2=inst._zod.parse;inst._zod.parse=(payload,ctx)=>{let n=size(payload.value);if(n>cap&&!ctx?.skipChecks&&ctx?.direction!=="backward"){for(let[max,ch]of sizeCaps(inst._zod.def.checks))if(n>max&&ch._zod.def.when(payload)){let start=payload.issues.length;return ch._zod.check(payload),payload.issues[start].continue=!1,attachSchema(payload.issues,start,inst),payload}}return parse2(payload,ctx)}}var arraySize=input=>Array.isArray(input)?input.length:-1;function handleArrayResult(result,final,index){result.issues.length&&final.issues.push(...prefixIssues(index,result.issues)),final.value[index]=result.value}var $ZodArray=$constructor("$ZodArray",(inst,def)=>{$ZodType.init(inst,def);let memo2=globalConfig.memoizer;memo2?.attach(inst),inst._zod.parse=(payload,ctx)=>{let input=payload.value;if(!Array.isArray(input))return payload.issues.push({expected:"array",code:"invalid_type",input,inst}),payload;payload.value=memo2?memo2.alloc(inst,payload,Array(input.length),ctx):Array(input.length);let proms=[],abortEarly=ctx?.abortEarly;for(let i=0;i<input.length;i++){let item=input[i],result=def.element._zod.run({value:item,issues:[]},ctx);if(result instanceof Promise)proms.push(result.then(result2=>handleArrayResult(result2,payload,i)));else if(handleArrayResult(result,payload,i),abortEarly&&result.issues.length!==0&&aborted(result))break}return proms.length?Promise.all(proms).then(()=>payload):payload},capSize(inst,arraySize)});function handlePropertyResult(result,final,key,input,optin,optout){let isPresent=key in input,isOptionalOut=optout==="optional";if(!(!isPresent&&isOptionalOut&&optin==="optional")){if(result.issues.length){if(optin!==void 0&&isOptionalOut&&!isPresent)return;final.issues.push(...prefixIssues(key,result.issues))}if(!isPresent&&optin===void 0){result.issues.length||final.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[key]});return}result.value===void 0?(isPresent||optin==="defaulted"&&!isOptionalOut)&&(final.value[key]=void 0):final.value[key]=result.value}}var NO_SYMBOL_KEYS=[];function normalizeDef(def){let keys=Object.keys(def.shape),ownSymbols=Object.getOwnPropertySymbols(def.shape),symbolKeys=ownSymbols.length?ownSymbols:NO_SYMBOL_KEYS,allKeys=symbolKeys.length?[...keys,...symbolKeys]:keys;for(let k of allKeys)if(!def.shape?.[k]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);let okeys=optionalKeys(def.shape);return{...def,allKeys,symbolKeys,keySet:new Set(keys),numKeys:keys.length,optionalKeys:new Set(okeys)}}function handleCatchall(proms,input,payload,ctx,def,inst,abortEarly){let unrecognized=[],keySet=def.keySet,_catchall=def.catchall._zod,t=_catchall.def.type,optin=_catchall.optin,optout=_catchall.optout,seen=0;for(let key in input){if(abortEarly&&payload.issues.length!==seen){if(aborted(payload,seen))break;seen=payload.issues.length}if(keySet.has(key))continue;if(key==="__proto__"){t==="never"&&unrecognized.push(key);continue}if(t==="never"){unrecognized.push(key);continue}let r=_catchall.run({value:input[key],issues:[]},ctx);r instanceof Promise?proms.push(r.then(r2=>handlePropertyResult(r2,payload,key,input,optin,optout))):handlePropertyResult(r,payload,key,input,optin,optout)}return unrecognized.length&&payload.issues.push({code:"unrecognized_keys",keys:unrecognized,input,inst,continue:!0}),proms.length?Promise.all(proms).then(()=>payload):payload}var $ZodObject=$constructor("$ZodObject",(inst,def)=>{$ZodType.init(inst,def);let desc=Object.getOwnPropertyDescriptor(def,"shape"),sh=desc?.get?desc.get.raw:def.shape??{};if(sh){let get=()=>{let newSh={...sh};return Object.defineProperty(def,"shape",{value:newSh}),get.raw=newSh,newSh};get.raw=sh,Object.defineProperty(def,"shape",{get})}let _normalized=cached(()=>normalizeDef(def));defineLazyInternal(inst,"propValues",zod=>{let shape=zod.def.shape,propValues={};for(let key in shape){let field=shape[key]._zod;if(field.values){Object.prototype.hasOwnProperty.call(propValues,key)||assignProp(propValues,key,new Set);for(let v of field.values)propValues[key].add(v);field.optin!==void 0&&propValues[key].add(void 0)}}return propValues});let isObject2=isObject,catchall=def.catchall,value,memo2=globalConfig.memoizer;memo2?.attach(inst),inst._zod.parse=(payload,ctx)=>{value??(value=_normalized.value);let input=payload.value;if(!isObject2(input))return payload.issues.push({expected:"object",code:"invalid_type",input,inst}),payload;payload.value=memo2?memo2.alloc(inst,payload,{},ctx):{};let proms=[],shape=value.shape,abortEarly=ctx?.abortEarly,seen=payload.issues.length;for(let key of value.allKeys){if(abortEarly&&payload.issues.length!==seen){if(aborted(payload,seen))break;seen=payload.issues.length}if(key==="__proto__")continue;let el=shape[key],optin=el._zod.optin,optout=el._zod.optout,r=el._zod.run({value:input[key],issues:[]},ctx);r instanceof Promise?proms.push(r.then(r2=>handlePropertyResult(r2,payload,key,input,optin,optout))):handlePropertyResult(r,payload,key,input,optin,optout)}return catchall?handleCatchall(proms,input,payload,ctx,_normalized.value,inst,abortEarly===!0):proms.length?Promise.all(proms).then(()=>payload):payload}}),$ZodObjectJIT=$constructor("$ZodObjectJIT",(inst,def)=>{$ZodObject.init(inst,def);let superParse=inst._zod.parse,_normalized=cached(()=>normalizeDef(def)),memo2=globalConfig.memoizer,generateFastpass=shape=>{let normalized=_normalized.value,syms=normalized.symbolKeys,doc=new Doc(["payload","ctx"],{shape,inst,memo:memo2,syms}),parseStr=k=>`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`,prefixStr=(id,k)=>`
|
|
6
|
+
let ${id}_ab = false;
|
|
7
|
+
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
8
|
+
const iss = ${id}.issues[i];
|
|
9
|
+
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
10
|
+
payload.issues.push(iss);
|
|
11
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
12
|
+
}
|
|
13
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
14
|
+
payload.value = newResult;
|
|
15
|
+
return payload;
|
|
16
|
+
}`;doc.write("const input = payload.value;");let ids=Object.create(null),counter=0;for(let key of normalized.allKeys)ids[key]=`key_${counter++}`;doc.write(memo2?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let key of normalized.allKeys){if(key==="__proto__")continue;let id=ids[key],k=typeof key=="symbol"?`syms[${syms.indexOf(key)}]`:esc(key),isPresent=`${k} in input`,schema=shape[key],optin=schema?._zod?.optin,isOptionalIn=optin!==void 0,isOptionalOut=schema?._zod?.optout==="optional";if(doc.write(`const ${id} = ${parseStr(k)};`),isOptionalIn&&isOptionalOut){let assign=optin==="optional"?`${id}_present`:`${id}.value !== undefined || ${id}_present`;doc.write(`
|
|
17
|
+
const ${id}_present = ${isPresent};
|
|
18
|
+
if (!${id}.issues.length || ${id}_present) {
|
|
19
|
+
if (${id}.issues.length) {${prefixStr(id,k)}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (${assign}) {
|
|
23
|
+
newResult[${k}] = ${id}.value;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
`)}else isOptionalIn?(doc.write(`
|
|
28
|
+
if (${id}.issues.length) {${prefixStr(id,k)}
|
|
9
29
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
30
|
+
`),optin==="defaulted"?doc.write(`newResult[${k}] = ${id}.value;`):doc.write(`
|
|
31
|
+
if (${id}.value !== undefined || ${isPresent}) {
|
|
32
|
+
newResult[${k}] = ${id}.value;
|
|
33
|
+
}
|
|
34
|
+
`)):doc.write(`
|
|
35
|
+
const ${id}_present = ${isPresent};
|
|
36
|
+
if (${id}.issues.length) {${prefixStr(id,k)}
|
|
37
|
+
}
|
|
38
|
+
if (!${id}_present && !${id}.issues.length) {
|
|
39
|
+
payload.issues.push({
|
|
40
|
+
code: "invalid_type",
|
|
41
|
+
expected: "nonoptional",
|
|
42
|
+
input: undefined,
|
|
43
|
+
path: [${k}]
|
|
44
|
+
});
|
|
45
|
+
if (ctx && ctx.abortEarly) {
|
|
46
|
+
payload.value = newResult;
|
|
47
|
+
return payload;
|
|
15
48
|
}
|
|
16
|
-
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (${id}_present) {
|
|
17
52
|
newResult[${k}] = ${id}.value;
|
|
18
53
|
}
|
|
19
|
-
|
|
20
|
-
`)}doc.write("payload.value = newResult;"),doc.write("return payload;");let fn=doc.compile();return(payload,ctx)=>fn(shape,payload,ctx)},fastpass,isObject2=isObject,jit=!globalConfig.jitless,fastEnabled=jit&&allowsEval.value,catchall=def.catchall,value;inst._zod.parse=(payload,ctx)=>{value??(value=_normalized.value);let input=payload.value;return isObject2(input)?jit&&fastEnabled&&ctx?.async===!1&&ctx.jitless!==!0?(fastpass||(fastpass=generateFastpass(def.shape)),payload=fastpass(payload,ctx),catchall?handleCatchall([],input,payload,ctx,value,inst):payload):superParse(payload,ctx):(payload.issues.push({expected:"object",code:"invalid_type",input,inst}),payload)}});function handleUnionResults(results,final,inst,ctx){for(let result of results)if(result.issues.length===0)return final.value=result.value,final;let nonaborted=results.filter(r=>!aborted(r));return nonaborted.length===1?(final.value=nonaborted[0].value,nonaborted[0]):(final.issues.push({code:"invalid_union",input:final.value,inst,errors:results.map(result=>result.issues.map(iss=>finalizeIssue(iss,ctx,config())))}),final)}var $ZodUnion=$constructor("$ZodUnion",(inst,def)=>{$ZodType.init(inst,def),defineLazy(inst._zod,"optin",()=>def.options.some(o=>o._zod.optin==="optional")?"optional":void 0),defineLazy(inst._zod,"optout",()=>def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),defineLazy(inst._zod,"values",()=>{if(def.options.every(o=>o._zod.values))return new Set(def.options.flatMap(option=>Array.from(option._zod.values)))}),defineLazy(inst._zod,"pattern",()=>{if(def.options.every(o=>o._zod.pattern)){let patterns=def.options.map(o=>o._zod.pattern);return new RegExp(`^(${patterns.map(p=>cleanRegex(p.source)).join("|")})$`)}});let single=def.options.length===1,first=def.options[0]._zod.run;inst._zod.parse=(payload,ctx)=>{if(single)return first(payload,ctx);let async=!1,results=[];for(let option of def.options){let result=option._zod.run({value:payload.value,issues:[]},ctx);if(result instanceof Promise)results.push(result),async=!0;else{if(result.issues.length===0)return result;results.push(result)}}return async?Promise.all(results).then(results2=>handleUnionResults(results2,payload,inst,ctx)):handleUnionResults(results,payload,inst,ctx)}});var $ZodIntersection=$constructor("$ZodIntersection",(inst,def)=>{$ZodType.init(inst,def),inst._zod.parse=(payload,ctx)=>{let input=payload.value,left=def.left._zod.run({value:input,issues:[]},ctx),right=def.right._zod.run({value:input,issues:[]},ctx);return left instanceof Promise||right instanceof Promise?Promise.all([left,right]).then(([left2,right2])=>handleIntersectionResults(payload,left2,right2)):handleIntersectionResults(payload,left,right)}});function mergeValues(a,b){if(a===b)return{valid:!0,data:a};if(a instanceof Date&&b instanceof Date&&+a==+b)return{valid:!0,data:a};if(isPlainObject(a)&&isPlainObject(b)){let bKeys=Object.keys(b),sharedKeys=Object.keys(a).filter(key=>bKeys.indexOf(key)!==-1),newObj={...a,...b};for(let key of sharedKeys){let sharedValue=mergeValues(a[key],b[key]);if(!sharedValue.valid)return{valid:!1,mergeErrorPath:[key,...sharedValue.mergeErrorPath]};newObj[key]=sharedValue.data}return{valid:!0,data:newObj}}if(Array.isArray(a)&&Array.isArray(b)){if(a.length!==b.length)return{valid:!1,mergeErrorPath:[]};let newArray=[];for(let index=0;index<a.length;index++){let itemA=a[index],itemB=b[index],sharedValue=mergeValues(itemA,itemB);if(!sharedValue.valid)return{valid:!1,mergeErrorPath:[index,...sharedValue.mergeErrorPath]};newArray.push(sharedValue.data)}return{valid:!0,data:newArray}}return{valid:!1,mergeErrorPath:[]}}function handleIntersectionResults(result,left,right){if(left.issues.length&&result.issues.push(...left.issues),right.issues.length&&result.issues.push(...right.issues),aborted(result))return result;let merged=mergeValues(left.value,right.value);if(!merged.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);return result.value=merged.data,result}var $ZodEnum=$constructor("$ZodEnum",(inst,def)=>{$ZodType.init(inst,def);let values=getEnumValues(def.entries),valuesSet=new Set(values);inst._zod.values=valuesSet,inst._zod.pattern=new RegExp(`^(${values.filter(k=>propertyKeyTypes.has(typeof k)).map(o=>typeof o=="string"?escapeRegex(o):o.toString()).join("|")})$`),inst._zod.parse=(payload,_ctx)=>{let input=payload.value;return valuesSet.has(input)||payload.issues.push({code:"invalid_value",values,input,inst}),payload}}),$ZodLiteral=$constructor("$ZodLiteral",(inst,def)=>{if($ZodType.init(inst,def),def.values.length===0)throw new Error("Cannot create literal schema with no valid values");inst._zod.values=new Set(def.values),inst._zod.pattern=new RegExp(`^(${def.values.map(o=>typeof o=="string"?escapeRegex(o):o?escapeRegex(o.toString()):String(o)).join("|")})$`),inst._zod.parse=(payload,_ctx)=>{let input=payload.value;return inst._zod.values.has(input)||payload.issues.push({code:"invalid_value",values:def.values,input,inst}),payload}});var $ZodTransform=$constructor("$ZodTransform",(inst,def)=>{$ZodType.init(inst,def),inst._zod.parse=(payload,ctx)=>{if(ctx.direction==="backward")throw new $ZodEncodeError(inst.constructor.name);let _out=def.transform(payload.value,payload);if(ctx.async)return(_out instanceof Promise?_out:Promise.resolve(_out)).then(output2=>(payload.value=output2,payload));if(_out instanceof Promise)throw new $ZodAsyncError;return payload.value=_out,payload}});function handleOptionalResult(result,input){return result.issues.length&&input===void 0?{issues:[],value:void 0}:result}var $ZodOptional=$constructor("$ZodOptional",(inst,def)=>{$ZodType.init(inst,def),inst._zod.optin="optional",inst._zod.optout="optional",defineLazy(inst._zod,"values",()=>def.innerType._zod.values?new Set([...def.innerType._zod.values,void 0]):void 0),defineLazy(inst._zod,"pattern",()=>{let pattern=def.innerType._zod.pattern;return pattern?new RegExp(`^(${cleanRegex(pattern.source)})?$`):void 0}),inst._zod.parse=(payload,ctx)=>{if(def.innerType._zod.optin==="optional"){let result=def.innerType._zod.run(payload,ctx);return result instanceof Promise?result.then(r=>handleOptionalResult(r,payload.value)):handleOptionalResult(result,payload.value)}return payload.value===void 0?payload:def.innerType._zod.run(payload,ctx)}}),$ZodNullable=$constructor("$ZodNullable",(inst,def)=>{$ZodType.init(inst,def),defineLazy(inst._zod,"optin",()=>def.innerType._zod.optin),defineLazy(inst._zod,"optout",()=>def.innerType._zod.optout),defineLazy(inst._zod,"pattern",()=>{let pattern=def.innerType._zod.pattern;return pattern?new RegExp(`^(${cleanRegex(pattern.source)}|null)$`):void 0}),defineLazy(inst._zod,"values",()=>def.innerType._zod.values?new Set([...def.innerType._zod.values,null]):void 0),inst._zod.parse=(payload,ctx)=>payload.value===null?payload:def.innerType._zod.run(payload,ctx)}),$ZodDefault=$constructor("$ZodDefault",(inst,def)=>{$ZodType.init(inst,def),inst._zod.optin="optional",defineLazy(inst._zod,"values",()=>def.innerType._zod.values),inst._zod.parse=(payload,ctx)=>{if(ctx.direction==="backward")return def.innerType._zod.run(payload,ctx);if(payload.value===void 0)return payload.value=def.defaultValue,payload;let result=def.innerType._zod.run(payload,ctx);return result instanceof Promise?result.then(result2=>handleDefaultResult(result2,def)):handleDefaultResult(result,def)}});function handleDefaultResult(payload,def){return payload.value===void 0&&(payload.value=def.defaultValue),payload}var $ZodPrefault=$constructor("$ZodPrefault",(inst,def)=>{$ZodType.init(inst,def),inst._zod.optin="optional",defineLazy(inst._zod,"values",()=>def.innerType._zod.values),inst._zod.parse=(payload,ctx)=>(ctx.direction==="backward"||payload.value===void 0&&(payload.value=def.defaultValue),def.innerType._zod.run(payload,ctx))}),$ZodNonOptional=$constructor("$ZodNonOptional",(inst,def)=>{$ZodType.init(inst,def),defineLazy(inst._zod,"values",()=>{let v=def.innerType._zod.values;return v?new Set([...v].filter(x=>x!==void 0)):void 0}),inst._zod.parse=(payload,ctx)=>{let result=def.innerType._zod.run(payload,ctx);return result instanceof Promise?result.then(result2=>handleNonOptionalResult(result2,inst)):handleNonOptionalResult(result,inst)}});function handleNonOptionalResult(payload,inst){return!payload.issues.length&&payload.value===void 0&&payload.issues.push({code:"invalid_type",expected:"nonoptional",input:payload.value,inst}),payload}var $ZodCatch=$constructor("$ZodCatch",(inst,def)=>{$ZodType.init(inst,def),defineLazy(inst._zod,"optin",()=>def.innerType._zod.optin),defineLazy(inst._zod,"optout",()=>def.innerType._zod.optout),defineLazy(inst._zod,"values",()=>def.innerType._zod.values),inst._zod.parse=(payload,ctx)=>{if(ctx.direction==="backward")return def.innerType._zod.run(payload,ctx);let result=def.innerType._zod.run(payload,ctx);return result instanceof Promise?result.then(result2=>(payload.value=result2.value,result2.issues.length&&(payload.value=def.catchValue({...payload,error:{issues:result2.issues.map(iss=>finalizeIssue(iss,ctx,config()))},input:payload.value}),payload.issues=[]),payload)):(payload.value=result.value,result.issues.length&&(payload.value=def.catchValue({...payload,error:{issues:result.issues.map(iss=>finalizeIssue(iss,ctx,config()))},input:payload.value}),payload.issues=[]),payload)}});var $ZodPipe=$constructor("$ZodPipe",(inst,def)=>{$ZodType.init(inst,def),defineLazy(inst._zod,"values",()=>def.in._zod.values),defineLazy(inst._zod,"optin",()=>def.in._zod.optin),defineLazy(inst._zod,"optout",()=>def.out._zod.optout),defineLazy(inst._zod,"propValues",()=>def.in._zod.propValues),inst._zod.parse=(payload,ctx)=>{if(ctx.direction==="backward"){let right=def.out._zod.run(payload,ctx);return right instanceof Promise?right.then(right2=>handlePipeResult(right2,def.in,ctx)):handlePipeResult(right,def.in,ctx)}let left=def.in._zod.run(payload,ctx);return left instanceof Promise?left.then(left2=>handlePipeResult(left2,def.out,ctx)):handlePipeResult(left,def.out,ctx)}});function handlePipeResult(left,next,ctx){return left.issues.length?(left.aborted=!0,left):next._zod.run({value:left.value,issues:left.issues},ctx)}var $ZodReadonly=$constructor("$ZodReadonly",(inst,def)=>{$ZodType.init(inst,def),defineLazy(inst._zod,"propValues",()=>def.innerType._zod.propValues),defineLazy(inst._zod,"values",()=>def.innerType._zod.values),defineLazy(inst._zod,"optin",()=>def.innerType._zod.optin),defineLazy(inst._zod,"optout",()=>def.innerType._zod.optout),inst._zod.parse=(payload,ctx)=>{if(ctx.direction==="backward")return def.innerType._zod.run(payload,ctx);let result=def.innerType._zod.run(payload,ctx);return result instanceof Promise?result.then(handleReadonlyResult):handleReadonlyResult(result)}});function handleReadonlyResult(payload){return payload.value=Object.freeze(payload.value),payload}var $ZodCustom=$constructor("$ZodCustom",(inst,def)=>{$ZodCheck.init(inst,def),$ZodType.init(inst,def),inst._zod.parse=(payload,_)=>payload,inst._zod.check=payload=>{let input=payload.value,r=def.fn(input);if(r instanceof Promise)return r.then(r2=>handleRefineResult(r2,payload,input,inst));handleRefineResult(r,payload,input,inst)}});function handleRefineResult(result,payload,input,inst){if(!result){let _iss={code:"custom",input,inst,path:[...inst._zod.def.path??[]],continue:!inst._zod.def.abort};inst._zod.def.params&&(_iss.params=inst._zod.def.params),payload.issues.push(issue(_iss))}}var $output=Symbol("ZodOutput"),$input=Symbol("ZodInput"),$ZodRegistry=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(schema,..._meta){let meta=_meta[0];if(this._map.set(schema,meta),meta&&typeof meta=="object"&&"id"in meta){if(this._idmap.has(meta.id))throw new Error(`ID ${meta.id} already exists in the registry`);this._idmap.set(meta.id,schema)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(schema){let meta=this._map.get(schema);return meta&&typeof meta=="object"&&"id"in meta&&this._idmap.delete(meta.id),this._map.delete(schema),this}get(schema){let p=schema._zod.parent;if(p){let pm={...this.get(p)??{}};delete pm.id;let f={...pm,...this._map.get(schema)};return Object.keys(f).length?f:void 0}return this._map.get(schema)}has(schema){return this._map.has(schema)}};function registry(){return new $ZodRegistry}var globalRegistry=registry();function _string(Class2,params){return new Class2({type:"string",...normalizeParams(params)})}function _email(Class2,params){return new Class2({type:"string",format:"email",check:"string_format",abort:!1,...normalizeParams(params)})}function _guid(Class2,params){return new Class2({type:"string",format:"guid",check:"string_format",abort:!1,...normalizeParams(params)})}function _uuid(Class2,params){return new Class2({type:"string",format:"uuid",check:"string_format",abort:!1,...normalizeParams(params)})}function _uuidv4(Class2,params){return new Class2({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...normalizeParams(params)})}function _uuidv6(Class2,params){return new Class2({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...normalizeParams(params)})}function _uuidv7(Class2,params){return new Class2({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...normalizeParams(params)})}function _url(Class2,params){return new Class2({type:"string",format:"url",check:"string_format",abort:!1,...normalizeParams(params)})}function _emoji2(Class2,params){return new Class2({type:"string",format:"emoji",check:"string_format",abort:!1,...normalizeParams(params)})}function _nanoid(Class2,params){return new Class2({type:"string",format:"nanoid",check:"string_format",abort:!1,...normalizeParams(params)})}function _cuid(Class2,params){return new Class2({type:"string",format:"cuid",check:"string_format",abort:!1,...normalizeParams(params)})}function _cuid2(Class2,params){return new Class2({type:"string",format:"cuid2",check:"string_format",abort:!1,...normalizeParams(params)})}function _ulid(Class2,params){return new Class2({type:"string",format:"ulid",check:"string_format",abort:!1,...normalizeParams(params)})}function _xid(Class2,params){return new Class2({type:"string",format:"xid",check:"string_format",abort:!1,...normalizeParams(params)})}function _ksuid(Class2,params){return new Class2({type:"string",format:"ksuid",check:"string_format",abort:!1,...normalizeParams(params)})}function _ipv4(Class2,params){return new Class2({type:"string",format:"ipv4",check:"string_format",abort:!1,...normalizeParams(params)})}function _ipv6(Class2,params){return new Class2({type:"string",format:"ipv6",check:"string_format",abort:!1,...normalizeParams(params)})}function _cidrv4(Class2,params){return new Class2({type:"string",format:"cidrv4",check:"string_format",abort:!1,...normalizeParams(params)})}function _cidrv6(Class2,params){return new Class2({type:"string",format:"cidrv6",check:"string_format",abort:!1,...normalizeParams(params)})}function _base64(Class2,params){return new Class2({type:"string",format:"base64",check:"string_format",abort:!1,...normalizeParams(params)})}function _base64url(Class2,params){return new Class2({type:"string",format:"base64url",check:"string_format",abort:!1,...normalizeParams(params)})}function _e164(Class2,params){return new Class2({type:"string",format:"e164",check:"string_format",abort:!1,...normalizeParams(params)})}function _jwt(Class2,params){return new Class2({type:"string",format:"jwt",check:"string_format",abort:!1,...normalizeParams(params)})}function _isoDateTime(Class2,params){return new Class2({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...normalizeParams(params)})}function _isoDate(Class2,params){return new Class2({type:"string",format:"date",check:"string_format",...normalizeParams(params)})}function _isoTime(Class2,params){return new Class2({type:"string",format:"time",check:"string_format",precision:null,...normalizeParams(params)})}function _isoDuration(Class2,params){return new Class2({type:"string",format:"duration",check:"string_format",...normalizeParams(params)})}function _number(Class2,params){return new Class2({type:"number",checks:[],...normalizeParams(params)})}function _int(Class2,params){return new Class2({type:"number",check:"number_format",abort:!1,format:"safeint",...normalizeParams(params)})}function _boolean(Class2,params){return new Class2({type:"boolean",...normalizeParams(params)})}function _unknown(Class2){return new Class2({type:"unknown"})}function _never(Class2,params){return new Class2({type:"never",...normalizeParams(params)})}function _lt(value,params){return new $ZodCheckLessThan({check:"less_than",...normalizeParams(params),value,inclusive:!1})}function _lte(value,params){return new $ZodCheckLessThan({check:"less_than",...normalizeParams(params),value,inclusive:!0})}function _gt(value,params){return new $ZodCheckGreaterThan({check:"greater_than",...normalizeParams(params),value,inclusive:!1})}function _gte(value,params){return new $ZodCheckGreaterThan({check:"greater_than",...normalizeParams(params),value,inclusive:!0})}function _multipleOf(value,params){return new $ZodCheckMultipleOf({check:"multiple_of",...normalizeParams(params),value})}function _maxLength(maximum,params){return new $ZodCheckMaxLength({check:"max_length",...normalizeParams(params),maximum})}function _minLength(minimum,params){return new $ZodCheckMinLength({check:"min_length",...normalizeParams(params),minimum})}function _length(length,params){return new $ZodCheckLengthEquals({check:"length_equals",...normalizeParams(params),length})}function _regex(pattern,params){return new $ZodCheckRegex({check:"string_format",format:"regex",...normalizeParams(params),pattern})}function _lowercase(params){return new $ZodCheckLowerCase({check:"string_format",format:"lowercase",...normalizeParams(params)})}function _uppercase(params){return new $ZodCheckUpperCase({check:"string_format",format:"uppercase",...normalizeParams(params)})}function _includes(includes,params){return new $ZodCheckIncludes({check:"string_format",format:"includes",...normalizeParams(params),includes})}function _startsWith(prefix,params){return new $ZodCheckStartsWith({check:"string_format",format:"starts_with",...normalizeParams(params),prefix})}function _endsWith(suffix,params){return new $ZodCheckEndsWith({check:"string_format",format:"ends_with",...normalizeParams(params),suffix})}function _overwrite(tx){return new $ZodCheckOverwrite({check:"overwrite",tx})}function _normalize(form){return _overwrite(input=>input.normalize(form))}function _trim(){return _overwrite(input=>input.trim())}function _toLowerCase(){return _overwrite(input=>input.toLowerCase())}function _toUpperCase(){return _overwrite(input=>input.toUpperCase())}function _array(Class2,element,params){return new Class2({type:"array",element,...normalizeParams(params)})}function _refine(Class2,fn,_params){return new Class2({type:"custom",check:"custom",fn,...normalizeParams(_params)})}function _superRefine(fn){let ch=_check(payload=>(payload.addIssue=issue2=>{if(typeof issue2=="string")payload.issues.push(issue(issue2,payload.value,ch._zod.def));else{let _issue=issue2;_issue.fatal&&(_issue.continue=!1),_issue.code??(_issue.code="custom"),_issue.input??(_issue.input=payload.value),_issue.inst??(_issue.inst=ch),_issue.continue??(_issue.continue=!ch._zod.def.abort),payload.issues.push(issue(_issue))}},fn(payload.value,payload)));return ch}function _check(fn,params){let ch=new $ZodCheck({check:"custom",...normalizeParams(params)});return ch._zod.check=fn,ch}var ZodISODateTime=$constructor("ZodISODateTime",(inst,def)=>{$ZodISODateTime.init(inst,def),ZodStringFormat.init(inst,def)});function datetime2(params){return _isoDateTime(ZodISODateTime,params)}var ZodISODate=$constructor("ZodISODate",(inst,def)=>{$ZodISODate.init(inst,def),ZodStringFormat.init(inst,def)});function date2(params){return _isoDate(ZodISODate,params)}var ZodISOTime=$constructor("ZodISOTime",(inst,def)=>{$ZodISOTime.init(inst,def),ZodStringFormat.init(inst,def)});function time2(params){return _isoTime(ZodISOTime,params)}var ZodISODuration=$constructor("ZodISODuration",(inst,def)=>{$ZodISODuration.init(inst,def),ZodStringFormat.init(inst,def)});function duration2(params){return _isoDuration(ZodISODuration,params)}var initializer2=(inst,issues)=>{$ZodError.init(inst,issues),inst.name="ZodError",Object.defineProperties(inst,{format:{value:mapper=>formatError(inst,mapper)},flatten:{value:mapper=>flattenError(inst,mapper)},addIssue:{value:issue2=>{inst.issues.push(issue2),inst.message=JSON.stringify(inst.issues,jsonStringifyReplacer,2)}},addIssues:{value:issues2=>{inst.issues.push(...issues2),inst.message=JSON.stringify(inst.issues,jsonStringifyReplacer,2)}},isEmpty:{get(){return inst.issues.length===0}}})},ZodError=$constructor("ZodError",initializer2),ZodRealError=$constructor("ZodError",initializer2,{Parent:Error});var parse2=_parse(ZodRealError),parseAsync2=_parseAsync(ZodRealError),safeParse2=_safeParse(ZodRealError),safeParseAsync2=_safeParseAsync(ZodRealError),encode=_encode(ZodRealError),decode=_decode(ZodRealError),encodeAsync=_encodeAsync(ZodRealError),decodeAsync=_decodeAsync(ZodRealError),safeEncode=_safeEncode(ZodRealError),safeDecode=_safeDecode(ZodRealError),safeEncodeAsync=_safeEncodeAsync(ZodRealError),safeDecodeAsync=_safeDecodeAsync(ZodRealError);var ZodType=$constructor("ZodType",(inst,def)=>($ZodType.init(inst,def),inst.def=def,inst.type=def.type,Object.defineProperty(inst,"_def",{value:def}),inst.check=(...checks)=>inst.clone(util_exports.mergeDefs(def,{checks:[...def.checks??[],...checks.map(ch=>typeof ch=="function"?{_zod:{check:ch,def:{check:"custom"},onattach:[]}}:ch)]})),inst.clone=(def2,params)=>clone(inst,def2,params),inst.brand=()=>inst,inst.register=(reg,meta)=>(reg.add(inst,meta),inst),inst.parse=(data,params)=>parse2(inst,data,params,{callee:inst.parse}),inst.safeParse=(data,params)=>safeParse2(inst,data,params),inst.parseAsync=async(data,params)=>parseAsync2(inst,data,params,{callee:inst.parseAsync}),inst.safeParseAsync=async(data,params)=>safeParseAsync2(inst,data,params),inst.spa=inst.safeParseAsync,inst.encode=(data,params)=>encode(inst,data,params),inst.decode=(data,params)=>decode(inst,data,params),inst.encodeAsync=async(data,params)=>encodeAsync(inst,data,params),inst.decodeAsync=async(data,params)=>decodeAsync(inst,data,params),inst.safeEncode=(data,params)=>safeEncode(inst,data,params),inst.safeDecode=(data,params)=>safeDecode(inst,data,params),inst.safeEncodeAsync=async(data,params)=>safeEncodeAsync(inst,data,params),inst.safeDecodeAsync=async(data,params)=>safeDecodeAsync(inst,data,params),inst.refine=(check,params)=>inst.check(refine(check,params)),inst.superRefine=refinement=>inst.check(superRefine(refinement)),inst.overwrite=fn=>inst.check(_overwrite(fn)),inst.optional=()=>optional(inst),inst.nullable=()=>nullable(inst),inst.nullish=()=>optional(nullable(inst)),inst.nonoptional=params=>nonoptional(inst,params),inst.array=()=>array(inst),inst.or=arg=>union([inst,arg]),inst.and=arg=>intersection(inst,arg),inst.transform=tx=>pipe(inst,transform(tx)),inst.default=def2=>_default(inst,def2),inst.prefault=def2=>prefault(inst,def2),inst.catch=params=>_catch(inst,params),inst.pipe=target=>pipe(inst,target),inst.readonly=()=>readonly(inst),inst.describe=description=>{let cl=inst.clone();return globalRegistry.add(cl,{description}),cl},Object.defineProperty(inst,"description",{get(){return globalRegistry.get(inst)?.description},configurable:!0}),inst.meta=(...args)=>{if(args.length===0)return globalRegistry.get(inst);let cl=inst.clone();return globalRegistry.add(cl,args[0]),cl},inst.isOptional=()=>inst.safeParse(void 0).success,inst.isNullable=()=>inst.safeParse(null).success,inst)),_ZodString=$constructor("_ZodString",(inst,def)=>{$ZodString.init(inst,def),ZodType.init(inst,def);let bag=inst._zod.bag;inst.format=bag.format??null,inst.minLength=bag.minimum??null,inst.maxLength=bag.maximum??null,inst.regex=(...args)=>inst.check(_regex(...args)),inst.includes=(...args)=>inst.check(_includes(...args)),inst.startsWith=(...args)=>inst.check(_startsWith(...args)),inst.endsWith=(...args)=>inst.check(_endsWith(...args)),inst.min=(...args)=>inst.check(_minLength(...args)),inst.max=(...args)=>inst.check(_maxLength(...args)),inst.length=(...args)=>inst.check(_length(...args)),inst.nonempty=(...args)=>inst.check(_minLength(1,...args)),inst.lowercase=params=>inst.check(_lowercase(params)),inst.uppercase=params=>inst.check(_uppercase(params)),inst.trim=()=>inst.check(_trim()),inst.normalize=(...args)=>inst.check(_normalize(...args)),inst.toLowerCase=()=>inst.check(_toLowerCase()),inst.toUpperCase=()=>inst.check(_toUpperCase())}),ZodString=$constructor("ZodString",(inst,def)=>{$ZodString.init(inst,def),_ZodString.init(inst,def),inst.email=params=>inst.check(_email(ZodEmail,params)),inst.url=params=>inst.check(_url(ZodURL,params)),inst.jwt=params=>inst.check(_jwt(ZodJWT,params)),inst.emoji=params=>inst.check(_emoji2(ZodEmoji,params)),inst.guid=params=>inst.check(_guid(ZodGUID,params)),inst.uuid=params=>inst.check(_uuid(ZodUUID,params)),inst.uuidv4=params=>inst.check(_uuidv4(ZodUUID,params)),inst.uuidv6=params=>inst.check(_uuidv6(ZodUUID,params)),inst.uuidv7=params=>inst.check(_uuidv7(ZodUUID,params)),inst.nanoid=params=>inst.check(_nanoid(ZodNanoID,params)),inst.guid=params=>inst.check(_guid(ZodGUID,params)),inst.cuid=params=>inst.check(_cuid(ZodCUID,params)),inst.cuid2=params=>inst.check(_cuid2(ZodCUID2,params)),inst.ulid=params=>inst.check(_ulid(ZodULID,params)),inst.base64=params=>inst.check(_base64(ZodBase64,params)),inst.base64url=params=>inst.check(_base64url(ZodBase64URL,params)),inst.xid=params=>inst.check(_xid(ZodXID,params)),inst.ksuid=params=>inst.check(_ksuid(ZodKSUID,params)),inst.ipv4=params=>inst.check(_ipv4(ZodIPv4,params)),inst.ipv6=params=>inst.check(_ipv6(ZodIPv6,params)),inst.cidrv4=params=>inst.check(_cidrv4(ZodCIDRv4,params)),inst.cidrv6=params=>inst.check(_cidrv6(ZodCIDRv6,params)),inst.e164=params=>inst.check(_e164(ZodE164,params)),inst.datetime=params=>inst.check(datetime2(params)),inst.date=params=>inst.check(date2(params)),inst.time=params=>inst.check(time2(params)),inst.duration=params=>inst.check(duration2(params))});function string2(params){return _string(ZodString,params)}var ZodStringFormat=$constructor("ZodStringFormat",(inst,def)=>{$ZodStringFormat.init(inst,def),_ZodString.init(inst,def)}),ZodEmail=$constructor("ZodEmail",(inst,def)=>{$ZodEmail.init(inst,def),ZodStringFormat.init(inst,def)});var ZodGUID=$constructor("ZodGUID",(inst,def)=>{$ZodGUID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodUUID=$constructor("ZodUUID",(inst,def)=>{$ZodUUID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodURL=$constructor("ZodURL",(inst,def)=>{$ZodURL.init(inst,def),ZodStringFormat.init(inst,def)});var ZodEmoji=$constructor("ZodEmoji",(inst,def)=>{$ZodEmoji.init(inst,def),ZodStringFormat.init(inst,def)});var ZodNanoID=$constructor("ZodNanoID",(inst,def)=>{$ZodNanoID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodCUID=$constructor("ZodCUID",(inst,def)=>{$ZodCUID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodCUID2=$constructor("ZodCUID2",(inst,def)=>{$ZodCUID2.init(inst,def),ZodStringFormat.init(inst,def)});var ZodULID=$constructor("ZodULID",(inst,def)=>{$ZodULID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodXID=$constructor("ZodXID",(inst,def)=>{$ZodXID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodKSUID=$constructor("ZodKSUID",(inst,def)=>{$ZodKSUID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodIPv4=$constructor("ZodIPv4",(inst,def)=>{$ZodIPv4.init(inst,def),ZodStringFormat.init(inst,def)});var ZodIPv6=$constructor("ZodIPv6",(inst,def)=>{$ZodIPv6.init(inst,def),ZodStringFormat.init(inst,def)});var ZodCIDRv4=$constructor("ZodCIDRv4",(inst,def)=>{$ZodCIDRv4.init(inst,def),ZodStringFormat.init(inst,def)});var ZodCIDRv6=$constructor("ZodCIDRv6",(inst,def)=>{$ZodCIDRv6.init(inst,def),ZodStringFormat.init(inst,def)});var ZodBase64=$constructor("ZodBase64",(inst,def)=>{$ZodBase64.init(inst,def),ZodStringFormat.init(inst,def)});var ZodBase64URL=$constructor("ZodBase64URL",(inst,def)=>{$ZodBase64URL.init(inst,def),ZodStringFormat.init(inst,def)});var ZodE164=$constructor("ZodE164",(inst,def)=>{$ZodE164.init(inst,def),ZodStringFormat.init(inst,def)});var ZodJWT=$constructor("ZodJWT",(inst,def)=>{$ZodJWT.init(inst,def),ZodStringFormat.init(inst,def)});var ZodNumber=$constructor("ZodNumber",(inst,def)=>{$ZodNumber.init(inst,def),ZodType.init(inst,def),inst.gt=(value,params)=>inst.check(_gt(value,params)),inst.gte=(value,params)=>inst.check(_gte(value,params)),inst.min=(value,params)=>inst.check(_gte(value,params)),inst.lt=(value,params)=>inst.check(_lt(value,params)),inst.lte=(value,params)=>inst.check(_lte(value,params)),inst.max=(value,params)=>inst.check(_lte(value,params)),inst.int=params=>inst.check(int(params)),inst.safe=params=>inst.check(int(params)),inst.positive=params=>inst.check(_gt(0,params)),inst.nonnegative=params=>inst.check(_gte(0,params)),inst.negative=params=>inst.check(_lt(0,params)),inst.nonpositive=params=>inst.check(_lte(0,params)),inst.multipleOf=(value,params)=>inst.check(_multipleOf(value,params)),inst.step=(value,params)=>inst.check(_multipleOf(value,params)),inst.finite=()=>inst;let bag=inst._zod.bag;inst.minValue=Math.max(bag.minimum??Number.NEGATIVE_INFINITY,bag.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,inst.maxValue=Math.min(bag.maximum??Number.POSITIVE_INFINITY,bag.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,inst.isInt=(bag.format??"").includes("int")||Number.isSafeInteger(bag.multipleOf??.5),inst.isFinite=!0,inst.format=bag.format??null});function number2(params){return _number(ZodNumber,params)}var ZodNumberFormat=$constructor("ZodNumberFormat",(inst,def)=>{$ZodNumberFormat.init(inst,def),ZodNumber.init(inst,def)});function int(params){return _int(ZodNumberFormat,params)}var ZodBoolean=$constructor("ZodBoolean",(inst,def)=>{$ZodBoolean.init(inst,def),ZodType.init(inst,def)});function boolean2(params){return _boolean(ZodBoolean,params)}var ZodUnknown=$constructor("ZodUnknown",(inst,def)=>{$ZodUnknown.init(inst,def),ZodType.init(inst,def)});function unknown(){return _unknown(ZodUnknown)}var ZodNever=$constructor("ZodNever",(inst,def)=>{$ZodNever.init(inst,def),ZodType.init(inst,def)});function never(params){return _never(ZodNever,params)}var ZodArray=$constructor("ZodArray",(inst,def)=>{$ZodArray.init(inst,def),ZodType.init(inst,def),inst.element=def.element,inst.min=(minLength,params)=>inst.check(_minLength(minLength,params)),inst.nonempty=params=>inst.check(_minLength(1,params)),inst.max=(maxLength,params)=>inst.check(_maxLength(maxLength,params)),inst.length=(len,params)=>inst.check(_length(len,params)),inst.unwrap=()=>inst.element});function array(element,params){return _array(ZodArray,element,params)}var ZodObject=$constructor("ZodObject",(inst,def)=>{$ZodObjectJIT.init(inst,def),ZodType.init(inst,def),util_exports.defineLazy(inst,"shape",()=>def.shape),inst.keyof=()=>_enum(Object.keys(inst._zod.def.shape)),inst.catchall=catchall=>inst.clone({...inst._zod.def,catchall}),inst.passthrough=()=>inst.clone({...inst._zod.def,catchall:unknown()}),inst.loose=()=>inst.clone({...inst._zod.def,catchall:unknown()}),inst.strict=()=>inst.clone({...inst._zod.def,catchall:never()}),inst.strip=()=>inst.clone({...inst._zod.def,catchall:void 0}),inst.extend=incoming=>util_exports.extend(inst,incoming),inst.safeExtend=incoming=>util_exports.safeExtend(inst,incoming),inst.merge=other=>util_exports.merge(inst,other),inst.pick=mask=>util_exports.pick(inst,mask),inst.omit=mask=>util_exports.omit(inst,mask),inst.partial=(...args)=>util_exports.partial(ZodOptional,inst,args[0]),inst.required=(...args)=>util_exports.required(ZodNonOptional,inst,args[0])});function object(shape,params){let def={type:"object",shape:shape??{},...util_exports.normalizeParams(params)};return new ZodObject(def)}var ZodUnion=$constructor("ZodUnion",(inst,def)=>{$ZodUnion.init(inst,def),ZodType.init(inst,def),inst.options=def.options});function union(options,params){return new ZodUnion({type:"union",options,...util_exports.normalizeParams(params)})}var ZodIntersection=$constructor("ZodIntersection",(inst,def)=>{$ZodIntersection.init(inst,def),ZodType.init(inst,def)});function intersection(left,right){return new ZodIntersection({type:"intersection",left,right})}var ZodEnum=$constructor("ZodEnum",(inst,def)=>{$ZodEnum.init(inst,def),ZodType.init(inst,def),inst.enum=def.entries,inst.options=Object.values(def.entries);let keys=new Set(Object.keys(def.entries));inst.extract=(values,params)=>{let newEntries={};for(let value of values)if(keys.has(value))newEntries[value]=def.entries[value];else throw new Error(`Key ${value} not found in enum`);return new ZodEnum({...def,checks:[],...util_exports.normalizeParams(params),entries:newEntries})},inst.exclude=(values,params)=>{let newEntries={...def.entries};for(let value of values)if(keys.has(value))delete newEntries[value];else throw new Error(`Key ${value} not found in enum`);return new ZodEnum({...def,checks:[],...util_exports.normalizeParams(params),entries:newEntries})}});function _enum(values,params){let entries=Array.isArray(values)?Object.fromEntries(values.map(v=>[v,v])):values;return new ZodEnum({type:"enum",entries,...util_exports.normalizeParams(params)})}var ZodLiteral=$constructor("ZodLiteral",(inst,def)=>{$ZodLiteral.init(inst,def),ZodType.init(inst,def),inst.values=new Set(def.values),Object.defineProperty(inst,"value",{get(){if(def.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return def.values[0]}})});function literal(value,params){return new ZodLiteral({type:"literal",values:Array.isArray(value)?value:[value],...util_exports.normalizeParams(params)})}var ZodTransform=$constructor("ZodTransform",(inst,def)=>{$ZodTransform.init(inst,def),ZodType.init(inst,def),inst._zod.parse=(payload,_ctx)=>{if(_ctx.direction==="backward")throw new $ZodEncodeError(inst.constructor.name);payload.addIssue=issue2=>{if(typeof issue2=="string")payload.issues.push(util_exports.issue(issue2,payload.value,def));else{let _issue=issue2;_issue.fatal&&(_issue.continue=!1),_issue.code??(_issue.code="custom"),_issue.input??(_issue.input=payload.value),_issue.inst??(_issue.inst=inst),payload.issues.push(util_exports.issue(_issue))}};let output=def.transform(payload.value,payload);return output instanceof Promise?output.then(output2=>(payload.value=output2,payload)):(payload.value=output,payload)}});function transform(fn){return new ZodTransform({type:"transform",transform:fn})}var ZodOptional=$constructor("ZodOptional",(inst,def)=>{$ZodOptional.init(inst,def),ZodType.init(inst,def),inst.unwrap=()=>inst._zod.def.innerType});function optional(innerType){return new ZodOptional({type:"optional",innerType})}var ZodNullable=$constructor("ZodNullable",(inst,def)=>{$ZodNullable.init(inst,def),ZodType.init(inst,def),inst.unwrap=()=>inst._zod.def.innerType});function nullable(innerType){return new ZodNullable({type:"nullable",innerType})}var ZodDefault=$constructor("ZodDefault",(inst,def)=>{$ZodDefault.init(inst,def),ZodType.init(inst,def),inst.unwrap=()=>inst._zod.def.innerType,inst.removeDefault=inst.unwrap});function _default(innerType,defaultValue){return new ZodDefault({type:"default",innerType,get defaultValue(){return typeof defaultValue=="function"?defaultValue():util_exports.shallowClone(defaultValue)}})}var ZodPrefault=$constructor("ZodPrefault",(inst,def)=>{$ZodPrefault.init(inst,def),ZodType.init(inst,def),inst.unwrap=()=>inst._zod.def.innerType});function prefault(innerType,defaultValue){return new ZodPrefault({type:"prefault",innerType,get defaultValue(){return typeof defaultValue=="function"?defaultValue():util_exports.shallowClone(defaultValue)}})}var ZodNonOptional=$constructor("ZodNonOptional",(inst,def)=>{$ZodNonOptional.init(inst,def),ZodType.init(inst,def),inst.unwrap=()=>inst._zod.def.innerType});function nonoptional(innerType,params){return new ZodNonOptional({type:"nonoptional",innerType,...util_exports.normalizeParams(params)})}var ZodCatch=$constructor("ZodCatch",(inst,def)=>{$ZodCatch.init(inst,def),ZodType.init(inst,def),inst.unwrap=()=>inst._zod.def.innerType,inst.removeCatch=inst.unwrap});function _catch(innerType,catchValue){return new ZodCatch({type:"catch",innerType,catchValue:typeof catchValue=="function"?catchValue:()=>catchValue})}var ZodPipe=$constructor("ZodPipe",(inst,def)=>{$ZodPipe.init(inst,def),ZodType.init(inst,def),inst.in=def.in,inst.out=def.out});function pipe(in_,out){return new ZodPipe({type:"pipe",in:in_,out})}var ZodReadonly=$constructor("ZodReadonly",(inst,def)=>{$ZodReadonly.init(inst,def),ZodType.init(inst,def),inst.unwrap=()=>inst._zod.def.innerType});function readonly(innerType){return new ZodReadonly({type:"readonly",innerType})}var ZodCustom=$constructor("ZodCustom",(inst,def)=>{$ZodCustom.init(inst,def),ZodType.init(inst,def)});function refine(fn,_params={}){return _refine(ZodCustom,fn,_params)}function superRefine(fn){return _superRefine(fn)}var telemetryConfigSchema=object({enabled:boolean2().optional()}),guidanceConfigSchema=object({enabled:boolean2().optional()}),updatesConfigSchema=object({auto:boolean2().optional(),bypassMinReleaseAge:boolean2().optional()}),credStorageSchema=union([literal("auto"),literal("file"),literal("keyring")]),dpopPublicKeySchema=object({kty:literal("EC"),crv:literal("P-256"),x:string2(),y:string2()}),dpopPrivateKeySchema=dpopPublicKeySchema.and(union([object({d:string2()}),object({secureEnclave:string2(),sealed:string2()}),object({tpm:string2(),sealed:string2()}),object({tpmPublic:string2(),sealed:string2()})])),authConfigSchema=object({"// Note":string2().optional(),"// Docs":string2().optional(),skipWrite:boolean2().optional(),token:string2().optional(),userId:string2().optional(),cachedUser:object({id:string2(),username:string2()}).optional(),refreshToken:string2().optional(),expiresAt:number2().optional(),tokenSource:union([literal("flag"),literal("env")]).optional(),dpop:object({key:dpopPrivateKeySchema}).optional()}),authFileConfigSchema=authConfigSchema.omit({tokenSource:!0}),globalConfigSchema=object({"// Note":string2().optional(),"// Docs":string2().optional(),credStorage:credStorageSchema.optional(),currentTeam:string2().optional(),api:string2().optional(),telemetry:telemetryConfigSchema.optional(),guidance:guidanceConfigSchema.optional(),updates:updatesConfigSchema.optional(),useNativeBinary:boolean2().optional(),nativeBinaryAutoOptIn:boolean2().optional(),usedBefore:boolean2().optional()});function formatCredStorageError(value){return`Invalid value for \`credStorage\`: ${JSON.stringify(value)}. Expected one of: ${CRED_STORAGE_CONFIG_VALUES.map(storage=>JSON.stringify(storage)).join(", ")}.`}var telemetryConfigSchema2=telemetryConfigSchema.passthrough(),guidanceConfigSchema2=guidanceConfigSchema.passthrough(),updatesConfigSchema2=updatesConfigSchema.passthrough(),credStorageSchema2=_enum(CRED_STORAGE_CONFIG_VALUES,{error:issue2=>formatCredStorageError(issue2.input)}).optional(),globalConfigSchema2=globalConfigSchema.extend({credStorage:credStorageSchema2,telemetry:telemetryConfigSchema2.optional(),guidance:guidanceConfigSchema2.optional(),updates:updatesConfigSchema2.optional()}).passthrough(),authConfigSchema2=authConfigSchema.passthrough();var import_node_fs2=__toESM(require("fs")),import_node_path2=__toESM(require("path"));var import_node_fs=__toESM(require("fs")),import_node_path=__toESM(require("path")),import_node_os=require("os");function isReadableDirectory(targetPath){try{return import_node_fs.default.lstatSync(targetPath).isDirectory()}catch{return!1}}function getAppPaths(appName){return require_xdg_app_paths()(appName)}function getDataDirectories(appName){return getAppPaths(appName).dataDirs()}function getDataPath(){return getDataDirectories("com.vercel.cli")[0]}function getCachePath(){return getAppPaths("com.vercel.cli").cache()}function getGlobalPathConfig(){let vercelDirectories=getDataDirectories("com.vercel.cli");return[...vercelDirectories,import_node_path.default.join((0,import_node_os.homedir)(),".now"),...getDataDirectories("now")].find(configPath=>isReadableDirectory(configPath))||vercelDirectories[0]}function getConfigFilePath(configDir){return import_node_path.default.join(configDir,"config.json")}function getAuthConfigFilePath(configDir){return import_node_path.default.join(configDir,"auth.json")}function getDpopAuthConfigFilePath(configDir){return import_node_path.default.join(configDir,"credentials.json")}var DOCS_URL="https://vercel.com/docs/projects/project-configuration/global-configuration",defaultGlobalConfig={"// Note":"This is your Vercel config file. For more information see the global configuration documentation.","// Docs":`${DOCS_URL}#config.json`,usedBefore:!1};function getDefaultAuthConfig(){return{"// Note":"This is your Vercel credentials file. DO NOT SHARE!","// Docs":`${DOCS_URL}#auth.json`}}var defaultAuthConfig=getDefaultAuthConfig();function normalizeConfigError(error){if(error instanceof ZodError){let credStorageIssue=error.issues.find(issue2=>issue2.path[0]==="credStorage");if(credStorageIssue)throw new Error(credStorageIssue.message)}throw error}function parseGlobalConfig(value){try{return globalConfigSchema2.parse(value)}catch(error){normalizeConfigError(error)}}function parseAuthConfig(value){return authConfigSchema2.parse(value)}function parseAuthFileConfig(value){let{tokenSource,...authConfig}=parseAuthConfig(value);return authConfig}function readJsonFileSync(filePath){let content=import_node_fs2.default.readFileSync(filePath,"utf8").replace(/^\uFEFF/,"");return JSON.parse(content)}function writeJsonFileSync(filePath,value,options={}){let directory=import_node_path2.default.dirname(filePath),tempFilePath=import_node_path2.default.join(directory,`.${import_node_path2.default.basename(filePath)}.${process.pid}.${Date.now()}.tmp`),content=`${JSON.stringify(value,null,options.indent??2)}
|
|
21
|
-
|
|
54
|
+
|
|
55
|
+
`)}return doc.write("payload.value = newResult;"),doc.write("return payload;"),doc.compile()},fastpass,isObject2=isObject,jit=!globalConfig.jitless,fastEnabled=jit&&allowsEval.value,catchall=def.catchall,value;inst._zod.parse=(payload,ctx)=>{value??(value=_normalized.value);let input=payload.value;return isObject2(input)?jit&&fastEnabled&&ctx?.async===!1&&ctx.jitless!==!0?(fastpass||(fastpass=generateFastpass(def.shape)),payload=fastpass(payload,ctx),catchall?handleCatchall([],input,payload,ctx,value,inst,ctx?.abortEarly===!0):payload):superParse(payload,ctx):(payload.issues.push({expected:"object",code:"invalid_type",input,inst}),payload)}});function handleUnionResults(results,final,inst,ctx){for(let result of results)if(result.issues.length===0)return final.value=result.value,final;let nonaborted=results.filter(r=>!aborted(r));return nonaborted.length===1?(final.value=nonaborted[0].value,nonaborted[0]):(final.issues.push({code:"invalid_union",input:final.value,inst,errors:results.map(result=>result.issues.map(iss=>finalizeIssue(iss,ctx,config())))}),final)}var $ZodUnion=$constructor("$ZodUnion",(inst,def)=>{$ZodType.init(inst,def),defineLazyInternal(inst,"optin",zod=>zod.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":zod.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),defineLazyInternal(inst,"optout",zod=>zod.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),defineLazyInternal(inst,"values",zod=>{if(zod.def.options.every(o=>o._zod.values))return new Set(zod.def.options.flatMap(option=>Array.from(option._zod.values)))}),defineLazyInternal(inst,"pattern",zod=>{if(zod.def.options.every(o=>o._zod.pattern)){let patterns=zod.def.options.map(o=>o._zod.pattern);return new RegExp(`^(${patterns.map(p=>cleanRegex(p.source)).join("|")})$`)}});let first=def.options.length===1?def.options[0]._zod.run:null;inst._zod.parse=(payload,ctx)=>{if(first)return first(payload,ctx);let async=!1,results=[];for(let option of def.options){let result=option._zod.run({value:payload.value,issues:[]},ctx);if(result instanceof Promise)results.push(result),async=!0;else{if(result.issues.length===0)return result;results.push(result)}}return async?Promise.all(results).then(results2=>handleUnionResults(results2,payload,inst,ctx)):handleUnionResults(results,payload,inst,ctx)}});var $ZodIntersection=$constructor("$ZodIntersection",(inst,def)=>{$ZodType.init(inst,def),inst._zod.parse=(payload,ctx)=>{let input=payload.value,left=def.left._zod.run({value:input,issues:[]},ctx),right=def.right._zod.run({value:input,issues:[]},ctx);return left instanceof Promise||right instanceof Promise?Promise.all([left,right]).then(([left2,right2])=>handleIntersectionResults(payload,left2,right2)):handleIntersectionResults(payload,left,right)}});function mergeValues(a,b){if(a===b)return{valid:!0,data:a};if(a instanceof Date&&b instanceof Date&&+a==+b)return{valid:!0,data:a};if(isPlainObject(a)&&isPlainObject(b)){let bKeys=Object.keys(b),sharedKeys=Object.keys(a).filter(key=>bKeys.indexOf(key)!==-1),newObj={...a,...b};Object.prototype.hasOwnProperty.call(newObj,"__proto__")&&delete newObj.__proto__;for(let key of sharedKeys){if(key==="__proto__")continue;let sharedValue=mergeValues(a[key],b[key]);if(!sharedValue.valid)return{valid:!1,mergeErrorPath:[key,...sharedValue.mergeErrorPath]};newObj[key]=sharedValue.data}return{valid:!0,data:newObj}}if(Array.isArray(a)&&Array.isArray(b)){if(a.length!==b.length)return{valid:!1,mergeErrorPath:[]};let newArray=[];for(let index=0;index<a.length;index++){let itemA=a[index],itemB=b[index],sharedValue=mergeValues(itemA,itemB);if(!sharedValue.valid)return{valid:!1,mergeErrorPath:[index,...sharedValue.mergeErrorPath]};newArray.push(sharedValue.data)}return{valid:!0,data:newArray}}return{valid:!1,mergeErrorPath:[]}}function handleIntersectionResults(result,left,right){let unrecKeys=new Map,unrecIssue,keyIssues=new Map,collect=(iss,side)=>{let keys;if(iss.code==="unrecognized_keys"&&!iss.path?.length)unrecIssue??(unrecIssue=iss),keys=iss.keys;else if(iss.code==="invalid_key"&&iss.origin==="record"&&iss.path?.length===1){let k=String(iss.path[0]);keyIssues.has(k)||keyIssues.set(k,iss),keys=[k]}else return!1;for(let k of keys)unrecKeys.has(k)||unrecKeys.set(k,{}),unrecKeys.get(k)[side]=!0;return!0};for(let iss of left.issues)collect(iss,"l")||result.issues.push(iss);for(let iss of right.issues)collect(iss,"r")||result.issues.push(iss);let bothKeys=[...unrecKeys].filter(([,f])=>f.l&&f.r).map(([k])=>k);if(bothKeys.length){let aggregated=unrecIssue?bothKeys.filter(k=>unrecIssue.keys.includes(k)):[];aggregated.length&&result.issues.push({...unrecIssue,keys:aggregated});for(let k of bothKeys)!aggregated.includes(k)&&keyIssues.has(k)&&result.issues.push(keyIssues.get(k))}let merged=mergeValues(left.value,right.value);if(!merged.valid){if(aborted(result))return result;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`)}return result.value=merged.data,result}var $ZodEnum=$constructor("$ZodEnum",(inst,def)=>{$ZodType.init(inst,def);let values=getEnumValues(def.entries),valuesSet=new Set(values);inst._zod.values=valuesSet,defineLazyInternal(inst,"pattern",zod=>{let patternValues=getEnumValues(zod.def.entries).filter(k=>propertyKeyTypes.has(typeof k));return new RegExp(patternValues.length?`^(${patternValues.map(o=>escapeRegex(o.toString())).join("|")})$`:"^[^\\s\\S]$")}),inst._zod.parse=(payload,_ctx)=>{let input=payload.value;return valuesSet.has(input)||payload.issues.push({code:"invalid_value",values,input,inst}),payload}}),$ZodLiteral=$constructor("$ZodLiteral",(inst,def)=>{$ZodType.init(inst,def);let values=new Set(def.values);inst._zod.values=values,defineLazyInternal(inst,"pattern",zod=>{let vals=zod.def.values;return new RegExp(vals.length?`^(${vals.map(o=>typeof o=="string"?escapeRegex(o):o?escapeRegex(o.toString()):String(o)).join("|")})$`:"^[^\\s\\S]$")}),inst._zod.parse=(payload,_ctx)=>{let input=payload.value;return values.has(input)||payload.issues.push({code:"invalid_value",values:def.values,input,inst}),payload}});var $ZodTransform=$constructor("$ZodTransform",(inst,def)=>{$ZodType.init(inst,def),inst._zod.optin="optional",globalConfig.memoizer?.guard(inst),inst._zod.parse=(payload,ctx)=>{if(ctx.direction==="backward")throw new $ZodEncodeError(inst.constructor.name);let _out=def.transform(payload.value,payload);if(ctx.async)return(_out instanceof Promise?_out:Promise.resolve(_out)).then(output2=>(payload.value=output2,payload));if(_out instanceof Promise)throw new $ZodAsyncError;return payload.value=_out,payload}});function handleOptionalResult(payload,result){return payload.value=result.issues.length?void 0:result.value,payload}var $ZodOptional=$constructor("$ZodOptional",(inst,def)=>{$ZodType.init(inst,def),defineLazyInternal(inst,"optin",zod=>zod.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),inst._zod.optout="optional",defineLazyInternal(inst,"values",zod=>{let values=zod.def.innerType._zod.values;return values?new Set([...values,void 0]):void 0}),defineLazyInternal(inst,"pattern",zod=>{let pattern=zod.def.innerType._zod.pattern;return pattern?new RegExp(`^(${cleanRegex(pattern.source)})?$`):void 0}),inst._zod.parse=(payload,ctx)=>{if(payload.value===void 0){if(def.innerType._zod.optin!=="defaulted")return payload;let result=def.innerType._zod.run({value:payload.value,issues:[]},ctx);return result instanceof Promise?result.then(result2=>handleOptionalResult(payload,result2)):handleOptionalResult(payload,result)}return def.innerType._zod.run(payload,ctx)}}),$ZodExactOptional=$constructor("$ZodExactOptional",(inst,def)=>{$ZodOptional.init(inst,def),defineLazyInternal(inst,"values",zod=>zod.def.innerType._zod.values),defineLazyInternal(inst,"pattern",zod=>zod.def.innerType._zod.pattern),inst._zod.parse=(payload,ctx)=>def.innerType._zod.run(payload,ctx)}),$ZodNullable=$constructor("$ZodNullable",(inst,def)=>{$ZodType.init(inst,def),defineLazyInternal(inst,"optin",zod=>zod.def.innerType._zod.optin),defineLazyInternal(inst,"optout",zod=>zod.def.innerType._zod.optout),defineLazyInternal(inst,"pattern",zod=>{let pattern=zod.def.innerType._zod.pattern;return pattern?new RegExp(`^(${cleanRegex(pattern.source)}|null)$`):void 0}),defineLazyInternal(inst,"values",zod=>zod.def.innerType._zod.values?new Set([...zod.def.innerType._zod.values,null]):void 0),inst._zod.parse=(payload,ctx)=>payload.value===null?payload:def.innerType._zod.run(payload,ctx)}),$ZodDefault=$constructor("$ZodDefault",(inst,def)=>{$ZodType.init(inst,def),inst._zod.optin="defaulted",defineLazyInternal(inst,"values",zod=>zod.def.innerType._zod.values),inst._zod.parse=(payload,ctx)=>{if(ctx.direction==="backward")return def.innerType._zod.run(payload,ctx);if(payload.value===void 0)return payload.value=def.defaultValue,payload;let result=def.innerType._zod.run(payload,ctx);return result instanceof Promise?result.then(result2=>handleDefaultResult(result2,def)):handleDefaultResult(result,def)}});function handleDefaultResult(payload,def){return payload.value===void 0&&(payload.value=def.defaultValue),payload}var $ZodPrefault=$constructor("$ZodPrefault",(inst,def)=>{$ZodType.init(inst,def),inst._zod.optin="defaulted",defineLazyInternal(inst,"values",zod=>zod.def.innerType._zod.values),inst._zod.parse=(payload,ctx)=>(ctx.direction==="backward"||payload.value===void 0&&(payload.value=def.defaultValue),def.innerType._zod.run(payload,ctx))}),$ZodNonOptional=$constructor("$ZodNonOptional",(inst,def)=>{$ZodType.init(inst,def),defineLazyInternal(inst,"values",zod=>{let v=zod.def.innerType._zod.values;return v?new Set([...v].filter(x=>x!==void 0)):void 0}),inst._zod.parse=(payload,ctx)=>{let result=def.innerType._zod.run(payload,ctx);return result instanceof Promise?result.then(result2=>handleNonOptionalResult(result2,inst)):handleNonOptionalResult(result,inst)}});function handleNonOptionalResult(payload,inst){return!payload.issues.length&&payload.value===void 0&&payload.issues.push({code:"invalid_type",expected:"nonoptional",input:payload.value,inst}),payload}function handleCatchResult(payload,result,def,ctx){return result.issues.length?(payload.value=def.catchValue({...result,value:payload.value,error:{issues:result.issues.map(iss=>finalizeIssue(iss,ctx,config()))},input:payload.value}),payload):(payload.value=result.value,result.memo&&(payload.memo=!0),payload)}var $ZodCatch=$constructor("$ZodCatch",(inst,def)=>{$ZodType.init(inst,def),defineLazyInternal(inst,"optin",zod=>zod.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),defineLazyInternal(inst,"optout",zod=>zod.def.innerType._zod.optout),defineLazyInternal(inst,"values",zod=>zod.def.innerType._zod.values),inst._zod.parse=(payload,ctx)=>{if(ctx.direction==="backward")return def.innerType._zod.run(payload,ctx);let result=def.innerType._zod.run({value:payload.value,issues:[]},ctx);return result instanceof Promise?result.then(result2=>handleCatchResult(payload,result2,def,ctx)):handleCatchResult(payload,result,def,ctx)}});var $ZodPipe=$constructor("$ZodPipe",(inst,def)=>{$ZodType.init(inst,def),defineLazyInternal(inst,"values",zod=>zod.def.in._zod.values),defineLazyInternal(inst,"optin",zod=>zod.def.in._zod.optin),defineLazyInternal(inst,"optout",zod=>zod.def.out._zod.optout),defineLazyInternal(inst,"propValues",zod=>zod.def.in._zod.propValues),inst._zod.parse=(payload,ctx)=>{if(ctx.direction==="backward"){let right=def.out._zod.run(payload,ctx);return right instanceof Promise?right.then(right2=>handlePipeResult(right2,def.in,ctx)):handlePipeResult(right,def.in,ctx)}let left=def.in._zod.run(payload,ctx);return left instanceof Promise?left.then(left2=>handlePipeResult(left2,def.out,ctx)):handlePipeResult(left,def.out,ctx)}});function handlePipeResult(left,next,ctx){return left.issues.some(iss=>iss.code!=="unrecognized_keys")?(left.aborted=!0,left):next._zod.run({value:left.value,issues:left.issues},ctx)}var $ZodReadonly=$constructor("$ZodReadonly",(inst,def)=>{$ZodType.init(inst,def),defineLazyInternal(inst,"propValues",zod=>zod.def.innerType._zod.propValues),defineLazyInternal(inst,"values",zod=>zod.def.innerType._zod.values),defineLazyInternal(inst,"optin",zod=>zod.def.innerType?._zod?.optin),defineLazyInternal(inst,"optout",zod=>zod.def.innerType?._zod?.optout),inst._zod.parse=(payload,ctx)=>{if(ctx.direction==="backward")return def.innerType._zod.run(payload,ctx);let result=def.innerType._zod.run(payload,ctx);return result instanceof Promise?result.then(handleReadonlyResult):handleReadonlyResult(result)}});function handleReadonlyResult(payload){return payload.memo||(payload.value=Object.freeze(payload.value)),payload}var $ZodCustom=$constructor("$ZodCustom",(inst,def)=>{$ZodCheck.init(inst,def),$ZodType.init(inst,def),inst._zod.parse=(payload,_)=>payload,inst._zod.check=payload=>{let input=payload.value,r=def.fn(input);if(r instanceof Promise)return r.then(r2=>handleRefineResult(r2,payload,input,inst));handleRefineResult(r,payload,input,inst)}});function handleRefineResult(result,payload,input,inst){if(!result){let _iss={code:"custom",input,inst,path:[...inst._zod.def.path??[]],continue:!inst._zod.def.abort};inst._zod.def.params&&(_iss.params=inst._zod.def.params),payload.issues.push(issue(_iss))}}var $ZodCyclicError=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},STATE="~memo",NO_ISSUES=[];function isRef(value){return value!==null&&typeof value=="object"}function cloneIssues(issues){return issues.map(iss=>iss.path?{...iss,path:iss.path.slice()}:{...iss})}var recursive=new WeakMap,NONE=0,ASSUMED=1,PROVEN=2;function isRecursive(inst,stack,resolve){let cached2=recursive.get(inst);if(cached2!==void 0)return cached2?PROVEN:NONE;if(stack.has(inst))return PROVEN;stack.add(inst);let result=NONE,check=child=>{if(result!==PROVEN&&child?._zod){let answer=isRecursive(child,stack,resolve);answer>result&&(result=answer)}},shape=(sh,spread)=>{let answer=NONE;for(let key of Reflect.ownKeys(sh)){let desc=Object.getOwnPropertyDescriptor(sh,key);if(spread&&!desc.enumerable)continue;let child=desc.get?ASSUMED:desc.value?._zod?isRecursive(desc.value,stack,resolve):NONE;child>answer&&(answer=child)}return answer},merge2=answer=>{answer>result&&(result=answer)},def=inst._zod.def,kind=def.type;switch(kind){case"object":{let raw=rawShape(def);merge2(raw?shape(raw,!0):ASSUMED),check(def.catchall);break}case"array":check(def.element);break;case"tuple":for(let el of def.items)check(el);check(def.rest);break;case"record":case"map":check(def.keyType),check(def.valueType);break;case"set":check(def.valueType);break;case"union":for(let el of def.options)check(el);break;case"intersection":check(def.left),check(def.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":check(def.innerType);break;case"pipe":check(def.in),check(def.out);break;case"function":check(def.input),check(def.output);break;case"lazy":{let inner=def._cachedInner??(resolve?inst._zod.innerType:void 0);merge2(inner?isRecursive(inner,stack,!1):ASSUMED);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let key in def){let desc=Object.getOwnPropertyDescriptor(def,key);if(!desc||desc.get)continue;let value=desc.value;if(!(!value||typeof value!="object")){if(value._zod)check(value);else if(Array.isArray(value))for(let el of value)check(el)}}}return stack.delete(inst),settle(inst,result)}function settle(inst,answer){return answer!==ASSUMED&&recursive.set(inst,answer===PROVEN),answer}function bucketFor(state,inst){let bucket=state.buckets.get(inst);return bucket||(bucket=new WeakMap,state.buckets.set(inst,bucket)),bucket}var handoff,open=[],memo={alloc(_inst,payload,empty){let bucket=handoff;if(!bucket)return empty;handoff=void 0;let entry={value:empty,issues:null};return bucket.set(payload.value,entry),open.push(entry),empty},guard(inst){var _a3;(_a3=inst._zod).deferred??(_a3.deferred=[]),inst._zod.deferred.push(()=>{let base=inst._zod.parse,wrapped=(payload,ctx)=>{if(ctx.direction!=="backward"&&isBackEdge(ctx,payload.value))throw new $ZodCyclicError;return base(payload,ctx)};inst._zod.parse=wrapped,inst._zod.run===base&&(inst._zod.run=wrapped)})},attach(inst){var _a3;let isRecursiveInst,rechecked=!1,lastCtx,lastBucket;(_a3=inst._zod).deferred??(_a3.deferred=[]),inst._zod.deferred.push(()=>{let base=inst._zod.parse,wrapped=(payload,ctx)=>{if(isRecursiveInst===void 0){let walked=isRecursive(inst,new Set,!1);if(walked===NONE)return inst._zod.parse=base,inst._zod.run===wrapped&&(inst._zod.run=base),base(payload,ctx);walked===PROVEN||rechecked?isRecursiveInst=!0:rechecked=!0}let input=payload.value;if(!isRef(input))return base(payload,ctx);let state=ctx[STATE];state||(state={buckets:new WeakMap,backEdges:void 0},ctx[STATE]=state);let bucket;lastCtx===ctx?bucket=lastBucket:(bucket=bucketFor(state,inst),lastCtx=ctx,lastBucket=bucket);let hit=bucket.get(input);if(hit)return payload.value=hit.value,hit.issues?hit.issues.length&&payload.issues.push(...cloneIssues(hit.issues)):(payload.memo=!0,state.backEdges??(state.backEdges=new WeakSet),state.backEdges.add(hit.value)),payload;handoff=bucket;let depth=open.length,result=base(payload,ctx);handoff=void 0;let entry=open.length>depth?open.pop():void 0;return result instanceof Promise?result.then(r=>(entry&&(entry.issues=r.issues.length?cloneIssues(r.issues):NO_ISSUES),r)):(entry&&(entry.issues=result.issues.length?cloneIssues(result.issues):NO_ISSUES),result)};inst._zod.parse=wrapped,inst._zod.run===base&&(inst._zod.run=wrapped)})}};function memoizer(){return memo}function isBackEdge(ctx,value){let backEdges=ctx[STATE]?.backEdges;return backEdges!==void 0&&isRef(value)&&backEdges.has(value)}var error=()=>{let Sizable={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function getSizing(origin){return Sizable[origin]??null}let FormatDictionary={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},TypeDictionary={nan:"NaN"};function getTypeName(type,input){return type==="number"&&typeof input=="number"&&!Number.isFinite(input)?String(input):TypeDictionary[type]??type}return issue2=>{switch(issue2.code){case"invalid_type":{let expected=getTypeName(issue2.expected),receivedType=parsedType(issue2.input),received=getTypeName(receivedType,issue2.input);return`Invalid input: expected ${expected}, received ${received}`}case"invalid_value":return issue2.values.length===1?`Invalid input: expected ${stringifyPrimitive(issue2.values[0])}`:`Invalid option: expected one of ${joinValues(issue2.values,"|")}`;case"too_big":{let adj=issue2.exact?"exactly ":issue2.inclusive?"<=":"<",sizing=getSizing(issue2.origin);return sizing?`Too big: expected ${issue2.origin??"value"} to have ${adj}${issue2.maximum.toString()} ${sizing.unit??"elements"}`:`Too big: expected ${issue2.origin??"value"} to be ${adj}${issue2.maximum.toString()}`}case"too_small":{let adj=issue2.exact?"exactly ":issue2.inclusive?">=":">",sizing=getSizing(issue2.origin);return sizing?`Too small: expected ${issue2.origin} to have ${adj}${issue2.minimum.toString()} ${sizing.unit}`:`Too small: expected ${issue2.origin} to be ${adj}${issue2.minimum.toString()}`}case"invalid_format":{let _issue=issue2;return _issue.format==="starts_with"?`Invalid string: must start with "${_issue.prefix}"`:_issue.format==="ends_with"?`Invalid string: must end with "${_issue.suffix}"`:_issue.format==="includes"?`Invalid string: must include "${_issue.includes}"`:_issue.format==="regex"?`Invalid string: must match pattern ${_issue.pattern}`:`Invalid ${FormatDictionary[_issue.format]??issue2.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${issue2.divisor}`;case"unrecognized_keys":return`Unrecognized key${issue2.keys.length>1?"s":""}: ${joinValues(issue2.keys,", ")}`;case"invalid_key":return`Invalid key in ${issue2.origin}`;case"invalid_union":return issue2.options&&Array.isArray(issue2.options)&&issue2.options.length>0?`Invalid discriminator value. Expected ${issue2.options.map(o=>`'${o}'`).join(" | ")}`:issue2.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${issue2.origin}`;default:return"Invalid input"}}};function en_default(){return{localeError:error()}}var _a2;var $ZodRegistry=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(schema,..._meta){let meta2=_meta[0];return this._map.set(schema,meta2),meta2&&typeof meta2=="object"&&"id"in meta2&&this._idmap.set(meta2.id,schema),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(schema){let meta2=this._map.get(schema);return meta2&&typeof meta2=="object"&&"id"in meta2&&this._idmap.delete(meta2.id),this._map.delete(schema),this}get(schema){let p=schema._zod.parent;if(p){let pm={...this.get(p)??{}};delete pm.id;let f={...pm,...this._map.get(schema)};return Object.keys(f).length?f:void 0}return this._map.get(schema)}has(schema){return this._map.has(schema)}};function registry(){return new $ZodRegistry}(_a2=globalThis).__zod_globalRegistry??(_a2.__zod_globalRegistry=registry());var globalRegistry=globalThis.__zod_globalRegistry;function snapshotChecks(def){return def.checks&&(def.checks=[...def.checks]),def}function _string(Class2,params){return new Class2(snapshotChecks({type:"string",...normalizeParams(params)}))}function _email(Class2,params){return new Class2({type:"string",format:"email",check:"string_format",abort:!1,...normalizeParams(params)})}function _guid(Class2,params){return new Class2({type:"string",format:"guid",check:"string_format",abort:!1,...normalizeParams(params)})}function _uuid(Class2,params){return new Class2({type:"string",format:"uuid",check:"string_format",abort:!1,...normalizeParams(params)})}function _uuidv4(Class2,params){return new Class2({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...normalizeParams(params)})}function _uuidv6(Class2,params){return new Class2({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...normalizeParams(params)})}function _uuidv7(Class2,params){return new Class2({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...normalizeParams(params)})}function _url(Class2,params){return new Class2({type:"string",format:"url",check:"string_format",abort:!1,...normalizeParams(params)})}function _emoji2(Class2,params){return new Class2({type:"string",format:"emoji",check:"string_format",abort:!1,...normalizeParams(params)})}function _nanoid(Class2,params){return new Class2({type:"string",format:"nanoid",check:"string_format",abort:!1,...normalizeParams(params)})}function _cuid(Class2,params){return new Class2({type:"string",format:"cuid",check:"string_format",abort:!1,...normalizeParams(params)})}function _cuid2(Class2,params){return new Class2({type:"string",format:"cuid2",check:"string_format",abort:!1,...normalizeParams(params)})}function _ulid(Class2,params){return new Class2({type:"string",format:"ulid",check:"string_format",abort:!1,...normalizeParams(params)})}function _xid(Class2,params){return new Class2({type:"string",format:"xid",check:"string_format",abort:!1,...normalizeParams(params)})}function _ksuid(Class2,params){return new Class2({type:"string",format:"ksuid",check:"string_format",abort:!1,...normalizeParams(params)})}function _ipv4(Class2,params){return new Class2({type:"string",format:"ipv4",check:"string_format",abort:!1,...normalizeParams(params)})}function _ipv6(Class2,params){return new Class2({type:"string",format:"ipv6",check:"string_format",abort:!1,...normalizeParams(params)})}function _cidrv4(Class2,params){return new Class2({type:"string",format:"cidrv4",check:"string_format",abort:!1,...normalizeParams(params)})}function _cidrv6(Class2,params){return new Class2({type:"string",format:"cidrv6",check:"string_format",abort:!1,...normalizeParams(params)})}function _base64(Class2,params){return new Class2({type:"string",format:"base64",check:"string_format",abort:!1,...normalizeParams(params)})}function _base64url(Class2,params){return new Class2({type:"string",format:"base64url",check:"string_format",abort:!1,...normalizeParams(params)})}function _e164(Class2,params){return new Class2({type:"string",format:"e164",check:"string_format",abort:!1,...normalizeParams(params)})}function _jwt(Class2,params){return new Class2({type:"string",format:"jwt",check:"string_format",abort:!1,...normalizeParams(params)})}function _isoDateTime(Class2,params){return new Class2({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...normalizeParams(params)})}function _isoDate(Class2,params){return new Class2({type:"string",format:"date",check:"string_format",...normalizeParams(params)})}function _isoTime(Class2,params){return new Class2({type:"string",format:"time",check:"string_format",precision:null,...normalizeParams(params)})}function _isoDuration(Class2,params){return new Class2({type:"string",format:"duration",check:"string_format",...normalizeParams(params)})}function _number(Class2,params){return new Class2(snapshotChecks({type:"number",checks:[],...normalizeParams(params)}))}function _int(Class2,params){return new Class2({type:"number",check:"number_format",abort:!1,format:"safeint",...normalizeParams(params)})}function _boolean(Class2,params){return new Class2({type:"boolean",...normalizeParams(params)})}function _unknown(Class2){return new Class2({type:"unknown"})}function _never(Class2,params){return new Class2({type:"never",...normalizeParams(params)})}function _lt(value,params){return new $ZodCheckLessThan({check:"less_than",...normalizeParams(params),value,inclusive:!1})}function _lte(value,params){return new $ZodCheckLessThan({check:"less_than",...normalizeParams(params),value,inclusive:!0})}function _gt(value,params){return new $ZodCheckGreaterThan({check:"greater_than",...normalizeParams(params),value,inclusive:!1})}function _gte(value,params){return new $ZodCheckGreaterThan({check:"greater_than",...normalizeParams(params),value,inclusive:!0})}function _multipleOf(value,params){return new $ZodCheckMultipleOf({check:"multiple_of",...normalizeParams(params),value})}function _maxLength(maximum,params){return new $ZodCheckMaxLength({check:"max_length",...normalizeParams(params),maximum})}function _minLength(minimum,params){return new $ZodCheckMinLength({check:"min_length",...normalizeParams(params),minimum})}function _length(length,params){return new $ZodCheckLengthEquals({check:"length_equals",...normalizeParams(params),length})}function _regex(pattern,params){return new $ZodCheckRegex({check:"string_format",format:"regex",...normalizeParams(params),pattern})}function _lowercase(params){return new $ZodCheckLowerCase({check:"string_format",format:"lowercase",...normalizeParams(params)})}function _uppercase(params){return new $ZodCheckUpperCase({check:"string_format",format:"uppercase",...normalizeParams(params)})}function _includes(includes,params){return new $ZodCheckIncludes({check:"string_format",format:"includes",...normalizeParams(params),includes})}function _startsWith(prefix,params){return new $ZodCheckStartsWith({check:"string_format",format:"starts_with",...normalizeParams(params),prefix})}function _endsWith(suffix,params){return new $ZodCheckEndsWith({check:"string_format",format:"ends_with",...normalizeParams(params),suffix})}function _overwrite(tx){return new $ZodCheckOverwrite({check:"overwrite",tx})}function _normalize(form){return _overwrite(input=>input.normalize(form))}function _trim(){return _overwrite(input=>input.trim())}function _toLowerCase(){return _overwrite(input=>input.toLowerCase())}function _toUpperCase(){return _overwrite(input=>input.toUpperCase())}function _slugify(){return _overwrite(input=>slugify(input))}function _array(Class2,element,params){return new Class2({type:"array",element,...normalizeParams(params)})}function _refine(Class2,fn,_params){return new Class2({type:"custom",check:"custom",fn,...normalizeParams(_params)})}function _superRefine(fn,params){let ch=_check(payload=>(payload.addIssue=issue2=>{if(typeof issue2=="string")payload.issues.push(issue(issue2,payload.value,ch._zod.def));else{let _issue=issue2;_issue.fatal&&(_issue.continue=!1),_issue.code??(_issue.code="custom"),"input"in _issue||(_issue.input=payload.value),_issue.inst??(_issue.inst=ch),_issue.continue??(_issue.continue=!ch._zod.def.abort),payload.issues.push(issue(_issue))}},fn(payload.value,payload)),params);return ch}function _check(fn,params){let ch=new $ZodCheck({check:"custom",...normalizeParams(params)});return ch._zod.check=fn,ch}function assignProps(target,...sources){for(let source of sources)for(let key of Reflect.ownKeys(source))Object.prototype.propertyIsEnumerable.call(source,key)&&assignProp(target,key,source[key]);return target}function initializeContext(params){let target=params?.target??"draft-2020-12";return target==="draft-4"&&(target="draft-04"),target==="draft-7"&&(target="draft-07"),{processors:params.processors??{},metadataRegistry:params?.metadata??globalRegistry,target,unrepresentable:params?.unrepresentable??"throw",override:params?.override??(()=>{}),io:params?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:params?.cycles??"ref",reused:params?.reused??"inline",intersections:[],deferred:[],external:params?.external??void 0}}function handleUnrepresentable(schema,ctx,json,params,message){let result=typeof ctx.unrepresentable=="function"?ctx.unrepresentable({zodSchema:schema,path:params.path,message}):ctx.unrepresentable;if(result==="any")return!1;if(result===void 0||result==="throw")throw new Error(message);return Object.assign(json,result),!0}function processSchema(schema,ctx,_params={path:[],schemaPath:[]}){var _a3;let def=schema._zod.def,seen=ctx.seen.get(schema);if(seen)return seen.count++,_params.schemaPath.includes(schema)&&(seen.cycle=_params.path),seen.schema;let result={schema:{},count:1,cycle:void 0,path:_params.path};ctx.seen.set(schema,result),ctx.sharedDefsExtractedFor=void 0,ctx.sharedEmitDoneFor=void 0;let overrideSchema=schema._zod.toJSONSchema?.();if(overrideSchema)result.schema=overrideSchema;else{let params={..._params,schemaPath:[..._params.schemaPath,schema],path:_params.path};if(schema._zod.processJSONSchema)schema._zod.processJSONSchema(ctx,result.schema,params);else{let _json=result.schema,processor=ctx.processors[def.type];if(!processor)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);processor(schema,ctx,_json,params)}let parent=schema._zod.parent;parent&&(result.ref||(result.ref=parent),processSchema(parent,ctx,params),ctx.seen.get(parent).isParent=!0)}let meta2=ctx.metadataRegistry.get(schema);return meta2&&assignProps(result.schema,meta2),ctx.io==="input"&&isTransforming(schema)&&(delete result.schema.examples,delete result.schema.default),ctx.io==="input"&&"_prefault"in result.schema&&((_a3=result.schema).default??(_a3.default=result.schema._prefault)),delete result.schema._prefault,ctx.seen.get(schema).schema}function encodeJSONPointerSegment(segment){return segment.replace(/~/g,"~0").replace(/\//g,"~1")}function extractDefs(ctx,schema){let root=ctx.seen.get(schema);if(!root)throw new Error("Unprocessed schema. This is a bug in Zod.");if(ctx.external&&ctx.sharedDefsExtractedFor===ctx.external)return;let idToSchema=new Map;for(let entry of ctx.seen.entries()){let id=ctx.metadataRegistry.get(entry[0])?.id;if(id){let existing=idToSchema.get(id);if(existing&&existing!==entry[0])throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);idToSchema.set(id,entry[0])}}let makeURI=entry=>{let defsSegment=ctx.target==="draft-2020-12"?"$defs":"definitions";if(ctx.external){let externalId=ctx.external.registry.get(entry[0])?.id,uriGenerator=ctx.external.uri??(id2=>id2);if(externalId)return{ref:uriGenerator(externalId)};let id=entry[1].defId??entry[1].schema.id??`schema${ctx.counter++}`;return entry[1].defId=id,{defId:id,ref:`${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id)}`}}let uriPrefix="#",defUriPrefix=`${uriPrefix}/${defsSegment}/`;if(entry[1]===root&&!entry[1].schema.id)return{ref:uriPrefix};let defId=entry[1].schema.id??`__schema${ctx.counter++}`;return{defId,ref:defUriPrefix+encodeJSONPointerSegment(defId)}},extractToDef=entry=>{if(entry[1].schema.$ref)return;let seen=entry[1],{ref,defId}=makeURI(entry);seen.def={...seen.schema},defId&&(seen.defId=defId);let schema2=seen.schema;for(let key in schema2)delete schema2[key];schema2.$ref=ref};if(ctx.cycles==="throw")for(let entry of ctx.seen.entries()){let seen=entry[1];if(seen.cycle)throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
|
|
56
|
+
|
|
57
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let entry of ctx.seen.entries()){let seen=entry[1];if(schema===entry[0]){extractToDef(entry);continue}if(ctx.external){let ext=ctx.external.registry.get(entry[0])?.id;if(schema!==entry[0]&&ext){extractToDef(entry);continue}}if(ctx.metadataRegistry.get(entry[0])?.id){extractToDef(entry);continue}if(seen.cycle){extractToDef(entry);continue}seen.count>1&&ctx.reused==="ref"&&extractToDef(entry)}ctx.external&&(ctx.sharedDefsExtractedFor=ctx.external)}function compactTypeUnion(schema){let options=schema.anyOf;if(!Array.isArray(options)||options.length===0||schema.type!==void 0)return;let types=[];for(let option of options){if(!option||typeof option!="object")return;compactTypeUnion(option);let keys=Object.keys(option);if(keys.length!==1||keys[0]!=="type")return;let type=option.type;for(let member of Array.isArray(type)?type:[type]){if(typeof member!="string")return;types.includes(member)||types.push(member)}}delete schema.anyOf,schema.type=types.length===1?types[0]:types}var FOLDABLE_KEYS=new Set(["type","properties","required","additionalProperties"]),UNION_KEYS=["oneOf","anyOf"];function undeclaredConstraint(member){let extra=member.additionalProperties;return extra===void 0||extra===!1||typeof extra!="object"||extra===null?null:Object.keys(extra).length?extra:null}function foldObjects(members2){let objects=[];for(let member of members2){if(typeof member!="object"||member.type!=="object")return null;for(let key in member)if(!FOLDABLE_KEYS.has(key))return null;objects.push(member)}let properties={},required2=new Set;for(let object2 of objects){for(let key in object2.properties){if(Object.prototype.hasOwnProperty.call(properties,key))continue;let parts=[];for(let other of objects){let part=other.properties?.[key]??undeclaredConstraint(other);part!=null&&(parts.some(seen=>JSON.stringify(seen)===JSON.stringify(part))||parts.push(part))}let merged=parts.length===1?parts[0]:foldObjects(parts)??{allOf:parts};assignProp(properties,key,merged)}for(let key of object2.required??[])required2.add(key)}let folded={type:"object",properties};if(required2.size&&(folded.required=[...required2]),objects.every(object2=>object2.additionalProperties===!1))folded.additionalProperties=!1;else{let constraints=[];for(let object2 of objects){let constraint=undeclaredConstraint(object2);constraint&&!constraints.some(seen=>JSON.stringify(seen)===JSON.stringify(constraint))&&constraints.push(constraint)}constraints.length===1?folded.additionalProperties=constraints[0]:constraints.length>1&&(folded.additionalProperties={allOf:constraints})}return folded}function foldIntersection(json){let allOf=json.allOf;if(!Array.isArray(allOf)||allOf.length<2)return;for(let key of FOLDABLE_KEYS)if(key in json)return;let unions=allOf.filter(m=>UNION_KEYS.some(k=>Array.isArray(m[k]))),folded=null;if(!unions.length)folded=foldObjects(allOf);else{let union2=unions[0],keyword=UNION_KEYS.find(k=>Array.isArray(union2[k]));if(Object.keys(union2).length!==1)return;let rest=allOf.filter(m=>m!==union2),branches=union2[keyword].map(branch=>foldObjects([...rest,branch]));if(branches.some(b=>!b))return;folded={[keyword]:branches}}folded&&(delete json.allOf,assignProps(json,folded))}function finalize(ctx,schema){let root=ctx.seen.get(schema);if(!root)throw new Error("Unprocessed schema. This is a bug in Zod.");let flattenRef=zodSchema=>{let seen=ctx.seen.get(zodSchema);if(seen.ref===null)return;let schema2=seen.def??seen.schema,_cached={...schema2},ref=seen.ref;if(seen.ref=null,ref){flattenRef(ref);let refSeen=ctx.seen.get(ref),refSchema=refSeen.schema;if(refSchema.$ref&&(ctx.target==="draft-07"||ctx.target==="draft-04"||ctx.target==="openapi-3.0")?(schema2.allOf=schema2.allOf??[],schema2.allOf.push(refSchema)):assignProps(schema2,refSchema),assignProps(schema2,_cached),zodSchema._zod.parent===ref)for(let key in schema2)key==="$ref"||key==="allOf"||key in _cached||delete schema2[key];if(refSchema.$ref&&refSeen.def)for(let key in schema2)key==="$ref"||key==="allOf"||key in refSeen.def&&JSON.stringify(schema2[key])===JSON.stringify(refSeen.def[key])&&delete schema2[key]}let parent=zodSchema._zod.parent;if(parent&&parent!==ref){flattenRef(parent);let parentSeen=ctx.seen.get(parent);if(parentSeen?.schema.$ref&&(schema2.$ref=parentSeen.schema.$ref,parentSeen.def))for(let key in schema2)key==="$ref"||key==="allOf"||key in parentSeen.def&&JSON.stringify(schema2[key])===JSON.stringify(parentSeen.def[key])&&delete schema2[key]}ctx.override({zodSchema,jsonSchema:schema2,path:seen.path??[]})};if(!ctx.external||ctx.sharedEmitDoneFor!==ctx.external){for(let entry of[...ctx.seen.entries()].reverse())flattenRef(entry[0]);if(ctx.target!=="openapi-3.0")for(let entry of ctx.seen.entries())compactTypeUnion(entry[1].def??entry[1].schema);for(let rewrite of ctx.deferred)rewrite();if(ctx.intersections.length){let carriers=new Map;for(let seen of ctx.seen.values())for(let json of[seen.schema,seen.def]){let allOf=json?.allOf;if(!Array.isArray(allOf))continue;let existing=carriers.get(allOf);existing?existing.push(json):carriers.set(allOf,[json])}for(let allOf of ctx.intersections)for(let json of carriers.get(allOf)??[])foldIntersection(json)}}let result={};if(ctx.target==="draft-2020-12"?result.$schema="https://json-schema.org/draft/2020-12/schema":ctx.target==="draft-07"?result.$schema="http://json-schema.org/draft-07/schema#":ctx.target==="draft-04"?result.$schema="http://json-schema.org/draft-04/schema#":ctx.target,ctx.external?.uri){let id=ctx.external.registry.get(schema)?.id;if(!id)throw new Error("Schema is missing an `id` property");result.$id=ctx.external.uri(id)}assignProps(result,root.defId?root.schema:root.def??root.schema);let rootMetaId=ctx.metadataRegistry.get(schema)?.id;rootMetaId!==void 0&&result.id===rootMetaId&&delete result.id;let defs=ctx.external?.defs??{};if(!ctx.external||ctx.sharedEmitDoneFor!==ctx.external)for(let entry of ctx.seen.entries()){let seen=entry[1];seen.def&&seen.defId&&(seen.def.id===seen.defId&&delete seen.def.id,assignProp(defs,seen.defId,seen.def))}ctx.external&&(ctx.sharedEmitDoneFor=ctx.external),ctx.external||Object.keys(defs).length>0&&(ctx.target==="draft-2020-12"?result.$defs=defs:result.definitions=defs);try{let finalized=JSON.parse(JSON.stringify(result));return Object.defineProperty(finalized,"~standard",{value:{...schema["~standard"],jsonSchema:{input:createStandardJSONSchemaMethod(schema,"input",ctx.processors),output:createStandardJSONSchemaMethod(schema,"output",ctx.processors)}},enumerable:!1,writable:!1}),finalized}catch{throw new Error("Error converting schema to JSON.")}}function isTransforming(_schema,_ctx){let ctx=_ctx??{seen:new Set};if(ctx.seen.has(_schema))return!1;ctx.seen.add(_schema);let def=_schema._zod.def;if(def.type==="transform")return!0;if(def.type==="array")return isTransforming(def.element,ctx);if(def.type==="set")return isTransforming(def.valueType,ctx);if(def.type==="lazy")return isTransforming(def.getter(),ctx);if(def.type==="promise"||def.type==="optional"||def.type==="nonoptional"||def.type==="nullable"||def.type==="readonly"||def.type==="default"||def.type==="prefault"||def.type==="catch")return isTransforming(def.innerType,ctx);if(def.type==="intersection")return isTransforming(def.left,ctx)||isTransforming(def.right,ctx);if(def.type==="record"||def.type==="map")return isTransforming(def.keyType,ctx)||isTransforming(def.valueType,ctx);if(def.type==="pipe")return _schema._zod.traits.has("$ZodCodec")?!0:isTransforming(def.in,ctx)||isTransforming(def.out,ctx);if(def.type==="object"){for(let key in def.shape)if(isTransforming(def.shape[key],ctx))return!0;return!1}if(def.type==="union"){for(let option of def.options)if(isTransforming(option,ctx))return!0;return!1}if(def.type==="tuple"){for(let item of def.items)if(isTransforming(item,ctx))return!0;return!!(def.rest&&isTransforming(def.rest,ctx))}return!1}var createToJSONSchemaMethod=(schema,processors={})=>params=>{let ctx=initializeContext({...params,processors});return processSchema(schema,ctx),extractDefs(ctx,schema),finalize(ctx,schema)},createStandardJSONSchemaMethod=(schema,io,processors={})=>params=>{let{libraryOptions,target}=params??{},ctx=initializeContext({...libraryOptions??{},target,io,processors});return processSchema(schema,ctx),extractDefs(ctx,schema),finalize(ctx,schema)};var narrowMin=(agg,key,value)=>{(agg[key]===void 0||value>agg[key])&&(agg[key]=value)},narrowMax=(agg,key,value)=>{(agg[key]===void 0||value<agg[key])&&(agg[key]=value)},narrowBoth=(agg,value)=>{narrowMin(agg,"minimum",value),narrowMax(agg,"maximum",value)},addDivisor=(agg,value)=>{agg.multipleOf??(agg.multipleOf=[]),agg.multipleOf.includes(value)||agg.multipleOf.push(value)},addPattern=(agg,pattern)=>{agg.patterns??(agg.patterns=new Set),agg.patterns.add(pattern)},intersectMime=(agg,mime)=>{agg.mime=agg.mime?agg.mime.filter(m=>mime.includes(m)):[...mime]},setFormat=(agg,format)=>{agg.format=format,format.includes("int")&&(agg.isInt=!0)},minContributor=(agg,def)=>narrowMin(agg,"minimum",def.minimum),maxContributor=(agg,def)=>narrowMax(agg,"maximum",def.maximum),formatContributor=ranges=>(agg,def)=>{setFormat(agg,def.format);let[minimum,maximum]=ranges[def.format];narrowMin(agg,"minimum",minimum),narrowMax(agg,"maximum",maximum)},contributors={greater_than:(agg,def)=>narrowMin(agg,def.inclusive?"minimum":"exclusiveMinimum",def.value),less_than:(agg,def)=>narrowMax(agg,def.inclusive?"maximum":"exclusiveMaximum",def.value),multiple_of:(agg,def)=>addDivisor(agg,def.value),number_format:formatContributor(NUMBER_FORMAT_RANGES),bigint_format:formatContributor(BIGINT_FORMAT_RANGES),min_length:minContributor,max_length:maxContributor,length_equals:(agg,def)=>narrowBoth(agg,def.length),min_size:minContributor,max_size:maxContributor,size_equals:(agg,def)=>narrowBoth(agg,def.size),string_format:(agg,def)=>{setFormat(agg,def.format),def.pattern&&addPattern(agg,def.pattern),(def.format==="base64"||def.format==="base64url")&&(agg.contentEncoding=def.format),(def.local||def.precision===-1)&&(agg.laxFormat=!0)},mime_type:(agg,def)=>intersectMime(agg,def.mime)};function aggregateChecks(schema){let agg={},def=schema._zod.def,list=schema._zod.traits.has("$ZodCheck")?[schema,...def.checks??[]]:def.checks??[];for(let ch of list)contributors[ch._zod.def.check]?.(agg,ch._zod.def);let bag=schema._zod.bag;bag.minimum!==void 0&&narrowMin(agg,"minimum",bag.minimum),bag.exclusiveMinimum!==void 0&&narrowMin(agg,"exclusiveMinimum",bag.exclusiveMinimum),bag.maximum!==void 0&&narrowMax(agg,"maximum",bag.maximum),bag.exclusiveMaximum!==void 0&&narrowMax(agg,"exclusiveMaximum",bag.exclusiveMaximum),bag.multipleOf!==void 0&&addDivisor(agg,bag.multipleOf),bag.format!==void 0&&(agg.format??(agg.format=bag.format),bag.format.includes("int")&&(agg.isInt=!0)),bag.mime&&intersectMime(agg,bag.mime);for(let pattern of bag.patterns??[])addPattern(agg,pattern);return agg}var formatMap={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},exactPatterns=new Map([[base64Charset,base64],[base64urlCharset,base64url]]),exactPattern=p=>exactPatterns.get(p)??p,stringProcessor=(schema,ctx,_json,_params)=>{let json=_json;json.type="string";let{minimum,maximum,format,patterns,contentEncoding,laxFormat}=aggregateChecks(schema);if(typeof minimum=="number"&&(json.minLength=minimum),typeof maximum=="number"&&(json.maxLength=maximum),format&&(json.format=formatMap[format]??format,json.format===""&&delete json.format,(format==="time"||laxFormat)&&delete json.format),contentEncoding&&(json.contentEncoding=contentEncoding),patterns&&patterns.size>0){let patternList=[...patterns].map(exactPattern);patternList.length===1?json.pattern=patternList[0].source:patternList.length>1&&(json.allOf=[...patternList.map(regex=>({...ctx.target==="draft-07"||ctx.target==="draft-04"||ctx.target==="openapi-3.0"?{type:"string"}:{},pattern:regex.source}))])}},numberProcessor=(schema,ctx,_json,params)=>{let json=_json,{minimum,maximum,multipleOf,exclusiveMaximum,exclusiveMinimum,isInt}=aggregateChecks(schema);json.type=isInt?"integer":"number";let exMin=typeof exclusiveMinimum=="number"&&exclusiveMinimum>=(minimum??Number.NEGATIVE_INFINITY),exMax=typeof exclusiveMaximum=="number"&&exclusiveMaximum<=(maximum??Number.POSITIVE_INFINITY),legacy=ctx.target==="draft-04"||ctx.target==="openapi-3.0";if(exMin?legacy?(json.minimum=exclusiveMinimum,json.exclusiveMinimum=!0):json.exclusiveMinimum=exclusiveMinimum:typeof minimum=="number"&&(json.minimum=minimum),exMax?legacy?(json.maximum=exclusiveMaximum,json.exclusiveMaximum=!0):json.exclusiveMaximum=exclusiveMaximum:typeof maximum=="number"&&(json.maximum=maximum),multipleOf){let divisors=new Set;for(let divisor of multipleOf)Number.isFinite(divisor)&&divisor!==0?divisors.add(Math.abs(divisor)):handleUnrepresentable(schema,ctx,json,params,`A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);let[first,...rest]=divisors;first!==void 0&&(json.multipleOf=first),rest.length&&(json.allOf=[...json.allOf??[],...rest.map(m=>({multipleOf:m}))])}},booleanProcessor=(_schema,_ctx,json,_params)=>{json.type="boolean"};var neverProcessor=(_schema,_ctx,json,_params)=>{json.not={}};var unknownProcessor=(_schema,_ctx,_json,_params)=>{};var enumProcessor=(schema,_ctx,json,_params)=>{let def=schema._zod.def,values=getEnumValues(def.entries);if(values.length===0){json.not={};return}values.every(v=>typeof v=="number")&&(json.type="number"),values.every(v=>typeof v=="string")&&(json.type="string"),json.enum=values},literalProcessor=(schema,ctx,json,params)=>{let def=schema._zod.def;if(def.values.length===0){json.not={};return}let vals=[];for(let val of def.values)if(val===void 0){if(handleUnrepresentable(schema,ctx,json,params,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof val=="bigint"){if(handleUnrepresentable(schema,ctx,json,params,"BigInt literals cannot be represented in JSON Schema"))return;vals.push(Number(val))}else vals.push(val);if(vals.length!==0)if(vals.length===1){let val=vals[0];json.type=val===null?"null":typeof val,ctx.target==="draft-04"||ctx.target==="openapi-3.0"?json.enum=[val]:json.const=val}else vals.every(v=>typeof v=="number")&&(json.type="number"),vals.every(v=>typeof v=="string")&&(json.type="string"),vals.every(v=>typeof v=="boolean")&&(json.type="boolean"),vals.every(v=>v===null)&&(json.type="null"),json.enum=vals};var customProcessor=(schema,ctx,json,params)=>{handleUnrepresentable(schema,ctx,json,params,"Custom types cannot be represented in JSON Schema")};var transformProcessor=(schema,ctx,json,params)=>{handleUnrepresentable(schema,ctx,json,params,"Transforms cannot be represented in JSON Schema")};var arrayProcessor=(schema,ctx,_json,params)=>{let json=_json,def=schema._zod.def,{minimum,maximum}=aggregateChecks(schema);typeof minimum=="number"&&(json.minItems=minimum),typeof maximum=="number"&&(json.maxItems=maximum),json.type="array",json.items=processSchema(def.element,ctx,{...params,path:[...params.path,"items"]})};function inputOptin(schema){let def=schema._zod.def;return def.type==="pipe"&&def.in._zod.traits.has("$ZodTransform")?inputOptin(def.out):def.type==="catch"?inputOptin(def.innerType):schema._zod.optin}var objectProcessor=(schema,ctx,_json,params)=>{let json=_json,def=schema._zod.def,shape=def.shape;if(Object.getOwnPropertySymbols(shape).length&&handleUnrepresentable(schema,ctx,json,params,"Symbol keys cannot be represented in JSON Schema"))return;json.type="object",json.properties={};for(let key in shape)assignProp(json.properties,key,processSchema(shape[key],ctx,{...params,path:[...params.path,"properties",key]}));let requiredKeys=[];for(let key of Object.keys(shape)){let field=def.shape[key];(ctx.io==="input"?inputOptin(field)===void 0:field._zod.optout===void 0)&&requiredKeys.push(key)}requiredKeys.length>0&&(json.required=requiredKeys),def.catchall?._zod.def.type==="never"?json.additionalProperties=!1:def.catchall?def.catchall&&(json.additionalProperties=processSchema(def.catchall,ctx,{...params,path:[...params.path,"additionalProperties"]})):ctx.io==="output"&&(json.additionalProperties=!1)},unionProcessor=(schema,ctx,json,params)=>{let def=schema._zod.def,isExclusive=def.inclusive===!1,options=def.options.map((x,i)=>processSchema(x,ctx,{...params,path:[...params.path,isExclusive?"oneOf":"anyOf",i]}));isExclusive?json.oneOf=options:json.anyOf=options},intersectionProcessor=(schema,ctx,json,params)=>{let def=schema._zod.def,a=processSchema(def.left,ctx,{...params,path:[...params.path,"allOf",0]}),b=processSchema(def.right,ctx,{...params,path:[...params.path,"allOf",1]}),isSimpleIntersection=val=>"allOf"in val&&Object.keys(val).length===1,allOf=[...isSimpleIntersection(a)?a.allOf:[a],...isSimpleIntersection(b)?b.allOf:[b]];json.allOf=allOf,ctx.intersections.push(allOf)};var nullableProcessor=(schema,ctx,json,params)=>{let def=schema._zod.def,inner=processSchema(def.innerType,ctx,params),seen=ctx.seen.get(schema);ctx.target==="openapi-3.0"?(seen.ref=def.innerType,json.nullable=!0):json.anyOf=[inner,{type:"null"}]},nonoptionalProcessor=(schema,ctx,_json,params)=>{let def=schema._zod.def;processSchema(def.innerType,ctx,params);let seen=ctx.seen.get(schema);seen.ref=def.innerType},UNREPRESENTABLE_DEFAULT=Symbol();function serializeDefaultValue(value,schema,ctx,json,params){let unrepresentable=!1,serialized=JSON.stringify(value,(_,val)=>typeof val!="bigint"?val:(unrepresentable=!0,null));return unrepresentable?(handleUnrepresentable(schema,ctx,json,params,"BigInt defaults cannot be represented in JSON Schema"),UNREPRESENTABLE_DEFAULT):JSON.parse(serialized)}var defaultProcessor=(schema,ctx,json,params)=>{let def=schema._zod.def;processSchema(def.innerType,ctx,params);let seen=ctx.seen.get(schema);seen.ref=def.innerType;let value=serializeDefaultValue(def.defaultValue,schema,ctx,json,params);value!==UNREPRESENTABLE_DEFAULT&&(json.default=value)},prefaultProcessor=(schema,ctx,json,params)=>{let def=schema._zod.def;processSchema(def.innerType,ctx,params);let seen=ctx.seen.get(schema);if(seen.ref=def.innerType,ctx.io!=="input")return;let value=serializeDefaultValue(def.defaultValue,schema,ctx,json,params);value!==UNREPRESENTABLE_DEFAULT&&(json._prefault=value)},catchProcessor=(schema,ctx,json,params)=>{let def=schema._zod.def;processSchema(def.innerType,ctx,params);let seen=ctx.seen.get(schema);seen.ref=def.innerType;let catchValue;try{catchValue=def.catchValue(void 0)}catch{handleUnrepresentable(schema,ctx,json,params,"Dynamic catch values are not supported in JSON Schema");return}json.default=catchValue},pipeProcessor=(schema,ctx,_json,params)=>{let def=schema._zod.def,inIsTransform=def.in._zod.traits.has("$ZodTransform"),innerType=ctx.io==="input"?inIsTransform?def.out:def.in:def.out;processSchema(innerType,ctx,params);let seen=ctx.seen.get(schema);seen.ref=innerType},readonlyProcessor=(schema,ctx,json,params)=>{let def=schema._zod.def;processSchema(def.innerType,ctx,params);let seen=ctx.seen.get(schema);seen.ref=def.innerType,json.readOnly=!0};var optionalProcessor=(schema,ctx,_json,params)=>{let def=schema._zod.def;processSchema(def.innerType,ctx,params);let seen=ctx.seen.get(schema);seen.ref=def.innerType};var _installedErrorProtos=new WeakSet([Object.prototype,Error.prototype]);function _lazyMethod(proto,key,make){Object.defineProperty(proto,key,{configurable:!0,enumerable:!1,get(){let value=make(this);return Object.defineProperty(this,key,{value,configurable:!0,writable:!0}),value},set(value){Object.defineProperty(this,key,{value,configurable:!0,writable:!0})}})}var initializer2=(inst,issues)=>{$ZodError.init(inst,issues),inst.name="ZodError";let proto=Object.getPrototypeOf(inst);_installedErrorProtos.has(proto)||(_installedErrorProtos.add(proto),_lazyMethod(proto,"format",self=>mapper=>formatError(self,mapper)),_lazyMethod(proto,"flatten",self=>mapper=>flattenError(self,mapper)),_lazyMethod(proto,"addIssue",self=>issue2=>{self.issues.push(issue2),self.message=JSON.stringify(self.issues,jsonStringifyReplacer,2)}),_lazyMethod(proto,"addIssues",self=>issues2=>{self.issues.push(...issues2),self.message=JSON.stringify(self.issues,jsonStringifyReplacer,2)}),Object.defineProperty(proto,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},ZodError=$constructor("ZodError",initializer2),ZodRealError=$constructor("ZodError",initializer2,void 0,{Parent:Error});var parse=_parse(ZodRealError),parseAsync=_parseAsync(ZodRealError),safeParse=_safeParse(ZodRealError),safeParseAsync=_safeParseAsync(ZodRealError),encode=_encode(ZodRealError),decode=_decode(ZodRealError),encodeAsync=_encodeAsync(ZodRealError),decodeAsync=_decodeAsync(ZodRealError),safeEncode=_safeEncode(ZodRealError),safeDecode=_safeDecode(ZodRealError),safeEncodeAsync=_safeEncodeAsync(ZodRealError),safeDecodeAsync=_safeDecodeAsync(ZodRealError);function _ensureDefaultLocale(){globalConfig.localeError||config(en_default())}function _ensureDefaultMemoizer(){globalConfig.memoizer||config({memoizer:memoizer()})}var ZodType=$constructor("ZodType",(inst,def)=>(_ensureDefaultLocale(),$ZodType.init(inst,def),inst.def=def,inst.type=def.type,inst),{check(...chks){let def=this.def;return this.clone(util_exports.mergeDefs(def,{checks:[...def.checks??[],...chks.map(ch=>typeof ch=="function"?{_zod:{check:ch,def:{check:"custom"},onattach:[]}}:ch)]}),{parent:!0})},with(...chks){return this.check(...chks)},clone(def,params){return clone(this,def,params)},brand(){return this},register(reg,meta2){return reg.add(this,meta2),this},refine(check,params){return this.check(refine(check,params))},superRefine(refinement,params){return this.check(superRefine(refinement,params))},overwrite(fn){return this.check(_overwrite(fn))},optional(){return optional(this)},exactOptional(){return exactOptional(this)},nullable(){return nullable(this)},nullish(){return optional(nullable(this))},nonoptional(params){return nonoptional(this,params)},array(){return array(this)},or(arg){return union([this,arg])},and(arg){return intersection(this,arg)},transform(tx){return pipe(this,transform(tx))},default(d){return _default(this,d)},prefault(d){return prefault(this,d)},catch(params){return _catch(this,params)},pipe(target){return pipe(this,target)},readonly(){return readonly(this)},describe(description){let cl=this.clone();return globalRegistry.add(cl,{description}),cl},meta(...args){if(args.length===0)return globalRegistry.get(this);let cl=this.clone();return globalRegistry.add(cl,args[0]),cl},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(fn,...args){return args.length===0?fn(this):fn(this,...args)},get"~standard"(){return util_exports.hide(this,"~standard",{...standardProps(this),jsonSchema:{input:createStandardJSONSchemaMethod(this,"input"),output:createStandardJSONSchemaMethod(this,"output")}})},set"~standard"(value){util_exports.own(this,"~standard",value)},parse:function _parse2(data,params){return parse(this,data,params,{callee:_parse2})},parseAsync:async function _parseAsync2(data,params){return await parseAsync(this,data,params,{callee:_parseAsync2})},safeParse(data,params){return safeParse(this,data,params)},async safeParseAsync(data,params){return safeParseAsync(this,data,params)},get spa(){return this?.safeParseAsync},set spa(value){util_exports.own(this,"spa",value)},validate(data,params){return validate(this,data,params)},validateAsync(data,params){return validateAsync(this,data,params)},encode:function _encode2(data,params){return encode(this,data,params,{callee:_encode2})},decode:function _decode2(data,params){return decode(this,data,params,{callee:_decode2})},encodeAsync:async function _encodeAsync2(data,params){return await encodeAsync(this,data,params,{callee:_encodeAsync2})},decodeAsync:async function _decodeAsync2(data,params){return await decodeAsync(this,data,params,{callee:_decodeAsync2})},safeEncode(data,params){return safeEncode(this,data,params)},safeDecode(data,params){return safeDecode(this,data,params)},async safeEncodeAsync(data,params){return safeEncodeAsync(this,data,params)},async safeDecodeAsync(data,params){return safeDecodeAsync(this,data,params)},toJSONSchema(params){return createToJSONSchemaMethod(this,{})(params)},get description(){return globalRegistry.get(this)?.description},get _def(){return this._zod.def}}),_ZodString=$constructor("_ZodString",(inst,def)=>{$ZodString.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>stringProcessor(inst,ctx,json,params)},util_exports.derived({format:inst=>aggregateChecks(inst).format??null,minLength:inst=>aggregateChecks(inst).minimum??null,maxLength:inst=>aggregateChecks(inst).maximum??null},{regex(...args){return this.check(_regex(...args))},includes(...args){return this.check(_includes(...args))},startsWith(...args){return this.check(_startsWith(...args))},endsWith(...args){return this.check(_endsWith(...args))},min(...args){return this.check(_minLength(...args))},max(...args){return this.check(_maxLength(...args))},length(...args){return this.check(_length(...args))},nonempty(...args){return this.check(_minLength(1,...args))},lowercase(params){return this.check(_lowercase(params))},uppercase(params){return this.check(_uppercase(params))},trim(){return this.check(_trim())},normalize(...args){return this.check(_normalize(...args))},toLowerCase(){return this.check(_toLowerCase())},toUpperCase(){return this.check(_toUpperCase())},slugify(){return this.check(_slugify())}})),ZodString=$constructor("ZodString",(inst,def)=>{$ZodString.init(inst,def),_ZodString.init(inst,def)},{email(params){return this.check(_email(ZodEmail,params))},url(params){return this.check(_url(ZodURL,params))},jwt(params){return this.check(_jwt(ZodJWT,params))},emoji(params){return this.check(_emoji2(ZodEmoji,params))},guid(params){return this.check(_guid(ZodGUID,params))},uuid(params){return this.check(_uuid(ZodUUID,params))},uuidv4(params){return this.check(_uuidv4(ZodUUID,params))},uuidv6(params){return this.check(_uuidv6(ZodUUID,params))},uuidv7(params){return this.check(_uuidv7(ZodUUID,params))},nanoid(params){return this.check(_nanoid(ZodNanoID,params))},cuid(params){return this.check(_cuid(ZodCUID,params))},cuid2(params){return this.check(_cuid2(ZodCUID2,params))},ulid(params){return this.check(_ulid(ZodULID,params))},base64(params){return this.check(_base64(ZodBase64,params))},base64url(params){return this.check(_base64url(ZodBase64URL,params))},xid(params){return this.check(_xid(ZodXID,params))},ksuid(params){return this.check(_ksuid(ZodKSUID,params))},ipv4(params){return this.check(_ipv4(ZodIPv4,params))},ipv6(params){return this.check(_ipv6(ZodIPv6,params))},cidrv4(params){return this.check(_cidrv4(ZodCIDRv4,params))},cidrv6(params){return this.check(_cidrv6(ZodCIDRv6,params))},e164(params){return this.check(_e164(ZodE164,params))},datetime(params){return this.check(_isoDateTime(ZodISODateTime,params))},date(params){return this.check(_isoDate(ZodISODate,params))},time(params){return this.check(_isoTime(ZodISOTime,params))},duration(params){return this.check(_isoDuration(ZodISODuration,params))}});function string2(params){return _string(ZodString,params)}var ZodStringFormat=$constructor("ZodStringFormat",(inst,def)=>{$ZodStringFormat.init(inst,def),_ZodString.init(inst,def)}),ZodISODateTime=$constructor("ZodISODateTime",(inst,def)=>{$ZodISODateTime.init(inst,def),ZodStringFormat.init(inst,def)}),ZodISODate=$constructor("ZodISODate",(inst,def)=>{$ZodISODate.init(inst,def),ZodStringFormat.init(inst,def)}),ZodISOTime=$constructor("ZodISOTime",(inst,def)=>{$ZodISOTime.init(inst,def),ZodStringFormat.init(inst,def)}),ZodISODuration=$constructor("ZodISODuration",(inst,def)=>{$ZodISODuration.init(inst,def),ZodStringFormat.init(inst,def)}),ZodEmail=$constructor("ZodEmail",(inst,def)=>{$ZodEmail.init(inst,def),ZodStringFormat.init(inst,def)});var ZodGUID=$constructor("ZodGUID",(inst,def)=>{$ZodGUID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodUUID=$constructor("ZodUUID",(inst,def)=>{$ZodUUID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodURL=$constructor("ZodURL",(inst,def)=>{$ZodURL.init(inst,def),ZodStringFormat.init(inst,def)});var ZodEmoji=$constructor("ZodEmoji",(inst,def)=>{$ZodEmoji.init(inst,def),ZodStringFormat.init(inst,def)});var ZodNanoID=$constructor("ZodNanoID",(inst,def)=>{$ZodNanoID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodCUID=$constructor("ZodCUID",(inst,def)=>{$ZodCUID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodCUID2=$constructor("ZodCUID2",(inst,def)=>{$ZodCUID2.init(inst,def),ZodStringFormat.init(inst,def)});var ZodULID=$constructor("ZodULID",(inst,def)=>{$ZodULID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodXID=$constructor("ZodXID",(inst,def)=>{$ZodXID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodKSUID=$constructor("ZodKSUID",(inst,def)=>{$ZodKSUID.init(inst,def),ZodStringFormat.init(inst,def)});var ZodIPv4=$constructor("ZodIPv4",(inst,def)=>{$ZodIPv4.init(inst,def),ZodStringFormat.init(inst,def)});var ZodIPv6=$constructor("ZodIPv6",(inst,def)=>{$ZodIPv6.init(inst,def),ZodStringFormat.init(inst,def)});var ZodCIDRv4=$constructor("ZodCIDRv4",(inst,def)=>{$ZodCIDRv4.init(inst,def),ZodStringFormat.init(inst,def)});var ZodCIDRv6=$constructor("ZodCIDRv6",(inst,def)=>{$ZodCIDRv6.init(inst,def),ZodStringFormat.init(inst,def)});var ZodBase64=$constructor("ZodBase64",(inst,def)=>{$ZodBase64.init(inst,def),ZodStringFormat.init(inst,def)});var ZodBase64URL=$constructor("ZodBase64URL",(inst,def)=>{$ZodBase64URL.init(inst,def),ZodStringFormat.init(inst,def)});var ZodE164=$constructor("ZodE164",(inst,def)=>{$ZodE164.init(inst,def),ZodStringFormat.init(inst,def)});var ZodJWT=$constructor("ZodJWT",(inst,def)=>{$ZodJWT.init(inst,def),ZodStringFormat.init(inst,def)});var ZodNumber=$constructor("ZodNumber",(inst,def)=>{$ZodNumber.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>numberProcessor(inst,ctx,json,params),inst.isFinite=!0},util_exports.derived({minValue:inst=>{let{minimum,exclusiveMinimum}=aggregateChecks(inst);return Math.max(minimum??Number.NEGATIVE_INFINITY,exclusiveMinimum??Number.NEGATIVE_INFINITY)},maxValue:inst=>{let{maximum,exclusiveMaximum}=aggregateChecks(inst);return Math.min(maximum??Number.POSITIVE_INFINITY,exclusiveMaximum??Number.POSITIVE_INFINITY)},isInt:inst=>{let{isInt,multipleOf}=aggregateChecks(inst);return!!isInt||!!multipleOf?.some(Number.isSafeInteger)},format:inst=>aggregateChecks(inst).format??null},{gt(value,params){return this.check(_gt(value,params))},gte(value,params){return this.check(_gte(value,params))},min(value,params){return this.check(_gte(value,params))},lt(value,params){return this.check(_lt(value,params))},lte(value,params){return this.check(_lte(value,params))},max(value,params){return this.check(_lte(value,params))},int(params){return this.check(int(params))},safe(params){return this.check(int(params))},positive(params){return this.check(_gt(0,params))},nonnegative(params){return this.check(_gte(0,params))},negative(params){return this.check(_lt(0,params))},nonpositive(params){return this.check(_lte(0,params))},multipleOf(value,params){return this.check(_multipleOf(value,params))},step(value,params){return this.check(_multipleOf(value,params))},finite(){return this}}));function number2(params){return _number(ZodNumber,params)}var ZodNumberFormat=$constructor("ZodNumberFormat",(inst,def)=>{$ZodNumberFormat.init(inst,def),ZodNumber.init(inst,def)});function int(params){return _int(ZodNumberFormat,params)}var ZodBoolean=$constructor("ZodBoolean",(inst,def)=>{$ZodBoolean.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>booleanProcessor(inst,ctx,json,params)});function boolean2(params){return _boolean(ZodBoolean,params)}var ZodUnknown=$constructor("ZodUnknown",(inst,def)=>{$ZodUnknown.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>unknownProcessor(inst,ctx,json,params)});function unknown(){return _unknown(ZodUnknown)}var ZodNever=$constructor("ZodNever",(inst,def)=>{$ZodNever.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>neverProcessor(inst,ctx,json,params)});function never(params){return _never(ZodNever,params)}var ZodArray=$constructor("ZodArray",(inst,def)=>{_ensureDefaultMemoizer(),$ZodArray.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>arrayProcessor(inst,ctx,json,params),inst.element=def.element},{min(n,params){return this.check(_minLength(n,params))},nonempty(params){return this.check(_minLength(1,params))},max(n,params){return this.check(_maxLength(n,params))},length(n,params){return this.check(_length(n,params))},unwrap(){return this.element}});function array(element,params){return _array(ZodArray,element,params)}var ZodObject=$constructor("ZodObject",(inst,def)=>{_ensureDefaultMemoizer(),$ZodObjectJIT.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>objectProcessor(inst,ctx,json,params),util_exports.installLazyProp(inst,"shape",self=>self._zod.def.shape,!1)},{keyof(){return _enum(Object.keys(this._zod.def.shape))},catchall(catchall){return this.clone(util_exports.mergeDefs(this._zod.def,{catchall}))},passthrough(){return this.clone(util_exports.mergeDefs(this._zod.def,{catchall:unknown()}))},loose(){return this.clone(util_exports.mergeDefs(this._zod.def,{catchall:unknown()}))},strict(){return this.clone(util_exports.mergeDefs(this._zod.def,{catchall:never()}))},strip(){return this.clone(util_exports.mergeDefs(this._zod.def,{catchall:void 0}))},extend(incoming){return util_exports.extend(this,incoming)},safeExtend(incoming){return util_exports.safeExtend(this,incoming)},merge(other){return util_exports.merge(this,other)},pick(mask){return util_exports.pick(this,mask)},omit(mask){return util_exports.omit(this,mask)},partial(...args){return util_exports.partial(ZodOptional,this,args[0])},exactPartial(...args){return util_exports.partial(ZodExactOptional,this,args[0],"exactPartial")},required(...args){return util_exports.required(ZodNonOptional,this,args[0])}});function object(shape,params){let def={type:"object",shape:shape??{},...util_exports.normalizeParams(params)};return new ZodObject(def)}var ZodUnion=$constructor("ZodUnion",(inst,def)=>{$ZodUnion.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>unionProcessor(inst,ctx,json,params),inst.options=def.options});function union(options,params){return new ZodUnion({type:"union",options,...util_exports.normalizeParams(params)})}var ZodIntersection=$constructor("ZodIntersection",(inst,def)=>{$ZodIntersection.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>intersectionProcessor(inst,ctx,json,params)});function intersection(left,right){return new ZodIntersection({type:"intersection",left,right})}var ZodEnum=$constructor("ZodEnum",(inst,def)=>{$ZodEnum.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>enumProcessor(inst,ctx,json,params),inst.enum=def.entries,inst.options=[...inst._zod.values];let keys=new Set(Object.keys(def.entries));inst.extract=(values,params)=>{let newEntries={};for(let value of values)if(keys.has(value))newEntries[value]=def.entries[value];else throw new Error(`Key ${value} not found in enum`);return new ZodEnum({...def,checks:[],...util_exports.normalizeParams(params),entries:newEntries})},inst.exclude=(values,params)=>{let newEntries={...def.entries};for(let value of values)if(keys.has(value))delete newEntries[value];else throw new Error(`Key ${value} not found in enum`);return new ZodEnum({...def,checks:[],...util_exports.normalizeParams(params),entries:newEntries})}});function _enum(values,params){let entries=Array.isArray(values)?Object.fromEntries(values.map(v=>[v,v])):values;return new ZodEnum({type:"enum",entries,...util_exports.normalizeParams(params)})}var ZodLiteral=$constructor("ZodLiteral",(inst,def)=>{$ZodLiteral.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>literalProcessor(inst,ctx,json,params),inst.values=new Set(def.values),Object.defineProperty(inst,"value",{get(){if(def.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return def.values[0]}})});function literal(value,params){return new ZodLiteral({type:"literal",values:Array.isArray(value)?value:[value],...util_exports.normalizeParams(params)})}var ZodTransform=$constructor("ZodTransform",(inst,def)=>{_ensureDefaultMemoizer(),$ZodTransform.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>transformProcessor(inst,ctx,json,params),inst._zod.parse=(payload,_ctx)=>{if(_ctx.direction==="backward")throw new $ZodEncodeError(inst.constructor.name);payload.addIssue=issue2=>{if(typeof issue2=="string")payload.issues.push(util_exports.issue(issue2,payload.value,def));else{let _issue=issue2;_issue.fatal&&(_issue.continue=!1),_issue.code??(_issue.code="custom"),"input"in _issue||(_issue.input=payload.value),_issue.inst??(_issue.inst=inst),payload.issues.push(util_exports.issue(_issue))}};let output=def.transform(payload.value,payload);return output instanceof Promise?output.then(output2=>(payload.value=output2,payload)):(payload.value=output,payload)}});function transform(fn){return new ZodTransform({type:"transform",transform:fn})}var ZodOptional=$constructor("ZodOptional",(inst,def)=>{$ZodOptional.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>optionalProcessor(inst,ctx,json,params),inst.unwrap=()=>inst._zod.def.innerType});function optional(innerType){return new ZodOptional({type:"optional",innerType})}var ZodExactOptional=$constructor("ZodExactOptional",(inst,def)=>{$ZodExactOptional.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>optionalProcessor(inst,ctx,json,params),inst.unwrap=()=>inst._zod.def.innerType});function exactOptional(innerType){return new ZodExactOptional({type:"optional",innerType})}var ZodNullable=$constructor("ZodNullable",(inst,def)=>{$ZodNullable.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>nullableProcessor(inst,ctx,json,params),inst.unwrap=()=>inst._zod.def.innerType});function nullable(innerType){return new ZodNullable({type:"nullable",innerType})}var ZodDefault=$constructor("ZodDefault",(inst,def)=>{$ZodDefault.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>defaultProcessor(inst,ctx,json,params),inst.unwrap=()=>inst._zod.def.innerType,inst.removeDefault=inst.unwrap});function _default(innerType,defaultValue){return new ZodDefault({type:"default",innerType,get defaultValue(){return typeof defaultValue=="function"?defaultValue():util_exports.shallowClone(defaultValue)}})}var ZodPrefault=$constructor("ZodPrefault",(inst,def)=>{$ZodPrefault.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>prefaultProcessor(inst,ctx,json,params),inst.unwrap=()=>inst._zod.def.innerType});function prefault(innerType,defaultValue){return new ZodPrefault({type:"prefault",innerType,get defaultValue(){return typeof defaultValue=="function"?defaultValue():util_exports.shallowClone(defaultValue)}})}var ZodNonOptional=$constructor("ZodNonOptional",(inst,def)=>{$ZodNonOptional.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>nonoptionalProcessor(inst,ctx,json,params),inst.unwrap=()=>inst._zod.def.innerType});function nonoptional(innerType,params){return new ZodNonOptional({type:"nonoptional",innerType,...util_exports.normalizeParams(params)})}var ZodCatch=$constructor("ZodCatch",(inst,def)=>{$ZodCatch.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>catchProcessor(inst,ctx,json,params),inst.unwrap=()=>inst._zod.def.innerType,inst.removeCatch=inst.unwrap});function _catch(innerType,catchValue){return new ZodCatch({type:"catch",innerType,catchValue:typeof catchValue=="function"?catchValue:util_exports.constantCatch(catchValue)})}var ZodPipe=$constructor("ZodPipe",(inst,def)=>{$ZodPipe.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>pipeProcessor(inst,ctx,json,params),inst.in=def.in,inst.out=def.out});function pipe(in_,out){return new ZodPipe({type:"pipe",in:in_,out})}var ZodReadonly=$constructor("ZodReadonly",(inst,def)=>{$ZodReadonly.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>readonlyProcessor(inst,ctx,json,params),inst.unwrap=()=>inst._zod.def.innerType});function readonly(innerType){return new ZodReadonly({type:"readonly",innerType})}var ZodCustom=$constructor("ZodCustom",(inst,def)=>{$ZodCustom.init(inst,def),ZodType.init(inst,def),inst._zod.processJSONSchema=(ctx,json,params)=>customProcessor(inst,ctx,json,params)});function refine(fn,_params={}){return _refine(ZodCustom,fn,_params)}function superRefine(fn,params){return _superRefine(fn,params)}var telemetryConfigSchema=object({enabled:boolean2().optional()}),guidanceConfigSchema=object({enabled:boolean2().optional()}),updatesConfigSchema=object({auto:boolean2().optional(),bypassMinReleaseAge:boolean2().optional()}),credStorageSchema=union([literal("auto"),literal("file"),literal("keyring")]),dpopPublicKeySchema=object({kty:literal("EC"),crv:literal("P-256"),x:string2(),y:string2()}),dpopPrivateKeySchema=dpopPublicKeySchema.and(union([object({d:string2()}),object({secureEnclave:string2(),sealed:string2()}),object({tpm:string2(),sealed:string2()}),object({tpmPublic:string2(),sealed:string2()})])),authConfigSchema=object({"// Note":string2().optional(),"// Docs":string2().optional(),skipWrite:boolean2().optional(),token:string2().optional(),userId:string2().optional(),cachedUser:object({id:string2(),username:string2()}).optional(),refreshToken:string2().optional(),expiresAt:number2().optional(),tokenSource:union([literal("flag"),literal("env")]).optional(),dpop:object({key:dpopPrivateKeySchema}).optional()}),authFileConfigSchema=authConfigSchema.omit({tokenSource:!0}),globalConfigSchema=object({"// Note":string2().optional(),"// Docs":string2().optional(),credStorage:credStorageSchema.optional(),currentTeam:string2().optional(),api:string2().optional(),telemetry:telemetryConfigSchema.optional(),guidance:guidanceConfigSchema.optional(),updates:updatesConfigSchema.optional(),useNativeBinary:boolean2().optional(),nativeBinaryAutoOptIn:boolean2().optional(),usedBefore:boolean2().optional()});function formatCredStorageError(value){return`Invalid value for \`credStorage\`: ${JSON.stringify(value)}. Expected one of: ${CRED_STORAGE_CONFIG_VALUES.map(storage=>JSON.stringify(storage)).join(", ")}.`}var telemetryConfigSchema2=telemetryConfigSchema.passthrough(),guidanceConfigSchema2=guidanceConfigSchema.passthrough(),updatesConfigSchema2=updatesConfigSchema.passthrough(),credStorageSchema2=_enum(CRED_STORAGE_CONFIG_VALUES,{error:issue2=>formatCredStorageError(issue2.input)}).optional(),globalConfigSchema2=globalConfigSchema.extend({credStorage:credStorageSchema2,telemetry:telemetryConfigSchema2.optional(),guidance:guidanceConfigSchema2.optional(),updates:updatesConfigSchema2.optional()}).passthrough(),authConfigSchema2=authConfigSchema.passthrough();var import_node_fs2=__toESM(require("fs")),import_node_path2=__toESM(require("path"));var import_node_fs=__toESM(require("fs")),import_node_path=__toESM(require("path")),import_node_os=require("os");function isReadableDirectory(targetPath){try{return import_node_fs.default.lstatSync(targetPath).isDirectory()}catch{return!1}}function getAppPaths(appName){return require_xdg_app_paths()(appName)}function getDataDirectories(appName){return getAppPaths(appName).dataDirs()}function getDataPath(){return getDataDirectories("com.vercel.cli")[0]}function getCachePath(){return getAppPaths("com.vercel.cli").cache()}function getGlobalPathConfig(){let vercelDirectories=getDataDirectories("com.vercel.cli");return[...vercelDirectories,import_node_path.default.join((0,import_node_os.homedir)(),".now"),...getDataDirectories("now")].find(configPath=>isReadableDirectory(configPath))||vercelDirectories[0]}function getConfigFilePath(configDir){return import_node_path.default.join(configDir,"config.json")}function getAuthConfigFilePath(configDir){return import_node_path.default.join(configDir,"auth.json")}function getDpopAuthConfigFilePath(configDir){return import_node_path.default.join(configDir,"credentials.json")}var DOCS_URL="https://vercel.com/docs/projects/project-configuration/global-configuration",defaultGlobalConfig={"// Note":"This is your Vercel config file. For more information see the global configuration documentation.","// Docs":`${DOCS_URL}#config.json`,usedBefore:!1};function getDefaultAuthConfig(){return{"// Note":"This is your Vercel credentials file. DO NOT SHARE!","// Docs":`${DOCS_URL}#auth.json`}}var defaultAuthConfig=getDefaultAuthConfig();function normalizeConfigError(error2){if(error2 instanceof ZodError){let credStorageIssue=error2.issues.find(issue2=>issue2.path[0]==="credStorage");if(credStorageIssue)throw new Error(credStorageIssue.message)}throw error2}function parseGlobalConfig(value){try{return globalConfigSchema2.parse(value)}catch(error2){normalizeConfigError(error2)}}function parseAuthConfig(value){return authConfigSchema2.parse(value)}function parseAuthFileConfig(value){let{tokenSource,...authConfig}=parseAuthConfig(value);return authConfig}function readJsonFileSync(filePath){let content=import_node_fs2.default.readFileSync(filePath,"utf8").replace(/^\uFEFF/,"");return JSON.parse(content)}function writeJsonFileSync(filePath,value,options={}){let directory=import_node_path2.default.dirname(filePath),tempFilePath=import_node_path2.default.join(directory,`.${import_node_path2.default.basename(filePath)}.${process.pid}.${Date.now()}.tmp`),content=`${JSON.stringify(value,null,options.indent??2)}
|
|
58
|
+
`;import_node_fs2.default.mkdirSync(directory,{recursive:!0});try{import_node_fs2.default.writeFileSync(tempFilePath,content,{encoding:"utf8",mode:options.mode}),import_node_fs2.default.renameSync(tempFilePath,filePath)}catch(error2){try{import_node_fs2.default.rmSync(tempFilePath,{force:!0})}catch{}throw error2}}function readConfigFile(configPath,schema){return schema.parse(readJsonFileSync(configPath))}function writeConfigFile(configPath,schema,config2,options){let normalizedConfig=encode(schema,config2);writeJsonFileSync(configPath,normalizedConfig,{indent:2,...options})}function readGlobalConfigFile(configPath){try{return readConfigFile(configPath,globalConfigSchema2)}catch(error2){normalizeConfigError(error2)}}function writeGlobalConfigFile(configPath,config2){writeConfigFile(configPath,globalConfigSchema2,config2)}function readAuthConfigFile(configPath){return readConfigFile(configPath,authConfigSchema2)}function readAuthFileConfig(configPath){return parseAuthFileConfig(readJsonFileSync(configPath))}function readAuthConfig(configDir){return readAuthConfigFile(getAuthConfigFilePath(configDir))}function tryReadAuthConfig(configDir){try{return readAuthConfig(configDir)}catch{return null}}function writeAuthConfigFile(configPath,authConfig){authConfig.skipWrite||writeConfigFile(configPath,authConfigSchema2,authConfig,{mode:384})}function writeAuthConfig(configDir,authConfig){writeAuthConfigFile(getAuthConfigFilePath(configDir),authConfig)}function deleteAuthConfigFile(configPath){import_node_fs2.default.rmSync(configPath,{force:!0})}function deleteAuthConfig(configDir){deleteAuthConfigFile(getAuthConfigFilePath(configDir))}var TOKEN_STORAGE_ENV="VERCEL_TOKEN_STORAGE";function isErrnoException(error2){return typeof error2=="object"&&error2!==null&&"code"in error2}function isCredStorage(value){return CRED_STORAGE_CONFIG_VALUES.includes(value)}function formatCredStorageError2(value,source){return`Invalid value for \`${source}\`: ${JSON.stringify(value)}. Expected one of: ${CRED_STORAGE_CONFIG_VALUES.map(storage=>JSON.stringify(storage)).join(", ")}.`}function parseCredStorage(value,source="credStorage"){if(!(typeof value>"u")){if(isCredStorage(value))return value;throw new Error(formatCredStorageError2(value,source))}}function authConfigHasUsableTokenData(value){if(!value||typeof value!="object")return!1;let authConfig=value;return typeof authConfig.token=="string"&&authConfig.token.length>0||typeof authConfig.refreshToken=="string"&&authConfig.refreshToken.length>0}function getLikelyAutoCredStorage(configDir){try{return authConfigHasUsableTokenData(readAuthConfigFile(getAuthConfigFilePath(configDir)))?"file":"keyring"}catch{return"keyring"}}function getLikelyConfiguredCredStorage(configDir,credStorage){return credStorage==="keyring"?"keyring":credStorage!=="auto"?DEFAULT_CRED_STORAGE:getLikelyAutoCredStorage(configDir)}function getLikelyEffectiveCredStorage(configDir){let config2={},credStorageOverride=process.env[TOKEN_STORAGE_ENV];if(typeof credStorageOverride<"u")return getLikelyConfiguredCredStorage(configDir,parseCredStorage(credStorageOverride,TOKEN_STORAGE_ENV));try{let parsed=readGlobalConfigFile(getConfigFilePath(configDir));config2={...parsed,credStorage:parseCredStorage(parsed.credStorage)}}catch(error2){if(!(isErrnoException(error2)&&error2.code==="ENOENT"))throw error2}return getLikelyConfiguredCredStorage(configDir,config2.credStorage)}0&&(module.exports={CRED_STORAGE_CONFIG_VALUES,CRED_STORAGE_VALUES,DEFAULT_CRED_STORAGE,authConfigHasUsableTokenData,authConfigSchema,credStorageSchema,defaultAuthConfig,defaultGlobalConfig,deleteAuthConfig,deleteAuthConfigFile,getAuthConfigFilePath,getCachePath,getConfigFilePath,getDataPath,getDefaultAuthConfig,getDpopAuthConfigFilePath,getGlobalPathConfig,getLikelyEffectiveCredStorage,globalConfigSchema,guidanceConfigSchema,parseAuthConfig,parseAuthFileConfig,parseGlobalConfig,readAuthConfig,readAuthConfigFile,readAuthFileConfig,readConfigFile,readGlobalConfigFile,telemetryConfigSchema,tryReadAuthConfig,updatesConfigSchema,writeAuthConfig,writeAuthConfigFile,writeConfigFile,writeGlobalConfigFile});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/cli-config",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6-snapshot-b8e5bb846796",
|
|
4
4
|
"description": "Shared core utilities for Vercel global configuration",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://vercel.com/docs/projects/project-configuration/global-configuration",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"zod": "4.
|
|
23
|
+
"zod": "^4.6.6",
|
|
24
24
|
"xdg-app-paths": "5"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|