@stacksjs/dtsx 0.9.5 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/cli.js CHANGED
@@ -1,9 +1,23 @@
1
1
  // @bun
2
- import{r as _}from"../chunk-mjstdqy6.js";import{resolve as b}from"path";import G from"process";import{EventEmitter as T}from"events";function x(t){return t==null?[]:Array.isArray(t)?t:[t]}function M(t,e,s,n){var i,o=t[e],l=~n.string.indexOf(e)?s==null||s===!0?"":String(s):typeof s==="boolean"?s:~n.boolean.indexOf(e)?s==="false"?!1:s==="true"||(t._.push((i=+s,i*0===0)?i:s),!!s):(i=+s,i*0===0)?i:s;t[e]=o==null?l:Array.isArray(o)?o.concat(l):[o,l]}function V(t,e){t=t||[],e=e||{};var s,n,i,o,l,c={_:[]},r=0,a=0,u=0,h=t.length;let d=e.alias!==void 0,y=e.unknown!==void 0,v=e.default!==void 0;if(e.alias=e.alias||{},e.string=x(e.string),e.boolean=x(e.boolean),d)for(s in e.alias){n=e.alias[s]=x(e.alias[s]);for(r=0;r<n.length;r++)(e.alias[n[r]]=n.concat(s)).splice(r,1)}for(r=e.boolean.length;r-- >0;){n=e.alias[e.boolean[r]]||[];for(a=n.length;a-- >0;)e.boolean.push(n[a])}for(r=e.string.length;r-- >0;){n=e.alias[e.string[r]]||[];for(a=n.length;a-- >0;)e.string.push(n[a])}if(v){for(s in e.default)if(o=typeof e.default[s],n=e.alias[s]=e.alias[s]||[],e[o]!==void 0){e[o].push(s);for(r=0;r<n.length;r++)e[o].push(n[r])}}let j=y?Object.keys(e.alias):[];for(r=0;r<h;r++){if(i=t[r],i==="--"){c._=c._.concat(t.slice(++r));break}for(a=0;a<i.length;a++)if(i.charCodeAt(a)!==45)break;if(a===0)c._.push(i);else if(i.substring(a,a+3)==="no-"){if(o=i.substring(a+3),y&&!~j.indexOf(o))return e.unknown(i);c[o]=!1}else{for(u=a+1;u<i.length;u++)if(i.charCodeAt(u)===61)break;o=i.substring(a,u),l=i.substring(++u)||(r+1===h||(""+t[r+1]).charCodeAt(0)===45||t[++r]),n=a===2?[o]:o;for(u=0;u<n.length;u++){if(o=n[u],y&&!~j.indexOf(o))return e.unknown("-".repeat(a)+o);M(c,o,u+1<n.length||l,e)}}}if(v){for(s in e.default)if(c[s]===void 0)c[s]=e.default[s]}if(d)for(s in c){n=e.alias[s]||[];while(n.length>0)c[n.shift()]=c[s]}return c}var D=(t)=>t.replace(/[<[].+/,"").trim(),P=(t)=>{let e=/<([^>]+)>/g,s=/\[([^\]]+)\]/g,n=[],i=(c)=>{let r=!1,a=c[1];if(a.startsWith("..."))a=a.slice(3),r=!0;return{required:c[0].startsWith("<"),value:a,variadic:r}},o;while(o=e.exec(t))n.push(i(o));let l;while(l=s.exec(t))n.push(i(l));return n},B=(t)=>{let e={alias:{},boolean:[]};for(let[s,n]of t.entries()){if(n.names.length>1)e.alias[n.names[0]]=n.names.slice(1);if(n.isBoolean)if(n.negated){if(!t.some((o,l)=>{return l!==s&&o.names.some((c)=>n.names.includes(c))&&typeof o.required==="boolean"}))e.boolean.push(n.names[0])}else e.boolean.push(n.names[0])}return e},$=(t)=>{return t.sort((e,s)=>{return e.length>s.length?-1:1})[0]},A=(t,e)=>{return t.length>=e?t:`${t}${" ".repeat(e-t.length)}`},q=(t)=>{return t.replace(/([a-z])-([a-z])/g,(e,s,n)=>{return s+n.toUpperCase()})},I=(t,e,s)=>{let n=0,i=e.length,o=t,l;for(;n<i;++n)l=o[e[n]],o=o[e[n]]=n===i-1?s:l!=null?l:!!~e[n+1].indexOf(".")||!(+e[n+1]>-1)?{}:[]},S=(t,e)=>{for(let s of Object.keys(e)){let n=e[s];if(n.shouldTransform){if(t[s]=Array.prototype.concat.call([],t[s]),typeof n.transformFunction==="function")t[s]=t[s].map(n.transformFunction)}}},R=(t)=>{let e=/([^\\\/]+)$/.exec(t);return e?e[1]:""},E=(t)=>{return t.split(".").map((e,s)=>{return s===0?q(e):e}).join(".")};class g extends Error{constructor(t){super(t);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=new Error(t).stack}}class N{constructor(t,e,s){if(this.rawName=t,this.description=e,this.config=Object.assign({},s),t=t.replace(/\.\*/g,""),this.negated=!1,this.names=D(t).split(",").map((n)=>{let i=n.trim().replace(/^-{1,2}/,"");if(i.startsWith("no-"))this.negated=!0,i=i.replace(/^no-/,"");return E(i)}).sort((n,i)=>n.length>i.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(t.includes("<"))this.required=!0;else if(t.includes("["))this.required=!1;else this.isBoolean=!0}}var U=process.argv,H=`${process.platform}-${process.arch} node-${process.version}`;class k{constructor(t,e,s={},n){this.rawName=t,this.description=e,this.config=s,this.cli=n,this.options=[],this.aliasNames=[],this.name=D(t),this.args=P(t),this.examples=[]}usage(t){return this.usageText=t,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(t,e="-v, --version"){return this.versionNumber=t,this.option(e,"Display version number"),this}example(t){return this.examples.push(t),this}option(t,e,s){let n=new N(t,e,s);return this.options.push(n),this}alias(t){return this.aliasNames.push(t),this}action(t){return this.commandAction=t,this}isMatched(t){return this.name===t||this.aliasNames.includes(t)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof C}hasOption(t){return t=t.split(".")[0],this.options.find((e)=>{return e.names.includes(t)})}outputHelp(){let{name:t,commands:e}=this.cli,{versionNumber:s,options:n,helpCallback:i}=this.cli.globalCommand,o=[{body:`${t}${s?`/${s}`:""}`}];if(o.push({title:"Usage",body:` $ ${t} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&e.length>0){let r=$(e.map((a)=>a.rawName));o.push({title:"Commands",body:e.map((a)=>{return` ${A(a.rawName,r.length)} ${a.description}`}).join(`
3
- `)}),o.push({title:"For more info, run any command with the `--help` flag",body:e.map((a)=>` $ ${t}${a.name===""?"":` ${a.name}`} --help`).join(`
4
- `)})}let c=this.isGlobalCommand?n:[...this.options,...n||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand)c=c.filter((r)=>r.name!=="version");if(c.length>0){let r=$(c.map((a)=>a.rawName));o.push({title:"Options",body:c.map((a)=>{return` ${A(a.rawName,r.length)} ${a.description} ${a.config.default===void 0?"":`(default: ${a.config.default})`}`}).join(`
5
- `)})}if(this.examples.length>0)o.push({title:"Examples",body:this.examples.map((r)=>{if(typeof r==="function")return r(t);return r}).join(`
6
- `)});if(i)o=i(o)||o;console.log(o.map((r)=>{return r.title?`${r.title}:
7
- ${r.body}`:r.body}).join(`
2
+ import{r as W0}from"../chunk-qsyn1k3w.js";import{resolve as y}from"path";import L0 from"process";import{EventEmitter as I0}from"events";import t from"process";import m from"process";import C from"process";import g0,{stdin as CZ,stdout as bZ}from"process";import Q0,{stdin as u0,stdout as m0}from"process";import x0 from"readline";var{create:M0,getPrototypeOf:N0,defineProperty:e,getOwnPropertyNames:O0}=Object,w0=Object.prototype.hasOwnProperty,L=(Z,$,Q)=>{Q=Z!=null?M0(N0(Z)):{};let z=$||!Z||!Z.__esModule?e(Q,"default",{value:Z,enumerable:!0}):Q;for(let J of O0(Z))if(!w0.call(z,J))e(z,J,{get:()=>Z[J],enumerable:!0});return z},x=(Z,$)=>()=>($||Z(($={exports:{}}).exports,$),$.exports),B0=x((Z,$)=>{function Q(J){return J==null?[]:Array.isArray(J)?J:[J]}function z(J,Y,X,j){var q,G=J[Y],U=~j.string.indexOf(Y)?X==null||X===!0?"":String(X):typeof X==="boolean"?X:~j.boolean.indexOf(Y)?X==="false"?!1:X==="true"||(J._.push((q=+X,q*0===0)?q:X),!!X):(q=+X,q*0===0)?q:X;J[Y]=G==null?U:Array.isArray(G)?G.concat(U):[G,U]}$.exports=function(J,Y){J=J||[],Y=Y||{};var X,j,q,G,U,F={_:[]},K=0,H=0,V=0,T=J.length;let f=Y.alias!==void 0,S=Y.unknown!==void 0,r=Y.default!==void 0;if(Y.alias=Y.alias||{},Y.string=Q(Y.string),Y.boolean=Q(Y.boolean),f)for(X in Y.alias){j=Y.alias[X]=Q(Y.alias[X]);for(K=0;K<j.length;K++)(Y.alias[j[K]]=j.concat(X)).splice(K,1)}for(K=Y.boolean.length;K-- >0;){j=Y.alias[Y.boolean[K]]||[];for(H=j.length;H-- >0;)Y.boolean.push(j[H])}for(K=Y.string.length;K-- >0;){j=Y.alias[Y.string[K]]||[];for(H=j.length;H-- >0;)Y.string.push(j[H])}if(r){for(X in Y.default)if(G=typeof Y.default[X],j=Y.alias[X]=Y.alias[X]||[],Y[G]!==void 0){Y[G].push(X);for(K=0;K<j.length;K++)Y[G].push(j[K])}}let s=S?Object.keys(Y.alias):[];for(K=0;K<T;K++){if(q=J[K],q==="--"){F._=F._.concat(J.slice(++K));break}for(H=0;H<q.length;H++)if(q.charCodeAt(H)!==45)break;if(H===0)F._.push(q);else if(q.substring(H,H+3)==="no-"){if(G=q.substring(H+3),S&&!~s.indexOf(G))return Y.unknown(q);F[G]=!1}else{for(V=H+1;V<q.length;V++)if(q.charCodeAt(V)===61)break;G=q.substring(H,V),U=q.substring(++V)||(K+1===T||(""+J[K+1]).charCodeAt(0)===45||J[++K]),j=H===2?[G]:G;for(V=0;V<j.length;V++){if(G=j[V],S&&!~s.indexOf(G))return Y.unknown("-".repeat(H)+G);z(F,G,V+1<j.length||U,Y)}}}if(r){for(X in Y.default)if(F[X]===void 0)F[X]=Y.default[X]}if(f)for(X in F){j=Y.alias[X]||[];while(j.length>0)F[j.shift()]=F[X]}return F}}),N=x((Z,$)=>{var Q=process||{},z=Q.argv||[],J=Q.env||{},Y=!(!!J.NO_COLOR||z.includes("--no-color"))&&(!!J.FORCE_COLOR||z.includes("--color")||Q.platform==="win32"||(Q.stdout||{}).isTTY&&J.TERM!=="dumb"||!!J.CI),X=(G,U,F=G)=>(K)=>{let H=""+K,V=H.indexOf(U,G.length);return~V?G+j(H,U,F,V)+U:G+H+U},j=(G,U,F,K)=>{let H="",V=0;do H+=G.substring(V,K)+F,V=K+U.length,K=G.indexOf(U,V);while(~K);return H+G.substring(V)},q=(G=Y)=>{let U=G?X:()=>String;return{isColorSupported:G,reset:U("\x1B[0m","\x1B[0m"),bold:U("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:U("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:U("\x1B[3m","\x1B[23m"),underline:U("\x1B[4m","\x1B[24m"),inverse:U("\x1B[7m","\x1B[27m"),hidden:U("\x1B[8m","\x1B[28m"),strikethrough:U("\x1B[9m","\x1B[29m"),black:U("\x1B[30m","\x1B[39m"),red:U("\x1B[31m","\x1B[39m"),green:U("\x1B[32m","\x1B[39m"),yellow:U("\x1B[33m","\x1B[39m"),blue:U("\x1B[34m","\x1B[39m"),magenta:U("\x1B[35m","\x1B[39m"),cyan:U("\x1B[36m","\x1B[39m"),white:U("\x1B[37m","\x1B[39m"),gray:U("\x1B[90m","\x1B[39m"),bgBlack:U("\x1B[40m","\x1B[49m"),bgRed:U("\x1B[41m","\x1B[49m"),bgGreen:U("\x1B[42m","\x1B[49m"),bgYellow:U("\x1B[43m","\x1B[49m"),bgBlue:U("\x1B[44m","\x1B[49m"),bgMagenta:U("\x1B[45m","\x1B[49m"),bgCyan:U("\x1B[46m","\x1B[49m"),bgWhite:U("\x1B[47m","\x1B[49m"),blackBright:U("\x1B[90m","\x1B[39m"),redBright:U("\x1B[91m","\x1B[39m"),greenBright:U("\x1B[92m","\x1B[39m"),yellowBright:U("\x1B[93m","\x1B[39m"),blueBright:U("\x1B[94m","\x1B[39m"),magentaBright:U("\x1B[95m","\x1B[39m"),cyanBright:U("\x1B[96m","\x1B[39m"),whiteBright:U("\x1B[97m","\x1B[39m"),bgBlackBright:U("\x1B[100m","\x1B[49m"),bgRedBright:U("\x1B[101m","\x1B[49m"),bgGreenBright:U("\x1B[102m","\x1B[49m"),bgYellowBright:U("\x1B[103m","\x1B[49m"),bgBlueBright:U("\x1B[104m","\x1B[49m"),bgMagentaBright:U("\x1B[105m","\x1B[49m"),bgCyanBright:U("\x1B[106m","\x1B[49m"),bgWhiteBright:U("\x1B[107m","\x1B[49m")}};$.exports=q(),$.exports.createColors=q}),T0=x((Z,$)=>{$.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}}),P0=L(B0(),1);function G0(Z){return Z.replace(/[<[].+/,"").trim()}function R0(Z){let $=/<([^>]+)>/g,Q=/\[([^\]]+)\]/g,z=[],J=(j)=>{let q=!1,G=j[1];if(G.startsWith("..."))G=G.slice(3),q=!0;return{required:j[0].startsWith("<"),value:G,variadic:q}},Y;while(Y=$.exec(Z))z.push(J(Y));let X;while(X=Q.exec(Z))z.push(J(X));return z}function E0(Z){let $={alias:{},boolean:[]};for(let[Q,z]of Z.entries()){if(z.names.length>1)$.alias[z.names[0]]=z.names.slice(1);if(z.isBoolean)if(z.negated){if(!Z.some((Y,X)=>{return X!==Q&&Y.names.some((j)=>z.names.includes(j))&&typeof Y.required==="boolean"}))$.boolean.push(z.names[0])}else $.boolean.push(z.names[0])}return $}function o(Z){return Z.sort(($,Q)=>{return $.length>Q.length?-1:1})[0]}function Z0(Z,$){return Z.length>=$?Z:`${Z}${" ".repeat($-Z.length)}`}function k0(Z){return Z.replace(/([a-z])-([a-z])/g,($,Q,z)=>{return Q+z.toUpperCase()})}function C0(Z,$,Q){let z=0,J=$.length,Y=Z,X;for(;z<J;++z)X=Y[$[z]],Y=Y[$[z]]=z===J-1?Q:X!=null?X:!!~$[z+1].indexOf(".")||!(+$[z+1]>-1)?{}:[]}function b0(Z,$){for(let Q of Object.keys($)){let z=$[Q];if(z.shouldTransform){if(Z[Q]=Array.prototype.concat.call([],Z[Q]),typeof z.transformFunction==="function")Z[Q]=Z[Q].map(z.transformFunction)}}}function A0(Z){let $=/([^\\/]+)$/.exec(Z);return $?$[1]:""}function q0(Z){return Z.split(".").map(($,Q)=>{return Q===0?k0($):$}).join(".")}class k extends Error{constructor(Z){super(Z);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(Z).stack}}function h0(){let{env:Z}=t,{TERM:$,TERM_PROGRAM:Q}=Z;if(t.platform!=="win32")return $!=="linux";return Boolean(Z.WT_SESSION)||Boolean(Z.TERMINUS_SUBLIME)||Z.ConEmuTask==="{cmd::Cmder}"||Q==="Terminus-Sublime"||Q==="vscode"||$==="xterm-256color"||$==="alacritty"||$==="rxvt-unicode"||$==="rxvt-unicode-256color"||Z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var A="\x1B",M=`${A}[`;var w={to(Z,$){if(!$)return`${M}${Z+1}G`;return`${M}${$+1};${Z+1}H`},move(Z,$){let Q="";if(Z<0)Q+=`${M}${-Z}D`;else if(Z>0)Q+=`${M}${Z}C`;if($<0)Q+=`${M}${-$}A`;else if($>0)Q+=`${M}${$}B`;return Q},up:(Z=1)=>`${M}${Z}A`,down:(Z=1)=>`${M}${Z}B`,forward:(Z=1)=>`${M}${Z}C`,backward:(Z=1)=>`${M}${Z}D`,nextLine:(Z=1)=>`${M}E`.repeat(Z),prevLine:(Z=1)=>`${M}F`.repeat(Z),left:`${M}G`,hide:`${M}?25l`,show:`${M}?25h`,save:`${A}7`,restore:`${A}8`};var g={screen:`${M}2J`,up:(Z=1)=>`${M}1J`.repeat(Z),down:(Z=1)=>`${M}J`.repeat(Z),line:`${M}2K`,lineEnd:`${M}K`,lineStart:`${M}1K`,lines(Z){let $="";for(let Q=0;Q<Z;Q++)$+=this.line+(Q<Z-1?w.up():"");if(Z)$+=w.left;return $}},TZ={screen:`${A}c`};class F0{rawName;description;name;names;isBoolean;required;config;negated;constructor(Z,$,Q){if(this.rawName=Z,this.description=$,this.config=Object.assign({},Q),Z=Z.replace(/\.\*/g,""),this.negated=!1,this.names=G0(Z).split(",").map((z)=>{let J=z.trim().replace(/^-{1,2}/,"");if(J.startsWith("no-"))this.negated=!0,J=J.replace(/^no-/,"");return q0(J)}).sort((z,J)=>z.length>J.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(Z.includes("<"))this.required=!0;else if(Z.includes("["))this.required=!1;else this.isBoolean=!0}}var IZ=m.argv,v0=`${m.platform}-${m.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,y0=C.argv,f0=`${C.platform}-${C.arch} node-${C.version}`;class l{rawName;description;config;cli;options;aliasNames;name;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;constructor(Z,$,Q,z){if(this.rawName=Z,this.description=$,this.config=Q,this.cli=z,this.options=[],this.aliasNames=[],this.name=G0(Z),this.args=R0(Z),this.examples=[],!Q)this.config={}}usage(Z){return this.usageText=Z,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(Z,$="-v, --version"){return this.versionNumber=Z,this.option($,"Display version number"),this}example(Z){return this.examples.push(Z),this}option(Z,$,Q){let z=new F0(Z,$,Q);return this.options.push(z),this}alias(Z){return this.aliasNames.push(Z),this}action(Z){return this.commandAction=Z,this}isMatched(Z){return this.name===Z||this.aliasNames.includes(Z)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof n}hasOption(Z){return Z=Z.split(".")[0],!!this.options.find(($)=>{return $.names.includes(Z)})}outputHelp(){let{name:Z,commands:$}=this.cli,{versionNumber:Q,options:z,helpCallback:J}=this.cli.globalCommand,Y=[{body:`${Z}${Q?`/${Q}`:""}`}];if(Y.push({title:"Usage",body:` $ ${Z} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&$.length>0){let q=o($.map((G)=>G.rawName));Y.push({title:"Commands",body:$.map((G)=>{return` ${Z0(G.rawName,q.length)} ${G.description}`}).join(`
3
+ `)}),Y.push({title:"For more info, run any command with the `--help` flag",body:$.map((G)=>` $ ${Z}${G.name===""?"":` ${G.name}`} --help`).join(`
4
+ `)})}let j=this.isGlobalCommand?z:[...this.options,...z||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand)j=j.filter((q)=>q.name!=="version");if(j.length>0){let q=o(j.map((G)=>G.rawName));Y.push({title:"Options",body:j.map((G)=>{return` ${Z0(G.rawName,q.length)} ${G.description} ${G.config.default===void 0?"":`(default: ${G.config.default})`}`}).join(`
5
+ `)})}if(this.examples.length>0)Y.push({title:"Examples",body:this.examples.map((q)=>{if(typeof q==="function")return q(Z);return q}).join(`
6
+ `)});if(J)Y=J(Y)||Y;console.log(Y.map((q)=>{return q.title?`${q.title}:
7
+ ${q.body}`:q.body}).join(`
8
8
 
9
- `))}outputVersion(){let{name:t}=this.cli,{versionNumber:e}=this.cli.globalCommand;if(e)console.log(`${t}/${e} ${H}`)}checkRequiredArgs(){let t=this.args.filter((e)=>e.required).length;if(this.cli.args.length<t)throw new g(`missing required args for command \`${this.rawName}\``)}checkUnknownOptions(){let{options:t,globalCommand:e}=this.cli;if(!this.config.allowUnknownOptions){for(let s of Object.keys(t))if(s!=="--"&&!this.hasOption(s)&&!e.hasOption(s))throw new g(`Unknown option \`${s.length>1?`--${s}`:`-${s}`}\``)}}checkOptionValue(){let{options:t,globalCommand:e}=this.cli,s=[...e.options,...this.options];for(let n of s){let i=t[n.name.split(".")[0]];if(n.required){let o=s.some((l)=>l.negated&&l.names.includes(n.name));if(i===!0||i===!1&&!o)throw new g(`option \`${n.rawName}\` value is missing`)}}}}class C extends k{constructor(t){super("@@global@@","",{},t)}}var p=Object.assign;class w extends T{constructor(t=""){super();this.name=t,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new C(this),this.globalCommand.usage("<command> [options]")}usage(t){return this.globalCommand.usage(t),this}command(t,e,s){let n=new k(t,e||"",s,this);return n.globalCommand=this.globalCommand,this.commands.push(n),n}option(t,e,s){return this.globalCommand.option(t,e,s),this}help(t){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=t,this.showHelpOnExit=!0,this}version(t,e="-v, --version"){return this.globalCommand.version(t,e),this.showVersionOnExit=!0,this}example(t){return this.globalCommand.example(t),this}outputHelp(){if(this.matchedCommand)this.matchedCommand.outputHelp();else this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:t,options:e},s,n){if(this.args=t,this.options=e,s)this.matchedCommand=s;if(n)this.matchedCommandName=n;return this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}parse(t=U,{run:e=!0}={}){if(this.rawArgs=t,!this.name)this.name=t[1]?R(t[1]):"cli";let s=!0;for(let i of this.commands){let o=this.mri(t.slice(2),i),l=o.args[0];if(i.isMatched(l)){s=!1;let c=p(p({},o),{args:o.args.slice(1)});this.setParsedInfo(c,i,l),this.emit(`command:${l}`,i)}}if(s){for(let i of this.commands)if(i.name===""){s=!1;let o=this.mri(t.slice(2),i);this.setParsedInfo(o,i),this.emit("command:!",i)}}if(s){let i=this.mri(t.slice(2));this.setParsedInfo(i)}if(this.options.help&&this.showHelpOnExit)this.outputHelp(),e=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),e=!1,this.unsetMatchedCommand();let n={args:this.args,options:this.options};if(e)this.runMatchedCommand();if(!this.matchedCommand&&this.args[0])this.emit("command:*");return n}mri(t,e){let s=[...this.globalCommand.options,...e?e.options:[]],n=B(s),i=[],o=t.indexOf("--");if(o>-1)i=t.slice(o+1),t=t.slice(0,o);let l=V(t,n);l=Object.keys(l).reduce((h,d)=>{return p(p({},h),{[E(d)]:l[d]})},{_:[]});let c=l._,r={"--":i},a=e&&e.config.ignoreOptionDefaultValue?e.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,u=Object.create(null);for(let h of s){if(!a&&h.config.default!==void 0)for(let d of h.names)r[d]=h.config.default;if(Array.isArray(h.config.type)){if(u[h.name]===void 0)u[h.name]=Object.create(null),u[h.name].shouldTransform=!0,u[h.name].transformFunction=h.config.type[0]}}for(let h of Object.keys(l))if(h!=="_"){let d=h.split(".");I(r,d,l[h]),S(r,u)}return{args:c,options:r}}runMatchedCommand(){let{args:t,options:e,matchedCommand:s}=this;if(!s||!s.commandAction)return;s.checkUnknownOptions(),s.checkOptionValue(),s.checkRequiredArgs();let n=[];return s.args.forEach((i,o)=>{if(i.variadic)n.push(t.slice(o));else n.push(t[o])}),n.push(e),s.commandAction.apply(this,n)}}var O="0.9.5";var f=new w("dtsx"),m={cwd:G.cwd(),root:"./src",entrypoints:["**/*.ts"],outdir:"./dist",keepComments:!0,clean:!1,tsconfigPath:"tsconfig.json",verbose:!1};f.command("generate","Generate TypeScript declaration files").option("--cwd <path>","Current working directory",{default:m.cwd}).option("--root <path>","Root directory of the project",{default:m.root}).option("--entrypoints <files>","Entry point files (comma-separated)",{default:m.entrypoints?.join(","),type:[String]}).option("--outdir <path>","Output directory for generated .d.ts files",{default:m.outdir}).option("--keep-comments","Keep comments in generated .d.ts files",{default:m.keepComments}).option("--clean","Clean output directory before generation",{default:m.clean}).option("--tsconfig <path>","Path to tsconfig.json",{default:m.tsconfigPath}).option("--verbose","Enable verbose logging",{default:m.verbose}).example("dtsx generate").example("dtsx generate --entrypoints src/index.ts,src/utils.ts --outdir dist/types").action(async(t)=>{try{let e={entrypoints:t.entrypoints?t.entrypoints:m.entrypoints,cwd:b(t.cwd||m.cwd),root:b(t.root||m.root),outdir:b(t.outdir||m.outdir),tsconfigPath:b(t.tsconfigPath||m.tsconfigPath),keepComments:t.keepComments||m.keepComments,clean:t.clean||m.clean,verbose:t.verbose||m.verbose};await _(e)}catch(e){console.error("Error generating .d.ts files:",e),G.exit(1)}});f.command("version","Show the version of dtsx").action(()=>{console.log(O)});f.version(O);f.help();f.parse();
9
+ `))}outputVersion(){let{name:Z}=this.cli,{versionNumber:$}=this.cli.globalCommand;if($){let Q;if(Bun)Q=v0;else Q=f0;console.log(`${Z}/${$} ${Q}`)}}checkRequiredArgs(){let Z=this.args.filter(($)=>$.required).length;if(this.cli.args.length<Z)throw new k(`missing required args for command \`${this.rawName}\``)}checkUnknownOptions(){let{options:Z,globalCommand:$}=this.cli;if(!this.config.allowUnknownOptions){for(let Q of Object.keys(Z))if(Q!=="--"&&!this.hasOption(Q)&&!$.hasOption(Q))throw new k(`Unknown option \`${Q.length>1?`--${Q}`:`-${Q}`}\``)}}checkOptionValue(){let{options:Z,globalCommand:$}=this.cli,Q=[...$.options,...this.options];for(let z of Q){let J=Z[z.name.split(".")[0]];if(z.required){let Y=Q.some((X)=>X.negated&&X.names.includes(z.name));if(J===!0||J===!1&&!Y)throw new k(`option \`${z.rawName}\` value is missing`)}}}}class n extends l{constructor(Z){super("@@global@@","",{},Z)}}var S0=l;class a extends I0{name;commands;globalCommand;matchedCommand;matchedCommandName;rawArgs;args;options;showHelpOnExit;showVersionOnExit;constructor(Z=""){super();this.name=Z,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new n(this),this.globalCommand.usage("<command> [options]")}usage(Z){return this.globalCommand.usage(Z),this}command(Z,$,Q){if(!Q)Q={};let z=new S0(Z,$||"",Q,this);return z.globalCommand=this.globalCommand,this.commands.push(z),z}option(Z,$,Q){return this.globalCommand.option(Z,$,Q),this}help(Z){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=Z,this.showHelpOnExit=!0,this}version(Z,$="-v, --version"){return this.globalCommand.version(Z,$),this.showVersionOnExit=!0,this}example(Z){return this.globalCommand.example(Z),this}outputHelp(){if(this.matchedCommand)this.matchedCommand.outputHelp();else this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:Z,options:$},Q,z){if(this.args=Z,this.options=$,Q)this.matchedCommand=Q;if(z)this.matchedCommandName=z;return this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}parse(Z=y0,{run:$=!0}={}){if(this.rawArgs=Z,!this.name)this.name=Z[1]?A0(Z[1]):"cli";let Q=!0;for(let J of this.commands){let Y=this.mri(Z.slice(2),J),X=Y.args[0];if(J.isMatched(X)){Q=!1;let j={...Y,args:Y.args.slice(1)};this.setParsedInfo(j,J,X),this.emit(`command:${X}`,J)}}if(Q){for(let J of this.commands)if(J.name===""){Q=!1;let Y=this.mri(Z.slice(2),J);this.setParsedInfo(Y,J),this.emit("command:!",J)}}if(Q){let J=this.mri(Z.slice(2));this.setParsedInfo(J)}if(this.options.help&&this.showHelpOnExit)this.outputHelp(),$=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),$=!1,this.unsetMatchedCommand();let z={args:this.args,options:this.options};if($)this.runMatchedCommand();if(!this.matchedCommand&&this.args[0])this.emit("command:*");return z}mri(Z,$){let Q=[...this.globalCommand.options,...$?$.options:[]],z=E0(Q),J=[],Y=Z.indexOf("--");if(Y>-1)J=Z.slice(Y+1),Z=Z.slice(0,Y);let X=P0.default(Z,z);X=Object.keys(X).reduce((F,K)=>{return{...F,[q0(K)]:X[K]}},{_:[]});let j=X._,q={"--":J},G=$&&$.config.ignoreOptionDefaultValue?$.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,U=Object.create(null);for(let F of Q){if(!G&&F.config.default!==void 0)for(let K of F.names)q[K]=F.config.default;if(Array.isArray(F.config.type)){if(U[F.name]===void 0)U[F.name]=Object.create(null),U[F.name].shouldTransform=!0,U[F.name].transformFunction=F.config.type[0]}}for(let F of Object.keys(X))if(F!=="_"){let K=F.split(".");C0(q,K,X[F]),b0(q,U)}return{args:j,options:q}}runMatchedCommand(){let{args:Z,options:$,matchedCommand:Q}=this;if(!Q||!Q.commandAction)return;Q.checkUnknownOptions(),Q.checkOptionValue(),Q.checkRequiredArgs();let z=[];return Q.args.forEach((J,Y)=>{if(J.variadic)z.push(Z.slice(Y));else z.push(Z[Y])}),z.push($),Q.commandAction.apply(this,z)}}var EZ=L(N(),1),_0=["up","down","left","right","space","enter","cancel"],b={actions:new Set(_0),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};function K0(Z,$){if(typeof Z==="string")return b.aliases.get(Z)===$;for(let Q of Z){if(Q===void 0)continue;if(K0(Q,$))return!0}return!1}function d0(Z,$){if(Z===$)return[];let Q=Z.split(`
10
+ `),z=$.split(`
11
+ `),J=[];for(let Y=0;Y<Math.max(Q.length,z.length);Y++)if(Q[Y]!==z[Y])J.push(Y);return J}var AZ=g0.platform.startsWith("win"),$0=Symbol("clapp:cancel");function E(Z,$){let Q=Z;if(Q.isTTY)Q.setRawMode($)}var _=L(N(),1);function l0({onlyFirst:Z=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",Z?void 0:"g")}var n0=l0();function H0(Z){if(typeof Z!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof Z}\``);return Z.replace(n0,"")}function a0(Z){return Z===161||Z===164||Z===167||Z===168||Z===170||Z===173||Z===174||Z>=176&&Z<=180||Z>=182&&Z<=186||Z>=188&&Z<=191||Z===198||Z===208||Z===215||Z===216||Z>=222&&Z<=225||Z===230||Z>=232&&Z<=234||Z===236||Z===237||Z===240||Z===242||Z===243||Z>=247&&Z<=250||Z===252||Z===254||Z===257||Z===273||Z===275||Z===283||Z===294||Z===295||Z===299||Z>=305&&Z<=307||Z===312||Z>=319&&Z<=322||Z===324||Z>=328&&Z<=331||Z===333||Z===338||Z===339||Z===358||Z===359||Z===363||Z===462||Z===464||Z===466||Z===468||Z===470||Z===472||Z===474||Z===476||Z===593||Z===609||Z===708||Z===711||Z>=713&&Z<=715||Z===717||Z===720||Z>=728&&Z<=731||Z===733||Z===735||Z>=768&&Z<=879||Z>=913&&Z<=929||Z>=931&&Z<=937||Z>=945&&Z<=961||Z>=963&&Z<=969||Z===1025||Z>=1040&&Z<=1103||Z===1105||Z===8208||Z>=8211&&Z<=8214||Z===8216||Z===8217||Z===8220||Z===8221||Z>=8224&&Z<=8226||Z>=8228&&Z<=8231||Z===8240||Z===8242||Z===8243||Z===8245||Z===8251||Z===8254||Z===8308||Z===8319||Z>=8321&&Z<=8324||Z===8364||Z===8451||Z===8453||Z===8457||Z===8467||Z===8470||Z===8481||Z===8482||Z===8486||Z===8491||Z===8531||Z===8532||Z>=8539&&Z<=8542||Z>=8544&&Z<=8555||Z>=8560&&Z<=8569||Z===8585||Z>=8592&&Z<=8601||Z===8632||Z===8633||Z===8658||Z===8660||Z===8679||Z===8704||Z===8706||Z===8707||Z===8711||Z===8712||Z===8715||Z===8719||Z===8721||Z===8725||Z===8730||Z>=8733&&Z<=8736||Z===8739||Z===8741||Z>=8743&&Z<=8748||Z===8750||Z>=8756&&Z<=8759||Z===8764||Z===8765||Z===8776||Z===8780||Z===8786||Z===8800||Z===8801||Z>=8804&&Z<=8807||Z===8810||Z===8811||Z===8814||Z===8815||Z===8834||Z===8835||Z===8838||Z===8839||Z===8853||Z===8857||Z===8869||Z===8895||Z===8978||Z>=9312&&Z<=9449||Z>=9451&&Z<=9547||Z>=9552&&Z<=9587||Z>=9600&&Z<=9615||Z>=9618&&Z<=9621||Z===9632||Z===9633||Z>=9635&&Z<=9641||Z===9650||Z===9651||Z===9654||Z===9655||Z===9660||Z===9661||Z===9664||Z===9665||Z>=9670&&Z<=9672||Z===9675||Z>=9678&&Z<=9681||Z>=9698&&Z<=9701||Z===9711||Z===9733||Z===9734||Z===9737||Z===9742||Z===9743||Z===9756||Z===9758||Z===9792||Z===9794||Z===9824||Z===9825||Z>=9827&&Z<=9829||Z>=9831&&Z<=9834||Z===9836||Z===9837||Z===9839||Z===9886||Z===9887||Z===9919||Z>=9926&&Z<=9933||Z>=9935&&Z<=9939||Z>=9941&&Z<=9953||Z===9955||Z===9960||Z===9961||Z>=9963&&Z<=9969||Z===9972||Z>=9974&&Z<=9977||Z===9979||Z===9980||Z===9982||Z===9983||Z===10045||Z>=10102&&Z<=10111||Z>=11094&&Z<=11097||Z>=12872&&Z<=12879||Z>=57344&&Z<=63743||Z>=65024&&Z<=65039||Z===65533||Z>=127232&&Z<=127242||Z>=127248&&Z<=127277||Z>=127280&&Z<=127337||Z>=127344&&Z<=127373||Z===127375||Z===127376||Z>=127387&&Z<=127404||Z>=917760&&Z<=917999||Z>=983040&&Z<=1048573||Z>=1048576&&Z<=1114109}function c0(Z){return Z===12288||Z>=65281&&Z<=65376||Z>=65504&&Z<=65510}function p0(Z){return Z>=4352&&Z<=4447||Z===8986||Z===8987||Z===9001||Z===9002||Z>=9193&&Z<=9196||Z===9200||Z===9203||Z===9725||Z===9726||Z===9748||Z===9749||Z>=9776&&Z<=9783||Z>=9800&&Z<=9811||Z===9855||Z>=9866&&Z<=9871||Z===9875||Z===9889||Z===9898||Z===9899||Z===9917||Z===9918||Z===9924||Z===9925||Z===9934||Z===9940||Z===9962||Z===9970||Z===9971||Z===9973||Z===9978||Z===9981||Z===9989||Z===9994||Z===9995||Z===10024||Z===10060||Z===10062||Z>=10067&&Z<=10069||Z===10071||Z>=10133&&Z<=10135||Z===10160||Z===10175||Z===11035||Z===11036||Z===11088||Z===11093||Z>=11904&&Z<=11929||Z>=11931&&Z<=12019||Z>=12032&&Z<=12245||Z>=12272&&Z<=12287||Z>=12289&&Z<=12350||Z>=12353&&Z<=12438||Z>=12441&&Z<=12543||Z>=12549&&Z<=12591||Z>=12593&&Z<=12686||Z>=12688&&Z<=12773||Z>=12783&&Z<=12830||Z>=12832&&Z<=12871||Z>=12880&&Z<=42124||Z>=42128&&Z<=42182||Z>=43360&&Z<=43388||Z>=44032&&Z<=55203||Z>=63744&&Z<=64255||Z>=65040&&Z<=65049||Z>=65072&&Z<=65106||Z>=65108&&Z<=65126||Z>=65128&&Z<=65131||Z>=94176&&Z<=94180||Z===94192||Z===94193||Z>=94208&&Z<=100343||Z>=100352&&Z<=101589||Z>=101631&&Z<=101640||Z>=110576&&Z<=110579||Z>=110581&&Z<=110587||Z===110589||Z===110590||Z>=110592&&Z<=110882||Z===110898||Z>=110928&&Z<=110930||Z===110933||Z>=110948&&Z<=110951||Z>=110960&&Z<=111355||Z>=119552&&Z<=119638||Z>=119648&&Z<=119670||Z===126980||Z===127183||Z===127374||Z>=127377&&Z<=127386||Z>=127488&&Z<=127490||Z>=127504&&Z<=127547||Z>=127552&&Z<=127560||Z===127568||Z===127569||Z>=127584&&Z<=127589||Z>=127744&&Z<=127776||Z>=127789&&Z<=127797||Z>=127799&&Z<=127868||Z>=127870&&Z<=127891||Z>=127904&&Z<=127946||Z>=127951&&Z<=127955||Z>=127968&&Z<=127984||Z===127988||Z>=127992&&Z<=128062||Z===128064||Z>=128066&&Z<=128252||Z>=128255&&Z<=128317||Z>=128331&&Z<=128334||Z>=128336&&Z<=128359||Z===128378||Z===128405||Z===128406||Z===128420||Z>=128507&&Z<=128591||Z>=128640&&Z<=128709||Z===128716||Z>=128720&&Z<=128722||Z>=128725&&Z<=128727||Z>=128732&&Z<=128735||Z===128747||Z===128748||Z>=128756&&Z<=128764||Z>=128992&&Z<=129003||Z===129008||Z>=129292&&Z<=129338||Z>=129340&&Z<=129349||Z>=129351&&Z<=129535||Z>=129648&&Z<=129660||Z>=129664&&Z<=129673||Z>=129679&&Z<=129734||Z>=129742&&Z<=129756||Z>=129759&&Z<=129769||Z>=129776&&Z<=129784||Z>=131072&&Z<=196605||Z>=196608&&Z<=262141}function i0(Z){if(!Number.isSafeInteger(Z))throw TypeError(`Expected a code point, got \`${typeof Z}\`.`)}function r0(Z,{ambiguousAsWide:$=!1}={}){if(i0(Z),c0(Z)||p0(Z)||$&&a0(Z))return 2;return 1}var s0=L(T0(),1),e0=new Intl.Segmenter,t0=/^\p{Default_Ignorable_Code_Point}$/u;function I(Z,$={}){if(typeof Z!=="string"||Z.length===0)return 0;let{ambiguousIsNarrow:Q=!0,countAnsiEscapeCodes:z=!1}=$;if(!z)Z=H0(Z);if(Z.length===0)return 0;let J=0,Y={ambiguousAsWide:!Q};for(let{segment:X}of e0.segment(Z)){let j=X.codePointAt(0);if(j<=31||j>=127&&j<=159)continue;if(j>=8203&&j<=8207||j===65279)continue;if(j>=768&&j<=879||j>=6832&&j<=6911||j>=7616&&j<=7679||j>=8400&&j<=8447||j>=65056&&j<=65071)continue;if(j>=55296&&j<=57343)continue;if(j>=65024&&j<=65039)continue;if(t0.test(X))continue;if(s0.default().test(X)){J+=2;continue}J+=r0(j,Y)}return J}var d=10,z0=(Z=0)=>($)=>`\x1B[${$+Z}m`,J0=(Z=0)=>($)=>`\x1B[${38+Z};5;${$}m`,Y0=(Z=0)=>($,Q,z)=>`\x1B[${38+Z};2;${$};${Q};${z}m`,D={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},yZ=Object.keys(D.modifier),o0=Object.keys(D.color),ZZ=Object.keys(D.bgColor),fZ=[...o0,...ZZ];function $Z(){let Z=new Map;for(let[$,Q]of Object.entries(D)){for(let[z,J]of Object.entries(Q))D[z]={open:`\x1B[${J[0]}m`,close:`\x1B[${J[1]}m`},Q[z]=D[z],Z.set(J[0],J[1]);Object.defineProperty(D,$,{value:Q,enumerable:!1})}return Object.defineProperty(D,"codes",{value:Z,enumerable:!1}),D.color.close="\x1B[39m",D.bgColor.close="\x1B[49m",D.color.ansi=z0(),D.color.ansi256=J0(),D.color.ansi16m=Y0(),D.bgColor.ansi=z0(d),D.bgColor.ansi256=J0(d),D.bgColor.ansi16m=Y0(d),Object.defineProperties(D,{rgbToAnsi256:{value:($,Q,z)=>{if($===Q&&Q===z){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(Q/255*5)+Math.round(z/255*5)},enumerable:!1},hexToRgb:{value:($)=>{let Q=/[a-f\d]{6}|[a-f\d]{3}/i.exec($.toString(16));if(!Q)return[0,0,0];let[z]=Q;if(z.length===3)z=[...z].map((Y)=>Y+Y).join("");let J=Number.parseInt(z,16);return[J>>16&255,J>>8&255,J&255]},enumerable:!1},hexToAnsi256:{value:($)=>D.rgbToAnsi256(...D.hexToRgb($)),enumerable:!1},ansi256ToAnsi:{value:($)=>{if($<8)return 30+$;if($<16)return 90+($-8);let Q,z,J;if($>=232)Q=(($-232)*10+8)/255,z=Q,J=Q;else{$-=16;let j=$%36;Q=Math.floor($/36)/5,z=Math.floor(j/6)/5,J=j%6/5}let Y=Math.max(Q,z,J)*2;if(Y===0)return 30;let X=30+(Math.round(J)<<2|Math.round(z)<<1|Math.round(Q));if(Y===2)X+=60;return X},enumerable:!1},rgbToAnsi:{value:($,Q,z)=>D.ansi256ToAnsi(D.rgbToAnsi256($,Q,z)),enumerable:!1},hexToAnsi:{value:($)=>D.ansi256ToAnsi(D.hexToAnsi256($)),enumerable:!1}}),D}var QZ=$Z(),zZ=QZ,v=new Set(["\x1B","\x9B"]),JZ=39,c="\x07",V0="[",YZ="]",D0="m",h=`${YZ}8;;`,j0=(Z)=>`${v.values().next().value}${V0}${Z}${D0}`,X0=(Z)=>`${v.values().next().value}${h}${Z}${c}`,jZ=(Z)=>Z.split(" ").map(($)=>I($)),u=(Z,$,Q)=>{let z=[...$],J=!1,Y=!1,X=I(H0(Z.at(-1)));for(let[j,q]of z.entries()){let G=I(q);if(X+G<=Q)Z[Z.length-1]+=q;else Z.push(q),X=0;if(v.has(q))J=!0,Y=z.slice(j+1,j+1+h.length).join("")===h;if(J){if(Y){if(q===c)J=!1,Y=!1}else if(q===D0)J=!1;continue}if(X+=G,X===Q&&j<z.length-1)Z.push(""),X=0}if(!X&&Z.at(-1).length>0&&Z.length>1)Z[Z.length-2]+=Z.pop()},XZ=(Z)=>{let $=Z.split(" "),Q=$.length;while(Q>0){if(I($[Q-1])>0)break;Q--}if(Q===$.length)return Z;return $.slice(0,Q).join(" ")+$.slice(Q).join("")},UZ=(Z,$,Q={})=>{if(Q.trim!==!1&&Z.trim()==="")return"";let z="",J,Y,X=jZ(Z),j=[""];for(let[F,K]of Z.split(" ").entries()){if(Q.trim!==!1)j[j.length-1]=j.at(-1).trimStart();let H=I(j.at(-1));if(F!==0){if(H>=$&&(Q.wordWrap===!1||Q.trim===!1))j.push(""),H=0;if(H>0||Q.trim===!1)j[j.length-1]+=" ",H++}if(Q.hard&&X[F]>$){let V=$-H,T=1+Math.floor((X[F]-V-1)/$);if(Math.floor((X[F]-1)/$)<T)j.push("");u(j,K,$);continue}if(H+X[F]>$&&H>0&&X[F]>0){if(Q.wordWrap===!1&&H<$){u(j,K,$);continue}j.push("")}if(H+X[F]>$&&Q.wordWrap===!1){u(j,K,$);continue}j[j.length-1]+=K}if(Q.trim!==!1)j=j.map((F)=>XZ(F));let q=j.join(`
12
+ `),G=[...q],U=0;for(let[F,K]of G.entries()){if(z+=K,v.has(K)){let{groups:V}=new RegExp(`(?:\\${V0}(?<code>\\d+)m|\\${h}(?<uri>.*)${c})`).exec(q.slice(U))||{groups:{}};if(V.code!==void 0){let T=Number.parseFloat(V.code);J=T===JZ?void 0:T}else if(V.uri!==void 0)Y=V.uri.length===0?void 0:V.uri}let H=zZ.codes.get(Number(J));if(G[F+1]===`
13
+ `){if(Y)z+=X0("");if(J&&H)z+=j0(H)}else if(K===`
14
+ `){if(J&&H)z+=j0(J);if(Y)z+=X0(Y)}U+=K.length}return z};function U0(Z,$,Q){return String(Z).normalize().replaceAll(`\r
15
+ `,`
16
+ `).split(`
17
+ `).map((z)=>UZ(z,$,Q)).join(`
18
+ `)}class p{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;_manualLine="";state="initial";error="";value;userInput="";constructor(Z,$=!0){let{input:Q=u0,output:z=m0,render:J,signal:Y,...X}=Z;this.opts=X,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=J.bind(this),this._track=$,this._abortSignal=Y,this.input=Q,this.output=z}unsubscribe(){this._subscribers.clear()}setSubscriber(Z,$){let Q=this._subscribers.get(Z)??[];Q.push($),this._subscribers.set(Z,Q)}on(Z,$){return this.setSubscriber(Z,{cb:$}),this}once(Z,$){return this.setSubscriber(Z,{cb:$,once:!0}),this}emit(Z,...$){let Q=this._subscribers.get(Z)??[],z=[];for(let J of Q)if(J.cb(...$),J.once)z.push(()=>Q.splice(Q.indexOf(J),1));for(let J of z)J();return this}prompt(){return new Promise((Z)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),Z($0);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}if(this.rl=x0.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0)this._setUserInput(this.opts.initialUserInput,!0);this.input.on("keypress",this.onKeypress),E(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(w.show),this.output.off("resize",this.render),E(this.input,!1),Z(this.value)}),this.once("cancel",()=>{this.output.write(w.show),this.output.off("resize",this.render),E(this.input,!1),Z($0)})})}_isActionKey(Z,$){return Z==="\t"}_setValue(Z){this.value=Z,this.emit("value",this.value)}_setUserInput(Z,$){if(this.userInput=Z??"",this.emit("userInput",this.userInput),$&&this._track&&this.rl)this.rl.write(this.userInput),this._cursor=this.rl.cursor}onKeypress(Z,$){if(this._track&&$.name!=="return"){if($.name&&this._isActionKey(Z,$))this.rl?.write(null,{ctrl:!0,name:"h"});this._cursor=this.rl?.cursor??0;let Q=$.name==="tab"||$.name==="escape"||$.name==="backspace"||$.name==="delete"||$.name==="enter"||$.name==="return"||$.name&&["up","down","left","right"].includes($.name);if(Z&&!Q&&Z.length===1&&Z>=" ")this._manualLine+=Z;else if($.name==="backspace"&&this._manualLine.length>0)this._manualLine=this._manualLine.slice(0,-1);let z=this._manualLine.length>=(this.rl?.line?.length||0)?this._manualLine:this.rl?.line;this._setUserInput(z)}if(this.state==="error")this.state="active",this.error="";if($?.name){if(!this._track&&b.aliases.has($.name))this.emit("cursor",b.aliases.get($.name));if(b.actions.has($.name))this.emit("cursor",$.name)}if(Z&&(Z.toLowerCase()==="y"||Z.toLowerCase()==="n"))this.emit("confirm",Z.toLowerCase()==="y");if(this.emit("key",Z?.toLowerCase(),$),$?.name==="return"){if(this.opts.validate){let Q=this.opts.validate(this.value);if(Q)this.error=Q instanceof Error?Q.message:Q,this.state="error"}if(this.state!=="error")this.state="submit"}if(K0([Z,$?.name,$?.sequence],"cancel"))this.state="cancel";if(this.state==="submit"||this.state==="cancel")this.emit("finalize");if(this.render(),this.state==="submit"||this.state==="cancel")this.close()}close(){if(this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
19
+ `),E(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.state==="cancel")setTimeout(()=>{this.unsubscribe()},10);else this.unsubscribe()}restoreCursor(){let Z=U0(this._prevFrame,Q0.stdout.columns,{hard:!0,trim:!1}).split(`
20
+ `).length-1;this.output.write(w.move(-999,Z*-1))}render(){let Z=U0(this._render(this)??"",Q0.stdout.columns,{hard:!0,trim:!1});if(Z===this._prevFrame)return;if(this.state==="initial")this.output.write(w.hide);else{let $=d0(this._prevFrame,Z);if(this.restoreCursor(),$&&$?.length===1){let Q=$[0];this.output.write(w.move(0,Q)),this.output.write(g.lines(1));let z=Z.split(`
21
+ `);this.output.write(z[Q]),this._prevFrame=Z,this.output.write(w.move(0,z.length-Q-1));return}if($&&$?.length>1){let Q=$[0];this.output.write(w.move(0,Q)),this.output.write(g.down());let J=Z.split(`
22
+ `).slice(Q);this.output.write(J.join(`
23
+ `)),this._prevFrame=Z;return}this.output.write(g.down())}if(this.output.write(Z),this.state==="initial")this.state="active";this._prevFrame=Z}}function GZ(Z,$){if(Z===void 0)return 0;if($.length===0)return 0;let z=$.findIndex((J)=>J.value===Z);return z!==-1?z:0}function qZ(Z,$){return($.label??String($.value)).toLowerCase().includes(Z.toLowerCase())}function FZ(Z,$){if(!$)return;if(Z)return $;return $[0]}class KZ extends p{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#Z=0;#Q="";#z;#$;get cursor(){return this.#Z}get userInputWithCursor(){if(!this.userInput)return _.default.inverse(_.default.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;let Z=this.userInput.slice(0,this._cursor),[$,...Q]=this.userInput.slice(this._cursor);return`${Z}${_.default.inverse($)}${Q.join("")}`}get options(){if(typeof this.#$==="function")return this.#$();return this.#$}constructor(Z){super(Z);this.#$=Z.options;let $=this.options;this.filteredOptions=[...$],this.multiple=Z.multiple===!0,this.#z=Z.filter??qZ;let Q;if(Z.initialValue&&Array.isArray(Z.initialValue))if(this.multiple)Q=Z.initialValue;else Q=Z.initialValue.slice(0,1);else if(!this.multiple&&this.options.length>0)Q=[this.options[0].value];if(Q)for(let z of Q){let J=$.findIndex((Y)=>Y.value===z);if(J!==-1)this.toggleSelected(z),this.#Z=J}this.focusedValue=this.options[this.#Z]?.value,this.on("key",(z,J)=>this.#J(z,J)),this.on("userInput",(z)=>this.#Y(z))}_isActionKey(Z,$){return Z==="\t"||this.multiple&&this.isNavigating&&$.name==="space"&&Z!==void 0&&Z!==""}#J(Z,$){let Q=$.name==="up",z=$.name==="down",J=$.name==="return";if(Q||z){if(this.#Z=Math.max(0,Math.min(this.#Z+(Q?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#Z]?.value,!this.multiple)this.selectedValues=[this.focusedValue];this.isNavigating=!0}else if(J)this.value=FZ(this.multiple,this.selectedValues);else if(this.multiple)if(this.focusedValue!==void 0&&($.name==="tab"||this.isNavigating&&$.name==="space"))this.toggleSelected(this.focusedValue);else this.isNavigating=!1;else{if(this.focusedValue)this.selectedValues=[this.focusedValue];this.isNavigating=!1}}deselectAll(){this.selectedValues=[]}toggleSelected(Z){if(this.filteredOptions.length===0)return;if(this.multiple)if(this.selectedValues.includes(Z))this.selectedValues=this.selectedValues.filter(($)=>$!==Z);else this.selectedValues=[...this.selectedValues,Z];else this.selectedValues=[Z]}#Y(Z){if(Z!==this.#Q){this.#Q=Z;let $=this.options;if(Z)this.filteredOptions=$.filter((Q)=>this.#z(Z,Q));else this.filteredOptions=[...$];if(this.#Z=GZ(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#Z]?.value,!this.multiple)if(this.focusedValue!==void 0)this.toggleSelected(this.focusedValue);else this.deselectAll()}}}class HZ extends p{options;cursor=0;#Z;getGroupItems(Z){return this.options.filter(($)=>$.group===Z)}isGroupSelected(Z){let $=this.getGroupItems(Z),Q=this.value;if(Q===void 0)return!1;return $.every((z)=>Q.includes(z.value))}toggleValue(){let Z=this.options[this.cursor];if(this.value===void 0)this.value=[];if(Z.group===!0){let $=Z.value,Q=this.getGroupItems($);if(this.isGroupSelected($))this.value=this.value.filter((z)=>Q.findIndex((J)=>J.value===z)===-1);else this.value=[...this.value,...Q.map((z)=>z.value)];this.value=Array.from(new Set(this.value))}else{let $=this.value.includes(Z.value);this.value=$?this.value.filter((Q)=>Q!==Z.value):[...this.value,Z.value]}}constructor(Z){super(Z,!1);let{options:$}=Z;this.#Z=Z.selectableGroups!==!1,this.options=Object.entries($).flatMap(([Q,z])=>[{value:Q,group:!0,label:Q},...z.map((J)=>({...J,group:Q}))]),this.value=[...Z.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:Q})=>Q===Z.cursorAt),this.#Z?0:1),this.on("cursor",(Q)=>{switch(Q){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let z=this.options[this.cursor]?.group===!0;if(!this.#Z&&z)this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let z=this.options[this.cursor]?.group===!0;if(!this.#Z&&z)this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}case"space":this.toggleValue();break}})}}var SZ=L(N(),1);var gZ=L(N(),1);var _Z=L(N(),1),B={red:["\x1B[31m","\x1B[39m"],green:["\x1B[32m","\x1B[39m"],blue:["\x1B[34m","\x1B[39m"],yellow:["\x1B[33m","\x1B[39m"],cyan:["\x1B[36m","\x1B[39m"],magenta:["\x1B[35m","\x1B[39m"],white:["\x1B[37m","\x1B[39m"],gray:["\x1B[90m","\x1B[39m"],bgRed:["\x1B[41m","\x1B[49m"],bgGreen:["\x1B[42m","\x1B[49m"],bgBlue:["\x1B[44m","\x1B[49m"],bgYellow:["\x1B[43m","\x1B[49m"],bgCyan:["\x1B[46m","\x1B[49m"],bgMagenta:["\x1B[45m","\x1B[49m"],bold:["\x1B[1m","\x1B[22m"],italic:["\x1B[3m","\x1B[23m"],underline:["\x1B[4m","\x1B[24m"],dim:["\x1B[2m","\x1B[22m"],inverse:["\x1B[7m","\x1B[27m"],hidden:["\x1B[8m","\x1B[28m"],strikethrough:["\x1B[9m","\x1B[29m"]},P={primary:"blue",secondary:"cyan",success:"green",warning:"yellow",error:"red",info:"magenta",muted:"gray"};function VZ(){return!0}function DZ(){let Z={};Z.supportsColor=VZ();function $(z,J=[]){let Y=z===""?[]:[...J,z],X=function(q){if(!Z.supportsColor)return q;let G="",U="";for(let F of Y)if(F in P&&P[F]in B){let K=P[F];G+=B[K][0],U=B[K][1]+U}else if(F in B)G+=B[F][0],U=B[F][1]+U;return G+q+U},j=[...Object.keys(B),...Object.keys(P)];for(let q of j)if(!(q in X))Object.defineProperty(X,q,{get(){return $(q,Y)}});return X}let Q=[...Object.keys(B),...Object.keys(P)];for(let z of Q)if(!(z in Z))Object.defineProperty(Z,z,{get(){return $(z)}});return Z}var dZ=DZ();var WZ=h0();var W=(Z,$)=>WZ?Z:$,uZ=W("\u25C6","*"),mZ=W("\u25A0","x"),xZ=W("\u25B2","x"),lZ=W("\u25C7","o"),nZ=W("\u250C","T"),LZ=W("\u2502","|"),aZ=W("\u2514","\u2014"),cZ=W("\u25CF",">"),pZ=W("\u25CB"," "),iZ=W("\u25FB","[\u2022]"),rZ=W("\u25FC","[+]"),sZ=W("\u25FB","[ ]"),eZ=W("\u25AA","\u2022"),tZ=W("\u2500","-"),oZ=W("\u256E","+"),Z1=W("\u251C","+"),$1=W("\u256F","+"),Q1=W("\u25CF","\u2022"),z1=W("\u25C6","*"),J1=W("\u25B2","!"),Y1=W("\u25A0","x");var j1=L(N(),1);var X1=L(N(),1);var U1=L(N(),1);var G1=L(N(),1);var q1=L(N(),1);var F1=L(N(),1);var K1=L(N(),1);var H1=L(N(),1);var V1=L(N(),1),D1=L(N(),1);var W1={light:W("\u2500","-"),heavy:W("\u2501","="),block:W("\u2588","#")};var L1=L(N(),1);var M1=L(N(),1);var MZ=L(N(),1);function NZ(){return`${MZ.default.gray(LZ)} `}var N1=NZ();var O1=L(N(),1);var w1=L(N(),1);var i="0.9.7";var R=new a("dtsx"),O={cwd:L0.cwd(),root:"./src",entrypoints:["**/*.ts"],outdir:"./dist",keepComments:!0,clean:!1,tsconfigPath:"tsconfig.json",verbose:!1};R.command("generate","Generate TypeScript declaration files").option("--cwd <path>","Current working directory",{default:O.cwd}).option("--root <path>","Root directory of the project",{default:O.root}).option("--entrypoints <files>","Entry point files (comma-separated)",{default:O.entrypoints?.join(","),type:[String]}).option("--outdir <path>","Output directory for generated .d.ts files",{default:O.outdir}).option("--keep-comments","Keep comments in generated .d.ts files",{default:O.keepComments}).option("--clean","Clean output directory before generation",{default:O.clean}).option("--tsconfig <path>","Path to tsconfig.json",{default:O.tsconfigPath}).option("--verbose","Enable verbose logging",{default:O.verbose}).example("dtsx generate").example("dtsx generate --entrypoints src/index.ts,src/utils.ts --outdir dist/types").action(async(Z)=>{try{let $={entrypoints:Z.entrypoints?Z.entrypoints:O.entrypoints,cwd:y(Z.cwd||O.cwd),root:y(Z.root||O.root),outdir:y(Z.outdir||O.outdir),tsconfigPath:y(Z.tsconfigPath||O.tsconfigPath),keepComments:Z.keepComments||O.keepComments,clean:Z.clean||O.clean,verbose:Z.verbose||O.verbose};await W0($)}catch($){console.error("Error generating .d.ts files:",$),L0.exit(1)}});R.command("version","Show the version of dtsx").action(()=>{console.log(i)});R.version(i);R.help();R.parse();