@elysiumjs/styx 0.7.2 → 0.8.2

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/index.js CHANGED
@@ -1,112 +1,106 @@
1
1
  // @bun
2
- var g$=Object.create;var{getPrototypeOf:v$,defineProperty:H2,getOwnPropertyNames:y$}=Object;var d$=Object.prototype.hasOwnProperty;var V=(Y,$,H)=>{H=Y!=null?g$(v$(Y)):{};let Z=$||!Y||!Y.__esModule?H2(H,"default",{value:Y,enumerable:!0}):H;for(let X of y$(Y))if(!d$.call(Z,X))H2(Z,X,{get:()=>Y[X],enumerable:!0});return Z};var K=(Y,$)=>()=>($||Y(($={exports:{}}).exports,$),$.exports);var z=function(Y,$,H,Z){var X=arguments.length,U=X<3?$:Z===null?Z=Object.getOwnPropertyDescriptor($,H):Z,Q;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")U=Reflect.decorate(Y,$,H,Z);else for(var J=Y.length-1;J>=0;J--)if(Q=Y[J])U=(X<3?Q(U):X>3?Q($,H,U):Q($,H))||U;return X>3&&U&&Object.defineProperty($,H,U),U};var L=(Y,$)=>{if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(Y,$)};var _1=import.meta.require;var I=K((SU,U2)=>{var{FORCE_COLOR:c$,NODE_DISABLE_COLORS:l$,TERM:p$}=process.env,B={enabled:!l$&&p$!=="dumb"&&c$!=="0",reset:S(0,0),bold:S(1,22),dim:S(2,22),italic:S(3,23),underline:S(4,24),inverse:S(7,27),hidden:S(8,28),strikethrough:S(9,29),black:S(30,39),red:S(31,39),green:S(32,39),yellow:S(33,39),blue:S(34,39),magenta:S(35,39),cyan:S(36,39),white:S(37,39),gray:S(90,39),grey:S(90,39),bgBlack:S(40,49),bgRed:S(41,49),bgGreen:S(42,49),bgYellow:S(43,49),bgBlue:S(44,49),bgMagenta:S(45,49),bgCyan:S(46,49),bgWhite:S(47,49)};function Z2(Y,$){let H=0,Z,X="",U="";for(;H<Y.length;H++)if(Z=Y[H],X+=Z.open,U+=Z.close,$.includes(Z.close))$=$.replace(Z.rgx,Z.close+Z.open);return X+$+U}function n$(Y,$){let H={has:Y,keys:$};return H.reset=B.reset.bind(H),H.bold=B.bold.bind(H),H.dim=B.dim.bind(H),H.italic=B.italic.bind(H),H.underline=B.underline.bind(H),H.inverse=B.inverse.bind(H),H.hidden=B.hidden.bind(H),H.strikethrough=B.strikethrough.bind(H),H.black=B.black.bind(H),H.red=B.red.bind(H),H.green=B.green.bind(H),H.yellow=B.yellow.bind(H),H.blue=B.blue.bind(H),H.magenta=B.magenta.bind(H),H.cyan=B.cyan.bind(H),H.white=B.white.bind(H),H.gray=B.gray.bind(H),H.grey=B.grey.bind(H),H.bgBlack=B.bgBlack.bind(H),H.bgRed=B.bgRed.bind(H),H.bgGreen=B.bgGreen.bind(H),H.bgYellow=B.bgYellow.bind(H),H.bgBlue=B.bgBlue.bind(H),H.bgMagenta=B.bgMagenta.bind(H),H.bgCyan=B.bgCyan.bind(H),H.bgWhite=B.bgWhite.bind(H),H}function S(Y,$){let H={open:`\x1B[${Y}m`,close:`\x1B[${$}m`,rgx:new RegExp(`\\x1b\\[${$}m`,"g")};return function(Z){if(this!==void 0&&this.has!==void 0)return this.has.includes(Y)||(this.has.push(Y),this.keys.push(H)),Z===void 0?this:B.enabled?Z2(this.keys,Z+""):Z+"";return Z===void 0?n$([Y],[H]):B.enabled?Z2([H],Z+""):Z+""}}U2.exports=B});var Q2=K((RU,X2)=>{X2.exports=(Y,$)=>{if(Y.meta&&Y.name!=="escape")return;if(Y.ctrl){if(Y.name==="a")return"first";if(Y.name==="c")return"abort";if(Y.name==="d")return"abort";if(Y.name==="e")return"last";if(Y.name==="g")return"reset"}if($){if(Y.name==="j")return"down";if(Y.name==="k")return"up"}if(Y.name==="return")return"submit";if(Y.name==="enter")return"submit";if(Y.name==="backspace")return"delete";if(Y.name==="delete")return"deleteForward";if(Y.name==="abort")return"abort";if(Y.name==="escape")return"exit";if(Y.name==="tab")return"next";if(Y.name==="pagedown")return"nextPage";if(Y.name==="pageup")return"prevPage";if(Y.name==="home")return"home";if(Y.name==="end")return"end";if(Y.name==="up")return"up";if(Y.name==="down")return"down";if(Y.name==="right")return"right";if(Y.name==="left")return"left";return!1}});var k1=K((GU,J2)=>{J2.exports=(Y)=>{let $=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),H=new RegExp($,"g");return typeof Y==="string"?Y.replace(H,""):Y}});var O=K((IU,D2)=>{var Y0={to(Y,$){if(!$)return`\x1B[${Y+1}G`;return`\x1B[${$+1};${Y+1}H`},move(Y,$){let H="";if(Y<0)H+=`\x1B[${-Y}D`;else if(Y>0)H+=`\x1B[${Y}C`;if($<0)H+=`\x1B[${-$}A`;else if($>0)H+=`\x1B[${$}B`;return H},up:(Y=1)=>`\x1B[${Y}A`,down:(Y=1)=>`\x1B[${Y}B`,forward:(Y=1)=>`\x1B[${Y}C`,backward:(Y=1)=>`\x1B[${Y}D`,nextLine:(Y=1)=>"\x1B[E".repeat(Y),prevLine:(Y=1)=>"\x1B[F".repeat(Y),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},i$={up:(Y=1)=>"\x1B[S".repeat(Y),down:(Y=1)=>"\x1B[T".repeat(Y)},m$={screen:"\x1B[2J",up:(Y=1)=>"\x1B[1J".repeat(Y),down:(Y=1)=>"\x1B[J".repeat(Y),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(Y){let $="";for(let H=0;H<Y;H++)$+=this.line+(H<Y-1?Y0.up():"");if(Y)$+=Y0.left;return $}};D2.exports={cursor:Y0,scroll:i$,erase:m$,beep:"\x07"}});var B2=K((OU,L2)=>{function t$(Y,$){var H=typeof Symbol<"u"&&Y[Symbol.iterator]||Y["@@iterator"];if(!H){if(Array.isArray(Y)||(H=s$(Y))||$&&Y&&typeof Y.length==="number"){if(H)Y=H;var Z=0,X=function(){};return{s:X,n:function(){if(Z>=Y.length)return{done:!0};return{done:!1,value:Y[Z++]}},e:function(W){throw W},f:X}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var U=!0,Q=!1,J;return{s:function(){H=H.call(Y)},n:function(){var W=H.next();return U=W.done,W},e:function(W){Q=!0,J=W},f:function(){try{if(!U&&H.return!=null)H.return()}finally{if(Q)throw J}}}}function s$(Y,$){if(!Y)return;if(typeof Y==="string")return z2(Y,$);var H=Object.prototype.toString.call(Y).slice(8,-1);if(H==="Object"&&Y.constructor)H=Y.constructor.name;if(H==="Map"||H==="Set")return Array.from(Y);if(H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return z2(Y,$)}function z2(Y,$){if($==null||$>Y.length)$=Y.length;for(var H=0,Z=Array($);H<$;H++)Z[H]=Y[H];return Z}var o$=k1(),W2=O(),K2=W2.erase,r$=W2.cursor,a$=(Y)=>[...o$(Y)].length;L2.exports=function(Y,$){if(!$)return K2.line+r$.to(0);let H=0,Z=Y.split(/\r?\n/);var X=t$(Z),U;try{for(X.s();!(U=X.n()).done;){let Q=U.value;H+=1+Math.floor(Math.max(a$(Q)-1,0)/$)}}catch(Q){X.e(Q)}finally{X.f()}return K2.lines(H)}});var $0=K((FU,E2)=>{var L1={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},e$={arrowUp:L1.arrowUp,arrowDown:L1.arrowDown,arrowLeft:L1.arrowLeft,arrowRight:L1.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},YH=process.platform==="win32"?e$:L1;E2.exports=YH});var R2=K((VU,S2)=>{var X1=I(),H1=$0(),H0=Object.freeze({password:{scale:1,render:(Y)=>"*".repeat(Y.length)},emoji:{scale:2,render:(Y)=>"\uD83D\uDE03".repeat(Y.length)},invisible:{scale:0,render:(Y)=>""},default:{scale:1,render:(Y)=>`${Y}`}}),$H=(Y)=>H0[Y]||H0.default,B1=Object.freeze({aborted:X1.red(H1.cross),done:X1.green(H1.tick),exited:X1.yellow(H1.cross),default:X1.cyan("?")}),HH=(Y,$,H)=>$?B1.aborted:H?B1.exited:Y?B1.done:B1.default,ZH=(Y)=>X1.gray(Y?H1.ellipsis:H1.pointerSmall),UH=(Y,$)=>X1.gray(Y?$?H1.pointerSmall:"+":H1.line);S2.exports={styles:H0,render:$H,symbols:B1,symbol:HH,delimiter:ZH,item:UH}});var I2=K((AU,G2)=>{var XH=k1();G2.exports=function(Y,$){let H=String(XH(Y)||"").split(/\r?\n/);if(!$)return H.length;return H.map((Z)=>Math.ceil(Z.length/$)).reduce((Z,X)=>Z+X)}});var F2=K((MU,O2)=>{O2.exports=(Y,$={})=>{let H=Number.isSafeInteger(parseInt($.margin))?Array(parseInt($.margin)).fill(" ").join(""):$.margin||"",Z=$.width;return(Y||"").split(/\r?\n/g).map((X)=>X.split(/\s+/g).reduce((U,Q)=>{if(Q.length+H.length>=Z||U[U.length-1].length+Q.length+1<Z)U[U.length-1]+=` ${Q}`;else U.push(`${H}${Q}`);return U},[H]).join(`
2
+ var __create=Object.create;var{getPrototypeOf:__getProtoOf,defineProperty:__defProp,getOwnPropertyNames:__getOwnPropNames}=Object;var __hasOwnProp=Object.prototype.hasOwnProperty;function __accessProp(key){return this[key]}var __toESMCache_node,__toESMCache_esm,__toESM=(mod,isNodeMode,target)=>{var canCache=mod!=null&&typeof mod==="object";if(canCache){var cache=isNodeMode?__toESMCache_node??=new WeakMap:__toESMCache_esm??=new WeakMap,cached=cache.get(mod);if(cached)return cached}target=mod!=null?__create(__getProtoOf(mod)):{};let to=isNodeMode||!mod||!mod.__esModule||!__hasOwnProp.call(mod,"default")?__defProp(target,"default",{value:mod,enumerable:!0}):target;if(mod&&typeof mod==="object"||typeof mod==="function"){for(let key of __getOwnPropNames(mod))if(!__hasOwnProp.call(to,key))__defProp(to,key,{get:__accessProp.bind(mod,key),enumerable:!0})}if(canCache)cache.set(mod,to);return to};var __commonJS=(cb,mod)=>()=>(mod||cb((mod={exports:{}}).exports,mod),mod.exports);var __legacyDecorateClassTS=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};var __legacyMetadataTS=(k,v)=>{if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(k,v)};var __require=import.meta.require;var require_kleur=__commonJS(function(exports,module){var{FORCE_COLOR,NODE_DISABLE_COLORS,TERM}=process.env,$={enabled:!NODE_DISABLE_COLORS&&TERM!=="dumb"&&FORCE_COLOR!=="0",reset:init(0,0),bold:init(1,22),dim:init(2,22),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),grey:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49)};function run(arr,str){let i=0,tmp,beg="",end="";for(;i<arr.length;i++)if(tmp=arr[i],beg+=tmp.open,end+=tmp.close,str.includes(tmp.close))str=str.replace(tmp.rgx,tmp.close+tmp.open);return beg+str+end}function chain(has,keys){let ctx={has,keys};return ctx.reset=$.reset.bind(ctx),ctx.bold=$.bold.bind(ctx),ctx.dim=$.dim.bind(ctx),ctx.italic=$.italic.bind(ctx),ctx.underline=$.underline.bind(ctx),ctx.inverse=$.inverse.bind(ctx),ctx.hidden=$.hidden.bind(ctx),ctx.strikethrough=$.strikethrough.bind(ctx),ctx.black=$.black.bind(ctx),ctx.red=$.red.bind(ctx),ctx.green=$.green.bind(ctx),ctx.yellow=$.yellow.bind(ctx),ctx.blue=$.blue.bind(ctx),ctx.magenta=$.magenta.bind(ctx),ctx.cyan=$.cyan.bind(ctx),ctx.white=$.white.bind(ctx),ctx.gray=$.gray.bind(ctx),ctx.grey=$.grey.bind(ctx),ctx.bgBlack=$.bgBlack.bind(ctx),ctx.bgRed=$.bgRed.bind(ctx),ctx.bgGreen=$.bgGreen.bind(ctx),ctx.bgYellow=$.bgYellow.bind(ctx),ctx.bgBlue=$.bgBlue.bind(ctx),ctx.bgMagenta=$.bgMagenta.bind(ctx),ctx.bgCyan=$.bgCyan.bind(ctx),ctx.bgWhite=$.bgWhite.bind(ctx),ctx}function init(open,close){let blk={open:`\x1B[${open}m`,close:`\x1B[${close}m`,rgx:new RegExp(`\\x1b\\[${close}m`,"g")};return function(txt){if(this!==void 0&&this.has!==void 0)return this.has.includes(open)||(this.has.push(open),this.keys.push(blk)),txt===void 0?this:$.enabled?run(this.keys,txt+""):txt+"";return txt===void 0?chain([open],[blk]):$.enabled?run([blk],txt+""):txt+""}}module.exports=$});var require_action=__commonJS(function(exports,module){module.exports=(key,isSelect)=>{if(key.meta&&key.name!=="escape")return;if(key.ctrl){if(key.name==="a")return"first";if(key.name==="c")return"abort";if(key.name==="d")return"abort";if(key.name==="e")return"last";if(key.name==="g")return"reset"}if(isSelect){if(key.name==="j")return"down";if(key.name==="k")return"up"}if(key.name==="return")return"submit";if(key.name==="enter")return"submit";if(key.name==="backspace")return"delete";if(key.name==="delete")return"deleteForward";if(key.name==="abort")return"abort";if(key.name==="escape")return"exit";if(key.name==="tab")return"next";if(key.name==="pagedown")return"nextPage";if(key.name==="pageup")return"prevPage";if(key.name==="home")return"home";if(key.name==="end")return"end";if(key.name==="up")return"up";if(key.name==="down")return"down";if(key.name==="right")return"right";if(key.name==="left")return"left";return!1}});var require_strip=__commonJS(function(exports,module){module.exports=(str)=>{let pattern=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),RGX=new RegExp(pattern,"g");return typeof str==="string"?str.replace(RGX,""):str}});var require_src=__commonJS(function(exports,module){var cursor={to(x,y){if(!y)return`\x1B[${x+1}G`;return`\x1B[${y+1};${x+1}H`},move(x,y){let ret="";if(x<0)ret+=`\x1B[${-x}D`;else if(x>0)ret+=`\x1B[${x}C`;if(y<0)ret+=`\x1B[${-y}A`;else if(y>0)ret+=`\x1B[${y}B`;return ret},up:(count=1)=>`\x1B[${count}A`,down:(count=1)=>`\x1B[${count}B`,forward:(count=1)=>`\x1B[${count}C`,backward:(count=1)=>`\x1B[${count}D`,nextLine:(count=1)=>"\x1B[E".repeat(count),prevLine:(count=1)=>"\x1B[F".repeat(count),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},scroll={up:(count=1)=>"\x1B[S".repeat(count),down:(count=1)=>"\x1B[T".repeat(count)},erase={screen:"\x1B[2J",up:(count=1)=>"\x1B[1J".repeat(count),down:(count=1)=>"\x1B[J".repeat(count),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(count){let clear="";for(let i=0;i<count;i++)clear+=this.line+(i<count-1?cursor.up():"");if(count)clear+=cursor.left;return clear}};module.exports={cursor,scroll,erase,beep:"\x07"}});var require_clear=__commonJS(function(exports,module){function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0,F=function(){};return{s:F,n:function(){if(i>=o.length)return{done:!0};return{done:!1,value:o[i++]}},e:function(_e){throw _e},f:F}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var normalCompletion=!0,didErr=!1,err;return{s:function(){it=it.call(o)},n:function(){var step=it.next();return normalCompletion=step.done,step},e:function(_e2){didErr=!0,err=_e2},f:function(){try{if(!normalCompletion&&it.return!=null)it.return()}finally{if(didErr)throw err}}}}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}var strip=require_strip(),_require=require_src(),erase=_require.erase,cursor=_require.cursor,width=(str)=>[...strip(str)].length;module.exports=function(prompt,perLine){if(!perLine)return erase.line+cursor.to(0);let rows=0,lines=prompt.split(/\r?\n/);var _iterator=_createForOfIteratorHelper(lines),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){let line=_step.value;rows+=1+Math.floor(Math.max(width(line)-1,0)/perLine)}}catch(err){_iterator.e(err)}finally{_iterator.f()}return erase.lines(rows)}});var require_figures=__commonJS(function(exports,module){var main={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},win={arrowUp:main.arrowUp,arrowDown:main.arrowDown,arrowLeft:main.arrowLeft,arrowRight:main.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},figures=process.platform==="win32"?win:main;module.exports=figures});var require_style=__commonJS(function(exports,module){var c=require_kleur(),figures=require_figures(),styles=Object.freeze({password:{scale:1,render:(input)=>"*".repeat(input.length)},emoji:{scale:2,render:(input)=>"\uD83D\uDE03".repeat(input.length)},invisible:{scale:0,render:(input)=>""},default:{scale:1,render:(input)=>`${input}`}}),render=(type)=>styles[type]||styles.default,symbols=Object.freeze({aborted:c.red(figures.cross),done:c.green(figures.tick),exited:c.yellow(figures.cross),default:c.cyan("?")}),symbol=(done,aborted,exited)=>aborted?symbols.aborted:exited?symbols.exited:done?symbols.done:symbols.default,delimiter=(completing)=>c.gray(completing?figures.ellipsis:figures.pointerSmall),item=(expandable,expanded)=>c.gray(expandable?expanded?figures.pointerSmall:"+":figures.line);module.exports={styles,render,symbols,symbol,delimiter,item}});var require_lines=__commonJS(function(exports,module){var strip=require_strip();module.exports=function(msg,perLine){let lines=String(strip(msg)||"").split(/\r?\n/);if(!perLine)return lines.length;return lines.map((l)=>Math.ceil(l.length/perLine)).reduce((a,b)=>a+b)}});var require_wrap=__commonJS(function(exports,module){module.exports=(msg,opts={})=>{let tab=Number.isSafeInteger(parseInt(opts.margin))?Array(parseInt(opts.margin)).fill(" ").join(""):opts.margin||"",width=opts.width;return(msg||"").split(/\r?\n/g).map((line)=>line.split(/\s+/g).reduce((arr,w)=>{if(w.length+tab.length>=width||arr[arr.length-1].length+w.length+1<width)arr[arr.length-1]+=` ${w}`;else arr.push(`${tab}${w}`);return arr},[tab]).join(`
4
4
  `)).join(`
5
- `)}});var A2=K((qU,V2)=>{V2.exports=(Y,$,H)=>{H=H||$;let Z=Math.min($-H,Y-Math.floor(H/2));if(Z<0)Z=0;let X=Math.min(Z+H,$);return{startIndex:Z,endIndex:X}}});var C=K((NU,M2)=>{M2.exports={action:Q2(),clear:B2(),style:R2(),strip:k1(),figures:$0(),lines:I2(),wrap:F2(),entriesToDisplay:A2()}});var y=K((TU,P2)=>{var q2=_1("readline"),QH=C(),JH=QH.action,DH=_1("events"),N2=O(),zH=N2.beep,KH=N2.cursor,WH=I();class T2 extends DH{constructor(Y={}){super();this.firstRender=!0,this.in=Y.stdin||process.stdin,this.out=Y.stdout||process.stdout,this.onRender=(Y.onRender||(()=>{return})).bind(this);let $=q2.createInterface({input:this.in,escapeCodeTimeout:50});if(q2.emitKeypressEvents(this.in,$),this.in.isTTY)this.in.setRawMode(!0);let H=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,Z=(X,U)=>{let Q=JH(U,H);if(Q===!1)this._&&this._(X,U);else if(typeof this[Q]==="function")this[Q](U);else this.bell()};this.close=()=>{if(this.out.write(KH.show),this.in.removeListener("keypress",Z),this.in.isTTY)this.in.setRawMode(!1);$.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",Z)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(zH)}render(){if(this.onRender(WH),this.firstRender)this.firstRender=!1}}P2.exports=T2});var x2=K((PU,h2)=>{function C2(Y,$,H,Z,X,U,Q){try{var J=Y[U](Q),D=J.value}catch(W){H(W);return}if(J.done)$(D);else Promise.resolve(D).then(Z,X)}function j2(Y){return function(){var $=this,H=arguments;return new Promise(function(Z,X){var U=Y.apply($,H);function Q(D){C2(U,Z,X,Q,J,"next",D)}function J(D){C2(U,Z,X,Q,J,"throw",D)}Q(void 0)})}}var h1=I(),LH=y(),_2=O(),BH=_2.erase,E1=_2.cursor,x1=C(),Z0=x1.style,U0=x1.clear,EH=x1.lines,SH=x1.figures;class k2 extends LH{constructor(Y={}){super(Y);this.transform=Z0.render(Y.style),this.scale=this.transform.scale,this.msg=Y.message,this.initial=Y.initial||"",this.validator=Y.validate||(()=>!0),this.value="",this.errorMsg=Y.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=U0("",this.out.columns),this.render()}set value(Y){if(!Y&&this.initial)this.placeholder=!0,this.rendered=h1.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render(Y);this._value=Y,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
6
- `),this.close()}validate(){var Y=this;return j2(function*(){let $=yield Y.validator(Y.value);if(typeof $==="string")Y.errorMsg=$,$=!1;Y.error=!$})()}submit(){var Y=this;return j2(function*(){if(Y.value=Y.value||Y.initial,Y.cursorOffset=0,Y.cursor=Y.rendered.length,yield Y.validate(),Y.error){Y.red=!0,Y.fire(),Y.render();return}Y.done=!0,Y.aborted=!1,Y.fire(),Y.render(),Y.out.write(`
7
- `),Y.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(Y){if(this.placeholder)return;this.cursor=this.cursor+Y,this.cursorOffset+=Y}_(Y,$){let H=this.value.slice(0,this.cursor),Z=this.value.slice(this.cursor);this.value=`${H}${Y}${Z}`,this.red=!1,this.cursor=this.placeholder?0:H.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let Y=this.value.slice(0,this.cursor-1),$=this.value.slice(this.cursor);if(this.value=`${Y}${$}`,this.red=!1,this.isCursorAtStart())this.cursorOffset=0;else this.cursorOffset++,this.moveCursor(-1);this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let Y=this.value.slice(0,this.cursor),$=this.value.slice(this.cursor+1);if(this.value=`${Y}${$}`,this.red=!1,this.isCursorAtEnd())this.cursorOffset=0;else this.cursorOffset++;this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(E1.down(EH(this.outputError,this.out.columns)-1)+U0(this.outputError,this.out.columns));this.out.write(U0(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[Z0.symbol(this.done,this.aborted),h1.bold(this.msg),Z0.delimiter(this.done),this.red?h1.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
8
- `).reduce((Y,$,H)=>Y+`
9
- ${H?" ":SH.pointerSmall} ${h1.red().italic($)}`,"");this.out.write(BH.line+E1.to(0)+this.outputText+E1.save+this.outputError+E1.restore+E1.move(this.cursorOffset,0))}}h2.exports=k2});var v2=K((CU,g2)=>{var d=I(),RH=y(),S1=C(),b2=S1.style,f2=S1.clear,b1=S1.figures,GH=S1.wrap,IH=S1.entriesToDisplay,OH=O(),FH=OH.cursor;class w2 extends RH{constructor(Y={}){super(Y);this.msg=Y.message,this.hint=Y.hint||"- Use arrow-keys. Return to submit.",this.warn=Y.warn||"- This option is disabled",this.cursor=Y.initial||0,this.choices=Y.choices.map(($,H)=>{if(typeof $==="string")$={title:$,value:H};return{title:$&&($.title||$.value||$),value:$&&($.value===void 0?H:$.value),description:$&&$.description,selected:$&&$.selected,disabled:$&&$.disabled}}),this.optionsPerPage=Y.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=f2("",this.out.columns),this.render()}moveCursor(Y){this.cursor=Y,this.value=this.choices[Y].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
5
+ `)}});var require_entriesToDisplay=__commonJS(function(exports,module){module.exports=(cursor,total,maxVisible)=>{maxVisible=maxVisible||total;let startIndex=Math.min(total-maxVisible,cursor-Math.floor(maxVisible/2));if(startIndex<0)startIndex=0;let endIndex=Math.min(startIndex+maxVisible,total);return{startIndex,endIndex}}});var require_util=__commonJS(function(exports,module){module.exports={action:require_action(),clear:require_clear(),style:require_style(),strip:require_strip(),figures:require_figures(),lines:require_lines(),wrap:require_wrap(),entriesToDisplay:require_entriesToDisplay()}});var require_prompt=__commonJS(function(exports,module){var readline=__require("readline"),_require=require_util(),action=_require.action,EventEmitter=__require("events"),_require2=require_src(),beep=_require2.beep,cursor=_require2.cursor,color=require_kleur();class Prompt extends EventEmitter{constructor(opts={}){super();this.firstRender=!0,this.in=opts.stdin||process.stdin,this.out=opts.stdout||process.stdout,this.onRender=(opts.onRender||(()=>{return})).bind(this);let rl=readline.createInterface({input:this.in,escapeCodeTimeout:50});if(readline.emitKeypressEvents(this.in,rl),this.in.isTTY)this.in.setRawMode(!0);let isSelect=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,keypress=(str,key)=>{let a=action(key,isSelect);if(a===!1)this._&&this._(str,key);else if(typeof this[a]==="function")this[a](key);else this.bell()};this.close=()=>{if(this.out.write(cursor.show),this.in.removeListener("keypress",keypress),this.in.isTTY)this.in.setRawMode(!1);rl.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(beep)}render(){if(this.onRender(color),this.firstRender)this.firstRender=!1}}module.exports=Prompt});var require_text=__commonJS(function(exports,module){function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}if(info.done)resolve(value);else Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)})}}var color=require_kleur(),Prompt=require_prompt(),_require=require_src(),erase=_require.erase,cursor=_require.cursor,_require2=require_util(),style=_require2.style,clear=_require2.clear,lines=_require2.lines,figures=_require2.figures;class TextPrompt extends Prompt{constructor(opts={}){super(opts);this.transform=style.render(opts.style),this.scale=this.transform.scale,this.msg=opts.message,this.initial=opts.initial||"",this.validator=opts.validate||(()=>!0),this.value="",this.errorMsg=opts.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=clear("",this.out.columns),this.render()}set value(v){if(!v&&this.initial)this.placeholder=!0,this.rendered=color.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render(v);this._value=v,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
6
+ `),this.close()}validate(){var _this=this;return _asyncToGenerator(function*(){let valid=yield _this.validator(_this.value);if(typeof valid==="string")_this.errorMsg=valid,valid=!1;_this.error=!valid})()}submit(){var _this2=this;return _asyncToGenerator(function*(){if(_this2.value=_this2.value||_this2.initial,_this2.cursorOffset=0,_this2.cursor=_this2.rendered.length,yield _this2.validate(),_this2.error){_this2.red=!0,_this2.fire(),_this2.render();return}_this2.done=!0,_this2.aborted=!1,_this2.fire(),_this2.render(),_this2.out.write(`
7
+ `),_this2.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(n){if(this.placeholder)return;this.cursor=this.cursor+n,this.cursorOffset+=n}_(c,key){let s1=this.value.slice(0,this.cursor),s2=this.value.slice(this.cursor);this.value=`${s1}${c}${s2}`,this.red=!1,this.cursor=this.placeholder?0:s1.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let s1=this.value.slice(0,this.cursor-1),s2=this.value.slice(this.cursor);if(this.value=`${s1}${s2}`,this.red=!1,this.isCursorAtStart())this.cursorOffset=0;else this.cursorOffset++,this.moveCursor(-1);this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let s1=this.value.slice(0,this.cursor),s2=this.value.slice(this.cursor+1);if(this.value=`${s1}${s2}`,this.red=!1,this.isCursorAtEnd())this.cursorOffset=0;else this.cursorOffset++;this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(cursor.down(lines(this.outputError,this.out.columns)-1)+clear(this.outputError,this.out.columns));this.out.write(clear(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(this.done),this.red?color.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
8
+ `).reduce((a,l,i)=>a+`
9
+ ${i?" ":figures.pointerSmall} ${color.red().italic(l)}`,"");this.out.write(erase.line+cursor.to(0)+this.outputText+cursor.save+this.outputError+cursor.restore+cursor.move(this.cursorOffset,0))}}module.exports=TextPrompt});var require_select=__commonJS(function(exports,module){var color=require_kleur(),Prompt=require_prompt(),_require=require_util(),style=_require.style,clear=_require.clear,figures=_require.figures,wrap=_require.wrap,entriesToDisplay=_require.entriesToDisplay,_require2=require_src(),cursor=_require2.cursor;class SelectPrompt extends Prompt{constructor(opts={}){super(opts);this.msg=opts.message,this.hint=opts.hint||"- Use arrow-keys. Return to submit.",this.warn=opts.warn||"- This option is disabled",this.cursor=opts.initial||0,this.choices=opts.choices.map((ch,idx)=>{if(typeof ch==="string")ch={title:ch,value:idx};return{title:ch&&(ch.title||ch.value||ch),value:ch&&(ch.value===void 0?idx:ch.value),description:ch&&ch.description,selected:ch&&ch.selected,disabled:ch&&ch.disabled}}),this.optionsPerPage=opts.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=clear("",this.out.columns),this.render()}moveCursor(n){this.cursor=n,this.value=this.choices[n].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
10
10
  `),this.close()}submit(){if(!this.selection.disabled)this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
11
- `),this.close();else this.bell()}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){if(this.cursor===0)this.moveCursor(this.choices.length-1);else this.moveCursor(this.cursor-1);this.render()}down(){if(this.cursor===this.choices.length-1)this.moveCursor(0);else this.moveCursor(this.cursor+1);this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(Y,$){if(Y===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(FH.hide);else this.out.write(f2(this.outputText,this.out.columns));super.render();let Y=IH(this.cursor,this.choices.length,this.optionsPerPage),$=Y.startIndex,H=Y.endIndex;if(this.outputText=[b2.symbol(this.done,this.aborted),d.bold(this.msg),b2.delimiter(!1),this.done?this.selection.title:this.selection.disabled?d.yellow(this.warn):d.gray(this.hint)].join(" "),!this.done){this.outputText+=`
12
- `;for(let Z=$;Z<H;Z++){let X,U,Q="",J=this.choices[Z];if(Z===$&&$>0)U=b1.arrowUp;else if(Z===H-1&&H<this.choices.length)U=b1.arrowDown;else U=" ";if(J.disabled)X=this.cursor===Z?d.gray().underline(J.title):d.strikethrough().gray(J.title),U=(this.cursor===Z?d.bold().gray(b1.pointer)+" ":" ")+U;else if(X=this.cursor===Z?d.cyan().underline(J.title):J.title,U=(this.cursor===Z?d.cyan(b1.pointer)+" ":" ")+U,J.description&&this.cursor===Z){if(Q=` - ${J.description}`,U.length+X.length+Q.length>=this.out.columns||J.description.split(/\r?\n/).length>1)Q=`
13
- `+GH(J.description,{margin:3,width:this.out.columns})}this.outputText+=`${U} ${X}${d.gray(Q)}
14
- `}}this.out.write(this.outputText)}}g2.exports=w2});var n2=K((jU,p2)=>{var f1=I(),VH=y(),u2=C(),y2=u2.style,AH=u2.clear,c2=O(),d2=c2.cursor,MH=c2.erase;class l2 extends VH{constructor(Y={}){super(Y);this.msg=Y.message,this.value=!!Y.initial,this.active=Y.active||"on",this.inactive=Y.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
11
+ `),this.close();else this.bell()}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){if(this.cursor===0)this.moveCursor(this.choices.length-1);else this.moveCursor(this.cursor-1);this.render()}down(){if(this.cursor===this.choices.length-1)this.moveCursor(0);else this.moveCursor(this.cursor+1);this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(c,key){if(c===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);else this.out.write(clear(this.outputText,this.out.columns));super.render();let _entriesToDisplay=entriesToDisplay(this.cursor,this.choices.length,this.optionsPerPage),{startIndex,endIndex}=_entriesToDisplay;if(this.outputText=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(!1),this.done?this.selection.title:this.selection.disabled?color.yellow(this.warn):color.gray(this.hint)].join(" "),!this.done){this.outputText+=`
12
+ `;for(let i=startIndex;i<endIndex;i++){let title,prefix,desc="",v=this.choices[i];if(i===startIndex&&startIndex>0)prefix=figures.arrowUp;else if(i===endIndex-1&&endIndex<this.choices.length)prefix=figures.arrowDown;else prefix=" ";if(v.disabled)title=this.cursor===i?color.gray().underline(v.title):color.strikethrough().gray(v.title),prefix=(this.cursor===i?color.bold().gray(figures.pointer)+" ":" ")+prefix;else if(title=this.cursor===i?color.cyan().underline(v.title):v.title,prefix=(this.cursor===i?color.cyan(figures.pointer)+" ":" ")+prefix,v.description&&this.cursor===i){if(desc=` - ${v.description}`,prefix.length+title.length+desc.length>=this.out.columns||v.description.split(/\r?\n/).length>1)desc=`
13
+ `+wrap(v.description,{margin:3,width:this.out.columns})}this.outputText+=`${prefix} ${title}${color.gray(desc)}
14
+ `}}this.out.write(this.outputText)}}module.exports=SelectPrompt});var require_toggle=__commonJS(function(exports,module){var color=require_kleur(),Prompt=require_prompt(),_require=require_util(),style=_require.style,clear=_require.clear,_require2=require_src(),cursor=_require2.cursor,erase=_require2.erase;class TogglePrompt extends Prompt{constructor(opts={}){super(opts);this.msg=opts.message,this.value=!!opts.initial,this.active=opts.active||"on",this.inactive=opts.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
15
15
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
16
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(Y,$){if(Y===" ")this.value=!this.value;else if(Y==="1")this.value=!0;else if(Y==="0")this.value=!1;else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(d2.hide);else this.out.write(AH(this.outputText,this.out.columns));super.render(),this.outputText=[y2.symbol(this.done,this.aborted),f1.bold(this.msg),y2.delimiter(this.done),this.value?this.inactive:f1.cyan().underline(this.inactive),f1.gray("/"),this.value?f1.cyan().underline(this.active):this.active].join(" "),this.out.write(MH.line+d2.to(0)+this.outputText)}}p2.exports=l2});var k=K((_U,i2)=>{class w1{constructor({token:Y,date:$,parts:H,locales:Z}){this.token=Y,this.date=$||new Date,this.parts=H||[this],this.locales=Z||{}}up(){}down(){}next(){let Y=this.parts.indexOf(this);return this.parts.find(($,H)=>H>Y&&$ instanceof w1)}setTo(Y){}prev(){let Y=[].concat(this.parts).reverse(),$=Y.indexOf(this);return Y.find((H,Z)=>Z>$&&H instanceof w1)}toString(){return String(this.date)}}i2.exports=w1});var s2=K((kU,t2)=>{var qH=k();class m2 extends qH{constructor(Y={}){super(Y)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let Y=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?Y.toUpperCase():Y}}t2.exports=m2});var a2=K((hU,r2)=>{var NH=k(),TH=(Y)=>{return Y=Y%10,Y===1?"st":Y===2?"nd":Y===3?"rd":"th"};class o2 extends NH{constructor(Y={}){super(Y)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(Y){this.date.setDate(parseInt(Y.substr(-2)))}toString(){let Y=this.date.getDate(),$=this.date.getDay();return this.token==="DD"?String(Y).padStart(2,"0"):this.token==="Do"?Y+TH(Y):this.token==="d"?$+1:this.token==="ddd"?this.locales.weekdaysShort[$]:this.token==="dddd"?this.locales.weekdays[$]:Y}}r2.exports=o2});var $4=K((xU,Y4)=>{var PH=k();class e2 extends PH{constructor(Y={}){super(Y)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(Y){this.date.setHours(parseInt(Y.substr(-2)))}toString(){let Y=this.date.getHours();if(/h/.test(this.token))Y=Y%12||12;return this.token.length>1?String(Y).padStart(2,"0"):Y}}Y4.exports=e2});var U4=K((bU,Z4)=>{var CH=k();class H4 extends CH{constructor(Y={}){super(Y)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(Y){this.date.setMilliseconds(parseInt(Y.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}Z4.exports=H4});var J4=K((fU,Q4)=>{var jH=k();class X4 extends jH{constructor(Y={}){super(Y)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(Y){this.date.setMinutes(parseInt(Y.substr(-2)))}toString(){let Y=this.date.getMinutes();return this.token.length>1?String(Y).padStart(2,"0"):Y}}Q4.exports=X4});var K4=K((wU,z4)=>{var _H=k();class D4 extends _H{constructor(Y={}){super(Y)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(Y){Y=parseInt(Y.substr(-2))-1,this.date.setMonth(Y<0?0:Y)}toString(){let Y=this.date.getMonth(),$=this.token.length;return $===2?String(Y+1).padStart(2,"0"):$===3?this.locales.monthsShort[Y]:$===4?this.locales.months[Y]:String(Y+1)}}z4.exports=D4});var B4=K((gU,L4)=>{var kH=k();class W4 extends kH{constructor(Y={}){super(Y)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(Y){this.date.setSeconds(parseInt(Y.substr(-2)))}toString(){let Y=this.date.getSeconds();return this.token.length>1?String(Y).padStart(2,"0"):Y}}L4.exports=W4});var R4=K((vU,S4)=>{var hH=k();class E4 extends hH{constructor(Y={}){super(Y)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(Y){this.date.setFullYear(Y.substr(-4))}toString(){let Y=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?Y.substr(-2):Y}}S4.exports=E4});var I4=K((yU,G4)=>{G4.exports={DatePart:k(),Meridiem:s2(),Day:a2(),Hours:$4(),Milliseconds:U4(),Minutes:J4(),Month:K4(),Seconds:B4(),Year:R4()}});var j4=K((dU,C4)=>{function O4(Y,$,H,Z,X,U,Q){try{var J=Y[U](Q),D=J.value}catch(W){H(W);return}if(J.done)$(D);else Promise.resolve(D).then(Z,X)}function F4(Y){return function(){var $=this,H=arguments;return new Promise(function(Z,X){var U=Y.apply($,H);function Q(D){O4(U,Z,X,Q,J,"next",D)}function J(D){O4(U,Z,X,Q,J,"throw",D)}Q(void 0)})}}var X0=I(),xH=y(),Q0=C(),V4=Q0.style,A4=Q0.clear,bH=Q0.figures,T4=O(),fH=T4.erase,M4=T4.cursor,u=I4(),q4=u.DatePart,wH=u.Meridiem,gH=u.Day,vH=u.Hours,yH=u.Milliseconds,dH=u.Minutes,uH=u.Month,cH=u.Seconds,lH=u.Year,pH=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,N4={1:({token:Y})=>Y.replace(/\\(.)/g,"$1"),2:(Y)=>new gH(Y),3:(Y)=>new uH(Y),4:(Y)=>new lH(Y),5:(Y)=>new wH(Y),6:(Y)=>new vH(Y),7:(Y)=>new dH(Y),8:(Y)=>new cH(Y),9:(Y)=>new yH(Y)},nH={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class P4 extends xH{constructor(Y={}){super(Y);this.msg=Y.message,this.cursor=0,this.typed="",this.locales=Object.assign(nH,Y.locales),this._date=Y.initial||new Date,this.errorMsg=Y.error||"Please Enter A Valid Value",this.validator=Y.validate||(()=>!0),this.mask=Y.mask||"YYYY-MM-DD HH:mm:ss",this.clear=A4("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(Y){if(Y)this._date.setTime(Y.getTime())}set mask(Y){let $;this.parts=[];while($=pH.exec(Y)){let Z=$.shift(),X=$.findIndex((U)=>U!=null);this.parts.push(X in N4?N4[X]({token:$[X]||Z,date:this.date,parts:this.parts,locales:this.locales}):$[X]||Z)}let H=this.parts.reduce((Z,X)=>{if(typeof X==="string"&&typeof Z[Z.length-1]==="string")Z[Z.length-1]+=X;else Z.push(X);return Z},[]);this.parts.splice(0),this.parts.push(...H),this.reset()}moveCursor(Y){this.typed="",this.cursor=Y,this.fire()}reset(){this.moveCursor(this.parts.findIndex((Y)=>Y instanceof q4)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
17
- `),this.close()}validate(){var Y=this;return F4(function*(){let $=yield Y.validator(Y.value);if(typeof $==="string")Y.errorMsg=$,$=!1;Y.error=!$})()}submit(){var Y=this;return F4(function*(){if(yield Y.validate(),Y.error){Y.color="red",Y.fire(),Y.render();return}Y.done=!0,Y.aborted=!1,Y.fire(),Y.render(),Y.out.write(`
18
- `),Y.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let Y=this.parts[this.cursor].prev();if(Y==null)return this.bell();this.moveCursor(this.parts.indexOf(Y)),this.render()}right(){let Y=this.parts[this.cursor].next();if(Y==null)return this.bell();this.moveCursor(this.parts.indexOf(Y)),this.render()}next(){let Y=this.parts[this.cursor].next();this.moveCursor(Y?this.parts.indexOf(Y):this.parts.findIndex(($)=>$ instanceof q4)),this.render()}_(Y){if(/\d/.test(Y))this.typed+=Y,this.parts[this.cursor].setTo(this.typed),this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(M4.hide);else this.out.write(A4(this.outputText,this.out.columns));if(super.render(),this.outputText=[V4.symbol(this.done,this.aborted),X0.bold(this.msg),V4.delimiter(!1),this.parts.reduce((Y,$,H)=>Y.concat(H===this.cursor&&!this.done?X0.cyan().underline($.toString()):$),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split(`
19
- `).reduce((Y,$,H)=>Y+`
20
- ${H?" ":bH.pointerSmall} ${X0.red().italic($)}`,"");this.out.write(fH.line+M4.to(0)+this.outputText)}}C4.exports=P4});var g4=K((uU,w4)=>{function _4(Y,$,H,Z,X,U,Q){try{var J=Y[U](Q),D=J.value}catch(W){H(W);return}if(J.done)$(D);else Promise.resolve(D).then(Z,X)}function k4(Y){return function(){var $=this,H=arguments;return new Promise(function(Z,X){var U=Y.apply($,H);function Q(D){_4(U,Z,X,Q,J,"next",D)}function J(D){_4(U,Z,X,Q,J,"throw",D)}Q(void 0)})}}var g1=I(),iH=y(),b4=O(),v1=b4.cursor,mH=b4.erase,y1=C(),J0=y1.style,tH=y1.figures,h4=y1.clear,sH=y1.lines,oH=/[0-9]/,D0=(Y)=>Y!==void 0,x4=(Y,$)=>{let H=Math.pow(10,$);return Math.round(Y*H)/H};class f4 extends iH{constructor(Y={}){super(Y);this.transform=J0.render(Y.style),this.msg=Y.message,this.initial=D0(Y.initial)?Y.initial:"",this.float=!!Y.float,this.round=Y.round||2,this.inc=Y.increment||1,this.min=D0(Y.min)?Y.min:-1/0,this.max=D0(Y.max)?Y.max:1/0,this.errorMsg=Y.error||"Please Enter A Valid Value",this.validator=Y.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(Y){if(!Y&&Y!==0)this.placeholder=!0,this.rendered=g1.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${x4(Y,this.round)}`),this._value=x4(Y,this.round);this.fire()}get value(){return this._value}parse(Y){return this.float?parseFloat(Y):parseInt(Y)}valid(Y){return Y==="-"||Y==="."&&this.float||oH.test(Y)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let Y=this.value;this.value=Y!==""?Y:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
21
- `),this.close()}validate(){var Y=this;return k4(function*(){let $=yield Y.validator(Y.value);if(typeof $==="string")Y.errorMsg=$,$=!1;Y.error=!$})()}submit(){var Y=this;return k4(function*(){if(yield Y.validate(),Y.error){Y.color="red",Y.fire(),Y.render();return}let $=Y.value;Y.value=$!==""?$:Y.initial,Y.done=!0,Y.aborted=!1,Y.error=!1,Y.fire(),Y.render(),Y.out.write(`
22
- `),Y.close()})()}up(){if(this.typed="",this.value==="")this.value=this.min-this.inc;if(this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value==="")this.value=this.min+this.inc;if(this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let Y=this.value.toString();if(Y.length===0)return this.bell();if(this.value=this.parse(Y=Y.slice(0,-1))||"",this.value!==""&&this.value<this.min)this.value=this.min;this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(Y,$){if(!this.valid(Y))return this.bell();let H=Date.now();if(H-this.lastHit>1000)this.typed="";if(this.typed+=Y,this.lastHit=H,this.color="cyan",Y===".")return this.fire();if(this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire(),this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(v1.down(sH(this.outputError,this.out.columns)-1)+h4(this.outputError,this.out.columns));this.out.write(h4(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[J0.symbol(this.done,this.aborted),g1.bold(this.msg),J0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?g1[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
23
- `).reduce((Y,$,H)=>Y+`
24
- ${H?" ":tH.pointerSmall} ${g1.red().italic($)}`,"");this.out.write(mH.line+v1.to(0)+this.outputText+v1.save+this.outputError+v1.restore)}}w4.exports=f4});var z0=K((cU,u4)=>{var h=I(),rH=O(),aH=rH.cursor,eH=y(),R1=C(),v4=R1.clear,o=R1.figures,y4=R1.style,YZ=R1.wrap,$Z=R1.entriesToDisplay;class d4 extends eH{constructor(Y={}){super(Y);if(this.msg=Y.message,this.cursor=Y.cursor||0,this.scrollIndex=Y.cursor||0,this.hint=Y.hint||"",this.warn=Y.warn||"- This option is disabled -",this.minSelected=Y.min,this.showMinError=!1,this.maxChoices=Y.max,this.instructions=Y.instructions,this.optionsPerPage=Y.optionsPerPage||10,this.value=Y.choices.map(($,H)=>{if(typeof $==="string")$={title:$,value:H};return{title:$&&($.title||$.value||$),description:$&&$.description,value:$&&($.value===void 0?H:$.value),selected:$&&$.selected,disabled:$&&$.disabled}}),this.clear=v4("",this.out.columns),!Y.overrideRender)this.render()}reset(){this.value.map((Y)=>!Y.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((Y)=>Y.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
25
- `),this.close()}submit(){let Y=this.value.filter(($)=>$.selected);if(this.minSelected&&Y.length<this.minSelected)this.showMinError=!0,this.render();else this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
26
- `),this.close()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){if(this.cursor===0)this.cursor=this.value.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.value.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((Y)=>Y.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let Y=this.value[this.cursor];if(Y.selected)Y.selected=!1,this.render();else if(Y.disabled||this.value.filter(($)=>$.selected).length>=this.maxChoices)return this.bell();else Y.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let Y=!this.value[this.cursor].selected;this.value.filter(($)=>!$.disabled).forEach(($)=>$.selected=Y),this.render()}_(Y,$){if(Y===" ")this.handleSpaceToggle();else if(Y==="a")this.toggleAll();else return this.bell()}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
16
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(c,key){if(c===" ")this.value=!this.value;else if(c==="1")this.value=!0;else if(c==="0")this.value=!1;else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);else this.out.write(clear(this.outputText,this.out.columns));super.render(),this.outputText=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(this.done),this.value?this.inactive:color.cyan().underline(this.inactive),color.gray("/"),this.value?color.cyan().underline(this.active):this.active].join(" "),this.out.write(erase.line+cursor.to(0)+this.outputText)}}module.exports=TogglePrompt});var require_datepart=__commonJS(function(exports,module){class DatePart{constructor({token,date,parts,locales}){this.token=token,this.date=date||new Date,this.parts=parts||[this],this.locales=locales||{}}up(){}down(){}next(){let currentIdx=this.parts.indexOf(this);return this.parts.find((part,idx)=>idx>currentIdx&&part instanceof DatePart)}setTo(val){}prev(){let parts=[].concat(this.parts).reverse(),currentIdx=parts.indexOf(this);return parts.find((part,idx)=>idx>currentIdx&&part instanceof DatePart)}toString(){return String(this.date)}}module.exports=DatePart});var require_meridiem=__commonJS(function(exports,module){var DatePart=require_datepart();class Meridiem extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let meridiem=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?meridiem.toUpperCase():meridiem}}module.exports=Meridiem});var require_day=__commonJS(function(exports,module){var DatePart=require_datepart(),pos=(n)=>(n=n%10,n===1?"st":n===2?"nd":n===3?"rd":"th");class Day extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(val){this.date.setDate(parseInt(val.substr(-2)))}toString(){let date=this.date.getDate(),day=this.date.getDay();return this.token==="DD"?String(date).padStart(2,"0"):this.token==="Do"?date+pos(date):this.token==="d"?day+1:this.token==="ddd"?this.locales.weekdaysShort[day]:this.token==="dddd"?this.locales.weekdays[day]:date}}module.exports=Day});var require_hours=__commonJS(function(exports,module){var DatePart=require_datepart();class Hours extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(val){this.date.setHours(parseInt(val.substr(-2)))}toString(){let hours=this.date.getHours();if(/h/.test(this.token))hours=hours%12||12;return this.token.length>1?String(hours).padStart(2,"0"):hours}}module.exports=Hours});var require_milliseconds=__commonJS(function(exports,module){var DatePart=require_datepart();class Milliseconds extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(val){this.date.setMilliseconds(parseInt(val.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}module.exports=Milliseconds});var require_minutes=__commonJS(function(exports,module){var DatePart=require_datepart();class Minutes extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(val){this.date.setMinutes(parseInt(val.substr(-2)))}toString(){let m=this.date.getMinutes();return this.token.length>1?String(m).padStart(2,"0"):m}}module.exports=Minutes});var require_month=__commonJS(function(exports,module){var DatePart=require_datepart();class Month extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(val){val=parseInt(val.substr(-2))-1,this.date.setMonth(val<0?0:val)}toString(){let month=this.date.getMonth(),tl=this.token.length;return tl===2?String(month+1).padStart(2,"0"):tl===3?this.locales.monthsShort[month]:tl===4?this.locales.months[month]:String(month+1)}}module.exports=Month});var require_seconds=__commonJS(function(exports,module){var DatePart=require_datepart();class Seconds extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(val){this.date.setSeconds(parseInt(val.substr(-2)))}toString(){let s=this.date.getSeconds();return this.token.length>1?String(s).padStart(2,"0"):s}}module.exports=Seconds});var require_year=__commonJS(function(exports,module){var DatePart=require_datepart();class Year extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(val){this.date.setFullYear(val.substr(-4))}toString(){let year=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?year.substr(-2):year}}module.exports=Year});var require_dateparts=__commonJS(function(exports,module){module.exports={DatePart:require_datepart(),Meridiem:require_meridiem(),Day:require_day(),Hours:require_hours(),Milliseconds:require_milliseconds(),Minutes:require_minutes(),Month:require_month(),Seconds:require_seconds(),Year:require_year()}});var require_date=__commonJS(function(exports,module){function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}if(info.done)resolve(value);else Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)})}}var color=require_kleur(),Prompt=require_prompt(),_require=require_util(),style=_require.style,clear=_require.clear,figures=_require.figures,_require2=require_src(),erase=_require2.erase,cursor=_require2.cursor,_require3=require_dateparts(),DatePart=_require3.DatePart,Meridiem=_require3.Meridiem,Day=_require3.Day,Hours=_require3.Hours,Milliseconds=_require3.Milliseconds,Minutes=_require3.Minutes,Month=_require3.Month,Seconds=_require3.Seconds,Year=_require3.Year,regex=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,regexGroups={1:({token})=>token.replace(/\\(.)/g,"$1"),2:(opts)=>new Day(opts),3:(opts)=>new Month(opts),4:(opts)=>new Year(opts),5:(opts)=>new Meridiem(opts),6:(opts)=>new Hours(opts),7:(opts)=>new Minutes(opts),8:(opts)=>new Seconds(opts),9:(opts)=>new Milliseconds(opts)},dfltLocales={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends Prompt{constructor(opts={}){super(opts);this.msg=opts.message,this.cursor=0,this.typed="",this.locales=Object.assign(dfltLocales,opts.locales),this._date=opts.initial||new Date,this.errorMsg=opts.error||"Please Enter A Valid Value",this.validator=opts.validate||(()=>!0),this.mask=opts.mask||"YYYY-MM-DD HH:mm:ss",this.clear=clear("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(date){if(date)this._date.setTime(date.getTime())}set mask(mask){let result;this.parts=[];while(result=regex.exec(mask)){let match=result.shift(),idx=result.findIndex((gr)=>gr!=null);this.parts.push(idx in regexGroups?regexGroups[idx]({token:result[idx]||match,date:this.date,parts:this.parts,locales:this.locales}):result[idx]||match)}let parts=this.parts.reduce((arr,i)=>{if(typeof i==="string"&&typeof arr[arr.length-1]==="string")arr[arr.length-1]+=i;else arr.push(i);return arr},[]);this.parts.splice(0),this.parts.push(...parts),this.reset()}moveCursor(n){this.typed="",this.cursor=n,this.fire()}reset(){this.moveCursor(this.parts.findIndex((p)=>p instanceof DatePart)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
17
+ `),this.close()}validate(){var _this=this;return _asyncToGenerator(function*(){let valid=yield _this.validator(_this.value);if(typeof valid==="string")_this.errorMsg=valid,valid=!1;_this.error=!valid})()}submit(){var _this2=this;return _asyncToGenerator(function*(){if(yield _this2.validate(),_this2.error){_this2.color="red",_this2.fire(),_this2.render();return}_this2.done=!0,_this2.aborted=!1,_this2.fire(),_this2.render(),_this2.out.write(`
18
+ `),_this2.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let prev=this.parts[this.cursor].prev();if(prev==null)return this.bell();this.moveCursor(this.parts.indexOf(prev)),this.render()}right(){let next=this.parts[this.cursor].next();if(next==null)return this.bell();this.moveCursor(this.parts.indexOf(next)),this.render()}next(){let next=this.parts[this.cursor].next();this.moveCursor(next?this.parts.indexOf(next):this.parts.findIndex((part)=>part instanceof DatePart)),this.render()}_(c){if(/\d/.test(c))this.typed+=c,this.parts[this.cursor].setTo(this.typed),this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);else this.out.write(clear(this.outputText,this.out.columns));if(super.render(),this.outputText=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(!1),this.parts.reduce((arr,p,idx)=>arr.concat(idx===this.cursor&&!this.done?color.cyan().underline(p.toString()):p),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split(`
19
+ `).reduce((a,l,i)=>a+`
20
+ ${i?" ":figures.pointerSmall} ${color.red().italic(l)}`,"");this.out.write(erase.line+cursor.to(0)+this.outputText)}}module.exports=DatePrompt});var require_number=__commonJS(function(exports,module){function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}if(info.done)resolve(value);else Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)})}}var color=require_kleur(),Prompt=require_prompt(),_require=require_src(),cursor=_require.cursor,erase=_require.erase,_require2=require_util(),style=_require2.style,figures=_require2.figures,clear=_require2.clear,lines=_require2.lines,isNumber=/[0-9]/,isDef=(any)=>any!==void 0,round=(number,precision)=>{let factor=Math.pow(10,precision);return Math.round(number*factor)/factor};class NumberPrompt extends Prompt{constructor(opts={}){super(opts);this.transform=style.render(opts.style),this.msg=opts.message,this.initial=isDef(opts.initial)?opts.initial:"",this.float=!!opts.float,this.round=opts.round||2,this.inc=opts.increment||1,this.min=isDef(opts.min)?opts.min:-1/0,this.max=isDef(opts.max)?opts.max:1/0,this.errorMsg=opts.error||"Please Enter A Valid Value",this.validator=opts.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(v){if(!v&&v!==0)this.placeholder=!0,this.rendered=color.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${round(v,this.round)}`),this._value=round(v,this.round);this.fire()}get value(){return this._value}parse(x){return this.float?parseFloat(x):parseInt(x)}valid(c){return c==="-"||c==="."&&this.float||isNumber.test(c)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let x=this.value;this.value=x!==""?x:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
21
+ `),this.close()}validate(){var _this=this;return _asyncToGenerator(function*(){let valid=yield _this.validator(_this.value);if(typeof valid==="string")_this.errorMsg=valid,valid=!1;_this.error=!valid})()}submit(){var _this2=this;return _asyncToGenerator(function*(){if(yield _this2.validate(),_this2.error){_this2.color="red",_this2.fire(),_this2.render();return}let x=_this2.value;_this2.value=x!==""?x:_this2.initial,_this2.done=!0,_this2.aborted=!1,_this2.error=!1,_this2.fire(),_this2.render(),_this2.out.write(`
22
+ `),_this2.close()})()}up(){if(this.typed="",this.value==="")this.value=this.min-this.inc;if(this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value==="")this.value=this.min+this.inc;if(this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let val=this.value.toString();if(val.length===0)return this.bell();if(this.value=this.parse(val=val.slice(0,-1))||"",this.value!==""&&this.value<this.min)this.value=this.min;this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(c,key){if(!this.valid(c))return this.bell();let now=Date.now();if(now-this.lastHit>1000)this.typed="";if(this.typed+=c,this.lastHit=now,this.color="cyan",c===".")return this.fire();if(this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire(),this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(cursor.down(lines(this.outputError,this.out.columns)-1)+clear(this.outputError,this.out.columns));this.out.write(clear(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(this.done),!this.done||!this.done&&!this.placeholder?color[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
23
+ `).reduce((a,l,i)=>a+`
24
+ ${i?" ":figures.pointerSmall} ${color.red().italic(l)}`,"");this.out.write(erase.line+cursor.to(0)+this.outputText+cursor.save+this.outputError+cursor.restore)}}module.exports=NumberPrompt});var require_multiselect=__commonJS(function(exports,module){var color=require_kleur(),_require=require_src(),cursor=_require.cursor,Prompt=require_prompt(),_require2=require_util(),clear=_require2.clear,figures=_require2.figures,style=_require2.style,wrap=_require2.wrap,entriesToDisplay=_require2.entriesToDisplay;class MultiselectPrompt extends Prompt{constructor(opts={}){super(opts);if(this.msg=opts.message,this.cursor=opts.cursor||0,this.scrollIndex=opts.cursor||0,this.hint=opts.hint||"",this.warn=opts.warn||"- This option is disabled -",this.minSelected=opts.min,this.showMinError=!1,this.maxChoices=opts.max,this.instructions=opts.instructions,this.optionsPerPage=opts.optionsPerPage||10,this.value=opts.choices.map((ch,idx)=>{if(typeof ch==="string")ch={title:ch,value:idx};return{title:ch&&(ch.title||ch.value||ch),description:ch&&ch.description,value:ch&&(ch.value===void 0?idx:ch.value),selected:ch&&ch.selected,disabled:ch&&ch.disabled}}),this.clear=clear("",this.out.columns),!opts.overrideRender)this.render()}reset(){this.value.map((v)=>!v.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((v)=>v.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
25
+ `),this.close()}submit(){let selected=this.value.filter((e)=>e.selected);if(this.minSelected&&selected.length<this.minSelected)this.showMinError=!0,this.render();else this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
26
+ `),this.close()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){if(this.cursor===0)this.cursor=this.value.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.value.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((e)=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let v=this.value[this.cursor];if(v.selected)v.selected=!1,this.render();else if(v.disabled||this.value.filter((e)=>e.selected).length>=this.maxChoices)return this.bell();else v.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let newSelected=!this.value[this.cursor].selected;this.value.filter((v)=>!v.disabled).forEach((v)=>v.selected=newSelected),this.render()}_(c,key){if(c===" ")this.handleSpaceToggle();else if(c==="a")this.toggleAll();else return this.bell()}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
27
27
  Instructions:
28
- ${o.arrowUp}/${o.arrowDown}: Highlight option
29
- ${o.arrowLeft}/${o.arrowRight}/[space]: Toggle selection
28
+ ${figures.arrowUp}/${figures.arrowDown}: Highlight option
29
+ ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
30
30
  `+(this.maxChoices===void 0?` a: Toggle all
31
- `:"")+" enter/return: Complete answer"}return""}renderOption(Y,$,H,Z){let X=($.selected?h.green(o.radioOn):o.radioOff)+" "+Z+" ",U,Q;if($.disabled)U=Y===H?h.gray().underline($.title):h.strikethrough().gray($.title);else if(U=Y===H?h.cyan().underline($.title):$.title,Y===H&&$.description){if(Q=` - ${$.description}`,X.length+U.length+Q.length>=this.out.columns||$.description.split(/\r?\n/).length>1)Q=`
32
- `+YZ($.description,{margin:X.length,width:this.out.columns})}return X+U+h.gray(Q||"")}paginateOptions(Y){if(Y.length===0)return h.red("No matches for this query.");let $=$Z(this.cursor,Y.length,this.optionsPerPage),H=$.startIndex,Z=$.endIndex,X,U=[];for(let Q=H;Q<Z;Q++){if(Q===H&&H>0)X=o.arrowUp;else if(Q===Z-1&&Z<Y.length)X=o.arrowDown;else X=" ";U.push(this.renderOption(this.cursor,Y[Q],Q,X))}return`
33
- `+U.join(`
34
- `)}renderOptions(Y){if(!this.done)return this.paginateOptions(Y);return""}renderDoneOrInstructions(){if(this.done)return this.value.filter(($)=>$.selected).map(($)=>$.title).join(", ");let Y=[h.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)Y.push(h.yellow(this.warn));return Y.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(aH.hide);super.render();let Y=[y4.symbol(this.done,this.aborted),h.bold(this.msg),y4.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)Y+=h.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;Y+=this.renderOptions(this.value),this.out.write(this.clear+Y),this.clear=v4(Y,this.out.columns)}}u4.exports=d4});var s4=K((lU,t4)=>{function c4(Y,$,H,Z,X,U,Q){try{var J=Y[U](Q),D=J.value}catch(W){H(W);return}if(J.done)$(D);else Promise.resolve(D).then(Z,X)}function HZ(Y){return function(){var $=this,H=arguments;return new Promise(function(Z,X){var U=Y.apply($,H);function Q(D){c4(U,Z,X,Q,J,"next",D)}function J(D){c4(U,Z,X,Q,J,"throw",D)}Q(void 0)})}}var G1=I(),ZZ=y(),i4=O(),UZ=i4.erase,l4=i4.cursor,I1=C(),K0=I1.style,p4=I1.clear,W0=I1.figures,XZ=I1.wrap,QZ=I1.entriesToDisplay,n4=(Y,$)=>Y[$]&&(Y[$].value||Y[$].title||Y[$]),JZ=(Y,$)=>Y[$]&&(Y[$].title||Y[$].value||Y[$]),DZ=(Y,$)=>{let H=Y.findIndex((Z)=>Z.value===$||Z.title===$);return H>-1?H:void 0};class m4 extends ZZ{constructor(Y={}){super(Y);this.msg=Y.message,this.suggest=Y.suggest,this.choices=Y.choices,this.initial=typeof Y.initial==="number"?Y.initial:DZ(Y.choices,Y.initial),this.select=this.initial||Y.cursor||0,this.i18n={noMatches:Y.noMatches||"no matches found"},this.fallback=Y.fallback||this.initial,this.clearFirst=Y.clearFirst||!1,this.suggestions=[],this.input="",this.limit=Y.limit||10,this.cursor=0,this.transform=K0.render(Y.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=p4("",this.out.columns),this.complete(this.render),this.render()}set fallback(Y){this._fb=Number.isSafeInteger(parseInt(Y))?parseInt(Y):Y}get fallback(){let Y;if(typeof this._fb==="number")Y=this.choices[this._fb];else if(typeof this._fb==="string")Y={title:this._fb};return Y||this._fb||{title:this.i18n.noMatches}}moveSelect(Y){if(this.select=Y,this.suggestions.length>0)this.value=n4(this.suggestions,Y);else this.value=this.fallback.value;this.fire()}complete(Y){var $=this;return HZ(function*(){let H=$.completing=$.suggest($.input,$.choices),Z=yield H;if($.completing!==H)return;$.suggestions=Z.map((U,Q,J)=>({title:JZ(J,Q),value:n4(J,Q),description:U.description})),$.completing=!1;let X=Math.max(Z.length-1,0);$.moveSelect(Math.min(X,$.select)),Y&&Y()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){if(this.clearFirst&&this.input.length>0)this.reset();else this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
31
+ `:"")+" enter/return: Complete answer"}return""}renderOption(cursor,v,i,arrowIndicator){let prefix=(v.selected?color.green(figures.radioOn):figures.radioOff)+" "+arrowIndicator+" ",title,desc;if(v.disabled)title=cursor===i?color.gray().underline(v.title):color.strikethrough().gray(v.title);else if(title=cursor===i?color.cyan().underline(v.title):v.title,cursor===i&&v.description){if(desc=` - ${v.description}`,prefix.length+title.length+desc.length>=this.out.columns||v.description.split(/\r?\n/).length>1)desc=`
32
+ `+wrap(v.description,{margin:prefix.length,width:this.out.columns})}return prefix+title+color.gray(desc||"")}paginateOptions(options){if(options.length===0)return color.red("No matches for this query.");let _entriesToDisplay=entriesToDisplay(this.cursor,options.length,this.optionsPerPage),{startIndex,endIndex}=_entriesToDisplay,prefix,styledOptions=[];for(let i=startIndex;i<endIndex;i++){if(i===startIndex&&startIndex>0)prefix=figures.arrowUp;else if(i===endIndex-1&&endIndex<options.length)prefix=figures.arrowDown;else prefix=" ";styledOptions.push(this.renderOption(this.cursor,options[i],i,prefix))}return`
33
+ `+styledOptions.join(`
34
+ `)}renderOptions(options){if(!this.done)return this.paginateOptions(options);return""}renderDoneOrInstructions(){if(this.done)return this.value.filter((e)=>e.selected).map((v)=>v.title).join(", ");let output=[color.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)output.push(color.yellow(this.warn));return output.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);super.render();let prompt=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)prompt+=color.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;prompt+=this.renderOptions(this.value),this.out.write(this.clear+prompt),this.clear=clear(prompt,this.out.columns)}}module.exports=MultiselectPrompt});var require_autocomplete=__commonJS(function(exports,module){function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}if(info.done)resolve(value);else Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)})}}var color=require_kleur(),Prompt=require_prompt(),_require=require_src(),erase=_require.erase,cursor=_require.cursor,_require2=require_util(),style=_require2.style,clear=_require2.clear,figures=_require2.figures,wrap=_require2.wrap,entriesToDisplay=_require2.entriesToDisplay,getVal=(arr,i)=>arr[i]&&(arr[i].value||arr[i].title||arr[i]),getTitle=(arr,i)=>arr[i]&&(arr[i].title||arr[i].value||arr[i]),getIndex=(arr,valOrTitle)=>{let index=arr.findIndex((el)=>el.value===valOrTitle||el.title===valOrTitle);return index>-1?index:void 0};class AutocompletePrompt extends Prompt{constructor(opts={}){super(opts);this.msg=opts.message,this.suggest=opts.suggest,this.choices=opts.choices,this.initial=typeof opts.initial==="number"?opts.initial:getIndex(opts.choices,opts.initial),this.select=this.initial||opts.cursor||0,this.i18n={noMatches:opts.noMatches||"no matches found"},this.fallback=opts.fallback||this.initial,this.clearFirst=opts.clearFirst||!1,this.suggestions=[],this.input="",this.limit=opts.limit||10,this.cursor=0,this.transform=style.render(opts.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=clear("",this.out.columns),this.complete(this.render),this.render()}set fallback(fb){this._fb=Number.isSafeInteger(parseInt(fb))?parseInt(fb):fb}get fallback(){let choice;if(typeof this._fb==="number")choice=this.choices[this._fb];else if(typeof this._fb==="string")choice={title:this._fb};return choice||this._fb||{title:this.i18n.noMatches}}moveSelect(i){if(this.select=i,this.suggestions.length>0)this.value=getVal(this.suggestions,i);else this.value=this.fallback.value;this.fire()}complete(cb){var _this=this;return _asyncToGenerator(function*(){let p=_this.completing=_this.suggest(_this.input,_this.choices),suggestions=yield p;if(_this.completing!==p)return;_this.suggestions=suggestions.map((s,i,arr)=>({title:getTitle(arr,i),value:getVal(arr,i),description:s.description})),_this.completing=!1;let l=Math.max(suggestions.length-1,0);_this.moveSelect(Math.min(l,_this.select)),cb&&cb()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){if(this.clearFirst&&this.input.length>0)this.reset();else this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
35
35
  `),this.close()}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
36
36
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
37
- `),this.close()}_(Y,$){let H=this.input.slice(0,this.cursor),Z=this.input.slice(this.cursor);this.input=`${H}${Y}${Z}`,this.cursor=H.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let Y=this.input.slice(0,this.cursor-1),$=this.input.slice(this.cursor);this.input=`${Y}${$}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let Y=this.input.slice(0,this.cursor),$=this.input.slice(this.cursor+1);this.input=`${Y}${$}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){if(this.select===0)this.moveSelect(this.suggestions.length-1);else this.moveSelect(this.select-1);this.render()}down(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}next(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(Y,$,H,Z){let X,U=H?W0.arrowUp:Z?W0.arrowDown:" ",Q=$?G1.cyan().underline(Y.title):Y.title;if(U=($?G1.cyan(W0.pointer)+" ":" ")+U,Y.description){if(X=` - ${Y.description}`,U.length+Q.length+X.length>=this.out.columns||Y.description.split(/\r?\n/).length>1)X=`
38
- `+XZ(Y.description,{margin:3,width:this.out.columns})}return U+" "+Q+G1.gray(X||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l4.hide);else this.out.write(p4(this.outputText,this.out.columns));super.render();let Y=QZ(this.select,this.choices.length,this.limit),$=Y.startIndex,H=Y.endIndex;if(this.outputText=[K0.symbol(this.done,this.aborted,this.exited),G1.bold(this.msg),K0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let Z=this.suggestions.slice($,H).map((X,U)=>this.renderOption(X,this.select===U+$,U===0&&$>0,U+$===H-1&&H<this.choices.length)).join(`
37
+ `),this.close()}_(c,key){let s1=this.input.slice(0,this.cursor),s2=this.input.slice(this.cursor);this.input=`${s1}${c}${s2}`,this.cursor=s1.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let s1=this.input.slice(0,this.cursor-1),s2=this.input.slice(this.cursor);this.input=`${s1}${s2}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let s1=this.input.slice(0,this.cursor),s2=this.input.slice(this.cursor+1);this.input=`${s1}${s2}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){if(this.select===0)this.moveSelect(this.suggestions.length-1);else this.moveSelect(this.select-1);this.render()}down(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}next(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(v,hovered,isStart,isEnd){let desc,prefix=isStart?figures.arrowUp:isEnd?figures.arrowDown:" ",title=hovered?color.cyan().underline(v.title):v.title;if(prefix=(hovered?color.cyan(figures.pointer)+" ":" ")+prefix,v.description){if(desc=` - ${v.description}`,prefix.length+title.length+desc.length>=this.out.columns||v.description.split(/\r?\n/).length>1)desc=`
38
+ `+wrap(v.description,{margin:3,width:this.out.columns})}return prefix+" "+title+color.gray(desc||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);else this.out.write(clear(this.outputText,this.out.columns));super.render();let _entriesToDisplay=entriesToDisplay(this.select,this.choices.length,this.limit),{startIndex,endIndex}=_entriesToDisplay;if(this.outputText=[style.symbol(this.done,this.aborted,this.exited),color.bold(this.msg),style.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let suggestions=this.suggestions.slice(startIndex,endIndex).map((item,i)=>this.renderOption(item,this.select===i+startIndex,i===0&&startIndex>0,i+startIndex===endIndex-1&&endIndex<this.choices.length)).join(`
39
39
  `);this.outputText+=`
40
- `+(Z||G1.gray(this.fallback.title))}this.out.write(UZ.line+l4.to(0)+this.outputText)}}t4.exports=m4});var Y9=K((pU,e4)=>{var c=I(),zZ=O(),KZ=zZ.cursor,WZ=z0(),L0=C(),o4=L0.clear,r4=L0.style,Q1=L0.figures;class a4 extends WZ{constructor(Y={}){Y.overrideRender=!0;super(Y);this.inputValue="",this.clear=o4("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){if(this.cursor===0)this.cursor=this.filteredOptions.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.filteredOptions.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((Y)=>Y.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){if(this.inputValue.length)this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions()}updateFilteredOptions(){let Y=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((H)=>{if(this.inputValue){if(typeof H.title==="string"){if(H.title.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}if(typeof H.value==="string"){if(H.value.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}return!1}return!0});let $=this.filteredOptions.findIndex((H)=>H===Y);this.cursor=$<0?0:$,this.render()}handleSpaceToggle(){let Y=this.filteredOptions[this.cursor];if(Y.selected)Y.selected=!1,this.render();else if(Y.disabled||this.value.filter(($)=>$.selected).length>=this.maxChoices)return this.bell();else Y.selected=!0,this.render()}handleInputChange(Y){this.inputValue=this.inputValue+Y,this.updateFilteredOptions()}_(Y,$){if(Y===" ")this.handleSpaceToggle();else this.handleInputChange(Y)}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
40
+ `+(suggestions||color.gray(this.fallback.title))}this.out.write(erase.line+cursor.to(0)+this.outputText)}}module.exports=AutocompletePrompt});var require_autocompleteMultiselect=__commonJS(function(exports,module){var color=require_kleur(),_require=require_src(),cursor=_require.cursor,MultiselectPrompt=require_multiselect(),_require2=require_util(),clear=_require2.clear,style=_require2.style,figures=_require2.figures;class AutocompleteMultiselectPrompt extends MultiselectPrompt{constructor(opts={}){opts.overrideRender=!0;super(opts);this.inputValue="",this.clear=clear("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){if(this.cursor===0)this.cursor=this.filteredOptions.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.filteredOptions.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((e)=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){if(this.inputValue.length)this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions()}updateFilteredOptions(){let currentHighlight=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((v)=>{if(this.inputValue){if(typeof v.title==="string"){if(v.title.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}if(typeof v.value==="string"){if(v.value.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}return!1}return!0});let newHighlightIndex=this.filteredOptions.findIndex((v)=>v===currentHighlight);this.cursor=newHighlightIndex<0?0:newHighlightIndex,this.render()}handleSpaceToggle(){let v=this.filteredOptions[this.cursor];if(v.selected)v.selected=!1,this.render();else if(v.disabled||this.value.filter((e)=>e.selected).length>=this.maxChoices)return this.bell();else v.selected=!0,this.render()}handleInputChange(c){this.inputValue=this.inputValue+c,this.updateFilteredOptions()}_(c,key){if(c===" ")this.handleSpaceToggle();else this.handleInputChange(c)}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
41
41
  Instructions:
42
- ${Q1.arrowUp}/${Q1.arrowDown}: Highlight option
43
- ${Q1.arrowLeft}/${Q1.arrowRight}/[space]: Toggle selection
42
+ ${figures.arrowUp}/${figures.arrowDown}: Highlight option
43
+ ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
44
44
  [a,b,c]/delete: Filter choices
45
45
  enter/return: Complete answer
46
46
  `}return""}renderCurrentInput(){return`
47
- Filtered results for: ${this.inputValue?this.inputValue:c.gray("Enter something to filter")}
48
- `}renderOption(Y,$,H){let Z;if($.disabled)Z=Y===H?c.gray().underline($.title):c.strikethrough().gray($.title);else Z=Y===H?c.cyan().underline($.title):$.title;return($.selected?c.green(Q1.radioOn):Q1.radioOff)+" "+Z}renderDoneOrInstructions(){if(this.done)return this.value.filter(($)=>$.selected).map(($)=>$.title).join(", ");let Y=[c.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled)Y.push(c.yellow(this.warn));return Y.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(KZ.hide);super.render();let Y=[r4.symbol(this.done,this.aborted),c.bold(this.msg),r4.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)Y+=c.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;Y+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+Y),this.clear=o4(Y,this.out.columns)}}e4.exports=a4});var D9=K((nU,J9)=>{var $9=I(),LZ=y(),U9=C(),H9=U9.style,BZ=U9.clear,X9=O(),EZ=X9.erase,Z9=X9.cursor;class Q9 extends LZ{constructor(Y={}){super(Y);this.msg=Y.message,this.value=Y.initial,this.initialValue=!!Y.initial,this.yesMsg=Y.yes||"yes",this.yesOption=Y.yesOption||"(Y/n)",this.noMsg=Y.no||"no",this.noOption=Y.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
47
+ Filtered results for: ${this.inputValue?this.inputValue:color.gray("Enter something to filter")}
48
+ `}renderOption(cursor,v,i){let title;if(v.disabled)title=cursor===i?color.gray().underline(v.title):color.strikethrough().gray(v.title);else title=cursor===i?color.cyan().underline(v.title):v.title;return(v.selected?color.green(figures.radioOn):figures.radioOff)+" "+title}renderDoneOrInstructions(){if(this.done)return this.value.filter((e)=>e.selected).map((v)=>v.title).join(", ");let output=[color.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled)output.push(color.yellow(this.warn));return output.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);super.render();let prompt=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)prompt+=color.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;prompt+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+prompt),this.clear=clear(prompt,this.out.columns)}}module.exports=AutocompleteMultiselectPrompt});var require_confirm=__commonJS(function(exports,module){var color=require_kleur(),Prompt=require_prompt(),_require=require_util(),style=_require.style,clear=_require.clear,_require2=require_src(),erase=_require2.erase,cursor=_require2.cursor;class ConfirmPrompt extends Prompt{constructor(opts={}){super(opts);this.msg=opts.message,this.value=opts.initial,this.initialValue=!!opts.initial,this.yesMsg=opts.yes||"yes",this.yesOption=opts.yesOption||"(Y/n)",this.noMsg=opts.no||"no",this.noOption=opts.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
49
49
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
50
- `),this.close()}_(Y,$){if(Y.toLowerCase()==="y")return this.value=!0,this.submit();if(Y.toLowerCase()==="n")return this.value=!1,this.submit();return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(Z9.hide);else this.out.write(BZ(this.outputText,this.out.columns));super.render(),this.outputText=[H9.symbol(this.done,this.aborted),$9.bold(this.msg),H9.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:$9.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(EZ.line+Z9.to(0)+this.outputText)}}J9.exports=Q9});var K9=K((iU,z9)=>{z9.exports={TextPrompt:x2(),SelectPrompt:v2(),TogglePrompt:n2(),DatePrompt:j4(),NumberPrompt:g4(),MultiselectPrompt:z0(),AutocompletePrompt:s4(),AutocompleteMultiselectPrompt:Y9(),ConfirmPrompt:D9()}});var L9=K((W9)=>{var q=W9,SZ=K9(),d1=(Y)=>Y;function x(Y,$,H={}){return new Promise((Z,X)=>{let U=new SZ[Y]($),Q=H.onAbort||d1,J=H.onSubmit||d1,D=H.onExit||d1;U.on("state",$.onState||d1),U.on("submit",(W)=>Z(J(W))),U.on("exit",(W)=>Z(D(W))),U.on("abort",(W)=>X(Q(W)))})}q.text=(Y)=>x("TextPrompt",Y);q.password=(Y)=>{return Y.style="password",q.text(Y)};q.invisible=(Y)=>{return Y.style="invisible",q.text(Y)};q.number=(Y)=>x("NumberPrompt",Y);q.date=(Y)=>x("DatePrompt",Y);q.confirm=(Y)=>x("ConfirmPrompt",Y);q.list=(Y)=>{let $=Y.separator||",";return x("TextPrompt",Y,{onSubmit:(H)=>H.split($).map((Z)=>Z.trim())})};q.toggle=(Y)=>x("TogglePrompt",Y);q.select=(Y)=>x("SelectPrompt",Y);q.multiselect=(Y)=>{Y.choices=[].concat(Y.choices||[]);let $=(H)=>H.filter((Z)=>Z.selected).map((Z)=>Z.value);return x("MultiselectPrompt",Y,{onAbort:$,onSubmit:$})};q.autocompleteMultiselect=(Y)=>{Y.choices=[].concat(Y.choices||[]);let $=(H)=>H.filter((Z)=>Z.selected).map((Z)=>Z.value);return x("AutocompleteMultiselectPrompt",Y,{onAbort:$,onSubmit:$})};var RZ=(Y,$)=>Promise.resolve($.filter((H)=>H.title.slice(0,Y.length).toLowerCase()===Y.toLowerCase()));q.autocomplete=(Y)=>{return Y.suggest=Y.suggest||RZ,Y.choices=[].concat(Y.choices||[]),x("AutocompletePrompt",Y)}});var F9=K((tU,O9)=>{function B9(Y,$){var H=Object.keys(Y);if(Object.getOwnPropertySymbols){var Z=Object.getOwnPropertySymbols(Y);if($)Z=Z.filter(function(X){return Object.getOwnPropertyDescriptor(Y,X).enumerable});H.push.apply(H,Z)}return H}function E9(Y){for(var $=1;$<arguments.length;$++){var H=arguments[$]!=null?arguments[$]:{};if($%2)B9(Object(H),!0).forEach(function(Z){GZ(Y,Z,H[Z])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(Y,Object.getOwnPropertyDescriptors(H));else B9(Object(H)).forEach(function(Z){Object.defineProperty(Y,Z,Object.getOwnPropertyDescriptor(H,Z))})}return Y}function GZ(Y,$,H){if($ in Y)Object.defineProperty(Y,$,{value:H,enumerable:!0,configurable:!0,writable:!0});else Y[$]=H;return Y}function IZ(Y,$){var H=typeof Symbol<"u"&&Y[Symbol.iterator]||Y["@@iterator"];if(!H){if(Array.isArray(Y)||(H=OZ(Y))||$&&Y&&typeof Y.length==="number"){if(H)Y=H;var Z=0,X=function(){};return{s:X,n:function(){if(Z>=Y.length)return{done:!0};return{done:!1,value:Y[Z++]}},e:function(W){throw W},f:X}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
51
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var U=!0,Q=!1,J;return{s:function(){H=H.call(Y)},n:function(){var W=H.next();return U=W.done,W},e:function(W){Q=!0,J=W},f:function(){try{if(!U&&H.return!=null)H.return()}finally{if(Q)throw J}}}}function OZ(Y,$){if(!Y)return;if(typeof Y==="string")return S9(Y,$);var H=Object.prototype.toString.call(Y).slice(8,-1);if(H==="Object"&&Y.constructor)H=Y.constructor.name;if(H==="Map"||H==="Set")return Array.from(Y);if(H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return S9(Y,$)}function S9(Y,$){if($==null||$>Y.length)$=Y.length;for(var H=0,Z=Array($);H<$;H++)Z[H]=Y[H];return Z}function R9(Y,$,H,Z,X,U,Q){try{var J=Y[U](Q),D=J.value}catch(W){H(W);return}if(J.done)$(D);else Promise.resolve(D).then(Z,X)}function G9(Y){return function(){var $=this,H=arguments;return new Promise(function(Z,X){var U=Y.apply($,H);function Q(D){R9(U,Z,X,Q,J,"next",D)}function J(D){R9(U,Z,X,Q,J,"throw",D)}Q(void 0)})}}var B0=L9(),FZ=["suggest","format","onState","validate","onRender","type"],I9=()=>{};function r(){return E0.apply(this,arguments)}function E0(){return E0=G9(function*(Y=[],{onSubmit:$=I9,onCancel:H=I9}={}){let Z={},X=r._override||{};Y=[].concat(Y);let U,Q,J,D,W,Y1,$1=function(){var s=G9(function*(v,j1,$2=!1){if(!$2&&v.validate&&v.validate(j1)!==!0)return;return v.format?yield v.format(j1,Z):j1});return function(j1,$2){return s.apply(this,arguments)}}();var G=IZ(Y),P;try{for(G.s();!(P=G.n()).done;){Q=P.value;var C1=Q;if(D=C1.name,W=C1.type,typeof W==="function")W=yield W(U,E9({},Z),Q),Q.type=W;if(!W)continue;for(let s in Q){if(FZ.includes(s))continue;let v=Q[s];Q[s]=typeof v==="function"?yield v(U,E9({},Z),Y1):v}if(Y1=Q,typeof Q.message!=="string")throw Error("prompt message is required");var Y2=Q;if(D=Y2.name,W=Y2.type,B0[W]===void 0)throw Error(`prompt type (${W}) is not defined`);if(X[Q.name]!==void 0){if(U=yield $1(Q,X[Q.name]),U!==void 0){Z[D]=U;continue}}try{U=r._injected?VZ(r._injected,Q.initial):yield B0[W](Q),Z[D]=U=yield $1(Q,U,!0),J=yield $(Q,U,Z)}catch(s){J=!(yield H(Q,Z))}if(J)return Z}}catch(s){G.e(s)}finally{G.f()}return Z}),E0.apply(this,arguments)}function VZ(Y,$){let H=Y.shift();if(H instanceof Error)throw H;return H===void 0?$:H}function AZ(Y){r._injected=(r._injected||[]).concat(Y)}function MZ(Y){r._override=Object.assign({},Y)}O9.exports=Object.assign(r,{prompt:r,prompts:B0,inject:AZ,override:MZ})});var A9=K((sU,V9)=>{V9.exports=(Y,$)=>{if(Y.meta&&Y.name!=="escape")return;if(Y.ctrl){if(Y.name==="a")return"first";if(Y.name==="c")return"abort";if(Y.name==="d")return"abort";if(Y.name==="e")return"last";if(Y.name==="g")return"reset"}if($){if(Y.name==="j")return"down";if(Y.name==="k")return"up"}if(Y.name==="return")return"submit";if(Y.name==="enter")return"submit";if(Y.name==="backspace")return"delete";if(Y.name==="delete")return"deleteForward";if(Y.name==="abort")return"abort";if(Y.name==="escape")return"exit";if(Y.name==="tab")return"next";if(Y.name==="pagedown")return"nextPage";if(Y.name==="pageup")return"prevPage";if(Y.name==="home")return"home";if(Y.name==="end")return"end";if(Y.name==="up")return"up";if(Y.name==="down")return"down";if(Y.name==="right")return"right";if(Y.name==="left")return"left";return!1}});var u1=K((oU,M9)=>{M9.exports=(Y)=>{let $=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),H=new RegExp($,"g");return typeof Y==="string"?Y.replace(H,""):Y}});var T9=K((rU,N9)=>{var qZ=u1(),{erase:q9,cursor:NZ}=O(),TZ=(Y)=>[...qZ(Y)].length;N9.exports=function(Y,$){if(!$)return q9.line+NZ.to(0);let H=0,Z=Y.split(/\r?\n/);for(let X of Z)H+=1+Math.floor(Math.max(TZ(X)-1,0)/$);return q9.lines(H)}});var S0=K((aU,P9)=>{var O1={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},PZ={arrowUp:O1.arrowUp,arrowDown:O1.arrowDown,arrowLeft:O1.arrowLeft,arrowRight:O1.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},CZ=process.platform==="win32"?PZ:O1;P9.exports=CZ});var j9=K((eU,C9)=>{var J1=I(),Z1=S0(),R0=Object.freeze({password:{scale:1,render:(Y)=>"*".repeat(Y.length)},emoji:{scale:2,render:(Y)=>"\uD83D\uDE03".repeat(Y.length)},invisible:{scale:0,render:(Y)=>""},default:{scale:1,render:(Y)=>`${Y}`}}),jZ=(Y)=>R0[Y]||R0.default,F1=Object.freeze({aborted:J1.red(Z1.cross),done:J1.green(Z1.tick),exited:J1.yellow(Z1.cross),default:J1.cyan("?")}),_Z=(Y,$,H)=>$?F1.aborted:H?F1.exited:Y?F1.done:F1.default,kZ=(Y)=>J1.gray(Y?Z1.ellipsis:Z1.pointerSmall),hZ=(Y,$)=>J1.gray(Y?$?Z1.pointerSmall:"+":Z1.line);C9.exports={styles:R0,render:jZ,symbols:F1,symbol:_Z,delimiter:kZ,item:hZ}});var k9=K((Y5,_9)=>{var xZ=u1();_9.exports=function(Y,$){let H=String(xZ(Y)||"").split(/\r?\n/);if(!$)return H.length;return H.map((Z)=>Math.ceil(Z.length/$)).reduce((Z,X)=>Z+X)}});var x9=K(($5,h9)=>{h9.exports=(Y,$={})=>{let H=Number.isSafeInteger(parseInt($.margin))?Array(parseInt($.margin)).fill(" ").join(""):$.margin||"",Z=$.width;return(Y||"").split(/\r?\n/g).map((X)=>X.split(/\s+/g).reduce((U,Q)=>{if(Q.length+H.length>=Z||U[U.length-1].length+Q.length+1<Z)U[U.length-1]+=` ${Q}`;else U.push(`${H}${Q}`);return U},[H]).join(`
50
+ `),this.close()}_(c,key){if(c.toLowerCase()==="y")return this.value=!0,this.submit();if(c.toLowerCase()==="n")return this.value=!1,this.submit();return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);else this.out.write(clear(this.outputText,this.out.columns));super.render(),this.outputText=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:color.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(erase.line+cursor.to(0)+this.outputText)}}module.exports=ConfirmPrompt});var require_elements=__commonJS(function(exports,module){module.exports={TextPrompt:require_text(),SelectPrompt:require_select(),TogglePrompt:require_toggle(),DatePrompt:require_date(),NumberPrompt:require_number(),MultiselectPrompt:require_multiselect(),AutocompletePrompt:require_autocomplete(),AutocompleteMultiselectPrompt:require_autocompleteMultiselect(),ConfirmPrompt:require_confirm()}});var require_prompts=__commonJS(function(exports){var $=exports,el=require_elements(),noop=(v)=>v;function toPrompt(type,args,opts={}){return new Promise((res,rej)=>{let p=new el[type](args),onAbort=opts.onAbort||noop,onSubmit=opts.onSubmit||noop,onExit=opts.onExit||noop;p.on("state",args.onState||noop),p.on("submit",(x)=>res(onSubmit(x))),p.on("exit",(x)=>res(onExit(x))),p.on("abort",(x)=>rej(onAbort(x)))})}$.text=(args)=>toPrompt("TextPrompt",args);$.password=(args)=>(args.style="password",$.text(args));$.invisible=(args)=>(args.style="invisible",$.text(args));$.number=(args)=>toPrompt("NumberPrompt",args);$.date=(args)=>toPrompt("DatePrompt",args);$.confirm=(args)=>toPrompt("ConfirmPrompt",args);$.list=(args)=>{let sep=args.separator||",";return toPrompt("TextPrompt",args,{onSubmit:(str)=>str.split(sep).map((s)=>s.trim())})};$.toggle=(args)=>toPrompt("TogglePrompt",args);$.select=(args)=>toPrompt("SelectPrompt",args);$.multiselect=(args)=>{args.choices=[].concat(args.choices||[]);let toSelected=(items)=>items.filter((item)=>item.selected).map((item)=>item.value);return toPrompt("MultiselectPrompt",args,{onAbort:toSelected,onSubmit:toSelected})};$.autocompleteMultiselect=(args)=>{args.choices=[].concat(args.choices||[]);let toSelected=(items)=>items.filter((item)=>item.selected).map((item)=>item.value);return toPrompt("AutocompleteMultiselectPrompt",args,{onAbort:toSelected,onSubmit:toSelected})};var byTitle=(input,choices)=>Promise.resolve(choices.filter((item)=>item.title.slice(0,input.length).toLowerCase()===input.toLowerCase()));$.autocomplete=(args)=>(args.suggest=args.suggest||byTitle,args.choices=[].concat(args.choices||[]),toPrompt("AutocompletePrompt",args))});var require_dist=__commonJS(function(exports,module){function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable});keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2)ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));else ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _defineProperty(obj,key,value){if(key in obj)Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0});else obj[key]=value;return obj}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0,F=function(){};return{s:F,n:function(){if(i>=o.length)return{done:!0};return{done:!1,value:o[i++]}},e:function(_e){throw _e},f:F}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
51
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var normalCompletion=!0,didErr=!1,err;return{s:function(){it=it.call(o)},n:function(){var step=it.next();return normalCompletion=step.done,step},e:function(_e2){didErr=!0,err=_e2},f:function(){try{if(!normalCompletion&&it.return!=null)it.return()}finally{if(didErr)throw err}}}}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}if(info.done)resolve(value);else Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)})}}var prompts=require_prompts(),passOn=["suggest","format","onState","validate","onRender","type"],noop=()=>{};function prompt(){return _prompt.apply(this,arguments)}function _prompt(){return _prompt=_asyncToGenerator(function*(questions=[],{onSubmit=noop,onCancel=noop}={}){let answers={},override=prompt._override||{};questions=[].concat(questions);let answer,question,quit,name,type,lastPrompt,getFormattedAnswer=function(){var _ref=_asyncToGenerator(function*(question,answer,skipValidation=!1){if(!skipValidation&&question.validate&&question.validate(answer)!==!0)return;return question.format?yield question.format(answer,answers):answer});return function(_x,_x2){return _ref.apply(this,arguments)}}();var _iterator=_createForOfIteratorHelper(questions),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){question=_step.value;var _question=question;if(name=_question.name,type=_question.type,typeof type==="function")type=yield type(answer,_objectSpread({},answers),question),question.type=type;if(!type)continue;for(let key in question){if(passOn.includes(key))continue;let value=question[key];question[key]=typeof value==="function"?yield value(answer,_objectSpread({},answers),lastPrompt):value}if(lastPrompt=question,typeof question.message!=="string")throw Error("prompt message is required");var _question2=question;if(name=_question2.name,type=_question2.type,prompts[type]===void 0)throw Error(`prompt type (${type}) is not defined`);if(override[question.name]!==void 0){if(answer=yield getFormattedAnswer(question,override[question.name]),answer!==void 0){answers[name]=answer;continue}}try{answer=prompt._injected?getInjectedAnswer(prompt._injected,question.initial):yield prompts[type](question),answers[name]=answer=yield getFormattedAnswer(question,answer,!0),quit=yield onSubmit(question,answer,answers)}catch(err){quit=!(yield onCancel(question,answers))}if(quit)return answers}}catch(err){_iterator.e(err)}finally{_iterator.f()}return answers}),_prompt.apply(this,arguments)}function getInjectedAnswer(injected,deafultValue){let answer=injected.shift();if(answer instanceof Error)throw answer;return answer===void 0?deafultValue:answer}function inject(answers){prompt._injected=(prompt._injected||[]).concat(answers)}function override(answers){prompt._override=Object.assign({},answers)}module.exports=Object.assign(prompt,{prompt,prompts,inject,override})});var require_action2=__commonJS(function(exports,module){module.exports=(key,isSelect)=>{if(key.meta&&key.name!=="escape")return;if(key.ctrl){if(key.name==="a")return"first";if(key.name==="c")return"abort";if(key.name==="d")return"abort";if(key.name==="e")return"last";if(key.name==="g")return"reset"}if(isSelect){if(key.name==="j")return"down";if(key.name==="k")return"up"}if(key.name==="return")return"submit";if(key.name==="enter")return"submit";if(key.name==="backspace")return"delete";if(key.name==="delete")return"deleteForward";if(key.name==="abort")return"abort";if(key.name==="escape")return"exit";if(key.name==="tab")return"next";if(key.name==="pagedown")return"nextPage";if(key.name==="pageup")return"prevPage";if(key.name==="home")return"home";if(key.name==="end")return"end";if(key.name==="up")return"up";if(key.name==="down")return"down";if(key.name==="right")return"right";if(key.name==="left")return"left";return!1}});var require_strip2=__commonJS(function(exports,module){module.exports=(str)=>{let pattern=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),RGX=new RegExp(pattern,"g");return typeof str==="string"?str.replace(RGX,""):str}});var require_clear2=__commonJS(function(exports,module){var strip=require_strip2(),{erase,cursor}=require_src(),width=(str)=>[...strip(str)].length;module.exports=function(prompt,perLine){if(!perLine)return erase.line+cursor.to(0);let rows=0,lines=prompt.split(/\r?\n/);for(let line of lines)rows+=1+Math.floor(Math.max(width(line)-1,0)/perLine);return erase.lines(rows)}});var require_figures2=__commonJS(function(exports,module){var main={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},win={arrowUp:main.arrowUp,arrowDown:main.arrowDown,arrowLeft:main.arrowLeft,arrowRight:main.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},figures=process.platform==="win32"?win:main;module.exports=figures});var require_style2=__commonJS(function(exports,module){var c=require_kleur(),figures=require_figures2(),styles=Object.freeze({password:{scale:1,render:(input)=>"*".repeat(input.length)},emoji:{scale:2,render:(input)=>"\uD83D\uDE03".repeat(input.length)},invisible:{scale:0,render:(input)=>""},default:{scale:1,render:(input)=>`${input}`}}),render=(type)=>styles[type]||styles.default,symbols=Object.freeze({aborted:c.red(figures.cross),done:c.green(figures.tick),exited:c.yellow(figures.cross),default:c.cyan("?")}),symbol=(done,aborted,exited)=>aborted?symbols.aborted:exited?symbols.exited:done?symbols.done:symbols.default,delimiter=(completing)=>c.gray(completing?figures.ellipsis:figures.pointerSmall),item=(expandable,expanded)=>c.gray(expandable?expanded?figures.pointerSmall:"+":figures.line);module.exports={styles,render,symbols,symbol,delimiter,item}});var require_lines2=__commonJS(function(exports,module){var strip=require_strip2();module.exports=function(msg,perLine){let lines=String(strip(msg)||"").split(/\r?\n/);if(!perLine)return lines.length;return lines.map((l)=>Math.ceil(l.length/perLine)).reduce((a,b)=>a+b)}});var require_wrap2=__commonJS(function(exports,module){module.exports=(msg,opts={})=>{let tab=Number.isSafeInteger(parseInt(opts.margin))?Array(parseInt(opts.margin)).fill(" ").join(""):opts.margin||"",width=opts.width;return(msg||"").split(/\r?\n/g).map((line)=>line.split(/\s+/g).reduce((arr,w)=>{if(w.length+tab.length>=width||arr[arr.length-1].length+w.length+1<width)arr[arr.length-1]+=` ${w}`;else arr.push(`${tab}${w}`);return arr},[tab]).join(`
52
52
  `)).join(`
53
- `)}});var f9=K((H5,b9)=>{b9.exports=(Y,$,H)=>{H=H||$;let Z=Math.min($-H,Y-Math.floor(H/2));if(Z<0)Z=0;let X=Math.min(Z+H,$);return{startIndex:Z,endIndex:X}}});var j=K((Z5,w9)=>{w9.exports={action:A9(),clear:T9(),style:j9(),strip:u1(),figures:S0(),lines:k9(),wrap:x9(),entriesToDisplay:f9()}});var l=K((U5,y9)=>{var g9=_1("readline"),{action:bZ}=j(),fZ=_1("events"),{beep:wZ,cursor:gZ}=O(),vZ=I();class v9 extends fZ{constructor(Y={}){super();this.firstRender=!0,this.in=Y.stdin||process.stdin,this.out=Y.stdout||process.stdout,this.onRender=(Y.onRender||(()=>{return})).bind(this);let $=g9.createInterface({input:this.in,escapeCodeTimeout:50});if(g9.emitKeypressEvents(this.in,$),this.in.isTTY)this.in.setRawMode(!0);let H=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,Z=(X,U)=>{let Q=bZ(U,H);if(Q===!1)this._&&this._(X,U);else if(typeof this[Q]==="function")this[Q](U);else this.bell()};this.close=()=>{if(this.out.write(gZ.show),this.in.removeListener("keypress",Z),this.in.isTTY)this.in.setRawMode(!1);$.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",Z)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(wZ)}render(){if(this.onRender(vZ),this.firstRender)this.firstRender=!1}}y9.exports=v9});var c9=K((X5,u9)=>{var c1=I(),yZ=l(),{erase:dZ,cursor:V1}=O(),{style:G0,clear:I0,lines:uZ,figures:cZ}=j();class d9 extends yZ{constructor(Y={}){super(Y);this.transform=G0.render(Y.style),this.scale=this.transform.scale,this.msg=Y.message,this.initial=Y.initial||"",this.validator=Y.validate||(()=>!0),this.value="",this.errorMsg=Y.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=I0("",this.out.columns),this.render()}set value(Y){if(!Y&&this.initial)this.placeholder=!0,this.rendered=c1.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render(Y);this._value=Y,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
54
- `),this.close()}async validate(){let Y=await this.validator(this.value);if(typeof Y==="string")this.errorMsg=Y,Y=!1;this.error=!Y}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
55
- `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(Y){if(this.placeholder)return;this.cursor=this.cursor+Y,this.cursorOffset+=Y}_(Y,$){let H=this.value.slice(0,this.cursor),Z=this.value.slice(this.cursor);this.value=`${H}${Y}${Z}`,this.red=!1,this.cursor=this.placeholder?0:H.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let Y=this.value.slice(0,this.cursor-1),$=this.value.slice(this.cursor);if(this.value=`${Y}${$}`,this.red=!1,this.isCursorAtStart())this.cursorOffset=0;else this.cursorOffset++,this.moveCursor(-1);this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let Y=this.value.slice(0,this.cursor),$=this.value.slice(this.cursor+1);if(this.value=`${Y}${$}`,this.red=!1,this.isCursorAtEnd())this.cursorOffset=0;else this.cursorOffset++;this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(V1.down(uZ(this.outputError,this.out.columns)-1)+I0(this.outputError,this.out.columns));this.out.write(I0(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[G0.symbol(this.done,this.aborted),c1.bold(this.msg),G0.delimiter(this.done),this.red?c1.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
56
- `).reduce((Y,$,H)=>Y+`
57
- ${H?" ":cZ.pointerSmall} ${c1.red().italic($)}`,"");this.out.write(dZ.line+V1.to(0)+this.outputText+V1.save+this.outputError+V1.restore+V1.move(this.cursorOffset,0))}}u9.exports=d9});var m9=K((Q5,i9)=>{var p=I(),lZ=l(),{style:l9,clear:p9,figures:l1,wrap:pZ,entriesToDisplay:nZ}=j(),{cursor:iZ}=O();class n9 extends lZ{constructor(Y={}){super(Y);this.msg=Y.message,this.hint=Y.hint||"- Use arrow-keys. Return to submit.",this.warn=Y.warn||"- This option is disabled",this.cursor=Y.initial||0,this.choices=Y.choices.map(($,H)=>{if(typeof $==="string")$={title:$,value:H};return{title:$&&($.title||$.value||$),value:$&&($.value===void 0?H:$.value),description:$&&$.description,selected:$&&$.selected,disabled:$&&$.disabled}}),this.optionsPerPage=Y.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=p9("",this.out.columns),this.render()}moveCursor(Y){this.cursor=Y,this.value=this.choices[Y].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
53
+ `)}});var require_entriesToDisplay2=__commonJS(function(exports,module){module.exports=(cursor,total,maxVisible)=>{maxVisible=maxVisible||total;let startIndex=Math.min(total-maxVisible,cursor-Math.floor(maxVisible/2));if(startIndex<0)startIndex=0;let endIndex=Math.min(startIndex+maxVisible,total);return{startIndex,endIndex}}});var require_util2=__commonJS(function(exports,module){module.exports={action:require_action2(),clear:require_clear2(),style:require_style2(),strip:require_strip2(),figures:require_figures2(),lines:require_lines2(),wrap:require_wrap2(),entriesToDisplay:require_entriesToDisplay2()}});var require_prompt2=__commonJS(function(exports,module){var readline=__require("readline"),{action}=require_util2(),EventEmitter=__require("events"),{beep,cursor}=require_src(),color=require_kleur();class Prompt extends EventEmitter{constructor(opts={}){super();this.firstRender=!0,this.in=opts.stdin||process.stdin,this.out=opts.stdout||process.stdout,this.onRender=(opts.onRender||(()=>{return})).bind(this);let rl=readline.createInterface({input:this.in,escapeCodeTimeout:50});if(readline.emitKeypressEvents(this.in,rl),this.in.isTTY)this.in.setRawMode(!0);let isSelect=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,keypress=(str,key)=>{let a=action(key,isSelect);if(a===!1)this._&&this._(str,key);else if(typeof this[a]==="function")this[a](key);else this.bell()};this.close=()=>{if(this.out.write(cursor.show),this.in.removeListener("keypress",keypress),this.in.isTTY)this.in.setRawMode(!1);rl.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(beep)}render(){if(this.onRender(color),this.firstRender)this.firstRender=!1}}module.exports=Prompt});var require_text2=__commonJS(function(exports,module){var color=require_kleur(),Prompt=require_prompt2(),{erase,cursor}=require_src(),{style,clear,lines,figures}=require_util2();class TextPrompt extends Prompt{constructor(opts={}){super(opts);this.transform=style.render(opts.style),this.scale=this.transform.scale,this.msg=opts.message,this.initial=opts.initial||"",this.validator=opts.validate||(()=>!0),this.value="",this.errorMsg=opts.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=clear("",this.out.columns),this.render()}set value(v){if(!v&&this.initial)this.placeholder=!0,this.rendered=color.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render(v);this._value=v,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
54
+ `),this.close()}async validate(){let valid=await this.validator(this.value);if(typeof valid==="string")this.errorMsg=valid,valid=!1;this.error=!valid}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
55
+ `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(n){if(this.placeholder)return;this.cursor=this.cursor+n,this.cursorOffset+=n}_(c,key){let s1=this.value.slice(0,this.cursor),s2=this.value.slice(this.cursor);this.value=`${s1}${c}${s2}`,this.red=!1,this.cursor=this.placeholder?0:s1.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let s1=this.value.slice(0,this.cursor-1),s2=this.value.slice(this.cursor);if(this.value=`${s1}${s2}`,this.red=!1,this.isCursorAtStart())this.cursorOffset=0;else this.cursorOffset++,this.moveCursor(-1);this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let s1=this.value.slice(0,this.cursor),s2=this.value.slice(this.cursor+1);if(this.value=`${s1}${s2}`,this.red=!1,this.isCursorAtEnd())this.cursorOffset=0;else this.cursorOffset++;this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(cursor.down(lines(this.outputError,this.out.columns)-1)+clear(this.outputError,this.out.columns));this.out.write(clear(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(this.done),this.red?color.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
56
+ `).reduce((a,l,i)=>a+`
57
+ ${i?" ":figures.pointerSmall} ${color.red().italic(l)}`,"");this.out.write(erase.line+cursor.to(0)+this.outputText+cursor.save+this.outputError+cursor.restore+cursor.move(this.cursorOffset,0))}}module.exports=TextPrompt});var require_select2=__commonJS(function(exports,module){var color=require_kleur(),Prompt=require_prompt2(),{style,clear,figures,wrap,entriesToDisplay}=require_util2(),{cursor}=require_src();class SelectPrompt extends Prompt{constructor(opts={}){super(opts);this.msg=opts.message,this.hint=opts.hint||"- Use arrow-keys. Return to submit.",this.warn=opts.warn||"- This option is disabled",this.cursor=opts.initial||0,this.choices=opts.choices.map((ch,idx)=>{if(typeof ch==="string")ch={title:ch,value:idx};return{title:ch&&(ch.title||ch.value||ch),value:ch&&(ch.value===void 0?idx:ch.value),description:ch&&ch.description,selected:ch&&ch.selected,disabled:ch&&ch.disabled}}),this.optionsPerPage=opts.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=clear("",this.out.columns),this.render()}moveCursor(n){this.cursor=n,this.value=this.choices[n].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
58
58
  `),this.close()}submit(){if(!this.selection.disabled)this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
59
- `),this.close();else this.bell()}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){if(this.cursor===0)this.moveCursor(this.choices.length-1);else this.moveCursor(this.cursor-1);this.render()}down(){if(this.cursor===this.choices.length-1)this.moveCursor(0);else this.moveCursor(this.cursor+1);this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(Y,$){if(Y===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(iZ.hide);else this.out.write(p9(this.outputText,this.out.columns));super.render();let{startIndex:Y,endIndex:$}=nZ(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[l9.symbol(this.done,this.aborted),p.bold(this.msg),l9.delimiter(!1),this.done?this.selection.title:this.selection.disabled?p.yellow(this.warn):p.gray(this.hint)].join(" "),!this.done){this.outputText+=`
60
- `;for(let H=Y;H<$;H++){let Z,X,U="",Q=this.choices[H];if(H===Y&&Y>0)X=l1.arrowUp;else if(H===$-1&&$<this.choices.length)X=l1.arrowDown;else X=" ";if(Q.disabled)Z=this.cursor===H?p.gray().underline(Q.title):p.strikethrough().gray(Q.title),X=(this.cursor===H?p.bold().gray(l1.pointer)+" ":" ")+X;else if(Z=this.cursor===H?p.cyan().underline(Q.title):Q.title,X=(this.cursor===H?p.cyan(l1.pointer)+" ":" ")+X,Q.description&&this.cursor===H){if(U=` - ${Q.description}`,X.length+Z.length+U.length>=this.out.columns||Q.description.split(/\r?\n/).length>1)U=`
61
- `+pZ(Q.description,{margin:3,width:this.out.columns})}this.outputText+=`${X} ${Z}${p.gray(U)}
62
- `}}this.out.write(this.outputText)}}i9.exports=n9});var a9=K((J5,r9)=>{var p1=I(),mZ=l(),{style:t9,clear:tZ}=j(),{cursor:s9,erase:sZ}=O();class o9 extends mZ{constructor(Y={}){super(Y);this.msg=Y.message,this.value=!!Y.initial,this.active=Y.active||"on",this.inactive=Y.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
59
+ `),this.close();else this.bell()}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){if(this.cursor===0)this.moveCursor(this.choices.length-1);else this.moveCursor(this.cursor-1);this.render()}down(){if(this.cursor===this.choices.length-1)this.moveCursor(0);else this.moveCursor(this.cursor+1);this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(c,key){if(c===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);else this.out.write(clear(this.outputText,this.out.columns));super.render();let{startIndex,endIndex}=entriesToDisplay(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(!1),this.done?this.selection.title:this.selection.disabled?color.yellow(this.warn):color.gray(this.hint)].join(" "),!this.done){this.outputText+=`
60
+ `;for(let i=startIndex;i<endIndex;i++){let title,prefix,desc="",v=this.choices[i];if(i===startIndex&&startIndex>0)prefix=figures.arrowUp;else if(i===endIndex-1&&endIndex<this.choices.length)prefix=figures.arrowDown;else prefix=" ";if(v.disabled)title=this.cursor===i?color.gray().underline(v.title):color.strikethrough().gray(v.title),prefix=(this.cursor===i?color.bold().gray(figures.pointer)+" ":" ")+prefix;else if(title=this.cursor===i?color.cyan().underline(v.title):v.title,prefix=(this.cursor===i?color.cyan(figures.pointer)+" ":" ")+prefix,v.description&&this.cursor===i){if(desc=` - ${v.description}`,prefix.length+title.length+desc.length>=this.out.columns||v.description.split(/\r?\n/).length>1)desc=`
61
+ `+wrap(v.description,{margin:3,width:this.out.columns})}this.outputText+=`${prefix} ${title}${color.gray(desc)}
62
+ `}}this.out.write(this.outputText)}}module.exports=SelectPrompt});var require_toggle2=__commonJS(function(exports,module){var color=require_kleur(),Prompt=require_prompt2(),{style,clear}=require_util2(),{cursor,erase}=require_src();class TogglePrompt extends Prompt{constructor(opts={}){super(opts);this.msg=opts.message,this.value=!!opts.initial,this.active=opts.active||"on",this.inactive=opts.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
63
63
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
64
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(Y,$){if(Y===" ")this.value=!this.value;else if(Y==="1")this.value=!0;else if(Y==="0")this.value=!1;else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(s9.hide);else this.out.write(tZ(this.outputText,this.out.columns));super.render(),this.outputText=[t9.symbol(this.done,this.aborted),p1.bold(this.msg),t9.delimiter(this.done),this.value?this.inactive:p1.cyan().underline(this.inactive),p1.gray("/"),this.value?p1.cyan().underline(this.active):this.active].join(" "),this.out.write(sZ.line+s9.to(0)+this.outputText)}}r9.exports=o9});var b=K((D5,e9)=>{class n1{constructor({token:Y,date:$,parts:H,locales:Z}){this.token=Y,this.date=$||new Date,this.parts=H||[this],this.locales=Z||{}}up(){}down(){}next(){let Y=this.parts.indexOf(this);return this.parts.find(($,H)=>H>Y&&$ instanceof n1)}setTo(Y){}prev(){let Y=[].concat(this.parts).reverse(),$=Y.indexOf(this);return Y.find((H,Z)=>Z>$&&H instanceof n1)}toString(){return String(this.date)}}e9.exports=n1});var HY=K((z5,$Y)=>{var oZ=b();class YY extends oZ{constructor(Y={}){super(Y)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let Y=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?Y.toUpperCase():Y}}$Y.exports=YY});var XY=K((K5,UY)=>{var rZ=b(),aZ=(Y)=>{return Y=Y%10,Y===1?"st":Y===2?"nd":Y===3?"rd":"th"};class ZY extends rZ{constructor(Y={}){super(Y)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(Y){this.date.setDate(parseInt(Y.substr(-2)))}toString(){let Y=this.date.getDate(),$=this.date.getDay();return this.token==="DD"?String(Y).padStart(2,"0"):this.token==="Do"?Y+aZ(Y):this.token==="d"?$+1:this.token==="ddd"?this.locales.weekdaysShort[$]:this.token==="dddd"?this.locales.weekdays[$]:Y}}UY.exports=ZY});var DY=K((W5,JY)=>{var eZ=b();class QY extends eZ{constructor(Y={}){super(Y)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(Y){this.date.setHours(parseInt(Y.substr(-2)))}toString(){let Y=this.date.getHours();if(/h/.test(this.token))Y=Y%12||12;return this.token.length>1?String(Y).padStart(2,"0"):Y}}JY.exports=QY});var WY=K((L5,KY)=>{var Y7=b();class zY extends Y7{constructor(Y={}){super(Y)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(Y){this.date.setMilliseconds(parseInt(Y.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}KY.exports=zY});var EY=K((B5,BY)=>{var $7=b();class LY extends $7{constructor(Y={}){super(Y)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(Y){this.date.setMinutes(parseInt(Y.substr(-2)))}toString(){let Y=this.date.getMinutes();return this.token.length>1?String(Y).padStart(2,"0"):Y}}BY.exports=LY});var GY=K((E5,RY)=>{var H7=b();class SY extends H7{constructor(Y={}){super(Y)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(Y){Y=parseInt(Y.substr(-2))-1,this.date.setMonth(Y<0?0:Y)}toString(){let Y=this.date.getMonth(),$=this.token.length;return $===2?String(Y+1).padStart(2,"0"):$===3?this.locales.monthsShort[Y]:$===4?this.locales.months[Y]:String(Y+1)}}RY.exports=SY});var FY=K((S5,OY)=>{var Z7=b();class IY extends Z7{constructor(Y={}){super(Y)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(Y){this.date.setSeconds(parseInt(Y.substr(-2)))}toString(){let Y=this.date.getSeconds();return this.token.length>1?String(Y).padStart(2,"0"):Y}}OY.exports=IY});var MY=K((R5,AY)=>{var U7=b();class VY extends U7{constructor(Y={}){super(Y)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(Y){this.date.setFullYear(Y.substr(-4))}toString(){let Y=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?Y.substr(-2):Y}}AY.exports=VY});var NY=K((G5,qY)=>{qY.exports={DatePart:b(),Meridiem:HY(),Day:XY(),Hours:DY(),Milliseconds:WY(),Minutes:EY(),Month:GY(),Seconds:FY(),Year:MY()}});var xY=K((I5,hY)=>{var O0=I(),X7=l(),{style:TY,clear:PY,figures:Q7}=j(),{erase:J7,cursor:CY}=O(),{DatePart:jY,Meridiem:D7,Day:z7,Hours:K7,Milliseconds:W7,Minutes:L7,Month:B7,Seconds:E7,Year:S7}=NY(),R7=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,_Y={1:({token:Y})=>Y.replace(/\\(.)/g,"$1"),2:(Y)=>new z7(Y),3:(Y)=>new B7(Y),4:(Y)=>new S7(Y),5:(Y)=>new D7(Y),6:(Y)=>new K7(Y),7:(Y)=>new L7(Y),8:(Y)=>new E7(Y),9:(Y)=>new W7(Y)},G7={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class kY extends X7{constructor(Y={}){super(Y);this.msg=Y.message,this.cursor=0,this.typed="",this.locales=Object.assign(G7,Y.locales),this._date=Y.initial||new Date,this.errorMsg=Y.error||"Please Enter A Valid Value",this.validator=Y.validate||(()=>!0),this.mask=Y.mask||"YYYY-MM-DD HH:mm:ss",this.clear=PY("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(Y){if(Y)this._date.setTime(Y.getTime())}set mask(Y){let $;this.parts=[];while($=R7.exec(Y)){let Z=$.shift(),X=$.findIndex((U)=>U!=null);this.parts.push(X in _Y?_Y[X]({token:$[X]||Z,date:this.date,parts:this.parts,locales:this.locales}):$[X]||Z)}let H=this.parts.reduce((Z,X)=>{if(typeof X==="string"&&typeof Z[Z.length-1]==="string")Z[Z.length-1]+=X;else Z.push(X);return Z},[]);this.parts.splice(0),this.parts.push(...H),this.reset()}moveCursor(Y){this.typed="",this.cursor=Y,this.fire()}reset(){this.moveCursor(this.parts.findIndex((Y)=>Y instanceof jY)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
65
- `),this.close()}async validate(){let Y=await this.validator(this.value);if(typeof Y==="string")this.errorMsg=Y,Y=!1;this.error=!Y}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
66
- `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let Y=this.parts[this.cursor].prev();if(Y==null)return this.bell();this.moveCursor(this.parts.indexOf(Y)),this.render()}right(){let Y=this.parts[this.cursor].next();if(Y==null)return this.bell();this.moveCursor(this.parts.indexOf(Y)),this.render()}next(){let Y=this.parts[this.cursor].next();this.moveCursor(Y?this.parts.indexOf(Y):this.parts.findIndex(($)=>$ instanceof jY)),this.render()}_(Y){if(/\d/.test(Y))this.typed+=Y,this.parts[this.cursor].setTo(this.typed),this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(CY.hide);else this.out.write(PY(this.outputText,this.out.columns));if(super.render(),this.outputText=[TY.symbol(this.done,this.aborted),O0.bold(this.msg),TY.delimiter(!1),this.parts.reduce((Y,$,H)=>Y.concat(H===this.cursor&&!this.done?O0.cyan().underline($.toString()):$),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split(`
67
- `).reduce((Y,$,H)=>Y+`
68
- ${H?" ":Q7.pointerSmall} ${O0.red().italic($)}`,"");this.out.write(J7.line+CY.to(0)+this.outputText)}}hY.exports=kY});var vY=K((O5,gY)=>{var i1=I(),I7=l(),{cursor:m1,erase:O7}=O(),{style:F0,figures:F7,clear:bY,lines:V7}=j(),A7=/[0-9]/,V0=(Y)=>Y!==void 0,fY=(Y,$)=>{let H=Math.pow(10,$);return Math.round(Y*H)/H};class wY extends I7{constructor(Y={}){super(Y);this.transform=F0.render(Y.style),this.msg=Y.message,this.initial=V0(Y.initial)?Y.initial:"",this.float=!!Y.float,this.round=Y.round||2,this.inc=Y.increment||1,this.min=V0(Y.min)?Y.min:-1/0,this.max=V0(Y.max)?Y.max:1/0,this.errorMsg=Y.error||"Please Enter A Valid Value",this.validator=Y.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(Y){if(!Y&&Y!==0)this.placeholder=!0,this.rendered=i1.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${fY(Y,this.round)}`),this._value=fY(Y,this.round);this.fire()}get value(){return this._value}parse(Y){return this.float?parseFloat(Y):parseInt(Y)}valid(Y){return Y==="-"||Y==="."&&this.float||A7.test(Y)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let Y=this.value;this.value=Y!==""?Y:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
69
- `),this.close()}async validate(){let Y=await this.validator(this.value);if(typeof Y==="string")this.errorMsg=Y,Y=!1;this.error=!Y}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let Y=this.value;this.value=Y!==""?Y:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
70
- `),this.close()}up(){if(this.typed="",this.value==="")this.value=this.min-this.inc;if(this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value==="")this.value=this.min+this.inc;if(this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let Y=this.value.toString();if(Y.length===0)return this.bell();if(this.value=this.parse(Y=Y.slice(0,-1))||"",this.value!==""&&this.value<this.min)this.value=this.min;this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(Y,$){if(!this.valid(Y))return this.bell();let H=Date.now();if(H-this.lastHit>1000)this.typed="";if(this.typed+=Y,this.lastHit=H,this.color="cyan",Y===".")return this.fire();if(this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire(),this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(m1.down(V7(this.outputError,this.out.columns)-1)+bY(this.outputError,this.out.columns));this.out.write(bY(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[F0.symbol(this.done,this.aborted),i1.bold(this.msg),F0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?i1[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
71
- `).reduce((Y,$,H)=>Y+`
72
- ${H?" ":F7.pointerSmall} ${i1.red().italic($)}`,"");this.out.write(O7.line+m1.to(0)+this.outputText+m1.save+this.outputError+m1.restore)}}gY.exports=wY});var A0=K((F5,cY)=>{var f=I(),{cursor:M7}=O(),q7=l(),{clear:yY,figures:a,style:dY,wrap:N7,entriesToDisplay:T7}=j();class uY extends q7{constructor(Y={}){super(Y);if(this.msg=Y.message,this.cursor=Y.cursor||0,this.scrollIndex=Y.cursor||0,this.hint=Y.hint||"",this.warn=Y.warn||"- This option is disabled -",this.minSelected=Y.min,this.showMinError=!1,this.maxChoices=Y.max,this.instructions=Y.instructions,this.optionsPerPage=Y.optionsPerPage||10,this.value=Y.choices.map(($,H)=>{if(typeof $==="string")$={title:$,value:H};return{title:$&&($.title||$.value||$),description:$&&$.description,value:$&&($.value===void 0?H:$.value),selected:$&&$.selected,disabled:$&&$.disabled}}),this.clear=yY("",this.out.columns),!Y.overrideRender)this.render()}reset(){this.value.map((Y)=>!Y.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((Y)=>Y.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
73
- `),this.close()}submit(){let Y=this.value.filter(($)=>$.selected);if(this.minSelected&&Y.length<this.minSelected)this.showMinError=!0,this.render();else this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
74
- `),this.close()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){if(this.cursor===0)this.cursor=this.value.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.value.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((Y)=>Y.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let Y=this.value[this.cursor];if(Y.selected)Y.selected=!1,this.render();else if(Y.disabled||this.value.filter(($)=>$.selected).length>=this.maxChoices)return this.bell();else Y.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let Y=!this.value[this.cursor].selected;this.value.filter(($)=>!$.disabled).forEach(($)=>$.selected=Y),this.render()}_(Y,$){if(Y===" ")this.handleSpaceToggle();else if(Y==="a")this.toggleAll();else return this.bell()}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
64
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(c,key){if(c===" ")this.value=!this.value;else if(c==="1")this.value=!0;else if(c==="0")this.value=!1;else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);else this.out.write(clear(this.outputText,this.out.columns));super.render(),this.outputText=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(this.done),this.value?this.inactive:color.cyan().underline(this.inactive),color.gray("/"),this.value?color.cyan().underline(this.active):this.active].join(" "),this.out.write(erase.line+cursor.to(0)+this.outputText)}}module.exports=TogglePrompt});var require_datepart2=__commonJS(function(exports,module){class DatePart{constructor({token,date,parts,locales}){this.token=token,this.date=date||new Date,this.parts=parts||[this],this.locales=locales||{}}up(){}down(){}next(){let currentIdx=this.parts.indexOf(this);return this.parts.find((part,idx)=>idx>currentIdx&&part instanceof DatePart)}setTo(val){}prev(){let parts=[].concat(this.parts).reverse(),currentIdx=parts.indexOf(this);return parts.find((part,idx)=>idx>currentIdx&&part instanceof DatePart)}toString(){return String(this.date)}}module.exports=DatePart});var require_meridiem2=__commonJS(function(exports,module){var DatePart=require_datepart2();class Meridiem extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let meridiem=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?meridiem.toUpperCase():meridiem}}module.exports=Meridiem});var require_day2=__commonJS(function(exports,module){var DatePart=require_datepart2(),pos=(n)=>(n=n%10,n===1?"st":n===2?"nd":n===3?"rd":"th");class Day extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(val){this.date.setDate(parseInt(val.substr(-2)))}toString(){let date=this.date.getDate(),day=this.date.getDay();return this.token==="DD"?String(date).padStart(2,"0"):this.token==="Do"?date+pos(date):this.token==="d"?day+1:this.token==="ddd"?this.locales.weekdaysShort[day]:this.token==="dddd"?this.locales.weekdays[day]:date}}module.exports=Day});var require_hours2=__commonJS(function(exports,module){var DatePart=require_datepart2();class Hours extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(val){this.date.setHours(parseInt(val.substr(-2)))}toString(){let hours=this.date.getHours();if(/h/.test(this.token))hours=hours%12||12;return this.token.length>1?String(hours).padStart(2,"0"):hours}}module.exports=Hours});var require_milliseconds2=__commonJS(function(exports,module){var DatePart=require_datepart2();class Milliseconds extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(val){this.date.setMilliseconds(parseInt(val.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}module.exports=Milliseconds});var require_minutes2=__commonJS(function(exports,module){var DatePart=require_datepart2();class Minutes extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(val){this.date.setMinutes(parseInt(val.substr(-2)))}toString(){let m=this.date.getMinutes();return this.token.length>1?String(m).padStart(2,"0"):m}}module.exports=Minutes});var require_month2=__commonJS(function(exports,module){var DatePart=require_datepart2();class Month extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(val){val=parseInt(val.substr(-2))-1,this.date.setMonth(val<0?0:val)}toString(){let month=this.date.getMonth(),tl=this.token.length;return tl===2?String(month+1).padStart(2,"0"):tl===3?this.locales.monthsShort[month]:tl===4?this.locales.months[month]:String(month+1)}}module.exports=Month});var require_seconds2=__commonJS(function(exports,module){var DatePart=require_datepart2();class Seconds extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(val){this.date.setSeconds(parseInt(val.substr(-2)))}toString(){let s=this.date.getSeconds();return this.token.length>1?String(s).padStart(2,"0"):s}}module.exports=Seconds});var require_year2=__commonJS(function(exports,module){var DatePart=require_datepart2();class Year extends DatePart{constructor(opts={}){super(opts)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(val){this.date.setFullYear(val.substr(-4))}toString(){let year=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?year.substr(-2):year}}module.exports=Year});var require_dateparts2=__commonJS(function(exports,module){module.exports={DatePart:require_datepart2(),Meridiem:require_meridiem2(),Day:require_day2(),Hours:require_hours2(),Milliseconds:require_milliseconds2(),Minutes:require_minutes2(),Month:require_month2(),Seconds:require_seconds2(),Year:require_year2()}});var require_date2=__commonJS(function(exports,module){var color=require_kleur(),Prompt=require_prompt2(),{style,clear,figures}=require_util2(),{erase,cursor}=require_src(),{DatePart,Meridiem,Day,Hours,Milliseconds,Minutes,Month,Seconds,Year}=require_dateparts2(),regex=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,regexGroups={1:({token})=>token.replace(/\\(.)/g,"$1"),2:(opts)=>new Day(opts),3:(opts)=>new Month(opts),4:(opts)=>new Year(opts),5:(opts)=>new Meridiem(opts),6:(opts)=>new Hours(opts),7:(opts)=>new Minutes(opts),8:(opts)=>new Seconds(opts),9:(opts)=>new Milliseconds(opts)},dfltLocales={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends Prompt{constructor(opts={}){super(opts);this.msg=opts.message,this.cursor=0,this.typed="",this.locales=Object.assign(dfltLocales,opts.locales),this._date=opts.initial||new Date,this.errorMsg=opts.error||"Please Enter A Valid Value",this.validator=opts.validate||(()=>!0),this.mask=opts.mask||"YYYY-MM-DD HH:mm:ss",this.clear=clear("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(date){if(date)this._date.setTime(date.getTime())}set mask(mask){let result;this.parts=[];while(result=regex.exec(mask)){let match=result.shift(),idx=result.findIndex((gr)=>gr!=null);this.parts.push(idx in regexGroups?regexGroups[idx]({token:result[idx]||match,date:this.date,parts:this.parts,locales:this.locales}):result[idx]||match)}let parts=this.parts.reduce((arr,i)=>{if(typeof i==="string"&&typeof arr[arr.length-1]==="string")arr[arr.length-1]+=i;else arr.push(i);return arr},[]);this.parts.splice(0),this.parts.push(...parts),this.reset()}moveCursor(n){this.typed="",this.cursor=n,this.fire()}reset(){this.moveCursor(this.parts.findIndex((p)=>p instanceof DatePart)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
65
+ `),this.close()}async validate(){let valid=await this.validator(this.value);if(typeof valid==="string")this.errorMsg=valid,valid=!1;this.error=!valid}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
66
+ `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let prev=this.parts[this.cursor].prev();if(prev==null)return this.bell();this.moveCursor(this.parts.indexOf(prev)),this.render()}right(){let next=this.parts[this.cursor].next();if(next==null)return this.bell();this.moveCursor(this.parts.indexOf(next)),this.render()}next(){let next=this.parts[this.cursor].next();this.moveCursor(next?this.parts.indexOf(next):this.parts.findIndex((part)=>part instanceof DatePart)),this.render()}_(c){if(/\d/.test(c))this.typed+=c,this.parts[this.cursor].setTo(this.typed),this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);else this.out.write(clear(this.outputText,this.out.columns));if(super.render(),this.outputText=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(!1),this.parts.reduce((arr,p,idx)=>arr.concat(idx===this.cursor&&!this.done?color.cyan().underline(p.toString()):p),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split(`
67
+ `).reduce((a,l,i)=>a+`
68
+ ${i?" ":figures.pointerSmall} ${color.red().italic(l)}`,"");this.out.write(erase.line+cursor.to(0)+this.outputText)}}module.exports=DatePrompt});var require_number2=__commonJS(function(exports,module){var color=require_kleur(),Prompt=require_prompt2(),{cursor,erase}=require_src(),{style,figures,clear,lines}=require_util2(),isNumber=/[0-9]/,isDef=(any)=>any!==void 0,round=(number,precision)=>{let factor=Math.pow(10,precision);return Math.round(number*factor)/factor};class NumberPrompt extends Prompt{constructor(opts={}){super(opts);this.transform=style.render(opts.style),this.msg=opts.message,this.initial=isDef(opts.initial)?opts.initial:"",this.float=!!opts.float,this.round=opts.round||2,this.inc=opts.increment||1,this.min=isDef(opts.min)?opts.min:-1/0,this.max=isDef(opts.max)?opts.max:1/0,this.errorMsg=opts.error||"Please Enter A Valid Value",this.validator=opts.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(v){if(!v&&v!==0)this.placeholder=!0,this.rendered=color.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${round(v,this.round)}`),this._value=round(v,this.round);this.fire()}get value(){return this._value}parse(x){return this.float?parseFloat(x):parseInt(x)}valid(c){return c==="-"||c==="."&&this.float||isNumber.test(c)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let x=this.value;this.value=x!==""?x:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
69
+ `),this.close()}async validate(){let valid=await this.validator(this.value);if(typeof valid==="string")this.errorMsg=valid,valid=!1;this.error=!valid}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let x=this.value;this.value=x!==""?x:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
70
+ `),this.close()}up(){if(this.typed="",this.value==="")this.value=this.min-this.inc;if(this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value==="")this.value=this.min+this.inc;if(this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let val=this.value.toString();if(val.length===0)return this.bell();if(this.value=this.parse(val=val.slice(0,-1))||"",this.value!==""&&this.value<this.min)this.value=this.min;this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(c,key){if(!this.valid(c))return this.bell();let now=Date.now();if(now-this.lastHit>1000)this.typed="";if(this.typed+=c,this.lastHit=now,this.color="cyan",c===".")return this.fire();if(this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire(),this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(cursor.down(lines(this.outputError,this.out.columns)-1)+clear(this.outputError,this.out.columns));this.out.write(clear(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(this.done),!this.done||!this.done&&!this.placeholder?color[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
71
+ `).reduce((a,l,i)=>a+`
72
+ ${i?" ":figures.pointerSmall} ${color.red().italic(l)}`,"");this.out.write(erase.line+cursor.to(0)+this.outputText+cursor.save+this.outputError+cursor.restore)}}module.exports=NumberPrompt});var require_multiselect2=__commonJS(function(exports,module){var color=require_kleur(),{cursor}=require_src(),Prompt=require_prompt2(),{clear,figures,style,wrap,entriesToDisplay}=require_util2();class MultiselectPrompt extends Prompt{constructor(opts={}){super(opts);if(this.msg=opts.message,this.cursor=opts.cursor||0,this.scrollIndex=opts.cursor||0,this.hint=opts.hint||"",this.warn=opts.warn||"- This option is disabled -",this.minSelected=opts.min,this.showMinError=!1,this.maxChoices=opts.max,this.instructions=opts.instructions,this.optionsPerPage=opts.optionsPerPage||10,this.value=opts.choices.map((ch,idx)=>{if(typeof ch==="string")ch={title:ch,value:idx};return{title:ch&&(ch.title||ch.value||ch),description:ch&&ch.description,value:ch&&(ch.value===void 0?idx:ch.value),selected:ch&&ch.selected,disabled:ch&&ch.disabled}}),this.clear=clear("",this.out.columns),!opts.overrideRender)this.render()}reset(){this.value.map((v)=>!v.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((v)=>v.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
73
+ `),this.close()}submit(){let selected=this.value.filter((e)=>e.selected);if(this.minSelected&&selected.length<this.minSelected)this.showMinError=!0,this.render();else this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
74
+ `),this.close()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){if(this.cursor===0)this.cursor=this.value.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.value.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((e)=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let v=this.value[this.cursor];if(v.selected)v.selected=!1,this.render();else if(v.disabled||this.value.filter((e)=>e.selected).length>=this.maxChoices)return this.bell();else v.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let newSelected=!this.value[this.cursor].selected;this.value.filter((v)=>!v.disabled).forEach((v)=>v.selected=newSelected),this.render()}_(c,key){if(c===" ")this.handleSpaceToggle();else if(c==="a")this.toggleAll();else return this.bell()}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
75
75
  Instructions:
76
- ${a.arrowUp}/${a.arrowDown}: Highlight option
77
- ${a.arrowLeft}/${a.arrowRight}/[space]: Toggle selection
76
+ ${figures.arrowUp}/${figures.arrowDown}: Highlight option
77
+ ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
78
78
  `+(this.maxChoices===void 0?` a: Toggle all
79
- `:"")+" enter/return: Complete answer"}return""}renderOption(Y,$,H,Z){let X=($.selected?f.green(a.radioOn):a.radioOff)+" "+Z+" ",U,Q;if($.disabled)U=Y===H?f.gray().underline($.title):f.strikethrough().gray($.title);else if(U=Y===H?f.cyan().underline($.title):$.title,Y===H&&$.description){if(Q=` - ${$.description}`,X.length+U.length+Q.length>=this.out.columns||$.description.split(/\r?\n/).length>1)Q=`
80
- `+N7($.description,{margin:X.length,width:this.out.columns})}return X+U+f.gray(Q||"")}paginateOptions(Y){if(Y.length===0)return f.red("No matches for this query.");let{startIndex:$,endIndex:H}=T7(this.cursor,Y.length,this.optionsPerPage),Z,X=[];for(let U=$;U<H;U++){if(U===$&&$>0)Z=a.arrowUp;else if(U===H-1&&H<Y.length)Z=a.arrowDown;else Z=" ";X.push(this.renderOption(this.cursor,Y[U],U,Z))}return`
81
- `+X.join(`
82
- `)}renderOptions(Y){if(!this.done)return this.paginateOptions(Y);return""}renderDoneOrInstructions(){if(this.done)return this.value.filter(($)=>$.selected).map(($)=>$.title).join(", ");let Y=[f.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)Y.push(f.yellow(this.warn));return Y.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(M7.hide);super.render();let Y=[dY.symbol(this.done,this.aborted),f.bold(this.msg),dY.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)Y+=f.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;Y+=this.renderOptions(this.value),this.out.write(this.clear+Y),this.clear=yY(Y,this.out.columns)}}cY.exports=uY});var tY=K((V5,mY)=>{var A1=I(),P7=l(),{erase:C7,cursor:lY}=O(),{style:M0,clear:pY,figures:q0,wrap:j7,entriesToDisplay:_7}=j(),nY=(Y,$)=>Y[$]&&(Y[$].value||Y[$].title||Y[$]),k7=(Y,$)=>Y[$]&&(Y[$].title||Y[$].value||Y[$]),h7=(Y,$)=>{let H=Y.findIndex((Z)=>Z.value===$||Z.title===$);return H>-1?H:void 0};class iY extends P7{constructor(Y={}){super(Y);this.msg=Y.message,this.suggest=Y.suggest,this.choices=Y.choices,this.initial=typeof Y.initial==="number"?Y.initial:h7(Y.choices,Y.initial),this.select=this.initial||Y.cursor||0,this.i18n={noMatches:Y.noMatches||"no matches found"},this.fallback=Y.fallback||this.initial,this.clearFirst=Y.clearFirst||!1,this.suggestions=[],this.input="",this.limit=Y.limit||10,this.cursor=0,this.transform=M0.render(Y.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=pY("",this.out.columns),this.complete(this.render),this.render()}set fallback(Y){this._fb=Number.isSafeInteger(parseInt(Y))?parseInt(Y):Y}get fallback(){let Y;if(typeof this._fb==="number")Y=this.choices[this._fb];else if(typeof this._fb==="string")Y={title:this._fb};return Y||this._fb||{title:this.i18n.noMatches}}moveSelect(Y){if(this.select=Y,this.suggestions.length>0)this.value=nY(this.suggestions,Y);else this.value=this.fallback.value;this.fire()}async complete(Y){let $=this.completing=this.suggest(this.input,this.choices),H=await $;if(this.completing!==$)return;this.suggestions=H.map((X,U,Q)=>({title:k7(Q,U),value:nY(Q,U),description:X.description})),this.completing=!1;let Z=Math.max(H.length-1,0);this.moveSelect(Math.min(Z,this.select)),Y&&Y()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){if(this.clearFirst&&this.input.length>0)this.reset();else this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
79
+ `:"")+" enter/return: Complete answer"}return""}renderOption(cursor2,v,i,arrowIndicator){let prefix=(v.selected?color.green(figures.radioOn):figures.radioOff)+" "+arrowIndicator+" ",title,desc;if(v.disabled)title=cursor2===i?color.gray().underline(v.title):color.strikethrough().gray(v.title);else if(title=cursor2===i?color.cyan().underline(v.title):v.title,cursor2===i&&v.description){if(desc=` - ${v.description}`,prefix.length+title.length+desc.length>=this.out.columns||v.description.split(/\r?\n/).length>1)desc=`
80
+ `+wrap(v.description,{margin:prefix.length,width:this.out.columns})}return prefix+title+color.gray(desc||"")}paginateOptions(options){if(options.length===0)return color.red("No matches for this query.");let{startIndex,endIndex}=entriesToDisplay(this.cursor,options.length,this.optionsPerPage),prefix,styledOptions=[];for(let i=startIndex;i<endIndex;i++){if(i===startIndex&&startIndex>0)prefix=figures.arrowUp;else if(i===endIndex-1&&endIndex<options.length)prefix=figures.arrowDown;else prefix=" ";styledOptions.push(this.renderOption(this.cursor,options[i],i,prefix))}return`
81
+ `+styledOptions.join(`
82
+ `)}renderOptions(options){if(!this.done)return this.paginateOptions(options);return""}renderDoneOrInstructions(){if(this.done)return this.value.filter((e)=>e.selected).map((v)=>v.title).join(", ");let output=[color.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)output.push(color.yellow(this.warn));return output.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);super.render();let prompt=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)prompt+=color.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;prompt+=this.renderOptions(this.value),this.out.write(this.clear+prompt),this.clear=clear(prompt,this.out.columns)}}module.exports=MultiselectPrompt});var require_autocomplete2=__commonJS(function(exports,module){var color=require_kleur(),Prompt=require_prompt2(),{erase,cursor}=require_src(),{style,clear,figures,wrap,entriesToDisplay}=require_util2(),getVal=(arr,i)=>arr[i]&&(arr[i].value||arr[i].title||arr[i]),getTitle=(arr,i)=>arr[i]&&(arr[i].title||arr[i].value||arr[i]),getIndex=(arr,valOrTitle)=>{let index=arr.findIndex((el)=>el.value===valOrTitle||el.title===valOrTitle);return index>-1?index:void 0};class AutocompletePrompt extends Prompt{constructor(opts={}){super(opts);this.msg=opts.message,this.suggest=opts.suggest,this.choices=opts.choices,this.initial=typeof opts.initial==="number"?opts.initial:getIndex(opts.choices,opts.initial),this.select=this.initial||opts.cursor||0,this.i18n={noMatches:opts.noMatches||"no matches found"},this.fallback=opts.fallback||this.initial,this.clearFirst=opts.clearFirst||!1,this.suggestions=[],this.input="",this.limit=opts.limit||10,this.cursor=0,this.transform=style.render(opts.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=clear("",this.out.columns),this.complete(this.render),this.render()}set fallback(fb){this._fb=Number.isSafeInteger(parseInt(fb))?parseInt(fb):fb}get fallback(){let choice;if(typeof this._fb==="number")choice=this.choices[this._fb];else if(typeof this._fb==="string")choice={title:this._fb};return choice||this._fb||{title:this.i18n.noMatches}}moveSelect(i){if(this.select=i,this.suggestions.length>0)this.value=getVal(this.suggestions,i);else this.value=this.fallback.value;this.fire()}async complete(cb){let p=this.completing=this.suggest(this.input,this.choices),suggestions=await p;if(this.completing!==p)return;this.suggestions=suggestions.map((s,i,arr)=>({title:getTitle(arr,i),value:getVal(arr,i),description:s.description})),this.completing=!1;let l=Math.max(suggestions.length-1,0);this.moveSelect(Math.min(l,this.select)),cb&&cb()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){if(this.clearFirst&&this.input.length>0)this.reset();else this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
83
83
  `),this.close()}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
84
84
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
85
- `),this.close()}_(Y,$){let H=this.input.slice(0,this.cursor),Z=this.input.slice(this.cursor);this.input=`${H}${Y}${Z}`,this.cursor=H.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let Y=this.input.slice(0,this.cursor-1),$=this.input.slice(this.cursor);this.input=`${Y}${$}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let Y=this.input.slice(0,this.cursor),$=this.input.slice(this.cursor+1);this.input=`${Y}${$}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){if(this.select===0)this.moveSelect(this.suggestions.length-1);else this.moveSelect(this.select-1);this.render()}down(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}next(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(Y,$,H,Z){let X,U=H?q0.arrowUp:Z?q0.arrowDown:" ",Q=$?A1.cyan().underline(Y.title):Y.title;if(U=($?A1.cyan(q0.pointer)+" ":" ")+U,Y.description){if(X=` - ${Y.description}`,U.length+Q.length+X.length>=this.out.columns||Y.description.split(/\r?\n/).length>1)X=`
86
- `+j7(Y.description,{margin:3,width:this.out.columns})}return U+" "+Q+A1.gray(X||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(lY.hide);else this.out.write(pY(this.outputText,this.out.columns));super.render();let{startIndex:Y,endIndex:$}=_7(this.select,this.choices.length,this.limit);if(this.outputText=[M0.symbol(this.done,this.aborted,this.exited),A1.bold(this.msg),M0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let H=this.suggestions.slice(Y,$).map((Z,X)=>this.renderOption(Z,this.select===X+Y,X===0&&Y>0,X+Y===$-1&&$<this.choices.length)).join(`
85
+ `),this.close()}_(c,key){let s1=this.input.slice(0,this.cursor),s2=this.input.slice(this.cursor);this.input=`${s1}${c}${s2}`,this.cursor=s1.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let s1=this.input.slice(0,this.cursor-1),s2=this.input.slice(this.cursor);this.input=`${s1}${s2}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let s1=this.input.slice(0,this.cursor),s2=this.input.slice(this.cursor+1);this.input=`${s1}${s2}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){if(this.select===0)this.moveSelect(this.suggestions.length-1);else this.moveSelect(this.select-1);this.render()}down(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}next(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(v,hovered,isStart,isEnd){let desc,prefix=isStart?figures.arrowUp:isEnd?figures.arrowDown:" ",title=hovered?color.cyan().underline(v.title):v.title;if(prefix=(hovered?color.cyan(figures.pointer)+" ":" ")+prefix,v.description){if(desc=` - ${v.description}`,prefix.length+title.length+desc.length>=this.out.columns||v.description.split(/\r?\n/).length>1)desc=`
86
+ `+wrap(v.description,{margin:3,width:this.out.columns})}return prefix+" "+title+color.gray(desc||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);else this.out.write(clear(this.outputText,this.out.columns));super.render();let{startIndex,endIndex}=entriesToDisplay(this.select,this.choices.length,this.limit);if(this.outputText=[style.symbol(this.done,this.aborted,this.exited),color.bold(this.msg),style.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let suggestions=this.suggestions.slice(startIndex,endIndex).map((item,i)=>this.renderOption(item,this.select===i+startIndex,i===0&&startIndex>0,i+startIndex===endIndex-1&&endIndex<this.choices.length)).join(`
87
87
  `);this.outputText+=`
88
- `+(H||A1.gray(this.fallback.title))}this.out.write(C7.line+lY.to(0)+this.outputText)}}mY.exports=iY});var eY=K((A5,aY)=>{var n=I(),{cursor:x7}=O(),b7=A0(),{clear:sY,style:oY,figures:D1}=j();class rY extends b7{constructor(Y={}){Y.overrideRender=!0;super(Y);this.inputValue="",this.clear=sY("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){if(this.cursor===0)this.cursor=this.filteredOptions.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.filteredOptions.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((Y)=>Y.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){if(this.inputValue.length)this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions()}updateFilteredOptions(){let Y=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((H)=>{if(this.inputValue){if(typeof H.title==="string"){if(H.title.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}if(typeof H.value==="string"){if(H.value.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}return!1}return!0});let $=this.filteredOptions.findIndex((H)=>H===Y);this.cursor=$<0?0:$,this.render()}handleSpaceToggle(){let Y=this.filteredOptions[this.cursor];if(Y.selected)Y.selected=!1,this.render();else if(Y.disabled||this.value.filter(($)=>$.selected).length>=this.maxChoices)return this.bell();else Y.selected=!0,this.render()}handleInputChange(Y){this.inputValue=this.inputValue+Y,this.updateFilteredOptions()}_(Y,$){if(Y===" ")this.handleSpaceToggle();else this.handleInputChange(Y)}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
88
+ `+(suggestions||color.gray(this.fallback.title))}this.out.write(erase.line+cursor.to(0)+this.outputText)}}module.exports=AutocompletePrompt});var require_autocompleteMultiselect2=__commonJS(function(exports,module){var color=require_kleur(),{cursor}=require_src(),MultiselectPrompt=require_multiselect2(),{clear,style,figures}=require_util2();class AutocompleteMultiselectPrompt extends MultiselectPrompt{constructor(opts={}){opts.overrideRender=!0;super(opts);this.inputValue="",this.clear=clear("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){if(this.cursor===0)this.cursor=this.filteredOptions.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.filteredOptions.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((e)=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){if(this.inputValue.length)this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions()}updateFilteredOptions(){let currentHighlight=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((v)=>{if(this.inputValue){if(typeof v.title==="string"){if(v.title.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}if(typeof v.value==="string"){if(v.value.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}return!1}return!0});let newHighlightIndex=this.filteredOptions.findIndex((v)=>v===currentHighlight);this.cursor=newHighlightIndex<0?0:newHighlightIndex,this.render()}handleSpaceToggle(){let v=this.filteredOptions[this.cursor];if(v.selected)v.selected=!1,this.render();else if(v.disabled||this.value.filter((e)=>e.selected).length>=this.maxChoices)return this.bell();else v.selected=!0,this.render()}handleInputChange(c){this.inputValue=this.inputValue+c,this.updateFilteredOptions()}_(c,key){if(c===" ")this.handleSpaceToggle();else this.handleInputChange(c)}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
89
89
  Instructions:
90
- ${D1.arrowUp}/${D1.arrowDown}: Highlight option
91
- ${D1.arrowLeft}/${D1.arrowRight}/[space]: Toggle selection
90
+ ${figures.arrowUp}/${figures.arrowDown}: Highlight option
91
+ ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
92
92
  [a,b,c]/delete: Filter choices
93
93
  enter/return: Complete answer
94
94
  `}return""}renderCurrentInput(){return`
95
- Filtered results for: ${this.inputValue?this.inputValue:n.gray("Enter something to filter")}
96
- `}renderOption(Y,$,H){let Z;if($.disabled)Z=Y===H?n.gray().underline($.title):n.strikethrough().gray($.title);else Z=Y===H?n.cyan().underline($.title):$.title;return($.selected?n.green(D1.radioOn):D1.radioOff)+" "+Z}renderDoneOrInstructions(){if(this.done)return this.value.filter(($)=>$.selected).map(($)=>$.title).join(", ");let Y=[n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled)Y.push(n.yellow(this.warn));return Y.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(x7.hide);super.render();let Y=[oY.symbol(this.done,this.aborted),n.bold(this.msg),oY.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)Y+=n.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;Y+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+Y),this.clear=sY(Y,this.out.columns)}}aY.exports=rY});var X$=K((M5,U$)=>{var Y$=I(),f7=l(),{style:$$,clear:w7}=j(),{erase:g7,cursor:H$}=O();class Z$ extends f7{constructor(Y={}){super(Y);this.msg=Y.message,this.value=Y.initial,this.initialValue=!!Y.initial,this.yesMsg=Y.yes||"yes",this.yesOption=Y.yesOption||"(Y/n)",this.noMsg=Y.no||"no",this.noOption=Y.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
95
+ Filtered results for: ${this.inputValue?this.inputValue:color.gray("Enter something to filter")}
96
+ `}renderOption(cursor2,v,i){let title;if(v.disabled)title=cursor2===i?color.gray().underline(v.title):color.strikethrough().gray(v.title);else title=cursor2===i?color.cyan().underline(v.title):v.title;return(v.selected?color.green(figures.radioOn):figures.radioOff)+" "+title}renderDoneOrInstructions(){if(this.done)return this.value.filter((e)=>e.selected).map((v)=>v.title).join(", ");let output=[color.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled)output.push(color.yellow(this.warn));return output.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);super.render();let prompt=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)prompt+=color.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;prompt+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+prompt),this.clear=clear(prompt,this.out.columns)}}module.exports=AutocompleteMultiselectPrompt});var require_confirm2=__commonJS(function(exports,module){var color=require_kleur(),Prompt=require_prompt2(),{style,clear}=require_util2(),{erase,cursor}=require_src();class ConfirmPrompt extends Prompt{constructor(opts={}){super(opts);this.msg=opts.message,this.value=opts.initial,this.initialValue=!!opts.initial,this.yesMsg=opts.yes||"yes",this.yesOption=opts.yesOption||"(Y/n)",this.noMsg=opts.no||"no",this.noOption=opts.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
97
97
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
98
- `),this.close()}_(Y,$){if(Y.toLowerCase()==="y")return this.value=!0,this.submit();if(Y.toLowerCase()==="n")return this.value=!1,this.submit();return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(H$.hide);else this.out.write(w7(this.outputText,this.out.columns));super.render(),this.outputText=[$$.symbol(this.done,this.aborted),Y$.bold(this.msg),$$.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Y$.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(g7.line+H$.to(0)+this.outputText)}}U$.exports=Z$});var J$=K((q5,Q$)=>{Q$.exports={TextPrompt:c9(),SelectPrompt:m9(),TogglePrompt:a9(),DatePrompt:xY(),NumberPrompt:vY(),MultiselectPrompt:A0(),AutocompletePrompt:tY(),AutocompleteMultiselectPrompt:eY(),ConfirmPrompt:X$()}});var z$=K((D$)=>{var N=D$,v7=J$(),t1=(Y)=>Y;function w(Y,$,H={}){return new Promise((Z,X)=>{let U=new v7[Y]($),Q=H.onAbort||t1,J=H.onSubmit||t1,D=H.onExit||t1;U.on("state",$.onState||t1),U.on("submit",(W)=>Z(J(W))),U.on("exit",(W)=>Z(D(W))),U.on("abort",(W)=>X(Q(W)))})}N.text=(Y)=>w("TextPrompt",Y);N.password=(Y)=>{return Y.style="password",N.text(Y)};N.invisible=(Y)=>{return Y.style="invisible",N.text(Y)};N.number=(Y)=>w("NumberPrompt",Y);N.date=(Y)=>w("DatePrompt",Y);N.confirm=(Y)=>w("ConfirmPrompt",Y);N.list=(Y)=>{let $=Y.separator||",";return w("TextPrompt",Y,{onSubmit:(H)=>H.split($).map((Z)=>Z.trim())})};N.toggle=(Y)=>w("TogglePrompt",Y);N.select=(Y)=>w("SelectPrompt",Y);N.multiselect=(Y)=>{Y.choices=[].concat(Y.choices||[]);let $=(H)=>H.filter((Z)=>Z.selected).map((Z)=>Z.value);return w("MultiselectPrompt",Y,{onAbort:$,onSubmit:$})};N.autocompleteMultiselect=(Y)=>{Y.choices=[].concat(Y.choices||[]);let $=(H)=>H.filter((Z)=>Z.selected).map((Z)=>Z.value);return w("AutocompleteMultiselectPrompt",Y,{onAbort:$,onSubmit:$})};var y7=(Y,$)=>Promise.resolve($.filter((H)=>H.title.slice(0,Y.length).toLowerCase()===Y.toLowerCase()));N.autocomplete=(Y)=>{return Y.suggest=Y.suggest||y7,Y.choices=[].concat(Y.choices||[]),w("AutocompletePrompt",Y)}});var L$=K((T5,W$)=>{var N0=z$(),d7=["suggest","format","onState","validate","onRender","type"],K$=()=>{};async function e(Y=[],{onSubmit:$=K$,onCancel:H=K$}={}){let Z={},X=e._override||{};Y=[].concat(Y);let U,Q,J,D,W,Y1,$1=async(G,P,C1=!1)=>{if(!C1&&G.validate&&G.validate(P)!==!0)return;return G.format?await G.format(P,Z):P};for(Q of Y){if({name:D,type:W}=Q,typeof W==="function")W=await W(U,{...Z},Q),Q.type=W;if(!W)continue;for(let G in Q){if(d7.includes(G))continue;let P=Q[G];Q[G]=typeof P==="function"?await P(U,{...Z},Y1):P}if(Y1=Q,typeof Q.message!=="string")throw Error("prompt message is required");if({name:D,type:W}=Q,N0[W]===void 0)throw Error(`prompt type (${W}) is not defined`);if(X[Q.name]!==void 0){if(U=await $1(Q,X[Q.name]),U!==void 0){Z[D]=U;continue}}try{U=e._injected?u7(e._injected,Q.initial):await N0[W](Q),Z[D]=U=await $1(Q,U,!0),J=await $(Q,U,Z)}catch(G){J=!await H(Q,Z)}if(J)return Z}return Z}function u7(Y,$){let H=Y.shift();if(H instanceof Error)throw H;return H===void 0?$:H}function c7(Y){e._injected=(e._injected||[]).concat(Y)}function l7(Y){e._override=Object.assign({},Y)}W$.exports=Object.assign(e,{prompt:e,prompts:N0,inject:c7,override:l7})});var T=K((P5,B$)=>{function p7(Y){Y=(Array.isArray(Y)?Y:Y.split(".")).map(Number);let $=0,H=process.versions.node.split(".").map(Number);for(;$<Y.length;$++){if(H[$]>Y[$])return!1;if(Y[$]>H[$])return!0}return!1}B$.exports=p7("8.6.0")?F9():L$()});var i=K((W8,S$)=>{var n7=/\{([0-9a-zA-Z_]+)\}/g;S$.exports=i7;function i7(Y){var $;if(arguments.length===2&&typeof arguments[1]==="object")$=arguments[1];else{$=Array(arguments.length-1);for(var H=1;H<arguments.length;++H)$[H-1]=arguments[H]}if(!$||!$.hasOwnProperty)$={};return Y.replace(n7,function(X,U,Q){var J;if(Y[Q-1]==="{"&&Y[Q+X.length]==="}")return U;else{if(J=$.hasOwnProperty(U)?$[U]:null,J===null||J===void 0)return"";return J}})}});import"reflect-metadata";import"@elysiumjs/core";import{Command as u$}from"@elysiumjs/core";class R extends u${static dev=!0}var P0=V(T(),1);import{join as r7}from"path";import{Command as q1,CommandArgumentType as o1}from"@elysiumjs/core";var T0=(Y,$,H="asc")=>{if(!Y)return[];let Z=(U,Q)=>`${$(U)}`.localeCompare($(Q)),X=(U,Q)=>`${$(Q)}`.localeCompare($(U));return Y.slice().sort(H==="desc"?X:Z)};var E$=(Y)=>{if(!Y||Y.length===0)return"";let $=Y.toLowerCase();return $.substring(0,1).toUpperCase()+$.substring(1,$.length)};var F=(Y,$)=>{let H=Y?.replace(/([A-Z])+/g,E$).split(/(?=[A-Z])|[\.\-\s_]/).map((X)=>X.toLowerCase())??[];if(H.length===0)return"";if(H.length===1)return H[0];let Z=H.reduce((X,U)=>{return`${X}_${U.toLowerCase()}`});return $?.splitOnNumber===!1?Z:Z.replace(/([A-Za-z]{1}[0-9]{1})/,(X)=>`${X[0]}_${X[1]}`)};var z1=(Y)=>{let $=Y?.split(/[\.\-\s_]/).map((H)=>H.toLowerCase())??[];if($.length===0)return"";return $.map((H)=>H.charAt(0).toUpperCase()+H.slice(1)).join("")};var s1=(Y,$=" ")=>{if(!Y)return"";let H=$.replace(/[\W]{1}/g,"\\$&"),Z=new RegExp(`^[${H}]+|[${H}]+$`,"g");return Y.replace(Z,"")};var O$=V(i(),1);import{join as o7}from"path";import{existsSync as m7}from"fs";import{mkdir as t7,readdir as R$,rename as G$}from"fs/promises";import{dirname as I$,extname as s7,join as _}from"path";var A=()=>{return I$(Bun.fileURLToPath(import.meta.url))},m=()=>{let Y=process.cwd(),$=Y;while(!0){if(m7(_($,".elysiumrc")))return $;let H=I$($);if($===H)break;$=H}return Y},M1=async(Y,$)=>{let H=m();{let Z=_(H,"src","modules",Y);if(await t7(Z,{recursive:!0}),$)if($==="root"){let X=await R$(_(H,"src"));for(let U of X){if(["app.ts","env.ts","database","modules"].includes(U))continue;let Q=_(H,"src",U),J=_(Z,U==="main.module.ts"?`${Y}.module.ts`:U);await G$(Q,J)}}else{let X=_(H,"src","modules",$);await G$(X,Z)}}{let Z=await Bun.file(_(H,"package.json")).json();if(Z.imports=Z.imports??{},Z.imports[`#${Y}/*`]=`./src/modules/${Y}/*.ts`,$&&$!=="root")delete Z.imports[`#${$}/*`];await Bun.write(_(H,"package.json"),JSON.stringify(Z,null,2))}{let Z=await Bun.file(_(H,".elysiumrc")).json();if(Z.mono=!1,Z.modules=Z.modules??{},Z.modules[Y]=`./src/modules/${Y}`,$)delete Z.modules[$];await Bun.write(_(H,".elysiumrc"),JSON.stringify(Z,null,2))}if($){let Z=async(X)=>{let U=await R$(X,{withFileTypes:!0});for(let Q of U){let J=_(X,Q.name);if(Q.isDirectory())await Z(J);else if(s7(Q.name)===".ts"){let D=await Bun.file(J).text();if($==="root")D=D.replace(new RegExp(`(['"])#${$}/((?!(env|app|database(?:/|$))).*?)(['"])`,"g"),`$1#${Y}/$2$4`);else D=D.replace(new RegExp(`(['"])#${$}/`,"g"),`$1#${Y}/`);D=D.replace(new RegExp(`(['"])#${$}/main\\.module(['"])/g`,"g"),`$1#${Y}/${Y}.module$2`),D=D.replace(new RegExp(`(['"])#${$}/main\\.module\\.ts(['"])?/g`,"g"),`$1#${Y}/${Y}.module$2`),await Bun.write(J,D)}}};await Z(H)}};var E=async()=>{let Y=Bun.file(o7(m(),".elysiumrc"));if(!Y.exists())throw Error("Elysium config file not found.");return Y.json()};var M=async(Y)=>{let $=await E();if($.mono)return"./src";return $.modules[Y]};class C0 extends R{static command="make:command";static description="Creates a new command.";async run(){if(!this.command||!this.name)return this.setup();let Y=await E(),$={module:this.module,name:this.name,command:this.command,description:this.description};if(!$.module&&!Y.mono){let H=await P0.default({type:"select",name:"module",message:"Module:",choices:Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))});$.module=H.module}return this.build($)}async setup(){let Y=await E(),H=await P0.default([{type(){return Y.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))}},{type:"text",name:"command",message:"Command Name:",initial:"user:say",validate(Z){if(Z.length<1)return"Command name cannot be empty";return!0}},{type:"text",name:"description",message:"Command Description:",initial:"Say something",validate(Z){if(Z.length<1)return"Command description cannot be empty";return!0}}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return H.name=z1(H.command.replaceAll(":","_")),this.build(H)}async build(Y){if(!Y.name){this.error("Operation cancelled.");return}if(!Y.name.endsWith("Command"))Y.name+="Command";let $=Bun.file(r7(A(),"stubs/command.stub")),H=O$.default(await $.text(),Y),Z=Y.module?await M(Y.module):"./src",X=F(Y.name.replace("Command","")),U=Bun.file(`${Z}/commands/${X}.command.ts`);await U.write(H),this.success(`Command ${this.bold(U.name)} created successfully.`)}}z([q1.arg({description:"The name of the command to create",type:o1.STRING}),L("design:type",String)],C0.prototype,"name",void 0),z([q1.arg({description:"The module where the command will be created",type:o1.STRING}),L("design:type",String)],C0.prototype,"module",void 0),z([q1.arg({description:"The command to create",type:o1.STRING}),L("design:type",String)],C0.prototype,"command",void 0),z([q1.arg({description:"The description of the command",type:o1.STRING}),L("design:type",String)],C0.prototype,"description",void 0),C0=z([q1.register()],C0);var j0=V(T(),1);import{join as a7}from"path";import{Command as g,CommandArgumentType as t}from"@elysiumjs/core";var F$=V(i(),1);class _0 extends R{constructor(){super(...arguments);this.http=!1;this.wamp=!1;this.ws=!1;this.server=!1;this.request=!1;this.path="/users"}static command="make:controller";static description="Creates a new controller.";async run(){if(!this.name)return this.setup();let Y=await E(),$={module:this.module,type:"http",scope:"SERVER",name:this.name,path:this.path,realm:this.realm??"realm1"};if(!$.module&&!Y.mono){let H=await j0.default({type:"select",name:"module",message:"Module:",choices:Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))});$.module=H.module}if(this.http)$.type="http";else if(this.wamp)$.type="wamp";else if(this.ws)$.type="ws";if(this.server)$.scope="SERVER";else if(this.request)$.scope="REQUEST";return this.build($)}async setup(){let Y="http",$=await E(),Z=await j0.default([{type(){return $.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys($.modules??{}).map((X)=>({title:X,value:X}))}},{type:"select",name:"type",message:"Controller Type:",choices:[{title:"HTTP",value:"http"},{title:"WAMP",value:"wamp"},{title:"WebSocket",value:"ws"}]},{type:"text",name:"name",message:"Controller Name:",initial:"UserController",validate:(X)=>{if(X.length<1)return"Controller name cannot be empty";return!0}},{type:"text",name:"path",message(X,U){return Y=U.type,U.type==="wamp"?"Controller URL":"Controller Path:"},initial(X,U){return U.type==="wamp"?"ws://localhost:8000":"/users"},validate(X){if(Y==="wamp")return X.match(/^wss?:\/\//)?!0:"The URL must start with ws:// or wss://";if(X[0]!=="/")return"The path must start with a slash (/)";return!0}},{type(X,U){return U.type==="http"?"select":null},name:"scope",message:"Controller Scope:",choices:[{title:"SERVER",value:"SERVER",description:"An unique instance of the controller is created for the entire lifecycle of the server."},{title:"REQUEST",value:"REQUEST",description:"An instance of the controller is created for each request."}]},{type(X,U){return U.type==="wamp"?"text":null},name:"realm",message:"Controller Realm:",initial:"realm1",validate(X){if(X.length<1)return"Realm name cannot be empty";return!0}}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(Z)}async build(Y){if(!Y.type||!Y.name||!Y.path){this.error("Operation cancelled.");return}if(!Y.name.endsWith("Controller"))Y.name+="Controller";let $=Bun.file(a7(A(),`stubs/${Y.type}.controller.stub`)),H=F$.default(await $.text(),Y),Z=Y.module?await M(Y.module):"./src",X=F(Y.name.replace("Controller","")),U=Bun.file(`${Z}/controllers/${Y.type}/${X}.controller.ts`);await U.write(H),this.success(`Controller ${this.bold(U.name)} created successfully.`)}}z([g.arg({description:"The name of the controller to create",type:t.STRING}),L("design:type",String)],_0.prototype,"name",void 0),z([g.arg({description:"The module where the controller will be created",type:t.STRING}),L("design:type",String)],_0.prototype,"module",void 0),z([g.arg({description:"Whether to create a HTTP controller",type:t.BOOLEAN,default:!1}),L("design:type",Boolean)],_0.prototype,"http",void 0),z([g.arg({description:"Whether to create a WAMP controller",type:t.BOOLEAN,default:!1}),L("design:type",Boolean)],_0.prototype,"wamp",void 0),z([g.arg({description:"Whether to create a WebSocket controller",type:t.BOOLEAN,default:!1}),L("design:type",Boolean)],_0.prototype,"ws",void 0),z([g.arg({description:"Whether to create a SERVER scope controller",type:t.BOOLEAN,default:!1}),L("design:type",Boolean)],_0.prototype,"server",void 0),z([g.arg({description:"Whether to create a REQUEST scope controller",type:t.BOOLEAN,default:!1}),L("design:type",Boolean)],_0.prototype,"request",void 0),z([g.arg({description:"The path or URL of the controller",type:t.STRING}),L("design:type",String)],_0.prototype,"path",void 0),z([g.arg({description:"The realm of the controller (only applicable to WAMP controllers)",type:t.STRING}),L("design:type",String)],_0.prototype,"realm",void 0),_0=z([g.register()],_0);var k0=V(T(),1);import{join as e7}from"path";import{Command as N1,CommandArgumentType as r1}from"@elysiumjs/core";var V$=V(i(),1);class h0 extends R{constructor(){super(...arguments);this.queue="default"}static command="make:job";static description="Creates a new job.";async run(){if(!this.name)return this.setup();let Y=await E(),$={module:this.module,name:this.name,alias:this.alias,queue:this.queue??"default"};if(!$.module&&!Y.mono){let H=await k0.default({type:"select",name:"module",message:"Module:",choices:Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))});$.module=H.module}return this.build($)}async setup(){let Y=await E(),H=await k0.default([{type(){return Y.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))}},{type:"text",name:"name",message:"Job Name:",initial:"SendEmailJob",validate(Z){if(Z.length<1)return"Job name cannot be empty";return!0}},{type:"text",name:"alias",message:"Job Alias:",initial(Z,X){return X.name},validate(Z){if(Z.length<1)return"Job alias cannot be empty";return!0}},{type:"text",name:"queue",message:"Job Queue:",initial:"default"}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(H)}async build(Y){if(!Y.name){this.error("Operation cancelled.");return}if(!Y.name.endsWith("Job"))Y.name+="Job";if(!Y.alias)Y.alias=Y.name;let $=Bun.file(e7(A(),"stubs/job.stub")),H=V$.default(await $.text(),Y),Z=Y.module?await M(Y.module):"./src",X=F(Y.name.replace("Job","")),U=Bun.file(`${Z}/jobs/${X}.job.ts`);await U.write(H),this.success(`Job ${this.bold(U.name)} created successfully.`)}}z([N1.arg({description:"The name of the job to create",type:r1.STRING}),L("design:type",String)],h0.prototype,"name",void 0),z([N1.arg({description:"The module where the job will be created",type:r1.STRING}),L("design:type",String)],h0.prototype,"module",void 0),z([N1.arg({description:"The alias of the job to create",type:r1.STRING}),L("design:type",String)],h0.prototype,"alias",void 0),z([N1.arg({description:"The name of the queue where the job will be dispatched",type:r1.STRING,default:"default"}),L("design:type",String)],h0.prototype,"queue",void 0),h0=z([N1.register()],h0);var b0=V(T(),1);import{join as YU}from"path";import{Command as x0,CommandArgumentType as A$}from"@elysiumjs/core";var M$=V(i(),1);class f0 extends R{static command="make:middleware";static description="Creates a new middleware.";async run(){if(!this.name)return this.setup();let Y=await E(),$={module:this.module,name:this.name};if(!$.module&&!Y.mono){let H=await b0.default({type:"select",name:"module",message:"Module:",choices:Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))});$.module=H.module}return this.build($)}async setup(){let Y=await E(),H=await b0.default([{type(){return Y.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))}},{type:"text",name:"name",message:"Middleware Name:",initial:"AuthMiddleware",validate(Z){if(Z.length<1)return"Middleware name cannot be empty";return!0}}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(H)}async build(Y){if(!Y.name){this.error("Operation cancelled.");return}if(!Y.name.endsWith("Middleware"))Y.name+="Middleware";let $=Bun.file(YU(A(),"stubs/middleware.stub")),H=M$.default(await $.text(),Y),Z=Y.module?await M(Y.module):"./src",X=F(Y.name.replace("Middleware","")),U=Bun.file(`${Z}/middlewares/${X}.middleware.ts`);await U.write(H),this.success(`Middleware ${this.bold(U.name)} created successfully.`)}}z([x0.arg({description:"The name of the middleware to create",type:A$.STRING}),L("design:type",String)],f0.prototype,"name",void 0),z([x0.arg({description:"The module where the middleware will be created",type:A$.STRING}),L("design:type",String)],f0.prototype,"module",void 0),f0=z([x0.register()],f0);var w0=V(T(),1);import{join as $U}from"path";import{Command as T1,CommandArgumentType as a1}from"@elysiumjs/core";var q$=V(i(),1);class g0 extends R{constructor(){super(...arguments);this.supportTenancy=!1}static command="make:model";static description="Creates a new model.";async run(){if(!this.name||!this.tableName)return this.setup();let Y=await E(),$={module:this.module,table:this.tableName,name:this.name,supportTenancy:this.supportTenancy};if(!$.module&&!Y.mono){let H=await w0.default({type:"select",name:"module",message:"Module:",choices:Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))},{onCancel:()=>process.exit(1)});$.module=H.module}if(!$.name)$.name=s1(z1($.table),"s");return $.canonicalName=$.name,this.build($)}async setup(){let Y=await E(),H=await w0.default([{type(){return Y.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))}},{type:"text",name:"table",message:"Table Name:",initial:"users",validate(Z){if(Z.length<1)return"Table name cannot be empty";return!0}},{type:"text",name:"name",message:"Model Name:",initial(Z,X){return s1(z1(X.table),"s")},validate(Z){if(Z.length<1)return"Model name cannot be empty";return!0}},{type:"select",name:"supportTenancy",message:"Support Tenancy:",choices:[{title:"Yes",value:!0,description:"The model supports multi-tenancy."},{title:"No",value:!1,description:"The model does not support multi-tenancy."}]}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(H)}async build(Y){if(!Y.name){this.error("Operation cancelled.");return}if(!Y.name.endsWith("Model"))Y.name+="Model";Y.canonicalName=Y.name.replace("Model","");let $=Bun.file($U(A(),"stubs/model.stub")),H=q$.default(await $.text(),Y),Z=Y.module?await M(Y.module):"./src",X=F(Y.name.replace("Model","")),U=Bun.file(`${Z}/models/${X}.model.ts`);await U.write(H),this.success(`Model ${this.bold(U.name)} created successfully.`)}}z([T1.arg({description:"The name of the model to create",type:a1.STRING}),L("design:type",String)],g0.prototype,"name",void 0),z([T1.arg({description:"The module where the model will be created",type:a1.STRING}),L("design:type",String)],g0.prototype,"module",void 0),z([T1.arg({name:"table",description:"The name of the table wrapped by the model",type:a1.STRING}),L("design:type",String)],g0.prototype,"tableName",void 0),z([T1.arg({name:"support-tenancy",description:"Support tenancy",type:a1.BOOLEAN,default:!1}),L("design:type",Boolean)],g0.prototype,"supportTenancy",void 0),g0=z([T1.register()],g0);var v0=V(T(),1);import{join as HU}from"path";import{Command as U1,CommandArgumentType as K1}from"@elysiumjs/core";var N$=V(i(),1);class y0 extends R{constructor(){super(...arguments);this.factory=!1;this.singleton=!1}static command="make:repository";static description="Creates a new repository.";async run(){if(!this.name)return this.setup();let Y=await E(),$={module:this.module,name:this.name,alias:this.alias,scope:this.factory?"FACTORY":this.singleton?"SINGLETON":"SINGLETON",model:this.model};if(!$.module&&!Y.mono){let H=await v0.default({type:"select",name:"module",message:"Module:",choices:Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))});$.module=H.module}return this.build($)}async setup(){let Y=await E(),H=await v0.default([{type(){return Y.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))}},{type:"text",name:"name",message:"Repository Name:",initial:"UserRepository",validate(Z){if(Z.length<1)return"Repository name cannot be empty";return!0}},{type:"text",name:"model",message:"Model Name:",initial:"UserModel",validate(Z){if(Z.length<1)return"Model name cannot be empty";return!0}},{type:"text",name:"alias",message:"Repository Alias:",initial(Z,X){return X.name},validate(Z){if(Z.length<1)return"Repository alias cannot be empty";return!0}},{type:"select",name:"scope",message:"Repository Scope:",choices:[{title:"SINGLETON",value:"SINGLETON",description:"A single instance of the repository is created."},{title:"FACTORY",value:"FACTORY",description:"A new instance of the repository is created each time it is injected."}]}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(H)}async build(Y){if(!Y.name){this.error("Operation cancelled.");return}if(!Y.name.endsWith("Repository"))Y.name+="Repository";if(!Y.alias)Y.alias=Y.name;let $=Bun.file(HU(A(),"stubs/repository.stub")),H=N$.default(await $.text(),{...Y,module:Y.module??"root",model_name:F(Y.model.replace("Model",""))}),Z=Y.module?await M(Y.module):"./src",X=F(Y.name.replace("Repository","")),U=Bun.file(`${Z}/repositories/${X}.repository.ts`);await U.write(H),this.success(`Repository ${this.bold(U.name)} created successfully.`)}}z([U1.arg({description:"The name of the repository to create",type:K1.STRING}),L("design:type",String)],y0.prototype,"name",void 0),z([U1.arg({description:"The module where the repository will be created",type:K1.STRING}),L("design:type",String)],y0.prototype,"module",void 0),z([U1.arg({description:"The alias of the repository to create",type:K1.STRING}),L("design:type",String)],y0.prototype,"alias",void 0),z([U1.arg({description:"The model used by the repository",type:K1.STRING}),L("design:type",String)],y0.prototype,"model",void 0),z([U1.arg({description:"Create a factory repository",type:K1.BOOLEAN,default:!1}),L("design:type",Boolean)],y0.prototype,"factory",void 0),z([U1.arg({description:"Create a singleton repository",type:K1.BOOLEAN,default:!1}),L("design:type",Boolean)],y0.prototype,"singleton",void 0),y0=z([U1.register()],y0);var d0=V(T(),1);import{join as ZU}from"path";import{Command as W1,CommandArgumentType as P1}from"@elysiumjs/core";var T$=V(i(),1);class u0 extends R{constructor(){super(...arguments);this.factory=!1;this.singleton=!1}static command="make:service";static description="Creates a new service.";async run(){if(!this.name)return this.setup();let Y=await E(),$={module:this.module,name:this.name,alias:this.alias,scope:this.factory?"FACTORY":this.singleton?"SINGLETON":"SINGLETON"};if(!$.module&&!Y.mono){let H=await d0.default({type:"select",name:"module",message:"Module:",choices:Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))});$.module=H.module}return this.build($)}async setup(){let Y=await E(),H=await d0.default([{type(){return Y.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))}},{type:"text",name:"name",message:"Service Name:",initial:"UserService",validate(Z){if(Z.length<1)return"Service name cannot be empty";return!0}},{type:"text",name:"alias",message:"Service Alias:",initial(Z,X){return X.name},validate(Z){if(Z.length<1)return"Service alias cannot be empty";return!0}},{type:"select",name:"scope",message:"Service Scope:",choices:[{title:"SINGLETON",value:"SINGLETON",description:"A single instance of the service is created."},{title:"FACTORY",value:"FACTORY",description:"A new instance of the service is created each time it is injected."}]}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(H)}async build(Y){if(!Y.name){this.error("Operation cancelled.");return}if(!Y.name.endsWith("Service"))Y.name+="Service";if(!Y.alias)Y.alias=Y.name;let $=Bun.file(ZU(A(),"stubs/service.stub")),H=T$.default(await $.text(),Y),Z=Y.module?await M(Y.module):"./src",X=F(Y.name.replace("Service","")),U=Bun.file(`${Z}/services/${X}.service.ts`);await U.write(H),this.success(`Service ${this.bold(U.name)} created successfully.`)}}z([W1.arg({description:"The name of the service to create",type:P1.STRING}),L("design:type",String)],u0.prototype,"name",void 0),z([W1.arg({description:"The module where the service will be created",type:P1.STRING}),L("design:type",String)],u0.prototype,"module",void 0),z([W1.arg({description:"The alias of the service to create",type:P1.STRING}),L("design:type",String)],u0.prototype,"alias",void 0),z([W1.arg({description:"Create a factory service",type:P1.BOOLEAN,default:!1}),L("design:type",Boolean)],u0.prototype,"factory",void 0),z([W1.arg({description:"Create a singleton service",type:P1.BOOLEAN,default:!1}),L("design:type",Boolean)],u0.prototype,"singleton",void 0),u0=z([W1.register()],u0);var l0=V(T(),1);import{join as UU}from"path";import{Command as c0,CommandArgumentType as P$}from"@elysiumjs/core";var C$=V(i(),1);class p0 extends R{static command="make:validator";static description="Creates a new validator.";async run(){if(!this.name)return this.setup();let Y=await E(),$={module:this.module,name:this.name};if(!$.module&&!Y.mono){let H=await l0.default({type:"select",name:"module",message:"Module:",choices:Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))});$.module=H.module}return this.build($)}async setup(){let Y=await E(),H=await l0.default([{type(){return Y.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(Y.modules??{}).map((Z)=>({title:Z,value:Z}))}},{type:"text",name:"name",message:"Validator Name:",initial:"LoginValidator",validate(Z){if(Z.length<1)return"Validator name cannot be empty";return!0}}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(H)}async build(Y){if(!Y.name){this.error("Operation cancelled.");return}if(!Y.name.endsWith("Validator"))Y.name+="Validator";if(!Y.request_name)Y.request_name=Y.name.replace("Validator","Request");let $=Bun.file(UU(A(),"stubs/validator.stub")),H=C$.default(await $.text(),Y),Z=Y.module?await M(Y.module):"./src",X=F(Y.name.replace("Validator","")),U=Bun.file(`${Z}/validators/${X}.validator.ts`);await U.write(H),this.success(`Validator ${this.bold(U.name)} created successfully.`)}}z([c0.arg({description:"The name of the validator to create",type:P$.STRING}),L("design:type",String)],p0.prototype,"name",void 0),z([c0.arg({description:"The module where the validator will be created",type:P$.STRING}),L("design:type",String)],p0.prototype,"module",void 0),p0=z([c0.register()],p0);var _$=V(T(),1);import{exists as XU}from"fs/promises";import{Command as j$,CommandArgumentType as QU}from"@elysiumjs/core";class n0 extends R{static command="migration:generate";static description="Generates migration files.";async run(){if(!this.name){let Z=await _$.default([{type:"text",name:"name",message:"Migration Name:",initial:"create_users_table",validate(X){if(X.length<1)return"Migration name cannot be empty";return!0}}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});this.name=Z.name}let Y=m(),$=`${Y}/src/database/schemas`;if(await XU(`${Y}/src/database/schema.ts`))$=`${Y}/src/database/schema.ts`;await Bun.$`bunx --bun drizzle-kit generate --dialect postgresql --schema ${$} --out ${Y}/src/database/migrations --prefix timestamp --name ${this.name}`;let H=new Bun.Glob(`${Y}/src/database/migrations/**/*.sql`).scan();for await(let Z of H){let X=Bun.file(Z),U=await X.text();await X.write(U.replace(/"public"\./gm,""))}}}z([j$.arg({description:"The name of the migration to create",type:QU.STRING}),L("design:type",String)],n0.prototype,"name",void 0),n0=z([j$.register()],n0);var x$=V(T(),1);import{basename as k$}from"path";import{Command as e1,CommandArgumentType as i0}from"@elysiumjs/core";import{Database as h$}from"@elysiumjs/mnemosyne-drizzle";class m0 extends R{constructor(){super(...arguments);this.tenant="";this.connection="default";this.fresh=!1}static command="migration:run";static description="Generates migration files.";async run(){if(!h$.connectionExists(this.connection))return this.error(`Connection ${this.bold(this.connection)} does not exist.`),process.exit(1);let Y=h$.getConnection(this.connection).$client;await Y.connect(),await Y.begin(async($)=>{if(this.fresh)await $`DROP SCHEMA IF EXISTS ${$(this.tenant)} CASCADE;`,await $`CREATE SCHEMA ${$(this.tenant)};`;let[{schema_exists:H}]=await $`SELECT EXISTS (
99
- SELECT schema_name
100
- FROM information_schema.schemata
101
- WHERE schema_name = ${this.tenant}
102
- ) AS schema_exists;`;if(!H)if((await x$.default([{type:"confirm",name:"create",message:`Schema ${this.tenant} does not exist. Do you want to create it?`,initial:!0}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}})).create)await $`CREATE SCHEMA ${$(this.tenant)};`;else return this.error(`Schema ${this.bold(this.tenant)} creation cancelled.`),process.exit(1);await $`SET search_path TO ${$(this.tenant)};`;let[{table_exists:Z}]=await $`SELECT EXISTS (
103
- SELECT *
104
- FROM information_schema.tables
105
- WHERE table_name = 'elysium_migrations'
106
- AND table_schema = ${this.tenant}
107
- ) AS table_exists;`;if(!Z)await $`CREATE TABLE elysium_migrations (
108
- id SERIAL PRIMARY KEY,
109
- name TEXT NOT NULL,
110
- batch INTEGER NOT NULL,
111
- applied_at TIMESTAMP NOT NULL
112
- );`;let U=(await $`SELECT name FROM elysium_migrations;`).map((G)=>G.name),Q=new Bun.Glob("./src/database/migrations/**/*.sql").scan({absolute:!0,onlyFiles:!0}),J=await Array.fromAsync(Q),D=T0(J.filter((G)=>!U.includes(k$(G))),(G)=>G);if(D.length===0){this.success("No new migrations to apply.");return}let W=this.spinner(`Running migrations for tenant ${this.bold(this.tenant)}...`),[{max:Y1}]=await $`SELECT MAX(batch) + 1 AS max FROM elysium_migrations;`,$1=Y1??0;for(let G of D){await $.file(G);let[{name:P}]=await $`INSERT INTO elysium_migrations (name, batch, applied_at) VALUES (${k$(G)}, ${$1}, ${new Date}) RETURNING name;`;W.pause(`Migration ${this.bold(P)} applied successfully.`)}W.complete(`Migrations for tenant ${this.bold(this.tenant)} applied successfully.`)}),await Y.close()}}z([e1.arg({description:"The name of the tenant in which the migrations will be executed.",type:i0.STRING,required:!0}),L("design:type",String)],m0.prototype,"tenant",void 0),z([e1.arg({description:"The name of the connection to use.",type:i0.STRING,default:"default"}),L("design:type",String)],m0.prototype,"connection",void 0),z([e1.arg({description:"Drop the entire schema before running the migrations.",type:i0.BOOLEAN,default:!1}),L("design:type",Boolean)],m0.prototype,"fresh",void 0),m0=z([e1.register()],m0);var t0=V(T(),1);import{exists as JU,rmdir as DU}from"fs/promises";import{join as zU}from"path";import{Command as b$,CommandArgumentType as KU}from"@elysiumjs/core";class s0 extends R{static command="module:new";static description="Creates a new module.";module;convert=!1;async run(){let Y=await E();if(!this.name){let $=await t0.default({type:"text",name:"name",message:"New module name:",initial:"module",validate(H){return H.length>0?!0:"Module name cannot be empty"}},{onCancel:()=>process.exit(0)});this.name=F($.name)}if(Y.mono){let{module:$,convert:H}=await t0.default([{type:"confirm",name:"convert",message:"This project is a mono-module project. Do you want to convert it to a multi-module project?",initial:!1},{type:(Z)=>Z?"text":null,name:"module",message:"Current module name:",initial:"main",validate(Z){return Z.length>0?!0:"Module name cannot be empty"}}],{onCancel:()=>process.exit(0)});if(!H)return this.error("Operation cancelled. The project is left unchanged.");this.module=F($),this.convert=H}if(this.convert){let $=zU(m(),"src","modules");if(await JU($))await DU($,{recursive:!0});await M1(this.module,"root"),this.success("Project converted to multi-module."),this.success(`Module '${this.module}' created.`)}await M1(this.name),this.success(`Module '${this.name}' created.`)}}z([b$.arg({description:"The name of the module to create",type:KU.STRING}),L("design:type",String)],s0.prototype,"name",void 0),s0=z([b$.register()],s0);var r0=V(T(),1);import{Command as o0,CommandArgumentType as f$}from"@elysiumjs/core";class a0 extends R{static command="module:rename";static description="Renames a module.";async run(){if((await E()).mono)return this.error("This operation is not supported for mono-module projects.");if(!this.module){let{module:$}=await r0.default({type:"text",name:"module",message:"Module to rename:",validate:(H)=>H.length>0});this.module=$}if(!this.name){let{name:$}=await r0.default({type:"text",name:"name",message:"New module name:",initial:this.module,validate:(H)=>H.length>0});this.name=$}if(this.module===this.name)return this.info("Module name is the same as the current name.");await M1(this.name,this.module),this.success(`Module '${this.module}' renamed to '${this.name}'.`)}}z([o0.arg({description:"The module to rename",type:f$.STRING}),L("design:type",String)],a0.prototype,"module",void 0),z([o0.arg({description:"The new name of the module",type:f$.STRING}),L("design:type",String)],a0.prototype,"name",void 0),a0=z([o0.register()],a0);var WU=m(),{App:w$}=await import(`${WU}/src/app`);class e0 extends w${}e0=z([w$.register()],e0);export{e0 as StyxApp};
98
+ `),this.close()}_(c,key){if(c.toLowerCase()==="y")return this.value=!0,this.submit();if(c.toLowerCase()==="n")return this.value=!1,this.submit();return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(cursor.hide);else this.out.write(clear(this.outputText,this.out.columns));super.render(),this.outputText=[style.symbol(this.done,this.aborted),color.bold(this.msg),style.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:color.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(erase.line+cursor.to(0)+this.outputText)}}module.exports=ConfirmPrompt});var require_elements2=__commonJS(function(exports,module){module.exports={TextPrompt:require_text2(),SelectPrompt:require_select2(),TogglePrompt:require_toggle2(),DatePrompt:require_date2(),NumberPrompt:require_number2(),MultiselectPrompt:require_multiselect2(),AutocompletePrompt:require_autocomplete2(),AutocompleteMultiselectPrompt:require_autocompleteMultiselect2(),ConfirmPrompt:require_confirm2()}});var require_prompts2=__commonJS(function(exports){var $=exports,el=require_elements2(),noop=(v)=>v;function toPrompt(type,args,opts={}){return new Promise((res,rej)=>{let p=new el[type](args),onAbort=opts.onAbort||noop,onSubmit=opts.onSubmit||noop,onExit=opts.onExit||noop;p.on("state",args.onState||noop),p.on("submit",(x)=>res(onSubmit(x))),p.on("exit",(x)=>res(onExit(x))),p.on("abort",(x)=>rej(onAbort(x)))})}$.text=(args)=>toPrompt("TextPrompt",args);$.password=(args)=>(args.style="password",$.text(args));$.invisible=(args)=>(args.style="invisible",$.text(args));$.number=(args)=>toPrompt("NumberPrompt",args);$.date=(args)=>toPrompt("DatePrompt",args);$.confirm=(args)=>toPrompt("ConfirmPrompt",args);$.list=(args)=>{let sep=args.separator||",";return toPrompt("TextPrompt",args,{onSubmit:(str)=>str.split(sep).map((s)=>s.trim())})};$.toggle=(args)=>toPrompt("TogglePrompt",args);$.select=(args)=>toPrompt("SelectPrompt",args);$.multiselect=(args)=>{args.choices=[].concat(args.choices||[]);let toSelected=(items)=>items.filter((item)=>item.selected).map((item)=>item.value);return toPrompt("MultiselectPrompt",args,{onAbort:toSelected,onSubmit:toSelected})};$.autocompleteMultiselect=(args)=>{args.choices=[].concat(args.choices||[]);let toSelected=(items)=>items.filter((item)=>item.selected).map((item)=>item.value);return toPrompt("AutocompleteMultiselectPrompt",args,{onAbort:toSelected,onSubmit:toSelected})};var byTitle=(input,choices)=>Promise.resolve(choices.filter((item)=>item.title.slice(0,input.length).toLowerCase()===input.toLowerCase()));$.autocomplete=(args)=>(args.suggest=args.suggest||byTitle,args.choices=[].concat(args.choices||[]),toPrompt("AutocompletePrompt",args))});var require_lib=__commonJS(function(exports,module){var prompts=require_prompts2(),passOn=["suggest","format","onState","validate","onRender","type"],noop=()=>{};async function prompt(questions=[],{onSubmit=noop,onCancel=noop}={}){let answers={},override=prompt._override||{};questions=[].concat(questions);let answer,question,quit,name,type,lastPrompt,getFormattedAnswer=async(question,answer,skipValidation=!1)=>{if(!skipValidation&&question.validate&&question.validate(answer)!==!0)return;return question.format?await question.format(answer,answers):answer};for(question of questions){if({name,type}=question,typeof type==="function")type=await type(answer,{...answers},question),question.type=type;if(!type)continue;for(let key in question){if(passOn.includes(key))continue;let value=question[key];question[key]=typeof value==="function"?await value(answer,{...answers},lastPrompt):value}if(lastPrompt=question,typeof question.message!=="string")throw Error("prompt message is required");if({name,type}=question,prompts[type]===void 0)throw Error(`prompt type (${type}) is not defined`);if(override[question.name]!==void 0){if(answer=await getFormattedAnswer(question,override[question.name]),answer!==void 0){answers[name]=answer;continue}}try{answer=prompt._injected?getInjectedAnswer(prompt._injected,question.initial):await prompts[type](question),answers[name]=answer=await getFormattedAnswer(question,answer,!0),quit=await onSubmit(question,answer,answers)}catch(err){quit=!await onCancel(question,answers)}if(quit)return answers}return answers}function getInjectedAnswer(injected,deafultValue){let answer=injected.shift();if(answer instanceof Error)throw answer;return answer===void 0?deafultValue:answer}function inject(answers){prompt._injected=(prompt._injected||[]).concat(answers)}function override(answers){prompt._override=Object.assign({},answers)}module.exports=Object.assign(prompt,{prompt,prompts,inject,override})});var require_prompts3=__commonJS(function(exports,module){function isNodeLT(tar){tar=(Array.isArray(tar)?tar:tar.split(".")).map(Number);let i=0,src=process.versions.node.split(".").map(Number);for(;i<tar.length;i++){if(src[i]>tar[i])return!1;if(tar[i]>src[i])return!0}return!1}module.exports=isNodeLT("8.6.0")?require_dist():require_lib()});var require_string_template=__commonJS(function(exports,module){var nargs=/\{([0-9a-zA-Z_]+)\}/g;module.exports=template;function template(string){var args;if(arguments.length===2&&typeof arguments[1]==="object")args=arguments[1];else{args=Array(arguments.length-1);for(var i=1;i<arguments.length;++i)args[i-1]=arguments[i]}if(!args||!args.hasOwnProperty)args={};return string.replace(nargs,function(match,i,index){var result;if(string[index-1]==="{"&&string[index+match.length]==="}")return i;else{if(result=args.hasOwnProperty(i)?args[i]:null,result===null||result===void 0)return"";return result}})}});import{Module}from"@elysiumjs/core";import{Command}from"@elysiumjs/core";class BaseCommand extends Command{static dev=!0}var import_prompts=__toESM(require_prompts3(),1);import{join as join3}from"path";import{Command as Command2,CommandArgumentType}from"@elysiumjs/core";var capitalize=(str)=>{if(!str||str.length===0)return"";let lower=str.toLowerCase();return lower.substring(0,1).toUpperCase()+lower.substring(1,lower.length)};var snake=(str,options)=>{let parts=str?.replace(/([A-Z])+/g,capitalize).split(/(?=[A-Z])|[\.\-\s_]/).map((x)=>x.toLowerCase())??[];if(parts.length===0)return"";if(parts.length===1)return parts[0];let result=parts.reduce((acc,part)=>`${acc}_${part.toLowerCase()}`);return options?.splitOnNumber===!1?result:result.replace(/([A-Za-z]{1}[0-9]{1})/,(val)=>`${val[0]}_${val[1]}`)};var pascal=(str)=>{let parts=str?.split(/[\.\-\s_]/).map((x)=>x.toLowerCase())??[];if(parts.length===0)return"";return parts.map((str2)=>str2.charAt(0).toUpperCase()+str2.slice(1)).join("")};var trim=(str,charsToTrim=" ")=>{if(!str)return"";let toTrim=charsToTrim.replace(/[\W]{1}/g,"\\$&"),regex=new RegExp(`^[${toTrim}]+|[${toTrim}]+$`,"g");return str.replace(regex,"")};var import_string_template=__toESM(require_string_template(),1);import{join as join2}from"path";import{existsSync}from"fs";import{mkdir,readdir,rename}from"fs/promises";import{dirname,extname,join}from"path";import{Application,ElysiumError}from"@elysiumjs/core";class AppEntryNotFoundError extends ElysiumError{path;constructor(path){super(`Could not find an exported Application class in ${path}`);this.path=path}}var resolveAppEntry=async(projectPath)=>{let appFile=join(projectPath,"src","app.ts"),entry=existsSync(appFile)?appFile:join(projectPath,"index.ts"),exports=await import(entry);for(let value of Object.values(exports))if(typeof value==="function"&&value.prototype instanceof Application)return value;throw new AppEntryNotFoundError(entry)},getRootPath=()=>dirname(Bun.fileURLToPath(import.meta.url)),getProjectPath=()=>{let startPath=process.cwd(),dir=startPath;while(!0){if(existsSync(join(dir,".elysiumrc")))return dir;let parentDir=dirname(dir);if(dir===parentDir)break;dir=parentDir}return startPath},createModule=async(name,oldName)=>{let root=getProjectPath();{let moduleDir=join(root,"src","modules",name);if(await mkdir(moduleDir,{recursive:!0}),!oldName){let moduleFile=join(moduleDir,`${name}.module.ts`);if(!existsSync(moduleFile)){let className=`${pascal(name)}Module`;await Bun.write(moduleFile,`import { Module } from '@elysiumjs/core';
99
+
100
+ @Module.register({
101
+ services: [],
102
+ controllers: [],
103
+ commands: []
104
+ })
105
+ export class ${className} extends Module {}
106
+ `)}}if(oldName)if(oldName==="root"){let entries=await readdir(join(root,"src"));for(let entry of entries){if(["app.ts","env.ts","database","modules"].includes(entry))continue;let oldPath=join(root,"src",entry),newPath=join(moduleDir,entry==="main.module.ts"?`${name}.module.ts`:entry);await rename(oldPath,newPath)}}else{let oldModuleDir=join(root,"src","modules",oldName);await rename(oldModuleDir,moduleDir)}}{let pkg=await Bun.file(join(root,"package.json")).json();if(pkg.imports=pkg.imports??{},pkg.imports[`#${name}/*`]=`./src/modules/${name}/*.ts`,oldName&&oldName!=="root")delete pkg.imports[`#${oldName}/*`];await Bun.write(join(root,"package.json"),JSON.stringify(pkg,null,2))}{let rc=await Bun.file(join(root,".elysiumrc")).json();if(rc.mono=!1,rc.modules=rc.modules??{},rc.modules[name]=`./src/modules/${name}`,oldName)delete rc.modules[oldName];await Bun.write(join(root,".elysiumrc"),JSON.stringify(rc,null,2))}if(oldName){let rewriteImports=async(dir)=>{let entries=await readdir(dir,{withFileTypes:!0});for(let entry of entries){let fullPath=join(dir,entry.name);if(entry.isDirectory())await rewriteImports(fullPath);else if(extname(entry.name)===".ts"){let text=await Bun.file(fullPath).text();if(oldName==="root")text=text.replace(new RegExp(`(['"])#${oldName}/((?!(env|app|database(?:/|$))).*?)(['"])`,"g"),`$1#${name}/$2$4`);else text=text.replace(new RegExp(`(['"])#${oldName}/`,"g"),`$1#${name}/`);text=text.replace(new RegExp(`(['"])#${oldName}/main\\.module(['"])/g`,"g"),`$1#${name}/${name}.module$2`),text=text.replace(new RegExp(`(['"])#${oldName}/main\\.module\\.ts(['"])?/g`,"g"),`$1#${name}/${name}.module$2`),await Bun.write(fullPath,text)}}};await rewriteImports(root)}};var parseProjectConfig=async()=>{let file=Bun.file(join2(getProjectPath(),".elysiumrc"));if(!file.exists())throw Error("Elysium config file not found.");return file.json()};var getModulePath=async(moduleName)=>{let config=await parseProjectConfig();if(config.mono)return"./src";return config.modules[moduleName]},addToModuleHint=async(list,className,moduleName)=>{let config=await parseProjectConfig();if(!config.mono&&!moduleName)return`Add ${className} to the ${list} list of the module that should own it.`;let name=config.mono?"main":moduleName,path=await getModulePath(name);return`Add ${className} to the ${list} list of ${pascal(name)}Module in ${path}/${name}.module.ts.`};class MakeCommandCommand extends BaseCommand{static command="make:command";static description="Creates a new command.";async run(){if(!this.command||!this.name)return this.setup();let config=await parseProjectConfig(),answers={module:this.module,name:this.name,command:this.command,description:this.description};if(!answers.module&&!config.mono){let module=await import_prompts.default({type:"select",name:"module",message:"Module:",choices:Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))});answers.module=module.module}return this.build(answers)}async setup(){let config=await parseProjectConfig(),answers=await import_prompts.default([{type(){return config.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))}},{type:"text",name:"command",message:"Command Name:",initial:"user:say",validate(value){if(value.length<1)return"Command name cannot be empty";return!0}},{type:"text",name:"description",message:"Command Description:",initial:"Say something",validate(value){if(value.length<1)return"Command description cannot be empty";return!0}}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return answers.name=pascal(answers.command.replaceAll(":","_")),this.build(answers)}async build(answers){if(!answers.name){this.error("Operation cancelled.");return}if(!answers.name.endsWith("Command"))answers.name+="Command";let stubFile=Bun.file(join3(getRootPath(),"stubs/command.stub")),stub=import_string_template.default(await stubFile.text(),answers),path=answers.module?await getModulePath(answers.module):"./src",name=snake(answers.name.replace("Command","")),file=Bun.file(`${path}/commands/${name}.command.ts`);await file.write(stub),this.success(`Command ${this.bold(file.name)} created successfully.`),this.info(await addToModuleHint("commands",answers.name,answers.module))}}__legacyDecorateClassTS([Command2.arg({description:"The name of the command to create",type:CommandArgumentType.STRING}),__legacyMetadataTS("design:type",String)],MakeCommandCommand.prototype,"name",void 0),__legacyDecorateClassTS([Command2.arg({description:"The module where the command will be created",type:CommandArgumentType.STRING}),__legacyMetadataTS("design:type",String)],MakeCommandCommand.prototype,"module",void 0),__legacyDecorateClassTS([Command2.arg({description:"The command to create",type:CommandArgumentType.STRING}),__legacyMetadataTS("design:type",String)],MakeCommandCommand.prototype,"command",void 0),__legacyDecorateClassTS([Command2.arg({description:"The description of the command",type:CommandArgumentType.STRING}),__legacyMetadataTS("design:type",String)],MakeCommandCommand.prototype,"description",void 0),MakeCommandCommand=__legacyDecorateClassTS([Command2.register()],MakeCommandCommand);var import_prompts2=__toESM(require_prompts3(),1);import{join as join4}from"path";import{Command as Command3,CommandArgumentType as CommandArgumentType2}from"@elysiumjs/core";var import_string_template2=__toESM(require_string_template(),1);class MakeControllerCommand extends BaseCommand{constructor(){super(...arguments);this.http=!1;this.wamp=!1;this.ws=!1;this.server=!1;this.request=!1;this.path="/users"}static command="make:controller";static description="Creates a new controller.";async run(){if(!this.name)return this.setup();let config=await parseProjectConfig(),answers={module:this.module,type:"http",scope:"SERVER",name:this.name,path:this.path,realm:this.realm??"realm1"};if(!answers.module&&!config.mono){let module=await import_prompts2.default({type:"select",name:"module",message:"Module:",choices:Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))});answers.module=module.module}if(this.http)answers.type="http";else if(this.wamp)answers.type="wamp";else if(this.ws)answers.type="ws";if(this.server)answers.scope="SERVER";else if(this.request)answers.scope="REQUEST";return this.build(answers)}async setup(){let mode="http",config=await parseProjectConfig(),answers=await import_prompts2.default([{type(){return config.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))}},{type:"select",name:"type",message:"Controller Type:",choices:[{title:"HTTP",value:"http"},{title:"WAMP",value:"wamp"},{title:"WebSocket",value:"ws"}]},{type:"text",name:"name",message:"Controller Name:",initial:"UserController",validate:(value)=>{if(value.length<1)return"Controller name cannot be empty";return!0}},{type:"text",name:"path",message(_prev,values){return mode=values.type,values.type==="wamp"?"Controller URL":"Controller Path:"},initial(_prev,values){return values.type==="wamp"?"ws://localhost:8000":"/users"},validate(value){if(mode==="wamp")return value.match(/^wss?:\/\//)?!0:"The URL must start with ws:// or wss://";if(value[0]!=="/")return"The path must start with a slash (/)";return!0}},{type(_prev,values){return values.type==="http"?"select":null},name:"scope",message:"Controller Scope:",choices:[{title:"SERVER",value:"SERVER",description:"An unique instance of the controller is created for the entire lifecycle of the server."},{title:"REQUEST",value:"REQUEST",description:"An instance of the controller is created for each request."}]},{type(_prev,values){return values.type==="wamp"?"text":null},name:"realm",message:"Controller Realm:",initial:"realm1",validate(value){if(value.length<1)return"Realm name cannot be empty";return!0}}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(answers)}async build(answers){if(!answers.type||!answers.name||!answers.path){this.error("Operation cancelled.");return}if(!answers.name.endsWith("Controller"))answers.name+="Controller";let stubFile=Bun.file(join4(getRootPath(),`stubs/${answers.type}.controller.stub`)),stub=import_string_template2.default(await stubFile.text(),answers),path=answers.module?await getModulePath(answers.module):"./src",name=snake(answers.name.replace("Controller","")),file=Bun.file(`${path}/controllers/${answers.type}/${name}.controller.ts`);await file.write(stub),this.success(`Controller ${this.bold(file.name)} created successfully.`),this.info(await addToModuleHint("controllers",answers.name,answers.module))}}__legacyDecorateClassTS([Command3.arg({description:"The name of the controller to create",type:CommandArgumentType2.STRING}),__legacyMetadataTS("design:type",String)],MakeControllerCommand.prototype,"name",void 0),__legacyDecorateClassTS([Command3.arg({description:"The module where the controller will be created",type:CommandArgumentType2.STRING}),__legacyMetadataTS("design:type",String)],MakeControllerCommand.prototype,"module",void 0),__legacyDecorateClassTS([Command3.arg({description:"Whether to create a HTTP controller",type:CommandArgumentType2.BOOLEAN,default:!1}),__legacyMetadataTS("design:type",Boolean)],MakeControllerCommand.prototype,"http",void 0),__legacyDecorateClassTS([Command3.arg({description:"Whether to create a WAMP controller",type:CommandArgumentType2.BOOLEAN,default:!1}),__legacyMetadataTS("design:type",Boolean)],MakeControllerCommand.prototype,"wamp",void 0),__legacyDecorateClassTS([Command3.arg({description:"Whether to create a WebSocket controller",type:CommandArgumentType2.BOOLEAN,default:!1}),__legacyMetadataTS("design:type",Boolean)],MakeControllerCommand.prototype,"ws",void 0),__legacyDecorateClassTS([Command3.arg({description:"Whether to create a SERVER scope controller",type:CommandArgumentType2.BOOLEAN,default:!1}),__legacyMetadataTS("design:type",Boolean)],MakeControllerCommand.prototype,"server",void 0),__legacyDecorateClassTS([Command3.arg({description:"Whether to create a REQUEST scope controller",type:CommandArgumentType2.BOOLEAN,default:!1}),__legacyMetadataTS("design:type",Boolean)],MakeControllerCommand.prototype,"request",void 0),__legacyDecorateClassTS([Command3.arg({description:"The path or URL of the controller",type:CommandArgumentType2.STRING}),__legacyMetadataTS("design:type",String)],MakeControllerCommand.prototype,"path",void 0),__legacyDecorateClassTS([Command3.arg({description:"The realm of the controller (only applicable to WAMP controllers)",type:CommandArgumentType2.STRING}),__legacyMetadataTS("design:type",String)],MakeControllerCommand.prototype,"realm",void 0),MakeControllerCommand=__legacyDecorateClassTS([Command3.register()],MakeControllerCommand);var import_prompts3=__toESM(require_prompts3(),1);import{join as join5}from"path";import{Command as Command4,CommandArgumentType as CommandArgumentType3}from"@elysiumjs/core";var import_string_template3=__toESM(require_string_template(),1);class MakeJobCommand extends BaseCommand{constructor(){super(...arguments);this.queue="default"}static command="make:job";static description="Creates a new job.";async run(){if(!this.name)return this.setup();let config=await parseProjectConfig(),answers={module:this.module,name:this.name,alias:this.alias,queue:this.queue??"default"};if(!answers.module&&!config.mono){let module=await import_prompts3.default({type:"select",name:"module",message:"Module:",choices:Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))});answers.module=module.module}return this.build(answers)}async setup(){let config=await parseProjectConfig(),answers=await import_prompts3.default([{type(){return config.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))}},{type:"text",name:"name",message:"Job Name:",initial:"SendEmailJob",validate(value){if(value.length<1)return"Job name cannot be empty";return!0}},{type:"text",name:"alias",message:"Job Alias:",initial(_,values){return values.name},validate(value){if(value.length<1)return"Job alias cannot be empty";return!0}},{type:"text",name:"queue",message:"Job Queue:",initial:"default"}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(answers)}async build(answers){if(!answers.name){this.error("Operation cancelled.");return}if(!answers.name.endsWith("Job"))answers.name+="Job";if(!answers.alias)answers.alias=answers.name;let stubFile=Bun.file(join5(getRootPath(),"stubs/job.stub")),stub=import_string_template3.default(await stubFile.text(),answers),path=answers.module?await getModulePath(answers.module):"./src",name=snake(answers.name.replace("Job","")),file=Bun.file(`${path}/jobs/${name}.job.ts`);await file.write(stub),this.success(`Job ${this.bold(file.name)} created successfully.`),this.info(await addToModuleHint("jobs",answers.name,answers.module))}}__legacyDecorateClassTS([Command4.arg({description:"The name of the job to create",type:CommandArgumentType3.STRING}),__legacyMetadataTS("design:type",String)],MakeJobCommand.prototype,"name",void 0),__legacyDecorateClassTS([Command4.arg({description:"The module where the job will be created",type:CommandArgumentType3.STRING}),__legacyMetadataTS("design:type",String)],MakeJobCommand.prototype,"module",void 0),__legacyDecorateClassTS([Command4.arg({description:"The alias of the job to create",type:CommandArgumentType3.STRING}),__legacyMetadataTS("design:type",String)],MakeJobCommand.prototype,"alias",void 0),__legacyDecorateClassTS([Command4.arg({description:"The name of the queue where the job will be dispatched",type:CommandArgumentType3.STRING,default:"default"}),__legacyMetadataTS("design:type",String)],MakeJobCommand.prototype,"queue",void 0),MakeJobCommand=__legacyDecorateClassTS([Command4.register()],MakeJobCommand);var import_prompts4=__toESM(require_prompts3(),1);import{join as join6}from"path";import{Command as Command5,CommandArgumentType as CommandArgumentType4}from"@elysiumjs/core";var import_string_template4=__toESM(require_string_template(),1);class MakeMiddlewareCommand extends BaseCommand{static command="make:middleware";static description="Creates a new middleware.";async run(){if(!this.name)return this.setup();let config=await parseProjectConfig(),answers={module:this.module,name:this.name};if(!answers.module&&!config.mono){let module=await import_prompts4.default({type:"select",name:"module",message:"Module:",choices:Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))});answers.module=module.module}return this.build(answers)}async setup(){let config=await parseProjectConfig(),answers=await import_prompts4.default([{type(){return config.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))}},{type:"text",name:"name",message:"Middleware Name:",initial:"AuthMiddleware",validate(value){if(value.length<1)return"Middleware name cannot be empty";return!0}}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(answers)}async build(answers){if(!answers.name){this.error("Operation cancelled.");return}if(!answers.name.endsWith("Middleware"))answers.name+="Middleware";let stubFile=Bun.file(join6(getRootPath(),"stubs/middleware.stub")),stub=import_string_template4.default(await stubFile.text(),answers),path=answers.module?await getModulePath(answers.module):"./src",name=snake(answers.name.replace("Middleware","")),file=Bun.file(`${path}/middlewares/${name}.middleware.ts`);await file.write(stub),this.success(`Middleware ${this.bold(file.name)} created successfully.`)}}__legacyDecorateClassTS([Command5.arg({description:"The name of the middleware to create",type:CommandArgumentType4.STRING}),__legacyMetadataTS("design:type",String)],MakeMiddlewareCommand.prototype,"name",void 0),__legacyDecorateClassTS([Command5.arg({description:"The module where the middleware will be created",type:CommandArgumentType4.STRING}),__legacyMetadataTS("design:type",String)],MakeMiddlewareCommand.prototype,"module",void 0),MakeMiddlewareCommand=__legacyDecorateClassTS([Command5.register()],MakeMiddlewareCommand);var import_prompts5=__toESM(require_prompts3(),1);import{join as join7}from"path";import{Command as Command6,CommandArgumentType as CommandArgumentType5}from"@elysiumjs/core";var import_string_template5=__toESM(require_string_template(),1);class MakeModelCommand extends BaseCommand{constructor(){super(...arguments);this.supportTenancy=!1}static command="make:model";static description="Creates a new model.";async run(){if(!this.name||!this.tableName)return this.setup();let config=await parseProjectConfig(),answers={module:this.module,table:this.tableName,name:this.name,supportTenancy:this.supportTenancy};if(!answers.module&&!config.mono){let module=await import_prompts5.default({type:"select",name:"module",message:"Module:",choices:Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))},{onCancel:()=>process.exit(1)});answers.module=module.module}if(!answers.name)answers.name=trim(pascal(answers.table),"s");return answers.canonicalName=answers.name,this.build(answers)}async setup(){let config=await parseProjectConfig(),answers=await import_prompts5.default([{type(){return config.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))}},{type:"text",name:"table",message:"Table Name:",initial:"users",validate(value){if(value.length<1)return"Table name cannot be empty";return!0}},{type:"text",name:"name",message:"Model Name:",initial(_,values){return trim(pascal(values.table),"s")},validate(value){if(value.length<1)return"Model name cannot be empty";return!0}},{type:"select",name:"supportTenancy",message:"Support Tenancy:",choices:[{title:"Yes",value:!0,description:"The model supports multi-tenancy."},{title:"No",value:!1,description:"The model does not support multi-tenancy."}]}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(answers)}async build(answers){if(!answers.name){this.error("Operation cancelled.");return}if(!answers.name.endsWith("Model"))answers.name+="Model";answers.canonicalName=answers.name.replace("Model","");let stubFile=Bun.file(join7(getRootPath(),"stubs/model.stub")),stub=import_string_template5.default(await stubFile.text(),answers),path=answers.module?await getModulePath(answers.module):"./src",name=snake(answers.name.replace("Model","")),file=Bun.file(`${path}/models/${name}.model.ts`);await file.write(stub),this.success(`Model ${this.bold(file.name)} created successfully.`)}}__legacyDecorateClassTS([Command6.arg({description:"The name of the model to create",type:CommandArgumentType5.STRING}),__legacyMetadataTS("design:type",String)],MakeModelCommand.prototype,"name",void 0),__legacyDecorateClassTS([Command6.arg({description:"The module where the model will be created",type:CommandArgumentType5.STRING}),__legacyMetadataTS("design:type",String)],MakeModelCommand.prototype,"module",void 0),__legacyDecorateClassTS([Command6.arg({name:"table",description:"The name of the table wrapped by the model",type:CommandArgumentType5.STRING}),__legacyMetadataTS("design:type",String)],MakeModelCommand.prototype,"tableName",void 0),__legacyDecorateClassTS([Command6.arg({name:"support-tenancy",description:"Support tenancy",type:CommandArgumentType5.BOOLEAN,default:!1}),__legacyMetadataTS("design:type",Boolean)],MakeModelCommand.prototype,"supportTenancy",void 0),MakeModelCommand=__legacyDecorateClassTS([Command6.register()],MakeModelCommand);var import_prompts6=__toESM(require_prompts3(),1);import{join as join8}from"path";import{Command as Command7,CommandArgumentType as CommandArgumentType6}from"@elysiumjs/core";var import_string_template6=__toESM(require_string_template(),1);class MakeRepositoryCommand extends BaseCommand{constructor(){super(...arguments);this.factory=!1;this.singleton=!1}static command="make:repository";static description="Creates a new repository.";async run(){if(!this.name)return this.setup();let config=await parseProjectConfig(),answers={module:this.module,name:this.name,alias:this.alias,scope:this.factory?"FACTORY":this.singleton?"SINGLETON":"SINGLETON",model:this.model};if(!answers.module&&!config.mono){let module=await import_prompts6.default({type:"select",name:"module",message:"Module:",choices:Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))});answers.module=module.module}return this.build(answers)}async setup(){let config=await parseProjectConfig(),answers=await import_prompts6.default([{type(){return config.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))}},{type:"text",name:"name",message:"Repository Name:",initial:"UserRepository",validate(value){if(value.length<1)return"Repository name cannot be empty";return!0}},{type:"text",name:"model",message:"Model Name:",initial:"UserModel",validate(value){if(value.length<1)return"Model name cannot be empty";return!0}},{type:"text",name:"alias",message:"Repository Alias:",initial(_,values){return values.name},validate(value){if(value.length<1)return"Repository alias cannot be empty";return!0}},{type:"select",name:"scope",message:"Repository Scope:",choices:[{title:"SINGLETON",value:"SINGLETON",description:"A single instance of the repository is created."},{title:"FACTORY",value:"FACTORY",description:"A new instance of the repository is created each time it is injected."}]}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(answers)}async build(answers){if(!answers.name){this.error("Operation cancelled.");return}if(!answers.name.endsWith("Repository"))answers.name+="Repository";if(!answers.alias)answers.alias=answers.name;let stubFile=Bun.file(join8(getRootPath(),"stubs/repository.stub")),stub=import_string_template6.default(await stubFile.text(),{...answers,module:answers.module??"root",model_name:snake(answers.model.replace("Model",""))}),path=answers.module?await getModulePath(answers.module):"./src",name=snake(answers.name.replace("Repository","")),file=Bun.file(`${path}/repositories/${name}.repository.ts`);await file.write(stub),this.success(`Repository ${this.bold(file.name)} created successfully.`)}}__legacyDecorateClassTS([Command7.arg({description:"The name of the repository to create",type:CommandArgumentType6.STRING}),__legacyMetadataTS("design:type",String)],MakeRepositoryCommand.prototype,"name",void 0),__legacyDecorateClassTS([Command7.arg({description:"The module where the repository will be created",type:CommandArgumentType6.STRING}),__legacyMetadataTS("design:type",String)],MakeRepositoryCommand.prototype,"module",void 0),__legacyDecorateClassTS([Command7.arg({description:"The alias of the repository to create",type:CommandArgumentType6.STRING}),__legacyMetadataTS("design:type",String)],MakeRepositoryCommand.prototype,"alias",void 0),__legacyDecorateClassTS([Command7.arg({description:"The model used by the repository",type:CommandArgumentType6.STRING}),__legacyMetadataTS("design:type",String)],MakeRepositoryCommand.prototype,"model",void 0),__legacyDecorateClassTS([Command7.arg({description:"Create a factory repository",type:CommandArgumentType6.BOOLEAN,default:!1}),__legacyMetadataTS("design:type",Boolean)],MakeRepositoryCommand.prototype,"factory",void 0),__legacyDecorateClassTS([Command7.arg({description:"Create a singleton repository",type:CommandArgumentType6.BOOLEAN,default:!1}),__legacyMetadataTS("design:type",Boolean)],MakeRepositoryCommand.prototype,"singleton",void 0),MakeRepositoryCommand=__legacyDecorateClassTS([Command7.register()],MakeRepositoryCommand);var import_prompts7=__toESM(require_prompts3(),1);import{join as join9}from"path";import{Command as Command8,CommandArgumentType as CommandArgumentType7}from"@elysiumjs/core";var import_string_template7=__toESM(require_string_template(),1);class MakeServiceCommand extends BaseCommand{constructor(){super(...arguments);this.factory=!1;this.singleton=!1}static command="make:service";static description="Creates a new service.";async run(){if(!this.name)return this.setup();let config=await parseProjectConfig(),answers={module:this.module,name:this.name,alias:this.alias,scope:this.factory?"FACTORY":this.singleton?"SINGLETON":"SINGLETON"};if(!answers.module&&!config.mono){let module=await import_prompts7.default({type:"select",name:"module",message:"Module:",choices:Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))});answers.module=module.module}return this.build(answers)}async setup(){let config=await parseProjectConfig(),answers=await import_prompts7.default([{type(){return config.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))}},{type:"text",name:"name",message:"Service Name:",initial:"UserService",validate(value){if(value.length<1)return"Service name cannot be empty";return!0}},{type:"text",name:"alias",message:"Service Alias:",initial(_,values){return values.name},validate(value){if(value.length<1)return"Service alias cannot be empty";return!0}},{type:"select",name:"scope",message:"Service Scope:",choices:[{title:"SINGLETON",value:"SINGLETON",description:"A single instance of the service is created."},{title:"FACTORY",value:"FACTORY",description:"A new instance of the service is created each time it is injected."}]}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(answers)}async build(answers){if(!answers.name){this.error("Operation cancelled.");return}if(!answers.name.endsWith("Service"))answers.name+="Service";if(!answers.alias)answers.alias=answers.name;let stubFile=Bun.file(join9(getRootPath(),"stubs/service.stub")),stub=import_string_template7.default(await stubFile.text(),answers),path=answers.module?await getModulePath(answers.module):"./src",name=snake(answers.name.replace("Service","")),file=Bun.file(`${path}/services/${name}.service.ts`);await file.write(stub),this.success(`Service ${this.bold(file.name)} created successfully.`),this.info(await addToModuleHint("services",answers.name,answers.module))}}__legacyDecorateClassTS([Command8.arg({description:"The name of the service to create",type:CommandArgumentType7.STRING}),__legacyMetadataTS("design:type",String)],MakeServiceCommand.prototype,"name",void 0),__legacyDecorateClassTS([Command8.arg({description:"The module where the service will be created",type:CommandArgumentType7.STRING}),__legacyMetadataTS("design:type",String)],MakeServiceCommand.prototype,"module",void 0),__legacyDecorateClassTS([Command8.arg({description:"The alias of the service to create",type:CommandArgumentType7.STRING}),__legacyMetadataTS("design:type",String)],MakeServiceCommand.prototype,"alias",void 0),__legacyDecorateClassTS([Command8.arg({description:"Create a factory service",type:CommandArgumentType7.BOOLEAN,default:!1}),__legacyMetadataTS("design:type",Boolean)],MakeServiceCommand.prototype,"factory",void 0),__legacyDecorateClassTS([Command8.arg({description:"Create a singleton service",type:CommandArgumentType7.BOOLEAN,default:!1}),__legacyMetadataTS("design:type",Boolean)],MakeServiceCommand.prototype,"singleton",void 0),MakeServiceCommand=__legacyDecorateClassTS([Command8.register()],MakeServiceCommand);var import_prompts8=__toESM(require_prompts3(),1);import{join as join10}from"path";import{Command as Command9,CommandArgumentType as CommandArgumentType8}from"@elysiumjs/core";var import_string_template8=__toESM(require_string_template(),1);class MakeValidatorCommand extends BaseCommand{static command="make:validator";static description="Creates a new validator.";async run(){if(!this.name)return this.setup();let config=await parseProjectConfig(),answers={module:this.module,name:this.name};if(!answers.module&&!config.mono){let module=await import_prompts8.default({type:"select",name:"module",message:"Module:",choices:Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))});answers.module=module.module}return this.build(answers)}async setup(){let config=await parseProjectConfig(),answers=await import_prompts8.default([{type(){return config.mono?null:"select"},name:"module",message:"Module:",choices(){return Object.keys(config.modules??{}).map((moduleName)=>({title:moduleName,value:moduleName}))}},{type:"text",name:"name",message:"Validator Name:",initial:"LoginValidator",validate(value){if(value.length<1)return"Validator name cannot be empty";return!0}}],{onCancel:()=>{this.error("Operation cancelled."),process.exit(0)}});return this.build(answers)}async build(answers){if(!answers.name){this.error("Operation cancelled.");return}if(!answers.name.endsWith("Validator"))answers.name+="Validator";if(!answers.request_name)answers.request_name=answers.name.replace("Validator","Request");let stubFile=Bun.file(join10(getRootPath(),"stubs/validator.stub")),stub=import_string_template8.default(await stubFile.text(),answers),path=answers.module?await getModulePath(answers.module):"./src",name=snake(answers.name.replace("Validator","")),file=Bun.file(`${path}/validators/${name}.validator.ts`);await file.write(stub),this.success(`Validator ${this.bold(file.name)} created successfully.`)}}__legacyDecorateClassTS([Command9.arg({description:"The name of the validator to create",type:CommandArgumentType8.STRING}),__legacyMetadataTS("design:type",String)],MakeValidatorCommand.prototype,"name",void 0),__legacyDecorateClassTS([Command9.arg({description:"The module where the validator will be created",type:CommandArgumentType8.STRING}),__legacyMetadataTS("design:type",String)],MakeValidatorCommand.prototype,"module",void 0),MakeValidatorCommand=__legacyDecorateClassTS([Command9.register()],MakeValidatorCommand);var import_prompts9=__toESM(require_prompts3(),1);import{exists,rm}from"fs/promises";import{join as join11}from"path";import{Command as Command10,CommandArgumentType as CommandArgumentType9}from"@elysiumjs/core";class ModuleNewCommand extends BaseCommand{static command="module:new";static description="Creates a new module.";module;convert=!1;async run(){let config=await parseProjectConfig();if(!this.name){let name=await import_prompts9.default({type:"text",name:"name",message:"New module name:",initial:"module",validate(value){return value.length>0?!0:"Module name cannot be empty"}},{onCancel:()=>process.exit(0)});this.name=snake(name.name)}if(config.mono){let{module,convert}=await import_prompts9.default([{type:"confirm",name:"convert",message:"This project is a mono-module project. Do you want to convert it to a multi-module project?",initial:!1},{type:(convert)=>convert?"text":null,name:"module",message:"Current module name:",initial:"main",validate(value){return value.length>0?!0:"Module name cannot be empty"}}],{onCancel:()=>process.exit(0)});if(!convert)return this.error("Operation cancelled. The project is left unchanged.");this.module=snake(module),this.convert=convert}if(this.convert){let modulesDir=join11(getProjectPath(),"src","modules");if(await exists(modulesDir))await rm(modulesDir,{recursive:!0});await createModule(this.module,"root"),this.success("Project converted to multi-module."),this.success(`Module '${this.module}' created.`)}await createModule(this.name),this.success(`Module '${this.name}' created.`)}}__legacyDecorateClassTS([Command10.arg({description:"The name of the module to create",type:CommandArgumentType9.STRING}),__legacyMetadataTS("design:type",String)],ModuleNewCommand.prototype,"name",void 0),ModuleNewCommand=__legacyDecorateClassTS([Command10.register()],ModuleNewCommand);var import_prompts10=__toESM(require_prompts3(),1);import{Command as Command11,CommandArgumentType as CommandArgumentType10}from"@elysiumjs/core";class ModuleRenameCommand extends BaseCommand{static command="module:rename";static description="Renames a module.";async run(){if((await parseProjectConfig()).mono)return this.error("This operation is not supported for mono-module projects.");if(!this.module){let{module}=await import_prompts10.default({type:"text",name:"module",message:"Module to rename:",validate:(value)=>value.length>0});this.module=module}if(!this.name){let{name}=await import_prompts10.default({type:"text",name:"name",message:"New module name:",initial:this.module,validate:(value)=>value.length>0});this.name=name}if(this.module===this.name)return this.info("Module name is the same as the current name.");await createModule(this.name,this.module),this.success(`Module '${this.module}' renamed to '${this.name}'.`)}}__legacyDecorateClassTS([Command11.arg({description:"The module to rename",type:CommandArgumentType10.STRING}),__legacyMetadataTS("design:type",String)],ModuleRenameCommand.prototype,"module",void 0),__legacyDecorateClassTS([Command11.arg({description:"The new name of the module",type:CommandArgumentType10.STRING}),__legacyMetadataTS("design:type",String)],ModuleRenameCommand.prototype,"name",void 0),ModuleRenameCommand=__legacyDecorateClassTS([Command11.register()],ModuleRenameCommand);class StyxModule extends Module{}StyxModule=__legacyDecorateClassTS([Module.register({env:["development"],commands:[MakeCommandCommand,MakeControllerCommand,MakeJobCommand,MakeMiddlewareCommand,MakeModelCommand,MakeRepositoryCommand,MakeServiceCommand,MakeValidatorCommand,ModuleNewCommand,ModuleRenameCommand]})],StyxModule);export{StyxModule};