@dovenv/utils
Version:
Utilities for dovenv
34 lines (31 loc) • 39.3 kB
JavaScript
import{hexToRgb as He,hslToRgb as Je,xyzToCIELab as Ge,rgbToXyz as Xe,rgbToHsl as qe,rgbToCIELab as Ye,rgbToHex as Ze}from"@vibrant/color";import Ke from"chalk";import Qe from"chroma-js";import{highlight as tr}from"cli-highlight";import er from"gradient-string";import rr from"ansi-align";import or from"figlet";import nr from"figures";import bt from"terminal-link";import ar from"boxen";import sr from"columnify";import{table as ir}from"table";import h,{argv as z}from"node:process";export{default as process}from"node:process";import cr from"terminal-size";export{default as terminalSize}from"terminal-size";import{globby as lr,globbyStream as ur}from"globby";import{createWriteStream as vt}from"node:fs";export{createWriteStream}from"node:fs";import{writeFile as xt,readdir as Ft,readFile as mr,rm as Ct,unlink as At,stat as ot,mkdir as nt,access as at,constants as pr,copyFile as dr,lstat as fr,symlink as st,rename as Tt}from"node:fs/promises";import{homedir as hr,tmpdir as wr,platform as gr,arch as yr,cpus as $r}from"node:os";import{resolve as Lt,relative as Er,extname as St,dirname as br,basename as A,isAbsolute as it,normalize as vr,join as C}from"node:path";import{fileURLToPath as xr,pathToFileURL as Fr}from"node:url";export{fileURLToPath}from"node:url";import{LocalStorage as Cr}from"node-localstorage";import*as Pt from"open";import{createRequire as Ar}from"module";import{spawn as ct,exec as Dt,fork as jt,execSync as Tr}from"node:child_process";import{npmRunPathEnv as Nt}from"npm-run-path";import{resolve as Lr}from"path";import{matcher as Sr}from"matcher";export{default as stringWidth}from"string-width";import Pr from"conf";import{deepmergeCustom as Rt}from"deepmerge-ts";export{deepmerge,deepmergeCustom}from"deepmerge-ts";import Dr from"archiver";import zt from"decompress";import jr from"decompress-targz";import Nr from"yargs";import{hideBin as Rr}from"yargs/helpers";import Ot from"log-update";import*as T from"@clack/prompts";import{TextPrompt as zr}from"@clack/core";import Or from"enquirer";import{consola as Ir}from"consola";import Mr from"ora";import{performance as It}from"node:perf_hooks";import kr from"pretty-ms";import{Validator as Br}from"@cfworker/json-schema";import{compile as Ur}from"json-schema-to-typescript-lite";import{jsonSchemaToZod as _r}from"json-schema-to-zod";import{createGenerator as Wr}from"ts-json-schema-generator";import{zodToJsonSchema as Vr}from"zod-to-json-schema";import{parse as Hr}from"csv-parse";import{stringify as Mt}from"csv-stringify/sync";import kt from"ini";import{stringify as Jr,parse as Gr}from"svgson";import{parse as Xr,stringify as qr}from"smol-toml";import{XMLBuilder as Yr,XMLParser as Zr}from"fast-xml-parser";import Bt from"js-yaml";import{ZodError as Kr,z as lt}from"zod";import{fromError as Qr}from"zod-validation-error";import{zerialize as Ut,dezerialize as _t}from"zodex";import{promisify as Wt}from"node:util";import{pipeline as to}from"node:stream";import{Marked as ut}from"marked";import{markedTerminal as eo}from"marked-terminal";import ro from"turndown";import{makeBadge as oo}from"badge-maker";import no from"remark-parse";import ao from"remark-stringify";import{unified as so}from"unified";import io from"qrcode-terminal";import{PNG as co}from"pngjs";import lo from"quantize";const uo=Qe,mo={rgb2hex:Ze,rgb2CIELab:Ye,rgb2sl:qe,rgb2xyz:Xe,xyz2CIELab:Ge,hslToRgb:Je,hex2rgb:He},po=(t,e)=>tr(t,e),d=Ke,fo=(t,e,r)=>er(...e).multiline(t,r),ho=nr,wo=(t,e="Standard")=>or.textSync(t,{font:e,horizontalLayout:"default",verticalLayout:"default",whitespaceBreak:!0}),go=(t,e)=>bt.isSupported?bt(t,e):e,yo=rr,Vt=(t,e)=>ir(t,e),W=(t,e)=>ar(t,e),Ht=(t,e)=>sr(t,e),$o=typeof window<"u"&&typeof window.document<"u",Eo=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,bo=typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",vo=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&"userAgent"in navigator&&typeof navigator.userAgent=="string"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),xo=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Fo=typeof process<"u"&&process.versions!=null&&process.versions.bun!=null,Jt=t=>{const e=t.process||h,r=Array.isArray(t.type)?t.type:[t.type||"stdout"],n={},o=a=>{n[a]=e[a].write,e[a].write=(s,...i)=>{const c=typeof s=="string"?s:s.toString(),l=t.fn({data:c,type:a});return n[a]?.call(e[a],l,...i)}};return{start:()=>{r.forEach(o)},stop:()=>{r.forEach(a=>{n[a]&&(e[a].write=n[a])})}}},Co=t=>Jt({process:t.process,type:t.type,fn:({data:e,type:r})=>{let n=t.transform?t.transform({data:e,type:r}):e;for(const[o,a]of Object.entries(t.params))n=n.replace(new RegExp(o,"g"),a);return n}}),Gt=t=>{const e=Array.isArray(t.type)?t.type:[t.type||"log"],r={},n=o=>{r[o]=console[o],console[o]=(...a)=>{const s=a.map(i=>{const c=typeof i=="string"?i:JSON.stringify(i);return t.fn({data:c,type:o})});r[o]?.call(console,...s)}};return{start:()=>{e.forEach(n)},stop:()=>{e.forEach(o=>{r[o]&&(console[o]=r[o])})}}},Ao=t=>Gt({type:t.type,fn:({data:e,type:r})=>{let n=t.transform?t.transform({data:e,type:r}):e;for(const[o,a]of Object.entries(t.params))n=n.replace(new RegExp(o,"g"),a);return n}}),To=()=>h.env.NODE_ENV!=="production",Lo=()=>{h.noDeprecation=!0},So=()=>({show:()=>{h.noDeprecation=!1},hide:()=>{h.noDeprecation=!0}}),Po=t=>{h.on("exit",t)},Do=t=>{h.on("SIGINT",t)},jo=()=>{h.exit(130)},O=t=>{const e=(u,m)=>u*m/100,{lineChar:r,title:n,titleAlign:o,align:a,lineColor:s}=t;let{width:i}=t;(i<1||i>100)&&(i=100);const{columns:c}=cr(),l=e(c,i);return W("",{title:n===""?void 0:n,borderStyle:{top:r,topLeft:"",topRight:"",left:"",right:"",bottomRight:"",bottomLeft:"",bottom:""},dimBorder:t.lineDim,borderColor:s,titleAlignment:o,float:a,padding:0,margin:0,width:l}).trimEnd()},No=t=>{let e="";const{title:r="",lineChar:n="\u23AF",align:o="center",titleAlign:a="center",width:s=100,lineColor:i,lineDim:c=!1}=t||{},l={align:o,width:s,lineColor:i,lineDim:c,titleAlign:a.replace("top-","").replace("bottom-","")};return a.startsWith("bottom")?(e+=O({lineChar:n,...l}),e+=`
`,e+=O({title:r,lineChar:" ",...l})):a.startsWith("top")?(e+=O({title:r,lineChar:" ",...l}),e+=`
`,e+=O({lineChar:n,...l})):e+=O({lineChar:n,title:r,...l}),e},P=Lt,Ro=Er,mt=St,V=br,Xt=A,qt=it,zo=vr,Oo=xt,H=lr,Io=ur,Mo=(t,e)=>{const r=P(t),n=P(e);return r===n},Yt=t=>{if((it(t)||/^(\.\/|\.\.\/|[A-Za-z]:\\|\/)/.test(t))&&(it(t)||/^(\.\/|\.\.\/|[A-Za-z]:\\|\/)/.test(t))){if(/\s(?!\\)/.test(t)&&!/\\\s/.test(t))return!1;try{return C(t)!==""}catch{return!1}}return!1},pt=async t=>{await G(t)||await re(t)},J=async t=>(t=$(t),await Ft(t,{withFileTypes:!0}));async function ko({path:t,extensions:e=[]}){return(await J(t)).filter(r=>{const n=mt(r.name);return e.includes(n)}).map(r=>Xt(r.name,mt(r.name)))}const Bo=(t=import.meta.url)=>V(xr(t));function b(...t){return C(...t)}const Zt=Lt;function $(t){let e=t;return t.startsWith("~/")&&(e=t.replace(/^~(?=$|\/|\\)/,hr())),Zt(e)}const I=mr;async function Kt(t){try{t=$(t),await Ct(t,{recursive:!0,force:!0})}catch(e){throw new Error(`Error removing ${t}: ${e.message}`)}}async function Qt(t){t=$(t),await G(t)&&await Kt(t)}async function Uo(t){t=$(t),await ee(t)?await Qt(t):await te(t)}async function te(t){t=$(t),await M(t)&&await At(t)}async function _o(t){await At(t)}async function ee(t){return t=$(t),(await ot(t)).isDirectory()}async function re(t){try{t=$(t),await nt(t,{recursive:!0})}catch(e){throw Error(`Error creating the directory: ${e}`)}}async function G(t){try{return t=$(t),await at(t,pr.F_OK),(await ot(t)).isDirectory()}catch{return!1}}async function M(t){try{return t=$(t),await at(t),(await ot(t)).isFile()}catch{return!1}}async function Wo(t,e){t=$(t),await xt(t,e)}async function k(t){return await M(t)?!0:await G(t)}const oe=async({input:t,output:e})=>{try{await dr(t,e)}catch(r){console.error(r)}},Vo=async({input:t,output:e})=>{try{const r=async({input:n,output:o})=>{const a=await J(n);await pt(o);for(const s of a){const i=C(n,s.name),c=C(o,s.name);s.isDirectory()?await r({input:i,output:c}):await oe({input:i,output:c})}};await r({input:t,output:e})}catch(r){console.error(`\u{1F4C1} Error copying directory: ${r.message}`)}},Ho=async({input:t,output:e})=>{try{await at(e)}catch(o){if(o.code==="ENOENT")await nt(e,{recursive:!0});else throw`\u274C\u{1F517} ${o}`}const r=await fr(t),n=process.platform==="win32";r.isDirectory()?n?await st(t,C(e,A(t)),"junction"):await st(t,C(e,A(t)),"dir"):r.isFile()&&await st(t,C(e,A(t))),console.log(`\u{1F517} symlink: "${t}" to "${e}".`)};function Jo(t){return new Cr(t)}const Go=Pt.default,Xo=Pt.openApp,x=async t=>t.then(e=>[void 0,e]).catch(e=>[e]);class ne extends Error{data;constructor(e,r){super(e),this.data=r,Error.captureStackTrace(this,this.constructor)}}const qo=t=>{try{return Ar(Lr(h.cwd(),"./")).resolve(t)}catch{}try{const e=import.meta.resolve(t);return new URL(e).pathname}catch{return}};class ae extends Error{}const Yo=async({name:t,opts:e})=>{const r=Nt(e);if(!r.PATH)return;const n=r.PATH.split(":").filter(o=>o.endsWith("node_modules/.bin"));for(const o of n){const a=b(o,t);if(await k(a))return a}},Zo=async({name:t,args:e,opts:r})=>new Promise((n,o)=>{const a=Nt(r),s=ct(t,e||[],{env:a,cwd:r?.cwd||h.cwd(),shell:!0,stdio:"inherit"});s.on("error",i=>{"code"in i&&i.code==="ENOENT"||"code"in i&&i.code==="MODULE_NOT_FOUND"?o(new ae(`Command '${t}' not found.`)):o(new Error(`Failed to execute '${t}': ${i.message}`))}),s.on("close",i=>{i!==0?o(new Error(`Process '${t}' exited with code ${i}`)):n(i)})}),Ko=async t=>{await new Promise((e,r)=>{ct(t,{shell:!0,stdio:"inherit"}).on("close",n=>{if(n===0)e();else{const o=new Error(`Command failed with code ${n}`);console.error(o),r(o)}})})},se=async t=>new Promise((e,r)=>{const n=ct(t,{shell:!0,stdio:"pipe"});let o="",a="";n.stdout?.on("data",s=>{o+=s.toString()}),n.stderr?.on("data",s=>{a+=s.toString()}),n.on("close",s=>{s===0?e({stdout:o,stderr:a}):r({code:s,stdout:o,stderr:a})}),n.on("error",s=>{r(s)})}),Qo=async t=>{const{name:e,on:r,onError:n,onExit:o,onSuccess:a}=t,s=h.argv.includes("--debug"),i={debug:c=>{s&&console.debug(`
\u{1F426}\u2B1B [${e}]`,c)},info:c=>console.log(`
\u{1F426}\u{1F7E6} [${e}]`,c),success:c=>console.log(`
\u{1F426}\u2705 [${e}]`,c),warn:c=>console.warn(`
\u{1F426}\u{1F7E1} [${e}]`,c),error:c=>console.error(`
\u{1F426}\u274C [${e}] Error: `,c),box:c=>console.log(`
${W(c,{padding:1,title:`\u{1F426}\u{1F7E6} [${e}]`})}`)};try{i.info(`Init process
`),console.group(),await r({log:i}),console.groupEnd(),a?await a({log:i}):i.success(`Process executed successfully
`)}catch(c){console.groupEnd(),c.name==="ExitPromptError"?o?await o({log:i}):i.warn("Exit from process"):n?await n({log:i,error:c}):i.error(c)}},tn=t=>x(new Promise((e,r)=>{Dt(t,(n,o,a)=>{if(n){r({error:n,stdout:o,stderr:a});return}e(o)})})),en=async({module:t,args:e=[]})=>{const r=await ht(t);await new Promise((n,o)=>{jt(r,e,{stdio:"inherit"}).on("close",a=>a===0?n():(console.warn(`[${t.id}] exited with code ${a}`),o()))})},rn=async({module:t,args:e=[]})=>{const r=await ht(t);return new Promise((n,o)=>{const a=jt(r,e,{stdio:["pipe","pipe","pipe","ipc"]});let s="",i="";a.stdout&&a.stdout.on("data",c=>s+=c.toString()),a.stderr&&a.stderr.on("data",c=>i+=c.toString()),a.on("close",c=>c===0?n({stdout:s,stderr:i}):(console.warn(`[${t.id}] exited with code ${c}`),o(new Error(`Process exited with code ${c}`)))),a.on("error",c=>{o(c)})})},ie=async t=>{const e=h.platform==="win32"?`where ${t}`:`which ${t}`;try{return await se(e),!0}catch{return!1}},on=async t=>{const e={},r=t.map(async n=>{const o=await ie(n);e[n]=o});return await Promise.all(r),e},nn=(t,e)=>{const r=ce(t);if(r&&Object.values(e).includes(r))return r},ce=t=>{const e=t.length===1?"-":"--",r=z;for(let n=0;n<r.length;n++){const o=r[n];if(o.startsWith(`${e}${t}=`))return o.split("=")[1];if(o===`${e}${t}`&&r[n+1]&&!r[n+1].startsWith(e))return r[n+1]}},an=t=>{const e=z,r=t.length===1?"-":"--";let n=[];for(let o=0;o<e.length;o++){const a=e[o];if(a.startsWith(`${r}${t}=`)){n=a.split("=")[1].split(",");break}if(a===`${r}${t}`){for(let s=o+1;s<e.length&&!e[s].startsWith(r);s++)n.push(e[s]);break}}return n.length>0?n:void 0},sn=t=>{const e=t.length===1?"-":"--";return z.includes(`${e}${t}`)},cn=t=>z.includes(t),ln=()=>z.length>2,un=Rr,mn=async({args:t=process.argv,fn:e})=>{const r=Nr(t);return await e(r),r.help(),r.parse(),r},pn=({frames:t,interval:e=100,clear:r=!1})=>{let n=!1,o=0,a=null;return{start:()=>{n||(n=!0,a=setInterval(()=>{Ot(t[o]),o=(o+1)%t.length},e))},stop:()=>{n&&(n=!1,a&&(clearInterval(a),a=null),r&&Ot.clear())}}},dn=()=>h.platform!=="win32"?h.env.TERM!=="linux":!!h.env.WT_SESSION||!!h.env.TERMINUS_SUBLIME||h.env.ConEmuTask==="{cmd::Cmder}"||h.env.TERM_PROGRAM==="Terminus-Sublime"||h.env.TERM_PROGRAM==="vscode"||h.env.TERM==="xterm-256color"||h.env.TERM==="alacritty"||h.env.TERMINAL_EMULATOR==="JetBrains-JediTerm",fn=dn(),D=(t,e)=>fn?t:e,v={STEP_ACTIVE:D("\u25C6","*"),STEP_CANCEL:D("\u25A0","x"),STEP_ERROR:D("\u25B2","x"),STEP_SUBMIT:D("\u25C7","o"),BAR:D("\u2502","|"),BAR_END:D("\u2514","\u2014")},le=t=>{if(t==="initial"||t==="active")return d.cyan(v.STEP_ACTIVE);if(t==="cancel")return d.red(v.STEP_CANCEL);if(t==="error")return d.yellow(v.STEP_ERROR);if(t==="submit")return d.green(v.STEP_SUBMIT)};async function hn(t){return new zr({validate:e=>{const r="Value must be a number without",n=/\s/.test(e),o=typeof Number(e)=="number"&&!isNaN(Number(e));if(!e||!o||n)return t.errorText?t.errorText:r;if(t.validate)return t.validate(e)},placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){const e=`${d.gray(v.BAR)}
${le(this.state)} ${t.message}
`,r=t.placeholder?d.inverse(t.placeholder[0])+d.dim(t.placeholder.slice(1)):d.inverse(d.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
${d.yellow(v.BAR)} ${n}
${d.yellow(v.BAR_END)} ${d.yellow(this.error)}
`;case"submit":return`${e}${d.gray(v.BAR)} ${d.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${d.gray(v.BAR)} ${d.strikethrough(d.dim(this.value??""))}${this.value?.trim()?`
`+d.gray(v.BAR):""}`;default:return`${e}${d.cyan(v.BAR)} ${n}
${d.cyan(v.BAR_END)}
`}}}).prompt()}const dt={message:"message"};async function ue(t){return Or.prompt(t)}const me=async(t,e)=>{T.log.message();const r="id",n=await ue({...t,name:r,prefix:o=>{let a="active";return o.cancelled&&(a="cancel"),o.submitted&&(a="submit"),o.error!==""&&(a="error"),le(a)},onCancel:async()=>{T.log.message(),e&&await e()}});return T.log.message(),r in n?n[r]:void 0},wn={table:({value:t,opts:e,type:r=dt.message})=>T.log[r](Vt(t,e)),columns:({value:t,opts:e,type:r=dt.message})=>T.log[r](Ht(t,e)),box:({value:t,opts:e,type:r=dt.message})=>T.log[r](W(t,e))},pe=T,gn=me,ft={...pe,number:hn,...wn};async function yn(t){t.onCancel||(t.onCancel=async o=>{o.cancel("canceled \u{1F494}"),process.exit(0)});const e={...ft,typePrompt:o=>me(o,()=>t.onCancel?.(ft))};t.intro&&e.intro(t.intro);const r=await t.list(e),n=await e.group(r,{onCancel:()=>t.onCancel?.(e)});return t.outro&&(e.log.step(""),e.outro(t.outro)),n}const $n=Ir,En=Mr,bn=()=>{const t=It.now(),e=()=>It.now()-t;return{stop:()=>e()/1e3,prettyStop:()=>kr(e())}},vn=async t=>new Promise(e=>setTimeout(e,t)),de=()=>{const t=new Date,e=t.getUTCFullYear().toString(),r=("0"+(t.getUTCMonth()+1)).slice(-2),n=("0"+t.getUTCDate()).slice(-2),o=("0"+t.getUTCHours()).slice(-2),a=("0"+t.getUTCMinutes()).slice(-2),s=("0"+t.getUTCSeconds()).slice(-2);return{year:e,month:r,day:n,hours:o,minutes:a,seconds:s}},xn=()=>{const t=de();return`${t.year}-${t.month}-${t.day}T${t.hours}:${t.minutes}:${t.seconds}Z`},ht=async({from:t=h.cwd(),id:e,path:r})=>{const n=class extends Error{};try{const o=e,a=o.includes("/")?o.startsWith("@")?o.split("/").slice(0,2).join("/"):o.split("/")[0]:o,s=`Module [${b(o,...r||[])}] not found. `,i=(await import("node:module")).default.createRequire(t).resolve.paths(o);if(!i)throw new n(s+"Failed in resolve.paths");let c=i.map(l=>b(l,a)).find(async l=>await k(l));if(!c)throw new n(s+"Failed in lookupPaths");if(r&&(c=b(c,...r)),!await k(c))throw new n(s+"Path does not exist");return c}catch(o){const a=`
Error information:
- Make sure the package [${e}] is installed correctly.`;throw o instanceof n?(o.message+=a,o):new Error(`It could not be located ${b(e,...r||[])}.`+a)}},Fn=async t=>{const{content:e,params:r,transform:n,opts:o}=t,{prefix:a,suffix:s}=o?.mark||{prefix:"{{",suffix:"}}"},i=g=>g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=new RegExp(`${i(a)}\\s*([^}]+?)\\s*${i(s)}`,"g"),l=(g,w)=>{const f=w.split(".");let p=g;for(const E of f){if(p===void 0)return;if(E.includes("[")&&E.includes("]")){const[R,We]=E.split("["),Ve=parseInt(We.replace("]",""),10);p=p[R]?.[Ve]}else p=p[E]}return p},u=async(g,w)=>{if(n){const p=await n(w);if(p!==w)return p}const f=l(r,w);if(f===void 0){if(o?.throw)throw new Error(`Placeholder ${w} not found`);return g}return String(f)};let m=e;const y=[...e.matchAll(c)];for(const g of y){const[w,f]=g,p=await u(w,f);m=m.replace(w,p)}return m},X=t=>{const e=t.length,r=t.split(/\s+/).filter(Boolean).length;return{chars:e,words:r}},Cn=(t,e=" ")=>t.split(`
`).map(r=>`${e}${r}`).join(`
`),An=t=>t.charAt(0).toUpperCase()+t.slice(1),Tn=Sr,j=t=>Ln(t)?"url":Yt(t)?"path":"text",Ln=t=>{try{return new URL(t),!0}catch{return!1}},fe=(...t)=>(t=t.map(e=>e.replace(/^\/+|\/+$/g,"")),t.join("/")),Sn=t=>JSON.stringify(t,null," ")+`
`,q=async t=>(t=$(t),(await I(t)).toString("utf8"));async function N(t){try{const e=await fetch(t);return e.headers.get("content-type")?.includes("image")?`data:image/jpeg;base64,${Buffer.from(await e.arrayBuffer()).toString("base64")}`:await e.text()}catch(e){throw new Error(`Fetching URL Error: ${e.message}`)}}const Pn=async t=>{const e=j(t);return e==="path"?await q(t):e==="url"?await N(t):t},Dn=async t=>{const e=[];for(let r=0;r<t.length;r++){const n=t[r],o=j(n);if(o==="path"){const a=await H(n);for(const s of a)e.push({type:o,path:s,id:`${V(s)}`,content:await q(s)})}else o==="url"?e.push({type:o,path:n,id:`${o}-${new URL(n).hostname}-${r}`,content:await N(n)}):e.push({type:o,id:`${o}-${r}`,content:n})}return e},jn=async({id:t,values:e,projectName:r,cwd:n})=>{const o=new Pr({projectName:r,cwd:n}),a=Rt({mergeArrays:!1}),s=l=>{const u=o.get(t)||{};if(!l)return u;if(l in u)return u[l];if(l in e)return e[l];throw new Error(`Cache value is unexpected: ${l.toString()}`)},i=l=>{const u=o.get(t)||{},m=a(u,l);o.set(t,m)},c=()=>o.reset(t);return o.get(t)||i(e),{defaultValues:e,get:s,set:i,reset:c,path:o.path}},Nn=()=>wr(),Rn=async()=>{switch(gr()){case"win32":return"windows";case"darwin":return"macos";case"linux":return"linux";default:return"unknown"}};function zn(){switch(yr()){case"arm64":return"arm64";case"arm":return"arm64";case"x64":return"x64";default:return"unknown"}}async function On({input:t,output:e,newName:r,remove:n=!1}){const o=St(t).toLowerCase(),a=r||A(t,o),s=b(e,a);try{if(o===".zip")await zt(t,e,{strip:1}),console.log(`File decompressed successfully to ${e}`);else if(o===".tar"||o===".tgz"||o===".gz")await zt(t,e,{plugins:[jr()],strip:1}),console.log(`File decompressed successfully to ${e}`);else throw new Error(`Unsupported file extension: ${o}`);r&&(await Tt(b(e,A(t,o)),s),console.log(`File renamed successfully to ${s}`)),n&&(await Ct(t),console.log(`Original file ${t} removed successfully`))}catch(i){console.error(`Error during decompression: ${i.message}`)}}const he=(t,e,r,n,o)=>new Promise((a,s)=>{const i=vt(b(r,e)),c=Dr("zip",{zlib:{level:6}});i.on("close",()=>{n(e),a()}),c.on("error",l=>{o(e,l),s(l)}),c.pipe(i),c.file(t,{name:e.replace(".zip","")}),c.finalize()}),In=async({input:t,output:e,name:r,onDone:n=()=>{},onError:o=()=>{}})=>{const a=r?r.endsWith(".zip")?r:`${r}.zip`:A(t);return await he(t,a,e,n,o)},Mn=async({input:t,output:e,onDone:r=()=>{},onError:n=()=>{}})=>{const o=async(l,u,m,y,g)=>{const w=b(l,u),f=`${u}.zip`;return he(w,f,m,y,g)},a=l=>!/(^|\/)\.[^\\/\\.]/g.test(l);await k(t)||await nt(e,{recursive:!0});const s=(await Ft(t)).filter(a),i=$r().length,c=[];for(let l=0;l<s.length;l+=i)c.push(s.slice(l,l+i));await Promise.all(c.map(async l=>{await Promise.all(l.map(u=>o(t,u,e,r,n)))}))},we=async({input:t,opts:e})=>{let r=0,n=0;const o=await H(t,{onlyFiles:!0,...e||{}});for(const a of o){const s=await I(a,"utf-8"),i=X(s);r+=i.chars,n+=i.words}return{files:o.length,chars:r,words:n}},ge=async({input:t,opts:e})=>{const{chars:r,words:n}=await we({input:t,opts:e});return{chars:r,words:n}},ye=async({input:t})=>{let e=0,r=0;for(const n of t){const o=await N(n),a=X(o);e+=a.chars,r+=a.words}return{chars:e,words:r}},$e=async({input:t})=>{let e=0,r=0;for(const n of t){const o=X(n);e+=o.chars,r+=o.words}return{chars:e,words:r}},kn=async({paths:t,url:e,content:r,opts:n})=>{try{const o={chars:0,words:0,paths:{chars:0,words:0},url:{chars:0,words:0},content:{chars:0,words:0}};if(t){const a=await ge({input:t,opts:n?.paths});o.chars+=a.chars,o.words+=a.words,o.paths.chars+=a.chars,o.paths.words+=a.words}if(e){const a=await ye({input:e});o.chars+=a.chars,o.words+=a.words,o.url.chars+=a.chars,o.url.words+=a.words}if(r){const a=await $e({input:r});o.chars+=a.chars,o.words+=a.words,o.content.chars+=a.chars,o.content.words+=a.words}return o}catch(o){throw console.error("Error reading files:",o),o}},wt=t=>{const e={lastFolder:d.gray.dim(" "),indent:d.gray.dim("\u2502 "),line:d.gray.dim("\u251C\u2500\u2500 "),lastLine:d.gray.dim("\u2514\u2500\u2500 ")},r=({name:a,indent:s,isLast:i,isFolder:c})=>(i&&c&&s===0?e.lastFolder:e.indent).repeat(s)+(i?e.lastLine:e.line)+(c?d.blue.bold(a):d.green(a)),n=t.style||r,o=(a,s=0)=>{const i=Object.entries(a);let c="";for(let l=0;l<i.length;l++){const[u,m]=i[l],y=typeof m=="object"&&m!==null,g=l===i.length-1;c+=n({name:u,indent:s,isLast:g,isFirst:l===0,isFolder:y})+`
`,y&&(c+=o(m,s+1))}return c};return(t.name?t.name+`
`:"")+o(t.structure,t.name?1:0)},Bn=async t=>{if(!t.input)throw new Error("The 'input' path is required.");const e=t.max??1/0,r=t?.sort||"atoz",n=async(o,a)=>{if(a<=0)return{};const s=await J(o),i={},c=s.sort((l,u)=>{const m=l.name.localeCompare(u.name);return r==="atoz"?m:-m});return await Promise.all(c.map(async l=>{const u=b(o,l.name);l.isDirectory()?i[l.name]=await n(u,a-1):i[l.name]=null})),i};return await n(t.input,e)},Un=async t=>{const{input:e,...r}=t,n=await Bn(t);return wt({structure:n,...r})},Ee=async t=>{const e=await H(t.input,t.patternOpts),r=t.max??1/0,n=t?.sort||"atoz";if(!e||e.length===0)throw new Error("No files found");const o=e.sort((a,s)=>{const i=a.localeCompare(s);return n==="atoz"?i:-i});return((a,s)=>{if(s<=0)return{};const i={};return a.forEach(c=>{const l=c.split("/");l.length>s&&(l.length=s),l.reduce((u,m,y)=>(u[m]||(u[m]=y===l.length-1?null:{}),u[m]),i)}),i})(o,r)},_n=async t=>{const{input:e,...r}=t,n=await Ee(t);return wt({structure:n,...r})},L=q,be=async t=>{try{const e=await L(t);return await Y(e)}catch(e){throw new Error(`Error reading CSV file ${t}: ${e.message}`)}},Y=async(t,e={delimiter:",",columns:!0,skip_empty_lines:!0})=>new Promise((r,n)=>{Hr(t,e,(o,a)=>{o?n(o):r(a)})}),Wn=async(t,e)=>Array.isArray(t)?Mt(t,{header:!0,...e}):Mt(t,{header:!0,...e}),Vn={deserialize:Y,serialize:Wn},Hn=t=>/<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)/i.test(t.trim()),ve=async t=>{try{const e=await L(t);return await Z(e)}catch(e){throw new Error(`Error reading INI file ${t}: ${e.message}`)}},Z=async t=>{if(Hn(t))throw new Error("Content is HTML");return kt.parse(t)},Jn=async t=>kt.stringify(t,{align:!0}),Gn={deserialize:Z,serialize:Jn},xe=async(t,e="default")=>{try{t=$(t);const r=(await import(Fr(t).href))[e];if(!r)throw new Error(`No [${e}] export found`);if(typeof r!="object")throw new Error("Export is not an object");return r}catch(r){throw r instanceof SyntaxError?new Error(`Syntax error in JS file ${t}: ${r.message}`):r instanceof Error&&r.code==="MODULE_NOT_FOUND"?new Error(`Module not found at ${t}: ${r.message}`):r instanceof TypeError?new Error(`Error accessing export [${e}] in ${t}: ${r.message}`):new Error(`Error reading JS file ${t}: ${r instanceof Error?r.message:String(r)}`)}},Fe=async(t,e="default")=>{const r=/export\s+default\s+({[^]*?});/,n=new RegExp(`export\\s+(const|let|var|function)\\s+${e}\\s*=\\s*({[^]*?});`);let o;const a=t.match(r);if(a&&a.length>1)o=a[1];else{const s=t.match(n);s&&s.length>2&&(o=s[2])}if(!o)throw new Error(`No export object found for "${e}".`);try{const s=new Function(`return ${o}`)();if(typeof s!="object"||s===null)throw new Error("The export is not a valid object.");return s}catch(s){throw new Error(`Error when loading the object from the Javascript content: ${s.message}`)}},Ce=async t=>{try{const e=await L(t);return await B(e)}catch(e){throw new Error(`Error reading JSON file ${t}: ${e.message}`)}},B=async t=>JSON.parse(t),Xn={deserialize:B,serialize:t=>JSON.stringify(t),parser:B,stringify:t=>JSON.stringify(t)},qn={deserialize:Gr,serialize:Jr},Ae=async t=>{try{const e=await L(t);return await K(e)}catch(e){throw new Error(`Error reading TOML file ${t}: ${e.message}`)}},K=async t=>Xr(t),Yn={deserialize:K,serialize:t=>qr(t)},Te=async t=>{try{const e=await L(t);return await Q(e)}catch(e){throw new Error(`Error reading XML file ${t}: ${e.message}`)}},Q=async t=>{try{return new Zr().parse(t)}catch(e){throw new Error(`Error parsing XML content: ${e.message}`)}},Zn=async t=>new Yr().build(t),Kn={deserialize:Q,serialize:Zn},Le=async t=>{try{const e=await L(t);return await tt(e)}catch(e){throw new Error(`Error reading YAML file ${t}: ${e.message}`)}},tt=async t=>Bt.load(t),Qn={deserialize:tt,serialize:t=>Bt.dump(t)},ta=t=>(...e)=>{const r=(...n)=>Rt(t||{})(...n);if(e.length===1){const[n]=e;return Array.isArray(n)?r(...n):n}return r(...e)},F={json:"json",yml:"yml",yaml:"yaml",toml:"toml",js:"js",mjs:"mjs",ini:"ini",xml:"xml",csv:"csv"},gt=async t=>{try{if(!await M(t))throw Error("File does not exists");let e;if(t.endsWith("."+F.json))e=await Ce(t);else if(t.endsWith("."+F.yml)||t.endsWith("."+F.yaml))e=await Le(t);else if(t.endsWith("."+F.toml))e=await Ae(t);else if(t.endsWith("."+F.js)||t.endsWith("."+F.mjs))e=await xe(t);else if(t.endsWith("."+F.ini))e=await ve(t);else if(t.endsWith("."+F.csv))e=await be(t);else if(t.endsWith("."+F.xml))e=await Te(t);else throw new Error("Unsupported file format. Expected JSON, YAML or TOML.");if(typeof e!="object"||e===null)throw new Error("Data is not an object.");return e}catch(e){throw new Error(`Error reading file ${t}: ${e.message}`)}},ea=async t=>{try{const e=await L(t),r=await et(e);if(typeof r!="object"||r===null)throw new Error("Data is not an object.");return r}catch(e){throw new Error(`Error reading file ${t}: ${e.message}`)}},ra=async(t,e)=>{try{const r=Object.values(F);for(let n=0;n<r.length;n++){const o=r[n],a=b(t,e+"."+o);if(await M(a))return await gt(a)}throw Error("Path not exist")}catch(r){throw new Error(`Error reading file ${t} with filename ${e}: ${r.message}`)}},et=async t=>{const[e,r]=await x(B(t));if(!e&&r)return r;const[n,o]=await x(tt(t));if(!n&&o)return o;const[a,s]=await x(K(t));if(!a&&s)return s;const[i,c]=await x(Fe(t));if(!i&&c)return c;const[l,u]=await x(Z(t));if(!l&&u)return u;const[m,y]=await x(Q(t));if(!m&&y)return y;const[g,w]=await x(Y(t));if(!g&&w&&Array.isArray(w))return w;throw new Error("Cannot parse object from content")},yt=async t=>{try{const e=await N(t);return et(e)}catch(e){throw new Error(`Error getting [${t}] data. ${e.message}`)}},$t=async t=>{try{const e=j(t);return e==="url"?await yt(t):e==="path"?await gt(t):await et(t)}catch(e){throw new Error(e.message)}},oa=t=>t,na=t=>t(rt),Se=t=>Qr(t).toString(),Et=Kr,rt=lt,aa=Ut,sa=_t;class ia{Error=Et;schema=rt;formatError=Se;serialize=Ut;deserialize=_t;createLiteralUnion(e){return lt.union(e.map(r=>lt.literal(r)))}}const ca=async t=>await Vr(t.schema,t.opts),la=async t=>await _r(t.schema,t.opts),ua=t=>JSON.parse(t),ma=async t=>await Wr(t.config).createSchema(t.config.type),Pe=async t=>Ur(t.schema,t.name,{...t?.opts}),pa=async t=>{const e="PKGSchema",r=(await Pe({name:e,schema:t.schema})).replace(new RegExp(`^[\\s\\S]*?${e}\\s`),"");return t.required&&r.replaceAll("?",""),t.noUnknownObject&&r.replaceAll(/^\s*\[k: string\]: unknown;\s*$/gm,"").replaceAll(/^\s*[\r\n]+/gm,""),r},U={INVALID_SCHEMA:"INVALID_SCHEMA",INVALID_DATA:"INVALID_DATA",UNEXPECTED:"UNEXPECTED"};class _ extends ne{}const da=async(t,e)=>{const r=async()=>e.parse(t),[n,o]=await x(r());if(!n)return o;throw n instanceof Et?new _(U.INVALID_DATA,{data:n.errors}):new _(U.UNEXPECTED,{data:n.message})},fa=async(t,e)=>{try{if(typeof t=="string"&&(t=await $t(t)),e instanceof rt.ZodType)return await da(t,e);if(typeof e=="string"&&(e=await $t(e),typeof e!="object"))throw new _(U.INVALID_SCHEMA,{data:e});const r="2020-12",n=!0,o=new Br(e,r,n).validate(t);if(!o.valid)throw new _(U.INVALID_DATA,{data:o.errors});return t}catch(r){throw new _(r?.message||U.UNEXPECTED)}},ha=Wt(to),De=/^[/]([^/]+)[/]([^/]+)[/]tree[/]([^/]+)[/](.*)/,je=async(t,e,r)=>{const n=await fetch(`https://api.github.com/repos/${t}`,e?{headers:{Authorization:`Bearer ${e}`}}:{});if(n.status===401)throw r||console.log("\u26A0 The token provided is invalid or has been revoked.",{token:e}),new Error("Invalid token");if(n.status===403){if(n.headers.get("X-RateLimit-Remaining")==="0")throw r||console.log("\u26A0 Your token rate limit has been exceeded.",{token:e}),new Error("Rate limit exceeded")}else if(n.status===404)throw r||console.log("\u26A0 Repository was not found.",{repo:t}),new Error("Repository not found");if(!n.ok)throw r||console.log("\u26A0 Could not obtain repository data from the GitHub API.",{repo:t,response:n}),new Error("Fetch error");return n.json()},wa=async({user:t,repository:e,ref:r="HEAD",directory:n,token:o,muteLog:a})=>{n.endsWith("/")||(n+="/");const s=[],i=await je(`${t}/${e}/git/trees/${r}?recursive=1`,o,a);if(i.message)throw new Error(i.message);for(const c of i.tree)c.type==="blob"&&c.path.startsWith(n)&&s.push(c);return s},Ne=async(t,e,r,n,o)=>{const a=(await je(`${t}/${e}`,o?.token,o?.muteLog)).private;return{files:await wa({user:t,repository:e,ref:r,directory:decodeURIComponent(n),token:o?.token,muteLog:o?.muteLog}),repoIsPrivate:a}},ga=(t,e)=>{try{const[,r,n,o,a]=De.exec(new URL(t).pathname)??[];return[r,n,o,a]}catch{}return[]},ya=async(t,e,r)=>{let n,o;const a={files:{},downloaded:0,success:!1},[s,i,c,l]=ga(t);if(!s||!i)return r?.muteLog||console.error("Invalid url. It must match: ",De),a.error="Invalid url",a;e||(e=P(process.cwd(),l)),qt(e)||(e=P(process.cwd(),e));try{n=await Ne(s,i,c,l,r)}catch(f){r?.muteLog||console.error("Failed to fetch repo meta info: ",f),await new Promise(p=>setTimeout(p,3e3));try{n=await Ne(s,i,c,l,r)}catch(p){return r?.muteLog||console.error("Failed to fetch repo meta info after second attempt: ",p),a.error=p,a}}const{files:u}=n;if(u.length===0)return r?.muteLog||console.log("No files to download"),a.success=!0,a;r?.muteLog||console.log(`Downloading ${u.length} files\u2026`);const m=async f=>{const p=await fetch(`https://raw.githubusercontent.com/${s}/${i}/${c}/${f.path}`,r?.token?{headers:{Authorization:`Bearer ${r?.token}`}}:void 0);if(!p.ok)throw new Error(`HTTP ${p.statusText} for ${f.path}`);return p};o=0;const y=async f=>{let p;try{p=await m(f)}catch(E){r?.muteLog||console.log("\u26A0 Failed to download file: "+f.path,E),await new Promise(R=>setTimeout(R,2e3));try{p=await m(f)}catch(R){r?.muteLog||console.log("\u26A0 Failed to download file after second attempt: "+f.path,R);return}}try{o++;const E=P(e,f.path.replace(l+"/",""));await pt(V(E)),await ha(p.body,vt(E)),a.files[f.path]=E}catch(E){r?.muteLog||console.error("Failed to write file: "+f.path,E)}},g=r?.requests??10,w=[];for(let f=0;f<u.length;f++){const p=f%g;w[p]&&await w[p],w[p]=y(u[f])}return await Promise.all(w),r?.muteLog||console.log(`Downloaded ${o}/${u.length} files`),a.downloaded=o,u.length===o&&(a.success=!0),a},$a=async t=>{await ya(t.input,t.output,{token:t.token})},Re=()=>{try{return Tr("gh auth status",{encoding:"utf-8"}).includes("Logged in to github.com")}catch{return!1}},Ea=async({user:t,repo:e,outputPath:r,filename:n,newFilename:o,version:a=""})=>{const s=Wt(Dt),i=C(r,n),c=C(r,o||n),l=`gh release download ${a||""} --repo ${t}/${e} --pattern ${n} --dir ${r}`;try{if(!Re())throw new Error('You need to authenticate in GitHub via CLI with "gh auth login"');const{stderr:u}=await s(l);if(u){console.error(`stderr: ${u}`);return}console.log(`File downloaded successfully to ${i}`),o&&(await Tt(i,c),console.log(`File renamed successfully to ${c}`))}catch(u){console.error(`Error: ${u.message}`)}},ze=({name:t,URL:e,imgURL:r})=>r?`[](${e})`:`[${t}](${e})`,ba=t=>{let e="";for(let r=0;r<t.length;r++)e+=ze(t[r]),r!==t.length-1&&(e+=`
`);return e},va=oo,xa=t=>{const{path:e,style:r="flat",host:n="https://img.shields.io",...o}=t;if(!e)throw new Error('The "path" parameter is required to create a badge URL.');const a=fe(n,e),s=new URLSearchParams({style:r});for(const[i,c]of Object.entries(o))c&&s.append(i,c.toString());return`${a}?${s.toString()}`},Oe=so().use(no).use(ao),Fa=t=>Oe.parse(t),Ca=t=>Oe.stringify(t),Aa={__proto__:null,deserialize:Fa,serialize:Ca},S=async t=>{const e=j(t);return e==="path"?await I(t,"utf-8"):e==="url"?await N(t):t},Ta=async t=>await S(t),La=async t=>await S(t),Sa=async t=>(t=await S(t),await new ut().parse(t)),Ie=async(t,e)=>{t=await S(t);const r=new ut;return r.use(eo(e?.renderer,e?.highlight)),await r.parse(t)},Me=async t=>(t=await S(t),new ro().turndown(t)),Pa=async t=>(t=await S(t),t=await Me(t),await Ie(t)),Da=t=>{const e=t.split(`
`);let r=!1;return e.map(n=>{if(n.startsWith("```"))return r=!r,n;if(r)return n;if(/^(#{1,6})\s/.test(n)){const o=n.match(/^(#{1,6})\s/);if(o){const a=o[1];if(a.length<6){const s="#".repeat(a.length+1);return n.replace(a,s)}}}return n}).join(`
`)},ke=async t=>{t=await S(t);const e=new ut().lexer(t),r=[];return e.forEach(n=>{if(n.type==="heading"){const o=n.depth,a=n.text,s=a.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"");r.push({level:o,title:a,anchor:s})}}),r},ja=async t=>{let e,r;const{title:n,input:o,removeH1:a,maxHeadingLevel:s}=t;r=n?`## ${n}
`:"";const i=await ke(o),c=a?i.filter(m=>m.level!==1):i,l=s??6,u=c.filter(m=>m.level<=l);return e=1,u.length&&u[0].level>1&&(e=u[0].level),u.forEach((m,y)=>{const g=y>0&&m.level>e?" ".repeat(m.level-e):"";r+=`${g}- [${m.title}](#${m.anchor})
`}),r},Na=async(t,e)=>new Promise(r=>{io.generate(t,e,n=>r(n))}),Be=async(t,e)=>{const r=await yt(`https://registry.npmjs.org/${t.toLowerCase()}`);return r.versions[e?.version?e.version:r["dist-tags"].latest]},Ra=async t=>{const{version:e}=await Be(t);return e},Ue=async t=>{try{const e=await fetch(t);return Buffer.from(await e.arrayBuffer())}catch(e){throw new Error(`Error fetching ghaphic from URL: ${e.message}`)}},_e=async t=>{if(typeof t=="string"){const e=j(t);return e==="url"?await Ue(t):e==="path"?await I(t):Buffer.from(t,"utf-8")}else{if(t instanceof URL)return await Ue(t);if(Buffer.isBuffer(t))return t}throw new Error(`Invalid input type: ${typeof t}`)},za=async(t,e=6)=>{try{const r=await _e(t);return new Promise((n,o)=>{const a=new co;(s=>{a.parse(s,(i,c)=>{if(i)return o(i);const l=[];for(let m=0;m<c.data.length;m+=4){const y=c.data[m],g=c.data[m+1],w=c.data[m+2];c.data[m+3]>0&&l.push([y,g,w])}const u=lo(l,e).palette().map(([m,y,g])=>`#${(1<<24|m<<16|y<<8|g).toString(16).slice(1)}`);n(u)})})(r)})}catch(r){throw new Error(`Error getting media Palette: ${r instanceof Error?r.message:r}`)}};export{ae as RunLocalNodeBinError,ne as TypedError,Et as ValidateError,ia as Validation,yo as align,pn as animate,Mo as arePathsEqual,wo as asciiFont,W as box,jn as cache,jo as cancel,An as capitalize,x as catchError,tn as catchExecOutput,uo as chroma,d as color,mo as colorConversion,Ht as columns,Vo as copyDir,oe as copyFile,va as createBadgeSVG,xa as createBadgeURL,mn as createCli,re as createDir,ze as createMdLink,ba as createMdLinks,ta as createMergeDataFn,Ho as createSymlink,na as createValidateSchema,oa as createValidateSchemaFn,Vn as csv,On as decompressFile,vn as delay,So as deprecatedAlerts,sa as deserializeValidation,$a as downloadGitHubPath,Ea as downloadGitHubRelease,pt as ensureDir,Ko as exec,se as execChild,en as execModulePath,rn as execModulePathWithOutput,Qo as execProcess,G as existsDir,M as existsFile,ie as existsLocalBin,on as existsLocalBins,ln as existsOptions,k as existsPath,N as fetch2string,Se as formatValidationError,ja as geMDTocString,Zt as getAbsolutePath,zn as getArch,an as getArrayFlagValue,Xt as getBaseName,sn as getBooleanFlagValue,X as getCharsAndWords,kn as getCharsAndWordsFrom,$e as getCharsAndWordsFromContent,ge as getCharsAndWordsFromPaths,ye as getCharsAndWordsFromUrl,nn as getChoiceFlagValue,cn as getCmd,we as getCountFromPaths,de as getCurrentDateTime,xn as getCurrentDateTimeString,Bo as getCurrentDir,V as getDirName,Un as getDirTree,mt as getExtName,q as getFileText,ko as getFilteredFileNames,La as getHTML,Yo as getLocalNodeBinPath,qo as getLocalPkgPath,Ta as getMD,ke as getMDToc,Tn as getMatch,_e as getMediaInput,za as getMediaPalette,ht as getModulePath,$t as getObjectFrom,Y as getObjectFromCSVContent,be as getObjectFromCSVFile,et as getObjectFromContent,gt as getObjectFromFile,Z as getObjectFromINIContent,ve as getObjectFromINIFile,Fe as getObjectFromJSContent,xe as getObjectFromJSFile,B as getObjectFromJSONContent,Ce as getObjectFromJSONFile,ea as getObjectFromNonCheckFile,ra as getObjectFromPath,K as getObjectFromTOMLContent,Ae as getObjectFromTOMLFile,yt as getObjectFromUrl,Q as getObjectFromXMLContent,Te as getObjectFromXMLFile,tt as getObjectFromYAMLContent,Le as getObjectFromYAMLFile,Be as getPKG,Ra as getPKGVersion,H as getPaths,Io as getPathsStream,Ee as getPathsStructure,_n as getPathsTree,Rn as getPlatform,ce as getStringFlagValue,Pn as getStringFrom,j as getStringType,Dn as getStringsFrom,Nn as getTempDir,fo as gradient,un as hideBin,po as highlight,Me as html2md,Pa as html2terminal,ho as icon,Da as incrementMdHeaders,Cn as indent,Gn as ini,qt as isAbsolutePath,$o as isBrowser,Fo as isBun,xo as isDeno,To as isDev,ee as isDirectory,Re as isGitHubAuthenticated,vo as isJsDom,Eo as isNode,Yt as isPath,bo as isWebWorker,b as joinPath,fe as joinUrl,Xn as json,No as line,go as link,Jo as localStorage,$n as logger,Aa as md,Sa as md2html,Ie as md2terminal,zo as normalizePath,Sn as object2string,Do as onCancel,Gt as onConsole,Po as onExit,Jt as onStd,Go as open,Xo as openApp,bn as performance,ue as promptGroup,ft as promptLine,pe as promptLineCore,gn as promptLineEnquirer,yn as promptLineGroup,Na as qrcode,J as readDir,I as readFile,Ro as relativePath,Kt as removeDir,Qt as removeDirIfExist,_o as removeFile,te as removeFileIfExist,Uo as removePathIfExist,Ao as replaceConsole,Fn as replacePlaceholders,Co as replaceStd,P as resolvePath,Lo as rmDeprecationAlerts,Zo as runLocalNodeBin,ua as schema2object,Pe as schema2ts,pa as schema2type,la as schema2zod,aa as serializeValidation,wt as setDirTree,En as spinner,qn as svg,Vt as table,Yn as toml,ma as ts2schema,rt as validate,$ as validateHomeDir,fa as validateSchema,Oo as writeFile,Wo as writeFileContent,Kn as xml,Qn as yaml,In as zipFile,Mn as zipFilesInDirectory,ca as zod2schema};