@vee_stack/cli 6.3.20 → 6.3.22
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 +8 -8
- package/dist/version.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {createRequire}from'module';import Go,{config}from'dotenv';import*as rt from'path';import {dirname,join,resolve,basename}from'path';import {fileURLToPath}from'url';import*as ie from'fs';import {existsSync,readFileSync,statSync,writeFileSync}from'fs';import v from'chalk';import {Command}from'commander';import {execSync}from'child_process';import*as ge from'crypto';import ge__default from'crypto';import gi from'ora';import {glob}from'glob';import hi from'cli-progress';import*as gt from'os';import {homedir}from'os';import*as V from'fs/promises';import Cr from'prompts';import Pi from'readline';import {gzipSync}from'zlib';import Mi from'open';import Fa from'omelette';globalThis.require = createRequire(import.meta.url); globalThis.CLI_VERSION = "6.3.
|
|
2
|
+
import {createRequire}from'module';import Go,{config}from'dotenv';import*as rt from'path';import {dirname,join,resolve,basename}from'path';import {fileURLToPath}from'url';import*as ie from'fs';import {existsSync,readFileSync,statSync,writeFileSync}from'fs';import v from'chalk';import {Command}from'commander';import {execSync}from'child_process';import*as ge from'crypto';import ge__default from'crypto';import gi from'ora';import {glob}from'glob';import hi from'cli-progress';import*as gt from'os';import {homedir}from'os';import*as V from'fs/promises';import Cr from'prompts';import Pi from'readline';import {gzipSync}from'zlib';import Mi from'open';import Fa from'omelette';globalThis.require = createRequire(import.meta.url); globalThis.CLI_VERSION = "6.3.22"; globalThis.SNAPSHOT_VERSION = "6.0.0"; globalThis.ENGINE_TARGET = "6.0.0"; globalThis.AUDIT_VERSION = "6.0"; globalThis.SESSION_PAYLOAD_VERSION = "6.0.0"; globalThis.RULES_VERSION = "6.0.0"; globalThis.ANALYSIS_VERSION = "6.0.0"; globalThis.API_VERSION = "v6"; globalThis.MIN_NODE = 20;
|
|
3
3
|
var es=Object.defineProperty;var be=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var ts=(t,e)=>{for(var n in e)es(t,n,{get:e[n],enumerable:true});};var ns=[/^--token[=\s]/i,/^-t[=\s]/i,/^--api-key[=\s]/i,/^--apikey[=\s]/i,/^--key[=\s]/i,/^--auth[=\s]/i,/^--bearer[=\s]/i,/token[=:]\s*[a-zA-Z0-9_-]{10,}/i,/api[_-]?key[=:]\s*[a-zA-Z0-9_-]{10,}/i],st=/vs_[a-zA-Z0-9_-]{20,}/i;function zn(){let t=process.argv.slice(2);for(let e of t){for(let n of ns)n.test(e)&&(console.error(v.red(`
|
|
4
4
|
\u274C Security Error: Token detected in command line arguments`)),console.error(v.yellow(`
|
|
5
5
|
Passing tokens via CLI arguments is not allowed.`)),console.error(v.yellow("This prevents tokens from being saved in shell history (~/.bash_history, ~/.zsh_history)")),console.error(v.gray(`
|
|
@@ -20,7 +20,7 @@ Run with DEBUG=veestack for full stack trace (sanitized)`);}process.exit(1);}),p
|
|
|
20
20
|
`));for(let n of e)console.log(v.yellow(n));console.log(v.gray(`
|
|
21
21
|
To install the official CLI:`)),console.log(v.cyan(" npm install -g veestack-tools")),console.log(v.red("\u2550".repeat(60)+`
|
|
22
22
|
`)),process.exit(1);}process.env.VEESTACK_DEBUG==="true"&&console.log(v.gray(`\u2713 Official package verified: ${ot.join(" or ")}`));}function Bt(){let t=Gn(),e=ot.includes(t);return {packageName:t,isOfficial:e,homepage:"https://www.veestack.com",repository:"https://github.com/Mohmed-ElZehiry/VeeStack"}}var as=[".env",".env.local",".env.development",".env.production",".env.test",".env.example",".envrc",".env.*","id_rsa","id_rsa.pub","id_dsa","id_dsa.pub","id_ecdsa","id_ecdsa.pub","id_ed25519","id_ed25519.pub","*.pem","*.key","*.p12","*.pfx","*.crt","*.cer","*.der","credentials",".aws/credentials",".aws/config",".docker/config.json","kubeconfig","*.kubeconfig",".npmrc",".yarnrc",".pnpmrc",".git-credentials","*.sqlite","*.sqlite3","*.db","secrets/","secret/",".secrets/","config.json","settings.json","local.settings.json"],cs=["veestack.config.json","package.json","tsconfig.json","jsconfig.json",".eslintrc.json",".prettierrc.json","README.md"],ls=[{name:"AWS Access Key ID",pattern:/AKIA[0-9A-Z]{16}/g,severity:"critical",description:"AWS Access Key ID detected"},{name:"AWS Secret Access Key",pattern:/['"\s][A-Za-z0-9/+=]{40}['"\s]/g,severity:"critical",description:"Potential AWS Secret Key detected"},{name:"Private Key",pattern:/-----BEGIN (RSA |DSA |EC |OPENSSH |PGP )?PRIVATE KEY-----/g,severity:"critical",description:"Private key detected"},{name:"JWT Token",pattern:/eyJ[a-zA-Z0-9_-]*\.eyJ[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]*/g,severity:"high",description:"JWT token detected"},{name:"Bearer Token",pattern:/Bearer\s+[a-zA-Z0-9_-]{20,}/gi,severity:"high",description:"Bearer token detected"},{name:"API Key",pattern:/(?:api[_-]?key|apikey|api_token|apiToken)['"\s]*[:=]\s*['"][a-zA-Z0-9_-]{16,}['"]/gi,severity:"high",description:"API key detected"},{name:"Password in URL",pattern:/[a-zA-Z]+:\/\/[^\s:@]+:[^\s:@]+@[^\s]+/g,severity:"high",description:"Password in URL detected"},{name:"Password Assignment",pattern:/(?:password|passwd|pwd)\s*[=:]\s*['"][^'"]{8,}['"]/gi,severity:"medium",description:"Password assignment detected"},{name:"GitHub Token",pattern:/gh[pousr]_[A-Za-z0-9_]{36,}/g,severity:"critical",description:"GitHub token detected"},{name:"Slack Token",pattern:/xox[baprs]-[0-9]{10,13}-[0-9]{10,13}(-[a-zA-Z0-9]{24})?/g,severity:"critical",description:"Slack token detected"},{name:"Generic Secret",pattern:/(?:secret|token|key)\s*[=:]\s*['"][a-zA-Z0-9_-]{20,}['"]/gi,severity:"medium",description:"Potential secret detected"},{name:"Connection String",pattern:/(?:mongodb|postgres|mysql|redis|amqp):\/\/[^\s]+/gi,severity:"high",description:"Database connection string detected"},{name:"VeeStack Token",pattern:/vs_[a-zA-Z0-9_-]{20,}/g,severity:"critical",description:"VeeStack token detected"}];function Wn(t){let e=t.replace(/\\/g,"/").toLowerCase(),n=rt.basename(e);for(let r of cs)if(n===r.toLowerCase())return false;for(let r of as){if(n===r.toLowerCase())return true;if(r.includes("*")){let s=r.toLowerCase().replace(/\./g,"\\.").replace(/\*/g,".*"),o=new RegExp(s);if(o.test(n)||o.test(e))return true}if(e.includes(r.toLowerCase().replace("*","")))return true}return false}function us(t,e){let n=[],r=e.split(`
|
|
23
|
-
`);for(let s of ls){s.pattern.lastIndex=0;for(let o=0;o<r.length;o++){let a=r[o],i;for(;(i=s.pattern.exec(a))!==null;)n.push({filePath:t,type:"secret_content",secretName:s.name,severity:s.severity,description:s.description,lineNumber:o+1,match:i[0].substring(0,20)+"..."});s.pattern.lastIndex=0;}}return n}async function ds(t){let e=[];if(Wn(t))return e.push({filePath:t,type:"sensitive_file",secretName:"Sensitive File",severity:"critical",description:`Sensitive file type detected: ${rt.basename(t)}`}),e;try{if(ie.statSync(t).size>1024*1024)return e;let r=ie.readFileSync(t,"utf-8"),s=us(t,r);e.push(...s);}catch{}return e}async function qn(t,e){let n=[];for(let i of e){let c=rt.join(t,i),l=await ds(c);for(let d of l)d.filePath=i,n.push(d);}let r=n.filter(i=>i.severity==="critical").length,s=n.filter(i=>i.severity==="high").length,o=n.filter(i=>i.severity==="medium").length,a=n.filter(i=>i.severity==="low").length;return {totalFiles:e.length,secretsFound:n.length,criticalCount:r,highCount:s,mediumCount:o,lowCount:a,results:n}}function Yn(t){let e=[],n=[];for(let r of t)Wn(r)?n.push(r):e.push(r);return {safe:e,blocked:n}}var hn=(t=>typeof be<"u"?be:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof be<"u"?be:e)[n]}):t)(function(t){if(typeof be<"u")return be.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),Xn=typeof process<"u"&&process.versions?.node,fs=Xn&&(Array.isArray(process.argv)&&process.argv.includes("--debug")||process.env.VEESTACK_DEBUG==="1"),yn=globalThis||{},vn=null;if(Xn)try{let t=function(){let b=d,L=0;for(;b!==i(b)&&L<10;){let N=a(b,"package.json");try{if(o(N)){let I=JSON.parse(s(N,"utf-8"));if(I.name==="vee_stack")return I}}catch{}b=i(b),L++;}return null};ps=t;let e=hn("fs"),n=hn("path"),r=hn("url"),{readFileSync:s,existsSync:o}=e,{join:a,dirname:i}=n,{fileURLToPath:c}=r,l=c(import.meta.url),d=i(l);vn=t();}catch{fs&&console.debug("[veestack:debug] Failed to load package.json dynamically, using defaults");}var ps,xe=vn?.versions||yn.VEESTACK_VERSIONS||{},ne=vn?.version||yn.VEESTACK_VERSION||yn.CLI_VERSION||"unknown",kn=`vs_cli_v${ne}`;xe.snapshot||"unknown";xe.engine_target||"unknown";xe.audit||"unknown";xe.session_payload||"unknown";xe.rules||"unknown";xe.analysis||"unknown";xe.api||"unknown";xe.min_node||"unknown";var f={};ts(f,{BRAND:()=>Hs,DIRTY:()=>De,EMPTY_PATH:()=>Es,INVALID:()=>h,NEVER:()=>Co,OK:()=>K,ParseStatus:()=>H,Schema:()=>w,ZodAny:()=>Ie,ZodArray:()=>_e,ZodBigInt:()=>Le,ZodBoolean:()=>$e,ZodBranded:()=>xt,ZodCatch:()=>Ze,ZodDate:()=>Ve,ZodDefault:()=>Ge,ZodDiscriminatedUnion:()=>Gt,ZodEffects:()=>oe,ZodEnum:()=>Je,ZodError:()=>Y,ZodFirstPartyTypeKind:()=>y,ZodFunction:()=>Wt,ZodIntersection:()=>Fe,ZodIssueCode:()=>u,ZodLazy:()=>ze,ZodLiteral:()=>He,ZodMap:()=>dt,ZodNaN:()=>pt,ZodNativeEnum:()=>Ke,ZodNever:()=>ae,ZodNull:()=>Me,ZodNullable:()=>pe,ZodNumber:()=>je,ZodObject:()=>X,ZodOptional:()=>re,ZodParsedType:()=>g,ZodPipeline:()=>Rt,ZodPromise:()=>Ne,ZodReadonly:()=>We,ZodRecord:()=>Zt,ZodSchema:()=>w,ZodSet:()=>ft,ZodString:()=>Ce,ZodSymbol:()=>lt,ZodTransformer:()=>oe,ZodTuple:()=>fe,ZodType:()=>w,ZodUndefined:()=>Ue,ZodUnion:()=>Be,ZodUnknown:()=>ke,ZodVoid:()=>ut,addIssueToContext:()=>p,any:()=>Qs,array:()=>ro,bigint:()=>Zs,boolean:()=>lr,coerce:()=>Ro,custom:()=>ir,date:()=>Ws,datetimeRegex:()=>sr,defaultErrorMap:()=>ye,discriminatedUnion:()=>ao,effect:()=>_o,enum:()=>yo,function:()=>go,getErrorMap:()=>it,getParsedType:()=>de,instanceof:()=>Ks,intersection:()=>co,isAborted:()=>Jt,isAsync:()=>at,isDirty:()=>Kt,isValid:()=>Re,late:()=>Js,lazy:()=>mo,literal:()=>ho,makeIssue:()=>bt,map:()=>fo,nan:()=>Gs,nativeEnum:()=>vo,never:()=>to,null:()=>Xs,nullable:()=>Eo,number:()=>cr,object:()=>so,objectUtil:()=>En,oboolean:()=>xo,onumber:()=>bo,optional:()=>wo,ostring:()=>Ao,pipeline:()=>To,preprocess:()=>So,promise:()=>ko,quotelessJson:()=>ks,record:()=>uo,set:()=>po,setErrorMap:()=>ws,strictObject:()=>oo,string:()=>ar,symbol:()=>qs,transformer:()=>_o,tuple:()=>lo,undefined:()=>Ys,union:()=>io,unknown:()=>eo,util:()=>S,void:()=>no});var S;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{let o={};for(let a of s)o[a]=a;return o},t.getValidEnumValues=s=>{let o=t.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),a={};for(let i of o)a[i]=s[i];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},t.find=(s,o)=>{for(let a of s)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o;})(S||(S={}));var En;(function(t){t.mergeShapes=(e,n)=>({...e,...n});})(En||(En={}));var g=S.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),de=t=>{switch(typeof t){case "undefined":return g.undefined;case "string":return g.string;case "number":return Number.isNaN(t)?g.nan:g.number;case "boolean":return g.boolean;case "function":return g.function;case "bigint":return g.bigint;case "symbol":return g.symbol;case "object":return Array.isArray(t)?g.array:t===null?g.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?g.promise:typeof Map<"u"&&t instanceof Map?g.map:typeof Set<"u"&&t instanceof Set?g.set:typeof Date<"u"&&t instanceof Date?g.date:g.object;default:return g.unknown}};var u=S.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ks=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Y=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r];},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r];};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e;}format(e){let n=e||function(o){return o.message},r={_errors:[]},s=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else {let i=r,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(n(a))):i[l]=i[l]||{_errors:[]},i=i[l],c++;}}};return s(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,S.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let s of this.issues)if(s.path.length>0){let o=s.path[0];n[o]=n[o]||[],n[o].push(e(s));}else r.push(e(s));return {formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Y.create=t=>new Y(t);var _s=(t,e)=>{let n;switch(t.code){case u.invalid_type:t.received===g.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case u.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,S.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:n=`Unrecognized key(s) in object: ${S.joinValues(t.keys,", ")}`;break;case u.invalid_union:n="Invalid input";break;case u.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${S.joinValues(t.options)}`;break;case u.invalid_enum_value:n=`Invalid enum value. Expected ${S.joinValues(t.options)}, received '${t.received}'`;break;case u.invalid_arguments:n="Invalid function arguments";break;case u.invalid_return_type:n="Invalid function return type";break;case u.invalid_date:n="Invalid date";break;case u.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:S.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case u.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case u.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case u.custom:n="Invalid input";break;case u.invalid_intersection_types:n="Intersection results could not be merged";break;case u.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case u.not_finite:n="Number must be finite";break;default:n=e.defaultError,S.assertNever(t);}return {message:n}},ye=_s;var Qn=ye;function ws(t){Qn=t;}function it(){return Qn}var bt=t=>{let{data:e,path:n,errorMaps:r,issueData:s}=t,o=[...n,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return {...s,path:o,message:s.message};let i="",c=r.filter(l=>!!l).slice().reverse();for(let l of c)i=l(a,{data:e,defaultError:i}).message;return {...s,path:o,message:i}},Es=[];function p(t,e){let n=it(),r=bt({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ye?void 0:ye].filter(s=>!!s)});t.common.issues.push(r);}var H=class t{constructor(){this.value="valid";}dirty(){this.value==="valid"&&(this.value="dirty");}abort(){this.value!=="aborted"&&(this.value="aborted");}static mergeArray(e,n){let r=[];for(let s of n){if(s.status==="aborted")return h;s.status==="dirty"&&e.dirty(),r.push(s.value);}return {status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let s of n){let o=await s.key,a=await s.value;r.push({key:o,value:a});}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let s of n){let{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return h;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[o.value]=a.value);}return {status:e.value,value:r}}},h=Object.freeze({status:"aborted"}),De=t=>({status:"dirty",value:t}),K=t=>({status:"valid",value:t}),Jt=t=>t.status==="aborted",Kt=t=>t.status==="dirty",Re=t=>t.status==="valid",at=t=>typeof Promise<"u"&&t instanceof Promise;var m;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message;})(m||(m={}));var se=class{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s;}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},er=(t,e)=>{if(Re(e))return {success:true,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return {success:false,get error(){if(this._error)return this._error;let n=new Y(t.common.issues);return this._error=n,this._error}}};function _(t){if(!t)return {};let{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,i)=>{let{message:c}=t;return a.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:c??r??i.defaultError}:a.code!=="invalid_type"?{message:i.defaultError}:{message:c??n??i.defaultError}},description:s}}var w=class{get description(){return this._def.description}_getType(e){return de(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:de(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return {status:new H,ctx:{common:e.parent.common,data:e.data,parsedType:de(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(at(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??false,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)},s=this._parseSync({data:e,path:r.path,parent:r});return er(r,s)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return Re(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=true),n.common={issues:[],async:true};}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Re(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:true},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)},s=this._parse({data:e,path:r.path,parent:r}),o=await(at(s)?s:Promise.resolve(s));return er(r,o)}refine(e,n){let r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{let a=e(s),i=()=>o.addIssue({code:u.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?true:(i(),false)):a?true:(i(),false)})}refinement(e,n){return this._refinement((r,s)=>e(r)?true:(s.addIssue(typeof n=="function"?n(r,s):n),false))}_refinement(e){return new oe({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)};}optional(){return re.create(this,this._def)}nullable(){return pe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _e.create(this)}promise(){return Ne.create(this,this._def)}or(e){return Be.create([this,e],this._def)}and(e){return Fe.create(this,e,this._def)}transform(e){return new oe({..._(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Ge({..._(this._def),innerType:this,defaultValue:n,typeName:y.ZodDefault})}brand(){return new xt({typeName:y.ZodBranded,type:this,..._(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Ze({..._(this._def),innerType:this,catchValue:n,typeName:y.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Rt.create(this,e)}readonly(){return We.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ss=/^c[^\s-]{8,}$/i,Ts=/^[0-9a-z]+$/,As=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bs=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xs=/^[a-z0-9_-]{21}$/i,Rs=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Cs=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Is=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ns="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Sn,Os=/^(?:(?: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])$/,Ps=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ds=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,js=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ls=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$s=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nr="((\\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])))",Vs=new RegExp(`^${nr}$`);function rr(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Us(t){return new RegExp(`^${rr(t)}$`)}function sr(t){let e=`${nr}T${rr(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Ms(t,e){return !!((e==="v4"||!e)&&Os.test(t)||(e==="v6"||!e)&&Ds.test(t))}function Bs(t,e){if(!Rs.test(t))return false;try{let[n]=t.split(".");if(!n)return !1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return !(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return false}}function Fs(t,e){return !!((e==="v4"||!e)&&Ps.test(t)||(e==="v6"||!e)&&js.test(t))}var Ce=class t extends w{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_type,expected:g.string,received:o.parsedType}),h}let r=new H,s;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_small,minimum:o.value,type:"string",inclusive:true,exact:false,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_big,maximum:o.value,type:"string",inclusive:true,exact:false,message:o.message}),r.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,i=e.data.length<o.value;(a||i)&&(s=this._getOrReturnCtx(e,s),a?p(s,{code:u.too_big,maximum:o.value,type:"string",inclusive:true,exact:true,message:o.message}):i&&p(s,{code:u.too_small,minimum:o.value,type:"string",inclusive:true,exact:true,message:o.message}),r.dirty());}else if(o.kind==="email")Is.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"email",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Sn||(Sn=new RegExp(Ns,"u")),Sn.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"emoji",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")bs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"uuid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")xs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"nanoid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Ss.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cuid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Ts.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cuid2",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")As.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"ulid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data);}catch{s=this._getOrReturnCtx(e,s),p(s,{validation:"url",code:u.invalid_string,message:o.message}),r.dirty();}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"regex",code:u.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?sr(o).test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?Vs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Us(o).test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Cs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"duration",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Ms(e.data,o.version)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"ip",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?Bs(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"jwt",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?Fs(e.data,o.version)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cidr",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?Ls.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"base64",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?$s.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"base64url",code:u.invalid_string,message:o.message}),r.dirty()):S.assertNever(o);return {status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:u.invalid_string,...m.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...m.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...m.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:false,local:false,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??false,local:e?.local??false,...m.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...m.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...m.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...m.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...m.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...m.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...m.errToObj(n)})}nonempty(e){return this.min(1,m.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return !!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return !!this._def.checks.find(e=>e.kind==="date")}get isTime(){return !!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return !!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return !!this._def.checks.find(e=>e.kind==="email")}get isURL(){return !!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return !!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return !!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return !!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return !!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return !!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return !!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return !!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return !!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return !!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return !!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Ce.create=t=>new Ce({checks:[],typeName:y.ZodString,coerce:t?.coerce??false,..._(t)});function zs(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,o=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return o%a/10**s}var je=class t extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf;}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.number){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_type,expected:g.number,received:o.parsedType}),h}let r,s=new H;for(let o of this._def.checks)o.kind==="int"?S.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:false,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:false,message:o.message}),s.dirty()):o.kind==="multipleOf"?zs(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.not_finite,message:o.message}),s.dirty()):S.assertNever(o);return {status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,true,m.toString(n))}gt(e,n){return this.setLimit("min",e,false,m.toString(n))}lte(e,n){return this.setLimit("max",e,true,m.toString(n))}lt(e,n){return this.setLimit("max",e,false,m.toString(n))}setLimit(e,n,r,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:m.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:false,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:false,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:true,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:true,message:m.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:true,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:true,value:Number.MAX_SAFE_INTEGER,message:m.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return !!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&S.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return true;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);}return Number.isFinite(n)&&Number.isFinite(e)}};je.create=t=>new je({checks:[],typeName:y.ZodNumber,coerce:t?.coerce||false,..._(t)});var Le=class t extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte;}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data);}catch{return this._getInvalidInput(e)}if(this._getType(e)!==g.bigint)return this._getInvalidInput(e);let r,s=new H;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):S.assertNever(o);return {status:s.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return p(n,{code:u.invalid_type,expected:g.bigint,received:n.parsedType}),h}gte(e,n){return this.setLimit("min",e,true,m.toString(n))}gt(e,n){return this.setLimit("min",e,false,m.toString(n))}lte(e,n){return this.setLimit("max",e,true,m.toString(n))}lt(e,n){return this.setLimit("max",e,false,m.toString(n))}setLimit(e,n,r,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:m.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:false,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:false,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:true,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:true,message:m.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Le.create=t=>new Le({checks:[],typeName:y.ZodBigInt,coerce:t?.coerce??false,..._(t)});var $e=class extends w{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.boolean,received:r.parsedType}),h}return K(e.data)}};$e.create=t=>new $e({typeName:y.ZodBoolean,coerce:t?.coerce||false,..._(t)});var Ve=class t extends w{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_type,expected:g.date,received:o.parsedType}),h}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_date}),h}let r=new H,s;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_small,message:o.message,inclusive:true,exact:false,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_big,message:o.message,inclusive:true,exact:false,maximum:o.value,type:"date"}),r.dirty()):S.assertNever(o);return {status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:m.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Ve.create=t=>new Ve({checks:[],coerce:t?.coerce||false,typeName:y.ZodDate,..._(t)});var lt=class extends w{_parse(e){if(this._getType(e)!==g.symbol){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.symbol,received:r.parsedType}),h}return K(e.data)}};lt.create=t=>new lt({typeName:y.ZodSymbol,..._(t)});var Ue=class extends w{_parse(e){if(this._getType(e)!==g.undefined){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.undefined,received:r.parsedType}),h}return K(e.data)}};Ue.create=t=>new Ue({typeName:y.ZodUndefined,..._(t)});var Me=class extends w{_parse(e){if(this._getType(e)!==g.null){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.null,received:r.parsedType}),h}return K(e.data)}};Me.create=t=>new Me({typeName:y.ZodNull,..._(t)});var Ie=class extends w{constructor(){super(...arguments),this._any=true;}_parse(e){return K(e.data)}};Ie.create=t=>new Ie({typeName:y.ZodAny,..._(t)});var ke=class extends w{constructor(){super(...arguments),this._unknown=true;}_parse(e){return K(e.data)}};ke.create=t=>new ke({typeName:y.ZodUnknown,..._(t)});var ae=class extends w{_parse(e){let n=this._getOrReturnCtx(e);return p(n,{code:u.invalid_type,expected:g.never,received:n.parsedType}),h}};ae.create=t=>new ae({typeName:y.ZodNever,..._(t)});var ut=class extends w{_parse(e){if(this._getType(e)!==g.undefined){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.void,received:r.parsedType}),h}return K(e.data)}};ut.create=t=>new ut({typeName:y.ZodVoid,..._(t)});var _e=class t extends w{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==g.array)return p(n,{code:u.invalid_type,expected:g.array,received:n.parsedType}),h;if(s.exactLength!==null){let a=n.data.length>s.exactLength.value,i=n.data.length<s.exactLength.value;(a||i)&&(p(n,{code:a?u.too_big:u.too_small,minimum:i?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:true,exact:true,message:s.exactLength.message}),r.dirty());}if(s.minLength!==null&&n.data.length<s.minLength.value&&(p(n,{code:u.too_small,minimum:s.minLength.value,type:"array",inclusive:true,exact:false,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(p(n,{code:u.too_big,maximum:s.maxLength.value,type:"array",inclusive:true,exact:false,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,i)=>s.type._parseAsync(new se(n,a,n.path,i)))).then(a=>H.mergeArray(r,a));let o=[...n.data].map((a,i)=>s.type._parseSync(new se(n,a,n.path,i)));return H.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:m.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:m.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:m.toString(n)}})}nonempty(e){return this.min(1,e)}};_e.create=(t,e)=>new _e({type:t,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,..._(e)});function ct(t){if(t instanceof X){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=re.create(ct(r));}return new X({...t._def,shape:()=>e})}else return t instanceof _e?new _e({...t._def,type:ct(t.element)}):t instanceof re?re.create(ct(t.unwrap())):t instanceof pe?pe.create(ct(t.unwrap())):t instanceof fe?fe.create(t.items.map(e=>ct(e))):t}var X=class t extends w{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend;}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=S.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==g.object){let l=this._getOrReturnCtx(e);return p(l,{code:u.invalid_type,expected:g.object,received:l.parsedType}),h}let{status:r,ctx:s}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof ae&&this._def.unknownKeys==="strip"))for(let l in s.data)a.includes(l)||i.push(l);let c=[];for(let l of a){let d=o[l],b=s.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new se(s,b,s.path,l)),alwaysSet:l in s.data});}if(this._def.catchall instanceof ae){let l=this._def.unknownKeys;if(l==="passthrough")for(let d of i)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(l==="strict")i.length>0&&(p(s,{code:u.unrecognized_keys,keys:i}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else {let l=this._def.catchall;for(let d of i){let b=s.data[d];c.push({key:{status:"valid",value:d},value:l._parse(new se(s,b,s.path,d)),alwaysSet:d in s.data});}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let d of c){let b=await d.key,L=await d.value;l.push({key:b,value:L,alwaysSet:d.alwaysSet});}return l}).then(l=>H.mergeObjectSync(r,l)):H.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let s=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:m.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of S.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of S.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return ct(this)}partial(e){let n={};for(let r of S.objectKeys(this.shape)){let s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional();}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of S.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else {let o=this.shape[r];for(;o instanceof re;)o=o._def.innerType;n[r]=o;}return new t({...this._def,shape:()=>n})}keyof(){return or(S.objectKeys(this.shape))}};X.create=(t,e)=>new X({shape:()=>t,unknownKeys:"strip",catchall:ae.create(),typeName:y.ZodObject,..._(e)});X.strictCreate=(t,e)=>new X({shape:()=>t,unknownKeys:"strict",catchall:ae.create(),typeName:y.ZodObject,..._(e)});X.lazycreate=(t,e)=>new X({shape:t,unknownKeys:"strip",catchall:ae.create(),typeName:y.ZodObject,..._(e)});var Be=class extends w{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function s(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(i=>new Y(i.ctx.common.issues));return p(n,{code:u.invalid_union,unionErrors:a}),h}if(n.common.async)return Promise.all(r.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return {result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(s);{let o,a=[];for(let c of r){let l={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:l}),l.common.issues.length&&a.push(l.common.issues);}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(c=>new Y(c));return p(n,{code:u.invalid_union,unionErrors:i}),h}}get options(){return this._def.options}};Be.create=(t,e)=>new Be({options:t,typeName:y.ZodUnion,..._(e)});var ve=t=>t instanceof ze?ve(t.schema):t instanceof oe?ve(t.innerType()):t instanceof He?[t.value]:t instanceof Je?t.options:t instanceof Ke?S.objectValues(t.enum):t instanceof Ge?ve(t._def.innerType):t instanceof Ue?[void 0]:t instanceof Me?[null]:t instanceof re?[void 0,...ve(t.unwrap())]:t instanceof pe?[null,...ve(t.unwrap())]:t instanceof xt||t instanceof We?ve(t.unwrap()):t instanceof Ze?ve(t._def.innerType):[],Gt=class t extends w{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==g.object)return p(n,{code:u.invalid_type,expected:g.object,received:n.parsedType}),h;let r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(p(n,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),h)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let s=new Map;for(let o of n){let a=ve(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of a){if(s.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);s.set(i,o);}}return new t({typeName:y.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,..._(r)})}};function Tn(t,e){let n=de(t),r=de(e);if(t===e)return {valid:true,data:t};if(n===g.object&&r===g.object){let s=S.objectKeys(e),o=S.objectKeys(t).filter(i=>s.indexOf(i)!==-1),a={...t,...e};for(let i of o){let c=Tn(t[i],e[i]);if(!c.valid)return {valid:false};a[i]=c.data;}return {valid:true,data:a}}else if(n===g.array&&r===g.array){if(t.length!==e.length)return {valid:false};let s=[];for(let o=0;o<t.length;o++){let a=t[o],i=e[o],c=Tn(a,i);if(!c.valid)return {valid:false};s.push(c.data);}return {valid:true,data:s}}else return n===g.date&&r===g.date&&+t==+e?{valid:true,data:t}:{valid:false}}var Fe=class extends w{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),s=(o,a)=>{if(Jt(o)||Jt(a))return h;let i=Tn(o.value,a.value);return i.valid?((Kt(o)||Kt(a))&&n.dirty(),{status:n.value,value:i.data}):(p(r,{code:u.invalid_intersection_types}),h)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Fe.create=(t,e,n)=>new Fe({left:t,right:e,typeName:y.ZodIntersection,..._(n)});var fe=class t extends w{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.array)return p(r,{code:u.invalid_type,expected:g.array,received:r.parsedType}),h;if(r.data.length<this._def.items.length)return p(r,{code:u.too_small,minimum:this._def.items.length,inclusive:true,exact:false,type:"array"}),h;!this._def.rest&&r.data.length>this._def.items.length&&(p(r,{code:u.too_big,maximum:this._def.items.length,inclusive:true,exact:false,type:"array"}),n.dirty());let o=[...r.data].map((a,i)=>{let c=this._def.items[i]||this._def.rest;return c?c._parse(new se(r,a,r.path,i)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>H.mergeArray(n,a)):H.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};fe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fe({items:t,typeName:y.ZodTuple,rest:null,..._(e)})};var Zt=class t extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.object)return p(r,{code:u.invalid_type,expected:g.object,received:r.parsedType}),h;let s=[],o=this._def.keyType,a=this._def.valueType;for(let i in r.data)s.push({key:o._parse(new se(r,i,r.path,i)),value:a._parse(new se(r,r.data[i],r.path,i)),alwaysSet:i in r.data});return r.common.async?H.mergeObjectAsync(n,s):H.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof w?new t({keyType:e,valueType:n,typeName:y.ZodRecord,..._(r)}):new t({keyType:Ce.create(),valueType:e,typeName:y.ZodRecord,..._(n)})}},dt=class extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.map)return p(r,{code:u.invalid_type,expected:g.map,received:r.parsedType}),h;let s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([i,c],l)=>({key:s._parse(new se(r,i,r.path,[l,"key"])),value:o._parse(new se(r,c,r.path,[l,"value"]))}));if(r.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,d=await c.value;if(l.status==="aborted"||d.status==="aborted")return h;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),i.set(l.value,d.value);}return {status:n.value,value:i}})}else {let i=new Map;for(let c of a){let l=c.key,d=c.value;if(l.status==="aborted"||d.status==="aborted")return h;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),i.set(l.value,d.value);}return {status:n.value,value:i}}}};dt.create=(t,e,n)=>new dt({valueType:e,keyType:t,typeName:y.ZodMap,..._(n)});var ft=class t extends w{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.set)return p(r,{code:u.invalid_type,expected:g.set,received:r.parsedType}),h;let s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(p(r,{code:u.too_small,minimum:s.minSize.value,type:"set",inclusive:true,exact:false,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(p(r,{code:u.too_big,maximum:s.maxSize.value,type:"set",inclusive:true,exact:false,message:s.maxSize.message}),n.dirty());let o=this._def.valueType;function a(c){let l=new Set;for(let d of c){if(d.status==="aborted")return h;d.status==="dirty"&&n.dirty(),l.add(d.value);}return {status:n.value,value:l}}let i=[...r.data.values()].map((c,l)=>o._parse(new se(r,c,r.path,l)));return r.common.async?Promise.all(i).then(c=>a(c)):a(i)}min(e,n){return new t({...this._def,minSize:{value:e,message:m.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:m.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};ft.create=(t,e)=>new ft({valueType:t,minSize:null,maxSize:null,typeName:y.ZodSet,..._(e)});var Wt=class t extends w{constructor(){super(...arguments),this.validate=this.implement;}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==g.function)return p(n,{code:u.invalid_type,expected:g.function,received:n.parsedType}),h;function r(i,c){return bt({data:i,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,it(),ye].filter(l=>!!l),issueData:{code:u.invalid_arguments,argumentsError:c}})}function s(i,c){return bt({data:i,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,it(),ye].filter(l=>!!l),issueData:{code:u.invalid_return_type,returnTypeError:c}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Ne){let i=this;return K(async function(...c){let l=new Y([]),d=await i._def.args.parseAsync(c,o).catch(N=>{throw l.addIssue(r(c,N)),l}),b=await Reflect.apply(a,this,d);return await i._def.returns._def.type.parseAsync(b,o).catch(N=>{throw l.addIssue(s(b,N)),l})})}else {let i=this;return K(function(...c){let l=i._def.args.safeParse(c,o);if(!l.success)throw new Y([r(c,l.error)]);let d=Reflect.apply(a,this,l.data),b=i._def.returns.safeParse(d,o);if(!b.success)throw new Y([s(d,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:fe.create(e).rest(ke.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||fe.create([]).rest(ke.create()),returns:n||ke.create(),typeName:y.ZodFunction,..._(r)})}},ze=class extends w{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};ze.create=(t,e)=>new ze({getter:t,typeName:y.ZodLazy,..._(e)});var He=class extends w{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return p(n,{received:n.data,code:u.invalid_literal,expected:this._def.value}),h}return {status:"valid",value:e.data}}get value(){return this._def.value}};He.create=(t,e)=>new He({value:t,typeName:y.ZodLiteral,..._(e)});function or(t,e){return new Je({values:t,typeName:y.ZodEnum,..._(e)})}var Je=class t extends w{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{expected:S.joinValues(r),received:n.parsedType,code:u.invalid_type}),h}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{received:n.data,code:u.invalid_enum_value,options:r}),h}return K(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Je.create=or;var Ke=class extends w{_parse(e){let n=S.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==g.string&&r.parsedType!==g.number){let s=S.objectValues(n);return p(r,{expected:S.joinValues(s),received:r.parsedType,code:u.invalid_type}),h}if(this._cache||(this._cache=new Set(S.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=S.objectValues(n);return p(r,{received:r.data,code:u.invalid_enum_value,options:s}),h}return K(e.data)}get enum(){return this._def.values}};Ke.create=(t,e)=>new Ke({values:t,typeName:y.ZodNativeEnum,..._(e)});var Ne=class extends w{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==g.promise&&n.common.async===false)return p(n,{code:u.invalid_type,expected:g.promise,received:n.parsedType}),h;let r=n.parsedType===g.promise?n.data:Promise.resolve(n.data);return K(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Ne.create=(t,e)=>new Ne({type:t,typeName:y.ZodPromise,..._(e)});var oe=class extends w{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:a=>{p(r,a),a.fatal?n.abort():n.dirty();},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let a=s.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async i=>{if(n.value==="aborted")return h;let c=await this._def.schema._parseAsync({data:i,path:r.path,parent:r});return c.status==="aborted"?h:c.status==="dirty"?De(c.value):n.value==="dirty"?De(c.value):c});{if(n.value==="aborted")return h;let i=this._def.schema._parseSync({data:a,path:r.path,parent:r});return i.status==="aborted"?h:i.status==="dirty"?De(i.value):n.value==="dirty"?De(i.value):i}}if(s.type==="refinement"){let a=i=>{let c=s.refinement(i,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(r.common.async===false){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?h:(i.status==="dirty"&&n.dirty(),a(i.value),{status:n.value,value:i.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>i.status==="aborted"?h:(i.status==="dirty"&&n.dirty(),a(i.value).then(()=>({status:n.value,value:i.value}))))}if(s.type==="transform")if(r.common.async===false){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Re(a))return h;let i=s.transform(a.value,o);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return {status:n.value,value:i}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Re(a)?Promise.resolve(s.transform(a.value,o)).then(i=>({status:n.value,value:i})):h);S.assertNever(s);}};oe.create=(t,e,n)=>new oe({schema:t,typeName:y.ZodEffects,effect:e,..._(n)});oe.createWithPreprocess=(t,e,n)=>new oe({schema:e,effect:{type:"preprocess",transform:t},typeName:y.ZodEffects,..._(n)});var re=class extends w{_parse(e){return this._getType(e)===g.undefined?K(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};re.create=(t,e)=>new re({innerType:t,typeName:y.ZodOptional,..._(e)});var pe=class extends w{_parse(e){return this._getType(e)===g.null?K(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};pe.create=(t,e)=>new pe({innerType:t,typeName:y.ZodNullable,..._(e)});var Ge=class extends w{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===g.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ge.create=(t,e)=>new Ge({innerType:t,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});var Ze=class extends w{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return at(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Y(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Y(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Ze.create=(t,e)=>new Ze({innerType:t,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});var pt=class extends w{_parse(e){if(this._getType(e)!==g.nan){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.nan,received:r.parsedType}),h}return {status:"valid",value:e.data}}};pt.create=t=>new pt({typeName:y.ZodNaN,..._(t)});var Hs=Symbol("zod_brand"),xt=class extends w{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Rt=class t extends w{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return (async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?h:o.status==="dirty"?(n.dirty(),De(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?h:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:y.ZodPipeline})}},We=class extends w{_parse(e){let n=this._def.innerType._parse(e),r=s=>(Re(s)&&(s.value=Object.freeze(s.value)),s);return at(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}};We.create=(t,e)=>new We({innerType:t,typeName:y.ZodReadonly,..._(e)});function tr(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function ir(t,e={},n){return t?Ie.create().superRefine((r,s)=>{let o=t(r);if(o instanceof Promise)return o.then(a=>{if(!a){let i=tr(e,r),c=i.fatal??n??true;s.addIssue({code:"custom",...i,fatal:c});}});if(!o){let a=tr(e,r),i=a.fatal??n??true;s.addIssue({code:"custom",...a,fatal:i});}}):Ie.create()}var Js={object:X.lazycreate},y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly";})(y||(y={}));var Ks=(t,e={message:`Input not instance of ${t.name}`})=>ir(n=>n instanceof t,e),ar=Ce.create,cr=je.create,Gs=pt.create,Zs=Le.create,lr=$e.create,Ws=Ve.create,qs=lt.create,Ys=Ue.create,Xs=Me.create,Qs=Ie.create,eo=ke.create,to=ae.create,no=ut.create,ro=_e.create,so=X.create,oo=X.strictCreate,io=Be.create,ao=Gt.create,co=Fe.create,lo=fe.create,uo=Zt.create,fo=dt.create,po=ft.create,go=Wt.create,mo=ze.create,ho=He.create,yo=Je.create,vo=Ke.create,ko=Ne.create,_o=oe.create,wo=re.create,Eo=pe.create,So=oe.createWithPreprocess,To=Rt.create,Ao=()=>ar().optional(),bo=()=>cr().optional(),xo=()=>lr().optional(),Ro={string:(t=>Ce.create({...t,coerce:true})),number:(t=>je.create({...t,coerce:true})),boolean:(t=>$e.create({...t,coerce:true})),bigint:(t=>Le.create({...t,coerce:true})),date:(t=>Ve.create({...t,coerce:true}))};var Co=h;var Io={api:{rateLimit:{windowMs:900*1e3,maxRequests:100}}};f.object({snapshot_version:f.string(),engine_target_version:f.string(),project_id:f.string(),generated_at:f.string(),root_path_hash:f.string(),metadata:f.object({total_files:f.number().int().nonnegative(),total_dependencies:f.number().int().nonnegative(),total_size_bytes:f.number().int().nonnegative(),total_lines:f.number().int().nonnegative(),max_directory_depth:f.number().int().nonnegative(),language_breakdown:f.record(f.string(),f.number().int().nonnegative())}),files:f.array(f.object({id:f.string(),path_hash:f.string(),depth:f.number().int().nonnegative(),size_bytes:f.number().int().nonnegative(),estimated_lines:f.number().int().nonnegative(),extension:f.string(),is_binary:f.boolean(),import_count:f.number().int().nonnegative().optional(),function_count:f.number().int().nonnegative().optional(),class_count:f.number().int().nonnegative().optional()})),dependencies:f.array(f.object({id:f.string(),name_hash:f.string(),major_version:f.number().int().nonnegative(),minor_version:f.number().int().nonnegative(),category:f.enum(["dev","prod","peer"])}))});f.object({name:f.string().min(1).max(100)});f.object({analysis_version:f.string(),snapshot_schema_version:f.string(),total_score:f.number().min(0).max(100),severity_band:f.enum(["HEALTHY","STABLE","STRUCTURAL_CONCERN","HIGH_RISK"]),engines:f.array(f.object({engine_name:f.string(),score_impact:f.number(),risk_level:f.enum(["HEALTHY","STABLE","STRUCTURAL_CONCERN","HIGH_RISK"]),metrics:f.record(f.number()),findings:f.array(f.object({rule_id:f.string(),title:f.string(),message:f.string(),severity:f.enum(["CRITICAL","HIGH","MEDIUM","LOW"]),category:f.enum(["SECURITY","STRUCTURE","COMPLEXITY","DEPENDENCY","REPOSITORY_HYGIENE","DOCUMENTATION","QUALITY"]),evidence:f.array(f.string()).optional(),explanation:f.string().optional(),impact:f.string().optional(),effort:f.enum(["Low","Medium","High"]).optional(),recommendations:f.array(f.string()).optional()}))})),summary:f.object({total_findings:f.number().int().nonnegative(),critical_count:f.number().int().nonnegative(),high_count:f.number().int().nonnegative(),medium_count:f.number().int().nonnegative(),low_count:f.number().int().nonnegative(),categories:f.record(f.string(),f.number().int().nonnegative())}),generated_at:f.string()});var No=f.object({NEXT_PUBLIC_SUPABASE_URL:f.string().url("Invalid SUPABASE_URL"),NEXT_PUBLIC_SUPABASE_ANON_KEY:f.string().min(1,"SUPABASE_ANON_KEY is required"),SUPABASE_SERVICE_ROLE_KEY:f.string().min(1,"SERVICE_ROLE_KEY is required"),NODE_ENV:f.enum(["development","production","test"],{errorMap:()=>({message:"NODE_ENV must be development, production, or test"})}),JWT_SECRET:f.string().min(32,"JWT_SECRET must be at least 32 characters").optional()});function Oo(){try{return No.parse(process.env)}catch(t){if(t instanceof f.ZodError){let e=t.errors.map(n=>n.path.join(".")).join(", ");throw new Error(`Environment validation failed:
|
|
23
|
+
`);for(let s of ls){s.pattern.lastIndex=0;for(let o=0;o<r.length;o++){let a=r[o],i;for(;(i=s.pattern.exec(a))!==null;)n.push({filePath:t,type:"secret_content",secretName:s.name,severity:s.severity,description:s.description,lineNumber:o+1,match:i[0].substring(0,20)+"..."});s.pattern.lastIndex=0;}}return n}async function ds(t){let e=[];if(Wn(t))return e.push({filePath:t,type:"sensitive_file",secretName:"Sensitive File",severity:"critical",description:`Sensitive file type detected: ${rt.basename(t)}`}),e;try{if(ie.statSync(t).size>1024*1024)return e;let r=ie.readFileSync(t,"utf-8"),s=us(t,r);e.push(...s);}catch{}return e}async function qn(t,e){let n=[];for(let i of e){let c=rt.join(t,i),l=await ds(c);for(let d of l)d.filePath=i,n.push(d);}let r=n.filter(i=>i.severity==="critical").length,s=n.filter(i=>i.severity==="high").length,o=n.filter(i=>i.severity==="medium").length,a=n.filter(i=>i.severity==="low").length;return {totalFiles:e.length,secretsFound:n.length,criticalCount:r,highCount:s,mediumCount:o,lowCount:a,results:n}}function Yn(t){let e=[],n=[];for(let r of t)Wn(r)?n.push(r):e.push(r);return {safe:e,blocked:n}}var hn=(t=>typeof be<"u"?be:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof be<"u"?be:e)[n]}):t)(function(t){if(typeof be<"u")return be.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),Xn=typeof process<"u"&&process.versions?.node,fs=Xn&&(Array.isArray(process.argv)&&process.argv.includes("--debug")||process.env.VEESTACK_DEBUG==="1"),yn=globalThis||{},vn=null;if(Xn)try{let t=function(){let x=d,L=0;for(;x!==i(x)&&L<10;){let N=a(x,"package.json");try{if(o(N)){let I=JSON.parse(s(N,"utf-8"));if(I.name==="vee_stack")return I}}catch{}x=i(x),L++;}return null};ps=t;let e=hn("fs"),n=hn("path"),r=hn("url"),{readFileSync:s,existsSync:o}=e,{join:a,dirname:i}=n,{fileURLToPath:c}=r,l=c(import.meta.url),d=i(l);vn=t();}catch{fs&&console.debug("[veestack:debug] Failed to load package.json dynamically, using defaults");}var ps,xe=vn?.versions||yn.VEESTACK_VERSIONS||{},ne=vn?.version||yn.VEESTACK_VERSION||yn.CLI_VERSION||"unknown",kn=`vs_cli_v${ne}`;xe.snapshot||"unknown";xe.engine_target||"unknown";xe.audit||"unknown";xe.session_payload||"unknown";xe.rules||"unknown";xe.analysis||"unknown";xe.api||"unknown";xe.min_node||"unknown";var f={};ts(f,{BRAND:()=>Hs,DIRTY:()=>De,EMPTY_PATH:()=>Es,INVALID:()=>h,NEVER:()=>Co,OK:()=>K,ParseStatus:()=>H,Schema:()=>w,ZodAny:()=>Ie,ZodArray:()=>_e,ZodBigInt:()=>Le,ZodBoolean:()=>$e,ZodBranded:()=>xt,ZodCatch:()=>Ze,ZodDate:()=>Ve,ZodDefault:()=>Ge,ZodDiscriminatedUnion:()=>Gt,ZodEffects:()=>oe,ZodEnum:()=>Je,ZodError:()=>Y,ZodFirstPartyTypeKind:()=>y,ZodFunction:()=>Wt,ZodIntersection:()=>Fe,ZodIssueCode:()=>u,ZodLazy:()=>ze,ZodLiteral:()=>He,ZodMap:()=>dt,ZodNaN:()=>pt,ZodNativeEnum:()=>Ke,ZodNever:()=>ae,ZodNull:()=>Me,ZodNullable:()=>pe,ZodNumber:()=>je,ZodObject:()=>X,ZodOptional:()=>re,ZodParsedType:()=>g,ZodPipeline:()=>Rt,ZodPromise:()=>Ne,ZodReadonly:()=>We,ZodRecord:()=>Zt,ZodSchema:()=>w,ZodSet:()=>ft,ZodString:()=>Ce,ZodSymbol:()=>lt,ZodTransformer:()=>oe,ZodTuple:()=>fe,ZodType:()=>w,ZodUndefined:()=>Ue,ZodUnion:()=>Be,ZodUnknown:()=>ke,ZodVoid:()=>ut,addIssueToContext:()=>p,any:()=>Qs,array:()=>ro,bigint:()=>Zs,boolean:()=>lr,coerce:()=>Ro,custom:()=>ir,date:()=>Ws,datetimeRegex:()=>sr,defaultErrorMap:()=>ye,discriminatedUnion:()=>ao,effect:()=>_o,enum:()=>yo,function:()=>go,getErrorMap:()=>it,getParsedType:()=>de,instanceof:()=>Ks,intersection:()=>co,isAborted:()=>Jt,isAsync:()=>at,isDirty:()=>Kt,isValid:()=>Re,late:()=>Js,lazy:()=>mo,literal:()=>ho,makeIssue:()=>bt,map:()=>fo,nan:()=>Gs,nativeEnum:()=>vo,never:()=>to,null:()=>Xs,nullable:()=>Eo,number:()=>cr,object:()=>so,objectUtil:()=>En,oboolean:()=>xo,onumber:()=>bo,optional:()=>wo,ostring:()=>Ao,pipeline:()=>To,preprocess:()=>So,promise:()=>ko,quotelessJson:()=>ks,record:()=>uo,set:()=>po,setErrorMap:()=>ws,strictObject:()=>oo,string:()=>ar,symbol:()=>qs,transformer:()=>_o,tuple:()=>lo,undefined:()=>Ys,union:()=>io,unknown:()=>eo,util:()=>S,void:()=>no});var S;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{let o={};for(let a of s)o[a]=a;return o},t.getValidEnumValues=s=>{let o=t.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),a={};for(let i of o)a[i]=s[i];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},t.find=(s,o)=>{for(let a of s)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o;})(S||(S={}));var En;(function(t){t.mergeShapes=(e,n)=>({...e,...n});})(En||(En={}));var g=S.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),de=t=>{switch(typeof t){case "undefined":return g.undefined;case "string":return g.string;case "number":return Number.isNaN(t)?g.nan:g.number;case "boolean":return g.boolean;case "function":return g.function;case "bigint":return g.bigint;case "symbol":return g.symbol;case "object":return Array.isArray(t)?g.array:t===null?g.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?g.promise:typeof Map<"u"&&t instanceof Map?g.map:typeof Set<"u"&&t instanceof Set?g.set:typeof Date<"u"&&t instanceof Date?g.date:g.object;default:return g.unknown}};var u=S.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ks=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Y=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r];},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r];};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e;}format(e){let n=e||function(o){return o.message},r={_errors:[]},s=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else {let i=r,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(n(a))):i[l]=i[l]||{_errors:[]},i=i[l],c++;}}};return s(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,S.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let s of this.issues)if(s.path.length>0){let o=s.path[0];n[o]=n[o]||[],n[o].push(e(s));}else r.push(e(s));return {formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Y.create=t=>new Y(t);var _s=(t,e)=>{let n;switch(t.code){case u.invalid_type:t.received===g.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case u.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,S.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:n=`Unrecognized key(s) in object: ${S.joinValues(t.keys,", ")}`;break;case u.invalid_union:n="Invalid input";break;case u.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${S.joinValues(t.options)}`;break;case u.invalid_enum_value:n=`Invalid enum value. Expected ${S.joinValues(t.options)}, received '${t.received}'`;break;case u.invalid_arguments:n="Invalid function arguments";break;case u.invalid_return_type:n="Invalid function return type";break;case u.invalid_date:n="Invalid date";break;case u.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:S.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case u.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case u.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case u.custom:n="Invalid input";break;case u.invalid_intersection_types:n="Intersection results could not be merged";break;case u.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case u.not_finite:n="Number must be finite";break;default:n=e.defaultError,S.assertNever(t);}return {message:n}},ye=_s;var Qn=ye;function ws(t){Qn=t;}function it(){return Qn}var bt=t=>{let{data:e,path:n,errorMaps:r,issueData:s}=t,o=[...n,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return {...s,path:o,message:s.message};let i="",c=r.filter(l=>!!l).slice().reverse();for(let l of c)i=l(a,{data:e,defaultError:i}).message;return {...s,path:o,message:i}},Es=[];function p(t,e){let n=it(),r=bt({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ye?void 0:ye].filter(s=>!!s)});t.common.issues.push(r);}var H=class t{constructor(){this.value="valid";}dirty(){this.value==="valid"&&(this.value="dirty");}abort(){this.value!=="aborted"&&(this.value="aborted");}static mergeArray(e,n){let r=[];for(let s of n){if(s.status==="aborted")return h;s.status==="dirty"&&e.dirty(),r.push(s.value);}return {status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let s of n){let o=await s.key,a=await s.value;r.push({key:o,value:a});}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let s of n){let{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return h;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[o.value]=a.value);}return {status:e.value,value:r}}},h=Object.freeze({status:"aborted"}),De=t=>({status:"dirty",value:t}),K=t=>({status:"valid",value:t}),Jt=t=>t.status==="aborted",Kt=t=>t.status==="dirty",Re=t=>t.status==="valid",at=t=>typeof Promise<"u"&&t instanceof Promise;var m;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message;})(m||(m={}));var se=class{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s;}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},er=(t,e)=>{if(Re(e))return {success:true,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return {success:false,get error(){if(this._error)return this._error;let n=new Y(t.common.issues);return this._error=n,this._error}}};function _(t){if(!t)return {};let{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,i)=>{let{message:c}=t;return a.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:c??r??i.defaultError}:a.code!=="invalid_type"?{message:i.defaultError}:{message:c??n??i.defaultError}},description:s}}var w=class{get description(){return this._def.description}_getType(e){return de(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:de(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return {status:new H,ctx:{common:e.parent.common,data:e.data,parsedType:de(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(at(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??false,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)},s=this._parseSync({data:e,path:r.path,parent:r});return er(r,s)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return Re(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=true),n.common={issues:[],async:true};}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Re(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:true},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)},s=this._parse({data:e,path:r.path,parent:r}),o=await(at(s)?s:Promise.resolve(s));return er(r,o)}refine(e,n){let r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{let a=e(s),i=()=>o.addIssue({code:u.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?true:(i(),false)):a?true:(i(),false)})}refinement(e,n){return this._refinement((r,s)=>e(r)?true:(s.addIssue(typeof n=="function"?n(r,s):n),false))}_refinement(e){return new oe({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)};}optional(){return re.create(this,this._def)}nullable(){return pe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _e.create(this)}promise(){return Ne.create(this,this._def)}or(e){return Be.create([this,e],this._def)}and(e){return Fe.create(this,e,this._def)}transform(e){return new oe({..._(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Ge({..._(this._def),innerType:this,defaultValue:n,typeName:y.ZodDefault})}brand(){return new xt({typeName:y.ZodBranded,type:this,..._(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Ze({..._(this._def),innerType:this,catchValue:n,typeName:y.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Rt.create(this,e)}readonly(){return We.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ss=/^c[^\s-]{8,}$/i,Ts=/^[0-9a-z]+$/,As=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bs=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xs=/^[a-z0-9_-]{21}$/i,Rs=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Cs=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Is=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ns="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Sn,Os=/^(?:(?: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])$/,Ps=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ds=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,js=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ls=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$s=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nr="((\\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])))",Vs=new RegExp(`^${nr}$`);function rr(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Us(t){return new RegExp(`^${rr(t)}$`)}function sr(t){let e=`${nr}T${rr(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Ms(t,e){return !!((e==="v4"||!e)&&Os.test(t)||(e==="v6"||!e)&&Ds.test(t))}function Bs(t,e){if(!Rs.test(t))return false;try{let[n]=t.split(".");if(!n)return !1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return !(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return false}}function Fs(t,e){return !!((e==="v4"||!e)&&Ps.test(t)||(e==="v6"||!e)&&js.test(t))}var Ce=class t extends w{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_type,expected:g.string,received:o.parsedType}),h}let r=new H,s;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_small,minimum:o.value,type:"string",inclusive:true,exact:false,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_big,maximum:o.value,type:"string",inclusive:true,exact:false,message:o.message}),r.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,i=e.data.length<o.value;(a||i)&&(s=this._getOrReturnCtx(e,s),a?p(s,{code:u.too_big,maximum:o.value,type:"string",inclusive:true,exact:true,message:o.message}):i&&p(s,{code:u.too_small,minimum:o.value,type:"string",inclusive:true,exact:true,message:o.message}),r.dirty());}else if(o.kind==="email")Is.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"email",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Sn||(Sn=new RegExp(Ns,"u")),Sn.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"emoji",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")bs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"uuid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")xs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"nanoid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Ss.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cuid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Ts.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cuid2",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")As.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"ulid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data);}catch{s=this._getOrReturnCtx(e,s),p(s,{validation:"url",code:u.invalid_string,message:o.message}),r.dirty();}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"regex",code:u.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?sr(o).test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?Vs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Us(o).test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Cs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"duration",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Ms(e.data,o.version)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"ip",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?Bs(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"jwt",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?Fs(e.data,o.version)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cidr",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?Ls.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"base64",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?$s.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"base64url",code:u.invalid_string,message:o.message}),r.dirty()):S.assertNever(o);return {status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:u.invalid_string,...m.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...m.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...m.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:false,local:false,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??false,local:e?.local??false,...m.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...m.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...m.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...m.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...m.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...m.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...m.errToObj(n)})}nonempty(e){return this.min(1,m.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return !!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return !!this._def.checks.find(e=>e.kind==="date")}get isTime(){return !!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return !!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return !!this._def.checks.find(e=>e.kind==="email")}get isURL(){return !!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return !!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return !!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return !!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return !!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return !!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return !!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return !!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return !!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return !!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return !!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Ce.create=t=>new Ce({checks:[],typeName:y.ZodString,coerce:t?.coerce??false,..._(t)});function zs(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,o=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return o%a/10**s}var je=class t extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf;}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.number){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_type,expected:g.number,received:o.parsedType}),h}let r,s=new H;for(let o of this._def.checks)o.kind==="int"?S.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:false,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:false,message:o.message}),s.dirty()):o.kind==="multipleOf"?zs(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.not_finite,message:o.message}),s.dirty()):S.assertNever(o);return {status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,true,m.toString(n))}gt(e,n){return this.setLimit("min",e,false,m.toString(n))}lte(e,n){return this.setLimit("max",e,true,m.toString(n))}lt(e,n){return this.setLimit("max",e,false,m.toString(n))}setLimit(e,n,r,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:m.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:false,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:false,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:true,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:true,message:m.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:true,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:true,value:Number.MAX_SAFE_INTEGER,message:m.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return !!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&S.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return true;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);}return Number.isFinite(n)&&Number.isFinite(e)}};je.create=t=>new je({checks:[],typeName:y.ZodNumber,coerce:t?.coerce||false,..._(t)});var Le=class t extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte;}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data);}catch{return this._getInvalidInput(e)}if(this._getType(e)!==g.bigint)return this._getInvalidInput(e);let r,s=new H;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):S.assertNever(o);return {status:s.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return p(n,{code:u.invalid_type,expected:g.bigint,received:n.parsedType}),h}gte(e,n){return this.setLimit("min",e,true,m.toString(n))}gt(e,n){return this.setLimit("min",e,false,m.toString(n))}lte(e,n){return this.setLimit("max",e,true,m.toString(n))}lt(e,n){return this.setLimit("max",e,false,m.toString(n))}setLimit(e,n,r,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:m.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:false,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:false,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:true,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:true,message:m.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Le.create=t=>new Le({checks:[],typeName:y.ZodBigInt,coerce:t?.coerce??false,..._(t)});var $e=class extends w{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.boolean,received:r.parsedType}),h}return K(e.data)}};$e.create=t=>new $e({typeName:y.ZodBoolean,coerce:t?.coerce||false,..._(t)});var Ve=class t extends w{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_type,expected:g.date,received:o.parsedType}),h}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_date}),h}let r=new H,s;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_small,message:o.message,inclusive:true,exact:false,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_big,message:o.message,inclusive:true,exact:false,maximum:o.value,type:"date"}),r.dirty()):S.assertNever(o);return {status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:m.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Ve.create=t=>new Ve({checks:[],coerce:t?.coerce||false,typeName:y.ZodDate,..._(t)});var lt=class extends w{_parse(e){if(this._getType(e)!==g.symbol){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.symbol,received:r.parsedType}),h}return K(e.data)}};lt.create=t=>new lt({typeName:y.ZodSymbol,..._(t)});var Ue=class extends w{_parse(e){if(this._getType(e)!==g.undefined){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.undefined,received:r.parsedType}),h}return K(e.data)}};Ue.create=t=>new Ue({typeName:y.ZodUndefined,..._(t)});var Me=class extends w{_parse(e){if(this._getType(e)!==g.null){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.null,received:r.parsedType}),h}return K(e.data)}};Me.create=t=>new Me({typeName:y.ZodNull,..._(t)});var Ie=class extends w{constructor(){super(...arguments),this._any=true;}_parse(e){return K(e.data)}};Ie.create=t=>new Ie({typeName:y.ZodAny,..._(t)});var ke=class extends w{constructor(){super(...arguments),this._unknown=true;}_parse(e){return K(e.data)}};ke.create=t=>new ke({typeName:y.ZodUnknown,..._(t)});var ae=class extends w{_parse(e){let n=this._getOrReturnCtx(e);return p(n,{code:u.invalid_type,expected:g.never,received:n.parsedType}),h}};ae.create=t=>new ae({typeName:y.ZodNever,..._(t)});var ut=class extends w{_parse(e){if(this._getType(e)!==g.undefined){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.void,received:r.parsedType}),h}return K(e.data)}};ut.create=t=>new ut({typeName:y.ZodVoid,..._(t)});var _e=class t extends w{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==g.array)return p(n,{code:u.invalid_type,expected:g.array,received:n.parsedType}),h;if(s.exactLength!==null){let a=n.data.length>s.exactLength.value,i=n.data.length<s.exactLength.value;(a||i)&&(p(n,{code:a?u.too_big:u.too_small,minimum:i?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:true,exact:true,message:s.exactLength.message}),r.dirty());}if(s.minLength!==null&&n.data.length<s.minLength.value&&(p(n,{code:u.too_small,minimum:s.minLength.value,type:"array",inclusive:true,exact:false,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(p(n,{code:u.too_big,maximum:s.maxLength.value,type:"array",inclusive:true,exact:false,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,i)=>s.type._parseAsync(new se(n,a,n.path,i)))).then(a=>H.mergeArray(r,a));let o=[...n.data].map((a,i)=>s.type._parseSync(new se(n,a,n.path,i)));return H.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:m.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:m.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:m.toString(n)}})}nonempty(e){return this.min(1,e)}};_e.create=(t,e)=>new _e({type:t,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,..._(e)});function ct(t){if(t instanceof X){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=re.create(ct(r));}return new X({...t._def,shape:()=>e})}else return t instanceof _e?new _e({...t._def,type:ct(t.element)}):t instanceof re?re.create(ct(t.unwrap())):t instanceof pe?pe.create(ct(t.unwrap())):t instanceof fe?fe.create(t.items.map(e=>ct(e))):t}var X=class t extends w{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend;}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=S.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==g.object){let l=this._getOrReturnCtx(e);return p(l,{code:u.invalid_type,expected:g.object,received:l.parsedType}),h}let{status:r,ctx:s}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof ae&&this._def.unknownKeys==="strip"))for(let l in s.data)a.includes(l)||i.push(l);let c=[];for(let l of a){let d=o[l],x=s.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new se(s,x,s.path,l)),alwaysSet:l in s.data});}if(this._def.catchall instanceof ae){let l=this._def.unknownKeys;if(l==="passthrough")for(let d of i)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(l==="strict")i.length>0&&(p(s,{code:u.unrecognized_keys,keys:i}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else {let l=this._def.catchall;for(let d of i){let x=s.data[d];c.push({key:{status:"valid",value:d},value:l._parse(new se(s,x,s.path,d)),alwaysSet:d in s.data});}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let d of c){let x=await d.key,L=await d.value;l.push({key:x,value:L,alwaysSet:d.alwaysSet});}return l}).then(l=>H.mergeObjectSync(r,l)):H.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let s=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:m.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of S.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of S.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return ct(this)}partial(e){let n={};for(let r of S.objectKeys(this.shape)){let s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional();}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of S.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else {let o=this.shape[r];for(;o instanceof re;)o=o._def.innerType;n[r]=o;}return new t({...this._def,shape:()=>n})}keyof(){return or(S.objectKeys(this.shape))}};X.create=(t,e)=>new X({shape:()=>t,unknownKeys:"strip",catchall:ae.create(),typeName:y.ZodObject,..._(e)});X.strictCreate=(t,e)=>new X({shape:()=>t,unknownKeys:"strict",catchall:ae.create(),typeName:y.ZodObject,..._(e)});X.lazycreate=(t,e)=>new X({shape:t,unknownKeys:"strip",catchall:ae.create(),typeName:y.ZodObject,..._(e)});var Be=class extends w{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function s(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(i=>new Y(i.ctx.common.issues));return p(n,{code:u.invalid_union,unionErrors:a}),h}if(n.common.async)return Promise.all(r.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return {result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(s);{let o,a=[];for(let c of r){let l={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:l}),l.common.issues.length&&a.push(l.common.issues);}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(c=>new Y(c));return p(n,{code:u.invalid_union,unionErrors:i}),h}}get options(){return this._def.options}};Be.create=(t,e)=>new Be({options:t,typeName:y.ZodUnion,..._(e)});var ve=t=>t instanceof ze?ve(t.schema):t instanceof oe?ve(t.innerType()):t instanceof He?[t.value]:t instanceof Je?t.options:t instanceof Ke?S.objectValues(t.enum):t instanceof Ge?ve(t._def.innerType):t instanceof Ue?[void 0]:t instanceof Me?[null]:t instanceof re?[void 0,...ve(t.unwrap())]:t instanceof pe?[null,...ve(t.unwrap())]:t instanceof xt||t instanceof We?ve(t.unwrap()):t instanceof Ze?ve(t._def.innerType):[],Gt=class t extends w{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==g.object)return p(n,{code:u.invalid_type,expected:g.object,received:n.parsedType}),h;let r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(p(n,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),h)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let s=new Map;for(let o of n){let a=ve(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of a){if(s.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);s.set(i,o);}}return new t({typeName:y.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,..._(r)})}};function Tn(t,e){let n=de(t),r=de(e);if(t===e)return {valid:true,data:t};if(n===g.object&&r===g.object){let s=S.objectKeys(e),o=S.objectKeys(t).filter(i=>s.indexOf(i)!==-1),a={...t,...e};for(let i of o){let c=Tn(t[i],e[i]);if(!c.valid)return {valid:false};a[i]=c.data;}return {valid:true,data:a}}else if(n===g.array&&r===g.array){if(t.length!==e.length)return {valid:false};let s=[];for(let o=0;o<t.length;o++){let a=t[o],i=e[o],c=Tn(a,i);if(!c.valid)return {valid:false};s.push(c.data);}return {valid:true,data:s}}else return n===g.date&&r===g.date&&+t==+e?{valid:true,data:t}:{valid:false}}var Fe=class extends w{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),s=(o,a)=>{if(Jt(o)||Jt(a))return h;let i=Tn(o.value,a.value);return i.valid?((Kt(o)||Kt(a))&&n.dirty(),{status:n.value,value:i.data}):(p(r,{code:u.invalid_intersection_types}),h)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Fe.create=(t,e,n)=>new Fe({left:t,right:e,typeName:y.ZodIntersection,..._(n)});var fe=class t extends w{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.array)return p(r,{code:u.invalid_type,expected:g.array,received:r.parsedType}),h;if(r.data.length<this._def.items.length)return p(r,{code:u.too_small,minimum:this._def.items.length,inclusive:true,exact:false,type:"array"}),h;!this._def.rest&&r.data.length>this._def.items.length&&(p(r,{code:u.too_big,maximum:this._def.items.length,inclusive:true,exact:false,type:"array"}),n.dirty());let o=[...r.data].map((a,i)=>{let c=this._def.items[i]||this._def.rest;return c?c._parse(new se(r,a,r.path,i)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>H.mergeArray(n,a)):H.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};fe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fe({items:t,typeName:y.ZodTuple,rest:null,..._(e)})};var Zt=class t extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.object)return p(r,{code:u.invalid_type,expected:g.object,received:r.parsedType}),h;let s=[],o=this._def.keyType,a=this._def.valueType;for(let i in r.data)s.push({key:o._parse(new se(r,i,r.path,i)),value:a._parse(new se(r,r.data[i],r.path,i)),alwaysSet:i in r.data});return r.common.async?H.mergeObjectAsync(n,s):H.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof w?new t({keyType:e,valueType:n,typeName:y.ZodRecord,..._(r)}):new t({keyType:Ce.create(),valueType:e,typeName:y.ZodRecord,..._(n)})}},dt=class extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.map)return p(r,{code:u.invalid_type,expected:g.map,received:r.parsedType}),h;let s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([i,c],l)=>({key:s._parse(new se(r,i,r.path,[l,"key"])),value:o._parse(new se(r,c,r.path,[l,"value"]))}));if(r.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,d=await c.value;if(l.status==="aborted"||d.status==="aborted")return h;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),i.set(l.value,d.value);}return {status:n.value,value:i}})}else {let i=new Map;for(let c of a){let l=c.key,d=c.value;if(l.status==="aborted"||d.status==="aborted")return h;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),i.set(l.value,d.value);}return {status:n.value,value:i}}}};dt.create=(t,e,n)=>new dt({valueType:e,keyType:t,typeName:y.ZodMap,..._(n)});var ft=class t extends w{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.set)return p(r,{code:u.invalid_type,expected:g.set,received:r.parsedType}),h;let s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(p(r,{code:u.too_small,minimum:s.minSize.value,type:"set",inclusive:true,exact:false,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(p(r,{code:u.too_big,maximum:s.maxSize.value,type:"set",inclusive:true,exact:false,message:s.maxSize.message}),n.dirty());let o=this._def.valueType;function a(c){let l=new Set;for(let d of c){if(d.status==="aborted")return h;d.status==="dirty"&&n.dirty(),l.add(d.value);}return {status:n.value,value:l}}let i=[...r.data.values()].map((c,l)=>o._parse(new se(r,c,r.path,l)));return r.common.async?Promise.all(i).then(c=>a(c)):a(i)}min(e,n){return new t({...this._def,minSize:{value:e,message:m.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:m.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};ft.create=(t,e)=>new ft({valueType:t,minSize:null,maxSize:null,typeName:y.ZodSet,..._(e)});var Wt=class t extends w{constructor(){super(...arguments),this.validate=this.implement;}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==g.function)return p(n,{code:u.invalid_type,expected:g.function,received:n.parsedType}),h;function r(i,c){return bt({data:i,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,it(),ye].filter(l=>!!l),issueData:{code:u.invalid_arguments,argumentsError:c}})}function s(i,c){return bt({data:i,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,it(),ye].filter(l=>!!l),issueData:{code:u.invalid_return_type,returnTypeError:c}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Ne){let i=this;return K(async function(...c){let l=new Y([]),d=await i._def.args.parseAsync(c,o).catch(N=>{throw l.addIssue(r(c,N)),l}),x=await Reflect.apply(a,this,d);return await i._def.returns._def.type.parseAsync(x,o).catch(N=>{throw l.addIssue(s(x,N)),l})})}else {let i=this;return K(function(...c){let l=i._def.args.safeParse(c,o);if(!l.success)throw new Y([r(c,l.error)]);let d=Reflect.apply(a,this,l.data),x=i._def.returns.safeParse(d,o);if(!x.success)throw new Y([s(d,x.error)]);return x.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:fe.create(e).rest(ke.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||fe.create([]).rest(ke.create()),returns:n||ke.create(),typeName:y.ZodFunction,..._(r)})}},ze=class extends w{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};ze.create=(t,e)=>new ze({getter:t,typeName:y.ZodLazy,..._(e)});var He=class extends w{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return p(n,{received:n.data,code:u.invalid_literal,expected:this._def.value}),h}return {status:"valid",value:e.data}}get value(){return this._def.value}};He.create=(t,e)=>new He({value:t,typeName:y.ZodLiteral,..._(e)});function or(t,e){return new Je({values:t,typeName:y.ZodEnum,..._(e)})}var Je=class t extends w{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{expected:S.joinValues(r),received:n.parsedType,code:u.invalid_type}),h}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{received:n.data,code:u.invalid_enum_value,options:r}),h}return K(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Je.create=or;var Ke=class extends w{_parse(e){let n=S.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==g.string&&r.parsedType!==g.number){let s=S.objectValues(n);return p(r,{expected:S.joinValues(s),received:r.parsedType,code:u.invalid_type}),h}if(this._cache||(this._cache=new Set(S.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=S.objectValues(n);return p(r,{received:r.data,code:u.invalid_enum_value,options:s}),h}return K(e.data)}get enum(){return this._def.values}};Ke.create=(t,e)=>new Ke({values:t,typeName:y.ZodNativeEnum,..._(e)});var Ne=class extends w{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==g.promise&&n.common.async===false)return p(n,{code:u.invalid_type,expected:g.promise,received:n.parsedType}),h;let r=n.parsedType===g.promise?n.data:Promise.resolve(n.data);return K(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Ne.create=(t,e)=>new Ne({type:t,typeName:y.ZodPromise,..._(e)});var oe=class extends w{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:a=>{p(r,a),a.fatal?n.abort():n.dirty();},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let a=s.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async i=>{if(n.value==="aborted")return h;let c=await this._def.schema._parseAsync({data:i,path:r.path,parent:r});return c.status==="aborted"?h:c.status==="dirty"?De(c.value):n.value==="dirty"?De(c.value):c});{if(n.value==="aborted")return h;let i=this._def.schema._parseSync({data:a,path:r.path,parent:r});return i.status==="aborted"?h:i.status==="dirty"?De(i.value):n.value==="dirty"?De(i.value):i}}if(s.type==="refinement"){let a=i=>{let c=s.refinement(i,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(r.common.async===false){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?h:(i.status==="dirty"&&n.dirty(),a(i.value),{status:n.value,value:i.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>i.status==="aborted"?h:(i.status==="dirty"&&n.dirty(),a(i.value).then(()=>({status:n.value,value:i.value}))))}if(s.type==="transform")if(r.common.async===false){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Re(a))return h;let i=s.transform(a.value,o);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return {status:n.value,value:i}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Re(a)?Promise.resolve(s.transform(a.value,o)).then(i=>({status:n.value,value:i})):h);S.assertNever(s);}};oe.create=(t,e,n)=>new oe({schema:t,typeName:y.ZodEffects,effect:e,..._(n)});oe.createWithPreprocess=(t,e,n)=>new oe({schema:e,effect:{type:"preprocess",transform:t},typeName:y.ZodEffects,..._(n)});var re=class extends w{_parse(e){return this._getType(e)===g.undefined?K(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};re.create=(t,e)=>new re({innerType:t,typeName:y.ZodOptional,..._(e)});var pe=class extends w{_parse(e){return this._getType(e)===g.null?K(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};pe.create=(t,e)=>new pe({innerType:t,typeName:y.ZodNullable,..._(e)});var Ge=class extends w{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===g.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ge.create=(t,e)=>new Ge({innerType:t,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});var Ze=class extends w{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return at(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Y(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Y(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Ze.create=(t,e)=>new Ze({innerType:t,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});var pt=class extends w{_parse(e){if(this._getType(e)!==g.nan){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.nan,received:r.parsedType}),h}return {status:"valid",value:e.data}}};pt.create=t=>new pt({typeName:y.ZodNaN,..._(t)});var Hs=Symbol("zod_brand"),xt=class extends w{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Rt=class t extends w{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return (async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?h:o.status==="dirty"?(n.dirty(),De(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?h:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:y.ZodPipeline})}},We=class extends w{_parse(e){let n=this._def.innerType._parse(e),r=s=>(Re(s)&&(s.value=Object.freeze(s.value)),s);return at(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}};We.create=(t,e)=>new We({innerType:t,typeName:y.ZodReadonly,..._(e)});function tr(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function ir(t,e={},n){return t?Ie.create().superRefine((r,s)=>{let o=t(r);if(o instanceof Promise)return o.then(a=>{if(!a){let i=tr(e,r),c=i.fatal??n??true;s.addIssue({code:"custom",...i,fatal:c});}});if(!o){let a=tr(e,r),i=a.fatal??n??true;s.addIssue({code:"custom",...a,fatal:i});}}):Ie.create()}var Js={object:X.lazycreate},y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly";})(y||(y={}));var Ks=(t,e={message:`Input not instance of ${t.name}`})=>ir(n=>n instanceof t,e),ar=Ce.create,cr=je.create,Gs=pt.create,Zs=Le.create,lr=$e.create,Ws=Ve.create,qs=lt.create,Ys=Ue.create,Xs=Me.create,Qs=Ie.create,eo=ke.create,to=ae.create,no=ut.create,ro=_e.create,so=X.create,oo=X.strictCreate,io=Be.create,ao=Gt.create,co=Fe.create,lo=fe.create,uo=Zt.create,fo=dt.create,po=ft.create,go=Wt.create,mo=ze.create,ho=He.create,yo=Je.create,vo=Ke.create,ko=Ne.create,_o=oe.create,wo=re.create,Eo=pe.create,So=oe.createWithPreprocess,To=Rt.create,Ao=()=>ar().optional(),bo=()=>cr().optional(),xo=()=>lr().optional(),Ro={string:(t=>Ce.create({...t,coerce:true})),number:(t=>je.create({...t,coerce:true})),boolean:(t=>$e.create({...t,coerce:true})),bigint:(t=>Le.create({...t,coerce:true})),date:(t=>Ve.create({...t,coerce:true}))};var Co=h;var Io={api:{rateLimit:{windowMs:900*1e3,maxRequests:100}}};f.object({snapshot_version:f.string(),engine_target_version:f.string(),project_id:f.string(),generated_at:f.string(),root_path_hash:f.string(),metadata:f.object({total_files:f.number().int().nonnegative(),total_dependencies:f.number().int().nonnegative(),total_size_bytes:f.number().int().nonnegative(),total_lines:f.number().int().nonnegative(),max_directory_depth:f.number().int().nonnegative(),language_breakdown:f.record(f.string(),f.number().int().nonnegative())}),files:f.array(f.object({id:f.string(),path_hash:f.string(),depth:f.number().int().nonnegative(),size_bytes:f.number().int().nonnegative(),estimated_lines:f.number().int().nonnegative(),extension:f.string(),is_binary:f.boolean(),import_count:f.number().int().nonnegative().optional(),function_count:f.number().int().nonnegative().optional(),class_count:f.number().int().nonnegative().optional()})),dependencies:f.array(f.object({id:f.string(),name_hash:f.string(),major_version:f.number().int().nonnegative(),minor_version:f.number().int().nonnegative(),category:f.enum(["dev","prod","peer"])}))});f.object({name:f.string().min(1).max(100)});f.object({analysis_version:f.string(),snapshot_schema_version:f.string(),total_score:f.number().min(0).max(100),severity_band:f.enum(["HEALTHY","STABLE","STRUCTURAL_CONCERN","HIGH_RISK"]),engines:f.array(f.object({engine_name:f.string(),score_impact:f.number(),risk_level:f.enum(["HEALTHY","STABLE","STRUCTURAL_CONCERN","HIGH_RISK"]),metrics:f.record(f.number()),findings:f.array(f.object({rule_id:f.string(),title:f.string(),message:f.string(),severity:f.enum(["CRITICAL","HIGH","MEDIUM","LOW"]),category:f.enum(["SECURITY","STRUCTURE","COMPLEXITY","DEPENDENCY","REPOSITORY_HYGIENE","DOCUMENTATION","QUALITY"]),evidence:f.array(f.string()).optional(),explanation:f.string().optional(),impact:f.string().optional(),effort:f.enum(["Low","Medium","High"]).optional(),recommendations:f.array(f.string()).optional()}))})),summary:f.object({total_findings:f.number().int().nonnegative(),critical_count:f.number().int().nonnegative(),high_count:f.number().int().nonnegative(),medium_count:f.number().int().nonnegative(),low_count:f.number().int().nonnegative(),categories:f.record(f.string(),f.number().int().nonnegative())}),generated_at:f.string()});var No=f.object({NEXT_PUBLIC_SUPABASE_URL:f.string().url("Invalid SUPABASE_URL"),NEXT_PUBLIC_SUPABASE_ANON_KEY:f.string().min(1,"SUPABASE_ANON_KEY is required"),SUPABASE_SERVICE_ROLE_KEY:f.string().min(1,"SERVICE_ROLE_KEY is required"),NODE_ENV:f.enum(["development","production","test"],{errorMap:()=>({message:"NODE_ENV must be development, production, or test"})}),JWT_SECRET:f.string().min(32,"JWT_SECRET must be at least 32 characters").optional()});function Oo(){try{return No.parse(process.env)}catch(t){if(t instanceof f.ZodError){let e=t.errors.map(n=>n.path.join(".")).join(", ");throw new Error(`Environment validation failed:
|
|
24
24
|
Missing or invalid variables: ${e}
|
|
25
25
|
Please check your .env file and ensure all required variables are set.`)}throw t}}var An=null;function Po(){return An||(An=Oo()),An}new Proxy({},{get(t,e){return Po()[e]}});var qe=new Map;function Do(t=Io.api.rateLimit){let{windowMs:e,maxRequests:n,message:r}=t;return {check(s){let o=Date.now(),a=qe.get(s);a&&o>a.resetTime&&qe.delete(s);let i=qe.get(s)||{count:0,resetTime:o+e};return i.count>=n?{success:false,remaining:0,resetTime:i.resetTime,error:r||"Too many requests"}:(i.count++,qe.set(s,i),{success:true,remaining:n-i.count,resetTime:i.resetTime})},reset(s){qe.delete(s);},cleanup(){let s=Date.now();for(let[o,a]of qe.entries())s>a.resetTime&&qe.delete(o);}}}Do();var Lo={TOKEN_BINDING_SALT:kn};function dr(t,e){let n=`${t}:${e}:${Lo.TOKEN_BINDING_SALT}`;return ge.createHash("sha256").update(n).digest("hex")}function fr(t,e,n,r,s="cli"){let o=new Date().toISOString(),a=Mo(),i=$o(t,e,n,o,a),c=Vo(o,s,i),l=Uo(r,o,s,c);return {signature:l,timestamp:o,nonce:a,headers:{"X-Signature":l,"X-Timestamp":o,"X-Nonce":a,"X-Signed-Headers":"host;x-timestamp;x-nonce"}}}function $o(t,e,n,r,s){let o=ge.createHash("sha256").update(n).digest("hex");return [t.toUpperCase(),e,"",`host:www.veestack.com
|
|
26
26
|
`,`x-timestamp:${r}
|
|
@@ -56,15 +56,15 @@ Creating project on VeeStack...`));let U=await ri(d.projectName,d.framework);U?(
|
|
|
56
56
|
\u2714 Configuration saved to veestack.config.json`)),I&&console.log(v.yellow("\u26A0 Framework detection failed. Some settings may need manual adjustment."));return}console.log(v.green(`
|
|
57
57
|
\u2714 Configuration saved to veestack.config.json`)),I&&console.log(v.yellow("\u26A0 Framework detection failed. Some settings may need manual adjustment.")),console.log(v.bold(`
|
|
58
58
|
Next steps:`)),console.log(v.gray(" 1. Run analysis:")),console.log(v.cyan(" veestack scan")),console.log(v.gray(" 2. Upload results:")),console.log(v.cyan(" veestack upload")),console.log(v.gray(" 3. View in dashboard:")),console.log(v.cyan(` https://www.veestack.com/dashboard${L?`/projects/${L}`:""}
|
|
59
|
-
`));}var Cn=globalThis,vi=Cn.CLI_VERSION||"unknown",ki=Cn.SNAPSHOT_VERSION||"unknown",_i=Cn.ENGINE_TARGET||"unknown";function wi(t){let e={},n=t.split(/\r?\n/),r=false,s=null;for(let o of n){let a=o.replace(/\t/g," "),i=a.trim();if(!r){/^packages\s*:\s*$/.test(i)&&(r=true,s=a.match(/^\s*/)?.[0].length??0);continue}if(i!==""&&!i.startsWith("#")){let N=a.match(/^\s*/)?.[0].length??0;if(s!==null&&N<=s)break}let c=i.match(/^\/?([^\s]+)\s*:\s*$/);if(!c)continue;let l=c[1].replace(/^\/+/,""),d=l.lastIndexOf("@");if(d<=0)continue;let
|
|
60
|
-
`).filter(Boolean)}catch{return []}}async function Ri(t,e,n,r=false){let s=[],o=await glob(e,{cwd:t,ignore:n,nodir:true,dot:true,absolute:false});if(r){let i=await xi(t);i.length>0&&(o=o.filter(c=>i.includes(c)));}let a=o.filter(i=>!i.replace(/\\/g,"/").match(/(node_modules|\.next|dist|build|\.git)\//));for(let i of a){let c=statSync(join(t,i));c.isFile()&&s.push({id:ge__default.randomUUID(),path:i,path_hash:In(i),depth:i.split(/[\\/]/).length,size_bytes:c.size,estimated_lines:Math.floor(c.size/50),extension:i.split(".").pop()||"",is_binary:Si(i)});}return s.sort((i,c)=>i.path_hash.localeCompare(c.path_hash))}async function Ci(t){let e=[];try{let n=join(t,"package.json");if(!existsSync(n))return [];let r=JSON.parse(readFileSync(n,"utf-8")),s={},o=join(t,"pnpm-lock.yaml"),a=join(t,"package-lock.json");if(existsSync(o))s=wi(readFileSync(o,"utf8"));else if(existsSync(a)){let c=JSON.parse(readFileSync(a,"utf8"));for(let[l,d]of Object.entries(c.packages||{}))l&&d.version&&(s[l.replace("node_modules/","")]=d.version);}let i=(c,l)=>{for(let[d,
|
|
59
|
+
`));}var Cn=globalThis,vi=Cn.CLI_VERSION||"unknown",ki=Cn.SNAPSHOT_VERSION||"unknown",_i=Cn.ENGINE_TARGET||"unknown";function wi(t){let e={},n=t.split(/\r?\n/),r=false,s=null;for(let o of n){let a=o.replace(/\t/g," "),i=a.trim();if(!r){/^packages\s*:\s*$/.test(i)&&(r=true,s=a.match(/^\s*/)?.[0].length??0);continue}if(i!==""&&!i.startsWith("#")){let N=a.match(/^\s*/)?.[0].length??0;if(s!==null&&N<=s)break}let c=i.match(/^\/?([^\s]+)\s*:\s*$/);if(!c)continue;let l=c[1].replace(/^\/+/,""),d=l.lastIndexOf("@");if(d<=0)continue;let x=l.slice(0,d),L=l.slice(d+1);!x||!L||!/^\d+\./.test(L)||(e[x]=L);}return e}function Ei(){if(process.env.GITHUB_ACTIONS){let[t,e]=(process.env.GITHUB_REPOSITORY||"").split("/");return {provider:"github_actions",repo_owner:t,repo_name:e,commit_sha:process.env.GITHUB_SHA,run_id:process.env.GITHUB_RUN_ID,event_name:process.env.GITHUB_EVENT_NAME,pr_number:process.env.GITHUB_REF?.includes("refs/pull/")?parseInt(process.env.GITHUB_REF.split("/")[2]):void 0}}}function In(t){return ge__default.createHash("sha256").update(t).digest("hex")}function Si(t){let e=[".exe",".dll",".so",".dylib",".bin",".png",".jpg",".jpeg",".gif",".pdf",".zip",".tar",".gz",".7z",".woff",".woff2",".ttf",".eot"],n=t.split(".").pop()?.toLowerCase();return n?e.includes("."+n):false}function Ti(t){return {ts:"TypeScript",js:"JavaScript",tsx:"TypeScript",jsx:"JavaScript",py:"Python",go:"Go",rs:"Rust",java:"Java",kt:"Kotlin",rb:"Ruby",php:"PHP",cs:"C#",cpp:"C++",c:"C",h:"C",json:"JSON",yaml:"YAML",yml:"YAML",md:"Markdown",html:"HTML",css:"CSS",scss:"SCSS",sql:"SQL",sh:"Shell",mjs:"JavaScript",cjs:"JavaScript",svelte:"Svelte",vue:"Vue"}[t]||"Other"}function Ai(t){let e={};for(let n of t){let r=Ti(n.extension.toLowerCase());e[r]=(e[r]||0)+1;}return e}function bi(t,e){let a=0,i={critical:0,high:0,medium:0,low:0};e&&(i={critical:e.criticalCount||0,high:e.highCount||0,medium:e.mediumCount||0,low:e.lowCount||0},a=i.critical*25+i.high*15+i.medium*5+i.low*2);let c=Math.max(0,100-a),l="F";return c===100?l="A+":c>=90?l="A":c>=80?l="B":c>=70?l="C":c>=60&&(l="D"),{score:c,grade:l,breakdown:i}}async function xi(t){try{return execSync("git diff --name-only HEAD",{cwd:t,encoding:"utf-8"}).split(`
|
|
60
|
+
`).filter(Boolean)}catch{return []}}async function Ri(t,e,n,r=false){let s=[],o=await glob(e,{cwd:t,ignore:n,nodir:true,dot:true,absolute:false});if(r){let i=await xi(t);i.length>0&&(o=o.filter(c=>i.includes(c)));}let a=o.filter(i=>!i.replace(/\\/g,"/").match(/(node_modules|\.next|dist|build|\.git)\//));for(let i of a){let c=statSync(join(t,i));c.isFile()&&s.push({id:ge__default.randomUUID(),path:i,path_hash:In(i),depth:i.split(/[\\/]/).length,size_bytes:c.size,estimated_lines:Math.floor(c.size/50),extension:i.split(".").pop()||"",is_binary:Si(i)});}return s.sort((i,c)=>i.path_hash.localeCompare(c.path_hash))}async function Ci(t){let e=[];try{let n=join(t,"package.json");if(!existsSync(n))return [];let r=JSON.parse(readFileSync(n,"utf-8")),s={},o=join(t,"pnpm-lock.yaml"),a=join(t,"package-lock.json");if(existsSync(o))s=wi(readFileSync(o,"utf8"));else if(existsSync(a)){let c=JSON.parse(readFileSync(a,"utf8"));for(let[l,d]of Object.entries(c.packages||{}))l&&d.version&&(s[l.replace("node_modules/","")]=d.version);}let i=(c,l)=>{for(let[d,x]of Object.entries(c)){let L=s[d]||x.replace(/[\^~]/,""),N=L.match(/^(\d+)\.(\d+)/);e.push({id:ge__default.randomUUID(),name_hash:In(d),name:d,version:L,major_version:N?parseInt(N[1]):0,minor_version:N?parseInt(N[2]):0,category:l});}};r.dependencies&&i(r.dependencies,"prod"),r.devDependencies&&i(r.devDependencies,"dev"),r.peerDependencies&&i(r.peerDependencies,"peer");}catch{}return e.sort((n,r)=>n.name_hash.localeCompare(r.name_hash))}async function Ii(t,e){let n=await Ci(t);return {snapshot_version:ki,engine_target_version:_i,project_id:ge__default.randomUUID(),generated_at:new Date().toISOString(),root_path_hash:In(t),project_root:resolve(t),metadata:{total_files:e.length,total_dependencies:n.length,total_size_bytes:e.reduce((r,s)=>r+s.size_bytes,0),total_lines:e.reduce((r,s)=>r+(s.estimated_lines||0),0),max_directory_depth:Math.max(...e.map(r=>r.depth),0),language_breakdown:Ai(e)},files:e,dependencies:n,ci_metadata:Ei()}}async function Nn(t){let e=t.quiet||t.json,n=t.ci||process.env.CI==="true",r=resolve(t.path),s=basename(r),o=s,a=join(r,"package.json"),i=join(r,"veestack.config.json");if(existsSync(a))try{let d=JSON.parse(readFileSync(a,"utf-8"));d.name&&(o=d.name);}catch{}if(existsSync(i))try{let d=JSON.parse(readFileSync(i,"utf-8"));d.name&&(o=d.name);}catch{}e||(console.log(v.bold.cyan(`
|
|
61
61
|
VeeStack Security Scan`)),console.log(v.gray("\u2500".repeat(40))));await Te();if(!existsSync(i)&&!t.json){if(n)console.log(v.gray(`
|
|
62
62
|
\u26A1 CI mode detected: Using default project name and scan directories`)),await vt({ci:true,skipAuthCheck:true,skipNextSteps:true});else if(!e){console.log(v.cyan(`
|
|
63
63
|
\u2728 Welcome to VeeStack!`)),console.log(v.gray(`Let's configure your project to start scanning for security issues.
|
|
64
64
|
`));let{runInit:d}=await Cr({type:"confirm",name:"runInit",message:"Would you like to run 'veestack init' first?",initial:true});d?await vt({skipAuthCheck:true,skipNextSteps:true}):console.log(v.gray(`
|
|
65
65
|
Using smart defaults for this scan...`));}}let l=gi({text:"Preparing scan...",spinner:"dots",stream:process.stdout});e||(console.log(`
|
|
66
66
|
`+v.bold.cyan("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501")),console.log(v.bold.white(" Analyzing Project")),console.log(v.bold.cyan(`\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
67
|
-
`)),l.start());try{let d=Date.now(),
|
|
67
|
+
`)),l.start());try{let d=Date.now(),x=existsSync(i)?JSON.parse(readFileSync(i,"utf-8")):{},L=x.scanPatterns||["**/*.{js,jsx,ts,tsx,json,py,go,rs,rb,php,cs,cpp,c,h,mjs,cjs,svelte,vue,html}"],N=x.excludePatterns||["**/node_modules/**","**/.next/**","**/dist/**","**/build/**","**/.git/**","**/coverage/**","**/*.test.ts","**/*.spec.ts"],I=await Ri(r,L,N,t.diff);if(I.length===0&&!t.json){e||console.log(v.yellow(`
|
|
68
68
|
\u26A0 No source files found to scan.`));return}let U=new hi.SingleBar({format:"Scanning |"+v.cyan("{bar}")+"| {percentage}% ({value}/{total} files)",barCompleteChar:"\u2588",barIncompleteChar:"\u2591",hideCursor:!0});e||U.start(I.length,0);let F=await qn(r,I.map(ee=>ee.path));e||(U.update(Math.floor(I.length*.5)),l.text="Analyzing security...");let $=bi(I.length,F),St=`report-${o}-security.json`;if(F.secretsFound>0){let ee={project:o,directory:s,timestamp:new Date().toISOString(),score:$.score,grade:$.grade,criticalIssues:F.criticalCount,issues:F.results};await(await import('fs/promises')).writeFile(St,JSON.stringify(ee,null,2));}t.json&&(console.log(JSON.stringify({version:vi,timestamp:new Date().toISOString(),score:$.score,grade:$.grade,files:I.length,issues:$.breakdown,project:o,directory:s},null,2)),process.exit(0)),F.criticalCount>0&&(e||(U.stop(),l.fail("Security validation failed"),console.log(v.red(`
|
|
69
69
|
\u274C ${F.criticalCount} Critical security risks detected.`)),F.secretsFound>0&&(console.log(v.gray(`
|
|
70
70
|
Issues detail:`)),F.results.slice(0,5).forEach(ee=>{console.log(v.yellow(` \u2022 ${ee.ruleId}: `)+v.gray(`${ee.filePath}:${ee.line}`));}),F.secretsFound>5&&console.log(v.gray(` ... and ${F.secretsFound-5} more issues.`))),console.log(v.cyan(`
|
|
@@ -95,13 +95,13 @@ Enter project name: `);if(r.trim()){let s=await Pr(r.trim());if(s)return console
|
|
|
95
95
|
\u{1F510} Authentication verified`)),r.user&&console.log(v.gray(`User: ${r.user.name}`)),console.log(v.gray(`Subscription tier: ${s==="pro"?"Pro":"Free"}`)),console.log(v.gray("\u2500".repeat(40)+`
|
|
96
96
|
`)));let o=gi({text:"Preparing upload...",isSilent:n}).start();try{let a=await import('fs/promises');existsSync(t.file)||(o.fail(`File not found: ${t.file}`),n||console.log(v.yellow(`
|
|
97
97
|
Tip: Run "veestack scan" first to generate a snapshot.`)),process.exit(1));let i=await a.readFile(t.file,"utf-8"),c=JSON.parse(i),l=t.projectId||process.env.VEESTACK_PROJECT_ID;if(!l){n&&(o.fail("Project ID is required in CI mode. Please set VEESTACK_PROJECT_ID."),process.exit(1)),o.stop();let le=await $i();le||(console.log(v.red(`
|
|
98
|
-
\u274C No project selected. Exiting.`)),process.exit(1)),l=le,o.start("Uploading snapshot...");}o.text="Compressing and uploading snapshot...";let d=gzipSync(JSON.stringify(c)).toString("base64"),
|
|
98
|
+
\u274C No project selected. Exiting.`)),process.exit(1)),l=le,o.start("Uploading snapshot...");}o.text="Compressing and uploading snapshot...";let d=gzipSync(JSON.stringify(c)).toString("base64"),x=JSON.stringify({project_id:l,snapshot:d,compressed:!0,encoding:"base64"}),L=await he("POST","/api/snapshots/upload",x),N=await On(`${Z}/api/snapshots/upload`,{method:"POST",headers:L,body:x});if(!N.ok){let le=await N.json().catch(()=>({}));o.fail("Upload failed"),console.error(v.red(`Error: ${le.message||le.error||"Server error"}`)),process.exit(1);}let I=await N.json(),{snapshotId:U,reportId:F,score:$,severity:St,findings:z}=I;if(o.succeed("Analysis complete"),n)console.log(`\u2714 Upload successful. Report: ${ht}/dashboard/reports/${F}?project=${l}`);else {console.log(v.green(`
|
|
99
99
|
\u2705 Report generated and saved to VeeStack`)),console.log(v.gray("Project ID: "),v.white(l)),console.log(v.gray("Snapshot ID: "),v.white(U)),console.log(v.gray("Report ID: "),v.white(F)),console.log(v.bold(`
|
|
100
100
|
\u{1F4CA} Security Score:`),$>=90?v.green($):$>=70?v.yellow($):v.red($)),console.log(v.gray("Severity: "),St),console.log(v.gray("Findings: "),z);let le=`${ht}/dashboard/reports/${F}?project=${l}`;console.log(v.blue(`
|
|
101
101
|
\u{1F517} View your full report at:`)),console.log(v.underline(le));}}catch(a){o.fail("Upload failed"),console.error(a),process.exit(1);}}async function Dr(t){t.format==="sarif"?await Vi(t):console.log(v.red('\u274C Unsupported format. Currently only "sarif" is supported.'));}async function Vi(t){await Pe()||(console.error(v.red("\u274C Authentication required. Please login first.")),process.exit(1));let n=t.reportId;n||(console.error(v.red("\u274C Report ID is required for SARIF export.")),process.exit(1)),console.log(v.blue(`
|
|
102
102
|
\u{1F4CA} Fetching report ${n} for SARIF export...`));try{let r=await he("GET",`/api/reports/${n}/sarif`),s=await fetch(`${Z}/api/reports/${n}/sarif`,{headers:r});if(!s.ok){let c=await s.json().catch(()=>({}));throw new Error(c.message||"Failed to fetch SARIF report")}let o=await s.json(),a=t.output||"veestack-results.sarif";await(await import('fs/promises')).writeFile(a,JSON.stringify(o,null,2)),console.log(v.green(`
|
|
103
103
|
\u2705 SARIF report exported to: ${a}`)),console.log(v.gray("You can now upload this to GitHub Security Tab."));}catch(r){console.error(v.red(`
|
|
104
|
-
\u274C Export failed:`),r instanceof Error?r.message:r),process.exit(1);}}var Bi=globalThis,Fi=Bi.CLI_VERSION||"unknown";function zi(){return ge__default.randomBytes(16).toString("hex")}function Hi(){let t=ge__default.randomBytes(32).toString("base64url"),e=ge__default.createHash("sha256").update(t).digest("base64url");return {code_verifier:t,code_challenge:e}}function Ji(){let t=process.platform,e=gt.hostname(),n=Fi,r=e||ge__default.randomBytes(8).toString("hex"),s=ge__default.createHash("sha256").update(`${r}:${t}:${n}`).digest("hex"),o=ge__default.randomBytes(12).toString("hex"),a=`${e||"Unknown"} (${t==="win32"?"Windows":t==="darwin"?"macOS":"Linux"})`;return {id:o,name:a,fingerprint:s,os:t,cli_version:n}}async function Ki(t,e){try{let n=new URL(Se.token);n.searchParams.set("device_code",t),n.searchParams.set("code_verifier",e);let r=await fetch(n.toString(),{method:"GET",headers:{"Content-Type":"application/json"}});if(r.status===202)return null;if(!r.ok){let s=await r.json().catch(()=>({}));if(s.code==="slow_down")return await new Promise(o=>setTimeout(o,2e3)),null;throw new Error(s.error||`Failed to poll for token: ${r.statusText}`)}return await r.json()}catch{return null}}async function Gi(t,e){try{let n=zi();console.log(v.gray(`[DEBUG] Creating device request at: ${Se.device}`));let r=await fetch(Se.device,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:n,client_id:t.id,code_challenge:e.code_challenge,code_challenge_method:"S256",device_info:t})});if(!r.ok){let s=await r.json().catch(()=>({}));throw console.log(v.red(`
|
|
104
|
+
\u274C Export failed:`),r instanceof Error?r.message:r),process.exit(1);}}var Bi=globalThis,Fi=Bi.CLI_VERSION||"unknown";function zi(){return ge__default.randomBytes(16).toString("hex")}function Hi(){let t=ge__default.randomBytes(32).toString("base64url"),e=ge__default.createHash("sha256").update(t).digest("base64url");return {code_verifier:t,code_challenge:e}}function Ji(){let t=process.platform,e=gt.hostname(),n=Fi,r=e||ge__default.randomBytes(8).toString("hex"),s=ge__default.createHash("sha256").update(`${r}:${t}:${n}`).digest("hex"),o=ge__default.randomBytes(12).toString("hex"),a=`${e||"Unknown"} (${t==="win32"?"Windows":t==="darwin"?"macOS":"Linux"})`;return {id:o,name:a,fingerprint:s,os:t,cli_version:n}}async function Ki(t,e){try{let n=new URL(Se.token);n.searchParams.set("device_code",t),n.searchParams.set("code_verifier",e),console.log(v.gray(`[DEBUG] Polling: ${n.toString()}`));let r=await fetch(n.toString(),{method:"GET",headers:{"Content-Type":"application/json"}});if(console.log(v.gray(`[DEBUG] Response status: ${r.status}`)),r.status===202)return null;if(!r.ok){let s=await r.json().catch(()=>({}));if(console.log(v.red(`[DEBUG] Poll error: ${JSON.stringify(s)}`)),s.code==="slow_down")return await new Promise(o=>setTimeout(o,2e3)),null;throw new Error(s.error||`Failed to poll for token: ${r.statusText}`)}return await r.json()}catch(n){return console.log(v.red(`[DEBUG] Poll exception: ${n instanceof Error?n.message:n}`)),null}}async function Gi(t,e){try{let n=zi();console.log(v.gray(`[DEBUG] Creating device request at: ${Se.device}`));let r=await fetch(Se.device,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:n,client_id:t.id,code_challenge:e.code_challenge,code_challenge_method:"S256",device_info:t})});if(!r.ok){let s=await r.json().catch(()=>({}));throw console.log(v.red(`
|
|
105
105
|
\u274C Server error: ${s.error||r.statusText}`)),new Error(s.error||`Failed to create device request: ${r.statusText}`)}return await r.json()}catch(n){throw console.log(v.red(`
|
|
106
106
|
\u274C Connection error: ${n instanceof Error?n.message:"Unknown error"}`)),n}}async function Lt(){console.log(v.bold.cyan(`
|
|
107
107
|
\u{1F510} Login to VeeStack
|
|
@@ -113,7 +113,7 @@ Tip: Run "veestack scan" first to generate a snapshot.`)),process.exit(1));let i
|
|
|
113
113
|
`));try{await Mi(r),console.log(v.gray(`If your browser did not open, visit: ${r}
|
|
114
114
|
`));}catch{console.log(v.yellow(`\u26A0\uFE0F Could not open browser automatically
|
|
115
115
|
`)),console.log(v.gray(`Please visit: ${r}
|
|
116
|
-
`));}let s=gi({text:"Waiting for browser authorization...",spinner:"dots",stream:process.stdout});s.start();let o=null,a=0,i=300;try{for(;!o&&a<i;)if(await new Promise(d=>setTimeout(d,2e3)),o=await Ki(n.device_code,e.code_verifier),a++,!o){let d=a*2,
|
|
116
|
+
`));}let s=gi({text:"Waiting for browser authorization...",spinner:"dots",stream:process.stdout});s.start();let o=null,a=0,i=300;try{for(;!o&&a<i;)if(await new Promise(d=>setTimeout(d,2e3)),o=await Ki(n.device_code,e.code_verifier),a++,!o){let d=a*2,x=i*2-d;s.text=`Waiting for browser authorization... (${d}s elapsed, ${x}s remaining)`;}o||(s.fail("Authentication timeout"),console.log(v.red(`
|
|
117
117
|
\u274C Authentication request expired after 10 minutes.`)),console.log(v.yellow(`
|
|
118
118
|
The device code has expired for security reasons.`)),console.log(v.gray("Device codes are valid for 10 minutes only.")),console.log(v.yellow(`
|
|
119
119
|
Please try again with: `)+v.cyan(`veestack login
|
package/dist/version.json
CHANGED