UNPKG

mdat

Version:

CLI tool and TypeScript library implementing the Markdown Autophagic Template (MDAT) system. MDAT lets you use comments as dynamic content templates in Markdown files, making it easy to generate and update readme boilerplate.

5 lines 402 kB
var eE=Object.create;var ou=Object.defineProperty;var tE=Object.getOwnPropertyDescriptor;var rE=Object.getOwnPropertyNames;var nE=Object.getPrototypeOf,iE=Object.prototype.hasOwnProperty;var au=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),oE=(e,t)=>{for(var r in t)ou(e,r,{get:t[r],enumerable:!0})},aE=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of rE(t))!iE.call(e,i)&&i!==r&&ou(e,i,{get:()=>t[i],enumerable:!(n=tE(t,i))||n.enumerable});return e};var mf=(e,t,r)=>(r=e!=null?eE(nE(e)):{},aE(t||!e||!e.__esModule?ou(r,"default",{value:e,enumerable:!0}):r,e));var wf=au((V1,AE)=>{AE.exports={addendum:"addenda",aircraft:"aircraft",alga:"algae",alumna:"alumnae",alumnus:"alumni",alveolus:"alveoli",amoeba:"amoebae",analysis:"analyses",antenna:"antennae",antithesis:"antitheses",apex:"apices",appendix:"appendices",automaton:"automata",axis:"axes",bacillus:"bacilli",bacterium:"bacteria",baculum:"bacula",barracks:"barracks",basis:"bases",beau:"beaux",bison:"bison",buffalo:"buffalo",bureau:"bureaus",cactus:"cacti",calf:"calves",carcinoma:"carcinomata",carp:"carp",census:"censuses",chassis:"chassis",cherub:"cherubim",child:"children",ch\u00E2teau:"ch\xE2teaus",cloaca:"cloacae",cod:"cod",codex:"codices",concerto:"concerti",consortium:"consortia",corpus:"corpora",crisis:"crises",criterion:"criteria",curriculum:"curricula",cystoma:"cystomata",datum:"data",deer:"deer",diagnosis:"diagnoses",die:"dice",dwarf:"dwarfs",echo:"echoes",elf:"elves",elk:"elk",ellipsis:"ellipses",embargo:"embargoes",emphasis:"emphases",erratum:"errata","faux pas":"faux pas",fez:"fezes",firmware:"firmware",fish:"fish",focus:"foci",foot:"feet",formula:"formulae",fungus:"fungi",gallows:"gallows",genus:"genera",glomerulus:"glomeruli",goose:"geese",graffito:"graffiti",grouse:"grouse",half:"halves",hamulus:"hamuli",hero:"heroes",hippopotamus:"hippopotami",hoof:"hooves",hovercraft:"hovercraft",hypothesis:"hypotheses",iliac:"ilia",incubus:"incubi",index:"indices",interstitium:"interstitia",kakapo:"kakapo",knife:"knives",larva:"larvae",leaf:"leaves",libretto:"libretti",life:"lives",loaf:"loaves",loculus:"loculi",locus:"loci",louse:"lice",man:"men",matrix:"matrices",means:"means",measles:"measles",media:"media",medium:"media",memorandum:"memoranda",millennium:"millennia",minutia:"minutiae",moose:"moose",mouse:"mice",nebula:"nebulae",nemesis:"nemeses",neurosis:"neuroses",news:"news",nucleolus:"nucleoli",nucleus:"nuclei",oasis:"oases",occiput:"occipita",offspring:"offspring",omphalos:"omphaloi",opus:"opera",ovum:"ova",ox:"oxen",paralysis:"paralyses",parenthesis:"parentheses",person:"people",phenomenon:"phenomena",phylum:"phyla",pike:"pike",polyhedron:"polyhedra",potato:"potatoes",primus:"primi",prognosis:"prognoses",quiz:"quizzes",radius:"radii",referendum:"referenda",salmon:"salmon",scarf:"scarves",scrotum:"scrota",self:"selves",seminoma:"seminomata",series:"series",sheep:"sheep",shelf:"shelves",shrimp:"shrimp",simulacrum:"simulacra",soliloquy:"soliloquies",spacecraft:"spacecraft",species:"species",spectrum:"spectra",squid:"squid",stimulus:"stimuli",stratum:"strata",swine:"swine",syconium:"syconia",syllabus:"syllabi",symposium:"symposia",synopsis:"synopses",synthesis:"syntheses",tableau:"tableaus",testis:"testes",that:"those",thesis:"theses",thief:"thieves",this:"these",thrombus:"thrombi",tomato:"tomatoes",tooth:"teeth",torus:"tori",trout:"trout",tuna:"tuna",umbilicus:"umbilici",uterus:"uteri",vertebra:"vertebrae",vertex:"vertices",veto:"vetoes",vita:"vitae",vortex:"vortices",watercraft:"watercraft",wharf:"wharves",wife:"wives",wolf:"wolves",woman:"women"}});var vf=au((G1,Sf)=>{"use strict";var TE=wf();Sf.exports=new Map(Object.entries(TE))});var dm=au((L2,mm)=>{"use strict";var Aa=Object.prototype.hasOwnProperty,pm=Object.prototype.toString,am=Object.defineProperty,sm=Object.getOwnPropertyDescriptor,um=function(t){return typeof Array.isArray=="function"?Array.isArray(t):pm.call(t)==="[object Array]"},lm=function(t){if(!t||pm.call(t)!=="[object Object]")return!1;var r=Aa.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&Aa.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var i;for(i in t);return typeof i>"u"||Aa.call(t,i)},cm=function(t,r){am&&r.name==="__proto__"?am(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},fm=function(t,r){if(r==="__proto__")if(Aa.call(t,r)){if(sm)return sm(t,r).value}else return;return t[r]};mm.exports=function e(){var t,r,n,i,o,a,s=arguments[0],u=1,l=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},u=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});u<l;++u)if(t=arguments[u],t!=null)for(r in t)n=fm(s,r),i=fm(t,r),s!==i&&(c&&i&&(lm(i)||(o=um(i)))?(o?(o=!1,a=n&&um(n)?n:[]):a=n&&lm(n)?n:{},cm(s,{name:r,newValue:e(c,a,i)})):typeof i<"u"&&cm(s,{name:r,newValue:i}));return s}});var df=(e=0)=>t=>`\x1B[${t+e}m`,hf=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,gf=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,be={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},D1=Object.keys(be.modifier),sE=Object.keys(be.color),uE=Object.keys(be.bgColor),F1=[...sE,...uE];function lE(){let e=new Map;for(let[t,r]of Object.entries(be)){for(let[n,i]of Object.entries(r))be[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=be[n],e.set(i[0],i[1]);Object.defineProperty(be,t,{value:r,enumerable:!1})}return Object.defineProperty(be,"codes",{value:e,enumerable:!1}),be.color.close="\x1B[39m",be.bgColor.close="\x1B[49m",be.color.ansi=df(),be.color.ansi256=hf(),be.color.ansi16m=gf(),be.bgColor.ansi=df(10),be.bgColor.ansi256=hf(10),be.bgColor.ansi16m=gf(10),Object.defineProperties(be,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>be.rgbToAnsi256(...be.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,i;if(t>=232)r=((t-232)*10+8)/255,n=r,i=r;else{t-=16;let s=t%36;r=Math.floor(t/36)/5,n=Math.floor(s/6)/5,i=s%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let a=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>be.ansi256ToAnsi(be.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>be.ansi256ToAnsi(be.hexToAnsi256(t)),enumerable:!1}}),be}var cE=lE(),Mt=cE;import su from"node:process";import fE from"node:os";import xf from"node:tty";function It(e,t=globalThis.Deno?globalThis.Deno.args:su.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:ve}=su,Vo;It("no-color")||It("no-colors")||It("color=false")||It("color=never")?Vo=0:(It("color")||It("colors")||It("color=true")||It("color=always"))&&(Vo=1);function pE(){if("FORCE_COLOR"in ve)return ve.FORCE_COLOR==="true"?1:ve.FORCE_COLOR==="false"?0:ve.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ve.FORCE_COLOR,10),3)}function mE(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function dE(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=pE();n!==void 0&&(Vo=n);let i=r?Vo:n;if(i===0)return 0;if(r){if(It("color=16m")||It("color=full")||It("color=truecolor"))return 3;if(It("color=256"))return 2}if("TF_BUILD"in ve&&"AGENT_NAME"in ve)return 1;if(e&&!t&&i===void 0)return 0;let o=i||0;if(ve.TERM==="dumb")return o;if(su.platform==="win32"){let a=fE.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in ve)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(a=>a in ve)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in ve)||ve.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in ve)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ve.TEAMCITY_VERSION)?1:0;if(ve.COLORTERM==="truecolor"||ve.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in ve){let a=Number.parseInt((ve.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ve.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ve.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ve.TERM)||"COLORTERM"in ve?1:o}function yf(e,t={}){let r=dE(e,{streamIsTTY:e&&e.isTTY,...t});return mE(r)}var hE={stdout:yf({isTTY:xf.isatty(1)}),stderr:yf({isTTY:xf.isatty(2)})},Ef=hE;function bf(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let i=t.length,o=0,a="";do a+=e.slice(o,n)+t+r,o=n+i,n=e.indexOf(t,o);while(n!==-1);return a+=e.slice(o),a}function kf(e,t,r,n){let i=0,o="";do{let a=e[n-1]==="\r";o+=e.slice(i,a?n-1:n)+t+(a?`\r `:` `)+r,i=n+1,n=e.indexOf(` `,i)}while(n!==-1);return o+=e.slice(i),o}var{stdout:Af,stderr:Tf}=Ef,uu=Symbol("GENERATOR"),Un=Symbol("STYLER"),Hi=Symbol("IS_EMPTY"),Cf=["ansi","ansi","ansi256","ansi16m"],zn=Object.create(null),gE=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Af?Af.level:0;e.level=t.level===void 0?r:t.level};var xE=e=>{let t=(...r)=>r.join(" ");return gE(t,e),Object.setPrototypeOf(t,Wi.prototype),t};function Wi(e){return xE(e)}Object.setPrototypeOf(Wi.prototype,Function.prototype);for(let[e,t]of Object.entries(Mt))zn[e]={get(){let r=Go(this,cu(t.open,t.close,this[Un]),this[Hi]);return Object.defineProperty(this,e,{value:r}),r}};zn.visible={get(){let e=Go(this,this[Un],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var lu=(e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Mt[r].ansi16m(...n):t==="ansi256"?Mt[r].ansi256(Mt.rgbToAnsi256(...n)):Mt[r].ansi(Mt.rgbToAnsi(...n)):e==="hex"?lu("rgb",t,r,...Mt.hexToRgb(...n)):Mt[r][e](...n),yE=["rgb","hex","ansi256"];for(let e of yE){zn[e]={get(){let{level:r}=this;return function(...n){let i=cu(lu(e,Cf[r],"color",...n),Mt.color.close,this[Un]);return Go(this,i,this[Hi])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);zn[t]={get(){let{level:r}=this;return function(...n){let i=cu(lu(e,Cf[r],"bgColor",...n),Mt.bgColor.close,this[Un]);return Go(this,i,this[Hi])}}}}var EE=Object.defineProperties(()=>{},{...zn,level:{enumerable:!0,get(){return this[uu].level},set(e){this[uu].level=e}}}),cu=(e,t,r)=>{let n,i;return r===void 0?(n=e,i=t):(n=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:i,parent:r}},Go=(e,t,r)=>{let n=(...i)=>bE(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,EE),n[uu]=e,n[Un]=t,n[Hi]=r,n},bE=(e,t)=>{if(e.level<=0||!t)return e[Hi]?"":t;let r=e[Un];if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=bf(t,r.close,r.open),r=r.parent;let o=t.indexOf(` `);return o!==-1&&(t=kf(t,i,n,o)),n+t+i};Object.defineProperties(Wi.prototype,zn);var kE=Wi(),$1=Wi({level:Tf?Tf.level:0});var fu=kE;import{cosmiconfig as Yf}from"cosmiconfig";import{TypeScriptLoader as Xf}from"cosmiconfig-typescript-loader";import Gb from"node:fs/promises";import ep from"node:path";var pu=mf(vf(),1);function mu(e,t,r){if(typeof t=="number"&&(r=t),pu.default.has(e.toLowerCase())){t=pu.default.get(e.toLowerCase());let n=e.charAt(0);n===n.toUpperCase()&&(t=n+t.slice(1)),e===e.toUpperCase()&&(t=t.toUpperCase())}else typeof t!="string"&&(t=(e.replace(/(?:s|x|z|ch|sh)$/i,"$&e").replace(/([^aeiou])y$/i,"$1ie")+"s").replace(/i?e?s$/i,n=>e.slice(-1)===e.slice(-1).toLowerCase()?n.toLowerCase():n.toUpperCase()));return Math.abs(r)===1?e:t}import{readPackage as Hb}from"read-pkg";import{deepMergeDefined as Qo,log as Ft,optionsSchema as Wb,rulesSchema as Kb}from"remark-mdat";var oe;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{let o={};for(let a of i)o[a]=a;return o},e.getValidEnumValues=i=>{let o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(let s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(let a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(oe||(oe={}));var hu;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(hu||(hu={}));var F=oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fr=e=>{switch(typeof e){case"undefined":return F.undefined;case"string":return F.string;case"number":return isNaN(e)?F.nan:F.number;case"boolean":return F.boolean;case"function":return F.function;case"bigint":return F.bigint;case"symbol":return F.symbol;case"object":return Array.isArray(e)?F.array:e===null?F.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?F.promise:typeof Map<"u"&&e instanceof Map?F.map:typeof Set<"u"&&e instanceof Set?F.set:typeof Date<"u"&&e instanceof Date?F.date:F.object;default:return F.unknown}},w=oe.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"]),CE=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),At=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},n={_errors:[]},i=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,u=0;for(;u<a.path.length;){let l=a.path[u];u===a.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(r(a))):s[l]=s[l]||{_errors:[]},s=s[l],u++}}};return i(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};At.create=e=>new At(e);var qn=(e,t)=>{let r;switch(e.code){case w.invalid_type:e.received===F.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case w.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,oe.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:r=`Unrecognized key(s) in object: ${oe.joinValues(e.keys,", ")}`;break;case w.invalid_union:r="Invalid input";break;case w.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${oe.joinValues(e.options)}`;break;case w.invalid_enum_value:r=`Invalid enum value. Expected ${oe.joinValues(e.options)}, received '${e.received}'`;break;case w.invalid_arguments:r="Invalid function arguments";break;case w.invalid_return_type:r="Invalid function return type";break;case w.invalid_date:r="Invalid date";break;case w.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:oe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case w.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case w.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case w.custom:r="Invalid input";break;case w.invalid_intersection_types:r="Intersection results could not be merged";break;case w.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case w.not_finite:r="Number must be finite";break;default:r=t.defaultError,oe.assertNever(e)}return{message:r}},Df=qn;function wE(e){Df=e}function Ho(){return Df}var Wo=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)s=l(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},SE=[];function I(e,t){let r=Ho(),n=Wo({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===qn?void 0:qn].filter(i=>!!i)});e.common.issues.push(n)}var Je=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return q;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let o=await i.key,a=await i.value;n.push({key:o,value:a})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return q;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(n[o.value]=a.value)}return{status:t.value,value:n}}},q=Object.freeze({status:"aborted"}),$n=e=>({status:"dirty",value:e}),at=e=>({status:"valid",value:e}),gu=e=>e.status==="aborted",xu=e=>e.status==="dirty",Xr=e=>e.status==="valid",Yi=e=>typeof Promise<"u"&&e instanceof Promise;function Ko(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Ff(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}var M;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(M||(M={}));var Ki,Zi,Dt=class{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},_f=(e,t)=>{if(Xr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new At(e.common.issues);return this._error=r,this._error}}};function K(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{var u,l;let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:(u=c??n)!==null&&u!==void 0?u:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:s.defaultError}},description:i}}var Z=class{get description(){return this._def.description}_getType(t){return fr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:fr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Je,ctx:{common:t.parent.common,data:t.data,parsedType:fr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Yi(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let i={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fr(t)},o=this._parseSync({data:t,path:i.path,parent:i});return _f(i,o)}"~validate"(t){var r,n;let i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fr(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:i});return Xr(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((n=(r=o?.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(o=>Xr(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fr(t)},i=this._parse({data:t,path:n.path,parent:n}),o=await(Yi(i)?i:Promise.resolve(i));return _f(n,o)}refine(t,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let a=t(i),s=()=>o.addIssue({code:w.custom,...n(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new Tt({schema:this,typeName:$.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Rt.create(this,this._def)}nullable(){return Gt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mr.create(this)}promise(){return vr.create(this,this._def)}or(t){return on.create([this,t],this._def)}and(t){return an.create(this,t,this._def)}transform(t){return new Tt({...K(this._def),schema:this,typeName:$.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new fn({...K(this._def),innerType:this,defaultValue:r,typeName:$.ZodDefault})}brand(){return new Xi({typeName:$.ZodBranded,type:this,...K(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new pn({...K(this._def),innerType:this,catchValue:r,typeName:$.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Ji.create(this,t)}readonly(){return mn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},vE=/^c[^\s-]{8,}$/i,_E=/^[0-9a-z]+$/,IE=/^[0-9A-HJKMNP-TV-Z]{26}$/i,RE=/^[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,DE=/^[a-z0-9_-]{21}$/i,FE=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,OE=/^[-+]?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)?)??$/,NE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,LE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",du,PE=/^(?:(?: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])$/,ME=/^(?:(?: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])$/,BE=/^(([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]))$/,UE=/^(([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])$/,zE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jE=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Of="((\\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])))",$E=new RegExp(`^${Of}$`);function Nf(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function qE(e){return new RegExp(`^${Nf(e)}$`)}function Lf(e){let t=`${Of}T${Nf(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function VE(e,t){return!!((t==="v4"||!t)&&PE.test(e)||(t==="v6"||!t)&&BE.test(e))}function GE(e,t){if(!FE.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function HE(e,t){return!!((t==="v4"||!t)&&ME.test(e)||(t==="v6"||!t)&&UE.test(e))}var wr=class e extends Z{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==F.string){let o=this._getOrReturnCtx(t);return I(o,{code:w.invalid_type,expected:F.string,received:o.parsedType}),q}let n=new Je,i;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),I(i,{code:w.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),I(i,{code:w.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?I(i,{code:w.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&I(i,{code:w.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")NE.test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"email",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")du||(du=new RegExp(LE,"u")),du.test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"emoji",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")RE.test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"uuid",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")DE.test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"nanoid",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")vE.test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"cuid",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")_E.test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"cuid2",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")IE.test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"ulid",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),I(i,{validation:"url",code:w.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"regex",code:w.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),I(i,{code:w.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),I(i,{code:w.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),I(i,{code:w.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Lf(o).test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{code:w.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?$E.test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{code:w.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?qE(o).test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{code:w.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?OE.test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"duration",code:w.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?VE(t.data,o.version)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"ip",code:w.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?GE(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"jwt",code:w.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?HE(t.data,o.version)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"cidr",code:w.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?zE.test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"base64",code:w.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?jE.test(t.data)||(i=this._getOrReturnCtx(t,i),I(i,{validation:"base64url",code:w.invalid_string,message:o.message}),n.dirty()):oe.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:w.invalid_string,...M.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...M.errToObj(t)})}url(t){return this._addCheck({kind:"url",...M.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...M.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...M.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...M.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...M.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...M.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...M.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...M.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...M.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...M.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...M.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...M.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(r=t?.offset)!==null&&r!==void 0?r:!1,local:(n=t?.local)!==null&&n!==void 0?n:!1,...M.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...M.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...M.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...M.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...M.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...M.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...M.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...M.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...M.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...M.errToObj(r)})}nonempty(t){return this.min(1,M.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};wr.create=e=>{var t;return new wr({checks:[],typeName:$.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...K(e)})};function WE(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}var Jr=class e extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==F.number){let o=this._getOrReturnCtx(t);return I(o,{code:w.invalid_type,expected:F.number,received:o.parsedType}),q}let n,i=new Je;for(let o of this._def.checks)o.kind==="int"?oe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),I(n,{code:w.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),I(n,{code:w.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),I(n,{code:w.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?WE(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),I(n,{code:w.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),I(n,{code:w.not_finite,message:o.message}),i.dirty()):oe.assertNever(o);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,M.toString(r))}gt(t,r){return this.setLimit("min",t,!1,M.toString(r))}lte(t,r){return this.setLimit("max",t,!0,M.toString(r))}lt(t,r){return this.setLimit("max",t,!1,M.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:M.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:M.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:M.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:M.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:M.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:M.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:M.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:M.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:M.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:M.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&oe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Jr.create=e=>new Jr({checks:[],typeName:$.ZodNumber,coerce:e?.coerce||!1,...K(e)});var Qr=class e extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==F.bigint)return this._getInvalidInput(t);let n,i=new Je;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),I(n,{code:w.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),I(n,{code:w.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),I(n,{code:w.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):oe.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return I(r,{code:w.invalid_type,expected:F.bigint,received:r.parsedType}),q}gte(t,r){return this.setLimit("min",t,!0,M.toString(r))}gt(t,r){return this.setLimit("min",t,!1,M.toString(r))}lte(t,r){return this.setLimit("max",t,!0,M.toString(r))}lt(t,r){return this.setLimit("max",t,!1,M.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:M.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:M.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:M.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:M.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:M.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:M.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Qr.create=e=>{var t;return new Qr({checks:[],typeName:$.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...K(e)})};var en=class extends Z{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==F.boolean){let n=this._getOrReturnCtx(t);return I(n,{code:w.invalid_type,expected:F.boolean,received:n.parsedType}),q}return at(t.data)}};en.create=e=>new en({typeName:$.ZodBoolean,coerce:e?.coerce||!1,...K(e)});var tn=class e extends Z{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==F.date){let o=this._getOrReturnCtx(t);return I(o,{code:w.invalid_type,expected:F.date,received:o.parsedType}),q}if(isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return I(o,{code:w.invalid_date}),q}let n=new Je,i;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),I(i,{code:w.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),I(i,{code:w.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):oe.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:M.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:M.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};tn.create=e=>new tn({checks:[],coerce:e?.coerce||!1,typeName:$.ZodDate,...K(e)});var Vn=class extends Z{_parse(t){if(this._getType(t)!==F.symbol){let n=this._getOrReturnCtx(t);return I(n,{code:w.invalid_type,expected:F.symbol,received:n.parsedType}),q}return at(t.data)}};Vn.create=e=>new Vn({typeName:$.ZodSymbol,...K(e)});var rn=class extends Z{_parse(t){if(this._getType(t)!==F.undefined){let n=this._getOrReturnCtx(t);return I(n,{code:w.invalid_type,expected:F.undefined,received:n.parsedType}),q}return at(t.data)}};rn.create=e=>new rn({typeName:$.ZodUndefined,...K(e)});var nn=class extends Z{_parse(t){if(this._getType(t)!==F.null){let n=this._getOrReturnCtx(t);return I(n,{code:w.invalid_type,expected:F.null,received:n.parsedType}),q}return at(t.data)}};nn.create=e=>new nn({typeName:$.ZodNull,...K(e)});var Sr=class extends Z{constructor(){super(...arguments),this._any=!0}_parse(t){return at(t.data)}};Sr.create=e=>new Sr({typeName:$.ZodAny,...K(e)});var pr=class extends Z{constructor(){super(...arguments),this._unknown=!0}_parse(t){return at(t.data)}};pr.create=e=>new pr({typeName:$.ZodUnknown,...K(e)});var Bt=class extends Z{_parse(t){let r=this._getOrReturnCtx(t);return I(r,{code:w.invalid_type,expected:F.never,received:r.parsedType}),q}};Bt.create=e=>new Bt({typeName:$.ZodNever,...K(e)});var Gn=class extends Z{_parse(t){if(this._getType(t)!==F.undefined){let n=this._getOrReturnCtx(t);return I(n,{code:w.invalid_type,expected:F.void,received:n.parsedType}),q}return at(t.data)}};Gn.create=e=>new Gn({typeName:$.ZodVoid,...K(e)});var mr=class e extends Z{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==F.array)return I(r,{code:w.invalid_type,expected:F.array,received:r.parsedType}),q;if(i.exactLength!==null){let a=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(a||s)&&(I(r,{code:a?w.too_big:w.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(I(r,{code:w.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(I(r,{code:w.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>i.type._parseAsync(new Dt(r,a,r.path,s)))).then(a=>Je.mergeArray(n,a));let o=[...r.data].map((a,s)=>i.type._parseSync(new Dt(r,a,r.path,s)));return Je.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:M.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:M.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:M.toString(r)}})}nonempty(t){return this.min(1,t)}};mr.create=(e,t)=>new mr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$.ZodArray,...K(t)});function jn(e){if(e instanceof dt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Rt.create(jn(n))}return new dt({...e._def,shape:()=>t})}else return e instanceof mr?new mr({...e._def,type:jn(e.element)}):e instanceof Rt?Rt.create(jn(e.unwrap())):e instanceof Gt?Gt.create(jn(e.unwrap())):e instanceof Vt?Vt.create(e.items.map(t=>jn(t))):e}var dt=class e extends Z{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=oe.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==F.object){let l=this._getOrReturnCtx(t);return I(l,{code:w.invalid_type,expected:F.object,received:l.parsedType}),q}let{status:n,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Bt&&this._def.unknownKeys==="strip"))for(let l in i.data)a.includes(l)||s.push(l);let u=[];for(let l of a){let c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Dt(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Bt){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of s)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")s.length>0&&(I(i,{code:w.unrecognized_keys,keys:s})