create-enchilada 1.0.0 → 1.0.1

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,104 +1,104 @@
1
- import Mt from"readline";import Rt from"events";import{fileURLToPath as Pt}from"node:url";import J from"node:path";import oe,{argv as hi}from"node:process";import ui from"node:os";import Ct from"node:tty";import{readFileSync as ai,writeFileSync as ci,existsSync as Dt,mkdirSync as di}from"fs";import{readdirSync as fi,lstatSync as pi,mkdirSync as mi,copyFileSync as gi}from"node:fs";function Et(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var le={},he,_t;function E(){if(_t)return he;_t=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:r,TERM:i}=process.env,t={enabled:!r&&i!=="dumb"&&e!=="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 o(v,h){let a=0,n,d="",c="";for(;a<v.length;a++)n=v[a],d+=n.open,c+=n.close,h.includes(n.close)&&(h=h.replace(n.rgx,n.close+n.open));return d+h+c}function m(v,h){let a={has:v,keys:h};return a.reset=t.reset.bind(a),a.bold=t.bold.bind(a),a.dim=t.dim.bind(a),a.italic=t.italic.bind(a),a.underline=t.underline.bind(a),a.inverse=t.inverse.bind(a),a.hidden=t.hidden.bind(a),a.strikethrough=t.strikethrough.bind(a),a.black=t.black.bind(a),a.red=t.red.bind(a),a.green=t.green.bind(a),a.yellow=t.yellow.bind(a),a.blue=t.blue.bind(a),a.magenta=t.magenta.bind(a),a.cyan=t.cyan.bind(a),a.white=t.white.bind(a),a.gray=t.gray.bind(a),a.grey=t.grey.bind(a),a.bgBlack=t.bgBlack.bind(a),a.bgRed=t.bgRed.bind(a),a.bgGreen=t.bgGreen.bind(a),a.bgYellow=t.bgYellow.bind(a),a.bgBlue=t.bgBlue.bind(a),a.bgMagenta=t.bgMagenta.bind(a),a.bgCyan=t.bgCyan.bind(a),a.bgWhite=t.bgWhite.bind(a),a}function s(v,h){let a={open:`\x1B[${v}m`,close:`\x1B[${h}m`,rgx:new RegExp(`\\x1b\\[${h}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(v)||(this.has.push(v),this.keys.push(a)),n===void 0?this:t.enabled?o(this.keys,n+""):n+""):n===void 0?m([v],[a]):t.enabled?o([a],n+""):n+""}}return he=t,he}var ue,At;function vi(){return At||(At=1,ue=(e,r)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(r){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),ue}var ae,qt;function ce(){return qt||(qt=1,ae=e=>{const r=["[\\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("|"),i=new RegExp(r,"g");return typeof e=="string"?e.replace(i,""):e}),ae}var de,It;function _(){if(It)return de;It=1;const e="\x1B",r=`${e}[`,i="\x07",t={to(s,v){return v?`${r}${v+1};${s+1}H`:`${r}${s+1}G`},move(s,v){let h="";return s<0?h+=`${r}${-s}D`:s>0&&(h+=`${r}${s}C`),v<0?h+=`${r}${-v}A`:v>0&&(h+=`${r}${v}B`),h},up:(s=1)=>`${r}${s}A`,down:(s=1)=>`${r}${s}B`,forward:(s=1)=>`${r}${s}C`,backward:(s=1)=>`${r}${s}D`,nextLine:(s=1)=>`${r}E`.repeat(s),prevLine:(s=1)=>`${r}F`.repeat(s),left:`${r}G`,hide:`${r}?25l`,show:`${r}?25h`,save:`${e}7`,restore:`${e}8`},o={up:(s=1)=>`${r}S`.repeat(s),down:(s=1)=>`${r}T`.repeat(s)},m={screen:`${r}2J`,up:(s=1)=>`${r}1J`.repeat(s),down:(s=1)=>`${r}J`.repeat(s),line:`${r}2K`,lineEnd:`${r}K`,lineStart:`${r}1K`,lines(s){let v="";for(let h=0;h<s;h++)v+=this.line+(h<s-1?t.up():"");return s&&(v+=t.left),v}};return de={cursor:t,scroll:o,erase:m,beep:i},de}var fe,jt;function bi(){if(jt)return fe;jt=1;function e(h,a){var n=typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(!n){if(Array.isArray(h)||(n=r(h))||a){n&&(h=n);var d=0,c=function(){};return{s:c,n:function(){return d>=h.length?{done:!0}:{done:!1,value:h[d++]}},e:function(f){throw f},f:c}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l=!0,u=!1,y;return{s:function(){n=n.call(h)},n:function(){var f=n.next();return l=f.done,f},e:function(f){u=!0,y=f},f:function(){try{!l&&n.return!=null&&n.return()}finally{if(u)throw y}}}}function r(h,a){if(h){if(typeof h=="string")return i(h,a);var n=Object.prototype.toString.call(h).slice(8,-1);if(n==="Object"&&h.constructor&&(n=h.constructor.name),n==="Map"||n==="Set")return Array.from(h);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(h,a)}}function i(h,a){(a==null||a>h.length)&&(a=h.length);for(var n=0,d=new Array(a);n<a;n++)d[n]=h[n];return d}const t=ce(),o=_(),m=o.erase,s=o.cursor,v=h=>[...t(h)].length;return fe=function(h,a){if(!a)return m.line+s.to(0);let n=0;const d=h.split(/\r?\n/);var c=e(d),l;try{for(c.s();!(l=c.n()).done;){let u=l.value;n+=1+Math.floor(Math.max(v(u)-1,0)/a)}}catch(u){c.e(u)}finally{c.f()}return m.lines(n)},fe}var pe,Ft;function Nt(){if(Ft)return pe;Ft=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},r={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return pe=process.platform==="win32"?r:e,pe}var me,Lt;function yi(){if(Lt)return me;Lt=1;const e=E(),r=Nt(),i=Object.freeze({password:{scale:1,render:h=>"*".repeat(h.length)},emoji:{scale:2,render:h=>"\u{1F603}".repeat(h.length)},invisible:{scale:0,render:h=>""},default:{scale:1,render:h=>`${h}`}}),t=h=>i[h]||i.default,o=Object.freeze({aborted:e.red(r.cross),done:e.green(r.tick),exited:e.yellow(r.cross),default:e.cyan("?")});return me={styles:i,render:t,symbols:o,symbol:(h,a,n)=>a?o.aborted:n?o.exited:h?o.done:o.default,delimiter:h=>e.gray(h?r.ellipsis:r.pointerSmall),item:(h,a)=>e.gray(h?a?r.pointerSmall:"+":r.line)},me}var ge,Yt;function wi(){if(Yt)return ge;Yt=1;const e=ce();return ge=function(r,i){let t=String(e(r)||"").split(/\r?\n/);return i?t.map(o=>Math.ceil(o.length/i)).reduce((o,m)=>o+m):t.length},ge}var ve,kt;function xi(){return kt||(kt=1,ve=(e,r={})=>{const i=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"",t=r.width;return(e||"").split(/\r?\n/g).map(o=>o.split(/\s+/g).reduce((m,s)=>(s.length+i.length>=t||m[m.length-1].length+s.length+1<t?m[m.length-1]+=` ${s}`:m.push(`${i}${s}`),m),[i]).join(`
1
+ import Pt from"readline";import Ct from"events";import{fileURLToPath as Dt}from"node:url";import J from"node:path";import oe,{argv as ai}from"node:process";import ci from"node:os";import Et from"node:tty";import{readFileSync as di,writeFileSync as fi,existsSync as _t,mkdirSync as pi}from"fs";import{readdirSync as mi,lstatSync as gi,mkdirSync as vi,copyFileSync as bi}from"node:fs";function qt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var le={},he,At;function q(){if(At)return he;At=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:r,TERM:o}=process.env,t={enabled:!r&&o!=="dumb"&&e!=="0",reset:i(0,0),bold:i(1,22),dim:i(2,22),italic:i(3,23),underline:i(4,24),inverse:i(7,27),hidden:i(8,28),strikethrough:i(9,29),black:i(30,39),red:i(31,39),green:i(32,39),yellow:i(33,39),blue:i(34,39),magenta:i(35,39),cyan:i(36,39),white:i(37,39),gray:i(90,39),grey:i(90,39),bgBlack:i(40,49),bgRed:i(41,49),bgGreen:i(42,49),bgYellow:i(43,49),bgBlue:i(44,49),bgMagenta:i(45,49),bgCyan:i(46,49),bgWhite:i(47,49)};function s(b,l){let a=0,n,m="",f="";for(;a<b.length;a++)n=b[a],m+=n.open,f+=n.close,l.includes(n.close)&&(l=l.replace(n.rgx,n.close+n.open));return m+l+f}function c(b,l){let a={has:b,keys:l};return a.reset=t.reset.bind(a),a.bold=t.bold.bind(a),a.dim=t.dim.bind(a),a.italic=t.italic.bind(a),a.underline=t.underline.bind(a),a.inverse=t.inverse.bind(a),a.hidden=t.hidden.bind(a),a.strikethrough=t.strikethrough.bind(a),a.black=t.black.bind(a),a.red=t.red.bind(a),a.green=t.green.bind(a),a.yellow=t.yellow.bind(a),a.blue=t.blue.bind(a),a.magenta=t.magenta.bind(a),a.cyan=t.cyan.bind(a),a.white=t.white.bind(a),a.gray=t.gray.bind(a),a.grey=t.grey.bind(a),a.bgBlack=t.bgBlack.bind(a),a.bgRed=t.bgRed.bind(a),a.bgGreen=t.bgGreen.bind(a),a.bgYellow=t.bgYellow.bind(a),a.bgBlue=t.bgBlue.bind(a),a.bgMagenta=t.bgMagenta.bind(a),a.bgCyan=t.bgCyan.bind(a),a.bgWhite=t.bgWhite.bind(a),a}function i(b,l){let a={open:`\x1B[${b}m`,close:`\x1B[${l}m`,rgx:new RegExp(`\\x1b\\[${l}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(b)||(this.has.push(b),this.keys.push(a)),n===void 0?this:t.enabled?s(this.keys,n+""):n+""):n===void 0?c([b],[a]):t.enabled?s([a],n+""):n+""}}return he=t,he}var ue,It;function yi(){return It||(It=1,ue=(e,r)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(r){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),ue}var ae,jt;function ce(){return jt||(jt=1,ae=e=>{const r=["[\\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("|"),o=new RegExp(r,"g");return typeof e=="string"?e.replace(o,""):e}),ae}var de,Ft;function A(){if(Ft)return de;Ft=1;const e="\x1B",r=`${e}[`,o="\x07",t={to(i,b){return b?`${r}${b+1};${i+1}H`:`${r}${i+1}G`},move(i,b){let l="";return i<0?l+=`${r}${-i}D`:i>0&&(l+=`${r}${i}C`),b<0?l+=`${r}${-b}A`:b>0&&(l+=`${r}${b}B`),l},up:(i=1)=>`${r}${i}A`,down:(i=1)=>`${r}${i}B`,forward:(i=1)=>`${r}${i}C`,backward:(i=1)=>`${r}${i}D`,nextLine:(i=1)=>`${r}E`.repeat(i),prevLine:(i=1)=>`${r}F`.repeat(i),left:`${r}G`,hide:`${r}?25l`,show:`${r}?25h`,save:`${e}7`,restore:`${e}8`},s={up:(i=1)=>`${r}S`.repeat(i),down:(i=1)=>`${r}T`.repeat(i)},c={screen:`${r}2J`,up:(i=1)=>`${r}1J`.repeat(i),down:(i=1)=>`${r}J`.repeat(i),line:`${r}2K`,lineEnd:`${r}K`,lineStart:`${r}1K`,lines(i){let b="";for(let l=0;l<i;l++)b+=this.line+(l<i-1?t.up():"");return i&&(b+=t.left),b}};return de={cursor:t,scroll:s,erase:c,beep:o},de}var fe,Nt;function wi(){if(Nt)return fe;Nt=1;function e(l,a){var n=typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(!n){if(Array.isArray(l)||(n=r(l))||a){n&&(l=n);var m=0,f=function(){};return{s:f,n:function(){return m>=l.length?{done:!0}:{done:!1,value:l[m++]}},e:function(d){throw d},f}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var h=!0,u=!1,v;return{s:function(){n=n.call(l)},n:function(){var d=n.next();return h=d.done,d},e:function(d){u=!0,v=d},f:function(){try{!h&&n.return!=null&&n.return()}finally{if(u)throw v}}}}function r(l,a){if(l){if(typeof l=="string")return o(l,a);var n=Object.prototype.toString.call(l).slice(8,-1);if(n==="Object"&&l.constructor&&(n=l.constructor.name),n==="Map"||n==="Set")return Array.from(l);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(l,a)}}function o(l,a){(a==null||a>l.length)&&(a=l.length);for(var n=0,m=new Array(a);n<a;n++)m[n]=l[n];return m}const t=ce(),s=A(),c=s.erase,i=s.cursor,b=l=>[...t(l)].length;return fe=function(l,a){if(!a)return c.line+i.to(0);let n=0;const m=l.split(/\r?\n/);var f=e(m),h;try{for(f.s();!(h=f.n()).done;){let u=h.value;n+=1+Math.floor(Math.max(b(u)-1,0)/a)}}catch(u){f.e(u)}finally{f.f()}return c.lines(n)},fe}var pe,Lt;function Yt(){if(Lt)return pe;Lt=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},r={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return pe=process.platform==="win32"?r:e,pe}var me,kt;function xi(){if(kt)return me;kt=1;const e=q(),r=Yt(),o=Object.freeze({password:{scale:1,render:l=>"*".repeat(l.length)},emoji:{scale:2,render:l=>"\u{1F603}".repeat(l.length)},invisible:{scale:0,render:l=>""},default:{scale:1,render:l=>`${l}`}}),t=l=>o[l]||o.default,s=Object.freeze({aborted:e.red(r.cross),done:e.green(r.tick),exited:e.yellow(r.cross),default:e.cyan("?")});return me={styles:o,render:t,symbols:s,symbol:(l,a,n)=>a?s.aborted:n?s.exited:l?s.done:s.default,delimiter:l=>e.gray(l?r.ellipsis:r.pointerSmall),item:(l,a)=>e.gray(l?a?r.pointerSmall:"+":r.line)},me}var ge,Bt;function Si(){if(Bt)return ge;Bt=1;const e=ce();return ge=function(r,o){let t=String(e(r)||"").split(/\r?\n/);return o?t.map(s=>Math.ceil(s.length/o)).reduce((s,c)=>s+c):t.length},ge}var ve,Vt;function $i(){return Vt||(Vt=1,ve=(e,r={})=>{const o=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"",t=r.width;return(e||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((c,i)=>(i.length+o.length>=t||c[c.length-1].length+i.length+1<t?c[c.length-1]+=` ${i}`:c.push(`${o}${i}`),c),[o]).join(`
3
3
  `)).join(`
4
- `)}),ve}var be,Bt;function Si(){return Bt||(Bt=1,be=(e,r,i)=>{i=i||r;let t=Math.min(r-i,e-Math.floor(i/2));t<0&&(t=0);let o=Math.min(t+i,r);return{startIndex:t,endIndex:o}}),be}var ye,Vt;function k(){return Vt||(Vt=1,ye={action:vi(),clear:bi(),style:yi(),strip:ce(),figures:Nt(),lines:wi(),wrap:xi(),entriesToDisplay:Si()}),ye}var we,Ht;function W(){if(Ht)return we;Ht=1;const e=Mt,r=k(),i=r.action,t=Rt,o=_(),m=o.beep,s=o.cursor,v=E();class h extends t{constructor(n={}){super(),this.firstRender=!0,this.in=n.stdin||process.stdin,this.out=n.stdout||process.stdout,this.onRender=(n.onRender||(()=>{})).bind(this);const d=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,d),this.in.isTTY&&this.in.setRawMode(!0);const c=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,l=(u,y)=>{let g=i(y,c);g===!1?this._&&this._(u,y):typeof this[g]=="function"?this[g](y):this.bell()};this.close=()=>{this.out.write(s.show),this.in.removeListener("keypress",l),this.in.isTTY&&this.in.setRawMode(!1),d.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",l)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(m)}render(){this.onRender(v),this.firstRender&&(this.firstRender=!1)}}return we=h,we}var xe,Ut;function $i(){if(Ut)return xe;Ut=1;function e(l,u,y,g,f,p,b){try{var w=l[p](b),x=w.value}catch(S){y(S);return}w.done?u(x):Promise.resolve(x).then(g,f)}function r(l){return function(){var u=this,y=arguments;return new Promise(function(g,f){var p=l.apply(u,y);function b(x){e(p,g,f,b,w,"next",x)}function w(x){e(p,g,f,b,w,"throw",x)}b(void 0)})}}const i=E(),t=W(),o=_(),m=o.erase,s=o.cursor,v=k(),h=v.style,a=v.clear,n=v.lines,d=v.figures;class c extends t{constructor(u={}){super(u),this.transform=h.render(u.style),this.scale=this.transform.scale,this.msg=u.message,this.initial=u.initial||"",this.validator=u.validate||(()=>!0),this.value="",this.errorMsg=u.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=a("",this.out.columns),this.render()}set value(u){!u&&this.initial?(this.placeholder=!0,this.rendered=i.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(u)),this._value=u,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(`
5
- `),this.close()}validate(){var u=this;return r(function*(){let y=yield u.validator(u.value);typeof y=="string"&&(u.errorMsg=y,y=!1),u.error=!y})()}submit(){var u=this;return r(function*(){if(u.value=u.value||u.initial,u.cursorOffset=0,u.cursor=u.rendered.length,yield u.validate(),u.error){u.red=!0,u.fire(),u.render();return}u.done=!0,u.aborted=!1,u.fire(),u.render(),u.out.write(`
6
- `),u.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(u){this.placeholder||(this.cursor=this.cursor+u,this.cursorOffset+=u)}_(u,y){let g=this.value.slice(0,this.cursor),f=this.value.slice(this.cursor);this.value=`${g}${u}${f}`,this.red=!1,this.cursor=this.placeholder?0:g.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let u=this.value.slice(0,this.cursor-1),y=this.value.slice(this.cursor);this.value=`${u}${y}`,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 u=this.value.slice(0,this.cursor),y=this.value.slice(this.cursor+1);this.value=`${u}${y}`,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(s.down(n(this.outputError,this.out.columns)-1)+a(this.outputError,this.out.columns)),this.out.write(a(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[h.symbol(this.done,this.aborted),i.bold(this.msg),h.delimiter(this.done),this.red?i.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
7
- `).reduce((u,y,g)=>u+`
8
- ${g?" ":d.pointerSmall} ${i.red().italic(y)}`,"")),this.out.write(m.line+s.to(0)+this.outputText+s.save+this.outputError+s.restore+s.move(this.cursorOffset,0)))}}return xe=c,xe}var Se,Gt;function Ti(){if(Gt)return Se;Gt=1;const e=E(),r=W(),i=k(),t=i.style,o=i.clear,m=i.figures,s=i.wrap,v=i.entriesToDisplay,h=_(),a=h.cursor;class n extends r{constructor(c={}){super(c),this.msg=c.message,this.hint=c.hint||"- Use arrow-keys. Return to submit.",this.warn=c.warn||"- This option is disabled",this.cursor=c.initial||0,this.choices=c.choices.map((l,u)=>(typeof l=="string"&&(l={title:l,value:u}),{title:l&&(l.title||l.value||l),value:l&&(l.value===void 0?u:l.value),description:l&&l.description,selected:l&&l.selected,disabled:l&&l.disabled})),this.optionsPerPage=c.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=o("",this.out.columns),this.render()}moveCursor(c){this.cursor=c,this.value=this.choices[c].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(`
4
+ `)}),ve}var be,Ht;function Ti(){return Ht||(Ht=1,be=(e,r,o)=>{o=o||r;let t=Math.min(r-o,e-Math.floor(o/2));t<0&&(t=0);let s=Math.min(t+o,r);return{startIndex:t,endIndex:s}}),be}var ye,Ut;function k(){return Ut||(Ut=1,ye={action:yi(),clear:wi(),style:xi(),strip:ce(),figures:Yt(),lines:Si(),wrap:$i(),entriesToDisplay:Ti()}),ye}var we,Gt;function W(){if(Gt)return we;Gt=1;const e=Pt,r=k(),o=r.action,t=Ct,s=A(),c=s.beep,i=s.cursor,b=q();class l extends t{constructor(n={}){super(),this.firstRender=!0,this.in=n.stdin||process.stdin,this.out=n.stdout||process.stdout,this.onRender=(n.onRender||(()=>{})).bind(this);const m=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,m),this.in.isTTY&&this.in.setRawMode(!0);const f=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,h=(u,v)=>{let g=o(v,f);g===!1?this._&&this._(u,v):typeof this[g]=="function"?this[g](v):this.bell()};this.close=()=>{this.out.write(i.show),this.in.removeListener("keypress",h),this.in.isTTY&&this.in.setRawMode(!1),m.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",h)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(c)}render(){this.onRender(b),this.firstRender&&(this.firstRender=!1)}}return we=l,we}var xe,Jt;function Mi(){if(Jt)return xe;Jt=1;function e(h,u,v,g,d,p,y){try{var w=h[p](y),x=w.value}catch($){v($);return}w.done?u(x):Promise.resolve(x).then(g,d)}function r(h){return function(){var u=this,v=arguments;return new Promise(function(g,d){var p=h.apply(u,v);function y(x){e(p,g,d,y,w,"next",x)}function w(x){e(p,g,d,y,w,"throw",x)}y(void 0)})}}const o=q(),t=W(),s=A(),c=s.erase,i=s.cursor,b=k(),l=b.style,a=b.clear,n=b.lines,m=b.figures;class f extends t{constructor(u={}){super(u),this.transform=l.render(u.style),this.scale=this.transform.scale,this.msg=u.message,this.initial=u.initial||"",this.validator=u.validate||(()=>!0),this.value="",this.errorMsg=u.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=a("",this.out.columns),this.render()}set value(u){!u&&this.initial?(this.placeholder=!0,this.rendered=o.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(u)),this._value=u,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(`
5
+ `),this.close()}validate(){var u=this;return r(function*(){let v=yield u.validator(u.value);typeof v=="string"&&(u.errorMsg=v,v=!1),u.error=!v})()}submit(){var u=this;return r(function*(){if(u.value=u.value||u.initial,u.cursorOffset=0,u.cursor=u.rendered.length,yield u.validate(),u.error){u.red=!0,u.fire(),u.render();return}u.done=!0,u.aborted=!1,u.fire(),u.render(),u.out.write(`
6
+ `),u.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(u){this.placeholder||(this.cursor=this.cursor+u,this.cursorOffset+=u)}_(u,v){let g=this.value.slice(0,this.cursor),d=this.value.slice(this.cursor);this.value=`${g}${u}${d}`,this.red=!1,this.cursor=this.placeholder?0:g.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let u=this.value.slice(0,this.cursor-1),v=this.value.slice(this.cursor);this.value=`${u}${v}`,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 u=this.value.slice(0,this.cursor),v=this.value.slice(this.cursor+1);this.value=`${u}${v}`,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(i.down(n(this.outputError,this.out.columns)-1)+a(this.outputError,this.out.columns)),this.out.write(a(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
7
+ `).reduce((u,v,g)=>u+`
8
+ ${g?" ":m.pointerSmall} ${o.red().italic(v)}`,"")),this.out.write(c.line+i.to(0)+this.outputText+i.save+this.outputError+i.restore+i.move(this.cursorOffset,0)))}}return xe=f,xe}var Se,Wt;function Oi(){if(Wt)return Se;Wt=1;const e=q(),r=W(),o=k(),t=o.style,s=o.clear,c=o.figures,i=o.wrap,b=o.entriesToDisplay,l=A(),a=l.cursor;class n extends r{constructor(f={}){super(f),this.msg=f.message,this.hint=f.hint||"- Use arrow-keys. Return to submit.",this.warn=f.warn||"- This option is disabled",this.cursor=f.initial||0,this.choices=f.choices.map((h,u)=>(typeof h=="string"&&(h={title:h,value:u}),{title:h&&(h.title||h.value||h),value:h&&(h.value===void 0?u:h.value),description:h&&h.description,selected:h&&h.selected,disabled:h&&h.disabled})),this.optionsPerPage=f.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=s("",this.out.columns),this.render()}moveCursor(f){this.cursor=f,this.value=this.choices[f].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(`
9
9
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
10
- `),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()}_(c,l){if(c===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(a.hide):this.out.write(o(this.outputText,this.out.columns)),super.render();let c=v(this.cursor,this.choices.length,this.optionsPerPage),l=c.startIndex,u=c.endIndex;if(this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
11
- `;for(let y=l;y<u;y++){let g,f,p="",b=this.choices[y];y===l&&l>0?f=m.arrowUp:y===u-1&&u<this.choices.length?f=m.arrowDown:f=" ",b.disabled?(g=this.cursor===y?e.gray().underline(b.title):e.strikethrough().gray(b.title),f=(this.cursor===y?e.bold().gray(m.pointer)+" ":" ")+f):(g=this.cursor===y?e.cyan().underline(b.title):b.title,f=(this.cursor===y?e.cyan(m.pointer)+" ":" ")+f,b.description&&this.cursor===y&&(p=` - ${b.description}`,(f.length+g.length+p.length>=this.out.columns||b.description.split(/\r?\n/).length>1)&&(p=`
12
- `+s(b.description,{margin:3,width:this.out.columns})))),this.outputText+=`${f} ${g}${e.gray(p)}
13
- `}}this.out.write(this.outputText)}}return Se=n,Se}var $e,Jt;function Oi(){if(Jt)return $e;Jt=1;const e=E(),r=W(),i=k(),t=i.style,o=i.clear,m=_(),s=m.cursor,v=m.erase;class h extends r{constructor(n={}){super(n),this.msg=n.message,this.value=!!n.initial,this.active=n.active||"on",this.inactive=n.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(`
10
+ `),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()}_(f,h){if(f===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(a.hide):this.out.write(s(this.outputText,this.out.columns)),super.render();let f=b(this.cursor,this.choices.length,this.optionsPerPage),h=f.startIndex,u=f.endIndex;if(this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
11
+ `;for(let v=h;v<u;v++){let g,d,p="",y=this.choices[v];v===h&&h>0?d=c.arrowUp:v===u-1&&u<this.choices.length?d=c.arrowDown:d=" ",y.disabled?(g=this.cursor===v?e.gray().underline(y.title):e.strikethrough().gray(y.title),d=(this.cursor===v?e.bold().gray(c.pointer)+" ":" ")+d):(g=this.cursor===v?e.cyan().underline(y.title):y.title,d=(this.cursor===v?e.cyan(c.pointer)+" ":" ")+d,y.description&&this.cursor===v&&(p=` - ${y.description}`,(d.length+g.length+p.length>=this.out.columns||y.description.split(/\r?\n/).length>1)&&(p=`
12
+ `+i(y.description,{margin:3,width:this.out.columns})))),this.outputText+=`${d} ${g}${e.gray(p)}
13
+ `}}this.out.write(this.outputText)}}return Se=n,Se}var $e,zt;function Ri(){if(zt)return $e;zt=1;const e=q(),r=W(),o=k(),t=o.style,s=o.clear,c=A(),i=c.cursor,b=c.erase;class l extends r{constructor(n={}){super(n),this.msg=n.message,this.value=!!n.initial,this.active=n.active||"on",this.inactive=n.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(`
14
14
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
15
- `),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()}_(n,d){if(n===" ")this.value=!this.value;else if(n==="1")this.value=!0;else if(n==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(v.line+s.to(0)+this.outputText))}}return $e=h,$e}var Te,Wt;function U(){if(Wt)return Te;Wt=1;class e{constructor({token:i,date:t,parts:o,locales:m}){this.token=i,this.date=t||new Date,this.parts=o||[this],this.locales=m||{}}up(){}down(){}next(){const i=this.parts.indexOf(this);return this.parts.find((t,o)=>o>i&&t instanceof e)}setTo(i){}prev(){let i=[].concat(this.parts).reverse();const t=i.indexOf(this);return i.find((o,m)=>m>t&&o instanceof e)}toString(){return String(this.date)}}return Te=e,Te}var Oe,zt;function Mi(){if(zt)return Oe;zt=1;const e=U();class r extends e{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}}return Oe=r,Oe}var Me,Kt;function Ri(){if(Kt)return Me;Kt=1;const e=U(),r=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class i extends e{constructor(o={}){super(o)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(o){this.date.setDate(parseInt(o.substr(-2)))}toString(){let o=this.date.getDate(),m=this.date.getDay();return this.token==="DD"?String(o).padStart(2,"0"):this.token==="Do"?o+r(o):this.token==="d"?m+1:this.token==="ddd"?this.locales.weekdaysShort[m]:this.token==="dddd"?this.locales.weekdays[m]:o}}return Me=i,Me}var Re,Zt;function Pi(){if(Zt)return Re;Zt=1;const e=U();class r extends e{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}}return Re=r,Re}var Pe,Xt;function Ci(){if(Xt)return Pe;Xt=1;const e=U();class r extends e{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)}}return Pe=r,Pe}var Ce,Qt;function Di(){if(Qt)return Ce;Qt=1;const e=U();class r extends e{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}}return Ce=r,Ce}var De,er;function Ei(){if(er)return De;er=1;const e=U();class r extends e{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(),o=this.token.length;return o===2?String(t+1).padStart(2,"0"):o===3?this.locales.monthsShort[t]:o===4?this.locales.months[t]:String(t+1)}}return De=r,De}var Ee,tr;function _i(){if(tr)return Ee;tr=1;const e=U();class r extends e{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}}return Ee=r,Ee}var _e,rr;function Ai(){if(rr)return _e;rr=1;const e=U();class r extends e{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}}return _e=r,_e}var Ae,ir;function qi(){return ir||(ir=1,Ae={DatePart:U(),Meridiem:Mi(),Day:Ri(),Hours:Pi(),Milliseconds:Ci(),Minutes:Di(),Month:Ei(),Seconds:_i(),Year:Ai()}),Ae}var qe,sr;function Ii(){if(sr)return qe;sr=1;function e($,O,P,F,A,I,Y){try{var N=$[I](Y),j=N.value}catch(X){P(X);return}N.done?O(j):Promise.resolve(j).then(F,A)}function r($){return function(){var O=this,P=arguments;return new Promise(function(F,A){var I=$.apply(O,P);function Y(j){e(I,F,A,Y,N,"next",j)}function N(j){e(I,F,A,Y,N,"throw",j)}Y(void 0)})}}const i=E(),t=W(),o=k(),m=o.style,s=o.clear,v=o.figures,h=_(),a=h.erase,n=h.cursor,d=qi(),c=d.DatePart,l=d.Meridiem,u=d.Day,y=d.Hours,g=d.Milliseconds,f=d.Minutes,p=d.Month,b=d.Seconds,w=d.Year,x=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,S={1:({token:$})=>$.replace(/\\(.)/g,"$1"),2:$=>new u($),3:$=>new p($),4:$=>new w($),5:$=>new l($),6:$=>new y($),7:$=>new f($),8:$=>new b($),9:$=>new g($)},T={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 M extends t{constructor(O={}){super(O),this.msg=O.message,this.cursor=0,this.typed="",this.locales=Object.assign(T,O.locales),this._date=O.initial||new Date,this.errorMsg=O.error||"Please Enter A Valid Value",this.validator=O.validate||(()=>!0),this.mask=O.mask||"YYYY-MM-DD HH:mm:ss",this.clear=s("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(O){O&&this._date.setTime(O.getTime())}set mask(O){let P;for(this.parts=[];P=x.exec(O);){let A=P.shift(),I=P.findIndex(Y=>Y!=null);this.parts.push(I in S?S[I]({token:P[I]||A,date:this.date,parts:this.parts,locales:this.locales}):P[I]||A)}let F=this.parts.reduce((A,I)=>(typeof I=="string"&&typeof A[A.length-1]=="string"?A[A.length-1]+=I:A.push(I),A),[]);this.parts.splice(0),this.parts.push(...F),this.reset()}moveCursor(O){this.typed="",this.cursor=O,this.fire()}reset(){this.moveCursor(this.parts.findIndex(O=>O instanceof c)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
16
- `),this.close()}validate(){var O=this;return r(function*(){let P=yield O.validator(O.value);typeof P=="string"&&(O.errorMsg=P,P=!1),O.error=!P})()}submit(){var O=this;return r(function*(){if(yield O.validate(),O.error){O.color="red",O.fire(),O.render();return}O.done=!0,O.aborted=!1,O.fire(),O.render(),O.out.write(`
17
- `),O.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let O=this.parts[this.cursor].prev();if(O==null)return this.bell();this.moveCursor(this.parts.indexOf(O)),this.render()}right(){let O=this.parts[this.cursor].next();if(O==null)return this.bell();this.moveCursor(this.parts.indexOf(O)),this.render()}next(){let O=this.parts[this.cursor].next();this.moveCursor(O?this.parts.indexOf(O):this.parts.findIndex(P=>P instanceof c)),this.render()}_(O){/\d/.test(O)&&(this.typed+=O,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(n.hide):this.out.write(s(this.outputText,this.out.columns)),super.render(),this.outputText=[m.symbol(this.done,this.aborted),i.bold(this.msg),m.delimiter(!1),this.parts.reduce((O,P,F)=>O.concat(F===this.cursor&&!this.done?i.cyan().underline(P.toString()):P),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
18
- `).reduce((O,P,F)=>O+`
19
- ${F?" ":v.pointerSmall} ${i.red().italic(P)}`,"")),this.out.write(a.line+n.to(0)+this.outputText))}}return qe=M,qe}var Ie,nr;function ji(){if(nr)return Ie;nr=1;function e(g,f,p,b,w,x,S){try{var T=g[x](S),M=T.value}catch($){p($);return}T.done?f(M):Promise.resolve(M).then(b,w)}function r(g){return function(){var f=this,p=arguments;return new Promise(function(b,w){var x=g.apply(f,p);function S(M){e(x,b,w,S,T,"next",M)}function T(M){e(x,b,w,S,T,"throw",M)}S(void 0)})}}const i=E(),t=W(),o=_(),m=o.cursor,s=o.erase,v=k(),h=v.style,a=v.figures,n=v.clear,d=v.lines,c=/[0-9]/,l=g=>g!==void 0,u=(g,f)=>{let p=Math.pow(10,f);return Math.round(g*p)/p};class y extends t{constructor(f={}){super(f),this.transform=h.render(f.style),this.msg=f.message,this.initial=l(f.initial)?f.initial:"",this.float=!!f.float,this.round=f.round||2,this.inc=f.increment||1,this.min=l(f.min)?f.min:-1/0,this.max=l(f.max)?f.max:1/0,this.errorMsg=f.error||"Please Enter A Valid Value",this.validator=f.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(f){!f&&f!==0?(this.placeholder=!0,this.rendered=i.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${u(f,this.round)}`),this._value=u(f,this.round)),this.fire()}get value(){return this._value}parse(f){return this.float?parseFloat(f):parseInt(f)}valid(f){return f==="-"||f==="."&&this.float||c.test(f)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let f=this.value;this.value=f!==""?f:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
20
- `),this.close()}validate(){var f=this;return r(function*(){let p=yield f.validator(f.value);typeof p=="string"&&(f.errorMsg=p,p=!1),f.error=!p})()}submit(){var f=this;return r(function*(){if(yield f.validate(),f.error){f.color="red",f.fire(),f.render();return}let p=f.value;f.value=p!==""?p:f.initial,f.done=!0,f.aborted=!1,f.error=!1,f.fire(),f.render(),f.out.write(`
21
- `),f.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 f=this.value.toString();if(f.length===0)return this.bell();this.value=this.parse(f=f.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()}_(f,p){if(!this.valid(f))return this.bell();const b=Date.now();if(b-this.lastHit>1e3&&(this.typed=""),this.typed+=f,this.lastHit=b,this.color="cyan",f===".")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(m.down(d(this.outputError,this.out.columns)-1)+n(this.outputError,this.out.columns)),this.out.write(n(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[h.symbol(this.done,this.aborted),i.bold(this.msg),h.delimiter(this.done),!this.done||!this.done&&!this.placeholder?i[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
22
- `).reduce((f,p,b)=>f+`
23
- ${b?" ":a.pointerSmall} ${i.red().italic(p)}`,"")),this.out.write(s.line+m.to(0)+this.outputText+m.save+this.outputError+m.restore))}}return Ie=y,Ie}var je,or;function lr(){if(or)return je;or=1;const e=E(),r=_(),i=r.cursor,t=W(),o=k(),m=o.clear,s=o.figures,v=o.style,h=o.wrap,a=o.entriesToDisplay;class n extends t{constructor(c={}){super(c),this.msg=c.message,this.cursor=c.cursor||0,this.scrollIndex=c.cursor||0,this.hint=c.hint||"",this.warn=c.warn||"- This option is disabled -",this.minSelected=c.min,this.showMinError=!1,this.maxChoices=c.max,this.instructions=c.instructions,this.optionsPerPage=c.optionsPerPage||10,this.value=c.choices.map((l,u)=>(typeof l=="string"&&(l={title:l,value:u}),{title:l&&(l.title||l.value||l),description:l&&l.description,value:l&&(l.value===void 0?u:l.value),selected:l&&l.selected,disabled:l&&l.disabled})),this.clear=m("",this.out.columns),c.overrideRender||this.render()}reset(){this.value.map(c=>!c.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(c=>c.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
24
- `),this.close()}submit(){const c=this.value.filter(l=>l.selected);this.minSelected&&c.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
25
- `),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(c=>c.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const c=this.value[this.cursor];if(c.selected)c.selected=!1,this.render();else{if(c.disabled||this.value.filter(l=>l.selected).length>=this.maxChoices)return this.bell();c.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const c=!this.value[this.cursor].selected;this.value.filter(l=>!l.disabled).forEach(l=>l.selected=c),this.render()}_(c,l){if(c===" ")this.handleSpaceToggle();else if(c==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
15
+ `),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()}_(n,m){if(n===" ")this.value=!this.value;else if(n==="1")this.value=!0;else if(n==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(s(this.outputText,this.out.columns)),super.render(),this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(b.line+i.to(0)+this.outputText))}}return $e=l,$e}var Te,Kt;function U(){if(Kt)return Te;Kt=1;class e{constructor({token:o,date:t,parts:s,locales:c}){this.token=o,this.date=t||new Date,this.parts=s||[this],this.locales=c||{}}up(){}down(){}next(){const o=this.parts.indexOf(this);return this.parts.find((t,s)=>s>o&&t instanceof e)}setTo(o){}prev(){let o=[].concat(this.parts).reverse();const t=o.indexOf(this);return o.find((s,c)=>c>t&&s instanceof e)}toString(){return String(this.date)}}return Te=e,Te}var Me,Zt;function Pi(){if(Zt)return Me;Zt=1;const e=U();class r extends e{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}}return Me=r,Me}var Oe,Xt;function Ci(){if(Xt)return Oe;Xt=1;const e=U(),r=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class o extends e{constructor(s={}){super(s)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(s){this.date.setDate(parseInt(s.substr(-2)))}toString(){let s=this.date.getDate(),c=this.date.getDay();return this.token==="DD"?String(s).padStart(2,"0"):this.token==="Do"?s+r(s):this.token==="d"?c+1:this.token==="ddd"?this.locales.weekdaysShort[c]:this.token==="dddd"?this.locales.weekdays[c]:s}}return Oe=o,Oe}var Re,Qt;function Di(){if(Qt)return Re;Qt=1;const e=U();class r extends e{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}}return Re=r,Re}var Pe,er;function Ei(){if(er)return Pe;er=1;const e=U();class r extends e{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)}}return Pe=r,Pe}var Ce,tr;function _i(){if(tr)return Ce;tr=1;const e=U();class r extends e{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}}return Ce=r,Ce}var De,rr;function qi(){if(rr)return De;rr=1;const e=U();class r extends e{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(),s=this.token.length;return s===2?String(t+1).padStart(2,"0"):s===3?this.locales.monthsShort[t]:s===4?this.locales.months[t]:String(t+1)}}return De=r,De}var Ee,ir;function Ai(){if(ir)return Ee;ir=1;const e=U();class r extends e{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}}return Ee=r,Ee}var _e,sr;function Ii(){if(sr)return _e;sr=1;const e=U();class r extends e{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}}return _e=r,_e}var qe,nr;function ji(){return nr||(nr=1,qe={DatePart:U(),Meridiem:Pi(),Day:Ci(),Hours:Di(),Milliseconds:Ei(),Minutes:_i(),Month:qi(),Seconds:Ai(),Year:Ii()}),qe}var Ae,or;function Fi(){if(or)return Ae;or=1;function e(M,S,R,D,C,j,Y){try{var N=M[j](Y),F=N.value}catch(X){R(X);return}N.done?S(F):Promise.resolve(F).then(D,C)}function r(M){return function(){var S=this,R=arguments;return new Promise(function(D,C){var j=M.apply(S,R);function Y(F){e(j,D,C,Y,N,"next",F)}function N(F){e(j,D,C,Y,N,"throw",F)}Y(void 0)})}}const o=q(),t=W(),s=k(),c=s.style,i=s.clear,b=s.figures,l=A(),a=l.erase,n=l.cursor,m=ji(),f=m.DatePart,h=m.Meridiem,u=m.Day,v=m.Hours,g=m.Milliseconds,d=m.Minutes,p=m.Month,y=m.Seconds,w=m.Year,x=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,$={1:({token:M})=>M.replace(/\\(.)/g,"$1"),2:M=>new u(M),3:M=>new p(M),4:M=>new w(M),5:M=>new h(M),6:M=>new v(M),7:M=>new d(M),8:M=>new y(M),9:M=>new g(M)},T={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 O extends t{constructor(S={}){super(S),this.msg=S.message,this.cursor=0,this.typed="",this.locales=Object.assign(T,S.locales),this._date=S.initial||new Date,this.errorMsg=S.error||"Please Enter A Valid Value",this.validator=S.validate||(()=>!0),this.mask=S.mask||"YYYY-MM-DD HH:mm:ss",this.clear=i("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(S){S&&this._date.setTime(S.getTime())}set mask(S){let R;for(this.parts=[];R=x.exec(S);){let C=R.shift(),j=R.findIndex(Y=>Y!=null);this.parts.push(j in $?$[j]({token:R[j]||C,date:this.date,parts:this.parts,locales:this.locales}):R[j]||C)}let D=this.parts.reduce((C,j)=>(typeof j=="string"&&typeof C[C.length-1]=="string"?C[C.length-1]+=j:C.push(j),C),[]);this.parts.splice(0),this.parts.push(...D),this.reset()}moveCursor(S){this.typed="",this.cursor=S,this.fire()}reset(){this.moveCursor(this.parts.findIndex(S=>S instanceof f)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
16
+ `),this.close()}validate(){var S=this;return r(function*(){let R=yield S.validator(S.value);typeof R=="string"&&(S.errorMsg=R,R=!1),S.error=!R})()}submit(){var S=this;return r(function*(){if(yield S.validate(),S.error){S.color="red",S.fire(),S.render();return}S.done=!0,S.aborted=!1,S.fire(),S.render(),S.out.write(`
17
+ `),S.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let S=this.parts[this.cursor].prev();if(S==null)return this.bell();this.moveCursor(this.parts.indexOf(S)),this.render()}right(){let S=this.parts[this.cursor].next();if(S==null)return this.bell();this.moveCursor(this.parts.indexOf(S)),this.render()}next(){let S=this.parts[this.cursor].next();this.moveCursor(S?this.parts.indexOf(S):this.parts.findIndex(R=>R instanceof f)),this.render()}_(S){/\d/.test(S)&&(this.typed+=S,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(n.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(!1),this.parts.reduce((S,R,D)=>S.concat(D===this.cursor&&!this.done?o.cyan().underline(R.toString()):R),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
18
+ `).reduce((S,R,D)=>S+`
19
+ ${D?" ":b.pointerSmall} ${o.red().italic(R)}`,"")),this.out.write(a.line+n.to(0)+this.outputText))}}return Ae=O,Ae}var Ie,lr;function Ni(){if(lr)return Ie;lr=1;function e(g,d,p,y,w,x,$){try{var T=g[x]($),O=T.value}catch(M){p(M);return}T.done?d(O):Promise.resolve(O).then(y,w)}function r(g){return function(){var d=this,p=arguments;return new Promise(function(y,w){var x=g.apply(d,p);function $(O){e(x,y,w,$,T,"next",O)}function T(O){e(x,y,w,$,T,"throw",O)}$(void 0)})}}const o=q(),t=W(),s=A(),c=s.cursor,i=s.erase,b=k(),l=b.style,a=b.figures,n=b.clear,m=b.lines,f=/[0-9]/,h=g=>g!==void 0,u=(g,d)=>{let p=Math.pow(10,d);return Math.round(g*p)/p};class v extends t{constructor(d={}){super(d),this.transform=l.render(d.style),this.msg=d.message,this.initial=h(d.initial)?d.initial:"",this.float=!!d.float,this.round=d.round||2,this.inc=d.increment||1,this.min=h(d.min)?d.min:-1/0,this.max=h(d.max)?d.max:1/0,this.errorMsg=d.error||"Please Enter A Valid Value",this.validator=d.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(d){!d&&d!==0?(this.placeholder=!0,this.rendered=o.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${u(d,this.round)}`),this._value=u(d,this.round)),this.fire()}get value(){return this._value}parse(d){return this.float?parseFloat(d):parseInt(d)}valid(d){return d==="-"||d==="."&&this.float||f.test(d)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let d=this.value;this.value=d!==""?d:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
20
+ `),this.close()}validate(){var d=this;return r(function*(){let p=yield d.validator(d.value);typeof p=="string"&&(d.errorMsg=p,p=!1),d.error=!p})()}submit(){var d=this;return r(function*(){if(yield d.validate(),d.error){d.color="red",d.fire(),d.render();return}let p=d.value;d.value=p!==""?p:d.initial,d.done=!0,d.aborted=!1,d.error=!1,d.fire(),d.render(),d.out.write(`
21
+ `),d.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 d=this.value.toString();if(d.length===0)return this.bell();this.value=this.parse(d=d.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()}_(d,p){if(!this.valid(d))return this.bell();const y=Date.now();if(y-this.lastHit>1e3&&(this.typed=""),this.typed+=d,this.lastHit=y,this.color="cyan",d===".")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(c.down(m(this.outputError,this.out.columns)-1)+n(this.outputError,this.out.columns)),this.out.write(n(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
22
+ `).reduce((d,p,y)=>d+`
23
+ ${y?" ":a.pointerSmall} ${o.red().italic(p)}`,"")),this.out.write(i.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore))}}return Ie=v,Ie}var je,hr;function ur(){if(hr)return je;hr=1;const e=q(),r=A(),o=r.cursor,t=W(),s=k(),c=s.clear,i=s.figures,b=s.style,l=s.wrap,a=s.entriesToDisplay;class n extends t{constructor(f={}){super(f),this.msg=f.message,this.cursor=f.cursor||0,this.scrollIndex=f.cursor||0,this.hint=f.hint||"",this.warn=f.warn||"- This option is disabled -",this.minSelected=f.min,this.showMinError=!1,this.maxChoices=f.max,this.instructions=f.instructions,this.optionsPerPage=f.optionsPerPage||10,this.value=f.choices.map((h,u)=>(typeof h=="string"&&(h={title:h,value:u}),{title:h&&(h.title||h.value||h),description:h&&h.description,value:h&&(h.value===void 0?u:h.value),selected:h&&h.selected,disabled:h&&h.disabled})),this.clear=c("",this.out.columns),f.overrideRender||this.render()}reset(){this.value.map(f=>!f.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(f=>f.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
24
+ `),this.close()}submit(){const f=this.value.filter(h=>h.selected);this.minSelected&&f.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
25
+ `),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(f=>f.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const f=this.value[this.cursor];if(f.selected)f.selected=!1,this.render();else{if(f.disabled||this.value.filter(h=>h.selected).length>=this.maxChoices)return this.bell();f.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const f=!this.value[this.cursor].selected;this.value.filter(h=>!h.disabled).forEach(h=>h.selected=f),this.render()}_(f,h){if(f===" ")this.handleSpaceToggle();else if(f==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
26
26
  Instructions:
27
- ${s.arrowUp}/${s.arrowDown}: Highlight option
28
- ${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection
27
+ ${i.arrowUp}/${i.arrowDown}: Highlight option
28
+ ${i.arrowLeft}/${i.arrowRight}/[space]: Toggle selection
29
29
  `+(this.maxChoices===void 0?` a: Toggle all
30
- `:"")+" enter/return: Complete answer":""}renderOption(c,l,u,y){const g=(l.selected?e.green(s.radioOn):s.radioOff)+" "+y+" ";let f,p;return l.disabled?f=c===u?e.gray().underline(l.title):e.strikethrough().gray(l.title):(f=c===u?e.cyan().underline(l.title):l.title,c===u&&l.description&&(p=` - ${l.description}`,(g.length+f.length+p.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(p=`
31
- `+h(l.description,{margin:g.length,width:this.out.columns})))),g+f+e.gray(p||"")}paginateOptions(c){if(c.length===0)return e.red("No matches for this query.");let l=a(this.cursor,c.length,this.optionsPerPage),u=l.startIndex,y=l.endIndex,g,f=[];for(let p=u;p<y;p++)p===u&&u>0?g=s.arrowUp:p===y-1&&y<c.length?g=s.arrowDown:g=" ",f.push(this.renderOption(this.cursor,c[p],p,g));return`
32
- `+f.join(`
33
- `)}renderOptions(c){return this.done?"":this.paginateOptions(c)}renderDoneOrInstructions(){if(this.done)return this.value.filter(l=>l.selected).map(l=>l.title).join(", ");const c=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&c.push(e.yellow(this.warn)),c.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(i.hide),super.render();let c=[v.symbol(this.done,this.aborted),e.bold(this.msg),v.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(c+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),c+=this.renderOptions(this.value),this.out.write(this.clear+c),this.clear=m(c,this.out.columns)}}return je=n,je}var Fe,hr;function Fi(){if(hr)return Fe;hr=1;function e(f,p,b,w,x,S,T){try{var M=f[S](T),$=M.value}catch(O){b(O);return}M.done?p($):Promise.resolve($).then(w,x)}function r(f){return function(){var p=this,b=arguments;return new Promise(function(w,x){var S=f.apply(p,b);function T($){e(S,w,x,T,M,"next",$)}function M($){e(S,w,x,T,M,"throw",$)}T(void 0)})}}const i=E(),t=W(),o=_(),m=o.erase,s=o.cursor,v=k(),h=v.style,a=v.clear,n=v.figures,d=v.wrap,c=v.entriesToDisplay,l=(f,p)=>f[p]&&(f[p].value||f[p].title||f[p]),u=(f,p)=>f[p]&&(f[p].title||f[p].value||f[p]),y=(f,p)=>{const b=f.findIndex(w=>w.value===p||w.title===p);return b>-1?b:void 0};class g extends t{constructor(p={}){super(p),this.msg=p.message,this.suggest=p.suggest,this.choices=p.choices,this.initial=typeof p.initial=="number"?p.initial:y(p.choices,p.initial),this.select=this.initial||p.cursor||0,this.i18n={noMatches:p.noMatches||"no matches found"},this.fallback=p.fallback||this.initial,this.clearFirst=p.clearFirst||!1,this.suggestions=[],this.input="",this.limit=p.limit||10,this.cursor=0,this.transform=h.render(p.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=a("",this.out.columns),this.complete(this.render),this.render()}set fallback(p){this._fb=Number.isSafeInteger(parseInt(p))?parseInt(p):p}get fallback(){let p;return typeof this._fb=="number"?p=this.choices[this._fb]:typeof this._fb=="string"&&(p={title:this._fb}),p||this._fb||{title:this.i18n.noMatches}}moveSelect(p){this.select=p,this.suggestions.length>0?this.value=l(this.suggestions,p):this.value=this.fallback.value,this.fire()}complete(p){var b=this;return r(function*(){const w=b.completing=b.suggest(b.input,b.choices),x=yield w;if(b.completing!==w)return;b.suggestions=x.map((T,M,$)=>({title:u($,M),value:l($,M),description:T.description})),b.completing=!1;const S=Math.max(x.length-1,0);b.moveSelect(Math.min(S,b.select)),p&&p()})()}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(`
30
+ `:"")+" enter/return: Complete answer":""}renderOption(f,h,u,v){const g=(h.selected?e.green(i.radioOn):i.radioOff)+" "+v+" ";let d,p;return h.disabled?d=f===u?e.gray().underline(h.title):e.strikethrough().gray(h.title):(d=f===u?e.cyan().underline(h.title):h.title,f===u&&h.description&&(p=` - ${h.description}`,(g.length+d.length+p.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(p=`
31
+ `+l(h.description,{margin:g.length,width:this.out.columns})))),g+d+e.gray(p||"")}paginateOptions(f){if(f.length===0)return e.red("No matches for this query.");let h=a(this.cursor,f.length,this.optionsPerPage),u=h.startIndex,v=h.endIndex,g,d=[];for(let p=u;p<v;p++)p===u&&u>0?g=i.arrowUp:p===v-1&&v<f.length?g=i.arrowDown:g=" ",d.push(this.renderOption(this.cursor,f[p],p,g));return`
32
+ `+d.join(`
33
+ `)}renderOptions(f){return this.done?"":this.paginateOptions(f)}renderDoneOrInstructions(){if(this.done)return this.value.filter(h=>h.selected).map(h=>h.title).join(", ");const f=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&f.push(e.yellow(this.warn)),f.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(o.hide),super.render();let f=[b.symbol(this.done,this.aborted),e.bold(this.msg),b.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(f+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),f+=this.renderOptions(this.value),this.out.write(this.clear+f),this.clear=c(f,this.out.columns)}}return je=n,je}var Fe,ar;function Li(){if(ar)return Fe;ar=1;function e(d,p,y,w,x,$,T){try{var O=d[$](T),M=O.value}catch(S){y(S);return}O.done?p(M):Promise.resolve(M).then(w,x)}function r(d){return function(){var p=this,y=arguments;return new Promise(function(w,x){var $=d.apply(p,y);function T(M){e($,w,x,T,O,"next",M)}function O(M){e($,w,x,T,O,"throw",M)}T(void 0)})}}const o=q(),t=W(),s=A(),c=s.erase,i=s.cursor,b=k(),l=b.style,a=b.clear,n=b.figures,m=b.wrap,f=b.entriesToDisplay,h=(d,p)=>d[p]&&(d[p].value||d[p].title||d[p]),u=(d,p)=>d[p]&&(d[p].title||d[p].value||d[p]),v=(d,p)=>{const y=d.findIndex(w=>w.value===p||w.title===p);return y>-1?y:void 0};class g extends t{constructor(p={}){super(p),this.msg=p.message,this.suggest=p.suggest,this.choices=p.choices,this.initial=typeof p.initial=="number"?p.initial:v(p.choices,p.initial),this.select=this.initial||p.cursor||0,this.i18n={noMatches:p.noMatches||"no matches found"},this.fallback=p.fallback||this.initial,this.clearFirst=p.clearFirst||!1,this.suggestions=[],this.input="",this.limit=p.limit||10,this.cursor=0,this.transform=l.render(p.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=a("",this.out.columns),this.complete(this.render),this.render()}set fallback(p){this._fb=Number.isSafeInteger(parseInt(p))?parseInt(p):p}get fallback(){let p;return typeof this._fb=="number"?p=this.choices[this._fb]:typeof this._fb=="string"&&(p={title:this._fb}),p||this._fb||{title:this.i18n.noMatches}}moveSelect(p){this.select=p,this.suggestions.length>0?this.value=h(this.suggestions,p):this.value=this.fallback.value,this.fire()}complete(p){var y=this;return r(function*(){const w=y.completing=y.suggest(y.input,y.choices),x=yield w;if(y.completing!==w)return;y.suggestions=x.map((T,O,M)=>({title:u(M,O),value:h(M,O),description:T.description})),y.completing=!1;const $=Math.max(x.length-1,0);y.moveSelect(Math.min($,y.select)),p&&p()})()}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(`
34
34
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
35
35
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
36
- `),this.close()}_(p,b){let w=this.input.slice(0,this.cursor),x=this.input.slice(this.cursor);this.input=`${w}${p}${x}`,this.cursor=w.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let p=this.input.slice(0,this.cursor-1),b=this.input.slice(this.cursor);this.input=`${p}${b}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let p=this.input.slice(0,this.cursor),b=this.input.slice(this.cursor+1);this.input=`${p}${b}`,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(p,b,w,x){let S,T=w?n.arrowUp:x?n.arrowDown:" ",M=b?i.cyan().underline(p.title):p.title;return T=(b?i.cyan(n.pointer)+" ":" ")+T,p.description&&(S=` - ${p.description}`,(T.length+M.length+S.length>=this.out.columns||p.description.split(/\r?\n/).length>1)&&(S=`
37
- `+d(p.description,{margin:3,width:this.out.columns}))),T+" "+M+i.gray(S||"")}render(){if(this.closed)return;this.firstRender?this.out.write(s.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let p=c(this.select,this.choices.length,this.limit),b=p.startIndex,w=p.endIndex;if(this.outputText=[h.symbol(this.done,this.aborted,this.exited),i.bold(this.msg),h.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const x=this.suggestions.slice(b,w).map((S,T)=>this.renderOption(S,this.select===T+b,T===0&&b>0,T+b===w-1&&w<this.choices.length)).join(`
36
+ `),this.close()}_(p,y){let w=this.input.slice(0,this.cursor),x=this.input.slice(this.cursor);this.input=`${w}${p}${x}`,this.cursor=w.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let p=this.input.slice(0,this.cursor-1),y=this.input.slice(this.cursor);this.input=`${p}${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 p=this.input.slice(0,this.cursor),y=this.input.slice(this.cursor+1);this.input=`${p}${y}`,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(p,y,w,x){let $,T=w?n.arrowUp:x?n.arrowDown:" ",O=y?o.cyan().underline(p.title):p.title;return T=(y?o.cyan(n.pointer)+" ":" ")+T,p.description&&($=` - ${p.description}`,(T.length+O.length+$.length>=this.out.columns||p.description.split(/\r?\n/).length>1)&&($=`
37
+ `+m(p.description,{margin:3,width:this.out.columns}))),T+" "+O+o.gray($||"")}render(){if(this.closed)return;this.firstRender?this.out.write(i.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let p=f(this.select,this.choices.length,this.limit),y=p.startIndex,w=p.endIndex;if(this.outputText=[l.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),l.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const x=this.suggestions.slice(y,w).map(($,T)=>this.renderOption($,this.select===T+y,T===0&&y>0,T+y===w-1&&w<this.choices.length)).join(`
38
38
  `);this.outputText+=`
39
- `+(x||i.gray(this.fallback.title))}this.out.write(m.line+s.to(0)+this.outputText)}}return Fe=g,Fe}var Ne,ur;function Ni(){if(ur)return Ne;ur=1;const e=E(),r=_(),i=r.cursor,t=lr(),o=k(),m=o.clear,s=o.style,v=o.figures;class h extends t{constructor(n={}){n.overrideRender=!0,super(n),this.inputValue="",this.clear=m("",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(n=>n.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(){const n=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(c=>this.inputValue?!!(typeof c.title=="string"&&c.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof c.value=="string"&&c.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const d=this.filteredOptions.findIndex(c=>c===n);this.cursor=d<0?0:d,this.render()}handleSpaceToggle(){const n=this.filteredOptions[this.cursor];if(n.selected)n.selected=!1,this.render();else{if(n.disabled||this.value.filter(d=>d.selected).length>=this.maxChoices)return this.bell();n.selected=!0,this.render()}}handleInputChange(n){this.inputValue=this.inputValue+n,this.updateFilteredOptions()}_(n,d){n===" "?this.handleSpaceToggle():this.handleInputChange(n)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
39
+ `+(x||o.gray(this.fallback.title))}this.out.write(c.line+i.to(0)+this.outputText)}}return Fe=g,Fe}var Ne,cr;function Yi(){if(cr)return Ne;cr=1;const e=q(),r=A(),o=r.cursor,t=ur(),s=k(),c=s.clear,i=s.style,b=s.figures;class l extends t{constructor(n={}){n.overrideRender=!0,super(n),this.inputValue="",this.clear=c("",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(n=>n.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(){const n=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(f=>this.inputValue?!!(typeof f.title=="string"&&f.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof f.value=="string"&&f.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const m=this.filteredOptions.findIndex(f=>f===n);this.cursor=m<0?0:m,this.render()}handleSpaceToggle(){const n=this.filteredOptions[this.cursor];if(n.selected)n.selected=!1,this.render();else{if(n.disabled||this.value.filter(m=>m.selected).length>=this.maxChoices)return this.bell();n.selected=!0,this.render()}}handleInputChange(n){this.inputValue=this.inputValue+n,this.updateFilteredOptions()}_(n,m){n===" "?this.handleSpaceToggle():this.handleInputChange(n)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
40
40
  Instructions:
41
- ${v.arrowUp}/${v.arrowDown}: Highlight option
42
- ${v.arrowLeft}/${v.arrowRight}/[space]: Toggle selection
41
+ ${b.arrowUp}/${b.arrowDown}: Highlight option
42
+ ${b.arrowLeft}/${b.arrowRight}/[space]: Toggle selection
43
43
  [a,b,c]/delete: Filter choices
44
44
  enter/return: Complete answer
45
45
  `:""}renderCurrentInput(){return`
46
46
  Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}
47
- `}renderOption(n,d,c){let l;return d.disabled?l=n===c?e.gray().underline(d.title):e.strikethrough().gray(d.title):l=n===c?e.cyan().underline(d.title):d.title,(d.selected?e.green(v.radioOn):v.radioOff)+" "+l}renderDoneOrInstructions(){if(this.done)return this.value.filter(d=>d.selected).map(d=>d.title).join(", ");const n=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&n.push(e.yellow(this.warn)),n.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(i.hide),super.render();let n=[s.symbol(this.done,this.aborted),e.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+n),this.clear=m(n,this.out.columns)}}return Ne=h,Ne}var Le,ar;function Li(){if(ar)return Le;ar=1;const e=E(),r=W(),i=k(),t=i.style,o=i.clear,m=_(),s=m.erase,v=m.cursor;class h extends r{constructor(n={}){super(n),this.msg=n.message,this.value=n.initial,this.initialValue=!!n.initial,this.yesMsg=n.yes||"yes",this.yesOption=n.yesOption||"(Y/n)",this.noMsg=n.no||"no",this.noOption=n.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
+ `}renderOption(n,m,f){let h;return m.disabled?h=n===f?e.gray().underline(m.title):e.strikethrough().gray(m.title):h=n===f?e.cyan().underline(m.title):m.title,(m.selected?e.green(b.radioOn):b.radioOff)+" "+h}renderDoneOrInstructions(){if(this.done)return this.value.filter(m=>m.selected).map(m=>m.title).join(", ");const n=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&n.push(e.yellow(this.warn)),n.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(o.hide),super.render();let n=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+n),this.clear=c(n,this.out.columns)}}return Ne=l,Ne}var Le,dr;function ki(){if(dr)return Le;dr=1;const e=q(),r=W(),o=k(),t=o.style,s=o.clear,c=A(),i=c.erase,b=c.cursor;class l extends r{constructor(n={}){super(n),this.msg=n.message,this.value=n.initial,this.initialValue=!!n.initial,this.yesMsg=n.yes||"yes",this.yesOption=n.yesOption||"(Y/n)",this.noMsg=n.no||"no",this.noOption=n.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(`
48
48
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
49
- `),this.close()}_(n,d){return n.toLowerCase()==="y"?(this.value=!0,this.submit()):n.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(v.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(s.line+v.to(0)+this.outputText))}}return Le=h,Le}var Ye,cr;function Yi(){return cr||(cr=1,Ye={TextPrompt:$i(),SelectPrompt:Ti(),TogglePrompt:Oi(),DatePrompt:Ii(),NumberPrompt:ji(),MultiselectPrompt:lr(),AutocompletePrompt:Fi(),AutocompleteMultiselectPrompt:Ni(),ConfirmPrompt:Li()}),Ye}var dr;function ki(){return dr||(dr=1,function(e){const r=e,i=Yi(),t=s=>s;function o(s,v,h={}){return new Promise((a,n)=>{const d=new i[s](v),c=h.onAbort||t,l=h.onSubmit||t,u=h.onExit||t;d.on("state",v.onState||t),d.on("submit",y=>a(l(y))),d.on("exit",y=>a(u(y))),d.on("abort",y=>n(c(y)))})}r.text=s=>o("TextPrompt",s),r.password=s=>(s.style="password",r.text(s)),r.invisible=s=>(s.style="invisible",r.text(s)),r.number=s=>o("NumberPrompt",s),r.date=s=>o("DatePrompt",s),r.confirm=s=>o("ConfirmPrompt",s),r.list=s=>{const v=s.separator||",";return o("TextPrompt",s,{onSubmit:h=>h.split(v).map(a=>a.trim())})},r.toggle=s=>o("TogglePrompt",s),r.select=s=>o("SelectPrompt",s),r.multiselect=s=>{s.choices=[].concat(s.choices||[]);const v=h=>h.filter(a=>a.selected).map(a=>a.value);return o("MultiselectPrompt",s,{onAbort:v,onSubmit:v})},r.autocompleteMultiselect=s=>{s.choices=[].concat(s.choices||[]);const v=h=>h.filter(a=>a.selected).map(a=>a.value);return o("AutocompleteMultiselectPrompt",s,{onAbort:v,onSubmit:v})};const m=(s,v)=>Promise.resolve(v.filter(h=>h.title.slice(0,s.length).toLowerCase()===s.toLowerCase()));r.autocomplete=s=>(s.suggest=s.suggest||m,s.choices=[].concat(s.choices||[]),o("AutocompletePrompt",s))}(le)),le}var ke,fr;function Bi(){if(fr)return ke;fr=1;function e(g,f){var p=Object.keys(g);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(g);f&&(b=b.filter(function(w){return Object.getOwnPropertyDescriptor(g,w).enumerable})),p.push.apply(p,b)}return p}function r(g){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?e(Object(p),!0).forEach(function(b){i(g,b,p[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(p)):e(Object(p)).forEach(function(b){Object.defineProperty(g,b,Object.getOwnPropertyDescriptor(p,b))})}return g}function i(g,f,p){return f in g?Object.defineProperty(g,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):g[f]=p,g}function t(g,f){var p=typeof Symbol<"u"&&g[Symbol.iterator]||g["@@iterator"];if(!p){if(Array.isArray(g)||(p=o(g))||f){p&&(g=p);var b=0,w=function(){};return{s:w,n:function(){return b>=g.length?{done:!0}:{done:!1,value:g[b++]}},e:function($){throw $},f:w}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
50
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var x=!0,S=!1,T;return{s:function(){p=p.call(g)},n:function(){var $=p.next();return x=$.done,$},e:function($){S=!0,T=$},f:function(){try{!x&&p.return!=null&&p.return()}finally{if(S)throw T}}}}function o(g,f){if(g){if(typeof g=="string")return m(g,f);var p=Object.prototype.toString.call(g).slice(8,-1);if(p==="Object"&&g.constructor&&(p=g.constructor.name),p==="Map"||p==="Set")return Array.from(g);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return m(g,f)}}function m(g,f){(f==null||f>g.length)&&(f=g.length);for(var p=0,b=new Array(f);p<f;p++)b[p]=g[p];return b}function s(g,f,p,b,w,x,S){try{var T=g[x](S),M=T.value}catch($){p($);return}T.done?f(M):Promise.resolve(M).then(b,w)}function v(g){return function(){var f=this,p=arguments;return new Promise(function(b,w){var x=g.apply(f,p);function S(M){s(x,b,w,S,T,"next",M)}function T(M){s(x,b,w,S,T,"throw",M)}S(void 0)})}}const h=ki(),a=["suggest","format","onState","validate","onRender","type"],n=()=>{};function d(){return c.apply(this,arguments)}function c(){return c=v(function*(g=[],{onSubmit:f=n,onCancel:p=n}={}){const b={},w=d._override||{};g=[].concat(g);let x,S,T,M,$,O;const P=function(){var N=v(function*(j,X,Ot=!1){if(!(!Ot&&j.validate&&j.validate(X)!==!0))return j.format?yield j.format(X,b):X});return function(X,Ot){return N.apply(this,arguments)}}();var F=t(g),A;try{for(F.s();!(A=F.n()).done;){S=A.value;var I=S;if(M=I.name,$=I.type,typeof $=="function"&&($=yield $(x,r({},b),S),S.type=$),!!$){for(let N in S){if(a.includes(N))continue;let j=S[N];S[N]=typeof j=="function"?yield j(x,r({},b),O):j}if(O=S,typeof S.message!="string")throw new Error("prompt message is required");var Y=S;if(M=Y.name,$=Y.type,h[$]===void 0)throw new Error(`prompt type (${$}) is not defined`);if(w[S.name]!==void 0&&(x=yield P(S,w[S.name]),x!==void 0)){b[M]=x;continue}try{x=d._injected?l(d._injected,S.initial):yield h[$](S),b[M]=x=yield P(S,x,!0),T=yield f(S,x,b)}catch{T=!(yield p(S,b))}if(T)return b}}}catch(N){F.e(N)}finally{F.f()}return b}),c.apply(this,arguments)}function l(g,f){const p=g.shift();if(p instanceof Error)throw p;return p===void 0?f:p}function u(g){d._injected=(d._injected||[]).concat(g)}function y(g){d._override=Object.assign({},g)}return ke=Object.assign(d,{prompt:d,prompts:h,inject:u,override:y}),ke}var Be={},Ve,pr;function Vi(){return pr||(pr=1,Ve=(e,r)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(r){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),Ve}var He,mr;function Ue(){return mr||(mr=1,He=e=>{const r=["[\\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("|"),i=new RegExp(r,"g");return typeof e=="string"?e.replace(i,""):e}),He}var Ge,gr;function Hi(){if(gr)return Ge;gr=1;const e=Ue(),{erase:r,cursor:i}=_(),t=o=>[...e(o)].length;return Ge=function(o,m){if(!m)return r.line+i.to(0);let s=0;const v=o.split(/\r?\n/);for(let h of v)s+=1+Math.floor(Math.max(t(h)-1,0)/m);return r.lines(s)},Ge}var Je,vr;function br(){if(vr)return Je;vr=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},r={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return Je=process.platform==="win32"?r:e,Je}var We,yr;function Ui(){if(yr)return We;yr=1;const e=E(),r=br(),i=Object.freeze({password:{scale:1,render:h=>"*".repeat(h.length)},emoji:{scale:2,render:h=>"\u{1F603}".repeat(h.length)},invisible:{scale:0,render:h=>""},default:{scale:1,render:h=>`${h}`}}),t=h=>i[h]||i.default,o=Object.freeze({aborted:e.red(r.cross),done:e.green(r.tick),exited:e.yellow(r.cross),default:e.cyan("?")});return We={styles:i,render:t,symbols:o,symbol:(h,a,n)=>a?o.aborted:n?o.exited:h?o.done:o.default,delimiter:h=>e.gray(h?r.ellipsis:r.pointerSmall),item:(h,a)=>e.gray(h?a?r.pointerSmall:"+":r.line)},We}var ze,wr;function Gi(){if(wr)return ze;wr=1;const e=Ue();return ze=function(r,i){let t=String(e(r)||"").split(/\r?\n/);return i?t.map(o=>Math.ceil(o.length/i)).reduce((o,m)=>o+m):t.length},ze}var Ke,xr;function Ji(){return xr||(xr=1,Ke=(e,r={})=>{const i=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"",t=r.width;return(e||"").split(/\r?\n/g).map(o=>o.split(/\s+/g).reduce((m,s)=>(s.length+i.length>=t||m[m.length-1].length+s.length+1<t?m[m.length-1]+=` ${s}`:m.push(`${i}${s}`),m),[i]).join(`
49
+ `),this.close()}_(n,m){return n.toLowerCase()==="y"?(this.value=!0,this.submit()):n.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(b.hide):this.out.write(s(this.outputText,this.out.columns)),super.render(),this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(i.line+b.to(0)+this.outputText))}}return Le=l,Le}var Ye,fr;function Bi(){return fr||(fr=1,Ye={TextPrompt:Mi(),SelectPrompt:Oi(),TogglePrompt:Ri(),DatePrompt:Fi(),NumberPrompt:Ni(),MultiselectPrompt:ur(),AutocompletePrompt:Li(),AutocompleteMultiselectPrompt:Yi(),ConfirmPrompt:ki()}),Ye}var pr;function Vi(){return pr||(pr=1,function(e){const r=e,o=Bi(),t=i=>i;function s(i,b,l={}){return new Promise((a,n)=>{const m=new o[i](b),f=l.onAbort||t,h=l.onSubmit||t,u=l.onExit||t;m.on("state",b.onState||t),m.on("submit",v=>a(h(v))),m.on("exit",v=>a(u(v))),m.on("abort",v=>n(f(v)))})}r.text=i=>s("TextPrompt",i),r.password=i=>(i.style="password",r.text(i)),r.invisible=i=>(i.style="invisible",r.text(i)),r.number=i=>s("NumberPrompt",i),r.date=i=>s("DatePrompt",i),r.confirm=i=>s("ConfirmPrompt",i),r.list=i=>{const b=i.separator||",";return s("TextPrompt",i,{onSubmit:l=>l.split(b).map(a=>a.trim())})},r.toggle=i=>s("TogglePrompt",i),r.select=i=>s("SelectPrompt",i),r.multiselect=i=>{i.choices=[].concat(i.choices||[]);const b=l=>l.filter(a=>a.selected).map(a=>a.value);return s("MultiselectPrompt",i,{onAbort:b,onSubmit:b})},r.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const b=l=>l.filter(a=>a.selected).map(a=>a.value);return s("AutocompleteMultiselectPrompt",i,{onAbort:b,onSubmit:b})};const c=(i,b)=>Promise.resolve(b.filter(l=>l.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));r.autocomplete=i=>(i.suggest=i.suggest||c,i.choices=[].concat(i.choices||[]),s("AutocompletePrompt",i))}(le)),le}var ke,mr;function Hi(){if(mr)return ke;mr=1;function e(g,d){var p=Object.keys(g);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(g);d&&(y=y.filter(function(w){return Object.getOwnPropertyDescriptor(g,w).enumerable})),p.push.apply(p,y)}return p}function r(g){for(var d=1;d<arguments.length;d++){var p=arguments[d]!=null?arguments[d]:{};d%2?e(Object(p),!0).forEach(function(y){o(g,y,p[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(p)):e(Object(p)).forEach(function(y){Object.defineProperty(g,y,Object.getOwnPropertyDescriptor(p,y))})}return g}function o(g,d,p){return d in g?Object.defineProperty(g,d,{value:p,enumerable:!0,configurable:!0,writable:!0}):g[d]=p,g}function t(g,d){var p=typeof Symbol<"u"&&g[Symbol.iterator]||g["@@iterator"];if(!p){if(Array.isArray(g)||(p=s(g))||d){p&&(g=p);var y=0,w=function(){};return{s:w,n:function(){return y>=g.length?{done:!0}:{done:!1,value:g[y++]}},e:function(M){throw M},f:w}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
50
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var x=!0,$=!1,T;return{s:function(){p=p.call(g)},n:function(){var M=p.next();return x=M.done,M},e:function(M){$=!0,T=M},f:function(){try{!x&&p.return!=null&&p.return()}finally{if($)throw T}}}}function s(g,d){if(g){if(typeof g=="string")return c(g,d);var p=Object.prototype.toString.call(g).slice(8,-1);if(p==="Object"&&g.constructor&&(p=g.constructor.name),p==="Map"||p==="Set")return Array.from(g);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return c(g,d)}}function c(g,d){(d==null||d>g.length)&&(d=g.length);for(var p=0,y=new Array(d);p<d;p++)y[p]=g[p];return y}function i(g,d,p,y,w,x,$){try{var T=g[x]($),O=T.value}catch(M){p(M);return}T.done?d(O):Promise.resolve(O).then(y,w)}function b(g){return function(){var d=this,p=arguments;return new Promise(function(y,w){var x=g.apply(d,p);function $(O){i(x,y,w,$,T,"next",O)}function T(O){i(x,y,w,$,T,"throw",O)}$(void 0)})}}const l=Vi(),a=["suggest","format","onState","validate","onRender","type"],n=()=>{};function m(){return f.apply(this,arguments)}function f(){return f=b(function*(g=[],{onSubmit:d=n,onCancel:p=n}={}){const y={},w=m._override||{};g=[].concat(g);let x,$,T,O,M,S;const R=function(){var N=b(function*(F,X,Rt=!1){if(!(!Rt&&F.validate&&F.validate(X)!==!0))return F.format?yield F.format(X,y):X});return function(X,Rt){return N.apply(this,arguments)}}();var D=t(g),C;try{for(D.s();!(C=D.n()).done;){$=C.value;var j=$;if(O=j.name,M=j.type,typeof M=="function"&&(M=yield M(x,r({},y),$),$.type=M),!!M){for(let N in $){if(a.includes(N))continue;let F=$[N];$[N]=typeof F=="function"?yield F(x,r({},y),S):F}if(S=$,typeof $.message!="string")throw new Error("prompt message is required");var Y=$;if(O=Y.name,M=Y.type,l[M]===void 0)throw new Error(`prompt type (${M}) is not defined`);if(w[$.name]!==void 0&&(x=yield R($,w[$.name]),x!==void 0)){y[O]=x;continue}try{x=m._injected?h(m._injected,$.initial):yield l[M]($),y[O]=x=yield R($,x,!0),T=yield d($,x,y)}catch{T=!(yield p($,y))}if(T)return y}}}catch(N){D.e(N)}finally{D.f()}return y}),f.apply(this,arguments)}function h(g,d){const p=g.shift();if(p instanceof Error)throw p;return p===void 0?d:p}function u(g){m._injected=(m._injected||[]).concat(g)}function v(g){m._override=Object.assign({},g)}return ke=Object.assign(m,{prompt:m,prompts:l,inject:u,override:v}),ke}var Be={},Ve,gr;function Ui(){return gr||(gr=1,Ve=(e,r)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(r){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),Ve}var He,vr;function Ue(){return vr||(vr=1,He=e=>{const r=["[\\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("|"),o=new RegExp(r,"g");return typeof e=="string"?e.replace(o,""):e}),He}var Ge,br;function Gi(){if(br)return Ge;br=1;const e=Ue(),{erase:r,cursor:o}=A(),t=s=>[...e(s)].length;return Ge=function(s,c){if(!c)return r.line+o.to(0);let i=0;const b=s.split(/\r?\n/);for(let l of b)i+=1+Math.floor(Math.max(t(l)-1,0)/c);return r.lines(i)},Ge}var Je,yr;function wr(){if(yr)return Je;yr=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},r={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return Je=process.platform==="win32"?r:e,Je}var We,xr;function Ji(){if(xr)return We;xr=1;const e=q(),r=wr(),o=Object.freeze({password:{scale:1,render:l=>"*".repeat(l.length)},emoji:{scale:2,render:l=>"\u{1F603}".repeat(l.length)},invisible:{scale:0,render:l=>""},default:{scale:1,render:l=>`${l}`}}),t=l=>o[l]||o.default,s=Object.freeze({aborted:e.red(r.cross),done:e.green(r.tick),exited:e.yellow(r.cross),default:e.cyan("?")});return We={styles:o,render:t,symbols:s,symbol:(l,a,n)=>a?s.aborted:n?s.exited:l?s.done:s.default,delimiter:l=>e.gray(l?r.ellipsis:r.pointerSmall),item:(l,a)=>e.gray(l?a?r.pointerSmall:"+":r.line)},We}var ze,Sr;function Wi(){if(Sr)return ze;Sr=1;const e=Ue();return ze=function(r,o){let t=String(e(r)||"").split(/\r?\n/);return o?t.map(s=>Math.ceil(s.length/o)).reduce((s,c)=>s+c):t.length},ze}var Ke,$r;function zi(){return $r||($r=1,Ke=(e,r={})=>{const o=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"",t=r.width;return(e||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((c,i)=>(i.length+o.length>=t||c[c.length-1].length+i.length+1<t?c[c.length-1]+=` ${i}`:c.push(`${o}${i}`),c),[o]).join(`
51
51
  `)).join(`
52
- `)}),Ke}var Ze,Sr;function Wi(){return Sr||(Sr=1,Ze=(e,r,i)=>{i=i||r;let t=Math.min(r-i,e-Math.floor(i/2));t<0&&(t=0);let o=Math.min(t+i,r);return{startIndex:t,endIndex:o}}),Ze}var Xe,$r;function B(){return $r||($r=1,Xe={action:Vi(),clear:Hi(),style:Ui(),strip:Ue(),figures:br(),lines:Gi(),wrap:Ji(),entriesToDisplay:Wi()}),Xe}var Qe,Tr;function z(){if(Tr)return Qe;Tr=1;const e=Mt,{action:r}=B(),i=Rt,{beep:t,cursor:o}=_(),m=E();class s extends i{constructor(h={}){super(),this.firstRender=!0,this.in=h.stdin||process.stdin,this.out=h.stdout||process.stdout,this.onRender=(h.onRender||(()=>{})).bind(this);const a=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,a),this.in.isTTY&&this.in.setRawMode(!0);const n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,d=(c,l)=>{let u=r(l,n);u===!1?this._&&this._(c,l):typeof this[u]=="function"?this[u](l):this.bell()};this.close=()=>{this.out.write(o.show),this.in.removeListener("keypress",d),this.in.isTTY&&this.in.setRawMode(!1),a.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",d)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(t)}render(){this.onRender(m),this.firstRender&&(this.firstRender=!1)}}return Qe=s,Qe}var et,Or;function zi(){if(Or)return et;Or=1;const e=E(),r=z(),{erase:i,cursor:t}=_(),{style:o,clear:m,lines:s,figures:v}=B();class h extends r{constructor(n={}){super(n),this.transform=o.render(n.style),this.scale=this.transform.scale,this.msg=n.message,this.initial=n.initial||"",this.validator=n.validate||(()=>!0),this.value="",this.errorMsg=n.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=m("",this.out.columns),this.render()}set value(n){!n&&this.initial?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(n)),this._value=n,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(`
52
+ `)}),Ke}var Ze,Tr;function Ki(){return Tr||(Tr=1,Ze=(e,r,o)=>{o=o||r;let t=Math.min(r-o,e-Math.floor(o/2));t<0&&(t=0);let s=Math.min(t+o,r);return{startIndex:t,endIndex:s}}),Ze}var Xe,Mr;function B(){return Mr||(Mr=1,Xe={action:Ui(),clear:Gi(),style:Ji(),strip:Ue(),figures:wr(),lines:Wi(),wrap:zi(),entriesToDisplay:Ki()}),Xe}var Qe,Or;function z(){if(Or)return Qe;Or=1;const e=Pt,{action:r}=B(),o=Ct,{beep:t,cursor:s}=A(),c=q();class i extends o{constructor(l={}){super(),this.firstRender=!0,this.in=l.stdin||process.stdin,this.out=l.stdout||process.stdout,this.onRender=(l.onRender||(()=>{})).bind(this);const a=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,a),this.in.isTTY&&this.in.setRawMode(!0);const n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,m=(f,h)=>{let u=r(h,n);u===!1?this._&&this._(f,h):typeof this[u]=="function"?this[u](h):this.bell()};this.close=()=>{this.out.write(s.show),this.in.removeListener("keypress",m),this.in.isTTY&&this.in.setRawMode(!1),a.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",m)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(t)}render(){this.onRender(c),this.firstRender&&(this.firstRender=!1)}}return Qe=i,Qe}var et,Rr;function Zi(){if(Rr)return et;Rr=1;const e=q(),r=z(),{erase:o,cursor:t}=A(),{style:s,clear:c,lines:i,figures:b}=B();class l extends r{constructor(n={}){super(n),this.transform=s.render(n.style),this.scale=this.transform.scale,this.msg=n.message,this.initial=n.initial||"",this.validator=n.validate||(()=>!0),this.value="",this.errorMsg=n.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=c("",this.out.columns),this.render()}set value(n){!n&&this.initial?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(n)),this._value=n,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(`
53
53
  `),this.close()}async validate(){let n=await this.validator(this.value);typeof n=="string"&&(this.errorMsg=n,n=!1),this.error=!n}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(`
54
- `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(n){this.placeholder||(this.cursor=this.cursor+n,this.cursorOffset+=n)}_(n,d){let c=this.value.slice(0,this.cursor),l=this.value.slice(this.cursor);this.value=`${c}${n}${l}`,this.red=!1,this.cursor=this.placeholder?0:c.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let n=this.value.slice(0,this.cursor-1),d=this.value.slice(this.cursor);this.value=`${n}${d}`,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 n=this.value.slice(0,this.cursor),d=this.value.slice(this.cursor+1);this.value=`${n}${d}`,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(t.down(s(this.outputError,this.out.columns)-1)+m(this.outputError,this.out.columns)),this.out.write(m(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(this.done),this.red?e.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
55
- `).reduce((n,d,c)=>n+`
56
- ${c?" ":v.pointerSmall} ${e.red().italic(d)}`,"")),this.out.write(i.line+t.to(0)+this.outputText+t.save+this.outputError+t.restore+t.move(this.cursorOffset,0)))}}return et=h,et}var tt,Mr;function Ki(){if(Mr)return tt;Mr=1;const e=E(),r=z(),{style:i,clear:t,figures:o,wrap:m,entriesToDisplay:s}=B(),{cursor:v}=_();class h extends r{constructor(n={}){super(n),this.msg=n.message,this.hint=n.hint||"- Use arrow-keys. Return to submit.",this.warn=n.warn||"- This option is disabled",this.cursor=n.initial||0,this.choices=n.choices.map((d,c)=>(typeof d=="string"&&(d={title:d,value:c}),{title:d&&(d.title||d.value||d),value:d&&(d.value===void 0?c:d.value),description:d&&d.description,selected:d&&d.selected,disabled:d&&d.disabled})),this.optionsPerPage=n.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=t("",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(`
54
+ `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(n){this.placeholder||(this.cursor=this.cursor+n,this.cursorOffset+=n)}_(n,m){let f=this.value.slice(0,this.cursor),h=this.value.slice(this.cursor);this.value=`${f}${n}${h}`,this.red=!1,this.cursor=this.placeholder?0:f.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let n=this.value.slice(0,this.cursor-1),m=this.value.slice(this.cursor);this.value=`${n}${m}`,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 n=this.value.slice(0,this.cursor),m=this.value.slice(this.cursor+1);this.value=`${n}${m}`,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(t.down(i(this.outputError,this.out.columns)-1)+c(this.outputError,this.out.columns)),this.out.write(c(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[s.symbol(this.done,this.aborted),e.bold(this.msg),s.delimiter(this.done),this.red?e.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
55
+ `).reduce((n,m,f)=>n+`
56
+ ${f?" ":b.pointerSmall} ${e.red().italic(m)}`,"")),this.out.write(o.line+t.to(0)+this.outputText+t.save+this.outputError+t.restore+t.move(this.cursorOffset,0)))}}return et=l,et}var tt,Pr;function Xi(){if(Pr)return tt;Pr=1;const e=q(),r=z(),{style:o,clear:t,figures:s,wrap:c,entriesToDisplay:i}=B(),{cursor:b}=A();class l extends r{constructor(n={}){super(n),this.msg=n.message,this.hint=n.hint||"- Use arrow-keys. Return to submit.",this.warn=n.warn||"- This option is disabled",this.cursor=n.initial||0,this.choices=n.choices.map((m,f)=>(typeof m=="string"&&(m={title:m,value:f}),{title:m&&(m.title||m.value||m),value:m&&(m.value===void 0?f:m.value),description:m&&m.description,selected:m&&m.selected,disabled:m&&m.disabled})),this.optionsPerPage=n.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=t("",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(`
57
57
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
58
- `),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()}_(n,d){if(n===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(v.hide):this.out.write(t(this.outputText,this.out.columns)),super.render();let{startIndex:n,endIndex:d}=s(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
59
- `;for(let c=n;c<d;c++){let l,u,y="",g=this.choices[c];c===n&&n>0?u=o.arrowUp:c===d-1&&d<this.choices.length?u=o.arrowDown:u=" ",g.disabled?(l=this.cursor===c?e.gray().underline(g.title):e.strikethrough().gray(g.title),u=(this.cursor===c?e.bold().gray(o.pointer)+" ":" ")+u):(l=this.cursor===c?e.cyan().underline(g.title):g.title,u=(this.cursor===c?e.cyan(o.pointer)+" ":" ")+u,g.description&&this.cursor===c&&(y=` - ${g.description}`,(u.length+l.length+y.length>=this.out.columns||g.description.split(/\r?\n/).length>1)&&(y=`
60
- `+m(g.description,{margin:3,width:this.out.columns})))),this.outputText+=`${u} ${l}${e.gray(y)}
61
- `}}this.out.write(this.outputText)}}return tt=h,tt}var rt,Rr;function Zi(){if(Rr)return rt;Rr=1;const e=E(),r=z(),{style:i,clear:t}=B(),{cursor:o,erase:m}=_();class s extends r{constructor(h={}){super(h),this.msg=h.message,this.value=!!h.initial,this.active=h.active||"on",this.inactive=h.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(`
58
+ `),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()}_(n,m){if(n===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(b.hide):this.out.write(t(this.outputText,this.out.columns)),super.render();let{startIndex:n,endIndex:m}=i(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
59
+ `;for(let f=n;f<m;f++){let h,u,v="",g=this.choices[f];f===n&&n>0?u=s.arrowUp:f===m-1&&m<this.choices.length?u=s.arrowDown:u=" ",g.disabled?(h=this.cursor===f?e.gray().underline(g.title):e.strikethrough().gray(g.title),u=(this.cursor===f?e.bold().gray(s.pointer)+" ":" ")+u):(h=this.cursor===f?e.cyan().underline(g.title):g.title,u=(this.cursor===f?e.cyan(s.pointer)+" ":" ")+u,g.description&&this.cursor===f&&(v=` - ${g.description}`,(u.length+h.length+v.length>=this.out.columns||g.description.split(/\r?\n/).length>1)&&(v=`
60
+ `+c(g.description,{margin:3,width:this.out.columns})))),this.outputText+=`${u} ${h}${e.gray(v)}
61
+ `}}this.out.write(this.outputText)}}return tt=l,tt}var rt,Cr;function Qi(){if(Cr)return rt;Cr=1;const e=q(),r=z(),{style:o,clear:t}=B(),{cursor:s,erase:c}=A();class i extends r{constructor(l={}){super(l),this.msg=l.message,this.value=!!l.initial,this.active=l.active||"on",this.inactive=l.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(`
62
62
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
63
- `),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()}_(h,a){if(h===" ")this.value=!this.value;else if(h==="1")this.value=!0;else if(h==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(o.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(m.line+o.to(0)+this.outputText))}}return rt=s,rt}var it,Pr;function G(){if(Pr)return it;Pr=1;class e{constructor({token:i,date:t,parts:o,locales:m}){this.token=i,this.date=t||new Date,this.parts=o||[this],this.locales=m||{}}up(){}down(){}next(){const i=this.parts.indexOf(this);return this.parts.find((t,o)=>o>i&&t instanceof e)}setTo(i){}prev(){let i=[].concat(this.parts).reverse();const t=i.indexOf(this);return i.find((o,m)=>m>t&&o instanceof e)}toString(){return String(this.date)}}return it=e,it}var st,Cr;function Xi(){if(Cr)return st;Cr=1;const e=G();class r extends e{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}}return st=r,st}var nt,Dr;function Qi(){if(Dr)return nt;Dr=1;const e=G(),r=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class i extends e{constructor(o={}){super(o)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(o){this.date.setDate(parseInt(o.substr(-2)))}toString(){let o=this.date.getDate(),m=this.date.getDay();return this.token==="DD"?String(o).padStart(2,"0"):this.token==="Do"?o+r(o):this.token==="d"?m+1:this.token==="ddd"?this.locales.weekdaysShort[m]:this.token==="dddd"?this.locales.weekdays[m]:o}}return nt=i,nt}var ot,Er;function es(){if(Er)return ot;Er=1;const e=G();class r extends e{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}}return ot=r,ot}var lt,_r;function ts(){if(_r)return lt;_r=1;const e=G();class r extends e{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)}}return lt=r,lt}var ht,Ar;function rs(){if(Ar)return ht;Ar=1;const e=G();class r extends e{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}}return ht=r,ht}var ut,qr;function is(){if(qr)return ut;qr=1;const e=G();class r extends e{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(),o=this.token.length;return o===2?String(t+1).padStart(2,"0"):o===3?this.locales.monthsShort[t]:o===4?this.locales.months[t]:String(t+1)}}return ut=r,ut}var at,Ir;function ss(){if(Ir)return at;Ir=1;const e=G();class r extends e{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}}return at=r,at}var ct,jr;function ns(){if(jr)return ct;jr=1;const e=G();class r extends e{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}}return ct=r,ct}var dt,Fr;function os(){return Fr||(Fr=1,dt={DatePart:G(),Meridiem:Xi(),Day:Qi(),Hours:es(),Milliseconds:ts(),Minutes:rs(),Month:is(),Seconds:ss(),Year:ns()}),dt}var ft,Nr;function ls(){if(Nr)return ft;Nr=1;const e=E(),r=z(),{style:i,clear:t,figures:o}=B(),{erase:m,cursor:s}=_(),{DatePart:v,Meridiem:h,Day:a,Hours:n,Milliseconds:d,Minutes:c,Month:l,Seconds:u,Year:y}=os(),g=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,f={1:({token:w})=>w.replace(/\\(.)/g,"$1"),2:w=>new a(w),3:w=>new l(w),4:w=>new y(w),5:w=>new h(w),6:w=>new n(w),7:w=>new c(w),8:w=>new u(w),9:w=>new d(w)},p={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 b extends r{constructor(x={}){super(x),this.msg=x.message,this.cursor=0,this.typed="",this.locales=Object.assign(p,x.locales),this._date=x.initial||new Date,this.errorMsg=x.error||"Please Enter A Valid Value",this.validator=x.validate||(()=>!0),this.mask=x.mask||"YYYY-MM-DD HH:mm:ss",this.clear=t("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(x){x&&this._date.setTime(x.getTime())}set mask(x){let S;for(this.parts=[];S=g.exec(x);){let M=S.shift(),$=S.findIndex(O=>O!=null);this.parts.push($ in f?f[$]({token:S[$]||M,date:this.date,parts:this.parts,locales:this.locales}):S[$]||M)}let T=this.parts.reduce((M,$)=>(typeof $=="string"&&typeof M[M.length-1]=="string"?M[M.length-1]+=$:M.push($),M),[]);this.parts.splice(0),this.parts.push(...T),this.reset()}moveCursor(x){this.typed="",this.cursor=x,this.fire()}reset(){this.moveCursor(this.parts.findIndex(x=>x instanceof v)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
63
+ `),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()}_(l,a){if(l===" ")this.value=!this.value;else if(l==="1")this.value=!0;else if(l==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(c.line+s.to(0)+this.outputText))}}return rt=i,rt}var it,Dr;function G(){if(Dr)return it;Dr=1;class e{constructor({token:o,date:t,parts:s,locales:c}){this.token=o,this.date=t||new Date,this.parts=s||[this],this.locales=c||{}}up(){}down(){}next(){const o=this.parts.indexOf(this);return this.parts.find((t,s)=>s>o&&t instanceof e)}setTo(o){}prev(){let o=[].concat(this.parts).reverse();const t=o.indexOf(this);return o.find((s,c)=>c>t&&s instanceof e)}toString(){return String(this.date)}}return it=e,it}var st,Er;function es(){if(Er)return st;Er=1;const e=G();class r extends e{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}}return st=r,st}var nt,_r;function ts(){if(_r)return nt;_r=1;const e=G(),r=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class o extends e{constructor(s={}){super(s)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(s){this.date.setDate(parseInt(s.substr(-2)))}toString(){let s=this.date.getDate(),c=this.date.getDay();return this.token==="DD"?String(s).padStart(2,"0"):this.token==="Do"?s+r(s):this.token==="d"?c+1:this.token==="ddd"?this.locales.weekdaysShort[c]:this.token==="dddd"?this.locales.weekdays[c]:s}}return nt=o,nt}var ot,qr;function rs(){if(qr)return ot;qr=1;const e=G();class r extends e{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}}return ot=r,ot}var lt,Ar;function is(){if(Ar)return lt;Ar=1;const e=G();class r extends e{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)}}return lt=r,lt}var ht,Ir;function ss(){if(Ir)return ht;Ir=1;const e=G();class r extends e{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}}return ht=r,ht}var ut,jr;function ns(){if(jr)return ut;jr=1;const e=G();class r extends e{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(),s=this.token.length;return s===2?String(t+1).padStart(2,"0"):s===3?this.locales.monthsShort[t]:s===4?this.locales.months[t]:String(t+1)}}return ut=r,ut}var at,Fr;function os(){if(Fr)return at;Fr=1;const e=G();class r extends e{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}}return at=r,at}var ct,Nr;function ls(){if(Nr)return ct;Nr=1;const e=G();class r extends e{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}}return ct=r,ct}var dt,Lr;function hs(){return Lr||(Lr=1,dt={DatePart:G(),Meridiem:es(),Day:ts(),Hours:rs(),Milliseconds:is(),Minutes:ss(),Month:ns(),Seconds:os(),Year:ls()}),dt}var ft,Yr;function us(){if(Yr)return ft;Yr=1;const e=q(),r=z(),{style:o,clear:t,figures:s}=B(),{erase:c,cursor:i}=A(),{DatePart:b,Meridiem:l,Day:a,Hours:n,Milliseconds:m,Minutes:f,Month:h,Seconds:u,Year:v}=hs(),g=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,d={1:({token:w})=>w.replace(/\\(.)/g,"$1"),2:w=>new a(w),3:w=>new h(w),4:w=>new v(w),5:w=>new l(w),6:w=>new n(w),7:w=>new f(w),8:w=>new u(w),9:w=>new m(w)},p={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 y extends r{constructor(x={}){super(x),this.msg=x.message,this.cursor=0,this.typed="",this.locales=Object.assign(p,x.locales),this._date=x.initial||new Date,this.errorMsg=x.error||"Please Enter A Valid Value",this.validator=x.validate||(()=>!0),this.mask=x.mask||"YYYY-MM-DD HH:mm:ss",this.clear=t("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(x){x&&this._date.setTime(x.getTime())}set mask(x){let $;for(this.parts=[];$=g.exec(x);){let O=$.shift(),M=$.findIndex(S=>S!=null);this.parts.push(M in d?d[M]({token:$[M]||O,date:this.date,parts:this.parts,locales:this.locales}):$[M]||O)}let T=this.parts.reduce((O,M)=>(typeof M=="string"&&typeof O[O.length-1]=="string"?O[O.length-1]+=M:O.push(M),O),[]);this.parts.splice(0),this.parts.push(...T),this.reset()}moveCursor(x){this.typed="",this.cursor=x,this.fire()}reset(){this.moveCursor(this.parts.findIndex(x=>x instanceof b)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
64
64
  `),this.close()}async validate(){let x=await this.validator(this.value);typeof x=="string"&&(this.errorMsg=x,x=!1),this.error=!x}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(`
65
- `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let x=this.parts[this.cursor].prev();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}right(){let x=this.parts[this.cursor].next();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}next(){let x=this.parts[this.cursor].next();this.moveCursor(x?this.parts.indexOf(x):this.parts.findIndex(S=>S instanceof v)),this.render()}_(x){/\d/.test(x)&&(this.typed+=x,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(!1),this.parts.reduce((x,S,T)=>x.concat(T===this.cursor&&!this.done?e.cyan().underline(S.toString()):S),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
66
- `).reduce((x,S,T)=>x+`
67
- ${T?" ":o.pointerSmall} ${e.red().italic(S)}`,"")),this.out.write(m.line+s.to(0)+this.outputText))}}return ft=b,ft}var pt,Lr;function hs(){if(Lr)return pt;Lr=1;const e=E(),r=z(),{cursor:i,erase:t}=_(),{style:o,figures:m,clear:s,lines:v}=B(),h=/[0-9]/,a=c=>c!==void 0,n=(c,l)=>{let u=Math.pow(10,l);return Math.round(c*u)/u};class d extends r{constructor(l={}){super(l),this.transform=o.render(l.style),this.msg=l.message,this.initial=a(l.initial)?l.initial:"",this.float=!!l.float,this.round=l.round||2,this.inc=l.increment||1,this.min=a(l.min)?l.min:-1/0,this.max=a(l.max)?l.max:1/0,this.errorMsg=l.error||"Please Enter A Valid Value",this.validator=l.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(l){!l&&l!==0?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${n(l,this.round)}`),this._value=n(l,this.round)),this.fire()}get value(){return this._value}parse(l){return this.float?parseFloat(l):parseInt(l)}valid(l){return l==="-"||l==="."&&this.float||h.test(l)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let l=this.value;this.value=l!==""?l:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
68
- `),this.close()}async validate(){let l=await this.validator(this.value);typeof l=="string"&&(this.errorMsg=l,l=!1),this.error=!l}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let l=this.value;this.value=l!==""?l:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
69
- `),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 l=this.value.toString();if(l.length===0)return this.bell();this.value=this.parse(l=l.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()}_(l,u){if(!this.valid(l))return this.bell();const y=Date.now();if(y-this.lastHit>1e3&&(this.typed=""),this.typed+=l,this.lastHit=y,this.color="cyan",l===".")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(i.down(v(this.outputError,this.out.columns)-1)+s(this.outputError,this.out.columns)),this.out.write(s(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(this.done),!this.done||!this.done&&!this.placeholder?e[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
70
- `).reduce((l,u,y)=>l+`
71
- ${y?" ":m.pointerSmall} ${e.red().italic(u)}`,"")),this.out.write(t.line+i.to(0)+this.outputText+i.save+this.outputError+i.restore))}}return pt=d,pt}var mt,Yr;function kr(){if(Yr)return mt;Yr=1;const e=E(),{cursor:r}=_(),i=z(),{clear:t,figures:o,style:m,wrap:s,entriesToDisplay:v}=B();class h extends i{constructor(n={}){super(n),this.msg=n.message,this.cursor=n.cursor||0,this.scrollIndex=n.cursor||0,this.hint=n.hint||"",this.warn=n.warn||"- This option is disabled -",this.minSelected=n.min,this.showMinError=!1,this.maxChoices=n.max,this.instructions=n.instructions,this.optionsPerPage=n.optionsPerPage||10,this.value=n.choices.map((d,c)=>(typeof d=="string"&&(d={title:d,value:c}),{title:d&&(d.title||d.value||d),description:d&&d.description,value:d&&(d.value===void 0?c:d.value),selected:d&&d.selected,disabled:d&&d.disabled})),this.clear=t("",this.out.columns),n.overrideRender||this.render()}reset(){this.value.map(n=>!n.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(n=>n.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
72
- `),this.close()}submit(){const n=this.value.filter(d=>d.selected);this.minSelected&&n.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
73
- `),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(n=>n.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const n=this.value[this.cursor];if(n.selected)n.selected=!1,this.render();else{if(n.disabled||this.value.filter(d=>d.selected).length>=this.maxChoices)return this.bell();n.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const n=!this.value[this.cursor].selected;this.value.filter(d=>!d.disabled).forEach(d=>d.selected=n),this.render()}_(n,d){if(n===" ")this.handleSpaceToggle();else if(n==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
65
+ `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let x=this.parts[this.cursor].prev();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}right(){let x=this.parts[this.cursor].next();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}next(){let x=this.parts[this.cursor].next();this.moveCursor(x?this.parts.indexOf(x):this.parts.findIndex($=>$ instanceof b)),this.render()}_(x){/\d/.test(x)&&(this.typed+=x,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(!1),this.parts.reduce((x,$,T)=>x.concat(T===this.cursor&&!this.done?e.cyan().underline($.toString()):$),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
66
+ `).reduce((x,$,T)=>x+`
67
+ ${T?" ":s.pointerSmall} ${e.red().italic($)}`,"")),this.out.write(c.line+i.to(0)+this.outputText))}}return ft=y,ft}var pt,kr;function as(){if(kr)return pt;kr=1;const e=q(),r=z(),{cursor:o,erase:t}=A(),{style:s,figures:c,clear:i,lines:b}=B(),l=/[0-9]/,a=f=>f!==void 0,n=(f,h)=>{let u=Math.pow(10,h);return Math.round(f*u)/u};class m extends r{constructor(h={}){super(h),this.transform=s.render(h.style),this.msg=h.message,this.initial=a(h.initial)?h.initial:"",this.float=!!h.float,this.round=h.round||2,this.inc=h.increment||1,this.min=a(h.min)?h.min:-1/0,this.max=a(h.max)?h.max:1/0,this.errorMsg=h.error||"Please Enter A Valid Value",this.validator=h.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(h){!h&&h!==0?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${n(h,this.round)}`),this._value=n(h,this.round)),this.fire()}get value(){return this._value}parse(h){return this.float?parseFloat(h):parseInt(h)}valid(h){return h==="-"||h==="."&&this.float||l.test(h)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let h=this.value;this.value=h!==""?h:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
68
+ `),this.close()}async validate(){let h=await this.validator(this.value);typeof h=="string"&&(this.errorMsg=h,h=!1),this.error=!h}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let h=this.value;this.value=h!==""?h:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
69
+ `),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 h=this.value.toString();if(h.length===0)return this.bell();this.value=this.parse(h=h.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()}_(h,u){if(!this.valid(h))return this.bell();const v=Date.now();if(v-this.lastHit>1e3&&(this.typed=""),this.typed+=h,this.lastHit=v,this.color="cyan",h===".")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(o.down(b(this.outputError,this.out.columns)-1)+i(this.outputError,this.out.columns)),this.out.write(i(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[s.symbol(this.done,this.aborted),e.bold(this.msg),s.delimiter(this.done),!this.done||!this.done&&!this.placeholder?e[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
70
+ `).reduce((h,u,v)=>h+`
71
+ ${v?" ":c.pointerSmall} ${e.red().italic(u)}`,"")),this.out.write(t.line+o.to(0)+this.outputText+o.save+this.outputError+o.restore))}}return pt=m,pt}var mt,Br;function Vr(){if(Br)return mt;Br=1;const e=q(),{cursor:r}=A(),o=z(),{clear:t,figures:s,style:c,wrap:i,entriesToDisplay:b}=B();class l extends o{constructor(n={}){super(n),this.msg=n.message,this.cursor=n.cursor||0,this.scrollIndex=n.cursor||0,this.hint=n.hint||"",this.warn=n.warn||"- This option is disabled -",this.minSelected=n.min,this.showMinError=!1,this.maxChoices=n.max,this.instructions=n.instructions,this.optionsPerPage=n.optionsPerPage||10,this.value=n.choices.map((m,f)=>(typeof m=="string"&&(m={title:m,value:f}),{title:m&&(m.title||m.value||m),description:m&&m.description,value:m&&(m.value===void 0?f:m.value),selected:m&&m.selected,disabled:m&&m.disabled})),this.clear=t("",this.out.columns),n.overrideRender||this.render()}reset(){this.value.map(n=>!n.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(n=>n.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
72
+ `),this.close()}submit(){const n=this.value.filter(m=>m.selected);this.minSelected&&n.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
73
+ `),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(n=>n.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const n=this.value[this.cursor];if(n.selected)n.selected=!1,this.render();else{if(n.disabled||this.value.filter(m=>m.selected).length>=this.maxChoices)return this.bell();n.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const n=!this.value[this.cursor].selected;this.value.filter(m=>!m.disabled).forEach(m=>m.selected=n),this.render()}_(n,m){if(n===" ")this.handleSpaceToggle();else if(n==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
74
74
  Instructions:
75
- ${o.arrowUp}/${o.arrowDown}: Highlight option
76
- ${o.arrowLeft}/${o.arrowRight}/[space]: Toggle selection
75
+ ${s.arrowUp}/${s.arrowDown}: Highlight option
76
+ ${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection
77
77
  `+(this.maxChoices===void 0?` a: Toggle all
78
- `:"")+" enter/return: Complete answer":""}renderOption(n,d,c,l){const u=(d.selected?e.green(o.radioOn):o.radioOff)+" "+l+" ";let y,g;return d.disabled?y=n===c?e.gray().underline(d.title):e.strikethrough().gray(d.title):(y=n===c?e.cyan().underline(d.title):d.title,n===c&&d.description&&(g=` - ${d.description}`,(u.length+y.length+g.length>=this.out.columns||d.description.split(/\r?\n/).length>1)&&(g=`
79
- `+s(d.description,{margin:u.length,width:this.out.columns})))),u+y+e.gray(g||"")}paginateOptions(n){if(n.length===0)return e.red("No matches for this query.");let{startIndex:d,endIndex:c}=v(this.cursor,n.length,this.optionsPerPage),l,u=[];for(let y=d;y<c;y++)y===d&&d>0?l=o.arrowUp:y===c-1&&c<n.length?l=o.arrowDown:l=" ",u.push(this.renderOption(this.cursor,n[y],y,l));return`
78
+ `:"")+" enter/return: Complete answer":""}renderOption(n,m,f,h){const u=(m.selected?e.green(s.radioOn):s.radioOff)+" "+h+" ";let v,g;return m.disabled?v=n===f?e.gray().underline(m.title):e.strikethrough().gray(m.title):(v=n===f?e.cyan().underline(m.title):m.title,n===f&&m.description&&(g=` - ${m.description}`,(u.length+v.length+g.length>=this.out.columns||m.description.split(/\r?\n/).length>1)&&(g=`
79
+ `+i(m.description,{margin:u.length,width:this.out.columns})))),u+v+e.gray(g||"")}paginateOptions(n){if(n.length===0)return e.red("No matches for this query.");let{startIndex:m,endIndex:f}=b(this.cursor,n.length,this.optionsPerPage),h,u=[];for(let v=m;v<f;v++)v===m&&m>0?h=s.arrowUp:v===f-1&&f<n.length?h=s.arrowDown:h=" ",u.push(this.renderOption(this.cursor,n[v],v,h));return`
80
80
  `+u.join(`
81
- `)}renderOptions(n){return this.done?"":this.paginateOptions(n)}renderDoneOrInstructions(){if(this.done)return this.value.filter(d=>d.selected).map(d=>d.title).join(", ");const n=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&n.push(e.yellow(this.warn)),n.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let n=[m.symbol(this.done,this.aborted),e.bold(this.msg),m.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.value),this.out.write(this.clear+n),this.clear=t(n,this.out.columns)}}return mt=h,mt}var gt,Br;function us(){if(Br)return gt;Br=1;const e=E(),r=z(),{erase:i,cursor:t}=_(),{style:o,clear:m,figures:s,wrap:v,entriesToDisplay:h}=B(),a=(l,u)=>l[u]&&(l[u].value||l[u].title||l[u]),n=(l,u)=>l[u]&&(l[u].title||l[u].value||l[u]),d=(l,u)=>{const y=l.findIndex(g=>g.value===u||g.title===u);return y>-1?y:void 0};class c extends r{constructor(u={}){super(u),this.msg=u.message,this.suggest=u.suggest,this.choices=u.choices,this.initial=typeof u.initial=="number"?u.initial:d(u.choices,u.initial),this.select=this.initial||u.cursor||0,this.i18n={noMatches:u.noMatches||"no matches found"},this.fallback=u.fallback||this.initial,this.clearFirst=u.clearFirst||!1,this.suggestions=[],this.input="",this.limit=u.limit||10,this.cursor=0,this.transform=o.render(u.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=m("",this.out.columns),this.complete(this.render),this.render()}set fallback(u){this._fb=Number.isSafeInteger(parseInt(u))?parseInt(u):u}get fallback(){let u;return typeof this._fb=="number"?u=this.choices[this._fb]:typeof this._fb=="string"&&(u={title:this._fb}),u||this._fb||{title:this.i18n.noMatches}}moveSelect(u){this.select=u,this.suggestions.length>0?this.value=a(this.suggestions,u):this.value=this.fallback.value,this.fire()}async complete(u){const y=this.completing=this.suggest(this.input,this.choices),g=await y;if(this.completing!==y)return;this.suggestions=g.map((p,b,w)=>({title:n(w,b),value:a(w,b),description:p.description})),this.completing=!1;const f=Math.max(g.length-1,0);this.moveSelect(Math.min(f,this.select)),u&&u()}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(`
81
+ `)}renderOptions(n){return this.done?"":this.paginateOptions(n)}renderDoneOrInstructions(){if(this.done)return this.value.filter(m=>m.selected).map(m=>m.title).join(", ");const n=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&n.push(e.yellow(this.warn)),n.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let n=[c.symbol(this.done,this.aborted),e.bold(this.msg),c.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.value),this.out.write(this.clear+n),this.clear=t(n,this.out.columns)}}return mt=l,mt}var gt,Hr;function cs(){if(Hr)return gt;Hr=1;const e=q(),r=z(),{erase:o,cursor:t}=A(),{style:s,clear:c,figures:i,wrap:b,entriesToDisplay:l}=B(),a=(h,u)=>h[u]&&(h[u].value||h[u].title||h[u]),n=(h,u)=>h[u]&&(h[u].title||h[u].value||h[u]),m=(h,u)=>{const v=h.findIndex(g=>g.value===u||g.title===u);return v>-1?v:void 0};class f extends r{constructor(u={}){super(u),this.msg=u.message,this.suggest=u.suggest,this.choices=u.choices,this.initial=typeof u.initial=="number"?u.initial:m(u.choices,u.initial),this.select=this.initial||u.cursor||0,this.i18n={noMatches:u.noMatches||"no matches found"},this.fallback=u.fallback||this.initial,this.clearFirst=u.clearFirst||!1,this.suggestions=[],this.input="",this.limit=u.limit||10,this.cursor=0,this.transform=s.render(u.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=c("",this.out.columns),this.complete(this.render),this.render()}set fallback(u){this._fb=Number.isSafeInteger(parseInt(u))?parseInt(u):u}get fallback(){let u;return typeof this._fb=="number"?u=this.choices[this._fb]:typeof this._fb=="string"&&(u={title:this._fb}),u||this._fb||{title:this.i18n.noMatches}}moveSelect(u){this.select=u,this.suggestions.length>0?this.value=a(this.suggestions,u):this.value=this.fallback.value,this.fire()}async complete(u){const v=this.completing=this.suggest(this.input,this.choices),g=await v;if(this.completing!==v)return;this.suggestions=g.map((p,y,w)=>({title:n(w,y),value:a(w,y),description:p.description})),this.completing=!1;const d=Math.max(g.length-1,0);this.moveSelect(Math.min(d,this.select)),u&&u()}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(`
82
82
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
83
83
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
84
- `),this.close()}_(u,y){let g=this.input.slice(0,this.cursor),f=this.input.slice(this.cursor);this.input=`${g}${u}${f}`,this.cursor=g.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let u=this.input.slice(0,this.cursor-1),y=this.input.slice(this.cursor);this.input=`${u}${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 u=this.input.slice(0,this.cursor),y=this.input.slice(this.cursor+1);this.input=`${u}${y}`,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(u,y,g,f){let p,b=g?s.arrowUp:f?s.arrowDown:" ",w=y?e.cyan().underline(u.title):u.title;return b=(y?e.cyan(s.pointer)+" ":" ")+b,u.description&&(p=` - ${u.description}`,(b.length+w.length+p.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(p=`
85
- `+v(u.description,{margin:3,width:this.out.columns}))),b+" "+w+e.gray(p||"")}render(){if(this.closed)return;this.firstRender?this.out.write(t.hide):this.out.write(m(this.outputText,this.out.columns)),super.render();let{startIndex:u,endIndex:y}=h(this.select,this.choices.length,this.limit);if(this.outputText=[o.symbol(this.done,this.aborted,this.exited),e.bold(this.msg),o.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const g=this.suggestions.slice(u,y).map((f,p)=>this.renderOption(f,this.select===p+u,p===0&&u>0,p+u===y-1&&y<this.choices.length)).join(`
84
+ `),this.close()}_(u,v){let g=this.input.slice(0,this.cursor),d=this.input.slice(this.cursor);this.input=`${g}${u}${d}`,this.cursor=g.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let u=this.input.slice(0,this.cursor-1),v=this.input.slice(this.cursor);this.input=`${u}${v}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let u=this.input.slice(0,this.cursor),v=this.input.slice(this.cursor+1);this.input=`${u}${v}`,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(u,v,g,d){let p,y=g?i.arrowUp:d?i.arrowDown:" ",w=v?e.cyan().underline(u.title):u.title;return y=(v?e.cyan(i.pointer)+" ":" ")+y,u.description&&(p=` - ${u.description}`,(y.length+w.length+p.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(p=`
85
+ `+b(u.description,{margin:3,width:this.out.columns}))),y+" "+w+e.gray(p||"")}render(){if(this.closed)return;this.firstRender?this.out.write(t.hide):this.out.write(c(this.outputText,this.out.columns)),super.render();let{startIndex:u,endIndex:v}=l(this.select,this.choices.length,this.limit);if(this.outputText=[s.symbol(this.done,this.aborted,this.exited),e.bold(this.msg),s.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const g=this.suggestions.slice(u,v).map((d,p)=>this.renderOption(d,this.select===p+u,p===0&&u>0,p+u===v-1&&v<this.choices.length)).join(`
86
86
  `);this.outputText+=`
87
- `+(g||e.gray(this.fallback.title))}this.out.write(i.line+t.to(0)+this.outputText)}}return gt=c,gt}var vt,Vr;function as(){if(Vr)return vt;Vr=1;const e=E(),{cursor:r}=_(),i=kr(),{clear:t,style:o,figures:m}=B();class s extends i{constructor(h={}){h.overrideRender=!0,super(h),this.inputValue="",this.clear=t("",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(h=>h.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(){const h=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const a=this.filteredOptions.findIndex(n=>n===h);this.cursor=a<0?0:a,this.render()}handleSpaceToggle(){const h=this.filteredOptions[this.cursor];if(h.selected)h.selected=!1,this.render();else{if(h.disabled||this.value.filter(a=>a.selected).length>=this.maxChoices)return this.bell();h.selected=!0,this.render()}}handleInputChange(h){this.inputValue=this.inputValue+h,this.updateFilteredOptions()}_(h,a){h===" "?this.handleSpaceToggle():this.handleInputChange(h)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
87
+ `+(g||e.gray(this.fallback.title))}this.out.write(o.line+t.to(0)+this.outputText)}}return gt=f,gt}var vt,Ur;function ds(){if(Ur)return vt;Ur=1;const e=q(),{cursor:r}=A(),o=Vr(),{clear:t,style:s,figures:c}=B();class i extends o{constructor(l={}){l.overrideRender=!0,super(l),this.inputValue="",this.clear=t("",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(l=>l.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(){const l=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const a=this.filteredOptions.findIndex(n=>n===l);this.cursor=a<0?0:a,this.render()}handleSpaceToggle(){const l=this.filteredOptions[this.cursor];if(l.selected)l.selected=!1,this.render();else{if(l.disabled||this.value.filter(a=>a.selected).length>=this.maxChoices)return this.bell();l.selected=!0,this.render()}}handleInputChange(l){this.inputValue=this.inputValue+l,this.updateFilteredOptions()}_(l,a){l===" "?this.handleSpaceToggle():this.handleInputChange(l)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
88
88
  Instructions:
89
- ${m.arrowUp}/${m.arrowDown}: Highlight option
90
- ${m.arrowLeft}/${m.arrowRight}/[space]: Toggle selection
89
+ ${c.arrowUp}/${c.arrowDown}: Highlight option
90
+ ${c.arrowLeft}/${c.arrowRight}/[space]: Toggle selection
91
91
  [a,b,c]/delete: Filter choices
92
92
  enter/return: Complete answer
93
93
  `:""}renderCurrentInput(){return`
94
94
  Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}
95
- `}renderOption(h,a,n){let d;return a.disabled?d=h===n?e.gray().underline(a.title):e.strikethrough().gray(a.title):d=h===n?e.cyan().underline(a.title):a.title,(a.selected?e.green(m.radioOn):m.radioOff)+" "+d}renderDoneOrInstructions(){if(this.done)return this.value.filter(a=>a.selected).map(a=>a.title).join(", ");const h=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&h.push(e.yellow(this.warn)),h.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let h=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(h+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),h+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+h),this.clear=t(h,this.out.columns)}}return vt=s,vt}var bt,Hr;function cs(){if(Hr)return bt;Hr=1;const e=E(),r=z(),{style:i,clear:t}=B(),{erase:o,cursor:m}=_();class s extends r{constructor(h={}){super(h),this.msg=h.message,this.value=h.initial,this.initialValue=!!h.initial,this.yesMsg=h.yes||"yes",this.yesOption=h.yesOption||"(Y/n)",this.noMsg=h.no||"no",this.noOption=h.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
+ `}renderOption(l,a,n){let m;return a.disabled?m=l===n?e.gray().underline(a.title):e.strikethrough().gray(a.title):m=l===n?e.cyan().underline(a.title):a.title,(a.selected?e.green(c.radioOn):c.radioOff)+" "+m}renderDoneOrInstructions(){if(this.done)return this.value.filter(a=>a.selected).map(a=>a.title).join(", ");const l=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&l.push(e.yellow(this.warn)),l.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let l=[s.symbol(this.done,this.aborted),e.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(l+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),l+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+l),this.clear=t(l,this.out.columns)}}return vt=i,vt}var bt,Gr;function fs(){if(Gr)return bt;Gr=1;const e=q(),r=z(),{style:o,clear:t}=B(),{erase:s,cursor:c}=A();class i extends r{constructor(l={}){super(l),this.msg=l.message,this.value=l.initial,this.initialValue=!!l.initial,this.yesMsg=l.yes||"yes",this.yesOption=l.yesOption||"(Y/n)",this.noMsg=l.no||"no",this.noOption=l.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(`
96
96
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
97
- `),this.close()}_(h,a){return h.toLowerCase()==="y"?(this.value=!0,this.submit()):h.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(m.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(o.line+m.to(0)+this.outputText))}}return bt=s,bt}var yt,Ur;function ds(){return Ur||(Ur=1,yt={TextPrompt:zi(),SelectPrompt:Ki(),TogglePrompt:Zi(),DatePrompt:ls(),NumberPrompt:hs(),MultiselectPrompt:kr(),AutocompletePrompt:us(),AutocompleteMultiselectPrompt:as(),ConfirmPrompt:cs()}),yt}var Gr;function fs(){return Gr||(Gr=1,function(e){const r=e,i=ds(),t=s=>s;function o(s,v,h={}){return new Promise((a,n)=>{const d=new i[s](v),c=h.onAbort||t,l=h.onSubmit||t,u=h.onExit||t;d.on("state",v.onState||t),d.on("submit",y=>a(l(y))),d.on("exit",y=>a(u(y))),d.on("abort",y=>n(c(y)))})}r.text=s=>o("TextPrompt",s),r.password=s=>(s.style="password",r.text(s)),r.invisible=s=>(s.style="invisible",r.text(s)),r.number=s=>o("NumberPrompt",s),r.date=s=>o("DatePrompt",s),r.confirm=s=>o("ConfirmPrompt",s),r.list=s=>{const v=s.separator||",";return o("TextPrompt",s,{onSubmit:h=>h.split(v).map(a=>a.trim())})},r.toggle=s=>o("TogglePrompt",s),r.select=s=>o("SelectPrompt",s),r.multiselect=s=>{s.choices=[].concat(s.choices||[]);const v=h=>h.filter(a=>a.selected).map(a=>a.value);return o("MultiselectPrompt",s,{onAbort:v,onSubmit:v})},r.autocompleteMultiselect=s=>{s.choices=[].concat(s.choices||[]);const v=h=>h.filter(a=>a.selected).map(a=>a.value);return o("AutocompleteMultiselectPrompt",s,{onAbort:v,onSubmit:v})};const m=(s,v)=>Promise.resolve(v.filter(h=>h.title.slice(0,s.length).toLowerCase()===s.toLowerCase()));r.autocomplete=s=>(s.suggest=s.suggest||m,s.choices=[].concat(s.choices||[]),o("AutocompletePrompt",s))}(Be)),Be}var wt,Jr;function ps(){if(Jr)return wt;Jr=1;const e=fs(),r=["suggest","format","onState","validate","onRender","type"],i=()=>{};async function t(v=[],{onSubmit:h=i,onCancel:a=i}={}){const n={},d=t._override||{};v=[].concat(v);let c,l,u,y,g,f;const p=async(b,w,x=!1)=>{if(!(!x&&b.validate&&b.validate(w)!==!0))return b.format?await b.format(w,n):w};for(l of v)if({name:y,type:g}=l,typeof g=="function"&&(g=await g(c,{...n},l),l.type=g),!!g){for(let b in l){if(r.includes(b))continue;let w=l[b];l[b]=typeof w=="function"?await w(c,{...n},f):w}if(f=l,typeof l.message!="string")throw new Error("prompt message is required");if({name:y,type:g}=l,e[g]===void 0)throw new Error(`prompt type (${g}) is not defined`);if(d[l.name]!==void 0&&(c=await p(l,d[l.name]),c!==void 0)){n[y]=c;continue}try{c=t._injected?o(t._injected,l.initial):await e[g](l),n[y]=c=await p(l,c,!0),u=await h(l,c,n)}catch{u=!await a(l,n)}if(u)return n}return n}function o(v,h){const a=v.shift();if(a instanceof Error)throw a;return a===void 0?h:a}function m(v){t._injected=(t._injected||[]).concat(v)}function s(v){t._override=Object.assign({},v)}return wt=Object.assign(t,{prompt:t,prompts:e,inject:m,override:s}),wt}function ms(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let r=0,i=process.versions.node.split(".").map(Number);for(;r<e.length;r++){if(i[r]>e[r])return!1;if(e[r]>i[r])return!0}return!1}var gs=ms("8.6.0")?Bi():ps(),ie=Et(gs);function vs(e,r){var i=e;r.slice(0,-1).forEach(function(o){i=i[o]||{}});var t=r[r.length-1];return t in i}function Wr(e){return typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function zr(e,r){return r==="constructor"&&typeof e[r]=="function"||r==="__proto__"}var bs=function(e,r){r||(r={});var i={bools:{},strings:{},unknownFn:null};typeof r.unknown=="function"&&(i.unknownFn=r.unknown),typeof r.boolean=="boolean"&&r.boolean?i.allBools=!0:[].concat(r.boolean).filter(Boolean).forEach(function(w){i.bools[w]=!0});var t={};function o(w){return t[w].some(function(x){return i.bools[x]})}Object.keys(r.alias||{}).forEach(function(w){t[w]=[].concat(r.alias[w]),t[w].forEach(function(x){t[x]=[w].concat(t[w].filter(function(S){return x!==S}))})}),[].concat(r.string).filter(Boolean).forEach(function(w){i.strings[w]=!0,t[w]&&[].concat(t[w]).forEach(function(x){i.strings[x]=!0})});var m=r.default||{},s={_:[]};function v(w,x){return i.allBools&&/^--[^=]+$/.test(x)||i.strings[w]||i.bools[w]||t[w]}function h(w,x,S){for(var T=w,M=0;M<x.length-1;M++){var $=x[M];if(zr(T,$))return;T[$]===void 0&&(T[$]={}),(T[$]===Object.prototype||T[$]===Number.prototype||T[$]===String.prototype)&&(T[$]={}),T[$]===Array.prototype&&(T[$]=[]),T=T[$]}var O=x[x.length-1];zr(T,O)||((T===Object.prototype||T===Number.prototype||T===String.prototype)&&(T={}),T===Array.prototype&&(T=[]),T[O]===void 0||i.bools[O]||typeof T[O]=="boolean"?T[O]=S:Array.isArray(T[O])?T[O].push(S):T[O]=[T[O],S])}function a(w,x,S){if(!(S&&i.unknownFn&&!v(w,S)&&i.unknownFn(S)===!1)){var T=!i.strings[w]&&Wr(x)?Number(x):x;h(s,w.split("."),T),(t[w]||[]).forEach(function(M){h(s,M.split("."),T)})}}Object.keys(i.bools).forEach(function(w){a(w,m[w]===void 0?!1:m[w])});var n=[];e.indexOf("--")!==-1&&(n=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var d=0;d<e.length;d++){var c=e[d],l,u;if(/^--.+=/.test(c)){var y=c.match(/^--([^=]+)=([\s\S]*)$/);l=y[1];var g=y[2];i.bools[l]&&(g=g!=="false"),a(l,g,c)}else if(/^--no-.+/.test(c))l=c.match(/^--no-(.+)/)[1],a(l,!1,c);else if(/^--.+/.test(c))l=c.match(/^--(.+)/)[1],u=e[d+1],u!==void 0&&!/^(-|--)[^-]/.test(u)&&!i.bools[l]&&!i.allBools&&(!t[l]||!o(l))?(a(l,u,c),d+=1):/^(true|false)$/.test(u)?(a(l,u==="true",c),d+=1):a(l,i.strings[l]?"":!0,c);else if(/^-[^-]+/.test(c)){for(var f=c.slice(1,-1).split(""),p=!1,b=0;b<f.length;b++){if(u=c.slice(b+2),u==="-"){a(f[b],u,c);continue}if(/[A-Za-z]/.test(f[b])&&u[0]==="="){a(f[b],u.slice(1),c),p=!0;break}if(/[A-Za-z]/.test(f[b])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(u)){a(f[b],u,c),p=!0;break}if(f[b+1]&&f[b+1].match(/\W/)){a(f[b],c.slice(b+2),c),p=!0;break}else a(f[b],i.strings[f[b]]?"":!0,c)}l=c.slice(-1)[0],!p&&l!=="-"&&(e[d+1]&&!/^(-|--)[^-]/.test(e[d+1])&&!i.bools[l]&&(!t[l]||!o(l))?(a(l,e[d+1],c),d+=1):e[d+1]&&/^(true|false)$/.test(e[d+1])?(a(l,e[d+1]==="true",c),d+=1):a(l,i.strings[l]?"":!0,c))}else if((!i.unknownFn||i.unknownFn(c)!==!1)&&s._.push(i.strings._||!Wr(c)?c:Number(c)),r.stopEarly){s._.push.apply(s._,e.slice(d+1));break}}return Object.keys(m).forEach(function(w){vs(s,w.split("."))||(h(s,w.split("."),m[w]),(t[w]||[]).forEach(function(x){h(s,x.split("."),m[w])}))}),r["--"]?s["--"]=n.slice():n.forEach(function(w){s._.push(w)}),s},ys=Et(bs);const xt=10,Kr=(e=0)=>r=>`\x1B[${r+e}m`,Zr=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,Xr=(e=0)=>(r,i,t)=>`\x1B[${38+e};2;${r};${i};${t}m`,C={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(C.modifier);const ws=Object.keys(C.color),xs=Object.keys(C.bgColor);[...ws,...xs];function Ss(){const e=new Map;for(const[r,i]of Object.entries(C)){for(const[t,o]of Object.entries(i))C[t]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},i[t]=C[t],e.set(o[0],o[1]);Object.defineProperty(C,r,{value:i,enumerable:!1})}return Object.defineProperty(C,"codes",{value:e,enumerable:!1}),C.color.close="\x1B[39m",C.bgColor.close="\x1B[49m",C.color.ansi=Kr(),C.color.ansi256=Zr(),C.color.ansi16m=Xr(),C.bgColor.ansi=Kr(xt),C.bgColor.ansi256=Zr(xt),C.bgColor.ansi16m=Xr(xt),Object.defineProperties(C,{rgbToAnsi256:{value(r,i,t){return r===i&&i===t?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(i/255*5)+Math.round(t/255*5)},enumerable:!1},hexToRgb:{value(r){const i=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!i)return[0,0,0];let[t]=i;t.length===3&&(t=[...t].map(m=>m+m).join(""));const o=Number.parseInt(t,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:r=>C.rgbToAnsi256(...C.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let i,t,o;if(r>=232)i=((r-232)*10+8)/255,t=i,o=i;else{r-=16;const v=r%36;i=Math.floor(r/36)/5,t=Math.floor(v/6)/5,o=v%6/5}const m=Math.max(i,t,o)*2;if(m===0)return 30;let s=30+(Math.round(o)<<2|Math.round(t)<<1|Math.round(i));return m===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(r,i,t)=>C.ansi256ToAnsi(C.rgbToAnsi256(r,i,t)),enumerable:!1},hexToAnsi:{value:r=>C.ansi256ToAnsi(C.hexToAnsi256(r)),enumerable:!1}}),C}const V=Ss();function L(e,r=globalThis.Deno?globalThis.Deno.args:oe.argv){const i=e.startsWith("-")?"":e.length===1?"-":"--",t=r.indexOf(i+e),o=r.indexOf("--");return t!==-1&&(o===-1||t<o)}const{env:D}=oe;let se;L("no-color")||L("no-colors")||L("color=false")||L("color=never")?se=0:(L("color")||L("colors")||L("color=true")||L("color=always"))&&(se=1);function $s(){if("FORCE_COLOR"in D)return D.FORCE_COLOR==="true"?1:D.FORCE_COLOR==="false"?0:D.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(D.FORCE_COLOR,10),3)}function Ts(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Os(e,{streamIsTTY:r,sniffFlags:i=!0}={}){const t=$s();t!==void 0&&(se=t);const o=i?se:t;if(o===0)return 0;if(i){if(L("color=16m")||L("color=full")||L("color=truecolor"))return 3;if(L("color=256"))return 2}if("TF_BUILD"in D&&"AGENT_NAME"in D)return 1;if(e&&!r&&o===void 0)return 0;const m=o||0;if(D.TERM==="dumb")return m;if(oe.platform==="win32"){const s=ui.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in D)return"GITHUB_ACTIONS"in D||"GITEA_ACTIONS"in D?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in D)||D.CI_NAME==="codeship"?1:m;if("TEAMCITY_VERSION"in D)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(D.TEAMCITY_VERSION)?1:0;if(D.COLORTERM==="truecolor"||D.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in D){const s=Number.parseInt((D.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(D.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(D.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(D.TERM)||"COLORTERM"in D?1:m}function Qr(e,r={}){const i=Os(e,{streamIsTTY:e&&e.isTTY,...r});return Ts(i)}const Ms={stdout:Qr({isTTY:Ct.isatty(1)}),stderr:Qr({isTTY:Ct.isatty(2)})};function Rs(e,r,i){let t=e.indexOf(r);if(t===-1)return e;const o=r.length;let m=0,s="";do s+=e.slice(m,t)+r+i,m=t+o,t=e.indexOf(r,m);while(t!==-1);return s+=e.slice(m),s}function Ps(e,r,i,t){let o=0,m="";do{const s=e[t-1]==="\r";m+=e.slice(o,s?t-1:t)+r+(s?`\r
97
+ `),this.close()}_(l,a){return l.toLowerCase()==="y"?(this.value=!0,this.submit()):l.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(c.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(s.line+c.to(0)+this.outputText))}}return bt=i,bt}var yt,Jr;function ps(){return Jr||(Jr=1,yt={TextPrompt:Zi(),SelectPrompt:Xi(),TogglePrompt:Qi(),DatePrompt:us(),NumberPrompt:as(),MultiselectPrompt:Vr(),AutocompletePrompt:cs(),AutocompleteMultiselectPrompt:ds(),ConfirmPrompt:fs()}),yt}var Wr;function ms(){return Wr||(Wr=1,function(e){const r=e,o=ps(),t=i=>i;function s(i,b,l={}){return new Promise((a,n)=>{const m=new o[i](b),f=l.onAbort||t,h=l.onSubmit||t,u=l.onExit||t;m.on("state",b.onState||t),m.on("submit",v=>a(h(v))),m.on("exit",v=>a(u(v))),m.on("abort",v=>n(f(v)))})}r.text=i=>s("TextPrompt",i),r.password=i=>(i.style="password",r.text(i)),r.invisible=i=>(i.style="invisible",r.text(i)),r.number=i=>s("NumberPrompt",i),r.date=i=>s("DatePrompt",i),r.confirm=i=>s("ConfirmPrompt",i),r.list=i=>{const b=i.separator||",";return s("TextPrompt",i,{onSubmit:l=>l.split(b).map(a=>a.trim())})},r.toggle=i=>s("TogglePrompt",i),r.select=i=>s("SelectPrompt",i),r.multiselect=i=>{i.choices=[].concat(i.choices||[]);const b=l=>l.filter(a=>a.selected).map(a=>a.value);return s("MultiselectPrompt",i,{onAbort:b,onSubmit:b})},r.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const b=l=>l.filter(a=>a.selected).map(a=>a.value);return s("AutocompleteMultiselectPrompt",i,{onAbort:b,onSubmit:b})};const c=(i,b)=>Promise.resolve(b.filter(l=>l.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));r.autocomplete=i=>(i.suggest=i.suggest||c,i.choices=[].concat(i.choices||[]),s("AutocompletePrompt",i))}(Be)),Be}var wt,zr;function gs(){if(zr)return wt;zr=1;const e=ms(),r=["suggest","format","onState","validate","onRender","type"],o=()=>{};async function t(b=[],{onSubmit:l=o,onCancel:a=o}={}){const n={},m=t._override||{};b=[].concat(b);let f,h,u,v,g,d;const p=async(y,w,x=!1)=>{if(!(!x&&y.validate&&y.validate(w)!==!0))return y.format?await y.format(w,n):w};for(h of b)if({name:v,type:g}=h,typeof g=="function"&&(g=await g(f,{...n},h),h.type=g),!!g){for(let y in h){if(r.includes(y))continue;let w=h[y];h[y]=typeof w=="function"?await w(f,{...n},d):w}if(d=h,typeof h.message!="string")throw new Error("prompt message is required");if({name:v,type:g}=h,e[g]===void 0)throw new Error(`prompt type (${g}) is not defined`);if(m[h.name]!==void 0&&(f=await p(h,m[h.name]),f!==void 0)){n[v]=f;continue}try{f=t._injected?s(t._injected,h.initial):await e[g](h),n[v]=f=await p(h,f,!0),u=await l(h,f,n)}catch{u=!await a(h,n)}if(u)return n}return n}function s(b,l){const a=b.shift();if(a instanceof Error)throw a;return a===void 0?l:a}function c(b){t._injected=(t._injected||[]).concat(b)}function i(b){t._override=Object.assign({},b)}return wt=Object.assign(t,{prompt:t,prompts:e,inject:c,override:i}),wt}var xt,Kr;function vs(){if(Kr)return xt;Kr=1;function e(r){r=(Array.isArray(r)?r:r.split(".")).map(Number);let o=0,t=process.versions.node.split(".").map(Number);for(;o<r.length;o++){if(t[o]>r[o])return!1;if(r[o]>t[o])return!0}return!1}return xt=e("8.6.0")?Hi():gs(),xt}var bs=vs(),ie=qt(bs),St,Zr;function ys(){if(Zr)return St;Zr=1;function e(t,s){var c=t;s.slice(0,-1).forEach(function(b){c=c[b]||{}});var i=s[s.length-1];return i in c}function r(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function o(t,s){return s==="constructor"&&typeof t[s]=="function"||s==="__proto__"}return St=function(t,s){s||(s={});var c={bools:{},strings:{},unknownFn:null};typeof s.unknown=="function"&&(c.unknownFn=s.unknown),typeof s.boolean=="boolean"&&s.boolean?c.allBools=!0:[].concat(s.boolean).filter(Boolean).forEach(function(T){c.bools[T]=!0});var i={};function b(T){return i[T].some(function(O){return c.bools[O]})}Object.keys(s.alias||{}).forEach(function(T){i[T]=[].concat(s.alias[T]),i[T].forEach(function(O){i[O]=[T].concat(i[T].filter(function(M){return O!==M}))})}),[].concat(s.string).filter(Boolean).forEach(function(T){c.strings[T]=!0,i[T]&&[].concat(i[T]).forEach(function(O){c.strings[O]=!0})});var l=s.default||{},a={_:[]};function n(T,O){return c.allBools&&/^--[^=]+$/.test(O)||c.strings[T]||c.bools[T]||i[T]}function m(T,O,M){for(var S=T,R=0;R<O.length-1;R++){var D=O[R];if(o(S,D))return;S[D]===void 0&&(S[D]={}),(S[D]===Object.prototype||S[D]===Number.prototype||S[D]===String.prototype)&&(S[D]={}),S[D]===Array.prototype&&(S[D]=[]),S=S[D]}var C=O[O.length-1];o(S,C)||((S===Object.prototype||S===Number.prototype||S===String.prototype)&&(S={}),S===Array.prototype&&(S=[]),S[C]===void 0||c.bools[C]||typeof S[C]=="boolean"?S[C]=M:Array.isArray(S[C])?S[C].push(M):S[C]=[S[C],M])}function f(T,O,M){if(!(M&&c.unknownFn&&!n(T,M)&&c.unknownFn(M)===!1)){var S=!c.strings[T]&&r(O)?Number(O):O;m(a,T.split("."),S),(i[T]||[]).forEach(function(R){m(a,R.split("."),S)})}}Object.keys(c.bools).forEach(function(T){f(T,l[T]===void 0?!1:l[T])});var h=[];t.indexOf("--")!==-1&&(h=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var u=0;u<t.length;u++){var v=t[u],g,d;if(/^--.+=/.test(v)){var p=v.match(/^--([^=]+)=([\s\S]*)$/);g=p[1];var y=p[2];c.bools[g]&&(y=y!=="false"),f(g,y,v)}else if(/^--no-.+/.test(v))g=v.match(/^--no-(.+)/)[1],f(g,!1,v);else if(/^--.+/.test(v))g=v.match(/^--(.+)/)[1],d=t[u+1],d!==void 0&&!/^(-|--)[^-]/.test(d)&&!c.bools[g]&&!c.allBools&&(!i[g]||!b(g))?(f(g,d,v),u+=1):/^(true|false)$/.test(d)?(f(g,d==="true",v),u+=1):f(g,c.strings[g]?"":!0,v);else if(/^-[^-]+/.test(v)){for(var w=v.slice(1,-1).split(""),x=!1,$=0;$<w.length;$++){if(d=v.slice($+2),d==="-"){f(w[$],d,v);continue}if(/[A-Za-z]/.test(w[$])&&d[0]==="="){f(w[$],d.slice(1),v),x=!0;break}if(/[A-Za-z]/.test(w[$])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){f(w[$],d,v),x=!0;break}if(w[$+1]&&w[$+1].match(/\W/)){f(w[$],v.slice($+2),v),x=!0;break}else f(w[$],c.strings[w[$]]?"":!0,v)}g=v.slice(-1)[0],!x&&g!=="-"&&(t[u+1]&&!/^(-|--)[^-]/.test(t[u+1])&&!c.bools[g]&&(!i[g]||!b(g))?(f(g,t[u+1],v),u+=1):t[u+1]&&/^(true|false)$/.test(t[u+1])?(f(g,t[u+1]==="true",v),u+=1):f(g,c.strings[g]?"":!0,v))}else if((!c.unknownFn||c.unknownFn(v)!==!1)&&a._.push(c.strings._||!r(v)?v:Number(v)),s.stopEarly){a._.push.apply(a._,t.slice(u+1));break}}return Object.keys(l).forEach(function(T){e(a,T.split("."))||(m(a,T.split("."),l[T]),(i[T]||[]).forEach(function(O){m(a,O.split("."),l[T])}))}),s["--"]?a["--"]=h.slice():h.forEach(function(T){a._.push(T)}),a},St}var ws=ys(),xs=qt(ws);const $t=10,Xr=(e=0)=>r=>`\x1B[${r+e}m`,Qr=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,ei=(e=0)=>(r,o,t)=>`\x1B[${38+e};2;${r};${o};${t}m`,E={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(E.modifier);const Ss=Object.keys(E.color),$s=Object.keys(E.bgColor);[...Ss,...$s];function Ts(){const e=new Map;for(const[r,o]of Object.entries(E)){for(const[t,s]of Object.entries(o))E[t]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},o[t]=E[t],e.set(s[0],s[1]);Object.defineProperty(E,r,{value:o,enumerable:!1})}return Object.defineProperty(E,"codes",{value:e,enumerable:!1}),E.color.close="\x1B[39m",E.bgColor.close="\x1B[49m",E.color.ansi=Xr(),E.color.ansi256=Qr(),E.color.ansi16m=ei(),E.bgColor.ansi=Xr($t),E.bgColor.ansi256=Qr($t),E.bgColor.ansi16m=ei($t),Object.defineProperties(E,{rgbToAnsi256:{value(r,o,t){return r===o&&o===t?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(o/255*5)+Math.round(t/255*5)},enumerable:!1},hexToRgb:{value(r){const o=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!o)return[0,0,0];let[t]=o;t.length===3&&(t=[...t].map(c=>c+c).join(""));const s=Number.parseInt(t,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:r=>E.rgbToAnsi256(...E.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let o,t,s;if(r>=232)o=((r-232)*10+8)/255,t=o,s=o;else{r-=16;const b=r%36;o=Math.floor(r/36)/5,t=Math.floor(b/6)/5,s=b%6/5}const c=Math.max(o,t,s)*2;if(c===0)return 30;let i=30+(Math.round(s)<<2|Math.round(t)<<1|Math.round(o));return c===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(r,o,t)=>E.ansi256ToAnsi(E.rgbToAnsi256(r,o,t)),enumerable:!1},hexToAnsi:{value:r=>E.ansi256ToAnsi(E.hexToAnsi256(r)),enumerable:!1}}),E}const V=Ts();function L(e,r=globalThis.Deno?globalThis.Deno.args:oe.argv){const o=e.startsWith("-")?"":e.length===1?"-":"--",t=r.indexOf(o+e),s=r.indexOf("--");return t!==-1&&(s===-1||t<s)}const{env:_}=oe;let se;L("no-color")||L("no-colors")||L("color=false")||L("color=never")?se=0:(L("color")||L("colors")||L("color=true")||L("color=always"))&&(se=1);function Ms(){if("FORCE_COLOR"in _)return _.FORCE_COLOR==="true"?1:_.FORCE_COLOR==="false"?0:_.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(_.FORCE_COLOR,10),3)}function Os(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Rs(e,{streamIsTTY:r,sniffFlags:o=!0}={}){const t=Ms();t!==void 0&&(se=t);const s=o?se:t;if(s===0)return 0;if(o){if(L("color=16m")||L("color=full")||L("color=truecolor"))return 3;if(L("color=256"))return 2}if("TF_BUILD"in _&&"AGENT_NAME"in _)return 1;if(e&&!r&&s===void 0)return 0;const c=s||0;if(_.TERM==="dumb")return c;if(oe.platform==="win32"){const i=ci.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in _)return"GITHUB_ACTIONS"in _||"GITEA_ACTIONS"in _?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(i=>i in _)||_.CI_NAME==="codeship"?1:c;if("TEAMCITY_VERSION"in _)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_.TEAMCITY_VERSION)?1:0;if(_.COLORTERM==="truecolor"||_.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in _){const i=Number.parseInt((_.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(_.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_.TERM)||"COLORTERM"in _?1:c}function ti(e,r={}){const o=Rs(e,{streamIsTTY:e&&e.isTTY,...r});return Os(o)}const Ps={stdout:ti({isTTY:Et.isatty(1)}),stderr:ti({isTTY:Et.isatty(2)})};function Cs(e,r,o){let t=e.indexOf(r);if(t===-1)return e;const s=r.length;let c=0,i="";do i+=e.slice(c,t)+r+o,c=t+s,t=e.indexOf(r,c);while(t!==-1);return i+=e.slice(c),i}function Ds(e,r,o,t){let s=0,c="";do{const i=e[t-1]==="\r";c+=e.slice(s,i?t-1:t)+r+(i?`\r
98
98
  `:`
99
- `)+i,o=t+1,t=e.indexOf(`
100
- `,o)}while(t!==-1);return m+=e.slice(o),m}const{stdout:ei,stderr:ti}=Ms,St=Symbol("GENERATOR"),Q=Symbol("STYLER"),te=Symbol("IS_EMPTY"),ri=["ansi","ansi","ansi256","ansi16m"],ee=Object.create(null),Cs=(e,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const i=ei?ei.level:0;e.level=r.level===void 0?i:r.level},Ds=e=>{const r=(...i)=>i.join(" ");return Cs(r,e),Object.setPrototypeOf(r,re.prototype),r};function re(e){return Ds(e)}Object.setPrototypeOf(re.prototype,Function.prototype);for(const[e,r]of Object.entries(V))ee[e]={get(){const i=ne(this,Tt(r.open,r.close,this[Q]),this[te]);return Object.defineProperty(this,e,{value:i}),i}};ee.visible={get(){const e=ne(this,this[Q],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const $t=(e,r,i,...t)=>e==="rgb"?r==="ansi16m"?V[i].ansi16m(...t):r==="ansi256"?V[i].ansi256(V.rgbToAnsi256(...t)):V[i].ansi(V.rgbToAnsi(...t)):e==="hex"?$t("rgb",r,i,...V.hexToRgb(...t)):V[i][e](...t),Es=["rgb","hex","ansi256"];for(const e of Es){ee[e]={get(){const{level:i}=this;return function(...t){const o=Tt($t(e,ri[i],"color",...t),V.color.close,this[Q]);return ne(this,o,this[te])}}};const r="bg"+e[0].toUpperCase()+e.slice(1);ee[r]={get(){const{level:i}=this;return function(...t){const o=Tt($t(e,ri[i],"bgColor",...t),V.bgColor.close,this[Q]);return ne(this,o,this[te])}}}}const _s=Object.defineProperties(()=>{},{...ee,level:{enumerable:!0,get(){return this[St].level},set(e){this[St].level=e}}}),Tt=(e,r,i)=>{let t,o;return i===void 0?(t=e,o=r):(t=i.openAll+e,o=r+i.closeAll),{open:e,close:r,openAll:t,closeAll:o,parent:i}},ne=(e,r,i)=>{const t=(...o)=>As(t,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(t,_s),t[St]=e,t[Q]=r,t[te]=i,t},As=(e,r)=>{if(e.level<=0||!r)return e[te]?"":r;let i=e[Q];if(i===void 0)return r;const{openAll:t,closeAll:o}=i;if(r.includes("\x1B"))for(;i!==void 0;)r=Rs(r,i.close,i.open),i=i.parent;const m=r.indexOf(`
101
- `);return m!==-1&&(r=Ps(r,o,t,m)),t+r+o};Object.defineProperties(re.prototype,ee);const q=re();re({level:ti?ti.level:0});const R={backend:q.hex("#3677FF"),frontend:q.hex("#6DC6FE"),vanilla:q.hex("#EEC900"),react:q.hex("3B89E0"),typescript:q.hex("30B3ED"),ok:q.hex("30ED86"),error:q.hex("ED3066"),info:q.hex("42ECDE"),gray:q.hex("#686868"),vue:q.hex("54E6A5"),warn:q.hex("#EC9942"),webpack:q.hex("#75AFCC"),node:q.hex("#417E38"),rust:q.hex("#D34516"),experimental:q.hex("#FA2200")};function K(e){const r=22-e.length;return q.reset(R.gray(`${" ".repeat(r)}|${" ".repeat(2)}`))}function H(e){const r=e.split(" ");return e==="Frontend"?R.frontend(e):e==="Backend"?R.backend(e):e==="VanillaJS"?R.vanilla(e):e==="NodeJS"||r.includes("Node")?R.node(e):r.includes("JavaScript")?R.react(e):r.includes("TypeScript")?R.typescript(e):r.includes("React")?R.react(e):r.includes("TypeScript")?R.typescript(e):e}function Z(e){return q.reset(e)}const ii={Frontend:{VanillaJS:[{value:"vanilla-js",title:H("VanillaJS"),description:R.error("Vanilla JS + Vite.")}],"React JavaScript":[{value:"react",title:`${H("React")}${K("React")}${Z(R.error("React + Vite."))}`},{value:"react-dev",title:`${H("React Dev")}${K("React Dev")}${Z(R.error("Tailwind + Linter + Tests"))}`},{value:"react-webpack",title:`${H("React Webpack")}${K("React Webpack")}${Z(R.error("React + Webpack."))}`},{value:"react-dev-webpack",title:`${H("React Dev Webpack")}${K("React Dev Webpack")}${Z(R.error("Tailwind + Linter + Tests"))}`}],"React TypeScript":[{value:"react-typescript",title:`${H("React TypeScript")}${K("React TypeScript")}${Z(R.error("React + Vite + TypeScript"))}`},{value:"react-dev-typescript",title:`${H("React Dev TypeScript")}${K("React Dev TypeScript")}${Z(R.error("Tailwind + Linter + Tests"))}`}]},Backend:{NodeJS:[{value:"node-express",title:`${H("Node Express")}${K("Node Express")}${Z(R.error("Express + Sequelize + Linter + Tests"))}`}]}},si=(e,r)=>{fi(e).forEach(i=>{const t=J.join(e,i);let o=J.join(r,i);i==="_gitignore"&&(o=J.join(r,".gitignore")),pi(t).isDirectory()?(mi(o),si(t,o)):gi(t,o)})},qs=(e,r)=>{const i=J.join(e,"package.json");try{const t=ai(i,"utf8"),o=JSON.parse(t);o.name=r,ci(i,JSON.stringify(o,null,2),"utf8")}catch(t){console.log(t.message)}};async function ni(e,r,i){const t=Dt(e),o=Dt(r);t||console.log(R.error("Invalid Template")),o&&console.log(R.error("Target directory already exist!")),t&&!o&&(console.info(`\u{1F4C2} ${R.ok("Target directory doesn't exist")}`),console.info(`\u{1F6A7} ${R.ok("Creating directory")}`),di(r,{recursive:!0}),console.info(`\u{1F4C1} ${R.ok("Finished creating directory")}`),si(e,r),qs(r,i),console.info(`\u{1F680} ${R.ok(`Finished generating your app ${R.error(i)}`)}`),console.info(`\u{1F3E0} ${R.info(`cd ${i}`)}`),console.info(`\u{1F9EA} ${R.info("npm install")}`))}const Is=e=>e.toLowerCase().split(/[\s|_]/).join("-"),js=e=>e.match(/[^a-zA-Z0-9-\s]/g)?"App name should not contain special characters except hyphen (-)":!0,oi=`
99
+ `)+o,s=t+1,t=e.indexOf(`
100
+ `,s)}while(t!==-1);return c+=e.slice(s),c}const{stdout:ri,stderr:ii}=Ps,Tt=Symbol("GENERATOR"),Q=Symbol("STYLER"),te=Symbol("IS_EMPTY"),si=["ansi","ansi","ansi256","ansi16m"],ee=Object.create(null),Es=(e,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const o=ri?ri.level:0;e.level=r.level===void 0?o:r.level},_s=e=>{const r=(...o)=>o.join(" ");return Es(r,e),Object.setPrototypeOf(r,re.prototype),r};function re(e){return _s(e)}Object.setPrototypeOf(re.prototype,Function.prototype);for(const[e,r]of Object.entries(V))ee[e]={get(){const o=ne(this,Ot(r.open,r.close,this[Q]),this[te]);return Object.defineProperty(this,e,{value:o}),o}};ee.visible={get(){const e=ne(this,this[Q],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const Mt=(e,r,o,...t)=>e==="rgb"?r==="ansi16m"?V[o].ansi16m(...t):r==="ansi256"?V[o].ansi256(V.rgbToAnsi256(...t)):V[o].ansi(V.rgbToAnsi(...t)):e==="hex"?Mt("rgb",r,o,...V.hexToRgb(...t)):V[o][e](...t),qs=["rgb","hex","ansi256"];for(const e of qs){ee[e]={get(){const{level:o}=this;return function(...t){const s=Ot(Mt(e,si[o],"color",...t),V.color.close,this[Q]);return ne(this,s,this[te])}}};const r="bg"+e[0].toUpperCase()+e.slice(1);ee[r]={get(){const{level:o}=this;return function(...t){const s=Ot(Mt(e,si[o],"bgColor",...t),V.bgColor.close,this[Q]);return ne(this,s,this[te])}}}}const As=Object.defineProperties(()=>{},{...ee,level:{enumerable:!0,get(){return this[Tt].level},set(e){this[Tt].level=e}}}),Ot=(e,r,o)=>{let t,s;return o===void 0?(t=e,s=r):(t=o.openAll+e,s=r+o.closeAll),{open:e,close:r,openAll:t,closeAll:s,parent:o}},ne=(e,r,o)=>{const t=(...s)=>Is(t,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(t,As),t[Tt]=e,t[Q]=r,t[te]=o,t},Is=(e,r)=>{if(e.level<=0||!r)return e[te]?"":r;let o=e[Q];if(o===void 0)return r;const{openAll:t,closeAll:s}=o;if(r.includes("\x1B"))for(;o!==void 0;)r=Cs(r,o.close,o.open),o=o.parent;const c=r.indexOf(`
101
+ `);return c!==-1&&(r=Ds(r,s,t,c)),t+r+s};Object.defineProperties(re.prototype,ee);const I=re();re({level:ii?ii.level:0});const P={backend:I.hex("#3677FF"),frontend:I.hex("#6DC6FE"),vanilla:I.hex("#EEC900"),react:I.hex("3B89E0"),typescript:I.hex("30B3ED"),ok:I.hex("30ED86"),error:I.hex("ED3066"),info:I.hex("42ECDE"),gray:I.hex("#686868"),vue:I.hex("54E6A5"),warn:I.hex("#EC9942"),webpack:I.hex("#75AFCC"),node:I.hex("#417E38"),rust:I.hex("#D34516"),experimental:I.hex("#FA2200")};function K(e){const r=22-e.length;return I.reset(P.gray(`${" ".repeat(r)}|${" ".repeat(2)}`))}function H(e){const r=e.split(" ");return e==="Frontend"?P.frontend(e):e==="Backend"?P.backend(e):e==="VanillaJS"?P.vanilla(e):e==="NodeJS"||r.includes("Node")?P.node(e):r.includes("JavaScript")?P.react(e):r.includes("TypeScript")?P.typescript(e):r.includes("React")?P.react(e):r.includes("TypeScript")?P.typescript(e):e}function Z(e){return I.reset(e)}const ni={Frontend:{VanillaJS:[{value:"vanilla-js",title:`${H("VanillaJS")}${K("VanillaJS")}${Z(P.error("Vanilla JS + Vite."))}`}],"React JavaScript":[{value:"react",title:`${H("React")}${K("React")}${Z(P.error("React + Vite."))}`},{value:"react-dev",title:`${H("React Dev")}${K("React Dev")}${Z(P.error("Tailwind + Linter + Tests"))}`},{value:"react-webpack",title:`${H("React Webpack")}${K("React Webpack")}${Z(P.error("React + Webpack."))}`},{value:"react-dev-webpack",title:`${H("React Dev Webpack")}${K("React Dev Webpack")}${Z(P.error("Tailwind + Linter + Tests"))}`}],"React TypeScript":[{value:"react-typescript",title:`${H("React TypeScript")}${K("React TypeScript")}${Z(P.error("React + Vite + TypeScript"))}`},{value:"react-dev-typescript",title:`${H("React Dev TypeScript")}${K("React Dev TypeScript")}${Z(P.error("Tailwind + Linter + Tests"))}`}]},Backend:{NodeJS:[{value:"node-express",title:`${H("Node Express")}${K("Node Express")}${Z(P.error("Express + Sequelize + Linter + Tests"))}`}]}},oi=(e,r)=>{mi(e).forEach(o=>{const t=J.join(e,o);let s=J.join(r,o);o==="_gitignore"&&(s=J.join(r,".gitignore")),gi(t).isDirectory()?(vi(s),oi(t,s)):bi(t,s)})},js=(e,r)=>{const o=J.join(e,"package.json");try{const t=di(o,"utf8"),s=JSON.parse(t);s.name=r,fi(o,JSON.stringify(s,null,2),"utf8")}catch(t){console.log(t.message)}};async function li(e,r,o){const t=_t(e),s=_t(r);t||console.log(P.error("Invalid Template")),s&&console.log(P.error("Target directory already exist!")),t&&!s&&(console.info(`\u{1F4C2} ${P.ok("Target directory doesn't exist")}`),console.info(`\u{1F6A7} ${P.ok("Creating directory")}`),pi(r,{recursive:!0}),console.info(`\u{1F4C1} ${P.ok("Finished creating directory")}`),oi(e,r),js(r,o),console.info(`\u{1F680} ${P.ok(`Finished generating your app ${P.error(o)}`)}`),console.info(`\u{1F3E0} ${P.info(`cd ${o}`)}`),console.info(`\u{1F9EA} ${P.info("npm install")}`))}const Fs=e=>e.toLowerCase().split(/[\s|_]/).join("-"),Ns=e=>e.match(/[^a-zA-Z0-9-\s]/g)?"App name should not contain special characters except hyphen (-)":!0,hi=`
102
102
  Usage: create-enchilada [OPTION]... [DIRECTORY]
103
103
 
104
104
  Create a new app. With no arguments,
@@ -120,4 +120,4 @@ Available templates:
120
120
  react-typescript React + Vite + TypeScript
121
121
  react-dev-typescript Tailwind + Linter + Tests
122
122
  node-express Express + Sequelize + Linter + Tests
123
- `,Fs=ys(hi.slice(2)),li=async e=>{const r=e.template||e.t,i=e._[0],{help:t,h:o}=e;if(t||o)return console.info(oi),oi;if(!r||!i)try{const m=await ie([{type:"select",name:"category",message:"Select the type of project:",choices:Object.keys(ii).map(y=>({title:H(y),value:y}))}]);m.category||process.exit(0);const s=ii[m.category],v=await ie({type:"select",name:"subcategory",message:`Select the technology for ${m.category}:`,choices:Object.keys(s).map(y=>({title:H(y),value:y}))});v.subcategory||process.exit(0);const h=s[v.subcategory],a=await ie({type:"select",name:"template",message:`Select the template for ${v.subcategory}:`,choices:h});a.template||process.exit(0);const n=await ie({type:"text",name:"appName",message:R.typescript("Enter your app name"),initial:"my-app",format:y=>Is(y),validate:y=>js(y)});n.appName||process.exit(0);const{template:d}=a,{appName:c}=n,l=J.join(process.cwd(),c),u=J.resolve(Pt(import.meta.url),"../../templates",`${d}`);ni(u,l,c)}catch(m){console.error(R.error(m.message))}else try{const m=r,s=i,v=J.join(process.cwd(),s),h=J.resolve(Pt(import.meta.url),"../../templates",`${m}`);ni(h,v,s)}catch(m){console.error(R.error(m.message))}return 0};li(Fs);export{li as default};
123
+ `,Ls=xs(ai.slice(2)),ui=async e=>{const r=e.template||e.t,o=e._[0],{help:t,h:s}=e;if(t||s)return console.info(hi),hi;if(!r||!o)try{const c=await ie([{type:"select",name:"category",message:"Select the type of project:",choices:Object.keys(ni).map(v=>({title:H(v),value:v}))}]);c.category||process.exit(0);const i=ni[c.category],b=await ie({type:"select",name:"subcategory",message:`Select the technology for ${c.category}:`,choices:Object.keys(i).map(v=>({title:H(v),value:v}))});b.subcategory||process.exit(0);const l=i[b.subcategory],a=await ie({type:"select",name:"template",message:`Select the template for ${b.subcategory}:`,choices:l});a.template||process.exit(0);const n=await ie({type:"text",name:"appName",message:P.typescript("Enter your app name"),initial:"my-app",format:v=>Fs(v),validate:v=>Ns(v)});n.appName||process.exit(0);const{template:m}=a,{appName:f}=n,h=J.join(process.cwd(),f),u=J.resolve(Dt(import.meta.url),"../../templates",`${m}`);li(u,h,f)}catch(c){console.error(P.error(c.message))}else try{const c=r,i=o,b=J.join(process.cwd(),i),l=J.resolve(Dt(import.meta.url),"../../templates",`${c}`);li(l,b,i)}catch(c){console.error(P.error(c.message))}return 0};ui(Ls);export{ui as default};