@cwcss/crosswind 0.2.2 → 0.2.3

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.
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+ import{H as M6,K as N6,N as O6,Q as s}from"../chunk-3frpk224.js";import{existsSync as E,watch as Ez}from"fs";import{unlink as Az}from"fs/promises";import B from"process";import{EventEmitter as h6}from"events";import Z6 from"process";import x from"process";import k from"process";import l6,{stdin as gz,stdout as _z}from"process";import Y6,{stdin as c6,stdout as p6}from"process";import i6 from"readline";var{create:P6,getPrototypeOf:I6,defineProperty:z6,getOwnPropertyNames:R6}=Object,E6=Object.prototype.hasOwnProperty,L=(z,Z,$)=>{$=z!=null?P6(I6(z)):{};let Q=Z||!z||!z.__esModule?z6($,"default",{value:z,enumerable:!0}):$;for(let J of R6(z))if(!E6.call(Q,J))z6(Q,J,{get:()=>z[J],enumerable:!0});return Q},l=(z,Z)=>()=>(Z||z((Z={exports:{}}).exports,Z),Z.exports),A6=l((z,Z)=>{function $(J){return J==null?[]:Array.isArray(J)?J:[J]}function Q(J,Y,X,U){var F,q=J[Y],j=~U.string.indexOf(Y)?X==null||X===!0?"":String(X):typeof X==="boolean"?X:~U.boolean.indexOf(Y)?X==="false"?!1:X==="true"||(J._.push((F=+X,F*0===0)?F:X),!!X):(F=+X,F*0===0)?F:X;J[Y]=q==null?j:Array.isArray(q)?q.concat(j):[q,j]}Z.exports=function(J,Y){J=J||[],Y=Y||{};var X,U,F,q,j,G={_:[]},H=0,K=0,V=0,P=J.length;let f=Y.alias!==void 0,g=Y.unknown!==void 0,t=Y.default!==void 0;if(Y.alias=Y.alias||{},Y.string=$(Y.string),Y.boolean=$(Y.boolean),f)for(X in Y.alias){U=Y.alias[X]=$(Y.alias[X]);for(H=0;H<U.length;H++)(Y.alias[U[H]]=U.concat(X)).splice(H,1)}for(H=Y.boolean.length;H-- >0;){U=Y.alias[Y.boolean[H]]||[];for(K=U.length;K-- >0;)Y.boolean.push(U[K])}for(H=Y.string.length;H-- >0;){U=Y.alias[Y.string[H]]||[];for(K=U.length;K-- >0;)Y.string.push(U[K])}if(t){for(X in Y.default)if(q=typeof Y.default[X],U=Y.alias[X]=Y.alias[X]||[],Y[q]!==void 0){Y[q].push(X);for(H=0;H<U.length;H++)Y[q].push(U[H])}}let o=g?Object.keys(Y.alias):[];for(H=0;H<P;H++){if(F=J[H],F==="--"){G._=G._.concat(J.slice(++H));break}for(K=0;K<F.length;K++)if(F.charCodeAt(K)!==45)break;if(K===0)G._.push(F);else if(F.substring(K,K+3)==="no-"){if(q=F.substring(K+3),g&&!~o.indexOf(q))return Y.unknown(F);G[q]=!1}else{for(V=K+1;V<F.length;V++)if(F.charCodeAt(V)===61)break;q=F.substring(K,V),j=F.substring(++V)||(H+1===P||(""+J[H+1]).charCodeAt(0)===45||J[++H]),U=K===2?[q]:q;for(V=0;V<U.length;V++){if(q=U[V],g&&!~o.indexOf(q))return Y.unknown("-".repeat(K)+q);Q(G,q,V+1<U.length||j,Y)}}}if(t){for(X in Y.default)if(G[X]===void 0)G[X]=Y.default[X]}if(f)for(X in G){U=Y.alias[X]||[];while(U.length>0)G[U.shift()]=G[X]}return G}}),M=l((z,Z)=>{var $=process||{},Q=$.argv||[],J=$.env||{},Y=!(!!J.NO_COLOR||Q.includes("--no-color"))&&(!!J.FORCE_COLOR||Q.includes("--color")||$.platform==="win32"||($.stdout||{}).isTTY&&J.TERM!=="dumb"||!!J.CI),X=(q,j,G=q)=>(H)=>{let K=""+H,V=K.indexOf(j,q.length);return~V?q+U(K,j,G,V)+j:q+K+j},U=(q,j,G,H)=>{let K="",V=0;do K+=q.substring(V,H)+G,V=H+j.length,H=q.indexOf(j,V);while(~H);return K+q.substring(V)},F=(q=Y)=>{let j=q?X:()=>String;return{isColorSupported:q,reset:j("\x1B[0m","\x1B[0m"),bold:j("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:j("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:j("\x1B[3m","\x1B[23m"),underline:j("\x1B[4m","\x1B[24m"),inverse:j("\x1B[7m","\x1B[27m"),hidden:j("\x1B[8m","\x1B[28m"),strikethrough:j("\x1B[9m","\x1B[29m"),black:j("\x1B[30m","\x1B[39m"),red:j("\x1B[31m","\x1B[39m"),green:j("\x1B[32m","\x1B[39m"),yellow:j("\x1B[33m","\x1B[39m"),blue:j("\x1B[34m","\x1B[39m"),magenta:j("\x1B[35m","\x1B[39m"),cyan:j("\x1B[36m","\x1B[39m"),white:j("\x1B[37m","\x1B[39m"),gray:j("\x1B[90m","\x1B[39m"),bgBlack:j("\x1B[40m","\x1B[49m"),bgRed:j("\x1B[41m","\x1B[49m"),bgGreen:j("\x1B[42m","\x1B[49m"),bgYellow:j("\x1B[43m","\x1B[49m"),bgBlue:j("\x1B[44m","\x1B[49m"),bgMagenta:j("\x1B[45m","\x1B[49m"),bgCyan:j("\x1B[46m","\x1B[49m"),bgWhite:j("\x1B[47m","\x1B[49m"),blackBright:j("\x1B[90m","\x1B[39m"),redBright:j("\x1B[91m","\x1B[39m"),greenBright:j("\x1B[92m","\x1B[39m"),yellowBright:j("\x1B[93m","\x1B[39m"),blueBright:j("\x1B[94m","\x1B[39m"),magentaBright:j("\x1B[95m","\x1B[39m"),cyanBright:j("\x1B[96m","\x1B[39m"),whiteBright:j("\x1B[97m","\x1B[39m"),bgBlackBright:j("\x1B[100m","\x1B[49m"),bgRedBright:j("\x1B[101m","\x1B[49m"),bgGreenBright:j("\x1B[102m","\x1B[49m"),bgYellowBright:j("\x1B[103m","\x1B[49m"),bgBlueBright:j("\x1B[104m","\x1B[49m"),bgMagentaBright:j("\x1B[105m","\x1B[49m"),bgCyanBright:j("\x1B[106m","\x1B[49m"),bgWhiteBright:j("\x1B[107m","\x1B[49m")}};Z.exports=F(),Z.exports.createColors=F}),b6=l((z,Z)=>{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}}),k6=L(A6(),1);function H6(z){return z.replace(/[<[].+/,"").trim()}function C6(z){let Z=/<([^>]+)>/g,$=/\[([^\]]+)\]/g,Q=[],J=(U)=>{let F=!1,q=U[1];if(q.startsWith("..."))q=q.slice(3),F=!0;return{required:U[0].startsWith("<"),value:q,variadic:F}},Y;while(Y=Z.exec(z))Q.push(J(Y));let X;while(X=$.exec(z))Q.push(J(X));return Q}function v6(z){let Z={alias:{},boolean:[]};for(let[$,Q]of z.entries()){if(Q.names.length>1)Z.alias[Q.names[0]]=Q.names.slice(1);if(Q.isBoolean)if(Q.negated){if(!z.some((Y,X)=>{return X!==$&&Y.names.some((U)=>Q.names.includes(U))&&typeof Y.required==="boolean"}))Z.boolean.push(Q.names[0])}else Z.boolean.push(Q.names[0])}return Z}function $6(z){return z.sort((Z,$)=>{return Z.length>$.length?-1:1})[0]}function Q6(z,Z){return z.length>=Z?z:`${z}${" ".repeat(Z-z.length)}`}function y6(z){return z.replace(/([a-z])-([a-z])/g,(Z,$,Q)=>{return $+Q.toUpperCase()})}function S6(z,Z,$){let Q=0,J=Z.length,Y=z,X;for(;Q<J;++Q)X=Y[Z[Q]],Y=Y[Z[Q]]=Q===J-1?$:X!=null?X:!!~Z[Q+1].indexOf(".")||!(+Z[Q+1]>-1)?{}:[]}function f6(z,Z){for(let $ of Object.keys(Z)){let Q=Z[$];if(Q.shouldTransform){if(z[$]=Array.prototype.concat.call([],z[$]),typeof Q.transformFunction==="function")z[$]=z[$].map(Q.transformFunction)}}}function g6(z){let Z=/([^\\/]+)$/.exec(z);return Z?Z[1]:""}function K6(z){return z.split(".").map((Z,$)=>{return $===0?y6(Z):Z}).join(".")}class b 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 _6(){let{env:z}=Z6,{TERM:Z,TERM_PROGRAM:$}=z;if(Z6.platform!=="win32")return Z!=="linux";return Boolean(z.WT_SESSION)||Boolean(z.TERMINUS_SUBLIME)||z.ConEmuTask==="{cmd::Cmder}"||$==="Terminus-Sublime"||$==="vscode"||Z==="xterm-256color"||Z==="alacritty"||Z==="rxvt-unicode"||Z==="rxvt-unicode-256color"||z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var C="\x1B",w=`${C}[`;var O={to(z,Z){if(!Z)return`${w}${z+1}G`;return`${w}${Z+1};${z+1}H`},move(z,Z){let $="";if(z<0)$+=`${w}${-z}D`;else if(z>0)$+=`${w}${z}C`;if(Z<0)$+=`${w}${-Z}A`;else if(Z>0)$+=`${w}${Z}B`;return $},up:(z=1)=>`${w}${z}A`,down:(z=1)=>`${w}${z}B`,forward:(z=1)=>`${w}${z}C`,backward:(z=1)=>`${w}${z}D`,nextLine:(z=1)=>`${w}E`.repeat(z),prevLine:(z=1)=>`${w}F`.repeat(z),left:`${w}G`,hide:`${w}?25l`,show:`${w}?25h`,save:`${C}7`,restore:`${C}8`};var _={screen:`${w}2J`,up:(z=1)=>`${w}1J`.repeat(z),down:(z=1)=>`${w}J`.repeat(z),line:`${w}2K`,lineEnd:`${w}K`,lineStart:`${w}1K`,lines(z){let Z="";for(let $=0;$<z;$++)Z+=this.line+($<z-1?O.up():"");if(z)Z+=O.left;return Z}},hz={screen:`${C}c`};class V6{rawName;description;name;names;isBoolean;required;config;negated;constructor(z,Z,$){if(this.rawName=z,this.description=Z,this.config=Object.assign({},$),z=z.replace(/\.\*/g,""),this.negated=!1,this.names=H6(z).split(",").map((Q)=>{let J=Q.trim().replace(/^-{1,2}/,"");if(J.startsWith("no-"))this.negated=!0,J=J.replace(/^no-/,"");return K6(J)}).sort((Q,J)=>Q.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 vz=x.argv,d6=`${x.platform}-${x.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,u6=k.argv,m6=`${k.platform}-${k.arch} node-${k.version}`;class n{rawName;description;config;cli;options;aliasNames;name;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;constructor(z,Z,$,Q){if(this.rawName=z,this.description=Z,this.config=$,this.cli=Q,this.options=[],this.aliasNames=[],this.name=H6(z),this.args=C6(z),this.examples=[],!$)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,Z="-v, --version"){return this.versionNumber=z,this.option(Z,"Display version number"),this}example(z){return this.examples.push(z),this}option(z,Z,$){let Q=new V6(z,Z,$);return this.options.push(Q),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 a}hasOption(z){return z=z.split(".")[0],!!this.options.find((Z)=>{return Z.names.includes(z)})}outputHelp(){let{name:z,commands:Z}=this.cli,{versionNumber:$,options:Q,helpCallback:J}=this.cli.globalCommand,Y=[{body:`${z}${$?`/${$}`:""}`}];if(Y.push({title:"Usage",body:` $ ${z} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&Z.length>0){let F=$6(Z.map((q)=>q.rawName));Y.push({title:"Commands",body:Z.map((q)=>{return` ${Q6(q.rawName,F.length)} ${q.description}`}).join(`
4
+ `)}),Y.push({title:"For more info, run any command with the `--help` flag",body:Z.map((q)=>` $ ${z}${q.name===""?"":` ${q.name}`} --help`).join(`
5
+ `)})}let U=this.isGlobalCommand?Q:[...this.options,...Q||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand)U=U.filter((F)=>F.name!=="version");if(U.length>0){let F=$6(U.map((q)=>q.rawName));Y.push({title:"Options",body:U.map((q)=>{return` ${Q6(q.rawName,F.length)} ${q.description} ${q.config.default===void 0?"":`(default: ${q.config.default})`}`}).join(`
6
+ `)})}if(this.examples.length>0)Y.push({title:"Examples",body:this.examples.map((F)=>{if(typeof F==="function")return F(z);return F}).join(`
7
+ `)});if(J)Y=J(Y)||Y;console.log(Y.map((F)=>{return F.title?`${F.title}:
8
+ ${F.body}`:F.body}).join(`
9
+
10
+ `))}outputVersion(){let{name:z}=this.cli,{versionNumber:Z}=this.cli.globalCommand;if(Z){let $;if(Bun)$=d6;else $=m6;console.log(`${z}/${Z} ${$}`)}}checkRequiredArgs(){let z=this.args.filter((Z)=>Z.required).length;if(this.cli.args.length<z)throw new b(`missing required args for command \`${this.rawName}\``)}checkUnknownOptions(){let{options:z,globalCommand:Z}=this.cli;if(!this.config.allowUnknownOptions){for(let $ of Object.keys(z))if($!=="--"&&!this.hasOption($)&&!Z.hasOption($))throw new b(`Unknown option \`${$.length>1?`--${$}`:`-${$}`}\``)}}checkOptionValue(){let{options:z,globalCommand:Z}=this.cli,$=[...Z.options,...this.options];for(let Q of $){let J=z[Q.name.split(".")[0]];if(Q.required){let Y=$.some((X)=>X.negated&&X.names.includes(Q.name));if(J===!0||J===!1&&!Y)throw new b(`option \`${Q.rawName}\` value is missing`)}}}}class a extends n{constructor(z){super("@@global@@","",{},z)}}var x6=n;class c extends h6{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 a(this),this.globalCommand.usage("<command> [options]")}usage(z){return this.globalCommand.usage(z),this}command(z,Z,$){if(!$)$={};let Q=new x6(z,Z||"",$,this);return Q.globalCommand=this.globalCommand,this.commands.push(Q),Q}option(z,Z,$){return this.globalCommand.option(z,Z,$),this}help(z){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=z,this.showHelpOnExit=!0,this}version(z,Z="-v, --version"){return this.globalCommand.version(z,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:Z},$,Q){if(this.args=z,this.options=Z,$)this.matchedCommand=$;if(Q)this.matchedCommandName=Q;return this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}parse(z=u6,{run:Z=!0}={}){if(this.rawArgs=z,!this.name)this.name=z[1]?g6(z[1]):"cli";let $=!0;for(let J of this.commands){let Y=this.mri(z.slice(2),J),X=Y.args[0];if(J.isMatched(X)){$=!1;let U={...Y,args:Y.args.slice(1)};this.setParsedInfo(U,J,X),this.emit(`command:${X}`,J)}}if($){for(let J of this.commands)if(J.name===""){$=!1;let Y=this.mri(z.slice(2),J);this.setParsedInfo(Y,J),this.emit("command:!",J)}}if($){let J=this.mri(z.slice(2));this.setParsedInfo(J)}if(this.options.help&&this.showHelpOnExit)this.outputHelp(),Z=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),Z=!1,this.unsetMatchedCommand();let Q={args:this.args,options:this.options};if(Z)this.runMatchedCommand();if(!this.matchedCommand&&this.args[0])this.emit("command:*");return Q}mri(z,Z){let $=[...this.globalCommand.options,...Z?Z.options:[]],Q=v6($),J=[],Y=z.indexOf("--");if(Y>-1)J=z.slice(Y+1),z=z.slice(0,Y);let X=k6.default(z,Q);X=Object.keys(X).reduce((G,H)=>{return{...G,[K6(H)]:X[H]}},{_:[]});let U=X._,F={"--":J},q=Z&&Z.config.ignoreOptionDefaultValue?Z.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,j=Object.create(null);for(let G of $){if(!q&&G.config.default!==void 0)for(let H of G.names)F[H]=G.config.default;if(Array.isArray(G.config.type)){if(j[G.name]===void 0)j[G.name]=Object.create(null),j[G.name].shouldTransform=!0,j[G.name].transformFunction=G.config.type[0]}}for(let G of Object.keys(X))if(G!=="_"){let H=G.split(".");S6(F,H,X[G]),f6(F,j)}return{args:U,options:F}}runMatchedCommand(){let{args:z,options:Z,matchedCommand:$}=this;if(!$||!$.commandAction)return;$.checkUnknownOptions(),$.checkOptionValue(),$.checkRequiredArgs();let Q=[];return $.args.forEach((J,Y)=>{if(J.variadic)Q.push(z.slice(Y));else Q.push(z[Y])}),Q.push(Z),$.commandAction.apply(this,Q)}}var Sz=L(M(),1),n6=["up","down","left","right","space","enter","cancel"],h={actions:new Set(n6),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};function D6(z,Z){if(typeof z==="string")return h.aliases.get(z)===Z;for(let $ of z){if($===void 0)continue;if(D6($,Z))return!0}return!1}function a6(z,Z){if(z===Z)return[];let $=z.split(`
11
+ `),Q=Z.split(`
12
+ `),J=[];for(let Y=0;Y<Math.max($.length,Q.length);Y++)if($[Y]!==Q[Y])J.push(Y);return J}var dz=l6.platform.startsWith("win"),J6=Symbol("clapp:cancel");function A(z,Z){let $=z;if($.isTTY)$.setRawMode(Z)}var d=L(M(),1);function r6({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 s6=r6();function W6(z){if(typeof z!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof z}\``);return z.replace(s6,"")}function e6(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 t6(z){return z===12288||z>=65281&&z<=65376||z>=65504&&z<=65510}function o6(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 zz(z){if(!Number.isSafeInteger(z))throw TypeError(`Expected a code point, got \`${typeof z}\`.`)}function Zz(z,{ambiguousAsWide:Z=!1}={}){if(zz(z),t6(z)||o6(z)||Z&&e6(z))return 2;return 1}var $z=L(b6(),1),Qz=new Intl.Segmenter,Jz=/^\p{Default_Ignorable_Code_Point}$/u;function R(z,Z={}){if(typeof z!=="string"||z.length===0)return 0;let{ambiguousIsNarrow:$=!0,countAnsiEscapeCodes:Q=!1}=Z;if(!Q)z=W6(z);if(z.length===0)return 0;let J=0,Y={ambiguousAsWide:!$};for(let{segment:X}of Qz.segment(z)){let U=X.codePointAt(0);if(U<=31||U>=127&&U<=159)continue;if(U>=8203&&U<=8207||U===65279)continue;if(U>=768&&U<=879||U>=6832&&U<=6911||U>=7616&&U<=7679||U>=8400&&U<=8447||U>=65056&&U<=65071)continue;if(U>=55296&&U<=57343)continue;if(U>=65024&&U<=65039)continue;if(Jz.test(X))continue;if($z.default().test(X)){J+=2;continue}J+=Zz(U,Y)}return J}var u=10,X6=(z=0)=>(Z)=>`\x1B[${Z+z}m`,U6=(z=0)=>(Z)=>`\x1B[${38+z};5;${Z}m`,j6=(z=0)=>(Z,$,Q)=>`\x1B[${38+z};2;${Z};${$};${Q}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]}},xz=Object.keys(D.modifier),Yz=Object.keys(D.color),Xz=Object.keys(D.bgColor),lz=[...Yz,...Xz];function Uz(){let z=new Map;for(let[Z,$]of Object.entries(D)){for(let[Q,J]of Object.entries($))D[Q]={open:`\x1B[${J[0]}m`,close:`\x1B[${J[1]}m`},$[Q]=D[Q],z.set(J[0],J[1]);Object.defineProperty(D,Z,{value:$,enumerable:!1})}return Object.defineProperty(D,"codes",{value:z,enumerable:!1}),D.color.close="\x1B[39m",D.bgColor.close="\x1B[49m",D.color.ansi=X6(),D.color.ansi256=U6(),D.color.ansi16m=j6(),D.bgColor.ansi=X6(u),D.bgColor.ansi256=U6(u),D.bgColor.ansi16m=j6(u),Object.defineProperties(D,{rgbToAnsi256:{value:(Z,$,Q)=>{if(Z===$&&$===Q){if(Z<8)return 16;if(Z>248)return 231;return Math.round((Z-8)/247*24)+232}return 16+36*Math.round(Z/255*5)+6*Math.round($/255*5)+Math.round(Q/255*5)},enumerable:!1},hexToRgb:{value:(Z)=>{let $=/[a-f\d]{6}|[a-f\d]{3}/i.exec(Z.toString(16));if(!$)return[0,0,0];let[Q]=$;if(Q.length===3)Q=[...Q].map((Y)=>Y+Y).join("");let J=Number.parseInt(Q,16);return[J>>16&255,J>>8&255,J&255]},enumerable:!1},hexToAnsi256:{value:(Z)=>D.rgbToAnsi256(...D.hexToRgb(Z)),enumerable:!1},ansi256ToAnsi:{value:(Z)=>{if(Z<8)return 30+Z;if(Z<16)return 90+(Z-8);let $,Q,J;if(Z>=232)$=((Z-232)*10+8)/255,Q=$,J=$;else{Z-=16;let U=Z%36;$=Math.floor(Z/36)/5,Q=Math.floor(U/6)/5,J=U%6/5}let Y=Math.max($,Q,J)*2;if(Y===0)return 30;let X=30+(Math.round(J)<<2|Math.round(Q)<<1|Math.round($));if(Y===2)X+=60;return X},enumerable:!1},rgbToAnsi:{value:(Z,$,Q)=>D.ansi256ToAnsi(D.rgbToAnsi256(Z,$,Q)),enumerable:!1},hexToAnsi:{value:(Z)=>D.ansi256ToAnsi(D.hexToAnsi256(Z)),enumerable:!1}}),D}var jz=Uz(),qz=jz,y=new Set(["\x1B","\x9B"]),Fz=39,p="\x07",L6="[",Gz="]",w6="m",v=`${Gz}8;;`,q6=(z)=>`${y.values().next().value}${L6}${z}${w6}`,F6=(z)=>`${y.values().next().value}${v}${z}${p}`,Hz=(z)=>z.split(" ").map((Z)=>R(Z)),m=(z,Z,$)=>{let Q=[...Z],J=!1,Y=!1,X=R(W6(z.at(-1)));for(let[U,F]of Q.entries()){let q=R(F);if(X+q<=$)z[z.length-1]+=F;else z.push(F),X=0;if(y.has(F))J=!0,Y=Q.slice(U+1,U+1+v.length).join("")===v;if(J){if(Y){if(F===p)J=!1,Y=!1}else if(F===w6)J=!1;continue}if(X+=q,X===$&&U<Q.length-1)z.push(""),X=0}if(!X&&z.at(-1).length>0&&z.length>1)z[z.length-2]+=z.pop()},Kz=(z)=>{let Z=z.split(" "),$=Z.length;while($>0){if(R(Z[$-1])>0)break;$--}if($===Z.length)return z;return Z.slice(0,$).join(" ")+Z.slice($).join("")},Vz=(z,Z,$={})=>{if($.trim!==!1&&z.trim()==="")return"";let Q="",J,Y,X=Hz(z),U=[""];for(let[G,H]of z.split(" ").entries()){if($.trim!==!1)U[U.length-1]=U.at(-1).trimStart();let K=R(U.at(-1));if(G!==0){if(K>=Z&&($.wordWrap===!1||$.trim===!1))U.push(""),K=0;if(K>0||$.trim===!1)U[U.length-1]+=" ",K++}if($.hard&&X[G]>Z){let V=Z-K,P=1+Math.floor((X[G]-V-1)/Z);if(Math.floor((X[G]-1)/Z)<P)U.push("");m(U,H,Z);continue}if(K+X[G]>Z&&K>0&&X[G]>0){if($.wordWrap===!1&&K<Z){m(U,H,Z);continue}U.push("")}if(K+X[G]>Z&&$.wordWrap===!1){m(U,H,Z);continue}U[U.length-1]+=H}if($.trim!==!1)U=U.map((G)=>Kz(G));let F=U.join(`
13
+ `),q=[...F],j=0;for(let[G,H]of q.entries()){if(Q+=H,y.has(H)){let{groups:V}=new RegExp(`(?:\\${L6}(?<code>\\d+)m|\\${v}(?<uri>.*)${p})`).exec(F.slice(j))||{groups:{}};if(V.code!==void 0){let P=Number.parseFloat(V.code);J=P===Fz?void 0:P}else if(V.uri!==void 0)Y=V.uri.length===0?void 0:V.uri}let K=qz.codes.get(Number(J));if(q[G+1]===`
14
+ `){if(Y)Q+=F6("");if(J&&K)Q+=q6(K)}else if(H===`
15
+ `){if(J&&K)Q+=q6(J);if(Y)Q+=F6(Y)}j+=H.length}return Q};function G6(z,Z,$){return String(z).normalize().replaceAll(`\r
16
+ `,`
17
+ `).split(`
18
+ `).map((Q)=>Vz(Q,Z,$)).join(`
19
+ `)}class i{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;_manualLine="";state="initial";error="";value;userInput="";constructor(z,Z=!0){let{input:$=c6,output:Q=p6,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=Z,this._abortSignal=Y,this.input=$,this.output=Q}unsubscribe(){this._subscribers.clear()}setSubscriber(z,Z){let $=this._subscribers.get(z)??[];$.push(Z),this._subscribers.set(z,$)}on(z,Z){return this.setSubscriber(z,{cb:Z}),this}once(z,Z){return this.setSubscriber(z,{cb:Z,once:!0}),this}emit(z,...Z){let $=this._subscribers.get(z)??[],Q=[];for(let J of $)if(J.cb(...Z),J.once)Q.push(()=>$.splice($.indexOf(J),1));for(let J of Q)J();return this}prompt(){return new Promise((z)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),z(J6);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}if(this.rl=i6.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),A(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(O.show),this.output.off("resize",this.render),A(this.input,!1),z(this.value)}),this.once("cancel",()=>{this.output.write(O.show),this.output.off("resize",this.render),A(this.input,!1),z(J6)})})}_isActionKey(z,Z){return z==="\t"}_setValue(z){this.value=z,this.emit("value",this.value)}_setUserInput(z,Z){if(this.userInput=z??"",this.emit("userInput",this.userInput),Z&&this._track&&this.rl)this.rl.write(this.userInput),this._cursor=this.rl.cursor}onKeypress(z,Z){if(this._track&&Z.name!=="return"){if(Z.name&&this._isActionKey(z,Z))this.rl?.write(null,{ctrl:!0,name:"h"});this._cursor=this.rl?.cursor??0;let $=Z.name==="tab"||Z.name==="escape"||Z.name==="backspace"||Z.name==="delete"||Z.name==="enter"||Z.name==="return"||Z.name&&["up","down","left","right"].includes(Z.name);if(z&&!$&&z.length===1&&z>=" ")this._manualLine+=z;else if(Z.name==="backspace"&&this._manualLine.length>0)this._manualLine=this._manualLine.slice(0,-1);let Q=this._manualLine.length>=(this.rl?.line?.length||0)?this._manualLine:this.rl?.line;this._setUserInput(Q)}if(this.state==="error")this.state="active",this.error="";if(Z?.name){if(!this._track&&h.aliases.has(Z.name))this.emit("cursor",h.aliases.get(Z.name));if(h.actions.has(Z.name))this.emit("cursor",Z.name)}if(z&&(z.toLowerCase()==="y"||z.toLowerCase()==="n"))this.emit("confirm",z.toLowerCase()==="y");if(this.emit("key",z?.toLowerCase(),Z),Z?.name==="return"){if(this.opts.validate){let $=this.opts.validate(this.value);if($)this.error=$ instanceof Error?$.message:$,this.state="error"}if(this.state!=="error")this.state="submit"}if(D6([z,Z?.name,Z?.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(`
20
+ `),A(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=G6(this._prevFrame,Y6.stdout.columns,{hard:!0,trim:!1}).split(`
21
+ `).length-1;this.output.write(O.move(-999,z*-1))}render(){let z=G6(this._render(this)??"",Y6.stdout.columns,{hard:!0,trim:!1});if(z===this._prevFrame)return;if(this.state==="initial")this.output.write(O.hide);else{let Z=a6(this._prevFrame,z);if(this.restoreCursor(),Z&&Z?.length===1){let $=Z[0];this.output.write(O.move(0,$)),this.output.write(_.lines(1));let Q=z.split(`
22
+ `);this.output.write(Q[$]),this._prevFrame=z,this.output.write(O.move(0,Q.length-$-1));return}if(Z&&Z?.length>1){let $=Z[0];this.output.write(O.move(0,$)),this.output.write(_.down());let J=z.split(`
23
+ `).slice($);this.output.write(J.join(`
24
+ `)),this._prevFrame=z;return}this.output.write(_.down())}if(this.output.write(z),this.state==="initial")this.state="active";this._prevFrame=z}}function Dz(z,Z){if(z===void 0)return 0;if(Z.length===0)return 0;let Q=Z.findIndex((J)=>J.value===z);return Q!==-1?Q:0}function Wz(z,Z){return(Z.label??String(Z.value)).toLowerCase().includes(z.toLowerCase())}function Lz(z,Z){if(!Z)return;if(z)return Z;return Z[0]}class wz extends i{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#z=0;#$="";#Q;#Z;get cursor(){return this.#z}get userInputWithCursor(){if(!this.userInput)return d.default.inverse(d.default.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;let z=this.userInput.slice(0,this._cursor),[Z,...$]=this.userInput.slice(this._cursor);return`${z}${d.default.inverse(Z)}${$.join("")}`}get options(){if(typeof this.#Z==="function")return this.#Z();return this.#Z}constructor(z){super(z);this.#Z=z.options;let Z=this.options;this.filteredOptions=[...Z],this.multiple=z.multiple===!0,this.#Q=z.filter??Wz;let $;if(z.initialValue&&Array.isArray(z.initialValue))if(this.multiple)$=z.initialValue;else $=z.initialValue.slice(0,1);else if(!this.multiple&&this.options.length>0)$=[this.options[0].value];if($)for(let Q of $){let J=Z.findIndex((Y)=>Y.value===Q);if(J!==-1)this.toggleSelected(Q),this.#z=J}this.focusedValue=this.options[this.#z]?.value,this.on("key",(Q,J)=>this.#J(Q,J)),this.on("userInput",(Q)=>this.#Y(Q))}_isActionKey(z,Z){return z==="\t"||this.multiple&&this.isNavigating&&Z.name==="space"&&z!==void 0&&z!==""}#J(z,Z){let $=Z.name==="up",Q=Z.name==="down",J=Z.name==="return";if($||Q){if(this.#z=Math.max(0,Math.min(this.#z+($?-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=Lz(this.multiple,this.selectedValues);else if(this.multiple)if(this.focusedValue!==void 0&&(Z.name==="tab"||this.isNavigating&&Z.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)=>Z!==z);else this.selectedValues=[...this.selectedValues,z];else this.selectedValues=[z]}#Y(z){if(z!==this.#$){this.#$=z;let Z=this.options;if(z)this.filteredOptions=Z.filter(($)=>this.#Q(z,$));else this.filteredOptions=[...Z];if(this.#z=Dz(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 Mz extends i{options;cursor=0;#z;getGroupItems(z){return this.options.filter((Z)=>Z.group===z)}isGroupSelected(z){let Z=this.getGroupItems(z),$=this.value;if($===void 0)return!1;return Z.every((Q)=>$.includes(Q.value))}toggleValue(){let z=this.options[this.cursor];if(this.value===void 0)this.value=[];if(z.group===!0){let Z=z.value,$=this.getGroupItems(Z);if(this.isGroupSelected(Z))this.value=this.value.filter((Q)=>$.findIndex((J)=>J.value===Q)===-1);else this.value=[...this.value,...$.map((Q)=>Q.value)];this.value=Array.from(new Set(this.value))}else{let Z=this.value.includes(z.value);this.value=Z?this.value.filter(($)=>$!==z.value):[...this.value,z.value]}}constructor(z){super(z,!1);let{options:Z}=z;this.#z=z.selectableGroups!==!1,this.options=Object.entries(Z).flatMap(([$,Q])=>[{value:$,group:!0,label:$},...Q.map((J)=>({...J,group:$}))]),this.value=[...z.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:$})=>$===z.cursorAt),this.#z?0:1),this.on("cursor",($)=>{switch($){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let Q=this.options[this.cursor]?.group===!0;if(!this.#z&&Q)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 Q=this.options[this.cursor]?.group===!0;if(!this.#z&&Q)this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}case"space":this.toggleValue();break}})}}var nz=L(M(),1);var az=L(M(),1);var cz=L(M(),1),T={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"]},I={primary:"blue",secondary:"cyan",success:"green",warning:"yellow",error:"red",info:"magenta",muted:"gray"};function Nz(){return!0}function Oz(){let z={};z.supportsColor=Nz();function Z(Q,J=[]){let Y=Q===""?[]:[...J,Q],X=function(F){if(!z.supportsColor)return F;let q="",j="";for(let G of Y)if(G in I&&I[G]in T){let H=I[G];q+=T[H][0],j=T[H][1]+j}else if(G in T)q+=T[G][0],j=T[G][1]+j;return q+F+j},U=[...Object.keys(T),...Object.keys(I)];for(let F of U)if(!(F in X))Object.defineProperty(X,F,{get(){return Z(F,Y)}});return X}let $=[...Object.keys(T),...Object.keys(I)];for(let Q of $)if(!(Q in z))Object.defineProperty(z,Q,{get(){return Z(Q)}});return z}var pz=Oz();var Tz=_6();var W=(z,Z)=>Tz?z:Z,iz=W("\u25C6","*"),rz=W("\u25A0","x"),sz=W("\u25B2","x"),ez=W("\u25C7","o"),tz=W("\u250C","T"),Bz=W("\u2502","|"),oz=W("\u2514","\u2014"),z0=W("\u25CF",">"),Z0=W("\u25CB"," "),$0=W("\u25FB","[\u2022]"),Q0=W("\u25FC","[+]"),J0=W("\u25FB","[ ]"),Y0=W("\u25AA","\u2022"),X0=W("\u2500","-"),U0=W("\u256E","+"),j0=W("\u251C","+"),q0=W("\u256F","+"),F0=W("\u25CF","\u2022"),G0=W("\u25C6","*"),H0=W("\u25B2","!"),K0=W("\u25A0","x");var V0=L(M(),1);var D0=L(M(),1);var W0=L(M(),1);var L0=L(M(),1);var w0=L(M(),1);var M0=L(M(),1);var N0=L(M(),1);var O0=L(M(),1);var T0=L(M(),1),B0=L(M(),1);var P0={light:W("\u2500","-"),heavy:W("\u2501","="),block:W("\u2588","#")};var I0=L(M(),1);var R0=L(M(),1);var Pz=L(M(),1);function Iz(){return`${Pz.default.gray(Bz)} `}var E0=Iz();var A0=L(M(),1);var b0=L(M(),1);var r="0.2.3";var N=new c("crosswind");async function S(z){if(z){if(!E(z))console.error(`\u274C Config file not found: ${z}`),B.exit(1);try{let Z=await import(z);return{...s,...Z.default||Z}}catch(Z){console.error(`\u274C Failed to load config file: ${z}`),console.error(Z),B.exit(1)}}return s}function T6(z,Z){return{...z,output:Z.output||z.output,minify:Z.minify??z.minify,content:Z.content?[Z.content]:z.content,verbose:Z.verbose??z.verbose}}async function e(z,Z){try{let $=Z.verbose?"\uD83D\uDE80 Building CSS (verbose mode)...":"\uD83D\uDE80 Building CSS...";if(console.log($),Z.verbose)console.log(`\uD83D\uDCC2 Content patterns: ${z.content.join(", ")}`),console.log(`\uD83D\uDCDD Output: ${z.output}`),console.log(`\uD83D\uDDDC\uFE0F Minify: ${z.minify?"Yes":"No"}`);let Q=await N6(z);if(console.log(`\u2705 Built ${Q.classes.size} classes in ${Q.duration.toFixed(2)}ms`),console.log(`\uD83D\uDCDD Output: ${z.output}`),Q.compiledClasses&&Q.compiledClasses.size>0){if(console.log(`\uD83D\uDD28 Compiled ${Q.compiledClasses.size} class groups`),Q.transformedFiles)console.log(`\uD83D\uDCDD Transformed ${Q.transformedFiles.size} files`);if(Z.verbose){console.log(`
25
+ \uD83D\uDCE6 Compiled classes:`);for(let[,{className:J,utilities:Y}]of Q.compiledClasses)console.log(` ${J} \u2190 ${Y.join(" ")}`)}}if(Z.verbose&&Q.classes.size>0){let J=Array.from(Q.classes).sort();console.log(`
26
+ \uD83D\uDCCB Classes found (${Q.classes.size}):`),J.forEach((Y)=>console.log(` - ${Y}`))}if(E(z.output)){let Y=(Bun.file(z.output).size/1024).toFixed(2);console.log(`\uD83D\uDCE6 File size: ${Y} KB`)}}catch($){if(console.error("\u274C Build failed:",$),Z.verbose&&$ instanceof Error)console.error($.stack);B.exit(1)}}function B6(z,Z){console.log("\uD83D\uDC40 Watching for changes...");let $=new Set;for(let Q of z.content){let J=Q.split("**")[0]||".";$.add(J)}for(let Q of $)Ez(Q,{recursive:!0},async(J,Y)=>{if(Y&&/\.(?:html|js|ts|jsx|tsx|stx)$/.test(Y))console.log(`
27
+ \uD83D\uDCDD ${Y} changed, rebuilding...`),await e(z,Z)});console.log(`
28
+ \uD83D\uDC40 Watching: ${Array.from($).join(", ")}`)}N.command("build","Build CSS from content files").option("--output <path>","Output CSS file path").option("--minify","Minify CSS output").option("--watch","Watch for file changes").option("--content <pattern>","Content file pattern (can override config)").option("--config <path>","Path to config file").option("--verbose","Show detailed output").option("--no-preflight","Skip preflight CSS").example("crosswind build").example("crosswind build --output ./dist/styles.css").example("crosswind build --minify --watch").example("crosswind build --verbose").example("crosswind build --config ./custom.config.ts").action(async(z)=>{let Z=await S(z.config),$=T6(Z,z);if(await e($,z),z.watch)B6($,z)});N.command("watch","Build and watch for changes").option("--output <path>","Output CSS file path").option("--minify","Minify CSS output").option("--content <pattern>","Content file pattern").option("--config <path>","Path to config file").option("--verbose","Show detailed output").example("crosswind watch").example("crosswind watch --output ./dist/styles.css").example("crosswind watch --verbose").action(async(z)=>{let Z=await S(z.config),$=T6(Z,z);await e($,z),B6($,z)});N.command("init","Create a crosswind.config.ts file").option("--force","Overwrite existing config file").example("crosswind init").example("crosswind init --force").action(async(z)=>{if(E("./crosswind.config.ts")&&!z.force)console.error("\u274C Config file already exists. Use --force to overwrite."),B.exit(1);let $=`import type { CrosswindOptions } from '@cwcss/crosswind'
29
+
30
+ const config = {
31
+ content: ['./src/**/*.{html,js,ts,jsx,tsx}'],
32
+ output: './dist/crosswind.css',
33
+ minify: false,
34
+ watch: false,
35
+ } satisfies CrosswindOptions
36
+
37
+ export default config
38
+ `;try{await Bun.write("./crosswind.config.ts",$),console.log("\u2705 Created crosswind.config.ts"),console.log(`
39
+ Next steps:`),console.log(" 1. Update the content paths in crosswind.config.ts"),console.log(" 2. Run: crosswind build")}catch(Q){console.error("\u274C Failed to create config file:",Q),B.exit(1)}});N.command("analyze","Analyze utility class usage").option("--config <path>","Path to config file").option("--verbose","Show detailed output").option("--json","Output as JSON").option("--top <n>","Show top N most used classes",{default:10}).example("crosswind analyze").example("crosswind analyze --top 20").example("crosswind analyze --json").action(async(z)=>{try{let Z=await S(z.config);if(!z.json)console.log(`\uD83D\uDD0D Analyzing utility classes...
40
+ `);let $=await M6(Z),Q=new Map;for(let Y of $.classes){let X=Y.split("-")[0].split(":").pop()||"other";if(!Q.has(X))Q.set(X,[]);Q.get(X).push(Y)}let J={totalClasses:$.classes.size,buildTime:$.duration,outputSize:E(Z.output)?Bun.file(Z.output).size:0,utilityGroups:Object.fromEntries(Array.from(Q.entries()).map(([Y,X])=>[Y,X.length]).sort((Y,X)=>X[1]-Y[1])),topClasses:Array.from($.classes).slice(0,z.top||10)};if(z.json)console.log(JSON.stringify(J,null,2));else{console.log(`\uD83D\uDCCA Total classes: ${J.totalClasses}`),console.log(`\u23F1\uFE0F Build time: ${J.buildTime.toFixed(2)}ms`),console.log(`\uD83D\uDCE6 Output size: ${(J.outputSize/1024).toFixed(2)} KB
41
+ `),console.log(`\uD83C\uDFF7\uFE0F Utility groups (top ${z.top}):`);let Y=Object.entries(J.utilityGroups).slice(0,z.top||10);for(let[X,U]of Y)console.log(` ${X.padEnd(20)} ${U} classes`);if(z.verbose){console.log(`
42
+ \uD83D\uDCCB All classes:`);for(let X of Array.from($.classes).sort())console.log(` - ${X}`)}}}catch(Z){console.error("\u274C Analysis failed:",Z),B.exit(1)}});N.command("clean","Remove the output CSS file").option("--config <path>","Path to config file").example("crosswind clean").action(async(z)=>{try{let Z=await S(z.config);if(!E(Z.output)){console.log("\u2139\uFE0F Output file does not exist");return}await Az(Z.output),console.log(`\u2705 Removed ${Z.output}`)}catch(Z){console.error("\u274C Failed to remove output file:",Z),B.exit(1)}});N.command("preflight","Generate preflight CSS only").option("--output <path>","Output CSS file path",{default:"./preflight.css"}).example("crosswind preflight").example("crosswind preflight --output ./reset.css").action(async(z)=>{try{let Z=z.output||"./preflight.css",$=O6.getCSS();await Bun.write(Z,$),console.log("\u2705 Generated preflight CSS"),console.log(`\uD83D\uDCDD Output: ${Z}`);let J=(Bun.file(Z).size/1024).toFixed(2);console.log(`\uD83D\uDCE6 File size: ${J} KB`)}catch(Z){console.error("\u274C Failed to generate preflight CSS:",Z),B.exit(1)}});N.command("version","Show the version of Crosswind").action(()=>{console.log(r)});N.version(r);N.help();N.parse();