@jsrepo/migrate 0.0.15 → 0.0.16

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.
Files changed (2) hide show
  1. package/dist/bin.mjs +4 -4
  2. package/package.json +6 -6
package/dist/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{Command as e,Option as t,program as n}from"commander";import r,{existsSync as i,lstatSync as a,readdirSync as o}from"node:fs";import s,{cwd as c,stdin as l,stdout as u}from"node:process";import*as d from"node:readline";import f from"node:readline";import{ReadStream as p}from"node:tty";import m,{delimiter as h,dirname as g,join as _,normalize as v,resolve as y}from"node:path";import{stripVTControlCharacters as b}from"node:util";import{DEFAULT_PROVIDERS as x}from"jsrepo/providers";import{detectPackageManager as S,resolveRegistries as C}from"jsrepo/utils";import w from"node:fs/promises";import ee from"node:os";import{createRequire as T}from"module";import{spawn as te}from"node:child_process";import{PassThrough as ne}from"node:stream";var re=Object.create,ie=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,oe=Object.getOwnPropertyNames,se=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty,E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),le=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=oe(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ce.call(e,s)&&s!==n&&ie(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ae(t,s))||r.enumerable});return e},ue=(e,t,n)=>(n=e==null?{}:re(se(e)),le(t||!e||!e.__esModule?ie(n,`default`,{value:e,enumerable:!0}):n,e)),D=`@jsrepo/migrate`,de=`Automatically migrate your jsrepo project to the newest version of jsrepo.`,fe=`0.0.15`,pe=E(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),me=E(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),O=ue(pe(),1),k=me();const he=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,ge=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,_e=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,ve=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,ye=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,be=/\t{1,1000}/y,xe=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Se=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ce=/\p{M}+/gu,we={limit:1/0,ellipsis:``},Te=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Te(i,we,n).width:0),o=n.ansiWidth??0,s=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,f=n.regularWidth??1,p=n.wideWidth??2,m=0,h=0,g=e.length,_=0,v=!1,y=g,b=Math.max(0,r-a),x=0,S=0,C=0,w=0;t:for(;;){if(S>x||h>=g&&h>m){let t=e.slice(x,S)||e.slice(m,h);_=0;for(let e of t.replaceAll(Ce,``)){let t=e.codePointAt(0)||0;if(w=ge(t)?d:_e(t)?p:l!==f&&he(t)?l:f,C+w>b&&(y=Math.min(y,Math.max(x,m)+_)),C+w>r){v=!0;break t}_+=e.length,C+=w}x=S=0}if(h>=g)break;if(Se.lastIndex=h,Se.test(e)){if(_=Se.lastIndex-h,w=_*f,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/f))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=Se.lastIndex;continue}if(ve.lastIndex=h,ve.test(e)){if(C+o>b&&(y=Math.min(y,h)),C+o>r){v=!0;break}C+=o,x=m,S=h,h=m=ve.lastIndex;continue}if(ye.lastIndex=h,ye.test(e)){if(_=ye.lastIndex-h,w=_*s,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/s))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ye.lastIndex;continue}if(be.lastIndex=h,be.test(e)){if(_=be.lastIndex-h,w=_*c,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/c))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=be.lastIndex;continue}if(xe.lastIndex=h,xe.test(e)){if(C+u>b&&(y=Math.min(y,h)),C+u>r){v=!0;break}C+=u,x=m,S=h,h=m=xe.lastIndex;continue}h+=1}return{width:v?b:C,index:v?y:g,truncated:v,ellipsed:v&&r>=a}},Ee={limit:1/0,ellipsis:``,ellipsisWidth:0},De=(e,t={})=>Te(e,Ee,t).width,Oe=`]8;;`,ke=RegExp(`(?:\\[(?<code>\\d+)m|\\${Oe}(?<uri>.*))`,`y`),Ae=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},je=e=>`[${e}m`,Me=e=>`${Oe}${e}`,Ne=e=>e.map(e=>De(e)),Pe=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:De(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=De(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(Oe,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Fe=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(De(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ie=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=Ne(o),c=[``];for(let[e,r]of o.entries()){n.trim!==!1&&(c[c.length-1]=(c.at(-1)??``).trimStart());let i=De(c.at(-1)??``);if(e!==0&&(i>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(``),i=0),(i>0||n.trim===!1)&&(c[c.length-1]+=` `,i++)),n.hard&&s[e]>t){let n=t-i,a=1+Math.floor((s[e]-n-1)/t);Math.floor((s[e]-1)/t)<a&&c.push(``),Pe(c,r,t);continue}if(i+s[e]>t&&i>0&&s[e]>0){if(n.wordWrap===!1&&i<t){Pe(c,r,t);continue}c.push(``)}if(i+s[e]>t&&n.wordWrap===!1){Pe(c,r,t);continue}c[c.length-1]+=r}n.trim!==!1&&(c=c.map(e=>Fe(e)));let l=c.join(`
2
+ import{Command as e,Option as t,program as n}from"commander";import r,{existsSync as i,lstatSync as a,readdirSync as o}from"node:fs";import s,{cwd as c,stdin as l,stdout as u}from"node:process";import*as d from"node:readline";import f from"node:readline";import{ReadStream as p}from"node:tty";import m,{delimiter as h,dirname as g,join as _,normalize as v,resolve as y}from"node:path";import{stripVTControlCharacters as b}from"node:util";import{DEFAULT_PROVIDERS as x}from"jsrepo/providers";import{detectPackageManager as S,resolveRegistries as C}from"jsrepo/utils";import w from"node:fs/promises";import ee from"node:os";import{createRequire as T}from"module";import{spawn as te}from"node:child_process";import{PassThrough as ne}from"node:stream";var re=Object.create,ie=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,oe=Object.getOwnPropertyNames,se=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty,E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),le=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=oe(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ce.call(e,s)&&s!==n&&ie(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ae(t,s))||r.enumerable});return e},ue=(e,t,n)=>(n=e==null?{}:re(se(e)),le(t||!e||!e.__esModule?ie(n,`default`,{value:e,enumerable:!0}):n,e)),D=`@jsrepo/migrate`,de=`Automatically migrate your jsrepo project to the newest version of jsrepo.`,fe=`0.0.16`,pe=E(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),me=E(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),O=ue(pe(),1),k=me();const he=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,ge=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,_e=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,ve=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,ye=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,be=/\t{1,1000}/y,xe=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Se=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ce=/\p{M}+/gu,we={limit:1/0,ellipsis:``},Te=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Te(i,we,n).width:0),o=n.ansiWidth??0,s=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,f=n.regularWidth??1,p=n.wideWidth??2,m=0,h=0,g=e.length,_=0,v=!1,y=g,b=Math.max(0,r-a),x=0,S=0,C=0,w=0;t:for(;;){if(S>x||h>=g&&h>m){let t=e.slice(x,S)||e.slice(m,h);_=0;for(let e of t.replaceAll(Ce,``)){let t=e.codePointAt(0)||0;if(w=ge(t)?d:_e(t)?p:l!==f&&he(t)?l:f,C+w>b&&(y=Math.min(y,Math.max(x,m)+_)),C+w>r){v=!0;break t}_+=e.length,C+=w}x=S=0}if(h>=g)break;if(Se.lastIndex=h,Se.test(e)){if(_=Se.lastIndex-h,w=_*f,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/f))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=Se.lastIndex;continue}if(ve.lastIndex=h,ve.test(e)){if(C+o>b&&(y=Math.min(y,h)),C+o>r){v=!0;break}C+=o,x=m,S=h,h=m=ve.lastIndex;continue}if(ye.lastIndex=h,ye.test(e)){if(_=ye.lastIndex-h,w=_*s,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/s))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ye.lastIndex;continue}if(be.lastIndex=h,be.test(e)){if(_=be.lastIndex-h,w=_*c,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/c))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=be.lastIndex;continue}if(xe.lastIndex=h,xe.test(e)){if(C+u>b&&(y=Math.min(y,h)),C+u>r){v=!0;break}C+=u,x=m,S=h,h=m=xe.lastIndex;continue}h+=1}return{width:v?b:C,index:v?y:g,truncated:v,ellipsed:v&&r>=a}},Ee={limit:1/0,ellipsis:``,ellipsisWidth:0},De=(e,t={})=>Te(e,Ee,t).width,Oe=`]8;;`,ke=RegExp(`(?:\\[(?<code>\\d+)m|\\${Oe}(?<uri>.*))`,`y`),Ae=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},je=e=>`[${e}m`,Me=e=>`${Oe}${e}`,Ne=e=>e.map(e=>De(e)),Pe=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:De(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=De(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(Oe,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Fe=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(De(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ie=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=Ne(o),c=[``];for(let[e,r]of o.entries()){n.trim!==!1&&(c[c.length-1]=(c.at(-1)??``).trimStart());let i=De(c.at(-1)??``);if(e!==0&&(i>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(``),i=0),(i>0||n.trim===!1)&&(c[c.length-1]+=` `,i++)),n.hard&&s[e]>t){let n=t-i,a=1+Math.floor((s[e]-n-1)/t);Math.floor((s[e]-1)/t)<a&&c.push(``),Pe(c,r,t);continue}if(i+s[e]>t&&i>0&&s[e]>0){if(n.wordWrap===!1&&i<t){Pe(c,r,t);continue}c.push(``)}if(i+s[e]>t&&n.wordWrap===!1){Pe(c,r,t);continue}c[c.length-1]+=r}n.trim!==!1&&(c=c.map(e=>Fe(e)));let l=c.join(`
3
3
  `),u=l[Symbol.iterator](),d=u.next(),f=u.next(),p=0;for(;!d.done;){let e=d.value,t=f.value;if(r+=e,e===`\x1B`||e===`›`){ke.lastIndex=p+1;let e=ke.exec(l)?.groups;if(e?.code!==void 0){let t=Number.parseFloat(e.code);i=t===39?void 0:t}else e?.uri!==void 0&&(a=e.uri.length===0?void 0:e.uri)}let n=i?Ae(i):void 0;t===`
4
4
  `?(a&&(r+=Me(``)),i&&n&&(r+=je(n))):e===`
5
5
  `&&(i&&n&&(r+=je(i)),a&&(r+=Me(a))),p+=e.length,d=f,f=u.next()}return r};function Le(e,t,n){return String(e).normalize().replaceAll(`\r
@@ -56,7 +56,7 @@ ${O.default.gray(j)}`:``}`}default:return`${t}${O.default.cyan(j)} ${r}
56
56
  ${O.default.cyan(it)}
57
57
  `}}}).prompt();var jt=E((e=>{let t={withStackTrace:!1},n=(e,n,r=t)=>({data:n.isOk()?{type:`Ok`,value:n.value}:{type:`Err`,value:n.error},message:e,stack:r.withStackTrace?Error().stack:void 0});function r(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function i(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function a(e){return this instanceof a?(this.v=e,this):new a(e)}function o(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),c(`next`),c(`throw`),c(`return`,s),i[Symbol.asyncIterator]=function(){return this},i;function s(e){return function(t){return Promise.resolve(t).then(e,f)}}function c(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||l(e,t)})},t&&(i[e]=t(i[e])))}function l(e,t){try{u(r[e](t))}catch(e){p(o[0][3],e)}}function u(e){e.value instanceof a?Promise.resolve(e.value.v).then(d,f):p(o[0][2],e)}function d(e){l(`next`,e)}function f(e){l(`throw`,e)}function p(e,t){e(t),o.shift(),o.length&&l(o[0][0],o[0][1])}}function s(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:a(e[r](t)),done:!1}:i?i(t):t}:i}}function c(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof i==`function`?i(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,i){n=e[t](n),a(r,i,n.done,n.value)})}}function a(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}var l=class e{constructor(e){this._promise=e}static fromSafePromise(t){return new e(t.then(e=>new S(e)))}static fromPromise(t,n,r){return new e(t.then(e=>new S(e)).catch(e=>new C(n(e))).finally(r))}static fromThrowable(t,n,i){return(...a)=>new e(r(this,void 0,void 0,function*(){try{return new S(yield t(...a))}catch(e){return new C(n?n(e):e)}finally{i?.()}}))}static combine(e){return g(e)}static combineWithAllErrors(e){return v(e)}map(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){return e.isErr()?new C(e.error):new S(yield t(e.value))})))}andThrough(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){if(e.isErr())return new C(e.error);let n=yield t(e.value);return n.isErr()?new C(n.error):new S(e.value)})))}andTee(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){if(e.isErr())return new C(e.error);try{yield t(e.value)}catch{}return new S(e.value)})))}orTee(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){if(e.isOk())return new S(e.value);try{yield t(e.error)}catch{}return new C(e.error)})))}mapErr(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){return e.isOk()?new S(e.value):new C(yield t(e.error))})))}andThen(t){return new e(this._promise.then(n=>{if(n.isErr())return new C(n.error);let r=t(n.value);return r instanceof e?r._promise:r}))}finally(t){return new e(this._promise.finally(t))}orElse(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){return e.isErr()?t(e.error):new S(e.value)})))}match(e,t){return r(this,void 0,void 0,function*(){return this._promise.then(n=>n.match(e,t))})}unwrapOr(e){return r(this,void 0,void 0,function*(){return this._promise.then(t=>t.unwrapOr(e))})}safeUnwrap(){return o(this,arguments,function*(){return yield a(yield a(yield*s(c(yield a(this._promise.then(e=>e.safeUnwrap()))))))})}then(e,t){return this._promise.then(e,t)}[Symbol.asyncIterator](){return o(this,arguments,function*(){let e=yield a(this._promise);return e.isErr()&&(yield yield a(d(e.error))),yield a(e.value)})}};function u(e){return new l(Promise.resolve(new S(e)))}function d(e){return new l(Promise.resolve(new C(e)))}let f=l.fromPromise,p=l.fromSafePromise,m=l.fromThrowable,h=e=>{let t=y([]);for(let n of e)if(n.isErr()){t=b(n.error);break}else t.map(e=>e.push(n.value));return t},g=e=>l.fromSafePromise(Promise.all(e)).andThen(h),_=e=>{let t=y([]);for(let n of e)n.isErr()&&t.isErr()?t.error.push(n.error):n.isErr()&&t.isOk()?t=b([n.error]):n.isOk()&&t.isOk()&&t.value.push(n.value);return t},v=e=>l.fromSafePromise(Promise.all(e)).andThen(_);e.ResultJson=void 0,(function(e){function t(e){return!!(typeof e==`object`&&e&&`__tag`in e&&(`error`in e||`value`in e))}e.is=t;function n(e){return e.__tag===`err`}e.isErr=n;function r(e){return e.__tag===`ok`}e.isOk=r;function i(e){return{__tag:`ok`,value:e}}e.ok=i;function a(e){return{__tag:`err`,error:e}}e.err=a})(e.ResultJson||={}),e.Result=void 0,(function(t){function n(e,t){return(...n)=>{try{return y(e(...n))}catch(e){return b(t?t(e):e)}}}t.fromThrowable=n;function r(e){return h(e)}t.combine=r;function i(e){return _(e)}t.combineWithAllErrors=i;function a(t){return e.ResultJson.isOk(t)?y(t.value):b(t.error)}t.fromJson=a})(e.Result||={});function y(e){return new S(e)}function b(e){return new C(e)}function x(e){let t=e().next();return t instanceof Promise?new l(t.then(e=>e.value)):t.value}var S=class{constructor(e){this.value=e,this.__tag=`ok`}toJson(){return{__tag:this.__tag,value:this.value}}isOk(){return!0}isErr(){return!this.isOk()}map(e){return y(e(this.value))}mapErr(e){return y(this.value)}andThen(e){return e(this.value)}andThrough(e){return e(this.value).map(e=>this.value)}andTee(e){try{e(this.value)}catch{}return y(this.value)}orTee(e){return y(this.value)}orElse(e){return y(this.value)}asyncAndThen(e){return e(this.value)}asyncAndThrough(e){return e(this.value).map(()=>this.value)}asyncMap(e){return l.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,t){return e(this.value)}expect(){return this.value}expectErr(e){throw e instanceof Error?e:n(e,this)}safeUnwrap(){let e=this.value;return(function*(){return e})()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw n("Called `_unsafeUnwrapErr` on an Ok",this,e)}*[Symbol.iterator](){return this.value}},C=class{constructor(e){this.error=e,this.__tag=`err`}toJson(){return{__tag:this.__tag,error:this.error}}isOk(){return!1}isErr(){return!this.isOk()}map(e){return b(this.error)}mapErr(e){return b(e(this.error))}andThrough(e){return b(this.error)}andTee(e){return b(this.error)}orTee(e){try{e(this.error)}catch{}return b(this.error)}andThen(e){return b(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return d(this.error)}asyncAndThrough(e){return d(this.error)}asyncMap(e){return d(this.error)}unwrapOr(e){return e}match(e,t){return t(this.error)}expect(e){throw e instanceof Error?e:n(e,this)}expectErr(){return this.error}safeUnwrap(){let e=this.error;return(function*(){throw yield b(e),Error("Do not use this generator out of `safeTry`")})()}_unsafeUnwrap(e){throw n("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}*[Symbol.iterator](){return yield this,this}};let w=e.Result.fromThrowable;e.Err=C,e.Ok=S,e.ResultAsync=l,e.err=b,e.errAsync=d,e.fromAsyncThrowable=m,e.fromPromise=f,e.fromSafePromise=p,e.fromThrowable=w,e.ok=y,e.okAsync=u,e.safeTry=x}));function Mt(e,t){return n=>n.length>1?[e,t,n[0],`--`,...n.slice(1)]:[e,t,n[0]]}function Nt(){return e=>[`deno`,`run`,`npm:${e[0]}`,...e.slice(1)]}const Pt={agent:[`npm`,0],run:Mt(`npm`,`run`),install:[`npm`,`i`,0],frozen:[`npm`,`ci`,0],global:[`npm`,`i`,`-g`,0],add:[`npm`,`i`,0],upgrade:[`npm`,`update`,0],"upgrade-interactive":null,dedupe:[`npm`,`dedupe`,0],execute:[`npx`,0],"execute-local":[`npx`,0],uninstall:[`npm`,`uninstall`,0],global_uninstall:[`npm`,`uninstall`,`-g`,0]},Ft={agent:[`yarn`,0],run:[`yarn`,`run`,0],install:[`yarn`,`install`,0],frozen:[`yarn`,`install`,`--frozen-lockfile`,0],global:[`yarn`,`global`,`add`,0],add:[`yarn`,`add`,0],upgrade:[`yarn`,`upgrade`,0],"upgrade-interactive":[`yarn`,`upgrade-interactive`,0],dedupe:null,execute:[`npx`,0],"execute-local":Mt(`yarn`,`exec`),uninstall:[`yarn`,`remove`,0],global_uninstall:[`yarn`,`global`,`remove`,0]},It={...Ft,frozen:[`yarn`,`install`,`--immutable`,0],upgrade:[`yarn`,`up`,0],"upgrade-interactive":[`yarn`,`up`,`-i`,0],dedupe:[`yarn`,`dedupe`,0],execute:[`yarn`,`dlx`,0],"execute-local":[`yarn`,`exec`,0],global:[`npm`,`i`,`-g`,0],global_uninstall:[`npm`,`uninstall`,`-g`,0]},Lt={agent:[`pnpm`,0],run:[`pnpm`,`run`,0],install:[`pnpm`,`i`,0],frozen:[`pnpm`,`i`,`--frozen-lockfile`,0],global:[`pnpm`,`add`,`-g`,0],add:[`pnpm`,`add`,0],upgrade:[`pnpm`,`update`,0],"upgrade-interactive":[`pnpm`,`update`,`-i`,0],dedupe:[`pnpm`,`dedupe`,0],execute:[`pnpm`,`dlx`,0],"execute-local":[`pnpm`,`exec`,0],uninstall:[`pnpm`,`remove`,0],global_uninstall:[`pnpm`,`remove`,`--global`,0]},Rt={agent:[`bun`,0],run:[`bun`,`run`,0],install:[`bun`,`install`,0],frozen:[`bun`,`install`,`--frozen-lockfile`,0],global:[`bun`,`add`,`-g`,0],add:[`bun`,`add`,0],upgrade:[`bun`,`update`,0],"upgrade-interactive":[`bun`,`update`,`-i`,0],dedupe:null,execute:[`bun`,`x`,0],"execute-local":[`bun`,`x`,0],uninstall:[`bun`,`remove`,0],global_uninstall:[`bun`,`remove`,`-g`,0]},zt={agent:[`deno`,0],run:[`deno`,`task`,0],install:[`deno`,`install`,0],frozen:[`deno`,`install`,`--frozen`,0],global:[`deno`,`install`,`-g`,0],add:[`deno`,`add`,0],upgrade:[`deno`,`outdated`,`--update`,0],"upgrade-interactive":[`deno`,`outdated`,`--update`,0],dedupe:null,execute:Nt(),"execute-local":[`deno`,`task`,`--eval`,0],uninstall:[`deno`,`remove`,0],global_uninstall:[`deno`,`uninstall`,`-g`,0]},Bt={npm:Pt,yarn:Ft,"yarn@berry":It,pnpm:Lt,"pnpm@6":{...Lt,run:Mt(`pnpm`,`run`)},bun:Rt,deno:zt};function Vt(e,t,n){let r=Bt[e][t];return Ht(r,n)}function Ht(e,t){if(e==null)return null;let n=typeof e==`function`?e(t):e.flatMap(e=>typeof e==`number`?t:[e]);return{command:n[0],args:n.slice(1)}}const Ut=[`npm`,`yarn`,`yarn@berry`,`pnpm`,`pnpm@6`,`bun`,`deno`],Wt={"bun.lock":`bun`,"bun.lockb":`bun`,"deno.lock":`deno`,"pnpm-lock.yaml":`pnpm`,"pnpm-workspace.yaml":`pnpm`,"yarn.lock":`yarn`,"package-lock.json":`npm`,"npm-shrinkwrap.json":`npm`},Gt={"node_modules/.deno/":`deno`,"node_modules/.pnpm/":`pnpm`,"node_modules/.yarn-state.yml":`yarn`,"node_modules/.yarn_integrity":`yarn`,"node_modules/.package-lock.json":`npm`,".pnp.cjs":`yarn`,".pnp.js":`yarn`,"bun.lock":`bun`,"bun.lockb":`bun`};async function Kt(e,t){try{let n=await w.stat(e);return t===`file`?n.isFile():n.isDirectory()}catch{return!1}}function*qt(e=s.cwd()){let t=m.resolve(e),{root:n}=m.parse(t);for(;t&&t!==n;)yield t,t=m.dirname(t)}async function Jt(e,t){return!e||!await Kt(e,`file`)?null:await Zt(e,t)}async function Yt(e={}){let{cwd:t,strategies:n=[`lockfile`,`packageManager-field`,`devEngines-field`]}=e,r;if(typeof e.stopDir==`string`){let t=m.resolve(e.stopDir);r=e=>e===t}else r=e.stopDir;for(let i of qt(t)){for(let t of n)switch(t){case`lockfile`:for(let t of Object.keys(Wt))if(await Kt(m.join(i,t),`file`)){let n=Wt[t];return await Jt(m.join(i,`package.json`),e)||{name:n,agent:n}}break;case`packageManager-field`:case`devEngines-field`:{let t=await Jt(m.join(i,`package.json`),e);if(t)return t;break}case`install-metadata`:for(let e of Object.keys(Gt)){let t=e.endsWith(`/`)?`dir`:`file`;if(await Kt(m.join(i,e),t)){let t=Gt[e];return{name:t,agent:t===`yarn`?Qt(e)?`yarn`:`yarn@berry`:t}}}break}if(r?.(i))break}return null}function Xt(e){let t=e=>e?.match(/\d+(\.\d+){0,2}/)?.[0]??e;if(typeof e.packageManager==`string`){let[n,r]=e.packageManager.replace(/^\^/,``).split(`@`);return{name:n,ver:t(r)}}if(typeof e.devEngines?.packageManager?.name==`string`)return{name:e.devEngines.packageManager.name,ver:t(e.devEngines.packageManager.version)}}async function Zt(e,t){try{let n=await w.readFile(e,`utf8`),r=t.packageJsonParser?await t.packageJsonParser(n,e):JSON.parse(n),i,a=Xt(r);if(a){let e=a.name,n=a.ver,o=n;return e===`yarn`&&n&&Number.parseInt(n)>1?(i=`yarn@berry`,o=`berry`,{name:e,agent:i,version:o}):e===`pnpm`&&n&&Number.parseInt(n)<7?(i=`pnpm@6`,{name:e,agent:i,version:o}):Ut.includes(e)?(i=e,{name:e,agent:i,version:o}):t.onUnknown?.(r.packageManager)??null}}catch{}return null}function Qt(e){return e.endsWith(`.yarn_integrity`)}var N=jt();let $t=()=>{var e=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},a=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(let c of n(a))!r.call(i,c)&&c!==o&&e(i,c,{get:()=>a[c],enumerable:!(s=t(a,c))||s.enumerable});return i},o=t=>a(e({},`__esModule`,{value:!0}),t),s={};i(s,{default:()=>Ve});var c=e=>Array.isArray(e),l=e=>typeof e==`function`,u=e=>e.length===0,d=e=>typeof e==`number`,f=e=>typeof e==`object`&&!!e,p=e=>e instanceof RegExp,m=e=>typeof e==`string`,h=e=>e===void 0,g=e=>{let t=new Map;return n=>{let r=t.get(n);if(r)return r;let i=e(n);return t.set(n,i),i}},_=(e,t,n={})=>{let r={cache:{},input:e,index:0,indexMax:0,options:n,output:[]};if(ae(t)(r)&&r.index===e.length)return r.output;throw Error(`Failed to parse at index ${r.indexMax}`)},v=(e,t)=>c(e)?y(e,t):m(e)?x(e,t):b(e,t),y=(e,t)=>{let n={};for(let t of e){if(t.length!==1)throw Error(`Invalid character: "${t}"`);let e=t.charCodeAt(0);n[e]=!0}return e=>{let r=e.index,i=e.input;for(;e.index<i.length&&i.charCodeAt(e.index)in n;)e.index+=1;let a=e.index;if(a>r){if(!h(t)&&!e.options.silent){let n=e.input.slice(r,a),o=l(t)?t(n,i,String(r)):t;h(o)||e.output.push(o)}e.indexMax=Math.max(e.indexMax,e.index)}return!0}},b=(e,t)=>{let n=e.source,r=e.flags.replace(/y|$/,`y`),i=new RegExp(n,r);return re(e=>{i.lastIndex=e.index;let n=i.exec(e.input);if(n){if(!h(t)&&!e.options.silent){let r=l(t)?t(...n,e.input,String(e.index)):t;h(r)||e.output.push(r)}return e.index+=n[0].length,e.indexMax=Math.max(e.indexMax,e.index),!0}else return!1})},x=(e,t)=>n=>{if(n.input.startsWith(e,n.index)){if(!h(t)&&!n.options.silent){let r=l(t)?t(e,n.input,String(n.index)):t;h(r)||n.output.push(r)}return n.index+=e.length,n.indexMax=Math.max(n.indexMax,n.index),!0}else return!1},S=(e,t,n,r)=>{let i=ae(e);return re(ne(te(e=>{let r=0;for(;r<n;){let t=e.index;if(!i(e)||(r+=1,e.index===t))break}return r>=t})))},C=(e,t)=>S(e,0,1),w=(e,t)=>S(e,0,1/0),ee=(e,t)=>{let n=e.map(ae);return re(ne(te(e=>{for(let t=0,r=n.length;t<r;t++)if(!n[t](e))return!1;return!0})))},T=(e,t)=>{let n=e.map(ae);return re(ne(e=>{for(let t=0,r=n.length;t<r;t++)if(n[t](e))return!0;return!1}))},te=(e,t=!1)=>{let n=ae(e);return e=>{let r=e.index,i=e.output.length,a=n(e);return(!a||t)&&(e.index=r,e.output.length!==i&&(e.output.length=i)),a}},ne=(e,t)=>ae(e),re=(()=>{let e=0;return t=>{let n=ae(t),r=e+=1;return e=>{var t;if(e.options.memoization===!1)return n(e);let i=e.index,a=(t=e.cache)[r]||(t[r]=new Map),o=a.get(i);if(o===!1)return!1;if(d(o))return e.index=o,!0;if(o)return e.index=o.index,o.output?.length&&e.output.push(...o.output),!0;{let t=e.output.length;if(n(e)){let n=e.index,r=e.output.length;if(r>t){let o=e.output.slice(t,r);a.set(i,{index:n,output:o})}else a.set(i,n);return!0}else return a.set(i,!1),!1}}}})(),ie=e=>{let t;return n=>(t||=ae(e()),t(n))},ae=g(e=>{if(l(e))return u(e)?ie(e):e;if(m(e)||p(e))return v(e);if(c(e))return ee(e);if(f(e))return T(Object.values(e));throw Error(`Invalid rule`)}),oe=`abcdefghijklmnopqrstuvwxyz`,se=e=>{let t=``;for(;e>0;)t=oe[(e-1)%26]+t,e=Math.floor((e-1)/26);return t},ce=e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t=t*26+oe.indexOf(e[n])+1;return t},E=(e,t)=>{if(t<e)return E(t,e);let n=[];for(;e<=t;)n.push(e++);return n},le=(e,t,n)=>E(e,t).map(e=>String(e).padStart(n,`0`)),ue=(e,t)=>E(ce(e),ce(t)).map(se),D=e=>e,de=e=>fe(t=>_(t,e,{memoization:!1}).join(``)),fe=e=>{let t={};return n=>t[n]??(t[n]=e(n))},pe=v(/^\*\*\/\*$/,`.*`),me=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/,(e,t,n)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}`),O=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/,(e,t,n,r)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}(?:${r.replaceAll(`,`,`|`).replaceAll(`.`,`\\.`)})`),k=v(/\\./,D),he=v(/[$.*+?^(){}[\]\|]/,e=>`\\${e}`),ge=v(/./,D),_e=T([v(/^(?:!!)*!(.*)$/,(e,t)=>`(?!^${Ie(t)}$).*?`),v(/^(!!)+/,``)]),ve=T([v(/\/(\*\*\/)+/,`(?:/.+/|/)`),v(/^(\*\*\/)+/,`(?:^|.*/)`),v(/\/(\*\*)$/,`(?:/.*|$)`),v(/\*\*/,`.*`)]),ye=T([v(/\*\/(?!\*\*\/)/,`[^/]*/`),v(/\*/,`[^/]*`)]),be=v(`?`,`[^/]`),xe=v(`[`,D),Se=v(`]`,D),Ce=v(/[!^]/,`^/`),we=v(/[a-z]-[a-z]|[0-9]-[0-9]/i,D),Te=T([k,v(/[$.*+?^(){}[\|]/,e=>`\\${e}`),we,v(/[^\]]/,D)]),Ee=ee([xe,C(Ce),w(Te),Se]),De=v(`{`,`(?:`),Oe=v(`}`,`)`),ke=ee([De,T([v(/(\d+)\.\.(\d+)/,(e,t,n)=>le(+t,+n,Math.min(t.length,n.length)).join(`|`)),v(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>ue(t,n).join(`|`)),v(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>ue(t.toLowerCase(),n.toLowerCase()).join(`|`).toUpperCase())]),Oe]),Ae=v(`{`,`(?:`),je=v(`}`,`)`),Me=v(`,`,`|`),Ne=v(/[$.*+?^(){[\]\|]/,e=>`\\${e}`),Pe=v(/[^}]/,D),Fe=ee([Ae,w(T([ve,ye,be,Ee,ke,ie(()=>Fe),k,Ne,Me,Pe])),je]),Ie=de(w(T([pe,me,O,_e,ve,ye,be,Ee,ke,Fe,k,he,ge]))),Le=v(/\\./,D),Re=v(/./,D),ze=de(w(T([Le,v(/\*\*\*+/,`*`),v(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),v(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),Re]))),Be=(e,t)=>{let n=Array.isArray(e)?e:[e];if(!n.length)return!1;let r=n.map(Be.compile),i=n.every(e=>/(\/(?:\*\*)?|\[\/\])$/.test(e)),a=t.replace(/[\\\/]+/g,`/`).replace(/\/$/,i?`/`:``);return r.some(e=>e.test(a))};Be.compile=e=>RegExp(`^${Ie(ze(e))}$`,`s`);var Ve=Be;return o(s)})();return e.default||e},en;const tn=(e,t)=>(en||(en=$t(),$t=null),en(e,t)),nn=/^[A-Za-z]:\//;function rn(e=``){return e&&e.replace(/\\/g,`/`).replace(nn,e=>e.toUpperCase())}const an=/^[/\\]{2}/,on=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,sn=/^[A-Za-z]:$/,cn=/^\/([A-Za-z]:)?$/,ln=/.(\.[^./]+|\.)$/,un=/^[/\\]|^[a-zA-Z]:[/\\]/,dn=function(e){if(e.length===0)return`.`;e=rn(e);let t=e.match(an),n=gn(e),r=e[e.length-1]===`/`;return e=hn(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),sn.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!gn(e)?`/${e}`:e)},fn=function(...e){let t=``;for(let n of e)if(n)if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;e&&r?t+=n.slice(1):t+=e||r?n:`/${n}`}else t+=n;return dn(t)};function pn(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const mn=function(...e){e=e.map(e=>rn(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:pn();!i||i.length===0||(t=`${i}/${t}`,n=gn(i))}return t=hn(t,!n),n&&!gn(t)?`/${t}`:t.length>0?t:`.`};function hn(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}const gn=function(e){return on.test(e)},_n=function(e){return rn(e)},vn=function(e){if(e===`..`)return``;let t=ln.exec(rn(e));return t&&t[1]||``},yn=function(e,t){let n=mn(e).replace(cn,`$1`).split(`/`),r=mn(t).replace(cn,`$1`).split(`/`);if(r[0][1]===`:`&&n[0][1]===`:`&&n[0]!==r[0])return r.join(`/`);let i=[...n];for(let e of i){if(r[0]!==e)break;n.shift(),r.shift()}return[...n.map(()=>`..`),...r].join(`/`)},bn=function(e){let t=rn(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&sn.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(gn(e)?`/`:`.`)},xn=function(e){let t=e.ext?e.ext.startsWith(`.`)?e.ext:`.${e.ext}`:``,n=[e.root,e.dir,e.base??(e.name??``)+t].filter(Boolean);return rn(e.root?mn(...n):n.join(`/`))},Sn=function(e,t){let n=rn(e).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return t&&r.endsWith(t)?r.slice(0,-t.length):r},Cn={__proto__:null,basename:Sn,dirname:bn,extname:vn,format:xn,isAbsolute:gn,join:fn,matchesGlob:(e,t)=>tn(t,dn(e)),normalize:dn,normalizeString:hn,parse:function(e){let t=un.exec(e)?.[0]?.replace(/\\/g,`/`)||``,n=Sn(e),r=vn(n);return{root:t,dir:bn(e),base:n,ext:r,name:n.slice(0,n.length-r.length)}},relative:yn,resolve:mn,sep:`/`,toNamespacedPath:_n},wn=globalThis.process?.platform===`win32`?`;`:`:`,Tn={posix:void 0,win32:void 0},En=(e=wn)=>new Proxy(Cn,{get(t,n){return n===`delimiter`?e:n===`posix`?Dn:n===`win32`?On:Tn[n]||Cn[n]}}),Dn=En(`:`),On=En(`;`);Object.freeze({status:`aborted`});function P(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var kn=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},An=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const jn={};function Mn(e){return e&&Object.assign(jn,e),jn}function Nn(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Pn(e,t){return typeof t==`bigint`?t.toString():t}function Fn(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function In(e){return e==null}function Ln(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Rn(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const zn=Symbol(`evaluating`);function F(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==zn)return r===void 0&&(r=zn,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Bn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Vn(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Hn(e){return JSON.stringify(e)}function Un(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Wn=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Gn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Kn=Fn(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function qn(e){if(Gn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Gn(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Jn(e){return qn(e)?{...e}:Array.isArray(e)?[...e]:e}const Yn=new Set([`string`,`number`,`symbol`]);function Xn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Zn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function I(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Qn(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const $n={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function er(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Zn(e,Vn(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Bn(this,`shape`,e),e},checks:[]}))}function tr(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Zn(e,Vn(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Bn(this,`shape`,r),r},checks:[]}))}function nr(e,t){if(!qn(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Zn(e,Vn(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Bn(this,`shape`,n),n}}))}function rr(e,t){if(!qn(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Zn(e,Vn(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Bn(this,`shape`,n),n}}))}function ir(e,t){return Zn(e,Vn(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Bn(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function ar(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Zn(t,Vn(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Bn(this,`shape`,i),i},checks:[]}))}function or(e,t,n){return Zn(t,Vn(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Bn(this,`shape`,i),i}}))}function sr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function cr(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function lr(e){return typeof e==`string`?e:e?.message}function ur(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=lr(e.inst?._zod.def?.error?.(e))??lr(t?.error?.(e))??lr(n.customError?.(e))??lr(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function dr(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function fr(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const pr=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Pn,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},mr=P(`$ZodError`,pr),hr=P(`$ZodError`,pr,{Parent:Error});function gr(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function _r(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}const vr=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new kn;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>ur(e,a,Mn())));throw Wn(t,i?.callee),t}return o.value},yr=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>ur(e,a,Mn())));throw Wn(t,i?.callee),t}return o.value},br=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new kn;return a.issues.length?{success:!1,error:new(e??mr)(a.issues.map(e=>ur(e,i,Mn())))}:{success:!0,data:a.value}},xr=br(hr),Sr=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ur(e,i,Mn())))}:{success:!0,data:a.value}},Cr=Sr(hr),wr=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return vr(e)(t,n,i)},Tr=e=>(t,n,r)=>vr(e)(t,n,r),Er=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return yr(e)(t,n,i)},Dr=e=>async(t,n,r)=>yr(e)(t,n,r),Or=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return br(e)(t,n,i)},kr=e=>(t,n,r)=>br(e)(t,n,r),Ar=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Sr(e)(t,n,i)},jr=e=>async(t,n,r)=>Sr(e)(t,n,r),Mr=/^[cC][^\s-]{8,}$/,Nr=/^[0-9a-z]+$/,Pr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fr=/^[0-9a-vA-V]{20}$/,Ir=/^[A-Za-z0-9]{27}$/,Lr=/^[a-zA-Z0-9_-]{21}$/,Rr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Br=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Vr=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Hr(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const Ur=/^(?:(?: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])$/,Wr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Gr=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Kr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Jr=/^[A-Za-z0-9_-]*$/,Yr=/^\+[1-9]\d{6,14}$/,Xr=`(?:(?:\\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])))`,Zr=RegExp(`^${Xr}$`);function Qr(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function $r(e){return RegExp(`^${Qr(e)}$`)}function ei(e){let t=Qr({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Xr}T(?:${r})$`)}const ti=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},ni=/^-?\d+$/,ri=/^-?\d+(?:\.\d+)?$/,ii=/^(?:true|false)$/i,ai=/^[^A-Z]*$/,oi=/^[^a-z]*$/,L=P(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),si={number:`number`,bigint:`bigint`,object:`date`},ci=P(`$ZodCheckLessThan`,(e,t)=>{L.init(e,t);let n=si[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),li=P(`$ZodCheckGreaterThan`,(e,t)=>{L.init(e,t);let n=si[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ui=P(`$ZodCheckMultipleOf`,(e,t)=>{L.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Rn(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),di=P(`$ZodCheckNumberFormat`,(e,t)=>{L.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=$n[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=ni)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),fi=P(`$ZodCheckMaxLength`,(e,t)=>{var n;L.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!In(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=dr(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pi=P(`$ZodCheckMinLength`,(e,t)=>{var n;L.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!In(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=dr(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),mi=P(`$ZodCheckLengthEquals`,(e,t)=>{var n;L.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!In(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=dr(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),hi=P(`$ZodCheckStringFormat`,(e,t)=>{var n,r;L.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),gi=P(`$ZodCheckRegex`,(e,t)=>{hi.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_i=P(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ai,hi.init(e,t)}),vi=P(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=oi,hi.init(e,t)}),yi=P(`$ZodCheckIncludes`,(e,t)=>{L.init(e,t);let n=Xn(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),bi=P(`$ZodCheckStartsWith`,(e,t)=>{L.init(e,t);let n=RegExp(`^${Xn(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),xi=P(`$ZodCheckEndsWith`,(e,t)=>{L.init(e,t);let n=RegExp(`.*${Xn(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Si=P(`$ZodCheckOverwrite`,(e,t)=>{L.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Ci=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
58
58
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
59
- `))}};const wi={major:4,minor:3,patch:5},R=P(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wi;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=sr(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new kn;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=sr(e,t))});else{if(e.issues.length===t)continue;r||=sr(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(sr(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new kn;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new kn;return o.then(e=>t(e,r,a))}return t(o,r,a)}}F(e,`~standard`,()=>({validate:t=>{try{let n=xr(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Cr(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Ti=P(`$ZodString`,(e,t)=>{R.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ti(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),z=P(`$ZodStringFormat`,(e,t)=>{hi.init(e,t),Ti.init(e,t)}),Ei=P(`$ZodGUID`,(e,t)=>{t.pattern??=zr,z.init(e,t)}),Di=P(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Br(e)}else t.pattern??=Br();z.init(e,t)}),Oi=P(`$ZodEmail`,(e,t)=>{t.pattern??=Vr,z.init(e,t)}),ki=P(`$ZodURL`,(e,t)=>{z.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ai=P(`$ZodEmoji`,(e,t)=>{t.pattern??=Hr(),z.init(e,t)}),ji=P(`$ZodNanoID`,(e,t)=>{t.pattern??=Lr,z.init(e,t)}),Mi=P(`$ZodCUID`,(e,t)=>{t.pattern??=Mr,z.init(e,t)}),Ni=P(`$ZodCUID2`,(e,t)=>{t.pattern??=Nr,z.init(e,t)}),Pi=P(`$ZodULID`,(e,t)=>{t.pattern??=Pr,z.init(e,t)}),Fi=P(`$ZodXID`,(e,t)=>{t.pattern??=Fr,z.init(e,t)}),Ii=P(`$ZodKSUID`,(e,t)=>{t.pattern??=Ir,z.init(e,t)}),Li=P(`$ZodISODateTime`,(e,t)=>{t.pattern??=ei(t),z.init(e,t)}),Ri=P(`$ZodISODate`,(e,t)=>{t.pattern??=Zr,z.init(e,t)}),zi=P(`$ZodISOTime`,(e,t)=>{t.pattern??=$r(t),z.init(e,t)}),Bi=P(`$ZodISODuration`,(e,t)=>{t.pattern??=Rr,z.init(e,t)}),Vi=P(`$ZodIPv4`,(e,t)=>{t.pattern??=Ur,z.init(e,t),e._zod.bag.format=`ipv4`}),Hi=P(`$ZodIPv6`,(e,t)=>{t.pattern??=Wr,z.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Ui=P(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Gr,z.init(e,t)}),Wi=P(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Kr,z.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Gi(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Ki=P(`$ZodBase64`,(e,t)=>{t.pattern??=qr,z.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Gi(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function qi(e){if(!Jr.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Gi(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Ji=P(`$ZodBase64URL`,(e,t)=>{t.pattern??=Jr,z.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{qi(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Yi=P(`$ZodE164`,(e,t)=>{t.pattern??=Yr,z.init(e,t)});function Xi(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Zi=P(`$ZodJWT`,(e,t)=>{z.init(e,t),e._zod.check=n=>{Xi(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Qi=P(`$ZodNumber`,(e,t)=>{R.init(e,t),e._zod.pattern=e._zod.bag.pattern??ri,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),$i=P(`$ZodNumberFormat`,(e,t)=>{di.init(e,t),Qi.init(e,t)}),ea=P(`$ZodBoolean`,(e,t)=>{R.init(e,t),e._zod.pattern=ii,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),ta=P(`$ZodUnknown`,(e,t)=>{R.init(e,t),e._zod.parse=e=>e}),na=P(`$ZodNever`,(e,t)=>{R.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ra(e,t,n){e.issues.length&&t.issues.push(...cr(n,e.issues)),t.value[n]=e.value}const ia=P(`$ZodArray`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>ra(t,n,e))):ra(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function aa(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...cr(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function oa(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Qn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function sa(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>aa(e,n,i,t,u))):aa(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const ca=P(`$ZodObject`,(e,t)=>{if(R.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Fn(()=>oa(t));F(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Gn,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>aa(n,t,e,s,r))):aa(i,t,e,s,r)}return i?sa(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),la=P(`$ZodObjectJIT`,(e,t)=>{ca.init(e,t);let n=e._zod.parse,r=Fn(()=>oa(t)),i=e=>{let t=new Ci([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Hn(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Hn(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
59
+ `))}};const wi={major:4,minor:3,patch:6},R=P(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wi;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=sr(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new kn;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=sr(e,t))});else{if(e.issues.length===t)continue;r||=sr(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(sr(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new kn;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new kn;return o.then(e=>t(e,r,a))}return t(o,r,a)}}F(e,`~standard`,()=>({validate:t=>{try{let n=xr(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Cr(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Ti=P(`$ZodString`,(e,t)=>{R.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ti(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),z=P(`$ZodStringFormat`,(e,t)=>{hi.init(e,t),Ti.init(e,t)}),Ei=P(`$ZodGUID`,(e,t)=>{t.pattern??=zr,z.init(e,t)}),Di=P(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Br(e)}else t.pattern??=Br();z.init(e,t)}),Oi=P(`$ZodEmail`,(e,t)=>{t.pattern??=Vr,z.init(e,t)}),ki=P(`$ZodURL`,(e,t)=>{z.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ai=P(`$ZodEmoji`,(e,t)=>{t.pattern??=Hr(),z.init(e,t)}),ji=P(`$ZodNanoID`,(e,t)=>{t.pattern??=Lr,z.init(e,t)}),Mi=P(`$ZodCUID`,(e,t)=>{t.pattern??=Mr,z.init(e,t)}),Ni=P(`$ZodCUID2`,(e,t)=>{t.pattern??=Nr,z.init(e,t)}),Pi=P(`$ZodULID`,(e,t)=>{t.pattern??=Pr,z.init(e,t)}),Fi=P(`$ZodXID`,(e,t)=>{t.pattern??=Fr,z.init(e,t)}),Ii=P(`$ZodKSUID`,(e,t)=>{t.pattern??=Ir,z.init(e,t)}),Li=P(`$ZodISODateTime`,(e,t)=>{t.pattern??=ei(t),z.init(e,t)}),Ri=P(`$ZodISODate`,(e,t)=>{t.pattern??=Zr,z.init(e,t)}),zi=P(`$ZodISOTime`,(e,t)=>{t.pattern??=$r(t),z.init(e,t)}),Bi=P(`$ZodISODuration`,(e,t)=>{t.pattern??=Rr,z.init(e,t)}),Vi=P(`$ZodIPv4`,(e,t)=>{t.pattern??=Ur,z.init(e,t),e._zod.bag.format=`ipv4`}),Hi=P(`$ZodIPv6`,(e,t)=>{t.pattern??=Wr,z.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Ui=P(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Gr,z.init(e,t)}),Wi=P(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Kr,z.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Gi(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Ki=P(`$ZodBase64`,(e,t)=>{t.pattern??=qr,z.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Gi(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function qi(e){if(!Jr.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Gi(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Ji=P(`$ZodBase64URL`,(e,t)=>{t.pattern??=Jr,z.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{qi(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Yi=P(`$ZodE164`,(e,t)=>{t.pattern??=Yr,z.init(e,t)});function Xi(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Zi=P(`$ZodJWT`,(e,t)=>{z.init(e,t),e._zod.check=n=>{Xi(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Qi=P(`$ZodNumber`,(e,t)=>{R.init(e,t),e._zod.pattern=e._zod.bag.pattern??ri,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),$i=P(`$ZodNumberFormat`,(e,t)=>{di.init(e,t),Qi.init(e,t)}),ea=P(`$ZodBoolean`,(e,t)=>{R.init(e,t),e._zod.pattern=ii,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),ta=P(`$ZodUnknown`,(e,t)=>{R.init(e,t),e._zod.parse=e=>e}),na=P(`$ZodNever`,(e,t)=>{R.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ra(e,t,n){e.issues.length&&t.issues.push(...cr(n,e.issues)),t.value[n]=e.value}const ia=P(`$ZodArray`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>ra(t,n,e))):ra(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function aa(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...cr(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function oa(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Qn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function sa(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>aa(e,n,i,t,u))):aa(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const ca=P(`$ZodObject`,(e,t)=>{if(R.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Fn(()=>oa(t));F(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Gn,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>aa(n,t,e,s,r))):aa(i,t,e,s,r)}return i?sa(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),la=P(`$ZodObjectJIT`,(e,t)=>{ca.init(e,t);let n=e._zod.parse,r=Fn(()=>oa(t)),i=e=>{let t=new Ci([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Hn(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Hn(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
60
60
  if (${n}.issues.length) {
61
61
  if (${o} in input) {
62
62
  payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
@@ -90,9 +90,9 @@ ${O.default.cyan(it)}
90
90
  newResult[${o}] = ${n}.value;
91
91
  }
92
92
 
93
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Gn,s=!jn.jitless,c=s&&Kn.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?sa([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function ua(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!sr(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ur(e,r,Mn())))}),t)}const da=P(`$ZodUnion`,(e,t)=>{R.init(e,t),F(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),F(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),F(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),F(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Ln(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>ua(t,i,e,a)):ua(s,i,e,a)}}),fa=P(`$ZodIntersection`,(e,t)=>{R.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>ma(e,t,n)):ma(e,i,a)}});function pa(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qn(e)&&qn(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=pa(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=pa(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ma(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),sr(e))return e;let o=pa(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const ha=P(`$ZodTuple`,(e,t)=>{R.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=[...n].reverse().findIndex(e=>e._zod.optin!==`optional`),c=s===-1?0:n.length-s;if(!t.rest){let t=a.length>n.length,i=a.length<c-1;if(t||i)return r.issues.push({...t?{code:`too_big`,maximum:n.length,inclusive:!0}:{code:`too_small`,minimum:n.length},input:a,inst:e,origin:`array`}),r}let l=-1;for(let e of n){if(l++,l>=a.length&&l>=c)continue;let t=e._zod.run({value:a[l],issues:[]},i);t instanceof Promise?o.push(t.then(e=>ga(e,r,l))):ga(t,r,l)}if(t.rest){let e=a.slice(n.length);for(let n of e){l++;let e=t.rest._zod.run({value:n,issues:[]},i);e instanceof Promise?o.push(e.then(e=>ga(e,r,l))):ga(e,r,l)}}return o.length?Promise.all(o).then(()=>r):r}});function ga(e,t,n){e.issues.length&&t.issues.push(...cr(n,e.issues)),t.value[n]=e.value}const _a=P(`$ZodRecord`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!qn(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...cr(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...cr(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&ri.test(o)&&s.issues.length&&s.issues.some(e=>e.code===`invalid_type`&&e.expected===`number`)){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ur(e,r,Mn())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...cr(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...cr(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),va=P(`$ZodEnum`,(e,t)=>{R.init(e,t);let n=Nn(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Yn.has(typeof e)).map(e=>typeof e==`string`?Xn(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ya=P(`$ZodLiteral`,(e,t)=>{if(R.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Xn(e):e?Xn(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ba=P(`$ZodTransform`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new An(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new kn;return n.value=i,n}});function xa(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Sa=P(`$ZodOptional`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,F(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),F(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ln(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>xa(t,e.value)):xa(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ca=P(`$ZodExactOptional`,(e,t)=>{Sa.init(e,t),F(e._zod,`values`,()=>t.innerType._zod.values),F(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),wa=P(`$ZodNullable`,(e,t)=>{R.init(e,t),F(e._zod,`optin`,()=>t.innerType._zod.optin),F(e._zod,`optout`,()=>t.innerType._zod.optout),F(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ln(e.source)}|null)$`):void 0}),F(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ta=P(`$ZodDefault`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,F(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ea(e,t)):Ea(r,t)}});function Ea(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Da=P(`$ZodPrefault`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,F(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Oa=P(`$ZodNonOptional`,(e,t)=>{R.init(e,t),F(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ka(t,e)):ka(i,e)}});function ka(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Aa=P(`$ZodCatch`,(e,t)=>{R.init(e,t),F(e._zod,`optin`,()=>t.innerType._zod.optin),F(e._zod,`optout`,()=>t.innerType._zod.optout),F(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ur(e,n,Mn()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ur(e,n,Mn()))},input:e.value}),e.issues=[]),e)}}),ja=P(`$ZodPipe`,(e,t)=>{R.init(e,t),F(e._zod,`values`,()=>t.in._zod.values),F(e._zod,`optin`,()=>t.in._zod.optin),F(e._zod,`optout`,()=>t.out._zod.optout),F(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ma(e,t.in,n)):Ma(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ma(e,t.out,n)):Ma(r,t.out,n)}});function Ma(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Na=P(`$ZodReadonly`,(e,t)=>{R.init(e,t),F(e._zod,`propValues`,()=>t.innerType._zod.propValues),F(e._zod,`values`,()=>t.innerType._zod.values),F(e._zod,`optin`,()=>t.innerType?._zod?.optin),F(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Pa):Pa(r)}});function Pa(e){return e.value=Object.freeze(e.value),e}const Fa=P(`$ZodCustom`,(e,t)=>{L.init(e,t),R.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ia(t,n,r,e));Ia(i,n,r,e)}});function Ia(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(fr(e))}}var La,Ra=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function za(){return new Ra}(La=globalThis).__zod_globalRegistry??(La.__zod_globalRegistry=za());const Ba=globalThis.__zod_globalRegistry;function Va(e,t){return new e({type:`string`,...I(t)})}function Ha(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...I(t)})}function Ua(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...I(t)})}function Wa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...I(t)})}function Ga(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...I(t)})}function Ka(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...I(t)})}function qa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...I(t)})}function Ja(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...I(t)})}function Ya(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...I(t)})}function Xa(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...I(t)})}function Za(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...I(t)})}function Qa(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...I(t)})}function $a(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...I(t)})}function eo(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...I(t)})}function to(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...I(t)})}function no(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...I(t)})}function ro(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...I(t)})}function io(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...I(t)})}function ao(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...I(t)})}function oo(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...I(t)})}function so(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...I(t)})}function co(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...I(t)})}function lo(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...I(t)})}function uo(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...I(t)})}function fo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...I(t)})}function po(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...I(t)})}function mo(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...I(t)})}function ho(e,t){return new e({type:`number`,checks:[],...I(t)})}function go(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...I(t)})}function _o(e,t){return new e({type:`boolean`,...I(t)})}function vo(e){return new e({type:`unknown`})}function yo(e,t){return new e({type:`never`,...I(t)})}function bo(e,t){return new ci({check:`less_than`,...I(t),value:e,inclusive:!1})}function xo(e,t){return new ci({check:`less_than`,...I(t),value:e,inclusive:!0})}function So(e,t){return new li({check:`greater_than`,...I(t),value:e,inclusive:!1})}function Co(e,t){return new li({check:`greater_than`,...I(t),value:e,inclusive:!0})}function wo(e,t){return new ui({check:`multiple_of`,...I(t),value:e})}function To(e,t){return new fi({check:`max_length`,...I(t),maximum:e})}function Eo(e,t){return new pi({check:`min_length`,...I(t),minimum:e})}function Do(e,t){return new mi({check:`length_equals`,...I(t),length:e})}function Oo(e,t){return new gi({check:`string_format`,format:`regex`,...I(t),pattern:e})}function ko(e){return new _i({check:`string_format`,format:`lowercase`,...I(e)})}function Ao(e){return new vi({check:`string_format`,format:`uppercase`,...I(e)})}function jo(e,t){return new yi({check:`string_format`,format:`includes`,...I(t),includes:e})}function Mo(e,t){return new bi({check:`string_format`,format:`starts_with`,...I(t),prefix:e})}function No(e,t){return new xi({check:`string_format`,format:`ends_with`,...I(t),suffix:e})}function Po(e){return new Si({check:`overwrite`,tx:e})}function Fo(e){return Po(t=>t.normalize(e))}function Io(){return Po(e=>e.trim())}function Lo(){return Po(e=>e.toLowerCase())}function Ro(){return Po(e=>e.toUpperCase())}function zo(){return Po(e=>Un(e))}function Bo(e,t,n){return new e({type:`array`,element:t,...I(n)})}function Vo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...I(n)})}function Ho(e){let t=Uo(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(fr(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(fr(r))}},e(n.value,n)));return t}function Uo(e,t){let n=new L({check:`custom`,...I(t)});return n._zod.check=e,n}function Wo(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Ba,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function B(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,B(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&V(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Go(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
93
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Gn,s=!jn.jitless,c=s&&Kn.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?sa([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function ua(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!sr(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ur(e,r,Mn())))}),t)}const da=P(`$ZodUnion`,(e,t)=>{R.init(e,t),F(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),F(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),F(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),F(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Ln(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>ua(t,i,e,a)):ua(s,i,e,a)}}),fa=P(`$ZodIntersection`,(e,t)=>{R.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>ma(e,t,n)):ma(e,i,a)}});function pa(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qn(e)&&qn(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=pa(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=pa(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ma(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),sr(e))return e;let o=pa(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const ha=P(`$ZodTuple`,(e,t)=>{R.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=[...n].reverse().findIndex(e=>e._zod.optin!==`optional`),c=s===-1?0:n.length-s;if(!t.rest){let t=a.length>n.length,i=a.length<c-1;if(t||i)return r.issues.push({...t?{code:`too_big`,maximum:n.length,inclusive:!0}:{code:`too_small`,minimum:n.length},input:a,inst:e,origin:`array`}),r}let l=-1;for(let e of n){if(l++,l>=a.length&&l>=c)continue;let t=e._zod.run({value:a[l],issues:[]},i);t instanceof Promise?o.push(t.then(e=>ga(e,r,l))):ga(t,r,l)}if(t.rest){let e=a.slice(n.length);for(let n of e){l++;let e=t.rest._zod.run({value:n,issues:[]},i);e instanceof Promise?o.push(e.then(e=>ga(e,r,l))):ga(e,r,l)}}return o.length?Promise.all(o).then(()=>r):r}});function ga(e,t,n){e.issues.length&&t.issues.push(...cr(n,e.issues)),t.value[n]=e.value}const _a=P(`$ZodRecord`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!qn(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...cr(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...cr(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&ri.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ur(e,r,Mn())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...cr(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...cr(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),va=P(`$ZodEnum`,(e,t)=>{R.init(e,t);let n=Nn(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Yn.has(typeof e)).map(e=>typeof e==`string`?Xn(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ya=P(`$ZodLiteral`,(e,t)=>{if(R.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Xn(e):e?Xn(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ba=P(`$ZodTransform`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new An(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new kn;return n.value=i,n}});function xa(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Sa=P(`$ZodOptional`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,F(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),F(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ln(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>xa(t,e.value)):xa(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ca=P(`$ZodExactOptional`,(e,t)=>{Sa.init(e,t),F(e._zod,`values`,()=>t.innerType._zod.values),F(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),wa=P(`$ZodNullable`,(e,t)=>{R.init(e,t),F(e._zod,`optin`,()=>t.innerType._zod.optin),F(e._zod,`optout`,()=>t.innerType._zod.optout),F(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ln(e.source)}|null)$`):void 0}),F(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ta=P(`$ZodDefault`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,F(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ea(e,t)):Ea(r,t)}});function Ea(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Da=P(`$ZodPrefault`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,F(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Oa=P(`$ZodNonOptional`,(e,t)=>{R.init(e,t),F(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ka(t,e)):ka(i,e)}});function ka(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Aa=P(`$ZodCatch`,(e,t)=>{R.init(e,t),F(e._zod,`optin`,()=>t.innerType._zod.optin),F(e._zod,`optout`,()=>t.innerType._zod.optout),F(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ur(e,n,Mn()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ur(e,n,Mn()))},input:e.value}),e.issues=[]),e)}}),ja=P(`$ZodPipe`,(e,t)=>{R.init(e,t),F(e._zod,`values`,()=>t.in._zod.values),F(e._zod,`optin`,()=>t.in._zod.optin),F(e._zod,`optout`,()=>t.out._zod.optout),F(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ma(e,t.in,n)):Ma(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ma(e,t.out,n)):Ma(r,t.out,n)}});function Ma(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Na=P(`$ZodReadonly`,(e,t)=>{R.init(e,t),F(e._zod,`propValues`,()=>t.innerType._zod.propValues),F(e._zod,`values`,()=>t.innerType._zod.values),F(e._zod,`optin`,()=>t.innerType?._zod?.optin),F(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Pa):Pa(r)}});function Pa(e){return e.value=Object.freeze(e.value),e}const Fa=P(`$ZodCustom`,(e,t)=>{L.init(e,t),R.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ia(t,n,r,e));Ia(i,n,r,e)}});function Ia(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(fr(e))}}var La,Ra=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function za(){return new Ra}(La=globalThis).__zod_globalRegistry??(La.__zod_globalRegistry=za());const Ba=globalThis.__zod_globalRegistry;function Va(e,t){return new e({type:`string`,...I(t)})}function Ha(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...I(t)})}function Ua(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...I(t)})}function Wa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...I(t)})}function Ga(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...I(t)})}function Ka(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...I(t)})}function qa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...I(t)})}function Ja(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...I(t)})}function Ya(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...I(t)})}function Xa(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...I(t)})}function Za(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...I(t)})}function Qa(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...I(t)})}function $a(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...I(t)})}function eo(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...I(t)})}function to(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...I(t)})}function no(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...I(t)})}function ro(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...I(t)})}function io(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...I(t)})}function ao(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...I(t)})}function oo(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...I(t)})}function so(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...I(t)})}function co(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...I(t)})}function lo(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...I(t)})}function uo(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...I(t)})}function fo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...I(t)})}function po(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...I(t)})}function mo(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...I(t)})}function ho(e,t){return new e({type:`number`,checks:[],...I(t)})}function go(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...I(t)})}function _o(e,t){return new e({type:`boolean`,...I(t)})}function vo(e){return new e({type:`unknown`})}function yo(e,t){return new e({type:`never`,...I(t)})}function bo(e,t){return new ci({check:`less_than`,...I(t),value:e,inclusive:!1})}function xo(e,t){return new ci({check:`less_than`,...I(t),value:e,inclusive:!0})}function So(e,t){return new li({check:`greater_than`,...I(t),value:e,inclusive:!1})}function Co(e,t){return new li({check:`greater_than`,...I(t),value:e,inclusive:!0})}function wo(e,t){return new ui({check:`multiple_of`,...I(t),value:e})}function To(e,t){return new fi({check:`max_length`,...I(t),maximum:e})}function Eo(e,t){return new pi({check:`min_length`,...I(t),minimum:e})}function Do(e,t){return new mi({check:`length_equals`,...I(t),length:e})}function Oo(e,t){return new gi({check:`string_format`,format:`regex`,...I(t),pattern:e})}function ko(e){return new _i({check:`string_format`,format:`lowercase`,...I(e)})}function Ao(e){return new vi({check:`string_format`,format:`uppercase`,...I(e)})}function jo(e,t){return new yi({check:`string_format`,format:`includes`,...I(t),includes:e})}function Mo(e,t){return new bi({check:`string_format`,format:`starts_with`,...I(t),prefix:e})}function No(e,t){return new xi({check:`string_format`,format:`ends_with`,...I(t),suffix:e})}function Po(e){return new Si({check:`overwrite`,tx:e})}function Fo(e){return Po(t=>t.normalize(e))}function Io(){return Po(e=>e.trim())}function Lo(){return Po(e=>e.toLowerCase())}function Ro(){return Po(e=>e.toUpperCase())}function zo(){return Po(e=>Un(e))}function Bo(e,t,n){return new e({type:`array`,element:t,...I(n)})}function Vo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...I(n)})}function Ho(e){let t=Uo(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(fr(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(fr(r))}},e(n.value,n)));return t}function Uo(e,t){let n=new L({check:`custom`,...I(t)});return n._zod.check=e,n}function Wo(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Ba,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function B(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,B(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&V(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Go(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
94
94
 
95
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Ko(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Jo(t,`input`,e.processors),output:Jo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function V(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return V(r.element,n);if(r.type===`set`)return V(r.valueType,n);if(r.type===`lazy`)return V(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return V(r.innerType,n);if(r.type===`intersection`)return V(r.left,n)||V(r.right,n);if(r.type===`record`||r.type===`map`)return V(r.keyType,n)||V(r.valueType,n);if(r.type===`pipe`)return V(r.in,n)||V(r.out,n);if(r.type===`object`){for(let e in r.shape)if(V(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(V(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(V(e,n))return!0;return!!(r.rest&&V(r.rest,n))}return!1}const qo=(e,t={})=>n=>{let r=Wo({...n,processors:t});return B(e,r),Go(r,e),Ko(r,e)},Jo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Wo({...i??{},target:a,io:t,processors:n});return B(e,o),Go(o,e),Ko(o,e)},Yo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Xo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Yo[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Zo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},Qo=(e,t,n,r)=>{n.type=`boolean`},$o=(e,t,n,r)=>{n.not={}},es=(e,t,n,r)=>{let i=e._zod.def,a=Nn(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ts=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},ns=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},rs=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},is=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=B(a.element,t,{...r,path:[...r.path,`items`]})},as=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=B(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=B(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},os=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>B(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ss=(e,t,n,r)=>{let i=e._zod.def,a=B(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=B(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},cs=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>B(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?B(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},ls=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=B(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=B(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=B(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},us=(e,t,n,r)=>{let i=e._zod.def,a=B(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ds=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},fs=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ps=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},ms=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},hs=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;B(a,t,r);let o=t.seen.get(e);o.ref=a},gs=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},_s=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},vs=P(`ZodISODateTime`,(e,t)=>{Li.init(e,t),G.init(e,t)});function ys(e){return uo(vs,e)}const bs=P(`ZodISODate`,(e,t)=>{Ri.init(e,t),G.init(e,t)});function xs(e){return fo(bs,e)}const Ss=P(`ZodISOTime`,(e,t)=>{zi.init(e,t),G.init(e,t)});function Cs(e){return po(Ss,e)}const ws=P(`ZodISODuration`,(e,t)=>{Bi.init(e,t),G.init(e,t)});function Ts(e){return mo(ws,e)}const Es=(e,t)=>{mr.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>_r(e,t)},flatten:{value:t=>gr(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Pn,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Pn,2)}},isEmpty:{get(){return e.issues.length===0}}})};P(`ZodError`,Es);const H=P(`ZodError`,Es,{Parent:Error}),Ds=vr(H),Os=yr(H),ks=br(H),As=Sr(H),js=wr(H),Ms=Tr(H),Ns=Er(H),Ps=Dr(H),Fs=Or(H),Is=kr(H),Ls=Ar(H),Rs=jr(H),U=P(`ZodType`,(e,t)=>(R.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Jo(e,`input`),output:Jo(e,`output`)}}),e.toJSONSchema=qo(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(Vn(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Zn(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Ds(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ks(e,t,n),e.parseAsync=async(t,n)=>Os(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>As(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>js(e,t,n),e.decode=(t,n)=>Ms(e,t,n),e.encodeAsync=async(t,n)=>Ns(e,t,n),e.decodeAsync=async(t,n)=>Ps(e,t,n),e.safeEncode=(t,n)=>Fs(e,t,n),e.safeDecode=(t,n)=>Is(e,t,n),e.safeEncodeAsync=async(t,n)=>Ls(e,t,n),e.safeDecodeAsync=async(t,n)=>Rs(e,t,n),e.refine=(t,n)=>e.check(Xc(t,n)),e.superRefine=t=>e.check(Zc(t)),e.overwrite=t=>e.check(Po(t)),e.optional=()=>Mc(e),e.exactOptional=()=>Pc(e),e.nullable=()=>Ic(e),e.nullish=()=>Mc(Ic(e)),e.nonoptional=t=>Hc(e,t),e.array=()=>q(e),e.or=t=>vc([e,t]),e.and=t=>bc(e,t),e.transform=t=>Kc(e,Ac(t)),e.default=t=>Rc(e,t),e.prefault=t=>Bc(e,t),e.catch=t=>Wc(e,t),e.pipe=t=>Kc(e,t),e.readonly=()=>Jc(e),e.describe=t=>{let n=e.clone();return Ba.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Ba.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Ba.get(e);let n=e.clone();return Ba.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),zs=P(`_ZodString`,(e,t)=>{Ti.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Oo(...t)),e.includes=(...t)=>e.check(jo(...t)),e.startsWith=(...t)=>e.check(Mo(...t)),e.endsWith=(...t)=>e.check(No(...t)),e.min=(...t)=>e.check(Eo(...t)),e.max=(...t)=>e.check(To(...t)),e.length=(...t)=>e.check(Do(...t)),e.nonempty=(...t)=>e.check(Eo(1,...t)),e.lowercase=t=>e.check(ko(t)),e.uppercase=t=>e.check(Ao(t)),e.trim=()=>e.check(Io()),e.normalize=(...t)=>e.check(Fo(...t)),e.toLowerCase=()=>e.check(Lo()),e.toUpperCase=()=>e.check(Ro()),e.slugify=()=>e.check(zo())}),Bs=P(`ZodString`,(e,t)=>{Ti.init(e,t),zs.init(e,t),e.email=t=>e.check(Ha(Vs,t)),e.url=t=>e.check(Ja(Ws,t)),e.jwt=t=>e.check(lo(ac,t)),e.emoji=t=>e.check(Ya(Gs,t)),e.guid=t=>e.check(Ua(Hs,t)),e.uuid=t=>e.check(Wa(Us,t)),e.uuidv4=t=>e.check(Ga(Us,t)),e.uuidv6=t=>e.check(Ka(Us,t)),e.uuidv7=t=>e.check(qa(Us,t)),e.nanoid=t=>e.check(Xa(Ks,t)),e.guid=t=>e.check(Ua(Hs,t)),e.cuid=t=>e.check(Za(qs,t)),e.cuid2=t=>e.check(Qa(Js,t)),e.ulid=t=>e.check($a(Ys,t)),e.base64=t=>e.check(oo(nc,t)),e.base64url=t=>e.check(so(rc,t)),e.xid=t=>e.check(eo(Xs,t)),e.ksuid=t=>e.check(to(Zs,t)),e.ipv4=t=>e.check(no(Qs,t)),e.ipv6=t=>e.check(ro($s,t)),e.cidrv4=t=>e.check(io(ec,t)),e.cidrv6=t=>e.check(ao(tc,t)),e.e164=t=>e.check(co(ic,t)),e.datetime=t=>e.check(ys(t)),e.date=t=>e.check(xs(t)),e.time=t=>e.check(Cs(t)),e.duration=t=>e.check(Ts(t))});function W(e){return Va(Bs,e)}const G=P(`ZodStringFormat`,(e,t)=>{z.init(e,t),zs.init(e,t)}),Vs=P(`ZodEmail`,(e,t)=>{Oi.init(e,t),G.init(e,t)}),Hs=P(`ZodGUID`,(e,t)=>{Ei.init(e,t),G.init(e,t)}),Us=P(`ZodUUID`,(e,t)=>{Di.init(e,t),G.init(e,t)}),Ws=P(`ZodURL`,(e,t)=>{ki.init(e,t),G.init(e,t)}),Gs=P(`ZodEmoji`,(e,t)=>{Ai.init(e,t),G.init(e,t)}),Ks=P(`ZodNanoID`,(e,t)=>{ji.init(e,t),G.init(e,t)}),qs=P(`ZodCUID`,(e,t)=>{Mi.init(e,t),G.init(e,t)}),Js=P(`ZodCUID2`,(e,t)=>{Ni.init(e,t),G.init(e,t)}),Ys=P(`ZodULID`,(e,t)=>{Pi.init(e,t),G.init(e,t)}),Xs=P(`ZodXID`,(e,t)=>{Fi.init(e,t),G.init(e,t)}),Zs=P(`ZodKSUID`,(e,t)=>{Ii.init(e,t),G.init(e,t)}),Qs=P(`ZodIPv4`,(e,t)=>{Vi.init(e,t),G.init(e,t)}),$s=P(`ZodIPv6`,(e,t)=>{Hi.init(e,t),G.init(e,t)}),ec=P(`ZodCIDRv4`,(e,t)=>{Ui.init(e,t),G.init(e,t)}),tc=P(`ZodCIDRv6`,(e,t)=>{Wi.init(e,t),G.init(e,t)}),nc=P(`ZodBase64`,(e,t)=>{Ki.init(e,t),G.init(e,t)}),rc=P(`ZodBase64URL`,(e,t)=>{Ji.init(e,t),G.init(e,t)}),ic=P(`ZodE164`,(e,t)=>{Yi.init(e,t),G.init(e,t)}),ac=P(`ZodJWT`,(e,t)=>{Zi.init(e,t),G.init(e,t)}),oc=P(`ZodNumber`,(e,t)=>{Qi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r),e.gt=(t,n)=>e.check(So(t,n)),e.gte=(t,n)=>e.check(Co(t,n)),e.min=(t,n)=>e.check(Co(t,n)),e.lt=(t,n)=>e.check(bo(t,n)),e.lte=(t,n)=>e.check(xo(t,n)),e.max=(t,n)=>e.check(xo(t,n)),e.int=t=>e.check(lc(t)),e.safe=t=>e.check(lc(t)),e.positive=t=>e.check(So(0,t)),e.nonnegative=t=>e.check(Co(0,t)),e.negative=t=>e.check(bo(0,t)),e.nonpositive=t=>e.check(xo(0,t)),e.multipleOf=(t,n)=>e.check(wo(t,n)),e.step=(t,n)=>e.check(wo(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function sc(e){return ho(oc,e)}const cc=P(`ZodNumberFormat`,(e,t)=>{$i.init(e,t),oc.init(e,t)});function lc(e){return go(cc,e)}const uc=P(`ZodBoolean`,(e,t)=>{ea.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qo(e,t,n,r)});function K(e){return _o(uc,e)}const dc=P(`ZodUnknown`,(e,t)=>{ta.init(e,t),U.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function fc(){return vo(dc)}const pc=P(`ZodNever`,(e,t)=>{na.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r)});function mc(e){return yo(pc,e)}const hc=P(`ZodArray`,(e,t)=>{ia.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>is(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Eo(t,n)),e.nonempty=t=>e.check(Eo(1,t)),e.max=(t,n)=>e.check(To(t,n)),e.length=(t,n)=>e.check(Do(t,n)),e.unwrap=()=>e.element});function q(e,t){return Bo(hc,e,t)}const gc=P(`ZodObject`,(e,t)=>{la.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r),F(e,`shape`,()=>t.shape),e.keyof=()=>Ec(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fc()}),e.loose=()=>e.clone({...e._zod.def,catchall:fc()}),e.strict=()=>e.clone({...e._zod.def,catchall:mc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>nr(e,t),e.safeExtend=t=>rr(e,t),e.merge=t=>ir(e,t),e.pick=t=>er(e,t),e.omit=t=>tr(e,t),e.partial=(...t)=>ar(jc,e,t[0]),e.required=(...t)=>or(Vc,e,t[0])});function J(e,t){return new gc({type:`object`,shape:e??{},...I(t)})}const _c=P(`ZodUnion`,(e,t)=>{da.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r),e.options=t.options});function vc(e,t){return new _c({type:`union`,options:e,...I(t)})}const yc=P(`ZodIntersection`,(e,t)=>{fa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ss(e,t,n,r)});function bc(e,t){return new yc({type:`intersection`,left:e,right:t})}const xc=P(`ZodTuple`,(e,t)=>{ha.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cs(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Sc(e,t,n){let r=t instanceof R;return new xc({type:`tuple`,items:e,rest:r?t:null,...I(r?n:t)})}const Cc=P(`ZodRecord`,(e,t)=>{_a.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ls(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function wc(e,t,n){return new Cc({type:`record`,keyType:e,valueType:t,...I(n)})}const Tc=P(`ZodEnum`,(e,t)=>{va.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Tc({...t,checks:[],...I(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Tc({...t,checks:[],...I(r),entries:i})}});function Ec(e,t){return new Tc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...I(t)})}const Dc=P(`ZodLiteral`,(e,t)=>{ya.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ts(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Oc(e,t){return new Dc({type:`literal`,values:Array.isArray(e)?e:[e],...I(t)})}const kc=P(`ZodTransform`,(e,t)=>{ba.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rs(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new An(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(fr(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(fr(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ac(e){return new kc({type:`transform`,transform:e})}const jc=P(`ZodOptional`,(e,t)=>{Sa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mc(e){return new jc({type:`optional`,innerType:e})}const Nc=P(`ZodExactOptional`,(e,t)=>{Ca.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pc(e){return new Nc({type:`optional`,innerType:e})}const Fc=P(`ZodNullable`,(e,t)=>{wa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>us(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ic(e){return new Fc({type:`nullable`,innerType:e})}const Lc=P(`ZodDefault`,(e,t)=>{Ta.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Rc(e,t){return new Lc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Jn(t)}})}const zc=P(`ZodPrefault`,(e,t)=>{Da.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bc(e,t){return new zc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Jn(t)}})}const Vc=P(`ZodNonOptional`,(e,t)=>{Oa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ds(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hc(e,t){return new Vc({type:`nonoptional`,innerType:e,...I(t)})}const Uc=P(`ZodCatch`,(e,t)=>{Aa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Wc(e,t){return new Uc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const Gc=P(`ZodPipe`,(e,t)=>{ja.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(e,t,n,r),e.in=t.in,e.out=t.out});function Kc(e,t){return new Gc({type:`pipe`,in:e,out:t})}const qc=P(`ZodReadonly`,(e,t)=>{Na.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jc(e){return new qc({type:`readonly`,innerType:e})}const Yc=P(`ZodCustom`,(e,t)=>{Fa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ns(e,t,n,r)});function Xc(e,t={}){return Vo(Yc,e,t)}function Zc(e){return Ho(e)}var Y=class extends Error{suggestion;docsLink;constructor(e,t){super(e),this.suggestion=t.suggestion,this.docsLink=t.docsLink}toString(){return`${this.message} ${this.suggestion}${O.default.gray(this.docsLink?`\n See: ${this.docsLink}`:``)}`}},Qc=class extends Y{constructor(){super(`No package.json found.`,{suggestion:`Please run create a package.json first before initializing a jsrepo project.`})}},$c=class extends Y{constructor({path:e}){super(`Manifest not found at ${O.default.bold(e)}.`,{suggestion:`This is a bug, please report it here: https://github.com/jsrepojs/jsrepo/issues`})}},el=class extends Y{constructor(e){super(`Invalid options: ${e.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `)}`,{suggestion:`Please check the options and try again.`})}},tl=class extends Y{zodError;constructor(e){super(`Zod error: ${e.message}`,{suggestion:`Check the input schema and try again.`}),this.zodError=e}},nl=class extends Y{constructor(e){super(`Invalid JSON: ${e instanceof Error?e.stack??e.message:`${e}`}`,{suggestion:`Check the input JSON and try again.`})}};function rl(e,t){let n=e.safeParse(t);return n.success?(0,N.ok)(n.data):(0,N.err)(new tl(n.error))}function il(e,t){try{let n=e.safeParse(JSON.parse(t));return n.success?(0,N.ok)(n.data):(0,N.err)(new tl(n.error))}catch(e){return(0,N.err)(new nl(e))}}const al=J({cwd:W().transform(e=>e)}),ol={yes:new t(`--yes`,`Skip the confirmation prompt.`).default(!1),cwd:new t(`--cwd <path>`,`The current working directory.`).default(process.cwd())};function sl(e,t){return rl(e,t).match(e=>e,e=>ll(new el(e.zodError)))}async function cl(e){try{let t=await e;return t.isErr()?ll(t.error):t.value}catch(e){e instanceof Y&&ll(e),ll(new Y(e instanceof Error?e.message:String(e),{suggestion:`Please try again.`}))}}function ll(e){return ul(e)}function ul(e){M.message(),process.env.JSREPO_TRACE===`1`?(console.trace(e),process.exit(1)):(wt(O.default.red(e.toString())),process.exit(1))}function dl(e,...t){return Dn.join(e,...t)}function fl(e){return Dn.dirname(e)}function pl(e){try{return(0,N.ok)(r.readFileSync(e,`utf-8`))}catch(t){return(0,N.err)(new Y(`Failed to read file ${e}: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`}))}}function ml(e,t){try{let n=hl(fl(e));return n.isErr()?(0,N.err)(n.error):(r.writeFileSync(e,t),(0,N.ok)())}catch(t){return(0,N.err)(new Y(`Failed to write file ${e}: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`}))}}function hl(e){try{return r.mkdirSync(e,{recursive:!0}),(0,N.ok)()}catch(t){return(0,N.err)(new Y(`Failed to create directory ${e}: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`}))}}function gl(e){try{return _l(e)&&r.rmSync(e),(0,N.ok)()}catch(t){return(0,N.err)(new Y(`Failed to remove file ${e}: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`}))}}function _l(e){return r.existsSync(e)}function vl(e,t={}){return JSON.stringify(e,null,t.format?` `:void 0)}var yl=E(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),bl=E(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),xl=E(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=yl(),a=bl();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),Sl=E(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Cl=E(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),X=E(((e,t)=>{let n=bl(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=yl(),{safeRe:a,t:o}=xl(),s=Sl(),{compareIdentifiers:c}=Cl();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),wl=E(((e,t)=>{let n=X();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),Tl=E(((e,t)=>{let n=wl();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),El=E(((e,t)=>{let n=wl();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),Dl=E(((e,t)=>{let n=X();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),Ol=E(((e,t)=>{let n=wl();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),kl=E(((e,t)=>{let n=X();t.exports=(e,t)=>new n(e,t).major})),Al=E(((e,t)=>{let n=X();t.exports=(e,t)=>new n(e,t).minor})),jl=E(((e,t)=>{let n=X();t.exports=(e,t)=>new n(e,t).patch})),Ml=E(((e,t)=>{let n=wl();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),Z=E(((e,t)=>{let n=X();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Nl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(t,e,r)})),Pl=E(((e,t)=>{let n=Z();t.exports=(e,t)=>n(e,t,!0)})),Fl=E(((e,t)=>{let n=X();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),Il=E(((e,t)=>{let n=Fl();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),Ll=E(((e,t)=>{let n=Fl();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),Rl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(e,t,r)>0})),zl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(e,t,r)<0})),Bl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(e,t,r)===0})),Vl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(e,t,r)!==0})),Hl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(e,t,r)>=0})),Ul=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(e,t,r)<=0})),Wl=E(((e,t)=>{let n=Bl(),r=Vl(),i=Rl(),a=Hl(),o=zl(),s=Ul();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),Gl=E(((e,t)=>{let n=X(),r=wl(),{safeRe:i,t:a}=xl();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),Kl=E(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),Q=E(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&g(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,ne(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>te(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let b=[..._.values()];return r.set(t,b),b}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(re(this.set[t],e,this.options))return!0;return!1}};let r=new(Kl()),i=Sl(),a=ql(),o=bl(),s=X(),{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:f}=xl(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=yl(),h=e=>e.value===`<0.0.0-0`,g=e=>e.value===``,_=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=S(e,t),o(`caret`,e),e=b(e,t),o(`tildes`,e),e=w(e,t),o(`xrange`,e),e=T(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,b=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(` `),x=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},w=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>ee(e,t)).join(` `)),ee=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},T=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),te=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),ne=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),re=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),ql=E(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=Sl(),{safeRe:i,t:a}=xl(),o=Wl(),s=bl(),c=X(),l=Q()})),Jl=E(((e,t)=>{let n=Q();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),Yl=E(((e,t)=>{let n=Q();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),Xl=E(((e,t)=>{let n=X(),r=Q();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),Zl=E(((e,t)=>{let n=X(),r=Q();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),Ql=E(((e,t)=>{let n=X(),r=Q(),i=Rl();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),$l=E(((e,t)=>{let n=Q();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),eu=E(((e,t)=>{let n=X(),r=ql(),{ANY:i}=r,a=Q(),o=Jl(),s=Rl(),c=zl(),l=Ul(),u=Hl();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),tu=E(((e,t)=>{let n=eu();t.exports=(e,t,r)=>n(e,t,`>`,r)})),nu=E(((e,t)=>{let n=eu();t.exports=(e,t,r)=>n(e,t,`<`,r)})),ru=E(((e,t)=>{let n=Q();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),iu=E(((e,t)=>{let n=Jl(),r=Z();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),au=E(((e,t)=>{let n=Q(),r=ql(),{ANY:i}=r,a=Jl(),o=Z(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),ou=ue(E(((e,t)=>{let n=xl(),r=yl(),i=X(),a=Cl();t.exports={parse:wl(),valid:Tl(),clean:El(),inc:Dl(),diff:Ol(),major:kl(),minor:Al(),patch:jl(),prerelease:Ml(),compare:Z(),rcompare:Nl(),compareLoose:Pl(),compareBuild:Fl(),sort:Il(),rsort:Ll(),gt:Rl(),lt:zl(),eq:Bl(),neq:Vl(),gte:Hl(),lte:Ul(),cmp:Wl(),coerce:Gl(),Comparator:ql(),Range:Q(),satisfies:Jl(),toComparators:Yl(),maxSatisfying:Xl(),minSatisfying:Zl(),minVersion:Ql(),validRange:$l(),outside:eu(),gtr:tu(),ltr:nu(),intersects:ru(),simplifyRange:iu(),subset:au(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}))(),1);const su=/^(@[^/]+\/[^@/]+)(?:@([^/]+))?(\/.*)?$/,cu=/^([^@/]+)(?:@([^/]+))?(\/.*)?$/;function lu(e){let t=su.exec(e)||cu.exec(e);return t?(0,N.ok)({name:t[1]||``,version:t[2]||void 0,path:t[3]||``}):(0,N.err)(`invalid package name: ${e}`)}function uu(e){if(e===ee.homedir()||e===Dn.parse(e).root)return;let t=dl(e,`package.json`);return _l(t)?{path:t,package:fu(t)}:uu(fl(e))}function du(e){try{return(0,N.ok)(fu(e))}catch(t){return(0,N.err)(`Error while trying to get package.json at ${e}: ${t}`)}}function fu(e){return JSON.parse(pl(e)._unsafeUnwrap().toString())}function pu(e){return e[0]===`^`?e.slice(1):e}function mu(e,{pkg:t}){function n(e,t){let n=t?.[e.name];return!(e.version===void 0&&n||n&&(e.version===void 0||ou.default.satisfies(pu(n),e.version)))}let r=new Set;for(let i of e.dependencies)n(lu(i)._unsafeUnwrap(),t.dependencies)&&r.add(i);let i=new Set;for(let r of e.devDependencies)n(lu(r)._unsafeUnwrap(),t.devDependencies)&&i.add(r);return{dependencies:Array.from(r.values()),devDependencies:Array.from(i.values())}}var hu=Object.create,gu=Object.defineProperty,_u=Object.getOwnPropertyDescriptor,vu=Object.getOwnPropertyNames,yu=Object.getPrototypeOf,bu=Object.prototype.hasOwnProperty,$=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xu=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=vu(t),a=0,o=i.length,s;a<o;a++)s=i[a],!bu.call(e,s)&&s!==n&&gu(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=_u(t,s))||r.enumerable});return e},Su=(e,t,n)=>(n=e==null?{}:hu(yu(e)),xu(t||!e||!e.__esModule?gu(n,`default`,{value:e,enumerable:!0}):n,e)),Cu=T(import.meta.url);const wu=/^path$/i,Tu={key:`PATH`,value:``};function Eu(e){for(let t in e){if(!Object.prototype.hasOwnProperty.call(e,t)||!wu.test(t))continue;let n=e[t];return n?{key:t,value:n}:Tu}return Tu}function Du(e,t){let n=t.value.split(h),r=e,i;do n.push(y(r,`node_modules`,`.bin`)),i=r,r=g(r);while(r!==i);return{key:t.key,value:n.join(h)}}function Ou(e,t){let n={...process.env,...t},r=Du(e,Eu(n));return n[r.key]=r.value,n}const ku=e=>{let t=e.length,n=new ne,r=()=>{--t===0&&n.emit(`end`)};for(let t of e)t.pipe(n,{end:!1}),t.on(`end`,r);return n};var Au=$((e,t)=>{t.exports=a,a.sync=o;var n=Cu(`fs`);function r(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:r(t,n)}function a(e,t,r){n.stat(e,function(n,a){r(n,n?!1:i(a,e,t))})}function o(e,t){return i(n.statSync(e),e,t)}}),ju=$((e,t)=>{t.exports=r,r.sync=i;var n=Cu(`fs`);function r(e,t,r){n.stat(e,function(e,n){r(e,e?!1:a(n,t))})}function i(e,t){return a(n.statSync(e),t)}function a(e,t){return e.isFile()&&o(e,t)}function o(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}}),Mu=$((e,t)=>{Cu(`fs`);var n=process.platform===`win32`||global.TESTING_WINDOWS?Au():ju();t.exports=r,r.sync=i;function r(e,t,i){if(typeof t==`function`&&(i=t,t={}),!i){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,i){r(e,t||{},function(e,t){e?i(e):n(t)})})}n(e,t||{},function(e,n){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,n=!1),i(e,n)})}function i(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}}),Nu=$((e,t)=>{let n=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,r=Cu(`path`),i=n?`;`:`:`,a=Mu(),o=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),s=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||n&&e.match(/\\/)?[``]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(r)],o=n?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=n?o.split(r):[``];return n&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:a,pathExt:s,pathExtExe:o}},c=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:i,pathExt:c,pathExtExe:l}=s(e,t),u=[],d=n=>new Promise((a,s)=>{if(n===i.length)return t.all&&u.length?a(u):s(o(e));let c=i[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=r.join(l,e);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((i,o)=>{if(r===c.length)return i(d(n+1));let s=c[r];a(e+s,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+s);else return i(e+s);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};t.exports=c,c.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:i,pathExtExe:c}=s(e,t),l=[];for(let o=0;o<n.length;o++){let s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,d=r.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<i.length;e++){let n=f+i[e];try{if(a.sync(n,{pathExt:c}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw o(e)}}),Pu=$((e,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n}),Fu=$((e,t)=>{let n=Cu(`path`),r=Nu(),i=Pu();function a(e,t){let a=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=r.sync(e.command,{path:a[i({env:a})],pathExt:t?n.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=n.resolve(s?e.options.cwd:``,l),l}function o(e){return a(e)||a(e,!0)}t.exports=o}),Iu=$((e,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,`$1$1\\"`),e=e.replace(/(\\*)$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i}),Lu=$((e,t)=>{t.exports=/^#!(.*)/}),Ru=$((e,t)=>{let n=Lu();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}}),zu=$((e,t)=>{let n=Cu(`fs`),r=Ru();function i(e){let t=Buffer.alloc(150),i;try{i=n.openSync(e,`r`),n.readSync(i,t,0,150,0),n.closeSync(i)}catch{}return r(t.toString())}t.exports=i}),Bu=$((e,t)=>{let n=Cu(`path`),r=Fu(),i=Iu(),a=zu(),o=process.platform===`win32`,s=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(e){e.file=r(e);let t=e.file&&a(e.file);return t?(e.args.unshift(e.file),e.command=t,r(e)):e.file}function u(e){if(!o)return e;let t=l(e),r=!s.test(t);if(e.options.forceShell||r){let r=c.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,r)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function d(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:u(r)}t.exports=d}),Vu=$((e,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t,`spawn`);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}}),Hu=Su($((e,t)=>{let n=Cu(`child_process`),r=Bu(),i=Vu();function a(e,t,a){let o=r(e,t,a),s=n.spawn(o.command,o.args,o.options);return i.hookChildProcess(s,o),s}function o(e,t,a){let o=r(e,t,a),s=n.spawnSync(o.command,o.args,o.options);return s.error=s.error||i.verifyENOENTSync(s.status,o),s}t.exports=a,t.exports.spawn=a,t.exports.sync=o,t.exports._parse=r,t.exports._enoent=i})(),1),Uu=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(e,t){super(`Process exited with non-zero status (${e.exitCode})`),this.result=e,this.output=t}};const Wu={timeout:void 0,persist:!1},Gu={windowsHide:!0};function Ku(e,t){return{command:v(e),args:t??[]}}function qu(e){let t=new AbortController;for(let n of e){if(n.aborted)return t.abort(),n;n.addEventListener(`abort`,()=>{t.abort(n.reason)},{signal:t.signal})}return t.signal}async function Ju(e){let t=``;for await(let n of e)t+=n.toString();return t}var Yu=class{_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(e,t,n){this._options={...Wu,...n},this._command=e,this._args=t??[],this._processClosed=new Promise(e=>{this._resolveClose=e})}kill(e){return this._process?.kill(e)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(e,t,n){return Zu(e,t,{...n,stdin:this})}async*[Symbol.asyncIterator](){let e=this._process;if(!e)return;let t=[];this._streamErr&&t.push(this._streamErr),this._streamOut&&t.push(this._streamOut);let n=ku(t),r=f.createInterface({input:n});for await(let e of r)yield e.toString();if(await this._processClosed,e.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new Uu(this)}async _waitForOutput(){let e=this._process;if(!e)throw Error(`No process was started`);let[t,n]=await Promise.all([this._streamOut?Ju(this._streamOut):``,this._streamErr?Ju(this._streamErr):``]);if(await this._processClosed,this._options?.stdin&&await this._options.stdin,e.removeAllListeners(),this._thrownError)throw this._thrownError;let r={stderr:n,stdout:t,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new Uu(this,r);return r}then(e,t){return this._waitForOutput().then(e,t)}_streamOut;_streamErr;spawn(){let e=c(),t=this._options,n={...Gu,...t.nodeOptions},r=[];this._resetState(),t.timeout!==void 0&&r.push(AbortSignal.timeout(t.timeout)),t.signal!==void 0&&r.push(t.signal),t.persist===!0&&(n.detached=!0),r.length>0&&(n.signal=qu(r)),n.env=Ou(e,n.env);let{command:i,args:a}=Ku(this._command,this._args),o=(0,Hu._parse)(i,a,n),s=te(o.command,o.args,o.options);if(s.stderr&&(this._streamErr=s.stderr),s.stdout&&(this._streamOut=s.stdout),this._process=s,s.once(`error`,this._onError),s.once(`close`,this._onClose),t.stdin!==void 0&&s.stdin&&t.stdin.process){let{stdout:e}=t.stdin.process;e&&e.pipe(s.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(e=>{this._resolveClose=e}),this._thrownError=void 0}_onError=e=>{if(e.name===`AbortError`&&(!(e.cause instanceof Error)||e.cause.name!==`TimeoutError`)){this._aborted=!0;return}this._thrownError=e};_onClose=()=>{this._resolveClose&&this._resolveClose()}};const Xu=(e,t,n)=>{let r=new Yu(e,t,n);return r.spawn(),r},Zu=Xu;function Qu(){console.clear(),Tt(`${O.default.bgYellow(O.default.black(` ${D} `))}${O.default.gray(` v${fe} `)}`)}async function $u({title:e,commands:t,cwd:n,messages:r}){let i=kt({title:e,limit:Math.ceil(process.stdout.rows/2),spacing:0,retainLog:!0}),a=async e=>{let t=Xu(e.command,[...e.args],{nodeOptions:{cwd:n}});for await(let e of t)i.message(e)};try{for(let e of t)await a(e);i.success(r.success())}catch(e){i.error(r.error(e)),process.exit(1)}}async function ed(e,{cwd:t}){let n=uu(t);if(!n)return;let r=await S(t);if(e.dependencies.length===0&&e.devDependencies.length===0){let e=Vt(r,`install`,[]);if(e===null)return;await $u({title:`Installing dependencies with ${r}...`,commands:[e],cwd:t,messages:{success:()=>`Installed dependencies`,error:e=>`Failed to install dependencies: ${e instanceof Error?e.message:e}`}});return}let{dependencies:i,devDependencies:a}=mu(e,{pkg:n.package});if(i.length===0&&a.length===0)return;let o=Vt(r,`add`,[...i]),s=Vt(r,`add`,[`-D`,...a]);await $u({title:`Installing dependencies with ${r}...`,commands:[...o&&i.length>0?[o]:[],...s&&a.length>0?[s]:[]],cwd:t,messages:{success:()=>`Installed ${O.default.cyan([...i,...a].join(`, `))}`,error:e=>`Failed to install dependencies: ${e instanceof Error?e.message:e}`}})}function td(e,t){for(let n of t)if(e.endsWith(n))return n}const nd=`jsrepo-manifest.json`,rd=J({authors:q(W()).optional(),bugs:W().optional(),description:W().optional(),homepage:W().optional(),repository:W().optional(),tags:q(W()).optional()}),id=vc([Oc(`public`),Oc(`private`),Oc(`marketplace`)]),ad=J({name:W(),path:W(),expectedPath:W().optional(),optional:K().optional().default(!1)}),od=wc(W(),vc([W(),Sc([W(),vc([W(),sc()])],vc([W(),sc()]))])),sd=wc(W(),vc([W(),J({version:W(),message:W()})])),cd=J({$schema:W(),name:W().optional(),version:W().optional(),readme:W().optional(),access:id.optional(),meta:rd.optional(),defaultPaths:wc(W(),W()).optional(),peerDependencies:sd.optional(),configFiles:q(ad).optional(),dirs:q(W()),outputDir:W().optional(),includeBlocks:q(W()).optional().default([]),includeCategories:q(W()).optional().default([]),includeFiles:q(W()).optional().default([]),excludeBlocks:q(W()).optional().default([]),excludeCategories:q(W()).optional().default([]),doNotListBlocks:q(W()).optional().default([]),doNotListCategories:q(W()).optional().default([]),listBlocks:q(W()).optional().default([]),listCategories:q(W()).optional().default([]),excludeDeps:q(W()).optional().default([]),allowSubdirectories:K().optional(),preview:K().optional(),includeDocs:K().optional().default(!1),rules:od.optional()}),ld=ad.extend({dependencies:q(W()).optional(),devDependencies:q(W()).optional()}),ud=J({name:W(),category:W(),localDependencies:q(W()),dependencies:q(W()),devDependencies:q(W()),tests:K(),docs:K().optional().default(!1),list:K().optional().default(!0),directory:W(),subdirectory:K(),files:q(W()),_imports_:wc(W(),W())}),dd=J({name:W(),blocks:q(ud)}),fd=J({name:W().optional(),version:W().optional(),meta:rd.optional(),access:id.optional(),defaultPaths:wc(W(),W()).optional(),configFiles:q(ld).optional(),categories:q(dd)}),pd=vc([Oc(`prettier`),Oc(`biome`)]),md=J({$schema:W(),repos:q(W()).optional().default([]),includeTests:K().optional().default(!1),includeDocs:K().optional().default(!1),paths:wc(W(),W()).optional(),configFiles:wc(W(),W()).optional(),watermark:Mc(K()).default(!0),formatter:Mc(pd)}),hd=[`.test.ts`,`_test.ts`,`.test.js`,`_test.js`,`.spec.ts`,`_spec.ts`,`.spec.js`,`_spec.js`,`.stories.jsx`,`_stories.jsx`,`.stories.tsx`,`_stories.tsx`],gd=[`.mdx`,`.md`];function _d(e){return td(e,hd)!==void 0}function vd(e){return td(e,gd)!==void 0}const yd=al.extend({yes:K()}),bd=new e(`v3`).description(`Migrate your jsrepo config to v3.`).addOption(ol.cwd).addOption(ol.yes).action(async e=>{let t=sl(yd,e);Qu();let n=await cl(xd(t));Et(`Successfully migrated to jsrepo v3.`),n.migratedConfigs.registry!==null&&(process.stdout.write(O.default.green(` Next steps:
95
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Ko(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Jo(t,`input`,e.processors),output:Jo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function V(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return V(r.element,n);if(r.type===`set`)return V(r.valueType,n);if(r.type===`lazy`)return V(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return V(r.innerType,n);if(r.type===`intersection`)return V(r.left,n)||V(r.right,n);if(r.type===`record`||r.type===`map`)return V(r.keyType,n)||V(r.valueType,n);if(r.type===`pipe`)return V(r.in,n)||V(r.out,n);if(r.type===`object`){for(let e in r.shape)if(V(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(V(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(V(e,n))return!0;return!!(r.rest&&V(r.rest,n))}return!1}const qo=(e,t={})=>n=>{let r=Wo({...n,processors:t});return B(e,r),Go(r,e),Ko(r,e)},Jo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Wo({...i??{},target:a,io:t,processors:n});return B(e,o),Go(o,e),Ko(o,e)},Yo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Xo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Yo[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Zo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},Qo=(e,t,n,r)=>{n.type=`boolean`},$o=(e,t,n,r)=>{n.not={}},es=(e,t,n,r)=>{let i=e._zod.def,a=Nn(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ts=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},ns=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},rs=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},is=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=B(a.element,t,{...r,path:[...r.path,`items`]})},as=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=B(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=B(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},os=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>B(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ss=(e,t,n,r)=>{let i=e._zod.def,a=B(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=B(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},cs=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>B(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?B(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},ls=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=B(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=B(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=B(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},us=(e,t,n,r)=>{let i=e._zod.def,a=B(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ds=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},fs=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ps=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},ms=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},hs=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;B(a,t,r);let o=t.seen.get(e);o.ref=a},gs=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},_s=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},vs=P(`ZodISODateTime`,(e,t)=>{Li.init(e,t),G.init(e,t)});function ys(e){return uo(vs,e)}const bs=P(`ZodISODate`,(e,t)=>{Ri.init(e,t),G.init(e,t)});function xs(e){return fo(bs,e)}const Ss=P(`ZodISOTime`,(e,t)=>{zi.init(e,t),G.init(e,t)});function Cs(e){return po(Ss,e)}const ws=P(`ZodISODuration`,(e,t)=>{Bi.init(e,t),G.init(e,t)});function Ts(e){return mo(ws,e)}const Es=(e,t)=>{mr.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>_r(e,t)},flatten:{value:t=>gr(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Pn,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Pn,2)}},isEmpty:{get(){return e.issues.length===0}}})};P(`ZodError`,Es);const H=P(`ZodError`,Es,{Parent:Error}),Ds=vr(H),Os=yr(H),ks=br(H),As=Sr(H),js=wr(H),Ms=Tr(H),Ns=Er(H),Ps=Dr(H),Fs=Or(H),Is=kr(H),Ls=Ar(H),Rs=jr(H),U=P(`ZodType`,(e,t)=>(R.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Jo(e,`input`),output:Jo(e,`output`)}}),e.toJSONSchema=qo(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(Vn(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Zn(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Ds(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ks(e,t,n),e.parseAsync=async(t,n)=>Os(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>As(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>js(e,t,n),e.decode=(t,n)=>Ms(e,t,n),e.encodeAsync=async(t,n)=>Ns(e,t,n),e.decodeAsync=async(t,n)=>Ps(e,t,n),e.safeEncode=(t,n)=>Fs(e,t,n),e.safeDecode=(t,n)=>Is(e,t,n),e.safeEncodeAsync=async(t,n)=>Ls(e,t,n),e.safeDecodeAsync=async(t,n)=>Rs(e,t,n),e.refine=(t,n)=>e.check(Xc(t,n)),e.superRefine=t=>e.check(Zc(t)),e.overwrite=t=>e.check(Po(t)),e.optional=()=>Mc(e),e.exactOptional=()=>Pc(e),e.nullable=()=>Ic(e),e.nullish=()=>Mc(Ic(e)),e.nonoptional=t=>Hc(e,t),e.array=()=>q(e),e.or=t=>vc([e,t]),e.and=t=>bc(e,t),e.transform=t=>Kc(e,Ac(t)),e.default=t=>Rc(e,t),e.prefault=t=>Bc(e,t),e.catch=t=>Wc(e,t),e.pipe=t=>Kc(e,t),e.readonly=()=>Jc(e),e.describe=t=>{let n=e.clone();return Ba.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Ba.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Ba.get(e);let n=e.clone();return Ba.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),zs=P(`_ZodString`,(e,t)=>{Ti.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Oo(...t)),e.includes=(...t)=>e.check(jo(...t)),e.startsWith=(...t)=>e.check(Mo(...t)),e.endsWith=(...t)=>e.check(No(...t)),e.min=(...t)=>e.check(Eo(...t)),e.max=(...t)=>e.check(To(...t)),e.length=(...t)=>e.check(Do(...t)),e.nonempty=(...t)=>e.check(Eo(1,...t)),e.lowercase=t=>e.check(ko(t)),e.uppercase=t=>e.check(Ao(t)),e.trim=()=>e.check(Io()),e.normalize=(...t)=>e.check(Fo(...t)),e.toLowerCase=()=>e.check(Lo()),e.toUpperCase=()=>e.check(Ro()),e.slugify=()=>e.check(zo())}),Bs=P(`ZodString`,(e,t)=>{Ti.init(e,t),zs.init(e,t),e.email=t=>e.check(Ha(Vs,t)),e.url=t=>e.check(Ja(Ws,t)),e.jwt=t=>e.check(lo(ac,t)),e.emoji=t=>e.check(Ya(Gs,t)),e.guid=t=>e.check(Ua(Hs,t)),e.uuid=t=>e.check(Wa(Us,t)),e.uuidv4=t=>e.check(Ga(Us,t)),e.uuidv6=t=>e.check(Ka(Us,t)),e.uuidv7=t=>e.check(qa(Us,t)),e.nanoid=t=>e.check(Xa(Ks,t)),e.guid=t=>e.check(Ua(Hs,t)),e.cuid=t=>e.check(Za(qs,t)),e.cuid2=t=>e.check(Qa(Js,t)),e.ulid=t=>e.check($a(Ys,t)),e.base64=t=>e.check(oo(nc,t)),e.base64url=t=>e.check(so(rc,t)),e.xid=t=>e.check(eo(Xs,t)),e.ksuid=t=>e.check(to(Zs,t)),e.ipv4=t=>e.check(no(Qs,t)),e.ipv6=t=>e.check(ro($s,t)),e.cidrv4=t=>e.check(io(ec,t)),e.cidrv6=t=>e.check(ao(tc,t)),e.e164=t=>e.check(co(ic,t)),e.datetime=t=>e.check(ys(t)),e.date=t=>e.check(xs(t)),e.time=t=>e.check(Cs(t)),e.duration=t=>e.check(Ts(t))});function W(e){return Va(Bs,e)}const G=P(`ZodStringFormat`,(e,t)=>{z.init(e,t),zs.init(e,t)}),Vs=P(`ZodEmail`,(e,t)=>{Oi.init(e,t),G.init(e,t)}),Hs=P(`ZodGUID`,(e,t)=>{Ei.init(e,t),G.init(e,t)}),Us=P(`ZodUUID`,(e,t)=>{Di.init(e,t),G.init(e,t)}),Ws=P(`ZodURL`,(e,t)=>{ki.init(e,t),G.init(e,t)}),Gs=P(`ZodEmoji`,(e,t)=>{Ai.init(e,t),G.init(e,t)}),Ks=P(`ZodNanoID`,(e,t)=>{ji.init(e,t),G.init(e,t)}),qs=P(`ZodCUID`,(e,t)=>{Mi.init(e,t),G.init(e,t)}),Js=P(`ZodCUID2`,(e,t)=>{Ni.init(e,t),G.init(e,t)}),Ys=P(`ZodULID`,(e,t)=>{Pi.init(e,t),G.init(e,t)}),Xs=P(`ZodXID`,(e,t)=>{Fi.init(e,t),G.init(e,t)}),Zs=P(`ZodKSUID`,(e,t)=>{Ii.init(e,t),G.init(e,t)}),Qs=P(`ZodIPv4`,(e,t)=>{Vi.init(e,t),G.init(e,t)}),$s=P(`ZodIPv6`,(e,t)=>{Hi.init(e,t),G.init(e,t)}),ec=P(`ZodCIDRv4`,(e,t)=>{Ui.init(e,t),G.init(e,t)}),tc=P(`ZodCIDRv6`,(e,t)=>{Wi.init(e,t),G.init(e,t)}),nc=P(`ZodBase64`,(e,t)=>{Ki.init(e,t),G.init(e,t)}),rc=P(`ZodBase64URL`,(e,t)=>{Ji.init(e,t),G.init(e,t)}),ic=P(`ZodE164`,(e,t)=>{Yi.init(e,t),G.init(e,t)}),ac=P(`ZodJWT`,(e,t)=>{Zi.init(e,t),G.init(e,t)}),oc=P(`ZodNumber`,(e,t)=>{Qi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r),e.gt=(t,n)=>e.check(So(t,n)),e.gte=(t,n)=>e.check(Co(t,n)),e.min=(t,n)=>e.check(Co(t,n)),e.lt=(t,n)=>e.check(bo(t,n)),e.lte=(t,n)=>e.check(xo(t,n)),e.max=(t,n)=>e.check(xo(t,n)),e.int=t=>e.check(lc(t)),e.safe=t=>e.check(lc(t)),e.positive=t=>e.check(So(0,t)),e.nonnegative=t=>e.check(Co(0,t)),e.negative=t=>e.check(bo(0,t)),e.nonpositive=t=>e.check(xo(0,t)),e.multipleOf=(t,n)=>e.check(wo(t,n)),e.step=(t,n)=>e.check(wo(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function sc(e){return ho(oc,e)}const cc=P(`ZodNumberFormat`,(e,t)=>{$i.init(e,t),oc.init(e,t)});function lc(e){return go(cc,e)}const uc=P(`ZodBoolean`,(e,t)=>{ea.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qo(e,t,n,r)});function K(e){return _o(uc,e)}const dc=P(`ZodUnknown`,(e,t)=>{ta.init(e,t),U.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function fc(){return vo(dc)}const pc=P(`ZodNever`,(e,t)=>{na.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r)});function mc(e){return yo(pc,e)}const hc=P(`ZodArray`,(e,t)=>{ia.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>is(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Eo(t,n)),e.nonempty=t=>e.check(Eo(1,t)),e.max=(t,n)=>e.check(To(t,n)),e.length=(t,n)=>e.check(Do(t,n)),e.unwrap=()=>e.element});function q(e,t){return Bo(hc,e,t)}const gc=P(`ZodObject`,(e,t)=>{la.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r),F(e,`shape`,()=>t.shape),e.keyof=()=>Ec(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fc()}),e.loose=()=>e.clone({...e._zod.def,catchall:fc()}),e.strict=()=>e.clone({...e._zod.def,catchall:mc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>nr(e,t),e.safeExtend=t=>rr(e,t),e.merge=t=>ir(e,t),e.pick=t=>er(e,t),e.omit=t=>tr(e,t),e.partial=(...t)=>ar(jc,e,t[0]),e.required=(...t)=>or(Vc,e,t[0])});function J(e,t){return new gc({type:`object`,shape:e??{},...I(t)})}const _c=P(`ZodUnion`,(e,t)=>{da.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r),e.options=t.options});function vc(e,t){return new _c({type:`union`,options:e,...I(t)})}const yc=P(`ZodIntersection`,(e,t)=>{fa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ss(e,t,n,r)});function bc(e,t){return new yc({type:`intersection`,left:e,right:t})}const xc=P(`ZodTuple`,(e,t)=>{ha.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cs(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Sc(e,t,n){let r=t instanceof R;return new xc({type:`tuple`,items:e,rest:r?t:null,...I(r?n:t)})}const Cc=P(`ZodRecord`,(e,t)=>{_a.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ls(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function wc(e,t,n){return new Cc({type:`record`,keyType:e,valueType:t,...I(n)})}const Tc=P(`ZodEnum`,(e,t)=>{va.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Tc({...t,checks:[],...I(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Tc({...t,checks:[],...I(r),entries:i})}});function Ec(e,t){return new Tc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...I(t)})}const Dc=P(`ZodLiteral`,(e,t)=>{ya.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ts(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Oc(e,t){return new Dc({type:`literal`,values:Array.isArray(e)?e:[e],...I(t)})}const kc=P(`ZodTransform`,(e,t)=>{ba.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rs(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new An(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(fr(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(fr(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ac(e){return new kc({type:`transform`,transform:e})}const jc=P(`ZodOptional`,(e,t)=>{Sa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mc(e){return new jc({type:`optional`,innerType:e})}const Nc=P(`ZodExactOptional`,(e,t)=>{Ca.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pc(e){return new Nc({type:`optional`,innerType:e})}const Fc=P(`ZodNullable`,(e,t)=>{wa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>us(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ic(e){return new Fc({type:`nullable`,innerType:e})}const Lc=P(`ZodDefault`,(e,t)=>{Ta.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Rc(e,t){return new Lc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Jn(t)}})}const zc=P(`ZodPrefault`,(e,t)=>{Da.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bc(e,t){return new zc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Jn(t)}})}const Vc=P(`ZodNonOptional`,(e,t)=>{Oa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ds(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hc(e,t){return new Vc({type:`nonoptional`,innerType:e,...I(t)})}const Uc=P(`ZodCatch`,(e,t)=>{Aa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Wc(e,t){return new Uc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const Gc=P(`ZodPipe`,(e,t)=>{ja.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(e,t,n,r),e.in=t.in,e.out=t.out});function Kc(e,t){return new Gc({type:`pipe`,in:e,out:t})}const qc=P(`ZodReadonly`,(e,t)=>{Na.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jc(e){return new qc({type:`readonly`,innerType:e})}const Yc=P(`ZodCustom`,(e,t)=>{Fa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ns(e,t,n,r)});function Xc(e,t={}){return Vo(Yc,e,t)}function Zc(e){return Ho(e)}var Y=class extends Error{suggestion;docsLink;constructor(e,t){super(e),this.suggestion=t.suggestion,this.docsLink=t.docsLink}toString(){return`${this.message} ${this.suggestion}${O.default.gray(this.docsLink?`\n See: ${this.docsLink}`:``)}`}},Qc=class extends Y{constructor(){super(`No package.json found.`,{suggestion:`Please run create a package.json first before initializing a jsrepo project.`})}},$c=class extends Y{constructor({path:e}){super(`Manifest not found at ${O.default.bold(e)}.`,{suggestion:`This is a bug, please report it here: https://github.com/jsrepojs/jsrepo/issues`})}},el=class extends Y{constructor(e){super(`Invalid options: ${e.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `)}`,{suggestion:`Please check the options and try again.`})}},tl=class extends Y{zodError;constructor(e){super(`Zod error: ${e.message}`,{suggestion:`Check the input schema and try again.`}),this.zodError=e}},nl=class extends Y{constructor(e){super(`Invalid JSON: ${e instanceof Error?e.stack??e.message:`${e}`}`,{suggestion:`Check the input JSON and try again.`})}};function rl(e,t){let n=e.safeParse(t);return n.success?(0,N.ok)(n.data):(0,N.err)(new tl(n.error))}function il(e,t){try{let n=e.safeParse(JSON.parse(t));return n.success?(0,N.ok)(n.data):(0,N.err)(new tl(n.error))}catch(e){return(0,N.err)(new nl(e))}}const al=J({cwd:W().transform(e=>e)}),ol={yes:new t(`--yes`,`Skip the confirmation prompt.`).default(!1),cwd:new t(`--cwd <path>`,`The current working directory.`).default(process.cwd())};function sl(e,t){return rl(e,t).match(e=>e,e=>ll(new el(e.zodError)))}async function cl(e){try{let t=await e;return t.isErr()?ll(t.error):t.value}catch(e){e instanceof Y&&ll(e),ll(new Y(e instanceof Error?e.message:String(e),{suggestion:`Please try again.`}))}}function ll(e){return ul(e)}function ul(e){M.message(),process.env.JSREPO_TRACE===`1`?(console.trace(e),process.exit(1)):(wt(O.default.red(e.toString())),process.exit(1))}function dl(e,...t){return Dn.join(e,...t)}function fl(e){return Dn.dirname(e)}function pl(e){try{return(0,N.ok)(r.readFileSync(e,`utf-8`))}catch(t){return(0,N.err)(new Y(`Failed to read file ${e}: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`}))}}function ml(e,t){try{let n=hl(fl(e));return n.isErr()?(0,N.err)(n.error):(r.writeFileSync(e,t),(0,N.ok)())}catch(t){return(0,N.err)(new Y(`Failed to write file ${e}: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`}))}}function hl(e){try{return r.mkdirSync(e,{recursive:!0}),(0,N.ok)()}catch(t){return(0,N.err)(new Y(`Failed to create directory ${e}: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`}))}}function gl(e){try{return _l(e)&&r.rmSync(e),(0,N.ok)()}catch(t){return(0,N.err)(new Y(`Failed to remove file ${e}: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`}))}}function _l(e){return r.existsSync(e)}function vl(e,t={}){return JSON.stringify(e,null,t.format?` `:void 0)}var yl=E(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),bl=E(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),xl=E(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=yl(),a=bl();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),Sl=E(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Cl=E(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),X=E(((e,t)=>{let n=bl(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=yl(),{safeRe:a,t:o}=xl(),s=Sl(),{compareIdentifiers:c}=Cl();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),wl=E(((e,t)=>{let n=X();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),Tl=E(((e,t)=>{let n=wl();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),El=E(((e,t)=>{let n=wl();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),Dl=E(((e,t)=>{let n=X();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),Ol=E(((e,t)=>{let n=wl();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),kl=E(((e,t)=>{let n=X();t.exports=(e,t)=>new n(e,t).major})),Al=E(((e,t)=>{let n=X();t.exports=(e,t)=>new n(e,t).minor})),jl=E(((e,t)=>{let n=X();t.exports=(e,t)=>new n(e,t).patch})),Ml=E(((e,t)=>{let n=wl();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),Z=E(((e,t)=>{let n=X();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Nl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(t,e,r)})),Pl=E(((e,t)=>{let n=Z();t.exports=(e,t)=>n(e,t,!0)})),Fl=E(((e,t)=>{let n=X();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),Il=E(((e,t)=>{let n=Fl();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),Ll=E(((e,t)=>{let n=Fl();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),Rl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(e,t,r)>0})),zl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(e,t,r)<0})),Bl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(e,t,r)===0})),Vl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(e,t,r)!==0})),Hl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(e,t,r)>=0})),Ul=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>n(e,t,r)<=0})),Wl=E(((e,t)=>{let n=Bl(),r=Vl(),i=Rl(),a=Hl(),o=zl(),s=Ul();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),Gl=E(((e,t)=>{let n=X(),r=wl(),{safeRe:i,t:a}=xl();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),Kl=E(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),Q=E(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&g(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,ne(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>te(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let b=[..._.values()];return r.set(t,b),b}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(re(this.set[t],e,this.options))return!0;return!1}};let r=new(Kl()),i=Sl(),a=ql(),o=bl(),s=X(),{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:f}=xl(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=yl(),h=e=>e.value===`<0.0.0-0`,g=e=>e.value===``,_=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=S(e,t),o(`caret`,e),e=b(e,t),o(`tildes`,e),e=w(e,t),o(`xrange`,e),e=T(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,b=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(` `),x=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},w=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>ee(e,t)).join(` `)),ee=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},T=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),te=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),ne=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),re=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),ql=E(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=Sl(),{safeRe:i,t:a}=xl(),o=Wl(),s=bl(),c=X(),l=Q()})),Jl=E(((e,t)=>{let n=Q();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),Yl=E(((e,t)=>{let n=Q();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),Xl=E(((e,t)=>{let n=X(),r=Q();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),Zl=E(((e,t)=>{let n=X(),r=Q();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),Ql=E(((e,t)=>{let n=X(),r=Q(),i=Rl();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),$l=E(((e,t)=>{let n=Q();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),eu=E(((e,t)=>{let n=X(),r=ql(),{ANY:i}=r,a=Q(),o=Jl(),s=Rl(),c=zl(),l=Ul(),u=Hl();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),tu=E(((e,t)=>{let n=eu();t.exports=(e,t,r)=>n(e,t,`>`,r)})),nu=E(((e,t)=>{let n=eu();t.exports=(e,t,r)=>n(e,t,`<`,r)})),ru=E(((e,t)=>{let n=Q();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),iu=E(((e,t)=>{let n=Jl(),r=Z();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),au=E(((e,t)=>{let n=Q(),r=ql(),{ANY:i}=r,a=Jl(),o=Z(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),ou=ue(E(((e,t)=>{let n=xl(),r=yl(),i=X(),a=Cl();t.exports={parse:wl(),valid:Tl(),clean:El(),inc:Dl(),diff:Ol(),major:kl(),minor:Al(),patch:jl(),prerelease:Ml(),compare:Z(),rcompare:Nl(),compareLoose:Pl(),compareBuild:Fl(),sort:Il(),rsort:Ll(),gt:Rl(),lt:zl(),eq:Bl(),neq:Vl(),gte:Hl(),lte:Ul(),cmp:Wl(),coerce:Gl(),Comparator:ql(),Range:Q(),satisfies:Jl(),toComparators:Yl(),maxSatisfying:Xl(),minSatisfying:Zl(),minVersion:Ql(),validRange:$l(),outside:eu(),gtr:tu(),ltr:nu(),intersects:ru(),simplifyRange:iu(),subset:au(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}))(),1);const su=/^(@[^/]+\/[^@/]+)(?:@([^/]+))?(\/.*)?$/,cu=/^([^@/]+)(?:@([^/]+))?(\/.*)?$/;function lu(e){let t=su.exec(e)||cu.exec(e);return t?(0,N.ok)({name:t[1]||``,version:t[2]||void 0,path:t[3]||``}):(0,N.err)(`invalid package name: ${e}`)}function uu(e){if(e===ee.homedir()||e===Dn.parse(e).root)return;let t=dl(e,`package.json`);return _l(t)?{path:t,package:fu(t)}:uu(fl(e))}function du(e){try{return(0,N.ok)(fu(e))}catch(t){return(0,N.err)(`Error while trying to get package.json at ${e}: ${t}`)}}function fu(e){return JSON.parse(pl(e)._unsafeUnwrap().toString())}function pu(e){return e[0]===`^`?e.slice(1):e}function mu(e,{pkg:t}){function n(e,t){let n=t?.[e.name];return!(e.version===void 0&&n||n&&(e.version===void 0||ou.default.satisfies(pu(n),e.version)))}let r=new Set;for(let i of e.dependencies)n(lu(i)._unsafeUnwrap(),t.dependencies)&&r.add(i);let i=new Set;for(let r of e.devDependencies)n(lu(r)._unsafeUnwrap(),t.devDependencies)&&i.add(r);return{dependencies:Array.from(r.values()),devDependencies:Array.from(i.values())}}var hu=Object.create,gu=Object.defineProperty,_u=Object.getOwnPropertyDescriptor,vu=Object.getOwnPropertyNames,yu=Object.getPrototypeOf,bu=Object.prototype.hasOwnProperty,$=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xu=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=vu(t),a=0,o=i.length,s;a<o;a++)s=i[a],!bu.call(e,s)&&s!==n&&gu(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=_u(t,s))||r.enumerable});return e},Su=(e,t,n)=>(n=e==null?{}:hu(yu(e)),xu(t||!e||!e.__esModule?gu(n,`default`,{value:e,enumerable:!0}):n,e)),Cu=T(import.meta.url);const wu=/^path$/i,Tu={key:`PATH`,value:``};function Eu(e){for(let t in e){if(!Object.prototype.hasOwnProperty.call(e,t)||!wu.test(t))continue;let n=e[t];return n?{key:t,value:n}:Tu}return Tu}function Du(e,t){let n=t.value.split(h),r=e,i;do n.push(y(r,`node_modules`,`.bin`)),i=r,r=g(r);while(r!==i);return{key:t.key,value:n.join(h)}}function Ou(e,t){let n={...process.env,...t},r=Du(e,Eu(n));return n[r.key]=r.value,n}const ku=e=>{let t=e.length,n=new ne,r=()=>{--t===0&&n.emit(`end`)};for(let t of e)t.pipe(n,{end:!1}),t.on(`end`,r);return n};var Au=$((e,t)=>{t.exports=a,a.sync=o;var n=Cu(`fs`);function r(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:r(t,n)}function a(e,t,r){n.stat(e,function(n,a){r(n,n?!1:i(a,e,t))})}function o(e,t){return i(n.statSync(e),e,t)}}),ju=$((e,t)=>{t.exports=r,r.sync=i;var n=Cu(`fs`);function r(e,t,r){n.stat(e,function(e,n){r(e,e?!1:a(n,t))})}function i(e,t){return a(n.statSync(e),t)}function a(e,t){return e.isFile()&&o(e,t)}function o(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}}),Mu=$((e,t)=>{Cu(`fs`);var n=process.platform===`win32`||global.TESTING_WINDOWS?Au():ju();t.exports=r,r.sync=i;function r(e,t,i){if(typeof t==`function`&&(i=t,t={}),!i){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,i){r(e,t||{},function(e,t){e?i(e):n(t)})})}n(e,t||{},function(e,n){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,n=!1),i(e,n)})}function i(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}}),Nu=$((e,t)=>{let n=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,r=Cu(`path`),i=n?`;`:`:`,a=Mu(),o=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),s=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||n&&e.match(/\\/)?[``]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(r)],o=n?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=n?o.split(r):[``];return n&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:a,pathExt:s,pathExtExe:o}},c=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:i,pathExt:c,pathExtExe:l}=s(e,t),u=[],d=n=>new Promise((a,s)=>{if(n===i.length)return t.all&&u.length?a(u):s(o(e));let c=i[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=r.join(l,e);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((i,o)=>{if(r===c.length)return i(d(n+1));let s=c[r];a(e+s,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+s);else return i(e+s);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};t.exports=c,c.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:i,pathExtExe:c}=s(e,t),l=[];for(let o=0;o<n.length;o++){let s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,d=r.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<i.length;e++){let n=f+i[e];try{if(a.sync(n,{pathExt:c}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw o(e)}}),Pu=$((e,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n}),Fu=$((e,t)=>{let n=Cu(`path`),r=Nu(),i=Pu();function a(e,t){let a=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=r.sync(e.command,{path:a[i({env:a})],pathExt:t?n.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=n.resolve(s?e.options.cwd:``,l),l}function o(e){return a(e)||a(e,!0)}t.exports=o}),Iu=$((e,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,`$1$1\\"`),e=e.replace(/(\\*)$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i}),Lu=$((e,t)=>{t.exports=/^#!(.*)/}),Ru=$((e,t)=>{let n=Lu();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}}),zu=$((e,t)=>{let n=Cu(`fs`),r=Ru();function i(e){let t=Buffer.alloc(150),i;try{i=n.openSync(e,`r`),n.readSync(i,t,0,150,0),n.closeSync(i)}catch{}return r(t.toString())}t.exports=i}),Bu=$((e,t)=>{let n=Cu(`path`),r=Fu(),i=Iu(),a=zu(),o=process.platform===`win32`,s=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(e){e.file=r(e);let t=e.file&&a(e.file);return t?(e.args.unshift(e.file),e.command=t,r(e)):e.file}function u(e){if(!o)return e;let t=l(e),r=!s.test(t);if(e.options.forceShell||r){let r=c.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,r)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function d(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:u(r)}t.exports=d}),Vu=$((e,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t,`spawn`);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}}),Hu=Su($((e,t)=>{let n=Cu(`child_process`),r=Bu(),i=Vu();function a(e,t,a){let o=r(e,t,a),s=n.spawn(o.command,o.args,o.options);return i.hookChildProcess(s,o),s}function o(e,t,a){let o=r(e,t,a),s=n.spawnSync(o.command,o.args,o.options);return s.error=s.error||i.verifyENOENTSync(s.status,o),s}t.exports=a,t.exports.spawn=a,t.exports.sync=o,t.exports._parse=r,t.exports._enoent=i})(),1),Uu=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(e,t){super(`Process exited with non-zero status (${e.exitCode})`),this.result=e,this.output=t}};const Wu={timeout:void 0,persist:!1},Gu={windowsHide:!0};function Ku(e,t){return{command:v(e),args:t??[]}}function qu(e){let t=new AbortController;for(let n of e){if(n.aborted)return t.abort(),n;n.addEventListener(`abort`,()=>{t.abort(n.reason)},{signal:t.signal})}return t.signal}async function Ju(e){let t=``;for await(let n of e)t+=n.toString();return t}var Yu=class{_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(e,t,n){this._options={...Wu,...n},this._command=e,this._args=t??[],this._processClosed=new Promise(e=>{this._resolveClose=e})}kill(e){return this._process?.kill(e)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(e,t,n){return Zu(e,t,{...n,stdin:this})}async*[Symbol.asyncIterator](){let e=this._process;if(!e)return;let t=[];this._streamErr&&t.push(this._streamErr),this._streamOut&&t.push(this._streamOut);let n=ku(t),r=f.createInterface({input:n});for await(let e of r)yield e.toString();if(await this._processClosed,e.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new Uu(this)}async _waitForOutput(){let e=this._process;if(!e)throw Error(`No process was started`);let[t,n]=await Promise.all([this._streamOut?Ju(this._streamOut):``,this._streamErr?Ju(this._streamErr):``]);if(await this._processClosed,this._options?.stdin&&await this._options.stdin,e.removeAllListeners(),this._thrownError)throw this._thrownError;let r={stderr:n,stdout:t,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new Uu(this,r);return r}then(e,t){return this._waitForOutput().then(e,t)}_streamOut;_streamErr;spawn(){let e=c(),t=this._options,n={...Gu,...t.nodeOptions},r=[];this._resetState(),t.timeout!==void 0&&r.push(AbortSignal.timeout(t.timeout)),t.signal!==void 0&&r.push(t.signal),t.persist===!0&&(n.detached=!0),r.length>0&&(n.signal=qu(r)),n.env=Ou(e,n.env);let{command:i,args:a}=Ku(this._command,this._args),o=(0,Hu._parse)(i,a,n),s=te(o.command,o.args,o.options);if(s.stderr&&(this._streamErr=s.stderr),s.stdout&&(this._streamOut=s.stdout),this._process=s,s.once(`error`,this._onError),s.once(`close`,this._onClose),t.stdin!==void 0&&s.stdin&&t.stdin.process){let{stdout:e}=t.stdin.process;e&&e.pipe(s.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(e=>{this._resolveClose=e}),this._thrownError=void 0}_onError=e=>{if(e.name===`AbortError`&&(!(e.cause instanceof Error)||e.cause.name!==`TimeoutError`)){this._aborted=!0;return}this._thrownError=e};_onClose=()=>{this._resolveClose&&this._resolveClose()}};const Xu=(e,t,n)=>{let r=new Yu(e,t,n);return r.spawn(),r},Zu=Xu;function Qu(){console.clear(),Tt(`${O.default.bgYellow(O.default.black(` ${D} `))}${O.default.gray(` v${fe} `)}`)}async function $u({title:e,commands:t,cwd:n,messages:r}){let i=kt({title:e,limit:Math.ceil(process.stdout.rows/2),spacing:0,retainLog:!0}),a=async e=>{let t=Xu(e.command,[...e.args],{nodeOptions:{cwd:n}});for await(let e of t)i.message(e)};try{for(let e of t)await a(e);i.success(r.success())}catch(e){i.error(r.error(e)),process.exit(1)}}async function ed(e,{cwd:t}){let n=uu(t);if(!n)return;let r=await S(t);if(e.dependencies.length===0&&e.devDependencies.length===0){let e=Vt(r,`install`,[]);if(e===null)return;await $u({title:`Installing dependencies with ${r}...`,commands:[e],cwd:t,messages:{success:()=>`Installed dependencies`,error:e=>`Failed to install dependencies: ${e instanceof Error?e.message:e}`}});return}let{dependencies:i,devDependencies:a}=mu(e,{pkg:n.package});if(i.length===0&&a.length===0)return;let o=Vt(r,`add`,[...i]),s=Vt(r,`add`,[`-D`,...a]);await $u({title:`Installing dependencies with ${r}...`,commands:[...o&&i.length>0?[o]:[],...s&&a.length>0?[s]:[]],cwd:t,messages:{success:()=>`Installed ${O.default.cyan([...i,...a].join(`, `))}`,error:e=>`Failed to install dependencies: ${e instanceof Error?e.message:e}`}})}function td(e,t){for(let n of t)if(e.endsWith(n))return n}const nd=`jsrepo-manifest.json`,rd=J({authors:q(W()).optional(),bugs:W().optional(),description:W().optional(),homepage:W().optional(),repository:W().optional(),tags:q(W()).optional()}),id=vc([Oc(`public`),Oc(`private`),Oc(`marketplace`)]),ad=J({name:W(),path:W(),expectedPath:W().optional(),optional:K().optional().default(!1)}),od=wc(W(),vc([W(),Sc([W(),vc([W(),sc()])],vc([W(),sc()]))])),sd=wc(W(),vc([W(),J({version:W(),message:W()})])),cd=J({$schema:W(),name:W().optional(),version:W().optional(),readme:W().optional(),access:id.optional(),meta:rd.optional(),defaultPaths:wc(W(),W()).optional(),peerDependencies:sd.optional(),configFiles:q(ad).optional(),dirs:q(W()),outputDir:W().optional(),includeBlocks:q(W()).optional().default([]),includeCategories:q(W()).optional().default([]),includeFiles:q(W()).optional().default([]),excludeBlocks:q(W()).optional().default([]),excludeCategories:q(W()).optional().default([]),doNotListBlocks:q(W()).optional().default([]),doNotListCategories:q(W()).optional().default([]),listBlocks:q(W()).optional().default([]),listCategories:q(W()).optional().default([]),excludeDeps:q(W()).optional().default([]),allowSubdirectories:K().optional(),preview:K().optional(),includeDocs:K().optional().default(!1),rules:od.optional()}),ld=ad.extend({dependencies:q(W()).optional(),devDependencies:q(W()).optional()}),ud=J({name:W(),category:W(),localDependencies:q(W()),dependencies:q(W()),devDependencies:q(W()),tests:K(),docs:K().optional().default(!1),list:K().optional().default(!0),directory:W(),subdirectory:K(),files:q(W()),_imports_:wc(W(),W())}),dd=J({name:W(),blocks:q(ud)}),fd=J({name:W().optional(),version:W().optional(),meta:rd.optional(),access:id.optional(),defaultPaths:wc(W(),W()).optional(),configFiles:q(ld).optional(),categories:q(dd)}),pd=vc([Oc(`prettier`),Oc(`biome`)]),md=J({$schema:W(),repos:q(W()).optional().default([]),includeTests:K().optional().default(!1),includeDocs:K().optional().default(!1),paths:wc(W(),W()).optional(),configFiles:wc(W(),W()).optional(),watermark:Mc(K()).default(!0),formatter:Mc(pd)}),hd=[`.test.ts`,`_test.ts`,`.test.js`,`_test.js`,`.spec.ts`,`_spec.ts`,`.spec.js`,`_spec.js`,`.stories.jsx`,`_stories.jsx`,`.stories.tsx`,`_stories.tsx`],gd=[`.mdx`,`.md`];function _d(e){return td(e,hd)!==void 0}function vd(e){return td(e,gd)!==void 0}const yd=al.extend({yes:K()}),bd=new e(`v3`).description(`Migrate your jsrepo config to v3.`).addOption(ol.cwd).addOption(ol.yes).action(async e=>{let t=sl(yd,e);Qu();let n=await cl(xd(t));Et(`Successfully migrated to jsrepo v3.`),n.migratedConfigs.registry!==null&&(process.stdout.write(O.default.green(` Next steps:
96
96
 
97
97
  `)),process.stdout.write(` ${O.default.gray(`1.`)} Update documentation for the \`jsrepo add\` command ${O.default.gray("`jsrepo add <category>/<item>`")} -> ${O.default.cyan("`jsrepo add <item>`")}\n`),process.stdout.write(` ${O.default.gray(`2.`)} Add descriptions to registry items (optional)\n`),process.stdout.write(` ${O.default.gray(`3.`)} Checkout the new docs to learn more! ${O.default.cyan(`https://jsrepo.dev`)}\n`),process.stdout.write(`
98
98
  `))});async function xd(e){let t=du(dl(e.cwd,`package.json`));if(t.isErr())return(0,N.err)(new Qc);let n=t.value,r=dl(e.cwd,`jsrepo-build-config.json`),a;if(i(r)){let e=pl(r);if(e.isErr())return(0,N.err)(e.error);let t=il(cd,e.value);if(t.isErr())return(0,N.err)(new nl(t.error));a=t.value}else a=null;let o=dl(e.cwd,`jsrepo.json`),s;if(i(o)){let e=pl(o);if(e.isErr())return(0,N.err)(e.error);let t=il(md,e.value);if(t.isErr())return(0,N.err)(new nl(t.error));s=t.value}else s=null;if(a===null&&s===null)return(0,N.err)(new Y(`No configs to migrate at ${Dn.resolve(e.cwd)}!`,{suggestion:`Please ensure you are running this command in the root of your jsrepo project.`}));let c=null;if(a!==null){let t=await wd({packageJson:n,oldConfigPath:r,oldConfig:a,options:e});if(t.isErr())return(0,N.err)(t.error);c=t.value}let l=null;if(s!==null){let t=await Cd({oldConfig:s,options:e});if(t.isErr())return(0,N.err)(t.error);l=t.value}let u=[`jsrepo@latest`,...s?.formatter?[`@jsrepo/transform-${s.formatter}`]:[]],d=`import { defineConfig } from "jsrepo";${c?`\nimport { ${a?.outputDir?`distributed`:`repository`} } from "jsrepo/outputs";`:``}${s?.formatter?`\nimport ${s.formatter} from "@jsrepo/transform-${s.formatter}";`:``}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jsrepo/migrate",
3
3
  "description": "Automatically migrate your jsrepo project to the newest version of jsrepo.",
4
- "version": "0.0.15",
4
+ "version": "0.0.16",
5
5
  "license": "MIT",
6
6
  "homepage": "https://jsrepo.dev",
7
7
  "author": {
@@ -29,12 +29,12 @@
29
29
  "!dist/**/*.map"
30
30
  ],
31
31
  "dependencies": {
32
- "commander": "^14.0.2",
33
- "jsrepo": "3.2.0"
32
+ "commander": "^14.0.3",
33
+ "jsrepo": "3.2.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@clack/prompts": "1.0.0-alpha.6",
37
- "@types/node": "^25.0.3",
37
+ "@types/node": "^25.2.0",
38
38
  "@types/semver": "^7.7.1",
39
39
  "nevereverthrow": "^0.3.0",
40
40
  "package-manager-detector": "^1.6.0",
@@ -44,13 +44,13 @@
44
44
  "tinyexec": "^1.0.2",
45
45
  "tsdown": "0.19.0-beta.3",
46
46
  "typescript": "^5.9.3",
47
- "zod": "^4.3.5"
47
+ "zod": "^4.3.6"
48
48
  },
49
49
  "scripts": {
50
50
  "start": "node ./dist/bin.mjs",
51
51
  "build": "tsdown",
52
52
  "dev": "tsdown --watch",
53
53
  "check": "tsc --noEmit",
54
- "bundle-analyze": "FORCE_COLOR=1 node ../../bundle-analyzer/dist/index.mjs analyze ."
54
+ "bundle-analyze": "FORCE_COLOR=1 pnpx bundle-analyze . --fail-if-exceeds-bytes 500000"
55
55
  }
56
56
  }