@mxfb/cli 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ cli
2
+ some-cli-util
3
+ some-other-cli-util
4
+ third-cli-util
package/cli/index.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import t from"node:process";import{promises as r}from"node:fs";import a from"node:url";import i from"node:path";var e=a.fileURLToPath(import.meta.url),m=i.dirname(e),l=t.argv.at(2)?.trim();if(l==="--list"){let o=i.join(m,"assets/list.txt"),s=await r.readFile(o,{encoding:"utf-8"});console.log(s),t.exit(0)}
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@mxfb/cli",
3
+ "version": "0.0.15",
4
+ "description": "",
5
+ "author": "Maxime Fabas",
6
+ "license": "ISC",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/maximefabas/mxfb-cli"
10
+ },
11
+ "type": "module",
12
+ "main": "index.js",
13
+ "module": "index.js",
14
+ "bin": {
15
+ "cli": "./cli/index.js",
16
+ "some-cli-util": "./some-cli-util/index.js",
17
+ "some-other-cli-util": "./some-other-cli-util/index.js",
18
+ "third-cli-util": "./third-cli-util/index.js"
19
+ },
20
+ "devDependencies": {
21
+ "@mxfb/tools": "^0.0.16",
22
+ "@types/node": "^20.11.30",
23
+ "@types/prompts": "^2.4.9",
24
+ "@types/semver": "^7.5.8",
25
+ "camelcase": "^8.0.0",
26
+ "esbuild": "^0.20.2",
27
+ "prompts": "^2.4.2",
28
+ "semver": "^7.6.0",
29
+ "simple-git": "^3.23.0",
30
+ "typescript": "^5.4.3"
31
+ }
32
+ }
@@ -0,0 +1 @@
1
+ LAITINI
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env node
2
+ var mn=Object.create;var Fe=Object.defineProperty;var bn=Object.getOwnPropertyDescriptor;var vn=Object.getOwnPropertyNames;var wn=Object.getPrototypeOf,yn=Object.prototype.hasOwnProperty;var lt=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var u=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var xn=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of vn(t))!yn.call(i,r)&&r!==e&&Fe(i,r,{get:()=>t[r],enumerable:!(s=bn(t,r))||s.enumerable});return i};var Sn=(i,t,e)=>(e=i!=null?mn(wn(i)):{},xn(t||!i||!i.__esModule?Fe(e,"default",{value:i,enumerable:!0}):e,i));var f=u((Il,Ye)=>{"use strict";var{FORCE_COLOR:qn,NODE_DISABLE_COLORS:On,TERM:Mn}=process.env,c={enabled:!On&&Mn!=="dumb"&&qn!=="0",reset:d(0,0),bold:d(1,22),dim:d(2,22),italic:d(3,23),underline:d(4,24),inverse:d(7,27),hidden:d(8,28),strikethrough:d(9,29),black:d(30,39),red:d(31,39),green:d(32,39),yellow:d(33,39),blue:d(34,39),magenta:d(35,39),cyan:d(36,39),white:d(37,39),gray:d(90,39),grey:d(90,39),bgBlack:d(40,49),bgRed:d(41,49),bgGreen:d(42,49),bgYellow:d(43,49),bgBlue:d(44,49),bgMagenta:d(45,49),bgCyan:d(46,49),bgWhite:d(47,49)};function He(i,t){let e=0,s,r="",o="";for(;e<i.length;e++)s=i[e],r+=s.open,o+=s.close,t.includes(s.close)&&(t=t.replace(s.rgx,s.close+s.open));return r+t+o}function Tn(i,t){let e={has:i,keys:t};return e.reset=c.reset.bind(e),e.bold=c.bold.bind(e),e.dim=c.dim.bind(e),e.italic=c.italic.bind(e),e.underline=c.underline.bind(e),e.inverse=c.inverse.bind(e),e.hidden=c.hidden.bind(e),e.strikethrough=c.strikethrough.bind(e),e.black=c.black.bind(e),e.red=c.red.bind(e),e.green=c.green.bind(e),e.yellow=c.yellow.bind(e),e.blue=c.blue.bind(e),e.magenta=c.magenta.bind(e),e.cyan=c.cyan.bind(e),e.white=c.white.bind(e),e.gray=c.gray.bind(e),e.grey=c.grey.bind(e),e.bgBlack=c.bgBlack.bind(e),e.bgRed=c.bgRed.bind(e),e.bgGreen=c.bgGreen.bind(e),e.bgYellow=c.bgYellow.bind(e),e.bgBlue=c.bgBlue.bind(e),e.bgMagenta=c.bgMagenta.bind(e),e.bgCyan=c.bgCyan.bind(e),e.bgWhite=c.bgWhite.bind(e),e}function d(i,t){let e={open:`\x1B[${i}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(i)||(this.has.push(i),this.keys.push(e)),s===void 0?this:c.enabled?He(this.keys,s+""):s+""):s===void 0?Tn([i],[e]):c.enabled?He([e],s+""):s+""}}Ye.exports=c});var Le=u((Dl,Ve)=>{"use strict";Ve.exports=(i,t)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(t){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var ut=u((Cl,Ne)=>{"use strict";Ne.exports=i=>{let t=["[\\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("|"),e=new RegExp(t,"g");return typeof i=="string"?i.replace(e,""):i}});var g=u((El,Ue)=>{"use strict";var Mt="\x1B",p=`${Mt}[`,$n="\x07",Tt={to(i,t){return t?`${p}${t+1};${i+1}H`:`${p}${i+1}G`},move(i,t){let e="";return i<0?e+=`${p}${-i}D`:i>0&&(e+=`${p}${i}C`),t<0?e+=`${p}${-t}A`:t>0&&(e+=`${p}${t}B`),e},up:(i=1)=>`${p}${i}A`,down:(i=1)=>`${p}${i}B`,forward:(i=1)=>`${p}${i}C`,backward:(i=1)=>`${p}${i}D`,nextLine:(i=1)=>`${p}E`.repeat(i),prevLine:(i=1)=>`${p}F`.repeat(i),left:`${p}G`,hide:`${p}?25l`,show:`${p}?25h`,save:`${Mt}7`,restore:`${Mt}8`},Pn={up:(i=1)=>`${p}S`.repeat(i),down:(i=1)=>`${p}T`.repeat(i)},_n={screen:`${p}2J`,up:(i=1)=>`${p}1J`.repeat(i),down:(i=1)=>`${p}J`.repeat(i),line:`${p}2K`,lineEnd:`${p}K`,lineStart:`${p}1K`,lines(i){let t="";for(let e=0;e<i;e++)t+=this.line+(e<i-1?Tt.up():"");return i&&(t+=Tt.left),t}};Ue.exports={cursor:Tt,scroll:Pn,erase:_n,beep:$n}});var Ze=u((Al,ze)=>{"use strict";function In(i,t){var e=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!e){if(Array.isArray(i)||(e=Dn(i))||t&&i&&typeof i.length=="number"){e&&(i=e);var s=0,r=function(){};return{s:r,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(a){throw a},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,n=!1,h;return{s:function(){e=e.call(i)},n:function(){var a=e.next();return o=a.done,a},e:function(a){n=!0,h=a},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(n)throw h}}}}function Dn(i,t){if(i){if(typeof i=="string")return Ge(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Ge(i,t)}}function Ge(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,s=new Array(t);e<t;e++)s[e]=i[e];return s}var Cn=ut(),Be=g(),Je=Be.erase,En=Be.cursor,An=i=>[...Cn(i)].length;ze.exports=function(i,t){if(!t)return Je.line+En.to(0);let e=0,s=i.split(/\r?\n/);var r=In(s),o;try{for(r.s();!(o=r.n()).done;){let n=o.value;e+=1+Math.floor(Math.max(An(n)-1,0)/t)}}catch(n){r.e(n)}finally{r.f()}return Je.lines(e)}});var $t=u((jl,We)=>{"use strict";var Z={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},jn={arrowUp:Z.arrowUp,arrowDown:Z.arrowDown,arrowLeft:Z.arrowLeft,arrowRight:Z.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Rn=process.platform==="win32"?jn:Z;We.exports=Rn});var Xe=u((Rl,Ke)=>{"use strict";var N=f(),V=$t(),Pt=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),kn=i=>Pt[i]||Pt.default,W=Object.freeze({aborted:N.red(V.cross),done:N.green(V.tick),exited:N.yellow(V.cross),default:N.cyan("?")}),Fn=(i,t,e)=>t?W.aborted:e?W.exited:i?W.done:W.default,Hn=i=>N.gray(i?V.ellipsis:V.pointerSmall),Yn=(i,t)=>N.gray(i?t?V.pointerSmall:"+":V.line);Ke.exports={styles:Pt,render:kn,symbols:W,symbol:Fn,delimiter:Hn,item:Yn}});var ti=u((kl,Qe)=>{"use strict";var Vn=ut();Qe.exports=function(i,t){let e=String(Vn(i)||"").split(/\r?\n/);return t?e.map(s=>Math.ceil(s.length/t)).reduce((s,r)=>s+r):e.length}});var ii=u((Fl,ei)=>{"use strict";ei.exports=(i,t={})=>{let e=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",s=t.width;return(i||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((o,n)=>(n.length+e.length>=s||o[o.length-1].length+n.length+1<s?o[o.length-1]+=` ${n}`:o.push(`${e}${n}`),o),[e]).join(`
4
+ `)).join(`
5
+ `)}});var ri=u((Hl,si)=>{"use strict";si.exports=(i,t,e)=>{e=e||t;let s=Math.min(t-e,i-Math.floor(e/2));s<0&&(s=0);let r=Math.min(s+e,t);return{startIndex:s,endIndex:r}}});var w=u((Yl,ni)=>{"use strict";ni.exports={action:Le(),clear:Ze(),style:Xe(),strip:ut(),figures:$t(),lines:ti(),wrap:ii(),entriesToDisplay:ri()}});var _=u((Vl,li)=>{"use strict";var oi=lt("readline"),Ln=w(),Nn=Ln.action,Un=lt("events"),hi=g(),Gn=hi.beep,Jn=hi.cursor,Bn=f(),_t=class extends Un{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);let e=oi.createInterface({input:this.in,escapeCodeTimeout:50});oi.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(o,n)=>{let h=Nn(n,s);h===!1?this._&&this._(o,n):typeof this[h]=="function"?this[h](n):this.bell()};this.close=()=>{this.out.write(Jn.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Gn)}render(){this.onRender(Bn),this.firstRender&&(this.firstRender=!1)}};li.exports=_t});var fi=u((Ll,di)=>{"use strict";function ui(i,t,e,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){e(a);return}h.done?t(l):Promise.resolve(l).then(s,r)}function ai(i){return function(){var t=this,e=arguments;return new Promise(function(s,r){var o=i.apply(t,e);function n(l){ui(o,s,r,n,h,"next",l)}function h(l){ui(o,s,r,n,h,"throw",l)}n(void 0)})}}var at=f(),zn=_(),ci=g(),Zn=ci.erase,K=ci.cursor,ct=w(),It=ct.style,Dt=ct.clear,Wn=ct.lines,Kn=ct.figures,Ct=class extends zn{constructor(t={}){super(t),this.transform=It.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=Dt("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=at.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!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 t=this;return ai(function*(){let e=yield t.validator(t.value);typeof e=="string"&&(t.errorMsg=e,e=!1),t.error=!e})()}submit(){var t=this;return ai(function*(){if(t.value=t.value||t.initial,t.cursorOffset=0,t.cursor=t.rendered.length,yield t.validate(),t.error){t.red=!0,t.fire(),t.render();return}t.done=!0,t.aborted=!1,t.fire(),t.render(),t.out.write(`
7
+ `),t.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,e){let s=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${s}${t}${r}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),e=this.value.slice(this.cursor);this.value=`${t}${e}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor+1);this.value=`${t}${e}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0: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(){this.closed||(this.firstRender||(this.outputError&&this.out.write(K.down(Wn(this.outputError,this.out.columns)-1)+Dt(this.outputError,this.out.columns)),this.out.write(Dt(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[It.symbol(this.done,this.aborted),at.bold(this.msg),It.delimiter(this.done),this.red?at.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
8
+ `).reduce((t,e,s)=>t+`
9
+ ${s?" ":Kn.pointerSmall} ${at.red().italic(e)}`,"")),this.out.write(Zn.line+K.to(0)+this.outputText+K.save+this.outputError+K.restore+K.move(this.cursorOffset,0)))}};di.exports=Ct});var bi=u((Nl,mi)=>{"use strict";var I=f(),Xn=_(),X=w(),pi=X.style,gi=X.clear,dt=X.figures,Qn=X.wrap,to=X.entriesToDisplay,eo=g(),io=eo.cursor,Et=class extends Xn{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((e,s)=>(typeof e=="string"&&(e={title:e,value:s}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?s:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=gi("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].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
+ `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
11
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,e){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(io.hide):this.out.write(gi(this.outputText,this.out.columns)),super.render();let t=to(this.cursor,this.choices.length,this.optionsPerPage),e=t.startIndex,s=t.endIndex;if(this.outputText=[pi.symbol(this.done,this.aborted),I.bold(this.msg),pi.delimiter(!1),this.done?this.selection.title:this.selection.disabled?I.yellow(this.warn):I.gray(this.hint)].join(" "),!this.done){this.outputText+=`
12
+ `;for(let r=e;r<s;r++){let o,n,h="",l=this.choices[r];r===e&&e>0?n=dt.arrowUp:r===s-1&&s<this.choices.length?n=dt.arrowDown:n=" ",l.disabled?(o=this.cursor===r?I.gray().underline(l.title):I.strikethrough().gray(l.title),n=(this.cursor===r?I.bold().gray(dt.pointer)+" ":" ")+n):(o=this.cursor===r?I.cyan().underline(l.title):l.title,n=(this.cursor===r?I.cyan(dt.pointer)+" ":" ")+n,l.description&&this.cursor===r&&(h=` - ${l.description}`,(n.length+o.length+h.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(h=`
13
+ `+Qn(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${o}${I.gray(h)}
14
+ `}}this.out.write(this.outputText)}};mi.exports=Et});var qi=u((Ul,Si)=>{"use strict";var ft=f(),so=_(),yi=w(),vi=yi.style,ro=yi.clear,xi=g(),wi=xi.cursor,no=xi.erase,At=class extends so{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.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
+ `),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()}_(t,e){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(wi.hide):this.out.write(ro(this.outputText,this.out.columns)),super.render(),this.outputText=[vi.symbol(this.done,this.aborted),ft.bold(this.msg),vi.delimiter(this.done),this.value?this.inactive:ft.cyan().underline(this.inactive),ft.gray("/"),this.value?ft.cyan().underline(this.active):this.active].join(" "),this.out.write(no.line+wi.to(0)+this.outputText))}};Si.exports=At});var S=u((Gl,Oi)=>{"use strict";var jt=class i{constructor({token:t,date:e,parts:s,locales:r}){this.token=t,this.date=e||new Date,this.parts=s||[this],this.locales=r||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((e,s)=>s>t&&e instanceof i)}setTo(t){}prev(){let t=[].concat(this.parts).reverse(),e=t.indexOf(this);return t.find((s,r)=>r>e&&s instanceof i)}toString(){return String(this.date)}};Oi.exports=jt});var Ti=u((Jl,Mi)=>{"use strict";var oo=S(),Rt=class extends oo{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}};Mi.exports=Rt});var Pi=u((Bl,$i)=>{"use strict";var ho=S(),lo=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),kt=class extends ho{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),e=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+lo(t):this.token==="d"?e+1:this.token==="ddd"?this.locales.weekdaysShort[e]:this.token==="dddd"?this.locales.weekdays[e]:t}};$i.exports=kt});var Ii=u((zl,_i)=>{"use strict";var uo=S(),Ft=class extends uo{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}};_i.exports=Ft});var Ci=u((Zl,Di)=>{"use strict";var ao=S(),Ht=class extends ao{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Di.exports=Ht});var Ai=u((Wl,Ei)=>{"use strict";var co=S(),Yt=class extends co{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}};Ei.exports=Yt});var Ri=u((Kl,ji)=>{"use strict";var fo=S(),Vt=class extends fo{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),e=this.token.length;return e===2?String(t+1).padStart(2,"0"):e===3?this.locales.monthsShort[t]:e===4?this.locales.months[t]:String(t+1)}};ji.exports=Vt});var Fi=u((Xl,ki)=>{"use strict";var po=S(),Lt=class extends po{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}};ki.exports=Lt});var Yi=u((Ql,Hi)=>{"use strict";var go=S(),Nt=class extends go{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}};Hi.exports=Nt});var Li=u((tu,Vi)=>{"use strict";Vi.exports={DatePart:S(),Meridiem:Ti(),Day:Pi(),Hours:Ii(),Milliseconds:Ci(),Minutes:Ai(),Month:Ri(),Seconds:Fi(),Year:Yi()}});var Xi=u((eu,Ki)=>{"use strict";function Ni(i,t,e,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){e(a);return}h.done?t(l):Promise.resolve(l).then(s,r)}function Ui(i){return function(){var t=this,e=arguments;return new Promise(function(s,r){var o=i.apply(t,e);function n(l){Ni(o,s,r,n,h,"next",l)}function h(l){Ni(o,s,r,n,h,"throw",l)}n(void 0)})}}var Ut=f(),mo=_(),Jt=w(),Gi=Jt.style,Ji=Jt.clear,bo=Jt.figures,Wi=g(),vo=Wi.erase,Bi=Wi.cursor,D=Li(),zi=D.DatePart,wo=D.Meridiem,yo=D.Day,xo=D.Hours,So=D.Milliseconds,qo=D.Minutes,Oo=D.Month,Mo=D.Seconds,To=D.Year,$o=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Zi={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new yo(i),3:i=>new Oo(i),4:i=>new To(i),5:i=>new wo(i),6:i=>new xo(i),7:i=>new qo(i),8:i=>new Mo(i),9:i=>new So(i)},Po={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(",")},Gt=class extends mo{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(Po,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Ji("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let e;for(this.parts=[];e=$o.exec(t);){let r=e.shift(),o=e.findIndex(n=>n!=null);this.parts.push(o in Zi?Zi[o]({token:e[o]||r,date:this.date,parts:this.parts,locales:this.locales}):e[o]||r)}let s=this.parts.reduce((r,o)=>(typeof o=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=o:r.push(o),r),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex(t=>t instanceof zi)),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 t=this;return Ui(function*(){let e=yield t.validator(t.value);typeof e=="string"&&(t.errorMsg=e,e=!1),t.error=!e})()}submit(){var t=this;return Ui(function*(){if(yield t.validate(),t.error){t.color="red",t.fire(),t.render();return}t.done=!0,t.aborted=!1,t.fire(),t.render(),t.out.write(`
18
+ `),t.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex(e=>e instanceof zi)),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Bi.hide):this.out.write(Ji(this.outputText,this.out.columns)),super.render(),this.outputText=[Gi.symbol(this.done,this.aborted),Ut.bold(this.msg),Gi.delimiter(!1),this.parts.reduce((t,e,s)=>t.concat(s===this.cursor&&!this.done?Ut.cyan().underline(e.toString()):e),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
19
+ `).reduce((t,e,s)=>t+`
20
+ ${s?" ":bo.pointerSmall} ${Ut.red().italic(e)}`,"")),this.out.write(vo.line+Bi.to(0)+this.outputText))}};Ki.exports=Gt});var ns=u((iu,rs)=>{"use strict";function Qi(i,t,e,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){e(a);return}h.done?t(l):Promise.resolve(l).then(s,r)}function ts(i){return function(){var t=this,e=arguments;return new Promise(function(s,r){var o=i.apply(t,e);function n(l){Qi(o,s,r,n,h,"next",l)}function h(l){Qi(o,s,r,n,h,"throw",l)}n(void 0)})}}var pt=f(),_o=_(),ss=g(),gt=ss.cursor,Io=ss.erase,mt=w(),Bt=mt.style,Do=mt.figures,es=mt.clear,Co=mt.lines,Eo=/[0-9]/,zt=i=>i!==void 0,is=(i,t)=>{let e=Math.pow(10,t);return Math.round(i*e)/e},Zt=class extends _o{constructor(t={}){super(t),this.transform=Bt.render(t.style),this.msg=t.message,this.initial=zt(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=zt(t.min)?t.min:-1/0,this.max=zt(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){!t&&t!==0?(this.placeholder=!0,this.rendered=pt.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${is(t,this.round)}`),this._value=is(t,this.round)),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t==="-"||t==="."&&this.float||Eo.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==""?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
21
+ `),this.close()}validate(){var t=this;return ts(function*(){let e=yield t.validator(t.value);typeof e=="string"&&(t.errorMsg=e,e=!1),t.error=!e})()}submit(){var t=this;return ts(function*(){if(yield t.validate(),t.error){t.color="red",t.fire(),t.render();return}let e=t.value;t.value=e!==""?e:t.initial,t.done=!0,t.aborted=!1,t.error=!1,t.fire(),t.render(),t.out.write(`
22
+ `),t.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),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),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.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()}_(t,e){if(!this.valid(t))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=s,this.color="cyan",t===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(gt.down(Co(this.outputError,this.out.columns)-1)+es(this.outputError,this.out.columns)),this.out.write(es(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Bt.symbol(this.done,this.aborted),pt.bold(this.msg),Bt.delimiter(this.done),!this.done||!this.done&&!this.placeholder?pt[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
23
+ `).reduce((t,e,s)=>t+`
24
+ ${s?" ":Do.pointerSmall} ${pt.red().italic(e)}`,"")),this.out.write(Io.line+gt.to(0)+this.outputText+gt.save+this.outputError+gt.restore))}};rs.exports=Zt});var Kt=u((su,ls)=>{"use strict";var q=f(),Ao=g(),jo=Ao.cursor,Ro=_(),Q=w(),os=Q.clear,k=Q.figures,hs=Q.style,ko=Q.wrap,Fo=Q.entriesToDisplay,Wt=class extends Ro{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map((e,s)=>(typeof e=="string"&&(e={title:e,value:s}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?s:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=os("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map(t=>!t.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(t=>t.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
25
+ `),this.close()}submit(){let t=this.value.filter(e=>e.selected);this.minSelected&&t.length<this.minSelected?(this.showMinError=!0,this.render()):(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(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let t=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(e=>e.selected=t),this.render()}_(t,e){if(t===" ")this.handleSpaceToggle();else if(t==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
27
+ Instructions:
28
+ ${k.arrowUp}/${k.arrowDown}: Highlight option
29
+ ${k.arrowLeft}/${k.arrowRight}/[space]: Toggle selection
30
+ `+(this.maxChoices===void 0?` a: Toggle all
31
+ `:"")+" enter/return: Complete answer":""}renderOption(t,e,s,r){let o=(e.selected?q.green(k.radioOn):k.radioOff)+" "+r+" ",n,h;return e.disabled?n=t===s?q.gray().underline(e.title):q.strikethrough().gray(e.title):(n=t===s?q.cyan().underline(e.title):e.title,t===s&&e.description&&(h=` - ${e.description}`,(o.length+n.length+h.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(h=`
32
+ `+ko(e.description,{margin:o.length,width:this.out.columns})))),o+n+q.gray(h||"")}paginateOptions(t){if(t.length===0)return q.red("No matches for this query.");let e=Fo(this.cursor,t.length,this.optionsPerPage),s=e.startIndex,r=e.endIndex,o,n=[];for(let h=s;h<r;h++)h===s&&s>0?o=k.arrowUp:h===r-1&&r<t.length?o=k.arrowDown:o=" ",n.push(this.renderOption(this.cursor,t[h],h,o));return`
33
+ `+n.join(`
34
+ `)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");let t=[q.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(q.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(jo.hide),super.render();let t=[hs.symbol(this.done,this.aborted),q.bold(this.msg),hs.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=q.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=os(t,this.out.columns)}};ls.exports=Wt});var gs=u((ru,ps)=>{"use strict";function us(i,t,e,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){e(a);return}h.done?t(l):Promise.resolve(l).then(s,r)}function Ho(i){return function(){var t=this,e=arguments;return new Promise(function(s,r){var o=i.apply(t,e);function n(l){us(o,s,r,n,h,"next",l)}function h(l){us(o,s,r,n,h,"throw",l)}n(void 0)})}}var tt=f(),Yo=_(),fs=g(),Vo=fs.erase,as=fs.cursor,et=w(),Xt=et.style,cs=et.clear,Qt=et.figures,Lo=et.wrap,No=et.entriesToDisplay,ds=(i,t)=>i[t]&&(i[t].value||i[t].title||i[t]),Uo=(i,t)=>i[t]&&(i[t].title||i[t].value||i[t]),Go=(i,t)=>{let e=i.findIndex(s=>s.value===t||s.title===t);return e>-1?e:void 0},te=class extends Yo{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial=typeof t.initial=="number"?t.initial:Go(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=Xt.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=cs("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return typeof this._fb=="number"?t=this.choices[this._fb]:typeof this._fb=="string"&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=ds(this.suggestions,t):this.value=this.fallback.value,this.fire()}complete(t){var e=this;return Ho(function*(){let s=e.completing=e.suggest(e.input,e.choices),r=yield s;if(e.completing!==s)return;e.suggestions=r.map((n,h,l)=>({title:Uo(l,h),value:ds(l,h),description:n.description})),e.completing=!1;let o=Math.max(r.length-1,0);e.moveSelect(Math.min(o,e.select)),t&&t()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
35
+ `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
36
+ `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
37
+ `),this.close()}_(t,e){let s=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${s}${t}${r}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):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(t,e,s,r){let o,n=s?Qt.arrowUp:r?Qt.arrowDown:" ",h=e?tt.cyan().underline(t.title):t.title;return n=(e?tt.cyan(Qt.pointer)+" ":" ")+n,t.description&&(o=` - ${t.description}`,(n.length+h.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o=`
38
+ `+Lo(t.description,{margin:3,width:this.out.columns}))),n+" "+h+tt.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(as.hide):this.out.write(cs(this.outputText,this.out.columns)),super.render();let t=No(this.select,this.choices.length,this.limit),e=t.startIndex,s=t.endIndex;if(this.outputText=[Xt.symbol(this.done,this.aborted,this.exited),tt.bold(this.msg),Xt.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 r=this.suggestions.slice(e,s).map((o,n)=>this.renderOption(o,this.select===n+e,n===0&&e>0,n+e===s-1&&s<this.choices.length)).join(`
39
+ `);this.outputText+=`
40
+ `+(r||tt.gray(this.fallback.title))}this.out.write(Vo.line+as.to(0)+this.outputText)}};ps.exports=te});var ws=u((nu,vs)=>{"use strict";var C=f(),Jo=g(),Bo=Jo.cursor,zo=Kt(),ie=w(),ms=ie.clear,bs=ie.style,U=ie.figures,ee=class extends zo{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=ms("",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(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let e=this.filteredOptions.findIndex(s=>s===t);this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){let t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
41
+ Instructions:
42
+ ${U.arrowUp}/${U.arrowDown}: Highlight option
43
+ ${U.arrowLeft}/${U.arrowRight}/[space]: Toggle selection
44
+ [a,b,c]/delete: Filter choices
45
+ enter/return: Complete answer
46
+ `:""}renderCurrentInput(){return`
47
+ Filtered results for: ${this.inputValue?this.inputValue:C.gray("Enter something to filter")}
48
+ `}renderOption(t,e,s){let r;return e.disabled?r=t===s?C.gray().underline(e.title):C.strikethrough().gray(e.title):r=t===s?C.cyan().underline(e.title):e.title,(e.selected?C.green(U.radioOn):U.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");let t=[C.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(C.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Bo.hide),super.render();let t=[bs.symbol(this.done,this.aborted),C.bold(this.msg),bs.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=C.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=ms(t,this.out.columns)}};vs.exports=ee});var Ts=u((ou,Ms)=>{"use strict";var ys=f(),Zo=_(),qs=w(),xs=qs.style,Wo=qs.clear,Os=g(),Ko=Os.erase,Ss=Os.cursor,se=class extends Zo{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.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
+ `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
50
+ `),this.close()}_(t,e){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Ss.hide):this.out.write(Wo(this.outputText,this.out.columns)),super.render(),this.outputText=[xs.symbol(this.done,this.aborted),ys.bold(this.msg),xs.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:ys.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Ko.line+Ss.to(0)+this.outputText))}};Ms.exports=se});var Ps=u((hu,$s)=>{"use strict";$s.exports={TextPrompt:fi(),SelectPrompt:bi(),TogglePrompt:qi(),DatePrompt:Xi(),NumberPrompt:ns(),MultiselectPrompt:Kt(),AutocompletePrompt:gs(),AutocompleteMultiselectPrompt:ws(),ConfirmPrompt:Ts()}});var Is=u(_s=>{"use strict";var b=_s,Xo=Ps(),bt=i=>i;function O(i,t,e={}){return new Promise((s,r)=>{let o=new Xo[i](t),n=e.onAbort||bt,h=e.onSubmit||bt,l=e.onExit||bt;o.on("state",t.onState||bt),o.on("submit",a=>s(h(a))),o.on("exit",a=>s(l(a))),o.on("abort",a=>r(n(a)))})}b.text=i=>O("TextPrompt",i);b.password=i=>(i.style="password",b.text(i));b.invisible=i=>(i.style="invisible",b.text(i));b.number=i=>O("NumberPrompt",i);b.date=i=>O("DatePrompt",i);b.confirm=i=>O("ConfirmPrompt",i);b.list=i=>{let t=i.separator||",";return O("TextPrompt",i,{onSubmit:e=>e.split(t).map(s=>s.trim())})};b.toggle=i=>O("TogglePrompt",i);b.select=i=>O("SelectPrompt",i);b.multiselect=i=>{i.choices=[].concat(i.choices||[]);let t=e=>e.filter(s=>s.selected).map(s=>s.value);return O("MultiselectPrompt",i,{onAbort:t,onSubmit:t})};b.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let t=e=>e.filter(s=>s.selected).map(s=>s.value);return O("AutocompleteMultiselectPrompt",i,{onAbort:t,onSubmit:t})};var Qo=(i,t)=>Promise.resolve(t.filter(e=>e.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));b.autocomplete=i=>(i.suggest=i.suggest||Qo,i.choices=[].concat(i.choices||[]),O("AutocompletePrompt",i))});var Fs=u((uu,ks)=>{"use strict";function Ds(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),e.push.apply(e,s)}return e}function Cs(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Ds(Object(e),!0).forEach(function(s){th(i,s,e[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):Ds(Object(e)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(e,s))})}return i}function th(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function eh(i,t){var e=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!e){if(Array.isArray(i)||(e=ih(i))||t&&i&&typeof i.length=="number"){e&&(i=e);var s=0,r=function(){};return{s:r,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(a){throw a},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
51
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,n=!1,h;return{s:function(){e=e.call(i)},n:function(){var a=e.next();return o=a.done,a},e:function(a){n=!0,h=a},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(n)throw h}}}}function ih(i,t){if(i){if(typeof i=="string")return Es(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Es(i,t)}}function Es(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,s=new Array(t);e<t;e++)s[e]=i[e];return s}function As(i,t,e,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){e(a);return}h.done?t(l):Promise.resolve(l).then(s,r)}function js(i){return function(){var t=this,e=arguments;return new Promise(function(s,r){var o=i.apply(t,e);function n(l){As(o,s,r,n,h,"next",l)}function h(l){As(o,s,r,n,h,"throw",l)}n(void 0)})}}var re=Is(),sh=["suggest","format","onState","validate","onRender","type"],Rs=()=>{};function F(){return ne.apply(this,arguments)}function ne(){return ne=js(function*(i=[],{onSubmit:t=Rs,onCancel:e=Rs}={}){let s={},r=F._override||{};i=[].concat(i);let o,n,h,l,a,B,z=function(){var R=js(function*(P,ht,ke=!1){if(!(!ke&&P.validate&&P.validate(ht)!==!0))return P.format?yield P.format(ht,s):ht});return function(ht,ke){return R.apply(this,arguments)}}();var m=eh(i),x;try{for(m.s();!(x=m.n()).done;){n=x.value;var ot=n;if(l=ot.name,a=ot.type,typeof a=="function"&&(a=yield a(o,Cs({},s),n),n.type=a),!!a){for(let R in n){if(sh.includes(R))continue;let P=n[R];n[R]=typeof P=="function"?yield P(o,Cs({},s),B):P}if(B=n,typeof n.message!="string")throw new Error("prompt message is required");var Re=n;if(l=Re.name,a=Re.type,re[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[n.name]!==void 0&&(o=yield z(n,r[n.name]),o!==void 0)){s[l]=o;continue}try{o=F._injected?rh(F._injected,n.initial):yield re[a](n),s[l]=o=yield z(n,o,!0),h=yield t(n,o,s)}catch{h=!(yield e(n,s))}if(h)return s}}}catch(R){m.e(R)}finally{m.f()}return s}),ne.apply(this,arguments)}function rh(i,t){let e=i.shift();if(e instanceof Error)throw e;return e===void 0?t:e}function nh(i){F._injected=(F._injected||[]).concat(i)}function oh(i){F._override=Object.assign({},i)}ks.exports=Object.assign(F,{prompt:F,prompts:re,inject:nh,override:oh})});var Ys=u((au,Hs)=>{"use strict";Hs.exports=(i,t)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(t){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var vt=u((cu,Vs)=>{"use strict";Vs.exports=i=>{let t=["[\\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("|"),e=new RegExp(t,"g");return typeof i=="string"?i.replace(e,""):i}});var Us=u((du,Ns)=>{"use strict";var hh=vt(),{erase:Ls,cursor:lh}=g(),uh=i=>[...hh(i)].length;Ns.exports=function(i,t){if(!t)return Ls.line+lh.to(0);let e=0,s=i.split(/\r?\n/);for(let r of s)e+=1+Math.floor(Math.max(uh(r)-1,0)/t);return Ls.lines(e)}});var oe=u((fu,Gs)=>{"use strict";var it={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},ah={arrowUp:it.arrowUp,arrowDown:it.arrowDown,arrowLeft:it.arrowLeft,arrowRight:it.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},ch=process.platform==="win32"?ah:it;Gs.exports=ch});var Bs=u((pu,Js)=>{"use strict";var G=f(),L=oe(),he=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),dh=i=>he[i]||he.default,st=Object.freeze({aborted:G.red(L.cross),done:G.green(L.tick),exited:G.yellow(L.cross),default:G.cyan("?")}),fh=(i,t,e)=>t?st.aborted:e?st.exited:i?st.done:st.default,ph=i=>G.gray(i?L.ellipsis:L.pointerSmall),gh=(i,t)=>G.gray(i?t?L.pointerSmall:"+":L.line);Js.exports={styles:he,render:dh,symbols:st,symbol:fh,delimiter:ph,item:gh}});var Zs=u((gu,zs)=>{"use strict";var mh=vt();zs.exports=function(i,t){let e=String(mh(i)||"").split(/\r?\n/);return t?e.map(s=>Math.ceil(s.length/t)).reduce((s,r)=>s+r):e.length}});var Ks=u((mu,Ws)=>{"use strict";Ws.exports=(i,t={})=>{let e=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",s=t.width;return(i||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((o,n)=>(n.length+e.length>=s||o[o.length-1].length+n.length+1<s?o[o.length-1]+=` ${n}`:o.push(`${e}${n}`),o),[e]).join(`
52
+ `)).join(`
53
+ `)}});var Qs=u((bu,Xs)=>{"use strict";Xs.exports=(i,t,e)=>{e=e||t;let s=Math.min(t-e,i-Math.floor(e/2));s<0&&(s=0);let r=Math.min(s+e,t);return{startIndex:s,endIndex:r}}});var y=u((vu,tr)=>{"use strict";tr.exports={action:Ys(),clear:Us(),style:Bs(),strip:vt(),figures:oe(),lines:Zs(),wrap:Ks(),entriesToDisplay:Qs()}});var E=u((wu,ir)=>{"use strict";var er=lt("readline"),{action:bh}=y(),vh=lt("events"),{beep:wh,cursor:yh}=g(),xh=f(),le=class extends vh{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);let e=er.createInterface({input:this.in,escapeCodeTimeout:50});er.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(o,n)=>{let h=bh(n,s);h===!1?this._&&this._(o,n):typeof this[h]=="function"?this[h](n):this.bell()};this.close=()=>{this.out.write(yh.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(wh)}render(){this.onRender(xh),this.firstRender&&(this.firstRender=!1)}};ir.exports=le});var rr=u((yu,sr)=>{var wt=f(),Sh=E(),{erase:qh,cursor:rt}=g(),{style:ue,clear:ae,lines:Oh,figures:Mh}=y(),ce=class extends Sh{constructor(t={}){super(t),this.transform=ue.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=ae("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=wt.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!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 t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}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(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,e){let s=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${s}${t}${r}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),e=this.value.slice(this.cursor);this.value=`${t}${e}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor+1);this.value=`${t}${e}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0: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(){this.closed||(this.firstRender||(this.outputError&&this.out.write(rt.down(Oh(this.outputError,this.out.columns)-1)+ae(this.outputError,this.out.columns)),this.out.write(ae(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ue.symbol(this.done,this.aborted),wt.bold(this.msg),ue.delimiter(this.done),this.red?wt.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
56
+ `).reduce((t,e,s)=>t+`
57
+ ${s?" ":Mh.pointerSmall} ${wt.red().italic(e)}`,"")),this.out.write(qh.line+rt.to(0)+this.outputText+rt.save+this.outputError+rt.restore+rt.move(this.cursorOffset,0)))}};sr.exports=ce});var lr=u((xu,hr)=>{"use strict";var A=f(),Th=E(),{style:nr,clear:or,figures:yt,wrap:$h,entriesToDisplay:Ph}=y(),{cursor:_h}=g(),de=class extends Th{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((e,s)=>(typeof e=="string"&&(e={title:e,value:s}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?s:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=or("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].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
+ `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
59
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,e){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(_h.hide):this.out.write(or(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=Ph(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[nr.symbol(this.done,this.aborted),A.bold(this.msg),nr.delimiter(!1),this.done?this.selection.title:this.selection.disabled?A.yellow(this.warn):A.gray(this.hint)].join(" "),!this.done){this.outputText+=`
60
+ `;for(let s=t;s<e;s++){let r,o,n="",h=this.choices[s];s===t&&t>0?o=yt.arrowUp:s===e-1&&e<this.choices.length?o=yt.arrowDown:o=" ",h.disabled?(r=this.cursor===s?A.gray().underline(h.title):A.strikethrough().gray(h.title),o=(this.cursor===s?A.bold().gray(yt.pointer)+" ":" ")+o):(r=this.cursor===s?A.cyan().underline(h.title):h.title,o=(this.cursor===s?A.cyan(yt.pointer)+" ":" ")+o,h.description&&this.cursor===s&&(n=` - ${h.description}`,(o.length+r.length+n.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(n=`
61
+ `+$h(h.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${r}${A.gray(n)}
62
+ `}}this.out.write(this.outputText)}};hr.exports=de});var dr=u((Su,cr)=>{var xt=f(),Ih=E(),{style:ur,clear:Dh}=y(),{cursor:ar,erase:Ch}=g(),fe=class extends Ih{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.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
+ `),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()}_(t,e){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(ar.hide):this.out.write(Dh(this.outputText,this.out.columns)),super.render(),this.outputText=[ur.symbol(this.done,this.aborted),xt.bold(this.msg),ur.delimiter(this.done),this.value?this.inactive:xt.cyan().underline(this.inactive),xt.gray("/"),this.value?xt.cyan().underline(this.active):this.active].join(" "),this.out.write(Ch.line+ar.to(0)+this.outputText))}};cr.exports=fe});var M=u((qu,fr)=>{"use strict";var pe=class i{constructor({token:t,date:e,parts:s,locales:r}){this.token=t,this.date=e||new Date,this.parts=s||[this],this.locales=r||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((e,s)=>s>t&&e instanceof i)}setTo(t){}prev(){let t=[].concat(this.parts).reverse(),e=t.indexOf(this);return t.find((s,r)=>r>e&&s instanceof i)}toString(){return String(this.date)}};fr.exports=pe});var gr=u((Ou,pr)=>{"use strict";var Eh=M(),ge=class extends Eh{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}};pr.exports=ge});var br=u((Mu,mr)=>{"use strict";var Ah=M(),jh=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),me=class extends Ah{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),e=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+jh(t):this.token==="d"?e+1:this.token==="ddd"?this.locales.weekdaysShort[e]:this.token==="dddd"?this.locales.weekdays[e]:t}};mr.exports=me});var wr=u((Tu,vr)=>{"use strict";var Rh=M(),be=class extends Rh{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}};vr.exports=be});var xr=u(($u,yr)=>{"use strict";var kh=M(),ve=class extends kh{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};yr.exports=ve});var qr=u((Pu,Sr)=>{"use strict";var Fh=M(),we=class extends Fh{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}};Sr.exports=we});var Mr=u((_u,Or)=>{"use strict";var Hh=M(),ye=class extends Hh{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),e=this.token.length;return e===2?String(t+1).padStart(2,"0"):e===3?this.locales.monthsShort[t]:e===4?this.locales.months[t]:String(t+1)}};Or.exports=ye});var $r=u((Iu,Tr)=>{"use strict";var Yh=M(),xe=class extends Yh{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}};Tr.exports=xe});var _r=u((Du,Pr)=>{"use strict";var Vh=M(),Se=class extends Vh{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}};Pr.exports=Se});var Dr=u((Cu,Ir)=>{"use strict";Ir.exports={DatePart:M(),Meridiem:gr(),Day:br(),Hours:wr(),Milliseconds:xr(),Minutes:qr(),Month:Mr(),Seconds:$r(),Year:_r()}});var Fr=u((Eu,kr)=>{"use strict";var qe=f(),Lh=E(),{style:Cr,clear:Er,figures:Nh}=y(),{erase:Uh,cursor:Ar}=g(),{DatePart:jr,Meridiem:Gh,Day:Jh,Hours:Bh,Milliseconds:zh,Minutes:Zh,Month:Wh,Seconds:Kh,Year:Xh}=Dr(),Qh=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Rr={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new Jh(i),3:i=>new Wh(i),4:i=>new Xh(i),5:i=>new Gh(i),6:i=>new Bh(i),7:i=>new Zh(i),8:i=>new Kh(i),9:i=>new zh(i)},tl={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(",")},Oe=class extends Lh{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(tl,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Er("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let e;for(this.parts=[];e=Qh.exec(t);){let r=e.shift(),o=e.findIndex(n=>n!=null);this.parts.push(o in Rr?Rr[o]({token:e[o]||r,date:this.date,parts:this.parts,locales:this.locales}):e[o]||r)}let s=this.parts.reduce((r,o)=>(typeof o=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=o:r.push(o),r),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex(t=>t instanceof jr)),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 t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}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 t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex(e=>e instanceof jr)),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Ar.hide):this.out.write(Er(this.outputText,this.out.columns)),super.render(),this.outputText=[Cr.symbol(this.done,this.aborted),qe.bold(this.msg),Cr.delimiter(!1),this.parts.reduce((t,e,s)=>t.concat(s===this.cursor&&!this.done?qe.cyan().underline(e.toString()):e),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
67
+ `).reduce((t,e,s)=>t+`
68
+ ${s?" ":Nh.pointerSmall} ${qe.red().italic(e)}`,"")),this.out.write(Uh.line+Ar.to(0)+this.outputText))}};kr.exports=Oe});var Lr=u((Au,Vr)=>{var St=f(),el=E(),{cursor:qt,erase:il}=g(),{style:Me,figures:sl,clear:Hr,lines:rl}=y(),nl=/[0-9]/,Te=i=>i!==void 0,Yr=(i,t)=>{let e=Math.pow(10,t);return Math.round(i*e)/e},$e=class extends el{constructor(t={}){super(t),this.transform=Me.render(t.style),this.msg=t.message,this.initial=Te(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=Te(t.min)?t.min:-1/0,this.max=Te(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){!t&&t!==0?(this.placeholder=!0,this.rendered=St.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Yr(t,this.round)}`),this._value=Yr(t,this.round)),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t==="-"||t==="."&&this.float||nl.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==""?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
69
+ `),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let t=this.value;this.value=t!==""?t: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),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),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.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()}_(t,e){if(!this.valid(t))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=s,this.color="cyan",t===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(qt.down(rl(this.outputError,this.out.columns)-1)+Hr(this.outputError,this.out.columns)),this.out.write(Hr(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Me.symbol(this.done,this.aborted),St.bold(this.msg),Me.delimiter(this.done),!this.done||!this.done&&!this.placeholder?St[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
71
+ `).reduce((t,e,s)=>t+`
72
+ ${s?" ":sl.pointerSmall} ${St.red().italic(e)}`,"")),this.out.write(il.line+qt.to(0)+this.outputText+qt.save+this.outputError+qt.restore))}};Vr.exports=$e});var _e=u((ju,Gr)=>{"use strict";var T=f(),{cursor:ol}=g(),hl=E(),{clear:Nr,figures:H,style:Ur,wrap:ll,entriesToDisplay:ul}=y(),Pe=class extends hl{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map((e,s)=>(typeof e=="string"&&(e={title:e,value:s}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?s:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=Nr("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map(t=>!t.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(t=>t.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
73
+ `),this.close()}submit(){let t=this.value.filter(e=>e.selected);this.minSelected&&t.length<this.minSelected?(this.showMinError=!0,this.render()):(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(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let t=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(e=>e.selected=t),this.render()}_(t,e){if(t===" ")this.handleSpaceToggle();else if(t==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
75
+ Instructions:
76
+ ${H.arrowUp}/${H.arrowDown}: Highlight option
77
+ ${H.arrowLeft}/${H.arrowRight}/[space]: Toggle selection
78
+ `+(this.maxChoices===void 0?` a: Toggle all
79
+ `:"")+" enter/return: Complete answer":""}renderOption(t,e,s,r){let o=(e.selected?T.green(H.radioOn):H.radioOff)+" "+r+" ",n,h;return e.disabled?n=t===s?T.gray().underline(e.title):T.strikethrough().gray(e.title):(n=t===s?T.cyan().underline(e.title):e.title,t===s&&e.description&&(h=` - ${e.description}`,(o.length+n.length+h.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(h=`
80
+ `+ll(e.description,{margin:o.length,width:this.out.columns})))),o+n+T.gray(h||"")}paginateOptions(t){if(t.length===0)return T.red("No matches for this query.");let{startIndex:e,endIndex:s}=ul(this.cursor,t.length,this.optionsPerPage),r,o=[];for(let n=e;n<s;n++)n===e&&e>0?r=H.arrowUp:n===s-1&&s<t.length?r=H.arrowDown:r=" ",o.push(this.renderOption(this.cursor,t[n],n,r));return`
81
+ `+o.join(`
82
+ `)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");let t=[T.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(T.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ol.hide),super.render();let t=[Ur.symbol(this.done,this.aborted),T.bold(this.msg),Ur.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=T.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=Nr(t,this.out.columns)}};Gr.exports=Pe});var Wr=u((Ru,Zr)=>{"use strict";var nt=f(),al=E(),{erase:cl,cursor:Jr}=g(),{style:Ie,clear:Br,figures:De,wrap:dl,entriesToDisplay:fl}=y(),zr=(i,t)=>i[t]&&(i[t].value||i[t].title||i[t]),pl=(i,t)=>i[t]&&(i[t].title||i[t].value||i[t]),gl=(i,t)=>{let e=i.findIndex(s=>s.value===t||s.title===t);return e>-1?e:void 0},Ce=class extends al{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial=typeof t.initial=="number"?t.initial:gl(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=Ie.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Br("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return typeof this._fb=="number"?t=this.choices[this._fb]:typeof this._fb=="string"&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=zr(this.suggestions,t):this.value=this.fallback.value,this.fire()}async complete(t){let e=this.completing=this.suggest(this.input,this.choices),s=await e;if(this.completing!==e)return;this.suggestions=s.map((o,n,h)=>({title:pl(h,n),value:zr(h,n),description:o.description})),this.completing=!1;let r=Math.max(s.length-1,0);this.moveSelect(Math.min(r,this.select)),t&&t()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
83
+ `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
84
+ `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
85
+ `),this.close()}_(t,e){let s=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${s}${t}${r}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):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(t,e,s,r){let o,n=s?De.arrowUp:r?De.arrowDown:" ",h=e?nt.cyan().underline(t.title):t.title;return n=(e?nt.cyan(De.pointer)+" ":" ")+n,t.description&&(o=` - ${t.description}`,(n.length+h.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o=`
86
+ `+dl(t.description,{margin:3,width:this.out.columns}))),n+" "+h+nt.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Jr.hide):this.out.write(Br(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=fl(this.select,this.choices.length,this.limit);if(this.outputText=[Ie.symbol(this.done,this.aborted,this.exited),nt.bold(this.msg),Ie.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 s=this.suggestions.slice(t,e).map((r,o)=>this.renderOption(r,this.select===o+t,o===0&&t>0,o+t===e-1&&e<this.choices.length)).join(`
87
+ `);this.outputText+=`
88
+ `+(s||nt.gray(this.fallback.title))}this.out.write(cl.line+Jr.to(0)+this.outputText)}};Zr.exports=Ce});var tn=u((ku,Qr)=>{"use strict";var j=f(),{cursor:ml}=g(),bl=_e(),{clear:Kr,style:Xr,figures:J}=y(),Ee=class extends bl{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=Kr("",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(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let e=this.filteredOptions.findIndex(s=>s===t);this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){let t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
89
+ Instructions:
90
+ ${J.arrowUp}/${J.arrowDown}: Highlight option
91
+ ${J.arrowLeft}/${J.arrowRight}/[space]: Toggle selection
92
+ [a,b,c]/delete: Filter choices
93
+ enter/return: Complete answer
94
+ `:""}renderCurrentInput(){return`
95
+ Filtered results for: ${this.inputValue?this.inputValue:j.gray("Enter something to filter")}
96
+ `}renderOption(t,e,s){let r;return e.disabled?r=t===s?j.gray().underline(e.title):j.strikethrough().gray(e.title):r=t===s?j.cyan().underline(e.title):e.title,(e.selected?j.green(J.radioOn):J.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");let t=[j.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(j.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ml.hide),super.render();let t=[Xr.symbol(this.done,this.aborted),j.bold(this.msg),Xr.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=j.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=Kr(t,this.out.columns)}};Qr.exports=Ee});var on=u((Fu,nn)=>{var en=f(),vl=E(),{style:sn,clear:wl}=y(),{erase:yl,cursor:rn}=g(),Ae=class extends vl{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.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
+ `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
98
+ `),this.close()}_(t,e){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(rn.hide):this.out.write(wl(this.outputText,this.out.columns)),super.render(),this.outputText=[sn.symbol(this.done,this.aborted),en.bold(this.msg),sn.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:en.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(yl.line+rn.to(0)+this.outputText))}};nn.exports=Ae});var ln=u((Hu,hn)=>{"use strict";hn.exports={TextPrompt:rr(),SelectPrompt:lr(),TogglePrompt:dr(),DatePrompt:Fr(),NumberPrompt:Lr(),MultiselectPrompt:_e(),AutocompletePrompt:Wr(),AutocompleteMultiselectPrompt:tn(),ConfirmPrompt:on()}});var an=u(un=>{"use strict";var v=un,xl=ln(),Ot=i=>i;function $(i,t,e={}){return new Promise((s,r)=>{let o=new xl[i](t),n=e.onAbort||Ot,h=e.onSubmit||Ot,l=e.onExit||Ot;o.on("state",t.onState||Ot),o.on("submit",a=>s(h(a))),o.on("exit",a=>s(l(a))),o.on("abort",a=>r(n(a)))})}v.text=i=>$("TextPrompt",i);v.password=i=>(i.style="password",v.text(i));v.invisible=i=>(i.style="invisible",v.text(i));v.number=i=>$("NumberPrompt",i);v.date=i=>$("DatePrompt",i);v.confirm=i=>$("ConfirmPrompt",i);v.list=i=>{let t=i.separator||",";return $("TextPrompt",i,{onSubmit:e=>e.split(t).map(s=>s.trim())})};v.toggle=i=>$("TogglePrompt",i);v.select=i=>$("SelectPrompt",i);v.multiselect=i=>{i.choices=[].concat(i.choices||[]);let t=e=>e.filter(s=>s.selected).map(s=>s.value);return $("MultiselectPrompt",i,{onAbort:t,onSubmit:t})};v.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let t=e=>e.filter(s=>s.selected).map(s=>s.value);return $("AutocompleteMultiselectPrompt",i,{onAbort:t,onSubmit:t})};var Sl=(i,t)=>Promise.resolve(t.filter(e=>e.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));v.autocomplete=i=>(i.suggest=i.suggest||Sl,i.choices=[].concat(i.choices||[]),$("AutocompletePrompt",i))});var fn=u((Vu,dn)=>{"use strict";var je=an(),ql=["suggest","format","onState","validate","onRender","type"],cn=()=>{};async function Y(i=[],{onSubmit:t=cn,onCancel:e=cn}={}){let s={},r=Y._override||{};i=[].concat(i);let o,n,h,l,a,B,z=async(m,x,ot=!1)=>{if(!(!ot&&m.validate&&m.validate(x)!==!0))return m.format?await m.format(x,s):x};for(n of i)if({name:l,type:a}=n,typeof a=="function"&&(a=await a(o,{...s},n),n.type=a),!!a){for(let m in n){if(ql.includes(m))continue;let x=n[m];n[m]=typeof x=="function"?await x(o,{...s},B):x}if(B=n,typeof n.message!="string")throw new Error("prompt message is required");if({name:l,type:a}=n,je[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[n.name]!==void 0&&(o=await z(n,r[n.name]),o!==void 0)){s[l]=o;continue}try{o=Y._injected?Ol(Y._injected,n.initial):await je[a](n),s[l]=o=await z(n,o,!0),h=await t(n,o,s)}catch{h=!await e(n,s)}if(h)return s}return s}function Ol(i,t){let e=i.shift();if(e instanceof Error)throw e;return e===void 0?t:e}function Ml(i){Y._injected=(Y._injected||[]).concat(i)}function Tl(i){Y._override=Object.assign({},i)}dn.exports=Object.assign(Y,{prompt:Y,prompts:je,inject:Ml,override:Tl})});var gn=u((Lu,pn)=>{function $l(i){i=(Array.isArray(i)?i:i.split(".")).map(Number);let t=0,e=process.versions.node.split(".").map(Number);for(;t<i.length;t++){if(e[t]>i[t])return!1;if(i[t]>e[t])return!0}return!1}pn.exports=$l("8.6.0")?Fs():fn()});var Pl=Sn(gn(),1);import Uu from"node:path";var Gu="cc";var export_prompts=Pl.default;export{Gu as default,Uu as path,export_prompts as prompts};
File without changes
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ var c="cc";export{c as default};
File without changes
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ console.log("kikoo");