create-qwik 0.0.18-6 → 0.0.18-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/create-qwik CHANGED
@@ -5,29 +5,29 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
7
7
  */
8
- var Ln=Object.create;var fe=Object.defineProperty;var Nn=Object.getOwnPropertyDescriptor;var Gn=Object.getOwnPropertyNames,ft=Object.getOwnPropertySymbols,Bn=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty,Un=Object.prototype.propertyIsEnumerable;var pt=(i,e,t)=>e in i?fe(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Re=(i,e)=>{for(var t in e||(e={}))gt.call(e,t)&&pt(i,t,e[t]);if(ft)for(var t of ft(e))Un.call(e,t)&&pt(i,t,e[t]);return i};var Jn=i=>fe(i,"__esModule",{value:!0});var u=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var zn=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Gn(e))!gt.call(i,r)&&(t||r!=="default")&&fe(i,r,{get:()=>e[r],enumerable:!(s=Nn(e,r))||s.enumerable});return i},Wn=(i,e)=>zn(Jn(fe(i!=null?Ln(Bn(i)):{},"default",!e&&i&&i.__esModule?{get:()=>i.default,enumerable:!0}:{value:i,enumerable:!0})),i);var g=u((pu,$t)=>{"use strict";var{FORCE_COLOR:Qn,NODE_DISABLE_COLORS:eo,TERM:to}=process.env,d={enabled:!eo&&to!=="dumb"&&Qn!=="0",reset:p(0,0),bold:p(1,22),dim:p(2,22),italic:p(3,23),underline:p(4,24),inverse:p(7,27),hidden:p(8,28),strikethrough:p(9,29),black:p(30,39),red:p(31,39),green:p(32,39),yellow:p(33,39),blue:p(34,39),magenta:p(35,39),cyan:p(36,39),white:p(37,39),gray:p(90,39),grey:p(90,39),bgBlack:p(40,49),bgRed:p(41,49),bgGreen:p(42,49),bgYellow:p(43,49),bgBlue:p(44,49),bgMagenta:p(45,49),bgCyan:p(46,49),bgWhite:p(47,49)};function Pt(i,e){let t=0,s,r="",n="";for(;t<i.length;t++)s=i[t],r+=s.open,n+=s.close,e.includes(s.close)&&(e=e.replace(s.rgx,s.close+s.open));return r+e+n}function io(i,e){let t={has:i,keys:e};return t.reset=d.reset.bind(t),t.bold=d.bold.bind(t),t.dim=d.dim.bind(t),t.italic=d.italic.bind(t),t.underline=d.underline.bind(t),t.inverse=d.inverse.bind(t),t.hidden=d.hidden.bind(t),t.strikethrough=d.strikethrough.bind(t),t.black=d.black.bind(t),t.red=d.red.bind(t),t.green=d.green.bind(t),t.yellow=d.yellow.bind(t),t.blue=d.blue.bind(t),t.magenta=d.magenta.bind(t),t.cyan=d.cyan.bind(t),t.white=d.white.bind(t),t.gray=d.gray.bind(t),t.grey=d.grey.bind(t),t.bgBlack=d.bgBlack.bind(t),t.bgRed=d.bgRed.bind(t),t.bgGreen=d.bgGreen.bind(t),t.bgYellow=d.bgYellow.bind(t),t.bgBlue=d.bgBlue.bind(t),t.bgMagenta=d.bgMagenta.bind(t),t.bgCyan=d.bgCyan.bind(t),t.bgWhite=d.bgWhite.bind(t),t}function p(i,e){let t={open:`\x1B[${i}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(i)||(this.has.push(i),this.keys.push(t)),s===void 0?this:d.enabled?Pt(this.keys,s+""):s+""):s===void 0?io([i],[t]):d.enabled?Pt([t],s+""):s+""}}$t.exports=d});var Dt=u((gu,It)=>{"use strict";It.exports=(i,e)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(e){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var we=u((mu,_t)=>{"use strict";_t.exports=i=>{let e=["[\\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("|"),t=new RegExp(e,"g");return typeof i=="string"?i.replace(t,""):i}});var b=u((bu,Ct)=>{"use strict";var Fe="\x1B",m=`${Fe}[`,so="\x07",Ye={to(i,e){return e?`${m}${e+1};${i+1}H`:`${m}${i+1}G`},move(i,e){let t="";return i<0?t+=`${m}${-i}D`:i>0&&(t+=`${m}${i}C`),e<0?t+=`${m}${-e}A`:e>0&&(t+=`${m}${e}B`),t},up:(i=1)=>`${m}${i}A`,down:(i=1)=>`${m}${i}B`,forward:(i=1)=>`${m}${i}C`,backward:(i=1)=>`${m}${i}D`,nextLine:(i=1)=>`${m}E`.repeat(i),prevLine:(i=1)=>`${m}F`.repeat(i),left:`${m}G`,hide:`${m}?25l`,show:`${m}?25h`,save:`${Fe}7`,restore:`${Fe}8`},ro={up:(i=1)=>`${m}S`.repeat(i),down:(i=1)=>`${m}T`.repeat(i)},no={screen:`${m}2J`,up:(i=1)=>`${m}1J`.repeat(i),down:(i=1)=>`${m}J`.repeat(i),line:`${m}2K`,lineEnd:`${m}K`,lineStart:`${m}1K`,lines(i){let e="";for(let t=0;t<i;t++)e+=this.line+(t<i-1?Ye.up():"");return i&&(e+=Ye.left),e}};Ct.exports={cursor:Ye,scroll:ro,erase:no,beep:so}});var kt=u((vu,Rt)=>{"use strict";function oo(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=ho(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var s=0,r=function(){};return{s:r,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(a){throw a},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,h;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return n=a.done,a},e:function(a){o=!0,h=a},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw h}}}}function ho(i,e){if(!!i){if(typeof i=="string")return Et(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Et(i,e)}}function Et(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}var lo=we(),jt=b(),At=jt.erase,uo=jt.cursor,ao=i=>[...lo(i)].length;Rt.exports=function(i,e){if(!e)return At.line+uo.to(0);let t=0,s=i.split(/\r?\n/);var r=oo(s),n;try{for(r.s();!(n=r.n()).done;){let o=n.value;t+=1+Math.floor(Math.max(ao(o)-1,0)/e)}}catch(o){r.e(o)}finally{r.f()}return At.lines(t)}});var He=u((wu,Ft)=>{"use strict";var X={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},co={arrowUp:X.arrowUp,arrowDown:X.arrowDown,arrowLeft:X.arrowLeft,arrowRight:X.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},fo=process.platform==="win32"?co:X;Ft.exports=fo});var Ht=u((yu,Yt)=>{"use strict";var U=g(),G=He(),Ve=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),po=i=>Ve[i]||Ve.default,Q=Object.freeze({aborted:U.red(G.cross),done:U.green(G.tick),exited:U.yellow(G.cross),default:U.cyan("?")}),go=(i,e,t)=>e?Q.aborted:t?Q.exited:i?Q.done:Q.default,mo=i=>U.gray(i?G.ellipsis:G.pointerSmall),bo=(i,e)=>U.gray(i?e?G.pointerSmall:"+":G.line);Yt.exports={styles:Ve,render:po,symbols:Q,symbol:go,delimiter:mo,item:bo}});var Lt=u((xu,Vt)=>{"use strict";var vo=we();Vt.exports=function(i,e){let t=String(vo(i)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,r)=>s+r):t.length}});var Gt=u((Su,Nt)=>{"use strict";Nt.exports=(i,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(i||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=s||n[n.length-1].length+o.length+1<s?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
8
+ var Ln=Object.create;var je=Object.defineProperty;var Nn=Object.getOwnPropertyDescriptor;var Gn=Object.getOwnPropertyNames,ft=Object.getOwnPropertySymbols,Bn=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty,Un=Object.prototype.propertyIsEnumerable;var pt=(i,e,t)=>e in i?je(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Re=(i,e)=>{for(var t in e||(e={}))gt.call(e,t)&&pt(i,t,e[t]);if(ft)for(var t of ft(e))Un.call(e,t)&&pt(i,t,e[t]);return i};var u=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Jn=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Gn(e))!gt.call(i,r)&&r!==t&&je(i,r,{get:()=>e[r],enumerable:!(s=Nn(e,r))||s.enumerable});return i};var zn=(i,e,t)=>(t=i!=null?Ln(Bn(i)):{},Jn(e||!i||!i.__esModule?je(t,"default",{value:i,enumerable:!0}):t,i));var g=u((fu,$t)=>{"use strict";var{FORCE_COLOR:Xn,NODE_DISABLE_COLORS:Qn,TERM:eo}=process.env,d={enabled:!Qn&&eo!=="dumb"&&Xn!=="0",reset:p(0,0),bold:p(1,22),dim:p(2,22),italic:p(3,23),underline:p(4,24),inverse:p(7,27),hidden:p(8,28),strikethrough:p(9,29),black:p(30,39),red:p(31,39),green:p(32,39),yellow:p(33,39),blue:p(34,39),magenta:p(35,39),cyan:p(36,39),white:p(37,39),gray:p(90,39),grey:p(90,39),bgBlack:p(40,49),bgRed:p(41,49),bgGreen:p(42,49),bgYellow:p(43,49),bgBlue:p(44,49),bgMagenta:p(45,49),bgCyan:p(46,49),bgWhite:p(47,49)};function Pt(i,e){let t=0,s,r="",n="";for(;t<i.length;t++)s=i[t],r+=s.open,n+=s.close,e.includes(s.close)&&(e=e.replace(s.rgx,s.close+s.open));return r+e+n}function to(i,e){let t={has:i,keys:e};return t.reset=d.reset.bind(t),t.bold=d.bold.bind(t),t.dim=d.dim.bind(t),t.italic=d.italic.bind(t),t.underline=d.underline.bind(t),t.inverse=d.inverse.bind(t),t.hidden=d.hidden.bind(t),t.strikethrough=d.strikethrough.bind(t),t.black=d.black.bind(t),t.red=d.red.bind(t),t.green=d.green.bind(t),t.yellow=d.yellow.bind(t),t.blue=d.blue.bind(t),t.magenta=d.magenta.bind(t),t.cyan=d.cyan.bind(t),t.white=d.white.bind(t),t.gray=d.gray.bind(t),t.grey=d.grey.bind(t),t.bgBlack=d.bgBlack.bind(t),t.bgRed=d.bgRed.bind(t),t.bgGreen=d.bgGreen.bind(t),t.bgYellow=d.bgYellow.bind(t),t.bgBlue=d.bgBlue.bind(t),t.bgMagenta=d.bgMagenta.bind(t),t.bgCyan=d.bgCyan.bind(t),t.bgWhite=d.bgWhite.bind(t),t}function p(i,e){let t={open:`\x1B[${i}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(i)||(this.has.push(i),this.keys.push(t)),s===void 0?this:d.enabled?Pt(this.keys,s+""):s+""):s===void 0?to([i],[t]):d.enabled?Pt([t],s+""):s+""}}$t.exports=d});var Dt=u((pu,It)=>{"use strict";It.exports=(i,e)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(e){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var ve=u((gu,_t)=>{"use strict";_t.exports=i=>{let e=["[\\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("|"),t=new RegExp(e,"g");return typeof i=="string"?i.replace(t,""):i}});var b=u((mu,Ct)=>{"use strict";var Fe="\x1B",m=`${Fe}[`,io="\x07",Ye={to(i,e){return e?`${m}${e+1};${i+1}H`:`${m}${i+1}G`},move(i,e){let t="";return i<0?t+=`${m}${-i}D`:i>0&&(t+=`${m}${i}C`),e<0?t+=`${m}${-e}A`:e>0&&(t+=`${m}${e}B`),t},up:(i=1)=>`${m}${i}A`,down:(i=1)=>`${m}${i}B`,forward:(i=1)=>`${m}${i}C`,backward:(i=1)=>`${m}${i}D`,nextLine:(i=1)=>`${m}E`.repeat(i),prevLine:(i=1)=>`${m}F`.repeat(i),left:`${m}G`,hide:`${m}?25l`,show:`${m}?25h`,save:`${Fe}7`,restore:`${Fe}8`},so={up:(i=1)=>`${m}S`.repeat(i),down:(i=1)=>`${m}T`.repeat(i)},ro={screen:`${m}2J`,up:(i=1)=>`${m}1J`.repeat(i),down:(i=1)=>`${m}J`.repeat(i),line:`${m}2K`,lineEnd:`${m}K`,lineStart:`${m}1K`,lines(i){let e="";for(let t=0;t<i;t++)e+=this.line+(t<i-1?Ye.up():"");return i&&(e+=Ye.left),e}};Ct.exports={cursor:Ye,scroll:so,erase:ro,beep:io}});var kt=u((bu,Rt)=>{"use strict";function no(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=oo(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var s=0,r=function(){};return{s:r,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(a){throw a},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,h;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return n=a.done,a},e:function(a){o=!0,h=a},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw h}}}}function oo(i,e){if(!!i){if(typeof i=="string")return Et(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Et(i,e)}}function Et(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}var ho=ve(),jt=b(),At=jt.erase,lo=jt.cursor,uo=i=>[...ho(i)].length;Rt.exports=function(i,e){if(!e)return At.line+lo.to(0);let t=0,s=i.split(/\r?\n/);var r=no(s),n;try{for(r.s();!(n=r.n()).done;){let o=n.value;t+=1+Math.floor(Math.max(uo(o)-1,0)/e)}}catch(o){r.e(o)}finally{r.f()}return At.lines(t)}});var He=u((vu,Ft)=>{"use strict";var X={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},ao={arrowUp:X.arrowUp,arrowDown:X.arrowDown,arrowLeft:X.arrowLeft,arrowRight:X.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},co=process.platform==="win32"?ao:X;Ft.exports=co});var Ht=u((wu,Yt)=>{"use strict";var U=g(),G=He(),Ve=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),fo=i=>Ve[i]||Ve.default,Q=Object.freeze({aborted:U.red(G.cross),done:U.green(G.tick),exited:U.yellow(G.cross),default:U.cyan("?")}),po=(i,e,t)=>e?Q.aborted:t?Q.exited:i?Q.done:Q.default,go=i=>U.gray(i?G.ellipsis:G.pointerSmall),mo=(i,e)=>U.gray(i?e?G.pointerSmall:"+":G.line);Yt.exports={styles:Ve,render:fo,symbols:Q,symbol:po,delimiter:go,item:mo}});var Lt=u((yu,Vt)=>{"use strict";var bo=ve();Vt.exports=function(i,e){let t=String(bo(i)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,r)=>s+r):t.length}});var Gt=u((xu,Nt)=>{"use strict";Nt.exports=(i,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(i||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=s||n[n.length-1].length+o.length+1<s?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
10
10
  `)).join(`
11
- `)}});var Ut=u((Ou,Bt)=>{"use strict";Bt.exports=(i,e,t)=>{t=t||e;let s=Math.min(e-t,i-Math.floor(t/2));s<0&&(s=0);let r=Math.min(s+t,e);return{startIndex:s,endIndex:r}}});var x=u((qu,Jt)=>{"use strict";Jt.exports={action:Dt(),clear:kt(),style:Ht(),strip:we(),figures:He(),lines:Lt(),wrap:Gt(),entriesToDisplay:Ut()}});var C=u((Mu,Kt)=>{"use strict";var zt=require("readline"),wo=x(),yo=wo.action,xo=require("events"),Wt=b(),So=Wt.beep,Oo=Wt.cursor,qo=g(),Zt=class extends xo{constructor(e={}){super();this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=zt.createInterface({input:this.in,escapeCodeTimeout:50});zt.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(n,o)=>{let h=yo(o,s);h===!1?this._&&this._(n,o):typeof this[h]=="function"?this[h](o):this.bell()};this.close=()=>{this.out.write(Oo.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(So)}render(){this.onRender(qo),this.firstRender&&(this.firstRender=!1)}};Kt.exports=Zt});var si=u((Tu,ii)=>{"use strict";function Xt(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function Qt(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){Xt(n,s,r,o,h,"next",l)}function h(l){Xt(n,s,r,o,h,"throw",l)}o(void 0)})}}var ye=g(),Mo=C(),ei=b(),To=ei.erase,ee=ei.cursor,xe=x(),Le=xe.style,Ne=xe.clear,Po=xe.lines,$o=xe.figures,ti=class extends Mo{constructor(e={}){super(e);this.transform=Le.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=Ne("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=ye.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
11
+ `)}});var Ut=u((Su,Bt)=>{"use strict";Bt.exports=(i,e,t)=>{t=t||e;let s=Math.min(e-t,i-Math.floor(t/2));s<0&&(s=0);let r=Math.min(s+t,e);return{startIndex:s,endIndex:r}}});var x=u((Ou,Jt)=>{"use strict";Jt.exports={action:Dt(),clear:kt(),style:Ht(),strip:ve(),figures:He(),lines:Lt(),wrap:Gt(),entriesToDisplay:Ut()}});var C=u((qu,Kt)=>{"use strict";var zt=require("readline"),vo=x(),wo=vo.action,yo=require("events"),Wt=b(),xo=Wt.beep,So=Wt.cursor,Oo=g(),Zt=class extends yo{constructor(e={}){super();this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=zt.createInterface({input:this.in,escapeCodeTimeout:50});zt.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(n,o)=>{let h=wo(o,s);h===!1?this._&&this._(n,o):typeof this[h]=="function"?this[h](o):this.bell()};this.close=()=>{this.out.write(So.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(xo)}render(){this.onRender(Oo),this.firstRender&&(this.firstRender=!1)}};Kt.exports=Zt});var si=u((Mu,ii)=>{"use strict";function Xt(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function Qt(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){Xt(n,s,r,o,h,"next",l)}function h(l){Xt(n,s,r,o,h,"throw",l)}o(void 0)})}}var we=g(),qo=C(),ei=b(),Mo=ei.erase,ee=ei.cursor,ye=x(),Le=ye.style,Ne=ye.clear,To=ye.lines,Po=ye.figures,ti=class extends qo{constructor(e={}){super(e);this.transform=Le.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=Ne("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=we.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
12
12
  `),this.close()}validate(){var e=this;return Qt(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Qt(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
13
- `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${s}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,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 e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,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(ee.down(Po(this.outputError,this.out.columns)-1)+Ne(this.outputError,this.out.columns)),this.out.write(Ne(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Le.symbol(this.done,this.aborted),ye.bold(this.msg),Le.delimiter(this.done),this.red?ye.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
13
+ `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${s}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,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 e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,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(ee.down(To(this.outputError,this.out.columns)-1)+Ne(this.outputError,this.out.columns)),this.out.write(Ne(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Le.symbol(this.done,this.aborted),we.bold(this.msg),Le.delimiter(this.done),this.red?we.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
14
14
  `).reduce((e,t,s)=>e+`
15
- ${s?" ":$o.pointerSmall} ${ye.red().italic(t)}`,"")),this.out.write(To.line+ee.to(0)+this.outputText+ee.save+this.outputError+ee.restore+ee.move(this.cursorOffset,0)))}};ii.exports=ti});var li=u((Pu,hi)=>{"use strict";var E=g(),Io=C(),te=x(),ri=te.style,ni=te.clear,Se=te.figures,Do=te.wrap,_o=te.entriesToDisplay,Co=b(),Eo=Co.cursor,oi=class extends Io{constructor(e={}){super(e);this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=ni("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].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(`
15
+ ${s?" ":Po.pointerSmall} ${we.red().italic(t)}`,"")),this.out.write(Mo.line+ee.to(0)+this.outputText+ee.save+this.outputError+ee.restore+ee.move(this.cursorOffset,0)))}};ii.exports=ti});var li=u((Tu,hi)=>{"use strict";var E=g(),$o=C(),te=x(),ri=te.style,ni=te.clear,xe=te.figures,Io=te.wrap,Do=te.entriesToDisplay,_o=b(),Co=_o.cursor,oi=class extends $o{constructor(e={}){super(e);this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=ni("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].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(`
16
16
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
17
- `),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()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Eo.hide):this.out.write(ni(this.outputText,this.out.columns)),super.render();let e=_o(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,s=e.endIndex;if(this.outputText=[ri.symbol(this.done,this.aborted),E.bold(this.msg),ri.delimiter(!1),this.done?this.selection.title:this.selection.disabled?E.yellow(this.warn):E.gray(this.hint)].join(" "),!this.done){this.outputText+=`
18
- `;for(let r=t;r<s;r++){let n,o,h="",l=this.choices[r];r===t&&t>0?o=Se.arrowUp:r===s-1&&s<this.choices.length?o=Se.arrowDown:o=" ",l.disabled?(n=this.cursor===r?E.gray().underline(l.title):E.strikethrough().gray(l.title),o=(this.cursor===r?E.bold().gray(Se.pointer)+" ":" ")+o):(n=this.cursor===r?E.cyan().underline(l.title):l.title,o=(this.cursor===r?E.cyan(Se.pointer)+" ":" ")+o,l.description&&this.cursor===r&&(h=` - ${l.description}`,(o.length+n.length+h.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(h=`
19
- `+Do(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${E.gray(h)}
20
- `}}this.out.write(this.outputText)}};hi.exports=oi});var gi=u(($u,pi)=>{"use strict";var Oe=g(),Ao=C(),ci=x(),ui=ci.style,jo=ci.clear,di=b(),ai=di.cursor,Ro=di.erase,fi=class extends Ao{constructor(e={}){super(e);this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.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(`
17
+ `),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()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Co.hide):this.out.write(ni(this.outputText,this.out.columns)),super.render();let e=Do(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,s=e.endIndex;if(this.outputText=[ri.symbol(this.done,this.aborted),E.bold(this.msg),ri.delimiter(!1),this.done?this.selection.title:this.selection.disabled?E.yellow(this.warn):E.gray(this.hint)].join(" "),!this.done){this.outputText+=`
18
+ `;for(let r=t;r<s;r++){let n,o,h="",l=this.choices[r];r===t&&t>0?o=xe.arrowUp:r===s-1&&s<this.choices.length?o=xe.arrowDown:o=" ",l.disabled?(n=this.cursor===r?E.gray().underline(l.title):E.strikethrough().gray(l.title),o=(this.cursor===r?E.bold().gray(xe.pointer)+" ":" ")+o):(n=this.cursor===r?E.cyan().underline(l.title):l.title,o=(this.cursor===r?E.cyan(xe.pointer)+" ":" ")+o,l.description&&this.cursor===r&&(h=` - ${l.description}`,(o.length+n.length+h.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(h=`
19
+ `+Io(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${E.gray(h)}
20
+ `}}this.out.write(this.outputText)}};hi.exports=oi});var gi=u((Pu,pi)=>{"use strict";var Se=g(),Eo=C(),ci=x(),ui=ci.style,Ao=ci.clear,di=b(),ai=di.cursor,jo=di.erase,fi=class extends Eo{constructor(e={}){super(e);this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.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(`
21
21
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
22
- `),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()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(ai.hide):this.out.write(jo(this.outputText,this.out.columns)),super.render(),this.outputText=[ui.symbol(this.done,this.aborted),Oe.bold(this.msg),ui.delimiter(this.done),this.value?this.inactive:Oe.cyan().underline(this.inactive),Oe.gray("/"),this.value?Oe.cyan().underline(this.active):this.active].join(" "),this.out.write(Ro.line+ai.to(0)+this.outputText))}};pi.exports=fi});var q=u((Iu,mi)=>{"use strict";var ie=class{constructor({token:e,date:t,parts:s,locales:r}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=r||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof ie)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,r)=>r>t&&s instanceof ie)}toString(){return String(this.date)}};mi.exports=ie});var wi=u((Du,vi)=>{"use strict";var ko=q(),bi=class extends ko{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};vi.exports=bi});var Si=u((_u,xi)=>{"use strict";var Fo=q(),Yo=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),yi=class extends Fo{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Yo(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};xi.exports=yi});var Mi=u((Cu,qi)=>{"use strict";var Ho=q(),Oi=class extends Ho{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};qi.exports=Oi});var $i=u((Eu,Pi)=>{"use strict";var Vo=q(),Ti=class extends Vo{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Pi.exports=Ti});var _i=u((Au,Di)=>{"use strict";var Lo=q(),Ii=class extends Lo{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Di.exports=Ii});var Ai=u((ju,Ei)=>{"use strict";var No=q(),Ci=class extends No{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};Ei.exports=Ci});var ki=u((Ru,Ri)=>{"use strict";var Go=q(),ji=class extends Go{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Ri.exports=ji});var Hi=u((ku,Yi)=>{"use strict";var Bo=q(),Fi=class extends Bo{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Yi.exports=Fi});var Li=u((Fu,Vi)=>{"use strict";Vi.exports={DatePart:q(),Meridiem:wi(),Day:Si(),Hours:Mi(),Milliseconds:$i(),Minutes:_i(),Month:Ai(),Seconds:ki(),Year:Hi()}});var Qi=u((Yu,Xi)=>{"use strict";function Ni(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function Gi(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){Ni(n,s,r,o,h,"next",l)}function h(l){Ni(n,s,r,o,h,"throw",l)}o(void 0)})}}var Ge=g(),Uo=C(),Be=x(),Bi=Be.style,Ui=Be.clear,Jo=Be.figures,Zi=b(),zo=Zi.erase,Ji=Zi.cursor,A=Li(),zi=A.DatePart,Wo=A.Meridiem,Zo=A.Day,Ko=A.Hours,Xo=A.Milliseconds,Qo=A.Minutes,eh=A.Month,th=A.Seconds,ih=A.Year,sh=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Wi={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new Zo(i),3:i=>new eh(i),4:i=>new ih(i),5:i=>new Wo(i),6:i=>new Ko(i),7:i=>new Qo(i),8:i=>new th(i),9:i=>new Xo(i)},rh={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(",")},Ki=class extends Uo{constructor(e={}){super(e);this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(rh,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Ui("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=sh.exec(e);){let r=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in Wi?Wi[n]({token:t[n]||r,date:this.date,parts:this.parts,locales:this.locales}):t[n]||r)}let s=this.parts.reduce((r,n)=>(typeof n=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=n:r.push(n),r),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof zi)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
22
+ `),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()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(ai.hide):this.out.write(Ao(this.outputText,this.out.columns)),super.render(),this.outputText=[ui.symbol(this.done,this.aborted),Se.bold(this.msg),ui.delimiter(this.done),this.value?this.inactive:Se.cyan().underline(this.inactive),Se.gray("/"),this.value?Se.cyan().underline(this.active):this.active].join(" "),this.out.write(jo.line+ai.to(0)+this.outputText))}};pi.exports=fi});var q=u(($u,mi)=>{"use strict";var ie=class{constructor({token:e,date:t,parts:s,locales:r}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=r||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof ie)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,r)=>r>t&&s instanceof ie)}toString(){return String(this.date)}};mi.exports=ie});var wi=u((Iu,vi)=>{"use strict";var Ro=q(),bi=class extends Ro{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};vi.exports=bi});var Si=u((Du,xi)=>{"use strict";var ko=q(),Fo=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),yi=class extends ko{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Fo(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};xi.exports=yi});var Mi=u((_u,qi)=>{"use strict";var Yo=q(),Oi=class extends Yo{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};qi.exports=Oi});var $i=u((Cu,Pi)=>{"use strict";var Ho=q(),Ti=class extends Ho{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Pi.exports=Ti});var _i=u((Eu,Di)=>{"use strict";var Vo=q(),Ii=class extends Vo{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Di.exports=Ii});var Ai=u((Au,Ei)=>{"use strict";var Lo=q(),Ci=class extends Lo{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};Ei.exports=Ci});var ki=u((ju,Ri)=>{"use strict";var No=q(),ji=class extends No{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Ri.exports=ji});var Hi=u((Ru,Yi)=>{"use strict";var Go=q(),Fi=class extends Go{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Yi.exports=Fi});var Li=u((ku,Vi)=>{"use strict";Vi.exports={DatePart:q(),Meridiem:wi(),Day:Si(),Hours:Mi(),Milliseconds:$i(),Minutes:_i(),Month:Ai(),Seconds:ki(),Year:Hi()}});var Qi=u((Fu,Xi)=>{"use strict";function Ni(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function Gi(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){Ni(n,s,r,o,h,"next",l)}function h(l){Ni(n,s,r,o,h,"throw",l)}o(void 0)})}}var Ge=g(),Bo=C(),Be=x(),Bi=Be.style,Ui=Be.clear,Uo=Be.figures,Zi=b(),Jo=Zi.erase,Ji=Zi.cursor,A=Li(),zi=A.DatePart,zo=A.Meridiem,Wo=A.Day,Zo=A.Hours,Ko=A.Milliseconds,Xo=A.Minutes,Qo=A.Month,eh=A.Seconds,th=A.Year,ih=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Wi={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new Wo(i),3:i=>new Qo(i),4:i=>new th(i),5:i=>new zo(i),6:i=>new Zo(i),7:i=>new Xo(i),8:i=>new eh(i),9:i=>new Ko(i)},sh={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(",")},Ki=class extends Bo{constructor(e={}){super(e);this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(sh,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Ui("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=ih.exec(e);){let r=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in Wi?Wi[n]({token:t[n]||r,date:this.date,parts:this.parts,locales:this.locales}):t[n]||r)}let s=this.parts.reduce((r,n)=>(typeof n=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=n:r.push(n),r),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof zi)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
23
23
  `),this.close()}validate(){var e=this;return Gi(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Gi(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
24
24
  `),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof zi)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Ji.hide):this.out.write(Ui(this.outputText,this.out.columns)),super.render(),this.outputText=[Bi.symbol(this.done,this.aborted),Ge.bold(this.msg),Bi.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?Ge.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
25
25
  `).reduce((e,t,s)=>e+`
26
- ${s?" ":Jo.pointerSmall} ${Ge.red().italic(t)}`,"")),this.out.write(zo.line+Ji.to(0)+this.outputText))}};Xi.exports=Ki});var hs=u((Hu,os)=>{"use strict";function es(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function ts(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){es(n,s,r,o,h,"next",l)}function h(l){es(n,s,r,o,h,"throw",l)}o(void 0)})}}var qe=g(),nh=C(),rs=b(),Me=rs.cursor,oh=rs.erase,Te=x(),Ue=Te.style,hh=Te.figures,is=Te.clear,lh=Te.lines,uh=/[0-9]/,Je=i=>i!==void 0,ss=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},ns=class extends nh{constructor(e={}){super(e);this.transform=Ue.render(e.style),this.msg=e.message,this.initial=Je(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Je(e.min)?e.min:-1/0,this.max=Je(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=qe.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${ss(e,this.round)}`),this._value=ss(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||uh.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
26
+ ${s?" ":Uo.pointerSmall} ${Ge.red().italic(t)}`,"")),this.out.write(Jo.line+Ji.to(0)+this.outputText))}};Xi.exports=Ki});var hs=u((Yu,os)=>{"use strict";function es(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function ts(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){es(n,s,r,o,h,"next",l)}function h(l){es(n,s,r,o,h,"throw",l)}o(void 0)})}}var Oe=g(),rh=C(),rs=b(),qe=rs.cursor,nh=rs.erase,Me=x(),Ue=Me.style,oh=Me.figures,is=Me.clear,hh=Me.lines,lh=/[0-9]/,Je=i=>i!==void 0,ss=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},ns=class extends rh{constructor(e={}){super(e);this.transform=Ue.render(e.style),this.msg=e.message,this.initial=Je(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Je(e.min)?e.min:-1/0,this.max=Je(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Oe.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${ss(e,this.round)}`),this._value=ss(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||lh.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
27
27
  `),this.close()}validate(){var e=this;return ts(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return ts(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let t=e.value;e.value=t!==""?t:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
28
- `),e.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 e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.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()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")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(Me.down(lh(this.outputError,this.out.columns)-1)+is(this.outputError,this.out.columns)),this.out.write(is(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ue.symbol(this.done,this.aborted),qe.bold(this.msg),Ue.delimiter(this.done),!this.done||!this.done&&!this.placeholder?qe[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
28
+ `),e.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 e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.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()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")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(qe.down(hh(this.outputError,this.out.columns)-1)+is(this.outputError,this.out.columns)),this.out.write(is(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ue.symbol(this.done,this.aborted),Oe.bold(this.msg),Ue.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Oe[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
29
29
  `).reduce((e,t,s)=>e+`
30
- ${s?" ":hh.pointerSmall} ${qe.red().italic(t)}`,"")),this.out.write(oh.line+Me.to(0)+this.outputText+Me.save+this.outputError+Me.restore))}};os.exports=ns});var ze=u((Vu,cs)=>{"use strict";var M=g(),ah=b(),ch=ah.cursor,dh=C(),se=x(),ls=se.clear,H=se.figures,us=se.style,fh=se.wrap,ph=se.entriesToDisplay,as=class extends dh{constructor(e={}){super(e);this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=ls("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
30
+ ${s?" ":oh.pointerSmall} ${Oe.red().italic(t)}`,"")),this.out.write(nh.line+qe.to(0)+this.outputText+qe.save+this.outputError+qe.restore))}};os.exports=ns});var ze=u((Hu,cs)=>{"use strict";var M=g(),uh=b(),ah=uh.cursor,ch=C(),se=x(),ls=se.clear,H=se.figures,us=se.style,dh=se.wrap,fh=se.entriesToDisplay,as=class extends ch{constructor(e={}){super(e);this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=ls("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
31
31
  `),this.close()}submit(){let e=this.value.filter(t=>t.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
32
32
  `),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(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(t=>!t.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
33
33
  Instructions:
@@ -35,15 +35,15 @@ Instructions:
35
35
  ${H.arrowLeft}/${H.arrowRight}/[space]: Toggle selection
36
36
  `+(this.maxChoices===void 0?` a: Toggle all
37
37
  `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,r){let n=(t.selected?M.green(H.radioOn):H.radioOff)+" "+r+" ",o,h;return t.disabled?o=e===s?M.gray().underline(t.title):M.strikethrough().gray(t.title):(o=e===s?M.cyan().underline(t.title):t.title,e===s&&t.description&&(h=` - ${t.description}`,(n.length+o.length+h.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(h=`
38
- `+fh(t.description,{margin:n.length,width:this.out.columns})))),n+o+M.gray(h||"")}paginateOptions(e){if(e.length===0)return M.red("No matches for this query.");let t=ph(this.cursor,e.length,this.optionsPerPage),s=t.startIndex,r=t.endIndex,n,o=[];for(let h=s;h<r;h++)h===s&&s>0?n=H.arrowUp:h===r-1&&r<e.length?n=H.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[h],h,n));return`
38
+ `+dh(t.description,{margin:n.length,width:this.out.columns})))),n+o+M.gray(h||"")}paginateOptions(e){if(e.length===0)return M.red("No matches for this query.");let t=fh(this.cursor,e.length,this.optionsPerPage),s=t.startIndex,r=t.endIndex,n,o=[];for(let h=s;h<r;h++)h===s&&s>0?n=H.arrowUp:h===r-1&&r<e.length?n=H.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[h],h,n));return`
39
39
  `+o.join(`
40
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[M.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(M.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ch.hide),super.render();let e=[us.symbol(this.done,this.aborted),M.bold(this.msg),us.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=M.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=ls(e,this.out.columns)}};cs.exports=as});var ws=u((Lu,vs)=>{"use strict";function ds(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function gh(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){ds(n,s,r,o,h,"next",l)}function h(l){ds(n,s,r,o,h,"throw",l)}o(void 0)})}}var re=g(),mh=C(),ms=b(),bh=ms.erase,fs=ms.cursor,ne=x(),We=ne.style,ps=ne.clear,Ze=ne.figures,vh=ne.wrap,wh=ne.entriesToDisplay,gs=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),yh=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),xh=(i,e)=>{let t=i.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},bs=class extends mh{constructor(e={}){super(e);this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:xh(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=We.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=ps("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=gs(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return gh(function*(){let s=t.completing=t.suggest(t.input,t.choices),r=yield s;if(t.completing!==s)return;t.suggestions=r.map((o,h,l)=>({title:yh(l,h),value:gs(l,h),description:o.description})),t.completing=!1;let n=Math.max(r.length-1,0);t.moveSelect(Math.min(n,t.select)),e&&e()})()}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(`
40
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[M.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(M.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ah.hide),super.render();let e=[us.symbol(this.done,this.aborted),M.bold(this.msg),us.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=M.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=ls(e,this.out.columns)}};cs.exports=as});var ws=u((Vu,vs)=>{"use strict";function ds(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function ph(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){ds(n,s,r,o,h,"next",l)}function h(l){ds(n,s,r,o,h,"throw",l)}o(void 0)})}}var re=g(),gh=C(),ms=b(),mh=ms.erase,fs=ms.cursor,ne=x(),We=ne.style,ps=ne.clear,Ze=ne.figures,bh=ne.wrap,vh=ne.entriesToDisplay,gs=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),wh=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),yh=(i,e)=>{let t=i.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},bs=class extends gh{constructor(e={}){super(e);this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:yh(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=We.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=ps("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=gs(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return ph(function*(){let s=t.completing=t.suggest(t.input,t.choices),r=yield s;if(t.completing!==s)return;t.suggestions=r.map((o,h,l)=>({title:wh(l,h),value:gs(l,h),description:o.description})),t.completing=!1;let n=Math.max(r.length-1,0);t.moveSelect(Math.min(n,t.select)),e&&e()})()}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(`
41
41
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
42
42
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
43
43
  `),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${s}${e}${r}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,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(e,t,s,r){let n,o=s?Ze.arrowUp:r?Ze.arrowDown:" ",h=t?re.cyan().underline(e.title):e.title;return o=(t?re.cyan(Ze.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+h.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
44
- `+vh(e.description,{margin:3,width:this.out.columns}))),o+" "+h+re.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(fs.hide):this.out.write(ps(this.outputText,this.out.columns)),super.render();let e=wh(this.select,this.choices.length,this.limit),t=e.startIndex,s=e.endIndex;if(this.outputText=[We.symbol(this.done,this.aborted,this.exited),re.bold(this.msg),We.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let r=this.suggestions.slice(t,s).map((n,o)=>this.renderOption(n,this.select===o+t,o===0&&t>0,o+t===s-1&&s<this.choices.length)).join(`
44
+ `+bh(e.description,{margin:3,width:this.out.columns}))),o+" "+h+re.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(fs.hide):this.out.write(ps(this.outputText,this.out.columns)),super.render();let e=vh(this.select,this.choices.length,this.limit),t=e.startIndex,s=e.endIndex;if(this.outputText=[We.symbol(this.done,this.aborted,this.exited),re.bold(this.msg),We.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let r=this.suggestions.slice(t,s).map((n,o)=>this.renderOption(n,this.select===o+t,o===0&&t>0,o+t===s-1&&s<this.choices.length)).join(`
45
45
  `);this.outputText+=`
46
- `+(r||re.gray(this.fallback.title))}this.out.write(bh.line+fs.to(0)+this.outputText)}};vs.exports=bs});var qs=u((Nu,Os)=>{"use strict";var j=g(),Sh=b(),Oh=Sh.cursor,qh=ze(),Ke=x(),ys=Ke.clear,xs=Ke.style,J=Ke.figures,Ss=class extends qh{constructor(e={}){e.overrideRender=!0;super(e);this.inputValue="",this.clear=ys("",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(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
46
+ `+(r||re.gray(this.fallback.title))}this.out.write(mh.line+fs.to(0)+this.outputText)}};vs.exports=bs});var qs=u((Lu,Os)=>{"use strict";var j=g(),xh=b(),Sh=xh.cursor,Oh=ze(),Ke=x(),ys=Ke.clear,xs=Ke.style,J=Ke.figures,Ss=class extends Oh{constructor(e={}){e.overrideRender=!0;super(e);this.inputValue="",this.clear=ys("",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(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
47
47
  Instructions:
48
48
  ${J.arrowUp}/${J.arrowDown}: Highlight option
49
49
  ${J.arrowLeft}/${J.arrowRight}/[space]: Toggle selection
@@ -51,31 +51,31 @@ Instructions:
51
51
  enter/return: Complete answer
52
52
  `:""}renderCurrentInput(){return`
53
53
  Filtered results for: ${this.inputValue?this.inputValue:j.gray("Enter something to filter")}
54
- `}renderOption(e,t,s){let r;return t.disabled?r=e===s?j.gray().underline(t.title):j.strikethrough().gray(t.title):r=e===s?j.cyan().underline(t.title):t.title,(t.selected?j.green(J.radioOn):J.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[j.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(j.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Oh.hide),super.render();let e=[xs.symbol(this.done,this.aborted),j.bold(this.msg),xs.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=j.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=ys(e,this.out.columns)}};Os.exports=Ss});var Cs=u((Gu,_s)=>{"use strict";var Ms=g(),Mh=C(),$s=x(),Ts=$s.style,Th=$s.clear,Is=b(),Ph=Is.erase,Ps=Is.cursor,Ds=class extends Mh{constructor(e={}){super(e);this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.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(`
54
+ `}renderOption(e,t,s){let r;return t.disabled?r=e===s?j.gray().underline(t.title):j.strikethrough().gray(t.title):r=e===s?j.cyan().underline(t.title):t.title,(t.selected?j.green(J.radioOn):J.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[j.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(j.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Sh.hide),super.render();let e=[xs.symbol(this.done,this.aborted),j.bold(this.msg),xs.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=j.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=ys(e,this.out.columns)}};Os.exports=Ss});var Cs=u((Nu,_s)=>{"use strict";var Ms=g(),qh=C(),$s=x(),Ts=$s.style,Mh=$s.clear,Is=b(),Th=Is.erase,Ps=Is.cursor,Ds=class extends qh{constructor(e={}){super(e);this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.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(`
55
55
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
56
- `),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Ps.hide):this.out.write(Th(this.outputText,this.out.columns)),super.render(),this.outputText=[Ts.symbol(this.done,this.aborted),Ms.bold(this.msg),Ts.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Ms.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Ph.line+Ps.to(0)+this.outputText))}};_s.exports=Ds});var As=u((Bu,Es)=>{"use strict";Es.exports={TextPrompt:si(),SelectPrompt:li(),TogglePrompt:gi(),DatePrompt:Qi(),NumberPrompt:hs(),MultiselectPrompt:ze(),AutocompletePrompt:ws(),AutocompleteMultiselectPrompt:qs(),ConfirmPrompt:Cs()}});var Rs=u(js=>{"use strict";var w=js,$h=As(),Pe=i=>i;function T(i,e,t={}){return new Promise((s,r)=>{let n=new $h[i](e),o=t.onAbort||Pe,h=t.onSubmit||Pe,l=t.onExit||Pe;n.on("state",e.onState||Pe),n.on("submit",a=>s(h(a))),n.on("exit",a=>s(l(a))),n.on("abort",a=>r(o(a)))})}w.text=i=>T("TextPrompt",i);w.password=i=>(i.style="password",w.text(i));w.invisible=i=>(i.style="invisible",w.text(i));w.number=i=>T("NumberPrompt",i);w.date=i=>T("DatePrompt",i);w.confirm=i=>T("ConfirmPrompt",i);w.list=i=>{let e=i.separator||",";return T("TextPrompt",i,{onSubmit:t=>t.split(e).map(s=>s.trim())})};w.toggle=i=>T("TogglePrompt",i);w.select=i=>T("SelectPrompt",i);w.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return T("MultiselectPrompt",i,{onAbort:e,onSubmit:e})};w.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return T("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var Ih=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));w.autocomplete=i=>(i.suggest=i.suggest||Ih,i.choices=[].concat(i.choices||[]),T("AutocompletePrompt",i))});var Gs=u((Ju,Ns)=>{"use strict";function ks(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,s)}return t}function Fs(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ks(Object(t),!0).forEach(function(s){Dh(i,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):ks(Object(t)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(t,s))})}return i}function Dh(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function _h(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=Ch(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var s=0,r=function(){};return{s:r,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(a){throw a},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
57
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,h;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return n=a.done,a},e:function(a){o=!0,h=a},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw h}}}}function Ch(i,e){if(!!i){if(typeof i=="string")return Ys(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ys(i,e)}}function Ys(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}function Hs(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function Vs(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){Hs(n,s,r,o,h,"next",l)}function h(l){Hs(n,s,r,o,h,"throw",l)}o(void 0)})}}var Xe=Rs(),Eh=["suggest","format","onState","validate","onRender","type"],Ls=()=>{};function V(){return Qe.apply(this,arguments)}function Qe(){return Qe=Vs(function*(i=[],{onSubmit:e=Ls,onCancel:t=Ls}={}){let s={},r=V._override||{};i=[].concat(i);let n,o,h,l,a,Z,K=function(){var Y=Vs(function*(D,de,dt=!1){if(!(!dt&&D.validate&&D.validate(de)!==!0))return D.format?yield D.format(de,s):de});return function(de,dt){return Y.apply(this,arguments)}}();var v=_h(i),O;try{for(v.s();!(O=v.n()).done;){o=O.value;var ce=o;if(l=ce.name,a=ce.type,typeof a=="function"&&(a=yield a(n,Fs({},s),o),o.type=a),!!a){for(let Y in o){if(Eh.includes(Y))continue;let D=o[Y];o[Y]=typeof D=="function"?yield D(n,Fs({},s),Z):D}if(Z=o,typeof o.message!="string")throw new Error("prompt message is required");var ct=o;if(l=ct.name,a=ct.type,Xe[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[o.name]!==void 0&&(n=yield K(o,r[o.name]),n!==void 0)){s[l]=n;continue}try{n=V._injected?Ah(V._injected,o.initial):yield Xe[a](o),s[l]=n=yield K(o,n,!0),h=yield e(o,n,s)}catch{h=!(yield t(o,s))}if(h)return s}}}catch(Y){v.e(Y)}finally{v.f()}return s}),Qe.apply(this,arguments)}function Ah(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function jh(i){V._injected=(V._injected||[]).concat(i)}function Rh(i){V._override=Object.assign({},i)}Ns.exports=Object.assign(V,{prompt:V,prompts:Xe,inject:jh,override:Rh})});var Us=u((zu,Bs)=>{"use strict";Bs.exports=(i,e)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(e){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var $e=u((Wu,Js)=>{"use strict";Js.exports=i=>{let e=["[\\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("|"),t=new RegExp(e,"g");return typeof i=="string"?i.replace(t,""):i}});var Zs=u((Zu,Ws)=>{"use strict";var kh=$e(),{erase:zs,cursor:Fh}=b(),Yh=i=>[...kh(i)].length;Ws.exports=function(i,e){if(!e)return zs.line+Fh.to(0);let t=0,s=i.split(/\r?\n/);for(let r of s)t+=1+Math.floor(Math.max(Yh(r)-1,0)/e);return zs.lines(t)}});var et=u((Ku,Ks)=>{"use strict";var oe={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Hh={arrowUp:oe.arrowUp,arrowDown:oe.arrowDown,arrowLeft:oe.arrowLeft,arrowRight:oe.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Vh=process.platform==="win32"?Hh:oe;Ks.exports=Vh});var Qs=u((Xu,Xs)=>{"use strict";var z=g(),B=et(),tt=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),Lh=i=>tt[i]||tt.default,he=Object.freeze({aborted:z.red(B.cross),done:z.green(B.tick),exited:z.yellow(B.cross),default:z.cyan("?")}),Nh=(i,e,t)=>e?he.aborted:t?he.exited:i?he.done:he.default,Gh=i=>z.gray(i?B.ellipsis:B.pointerSmall),Bh=(i,e)=>z.gray(i?e?B.pointerSmall:"+":B.line);Xs.exports={styles:tt,render:Lh,symbols:he,symbol:Nh,delimiter:Gh,item:Bh}});var tr=u((Qu,er)=>{"use strict";var Uh=$e();er.exports=function(i,e){let t=String(Uh(i)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,r)=>s+r):t.length}});var sr=u((ea,ir)=>{"use strict";ir.exports=(i,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(i||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=s||n[n.length-1].length+o.length+1<s?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
56
+ `),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Ps.hide):this.out.write(Mh(this.outputText,this.out.columns)),super.render(),this.outputText=[Ts.symbol(this.done,this.aborted),Ms.bold(this.msg),Ts.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Ms.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Th.line+Ps.to(0)+this.outputText))}};_s.exports=Ds});var As=u((Gu,Es)=>{"use strict";Es.exports={TextPrompt:si(),SelectPrompt:li(),TogglePrompt:gi(),DatePrompt:Qi(),NumberPrompt:hs(),MultiselectPrompt:ze(),AutocompletePrompt:ws(),AutocompleteMultiselectPrompt:qs(),ConfirmPrompt:Cs()}});var Rs=u(js=>{"use strict";var w=js,Ph=As(),Te=i=>i;function T(i,e,t={}){return new Promise((s,r)=>{let n=new Ph[i](e),o=t.onAbort||Te,h=t.onSubmit||Te,l=t.onExit||Te;n.on("state",e.onState||Te),n.on("submit",a=>s(h(a))),n.on("exit",a=>s(l(a))),n.on("abort",a=>r(o(a)))})}w.text=i=>T("TextPrompt",i);w.password=i=>(i.style="password",w.text(i));w.invisible=i=>(i.style="invisible",w.text(i));w.number=i=>T("NumberPrompt",i);w.date=i=>T("DatePrompt",i);w.confirm=i=>T("ConfirmPrompt",i);w.list=i=>{let e=i.separator||",";return T("TextPrompt",i,{onSubmit:t=>t.split(e).map(s=>s.trim())})};w.toggle=i=>T("TogglePrompt",i);w.select=i=>T("SelectPrompt",i);w.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return T("MultiselectPrompt",i,{onAbort:e,onSubmit:e})};w.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return T("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var $h=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));w.autocomplete=i=>(i.suggest=i.suggest||$h,i.choices=[].concat(i.choices||[]),T("AutocompletePrompt",i))});var Gs=u((Uu,Ns)=>{"use strict";function ks(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,s)}return t}function Fs(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ks(Object(t),!0).forEach(function(s){Ih(i,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):ks(Object(t)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(t,s))})}return i}function Ih(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Dh(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=_h(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var s=0,r=function(){};return{s:r,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(a){throw a},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
57
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,h;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return n=a.done,a},e:function(a){o=!0,h=a},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw h}}}}function _h(i,e){if(!!i){if(typeof i=="string")return Ys(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ys(i,e)}}function Ys(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}function Hs(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function Vs(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){Hs(n,s,r,o,h,"next",l)}function h(l){Hs(n,s,r,o,h,"throw",l)}o(void 0)})}}var Xe=Rs(),Ch=["suggest","format","onState","validate","onRender","type"],Ls=()=>{};function V(){return Qe.apply(this,arguments)}function Qe(){return Qe=Vs(function*(i=[],{onSubmit:e=Ls,onCancel:t=Ls}={}){let s={},r=V._override||{};i=[].concat(i);let n,o,h,l,a,Z,K=function(){var Y=Vs(function*(D,de,dt=!1){if(!(!dt&&D.validate&&D.validate(de)!==!0))return D.format?yield D.format(de,s):de});return function(de,dt){return Y.apply(this,arguments)}}();var v=Dh(i),O;try{for(v.s();!(O=v.n()).done;){o=O.value;var ce=o;if(l=ce.name,a=ce.type,typeof a=="function"&&(a=yield a(n,Fs({},s),o),o.type=a),!!a){for(let Y in o){if(Ch.includes(Y))continue;let D=o[Y];o[Y]=typeof D=="function"?yield D(n,Fs({},s),Z):D}if(Z=o,typeof o.message!="string")throw new Error("prompt message is required");var ct=o;if(l=ct.name,a=ct.type,Xe[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[o.name]!==void 0&&(n=yield K(o,r[o.name]),n!==void 0)){s[l]=n;continue}try{n=V._injected?Eh(V._injected,o.initial):yield Xe[a](o),s[l]=n=yield K(o,n,!0),h=yield e(o,n,s)}catch{h=!(yield t(o,s))}if(h)return s}}}catch(Y){v.e(Y)}finally{v.f()}return s}),Qe.apply(this,arguments)}function Eh(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function Ah(i){V._injected=(V._injected||[]).concat(i)}function jh(i){V._override=Object.assign({},i)}Ns.exports=Object.assign(V,{prompt:V,prompts:Xe,inject:Ah,override:jh})});var Us=u((Ju,Bs)=>{"use strict";Bs.exports=(i,e)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(e){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var Pe=u((zu,Js)=>{"use strict";Js.exports=i=>{let e=["[\\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("|"),t=new RegExp(e,"g");return typeof i=="string"?i.replace(t,""):i}});var Zs=u((Wu,Ws)=>{"use strict";var Rh=Pe(),{erase:zs,cursor:kh}=b(),Fh=i=>[...Rh(i)].length;Ws.exports=function(i,e){if(!e)return zs.line+kh.to(0);let t=0,s=i.split(/\r?\n/);for(let r of s)t+=1+Math.floor(Math.max(Fh(r)-1,0)/e);return zs.lines(t)}});var et=u((Zu,Ks)=>{"use strict";var oe={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Yh={arrowUp:oe.arrowUp,arrowDown:oe.arrowDown,arrowLeft:oe.arrowLeft,arrowRight:oe.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Hh=process.platform==="win32"?Yh:oe;Ks.exports=Hh});var Qs=u((Ku,Xs)=>{"use strict";var z=g(),B=et(),tt=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),Vh=i=>tt[i]||tt.default,he=Object.freeze({aborted:z.red(B.cross),done:z.green(B.tick),exited:z.yellow(B.cross),default:z.cyan("?")}),Lh=(i,e,t)=>e?he.aborted:t?he.exited:i?he.done:he.default,Nh=i=>z.gray(i?B.ellipsis:B.pointerSmall),Gh=(i,e)=>z.gray(i?e?B.pointerSmall:"+":B.line);Xs.exports={styles:tt,render:Vh,symbols:he,symbol:Lh,delimiter:Nh,item:Gh}});var tr=u((Xu,er)=>{"use strict";var Bh=Pe();er.exports=function(i,e){let t=String(Bh(i)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,r)=>s+r):t.length}});var sr=u((Qu,ir)=>{"use strict";ir.exports=(i,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(i||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=s||n[n.length-1].length+o.length+1<s?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
58
58
  `)).join(`
59
- `)}});var nr=u((ta,rr)=>{"use strict";rr.exports=(i,e,t)=>{t=t||e;let s=Math.min(e-t,i-Math.floor(t/2));s<0&&(s=0);let r=Math.min(s+t,e);return{startIndex:s,endIndex:r}}});var S=u((ia,or)=>{"use strict";or.exports={action:Us(),clear:Zs(),style:Qs(),strip:$e(),figures:et(),lines:tr(),wrap:sr(),entriesToDisplay:nr()}});var R=u((sa,ur)=>{"use strict";var hr=require("readline"),{action:Jh}=S(),zh=require("events"),{beep:Wh,cursor:Zh}=b(),Kh=g(),lr=class extends zh{constructor(e={}){super();this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=hr.createInterface({input:this.in,escapeCodeTimeout:50});hr.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(n,o)=>{let h=Jh(o,s);h===!1?this._&&this._(n,o):typeof this[h]=="function"?this[h](o):this.bell()};this.close=()=>{this.out.write(Zh.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Wh)}render(){this.onRender(Kh),this.firstRender&&(this.firstRender=!1)}};ur.exports=lr});var dr=u((ra,cr)=>{var Ie=g(),Xh=R(),{erase:Qh,cursor:le}=b(),{style:it,clear:st,lines:el,figures:tl}=S(),ar=class extends Xh{constructor(e={}){super(e);this.transform=it.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=st("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Ie.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
59
+ `)}});var nr=u((ea,rr)=>{"use strict";rr.exports=(i,e,t)=>{t=t||e;let s=Math.min(e-t,i-Math.floor(t/2));s<0&&(s=0);let r=Math.min(s+t,e);return{startIndex:s,endIndex:r}}});var S=u((ta,or)=>{"use strict";or.exports={action:Us(),clear:Zs(),style:Qs(),strip:Pe(),figures:et(),lines:tr(),wrap:sr(),entriesToDisplay:nr()}});var R=u((ia,ur)=>{"use strict";var hr=require("readline"),{action:Uh}=S(),Jh=require("events"),{beep:zh,cursor:Wh}=b(),Zh=g(),lr=class extends Jh{constructor(e={}){super();this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=hr.createInterface({input:this.in,escapeCodeTimeout:50});hr.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(n,o)=>{let h=Uh(o,s);h===!1?this._&&this._(n,o):typeof this[h]=="function"?this[h](o):this.bell()};this.close=()=>{this.out.write(Wh.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(zh)}render(){this.onRender(Zh),this.firstRender&&(this.firstRender=!1)}};ur.exports=lr});var dr=u((sa,cr)=>{var $e=g(),Kh=R(),{erase:Xh,cursor:le}=b(),{style:it,clear:st,lines:Qh,figures:el}=S(),ar=class extends Kh{constructor(e={}){super(e);this.transform=it.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=st("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=$e.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
60
60
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}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(`
61
- `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${s}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,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 e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,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(le.down(el(this.outputError,this.out.columns)-1)+st(this.outputError,this.out.columns)),this.out.write(st(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[it.symbol(this.done,this.aborted),Ie.bold(this.msg),it.delimiter(this.done),this.red?Ie.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
61
+ `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${s}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,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 e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,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(le.down(Qh(this.outputError,this.out.columns)-1)+st(this.outputError,this.out.columns)),this.out.write(st(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[it.symbol(this.done,this.aborted),$e.bold(this.msg),it.delimiter(this.done),this.red?$e.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
62
62
  `).reduce((e,t,s)=>e+`
63
- ${s?" ":tl.pointerSmall} ${Ie.red().italic(t)}`,"")),this.out.write(Qh.line+le.to(0)+this.outputText+le.save+this.outputError+le.restore+le.move(this.cursorOffset,0)))}};cr.exports=ar});var br=u((na,mr)=>{"use strict";var k=g(),il=R(),{style:fr,clear:pr,figures:De,wrap:sl,entriesToDisplay:rl}=S(),{cursor:nl}=b(),gr=class extends il{constructor(e={}){super(e);this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=pr("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].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(`
63
+ ${s?" ":el.pointerSmall} ${$e.red().italic(t)}`,"")),this.out.write(Xh.line+le.to(0)+this.outputText+le.save+this.outputError+le.restore+le.move(this.cursorOffset,0)))}};cr.exports=ar});var br=u((ra,mr)=>{"use strict";var k=g(),tl=R(),{style:fr,clear:pr,figures:Ie,wrap:il,entriesToDisplay:sl}=S(),{cursor:rl}=b(),gr=class extends tl{constructor(e={}){super(e);this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=pr("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].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(`
64
64
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
65
- `),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()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(nl.hide):this.out.write(pr(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=rl(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[fr.symbol(this.done,this.aborted),k.bold(this.msg),fr.delimiter(!1),this.done?this.selection.title:this.selection.disabled?k.yellow(this.warn):k.gray(this.hint)].join(" "),!this.done){this.outputText+=`
66
- `;for(let s=e;s<t;s++){let r,n,o="",h=this.choices[s];s===e&&e>0?n=De.arrowUp:s===t-1&&t<this.choices.length?n=De.arrowDown:n=" ",h.disabled?(r=this.cursor===s?k.gray().underline(h.title):k.strikethrough().gray(h.title),n=(this.cursor===s?k.bold().gray(De.pointer)+" ":" ")+n):(r=this.cursor===s?k.cyan().underline(h.title):h.title,n=(this.cursor===s?k.cyan(De.pointer)+" ":" ")+n,h.description&&this.cursor===s&&(o=` - ${h.description}`,(n.length+r.length+o.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(o=`
67
- `+sl(h.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${r}${k.gray(o)}
68
- `}}this.out.write(this.outputText)}};mr.exports=gr});var Sr=u((oa,xr)=>{var _e=g(),ol=R(),{style:vr,clear:hl}=S(),{cursor:wr,erase:ll}=b(),yr=class extends ol{constructor(e={}){super(e);this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.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(`
65
+ `),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()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(rl.hide):this.out.write(pr(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=sl(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[fr.symbol(this.done,this.aborted),k.bold(this.msg),fr.delimiter(!1),this.done?this.selection.title:this.selection.disabled?k.yellow(this.warn):k.gray(this.hint)].join(" "),!this.done){this.outputText+=`
66
+ `;for(let s=e;s<t;s++){let r,n,o="",h=this.choices[s];s===e&&e>0?n=Ie.arrowUp:s===t-1&&t<this.choices.length?n=Ie.arrowDown:n=" ",h.disabled?(r=this.cursor===s?k.gray().underline(h.title):k.strikethrough().gray(h.title),n=(this.cursor===s?k.bold().gray(Ie.pointer)+" ":" ")+n):(r=this.cursor===s?k.cyan().underline(h.title):h.title,n=(this.cursor===s?k.cyan(Ie.pointer)+" ":" ")+n,h.description&&this.cursor===s&&(o=` - ${h.description}`,(n.length+r.length+o.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(o=`
67
+ `+il(h.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${r}${k.gray(o)}
68
+ `}}this.out.write(this.outputText)}};mr.exports=gr});var Sr=u((na,xr)=>{var De=g(),nl=R(),{style:vr,clear:ol}=S(),{cursor:wr,erase:hl}=b(),yr=class extends nl{constructor(e={}){super(e);this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.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(`
69
69
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
70
- `),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()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(wr.hide):this.out.write(hl(this.outputText,this.out.columns)),super.render(),this.outputText=[vr.symbol(this.done,this.aborted),_e.bold(this.msg),vr.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(ll.line+wr.to(0)+this.outputText))}};xr.exports=yr});var P=u((ha,Or)=>{"use strict";var ue=class{constructor({token:e,date:t,parts:s,locales:r}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=r||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof ue)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,r)=>r>t&&s instanceof ue)}toString(){return String(this.date)}};Or.exports=ue});var Tr=u((la,Mr)=>{"use strict";var ul=P(),qr=class extends ul{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};Mr.exports=qr});var Ir=u((ua,$r)=>{"use strict";var al=P(),cl=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),Pr=class extends al{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+cl(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};$r.exports=Pr});var Cr=u((aa,_r)=>{"use strict";var dl=P(),Dr=class extends dl{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};_r.exports=Dr});var jr=u((ca,Ar)=>{"use strict";var fl=P(),Er=class extends fl{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Ar.exports=Er});var Fr=u((da,kr)=>{"use strict";var pl=P(),Rr=class extends pl{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};kr.exports=Rr});var Vr=u((fa,Hr)=>{"use strict";var gl=P(),Yr=class extends gl{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};Hr.exports=Yr});var Gr=u((pa,Nr)=>{"use strict";var ml=P(),Lr=class extends ml{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Nr.exports=Lr});var Jr=u((ga,Ur)=>{"use strict";var bl=P(),Br=class extends bl{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Ur.exports=Br});var Wr=u((ma,zr)=>{"use strict";zr.exports={DatePart:P(),Meridiem:Tr(),Day:Ir(),Hours:Cr(),Milliseconds:jr(),Minutes:Fr(),Month:Vr(),Seconds:Gr(),Year:Jr()}});var rn=u((ba,sn)=>{"use strict";var rt=g(),vl=R(),{style:Zr,clear:Kr,figures:wl}=S(),{erase:yl,cursor:Xr}=b(),{DatePart:Qr,Meridiem:xl,Day:Sl,Hours:Ol,Milliseconds:ql,Minutes:Ml,Month:Tl,Seconds:Pl,Year:$l}=Wr(),Il=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,en={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new Sl(i),3:i=>new Tl(i),4:i=>new $l(i),5:i=>new xl(i),6:i=>new Ol(i),7:i=>new Ml(i),8:i=>new Pl(i),9:i=>new ql(i)},Dl={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(",")},tn=class extends vl{constructor(e={}){super(e);this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(Dl,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Kr("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=Il.exec(e);){let r=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in en?en[n]({token:t[n]||r,date:this.date,parts:this.parts,locales:this.locales}):t[n]||r)}let s=this.parts.reduce((r,n)=>(typeof n=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=n:r.push(n),r),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Qr)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
70
+ `),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()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(wr.hide):this.out.write(ol(this.outputText,this.out.columns)),super.render(),this.outputText=[vr.symbol(this.done,this.aborted),De.bold(this.msg),vr.delimiter(this.done),this.value?this.inactive:De.cyan().underline(this.inactive),De.gray("/"),this.value?De.cyan().underline(this.active):this.active].join(" "),this.out.write(hl.line+wr.to(0)+this.outputText))}};xr.exports=yr});var P=u((oa,Or)=>{"use strict";var ue=class{constructor({token:e,date:t,parts:s,locales:r}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=r||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof ue)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,r)=>r>t&&s instanceof ue)}toString(){return String(this.date)}};Or.exports=ue});var Tr=u((ha,Mr)=>{"use strict";var ll=P(),qr=class extends ll{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};Mr.exports=qr});var Ir=u((la,$r)=>{"use strict";var ul=P(),al=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),Pr=class extends ul{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+al(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};$r.exports=Pr});var Cr=u((ua,_r)=>{"use strict";var cl=P(),Dr=class extends cl{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};_r.exports=Dr});var jr=u((aa,Ar)=>{"use strict";var dl=P(),Er=class extends dl{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Ar.exports=Er});var Fr=u((ca,kr)=>{"use strict";var fl=P(),Rr=class extends fl{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};kr.exports=Rr});var Vr=u((da,Hr)=>{"use strict";var pl=P(),Yr=class extends pl{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};Hr.exports=Yr});var Gr=u((fa,Nr)=>{"use strict";var gl=P(),Lr=class extends gl{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Nr.exports=Lr});var Jr=u((pa,Ur)=>{"use strict";var ml=P(),Br=class extends ml{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Ur.exports=Br});var Wr=u((ga,zr)=>{"use strict";zr.exports={DatePart:P(),Meridiem:Tr(),Day:Ir(),Hours:Cr(),Milliseconds:jr(),Minutes:Fr(),Month:Vr(),Seconds:Gr(),Year:Jr()}});var rn=u((ma,sn)=>{"use strict";var rt=g(),bl=R(),{style:Zr,clear:Kr,figures:vl}=S(),{erase:wl,cursor:Xr}=b(),{DatePart:Qr,Meridiem:yl,Day:xl,Hours:Sl,Milliseconds:Ol,Minutes:ql,Month:Ml,Seconds:Tl,Year:Pl}=Wr(),$l=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,en={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new xl(i),3:i=>new Ml(i),4:i=>new Pl(i),5:i=>new yl(i),6:i=>new Sl(i),7:i=>new ql(i),8:i=>new Tl(i),9:i=>new Ol(i)},Il={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(",")},tn=class extends bl{constructor(e={}){super(e);this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(Il,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Kr("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=$l.exec(e);){let r=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in en?en[n]({token:t[n]||r,date:this.date,parts:this.parts,locales:this.locales}):t[n]||r)}let s=this.parts.reduce((r,n)=>(typeof n=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=n:r.push(n),r),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Qr)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
71
71
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}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(`
72
72
  `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof Qr)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Xr.hide):this.out.write(Kr(this.outputText,this.out.columns)),super.render(),this.outputText=[Zr.symbol(this.done,this.aborted),rt.bold(this.msg),Zr.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?rt.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
73
73
  `).reduce((e,t,s)=>e+`
74
- ${s?" ":wl.pointerSmall} ${rt.red().italic(t)}`,"")),this.out.write(yl.line+Xr.to(0)+this.outputText))}};sn.exports=tn});var un=u((va,ln)=>{var Ce=g(),_l=R(),{cursor:Ee,erase:Cl}=b(),{style:nt,figures:El,clear:nn,lines:Al}=S(),jl=/[0-9]/,ot=i=>i!==void 0,on=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},hn=class extends _l{constructor(e={}){super(e);this.transform=nt.render(e.style),this.msg=e.message,this.initial=ot(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=ot(e.min)?e.min:-1/0,this.max=ot(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Ce.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${on(e,this.round)}`),this._value=on(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||jl.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
74
+ ${s?" ":vl.pointerSmall} ${rt.red().italic(t)}`,"")),this.out.write(wl.line+Xr.to(0)+this.outputText))}};sn.exports=tn});var un=u((ba,ln)=>{var _e=g(),Dl=R(),{cursor:Ce,erase:_l}=b(),{style:nt,figures:Cl,clear:nn,lines:El}=S(),Al=/[0-9]/,ot=i=>i!==void 0,on=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},hn=class extends Dl{constructor(e={}){super(e);this.transform=nt.render(e.style),this.msg=e.message,this.initial=ot(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=ot(e.min)?e.min:-1/0,this.max=ot(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=_e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${on(e,this.round)}`),this._value=on(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||Al.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
75
75
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
76
- `),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 e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.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()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")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(Ee.down(Al(this.outputError,this.out.columns)-1)+nn(this.outputError,this.out.columns)),this.out.write(nn(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[nt.symbol(this.done,this.aborted),Ce.bold(this.msg),nt.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Ce[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
76
+ `),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 e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.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()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")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(Ce.down(El(this.outputError,this.out.columns)-1)+nn(this.outputError,this.out.columns)),this.out.write(nn(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[nt.symbol(this.done,this.aborted),_e.bold(this.msg),nt.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(`
77
77
  `).reduce((e,t,s)=>e+`
78
- ${s?" ":El.pointerSmall} ${Ce.red().italic(t)}`,"")),this.out.write(Cl.line+Ee.to(0)+this.outputText+Ee.save+this.outputError+Ee.restore))}};ln.exports=hn});var ht=u((wa,fn)=>{"use strict";var $=g(),{cursor:Rl}=b(),kl=R(),{clear:an,figures:L,style:cn,wrap:Fl,entriesToDisplay:Yl}=S(),dn=class extends kl{constructor(e={}){super(e);this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=an("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
78
+ ${s?" ":Cl.pointerSmall} ${_e.red().italic(t)}`,"")),this.out.write(_l.line+Ce.to(0)+this.outputText+Ce.save+this.outputError+Ce.restore))}};ln.exports=hn});var ht=u((va,fn)=>{"use strict";var $=g(),{cursor:jl}=b(),Rl=R(),{clear:an,figures:L,style:cn,wrap:kl,entriesToDisplay:Fl}=S(),dn=class extends Rl{constructor(e={}){super(e);this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=an("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
79
79
  `),this.close()}submit(){let e=this.value.filter(t=>t.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
80
80
  `),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(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(t=>!t.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
81
81
  Instructions:
@@ -83,15 +83,15 @@ Instructions:
83
83
  ${L.arrowLeft}/${L.arrowRight}/[space]: Toggle selection
84
84
  `+(this.maxChoices===void 0?` a: Toggle all
85
85
  `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,r){let n=(t.selected?$.green(L.radioOn):L.radioOff)+" "+r+" ",o,h;return t.disabled?o=e===s?$.gray().underline(t.title):$.strikethrough().gray(t.title):(o=e===s?$.cyan().underline(t.title):t.title,e===s&&t.description&&(h=` - ${t.description}`,(n.length+o.length+h.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(h=`
86
- `+Fl(t.description,{margin:n.length,width:this.out.columns})))),n+o+$.gray(h||"")}paginateOptions(e){if(e.length===0)return $.red("No matches for this query.");let{startIndex:t,endIndex:s}=Yl(this.cursor,e.length,this.optionsPerPage),r,n=[];for(let o=t;o<s;o++)o===t&&t>0?r=L.arrowUp:o===s-1&&s<e.length?r=L.arrowDown:r=" ",n.push(this.renderOption(this.cursor,e[o],o,r));return`
86
+ `+kl(t.description,{margin:n.length,width:this.out.columns})))),n+o+$.gray(h||"")}paginateOptions(e){if(e.length===0)return $.red("No matches for this query.");let{startIndex:t,endIndex:s}=Fl(this.cursor,e.length,this.optionsPerPage),r,n=[];for(let o=t;o<s;o++)o===t&&t>0?r=L.arrowUp:o===s-1&&s<e.length?r=L.arrowDown:r=" ",n.push(this.renderOption(this.cursor,e[o],o,r));return`
87
87
  `+n.join(`
88
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[$.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push($.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Rl.hide),super.render();let e=[cn.symbol(this.done,this.aborted),$.bold(this.msg),cn.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=$.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=an(e,this.out.columns)}};fn.exports=dn});var wn=u((ya,vn)=>{"use strict";var ae=g(),Hl=R(),{erase:Vl,cursor:pn}=b(),{style:lt,clear:gn,figures:ut,wrap:Ll,entriesToDisplay:Nl}=S(),mn=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),Gl=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),Bl=(i,e)=>{let t=i.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},bn=class extends Hl{constructor(e={}){super(e);this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:Bl(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=lt.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=gn("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=mn(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),s=await t;if(this.completing!==t)return;this.suggestions=s.map((n,o,h)=>({title:Gl(h,o),value:mn(h,o),description:n.description})),this.completing=!1;let r=Math.max(s.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}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(`
88
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[$.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push($.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(jl.hide),super.render();let e=[cn.symbol(this.done,this.aborted),$.bold(this.msg),cn.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=$.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=an(e,this.out.columns)}};fn.exports=dn});var wn=u((wa,vn)=>{"use strict";var ae=g(),Yl=R(),{erase:Hl,cursor:pn}=b(),{style:lt,clear:gn,figures:ut,wrap:Vl,entriesToDisplay:Ll}=S(),mn=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),Nl=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),Gl=(i,e)=>{let t=i.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},bn=class extends Yl{constructor(e={}){super(e);this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:Gl(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=lt.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=gn("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=mn(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),s=await t;if(this.completing!==t)return;this.suggestions=s.map((n,o,h)=>({title:Nl(h,o),value:mn(h,o),description:n.description})),this.completing=!1;let r=Math.max(s.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}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(`
89
89
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
90
90
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
91
91
  `),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${s}${e}${r}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,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(e,t,s,r){let n,o=s?ut.arrowUp:r?ut.arrowDown:" ",h=t?ae.cyan().underline(e.title):e.title;return o=(t?ae.cyan(ut.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+h.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
92
- `+Ll(e.description,{margin:3,width:this.out.columns}))),o+" "+h+ae.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(pn.hide):this.out.write(gn(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=Nl(this.select,this.choices.length,this.limit);if(this.outputText=[lt.symbol(this.done,this.aborted,this.exited),ae.bold(this.msg),lt.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let s=this.suggestions.slice(e,t).map((r,n)=>this.renderOption(r,this.select===n+e,n===0&&e>0,n+e===t-1&&t<this.choices.length)).join(`
92
+ `+Vl(e.description,{margin:3,width:this.out.columns}))),o+" "+h+ae.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(pn.hide):this.out.write(gn(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=Ll(this.select,this.choices.length,this.limit);if(this.outputText=[lt.symbol(this.done,this.aborted,this.exited),ae.bold(this.msg),lt.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let s=this.suggestions.slice(e,t).map((r,n)=>this.renderOption(r,this.select===n+e,n===0&&e>0,n+e===t-1&&t<this.choices.length)).join(`
93
93
  `);this.outputText+=`
94
- `+(s||ae.gray(this.fallback.title))}this.out.write(Vl.line+pn.to(0)+this.outputText)}};vn.exports=bn});var qn=u((xa,On)=>{"use strict";var F=g(),{cursor:Ul}=b(),Jl=ht(),{clear:yn,style:xn,figures:W}=S(),Sn=class extends Jl{constructor(e={}){e.overrideRender=!0;super(e);this.inputValue="",this.clear=yn("",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(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
94
+ `+(s||ae.gray(this.fallback.title))}this.out.write(Hl.line+pn.to(0)+this.outputText)}};vn.exports=bn});var qn=u((ya,On)=>{"use strict";var F=g(),{cursor:Bl}=b(),Ul=ht(),{clear:yn,style:xn,figures:W}=S(),Sn=class extends Ul{constructor(e={}){e.overrideRender=!0;super(e);this.inputValue="",this.clear=yn("",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(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
95
95
  Instructions:
96
96
  ${W.arrowUp}/${W.arrowDown}: Highlight option
97
97
  ${W.arrowLeft}/${W.arrowRight}/[space]: Toggle selection
@@ -99,8 +99,8 @@ Instructions:
99
99
  enter/return: Complete answer
100
100
  `:""}renderCurrentInput(){return`
101
101
  Filtered results for: ${this.inputValue?this.inputValue:F.gray("Enter something to filter")}
102
- `}renderOption(e,t,s){let r;return t.disabled?r=e===s?F.gray().underline(t.title):F.strikethrough().gray(t.title):r=e===s?F.cyan().underline(t.title):t.title,(t.selected?F.green(W.radioOn):W.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[F.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(F.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Ul.hide),super.render();let e=[xn.symbol(this.done,this.aborted),F.bold(this.msg),xn.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=F.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=yn(e,this.out.columns)}};On.exports=Sn});var Dn=u((Sa,In)=>{var Mn=g(),zl=R(),{style:Tn,clear:Wl}=S(),{erase:Zl,cursor:Pn}=b(),$n=class extends zl{constructor(e={}){super(e);this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.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(`
102
+ `}renderOption(e,t,s){let r;return t.disabled?r=e===s?F.gray().underline(t.title):F.strikethrough().gray(t.title):r=e===s?F.cyan().underline(t.title):t.title,(t.selected?F.green(W.radioOn):W.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[F.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(F.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Bl.hide),super.render();let e=[xn.symbol(this.done,this.aborted),F.bold(this.msg),xn.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=F.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=yn(e,this.out.columns)}};On.exports=Sn});var Dn=u((xa,In)=>{var Mn=g(),Jl=R(),{style:Tn,clear:zl}=S(),{erase:Wl,cursor:Pn}=b(),$n=class extends Jl{constructor(e={}){super(e);this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.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(`
103
103
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
104
- `),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Pn.hide):this.out.write(Wl(this.outputText,this.out.columns)),super.render(),this.outputText=[Tn.symbol(this.done,this.aborted),Mn.bold(this.msg),Tn.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Mn.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Zl.line+Pn.to(0)+this.outputText))}};In.exports=$n});var Cn=u((Oa,_n)=>{"use strict";_n.exports={TextPrompt:dr(),SelectPrompt:br(),TogglePrompt:Sr(),DatePrompt:rn(),NumberPrompt:un(),MultiselectPrompt:ht(),AutocompletePrompt:wn(),AutocompleteMultiselectPrompt:qn(),ConfirmPrompt:Dn()}});var An=u(En=>{"use strict";var y=En,Kl=Cn(),Ae=i=>i;function I(i,e,t={}){return new Promise((s,r)=>{let n=new Kl[i](e),o=t.onAbort||Ae,h=t.onSubmit||Ae,l=t.onExit||Ae;n.on("state",e.onState||Ae),n.on("submit",a=>s(h(a))),n.on("exit",a=>s(l(a))),n.on("abort",a=>r(o(a)))})}y.text=i=>I("TextPrompt",i);y.password=i=>(i.style="password",y.text(i));y.invisible=i=>(i.style="invisible",y.text(i));y.number=i=>I("NumberPrompt",i);y.date=i=>I("DatePrompt",i);y.confirm=i=>I("ConfirmPrompt",i);y.list=i=>{let e=i.separator||",";return I("TextPrompt",i,{onSubmit:t=>t.split(e).map(s=>s.trim())})};y.toggle=i=>I("TogglePrompt",i);y.select=i=>I("SelectPrompt",i);y.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return I("MultiselectPrompt",i,{onAbort:e,onSubmit:e})};y.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return I("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var Xl=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));y.autocomplete=i=>(i.suggest=i.suggest||Xl,i.choices=[].concat(i.choices||[]),I("AutocompletePrompt",i))});var kn=u((Ma,Rn)=>{"use strict";var at=An(),Ql=["suggest","format","onState","validate","onRender","type"],jn=()=>{};async function N(i=[],{onSubmit:e=jn,onCancel:t=jn}={}){let s={},r=N._override||{};i=[].concat(i);let n,o,h,l,a,Z,K=async(v,O,ce=!1)=>{if(!(!ce&&v.validate&&v.validate(O)!==!0))return v.format?await v.format(O,s):O};for(o of i)if({name:l,type:a}=o,typeof a=="function"&&(a=await a(n,Re({},s),o),o.type=a),!!a){for(let v in o){if(Ql.includes(v))continue;let O=o[v];o[v]=typeof O=="function"?await O(n,Re({},s),Z):O}if(Z=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:l,type:a}=o,at[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[o.name]!==void 0&&(n=await K(o,r[o.name]),n!==void 0)){s[l]=n;continue}try{n=N._injected?eu(N._injected,o.initial):await at[a](o),s[l]=n=await K(o,n,!0),h=await e(o,n,s)}catch{h=!await t(o,s)}if(h)return s}return s}function eu(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function tu(i){N._injected=(N._injected||[]).concat(i)}function iu(i){N._override=Object.assign({},i)}Rn.exports=Object.assign(N,{prompt:N,prompts:at,inject:tu,override:iu})});var Yn=u((Ta,Fn)=>{function su(i){i=(Array.isArray(i)?i:i.split(".")).map(Number);let e=0,t=process.versions.node.split(".").map(Number);for(;e<i.length;e++){if(t[e]>i[e])return!1;if(i[e]>t[e])return!0}return!1}Fn.exports=su("8.6.0")?Gs():kn()});var qt=require("fs"),Mt=require("./index.js");var ke,bt,vt,wt,yt=!0;typeof process<"u"&&({FORCE_COLOR:ke,NODE_DISABLE_COLORS:bt,NO_COLOR:vt,TERM:wt}=process.env,yt=process.stdout&&process.stdout.isTTY);var c={enabled:!bt&&vt==null&&wt!=="dumb"&&(ke!=null&&ke!=="0"||yt),reset:f(0,0),bold:f(1,22),dim:f(2,22),italic:f(3,23),underline:f(4,24),inverse:f(7,27),hidden:f(8,28),strikethrough:f(9,29),black:f(30,39),red:f(31,39),green:f(32,39),yellow:f(33,39),blue:f(34,39),magenta:f(35,39),cyan:f(36,39),white:f(37,39),gray:f(90,39),grey:f(90,39),bgBlack:f(40,49),bgRed:f(41,49),bgGreen:f(42,49),bgYellow:f(43,49),bgBlue:f(44,49),bgMagenta:f(45,49),bgCyan:f(46,49),bgWhite:f(47,49)};function mt(i,e){let t=0,s,r="",n="";for(;t<i.length;t++)s=i[t],r+=s.open,n+=s.close,~e.indexOf(s.close)&&(e=e.replace(s.rgx,s.close+s.open));return r+e+n}function Zn(i,e){let t={has:i,keys:e};return t.reset=c.reset.bind(t),t.bold=c.bold.bind(t),t.dim=c.dim.bind(t),t.italic=c.italic.bind(t),t.underline=c.underline.bind(t),t.inverse=c.inverse.bind(t),t.hidden=c.hidden.bind(t),t.strikethrough=c.strikethrough.bind(t),t.black=c.black.bind(t),t.red=c.red.bind(t),t.green=c.green.bind(t),t.yellow=c.yellow.bind(t),t.blue=c.blue.bind(t),t.magenta=c.magenta.bind(t),t.cyan=c.cyan.bind(t),t.white=c.white.bind(t),t.gray=c.gray.bind(t),t.grey=c.grey.bind(t),t.bgBlack=c.bgBlack.bind(t),t.bgRed=c.bgRed.bind(t),t.bgGreen=c.bgGreen.bind(t),t.bgYellow=c.bgYellow.bind(t),t.bgBlue=c.bgBlue.bind(t),t.bgMagenta=c.bgMagenta.bind(t),t.bgCyan=c.bgCyan.bind(t),t.bgWhite=c.bgWhite.bind(t),t}function f(i,e){let t={open:`\x1B[${i}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(i)||(this.has.push(i),this.keys.push(t)),s===void 0?this:c.enabled?mt(this.keys,s+""):s+""):s===void 0?Zn([i],[t]):c.enabled?mt([t],s+""):s+""}}var _=c;var xt=require("path");function pe(i){let e=process.cwd()===i.outDir,t=(0,xt.relative)(process.cwd(),i.outDir);console.log(""),console.log(e?`\u2B50\uFE0F ${_.green("Success!")}`:`\u2B50\uFE0F ${_.green("Success! Project saved in")} ${_.yellow(t)} ${_.green("directory")}`),console.log(""),console.log(`\u{1F4DF} ${_.cyan("Next steps:")}`),e||console.log(` cd ${t}`),console.log(" npm install"),console.log(" npm start"),console.log("")}function ge(i){console.error(`
104
+ `),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Pn.hide):this.out.write(zl(this.outputText,this.out.columns)),super.render(),this.outputText=[Tn.symbol(this.done,this.aborted),Mn.bold(this.msg),Tn.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Mn.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Wl.line+Pn.to(0)+this.outputText))}};In.exports=$n});var Cn=u((Sa,_n)=>{"use strict";_n.exports={TextPrompt:dr(),SelectPrompt:br(),TogglePrompt:Sr(),DatePrompt:rn(),NumberPrompt:un(),MultiselectPrompt:ht(),AutocompletePrompt:wn(),AutocompleteMultiselectPrompt:qn(),ConfirmPrompt:Dn()}});var An=u(En=>{"use strict";var y=En,Zl=Cn(),Ee=i=>i;function I(i,e,t={}){return new Promise((s,r)=>{let n=new Zl[i](e),o=t.onAbort||Ee,h=t.onSubmit||Ee,l=t.onExit||Ee;n.on("state",e.onState||Ee),n.on("submit",a=>s(h(a))),n.on("exit",a=>s(l(a))),n.on("abort",a=>r(o(a)))})}y.text=i=>I("TextPrompt",i);y.password=i=>(i.style="password",y.text(i));y.invisible=i=>(i.style="invisible",y.text(i));y.number=i=>I("NumberPrompt",i);y.date=i=>I("DatePrompt",i);y.confirm=i=>I("ConfirmPrompt",i);y.list=i=>{let e=i.separator||",";return I("TextPrompt",i,{onSubmit:t=>t.split(e).map(s=>s.trim())})};y.toggle=i=>I("TogglePrompt",i);y.select=i=>I("SelectPrompt",i);y.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return I("MultiselectPrompt",i,{onAbort:e,onSubmit:e})};y.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return I("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var Kl=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));y.autocomplete=i=>(i.suggest=i.suggest||Kl,i.choices=[].concat(i.choices||[]),I("AutocompletePrompt",i))});var kn=u((qa,Rn)=>{"use strict";var at=An(),Xl=["suggest","format","onState","validate","onRender","type"],jn=()=>{};async function N(i=[],{onSubmit:e=jn,onCancel:t=jn}={}){let s={},r=N._override||{};i=[].concat(i);let n,o,h,l,a,Z,K=async(v,O,ce=!1)=>{if(!(!ce&&v.validate&&v.validate(O)!==!0))return v.format?await v.format(O,s):O};for(o of i)if({name:l,type:a}=o,typeof a=="function"&&(a=await a(n,Re({},s),o),o.type=a),!!a){for(let v in o){if(Xl.includes(v))continue;let O=o[v];o[v]=typeof O=="function"?await O(n,Re({},s),Z):O}if(Z=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:l,type:a}=o,at[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[o.name]!==void 0&&(n=await K(o,r[o.name]),n!==void 0)){s[l]=n;continue}try{n=N._injected?Ql(N._injected,o.initial):await at[a](o),s[l]=n=await K(o,n,!0),h=await e(o,n,s)}catch{h=!await t(o,s)}if(h)return s}return s}function Ql(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function eu(i){N._injected=(N._injected||[]).concat(i)}function tu(i){N._override=Object.assign({},i)}Rn.exports=Object.assign(N,{prompt:N,prompts:at,inject:eu,override:tu})});var Yn=u((Ma,Fn)=>{function iu(i){i=(Array.isArray(i)?i:i.split(".")).map(Number);let e=0,t=process.versions.node.split(".").map(Number);for(;e<i.length;e++){if(t[e]>i[e])return!1;if(i[e]>t[e])return!0}return!1}Fn.exports=iu("8.6.0")?Gs():kn()});var qt=require("fs"),Mt=require("./index.js");var ke,bt,vt,wt,yt=!0;typeof process<"u"&&({FORCE_COLOR:ke,NODE_DISABLE_COLORS:bt,NO_COLOR:vt,TERM:wt}=process.env,yt=process.stdout&&process.stdout.isTTY);var c={enabled:!bt&&vt==null&&wt!=="dumb"&&(ke!=null&&ke!=="0"||yt),reset:f(0,0),bold:f(1,22),dim:f(2,22),italic:f(3,23),underline:f(4,24),inverse:f(7,27),hidden:f(8,28),strikethrough:f(9,29),black:f(30,39),red:f(31,39),green:f(32,39),yellow:f(33,39),blue:f(34,39),magenta:f(35,39),cyan:f(36,39),white:f(37,39),gray:f(90,39),grey:f(90,39),bgBlack:f(40,49),bgRed:f(41,49),bgGreen:f(42,49),bgYellow:f(43,49),bgBlue:f(44,49),bgMagenta:f(45,49),bgCyan:f(46,49),bgWhite:f(47,49)};function mt(i,e){let t=0,s,r="",n="";for(;t<i.length;t++)s=i[t],r+=s.open,n+=s.close,~e.indexOf(s.close)&&(e=e.replace(s.rgx,s.close+s.open));return r+e+n}function Wn(i,e){let t={has:i,keys:e};return t.reset=c.reset.bind(t),t.bold=c.bold.bind(t),t.dim=c.dim.bind(t),t.italic=c.italic.bind(t),t.underline=c.underline.bind(t),t.inverse=c.inverse.bind(t),t.hidden=c.hidden.bind(t),t.strikethrough=c.strikethrough.bind(t),t.black=c.black.bind(t),t.red=c.red.bind(t),t.green=c.green.bind(t),t.yellow=c.yellow.bind(t),t.blue=c.blue.bind(t),t.magenta=c.magenta.bind(t),t.cyan=c.cyan.bind(t),t.white=c.white.bind(t),t.gray=c.gray.bind(t),t.grey=c.grey.bind(t),t.bgBlack=c.bgBlack.bind(t),t.bgRed=c.bgRed.bind(t),t.bgGreen=c.bgGreen.bind(t),t.bgYellow=c.bgYellow.bind(t),t.bgBlue=c.bgBlue.bind(t),t.bgMagenta=c.bgMagenta.bind(t),t.bgCyan=c.bgCyan.bind(t),t.bgWhite=c.bgWhite.bind(t),t}function f(i,e){let t={open:`\x1B[${i}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(i)||(this.has.push(i),this.keys.push(t)),s===void 0?this:c.enabled?mt(this.keys,s+""):s+""):s===void 0?Wn([i],[t]):c.enabled?mt([t],s+""):s+""}}var _=c;var xt=require("path");function fe(i){let e=process.cwd()===i.outDir,t=(0,xt.relative)(process.cwd(),i.outDir);console.log(""),console.log(e?`\u2B50\uFE0F ${_.green("Success!")}`:`\u2B50\uFE0F ${_.green("Success! Project saved in")} ${_.yellow(t)} ${_.green("directory")}`),console.log(""),console.log(`\u{1F4DF} ${_.cyan("Next steps:")}`),e||console.log(` cd ${t}`),console.log(" npm install"),console.log(" npm start"),console.log("")}function pe(i){console.error(`
105
105
  \u274C ${_.red(i)}
106
- `),process.exit(1)}var St=require("fs"),Ot=require("path");function me(i){return i.toLocaleLowerCase().replace(/ /g,"-")}function be(i){return(0,Ot.resolve)(process.cwd(),i)}function ve(i){(0,St.existsSync)(i)&&ge(`Directory "${i}" already exists. Please either remove this directory, or choose another location.`)}async function Tt(i,e){let t=me(e),s;Kn()?s=process.cwd():(s=be(t),ve(s),(0,qt.mkdirSync)(s,{recursive:!0}));let n=await(0,Mt.generateStarter)({appId:i,projectName:e,serverId:"express",outDir:s,featureIds:[]});pe(n)}function Kn(){return Xn()}function Xn(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var Hn=Wn(Yn());var je=require("./index.js");async function Vn(){console.clear(),console.log(`\u{1F4AB} ${_.cyan("Let's create a Qwik project")} \u{1F4AB}`),console.log("");let i=await(0,je.getStarters)(),e=i.apps.filter(r=>r.id!=="base"),t={projectName:"",appId:"",serverId:"",featureIds:[],outDir:""};await(0,Hn.default)([{type:"text",name:"projectName",message:"Project name",initial:"qwik-app",validate:r=>{let n=me(r);return t.outDir=be(n),ve(t.outDir),!0},format:r=>t.projectName=r},{type:"select",name:"appId",message:"Select a starter",choices:e.map(r=>({title:r.name,value:r.id,description:r.description})),format:r=>t.appId=r},{type:"select",name:"serverId",message:"Select a server",choices:()=>[...i.servers.map(r=>({title:r.name,value:r.id,description:r.description})),{title:"Setup later",value:"no-hosting",description:"I'll setup my own hosting"}],format:r=>t.serverId=r},{type:()=>{let r=i.apps.find(n=>n.id===t.appId);return r&&r.featureOptions.length>0?"multiselect":null},name:"featureIds",message:"Features",instructions:!1,choices:()=>[...i.apps.find(o=>o.id===t.appId).featureOptions].map(o=>{let h=i.features.find(l=>l.id===o);return{title:h.name,value:h.id,description:h.description,selected:!0}}),format:r=>t.featureIds=r}]);let s=await(0,je.generateStarter)(t);pe(s)}async function ru(){try{let i=process.argv.slice(2);if(i.length>=2){let e=i[0],t=i[1];await Tt(e,t)}else await Vn()}catch(i){ge(i.message||i)}}ru();
106
+ `),process.exit(1)}var St=require("fs"),Ot=require("path");function ge(i){return i.toLocaleLowerCase().replace(/ /g,"-")}function me(i){return(0,Ot.resolve)(process.cwd(),i)}function be(i){(0,St.existsSync)(i)&&pe(`Directory "${i}" already exists. Please either remove this directory, or choose another location.`)}async function Tt(i,e){let t=ge(e),s;Zn()?s=process.cwd():(s=me(t),be(s),(0,qt.mkdirSync)(s,{recursive:!0}));let n=await(0,Mt.generateStarter)({appId:i,projectName:e,serverId:"express",outDir:s,featureIds:[]});fe(n)}function Zn(){return Kn()}function Kn(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var Hn=zn(Yn());var Ae=require("./index.js");async function Vn(){console.clear(),console.log(`\u{1F4AB} ${_.cyan("Let's create a Qwik project")} \u{1F4AB}`),console.log("");let i=await(0,Ae.getStarters)(),e=i.apps.filter(r=>r.id!=="base"),t={projectName:"",appId:"",serverId:"",featureIds:[],outDir:""};await(0,Hn.default)([{type:"text",name:"projectName",message:"Project name",initial:"qwik-app",validate:r=>{let n=ge(r);return t.outDir=me(n),be(t.outDir),!0},format:r=>t.projectName=r},{type:"select",name:"appId",message:"Select a starter",choices:e.map(r=>({title:r.name,value:r.id,description:r.description})),format:r=>t.appId=r},{type:"select",name:"serverId",message:"Select a server",choices:()=>[...i.servers.map(r=>({title:r.name,value:r.id,description:r.description})),{title:"Setup later",value:"no-hosting",description:"I'll setup my own hosting"}],format:r=>t.serverId=r},{type:()=>{let r=i.apps.find(n=>n.id===t.appId);return r&&r.featureOptions.length>0?"multiselect":null},name:"featureIds",message:"Features",instructions:!1,choices:()=>[...i.apps.find(o=>o.id===t.appId).featureOptions].map(o=>{let h=i.features.find(l=>l.id===o);return{title:h.name,value:h.id,description:h.description,selected:!0}}),format:r=>t.featureIds=r}]);let s=await(0,Ae.generateStarter)(t);fe(s)}async function su(){try{let i=process.argv.slice(2);if(i.length>=2){let e=i[0],t=i[1];await Tt(e,t)}else await Vn()}catch(i){pe(i.message||i)}}su();
package/index.js CHANGED
@@ -4,11 +4,11 @@
4
4
  * Use of this source code is governed by an MIT-style license that can be
5
5
  * found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
6
6
  */
7
- var C=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames,J=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var O=(e,t,r)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h=(e,t)=>{for(var r in t||(t={}))N.call(t,r)&&O(e,r,t[r]);if(J)for(var r of J(t))z.call(t,r)&&O(e,r,t[r]);return e};var M=e=>C(e,"__esModule",{value:!0});var U=(e,t)=>{for(var r in t)C(e,r,{get:t[r],enumerable:!0})},V=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of q(t))!N.call(e,n)&&(r||n!=="default")&&C(e,n,{get:()=>t[n],enumerable:!(o=$(t,n))||o.enumerable});return e};var B=(e=>(t,r)=>e&&e.get(t)||(r=V(M({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Y={};U(Y,{generateStarter:()=>T,getStarters:()=>w});var g=require("fs"),L=require("path");var l=require("fs"),y=require("path");function K(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var E=function(t){K(t);let r=-1,o=0,n=-1,s=!0,i=0;for(let a=t.length-1;a>=0;--a){let d=t.charCodeAt(a);if(d===47){if(!s){o=a+1;break}continue}n===-1&&(s=!1,n=a+1),d===46?r===-1?r=a:i!==1&&(i=1):r!==-1&&(i=-1)}return r===-1||n===-1||i===0||i===1&&r===n-1&&r===o+1?"":t.slice(r,n)};function p(e,t,r){let o=(0,l.readdirSync)(e);for(let n of o){let s=(0,y.join)(e,n),i=(0,y.join)(t,n),a=(0,l.statSync)(s);if(a.isDirectory())(0,l.mkdirSync)(i,{recursive:!0}),p(s,i,r);else if(a.isFile())if(r.length>0&&[".json",".toml",".md",".html"].includes(E(s))){let c=(0,l.readFileSync)(s,"utf8");for(let u of r)c=c.replace(u[0],u[1]);(0,l.writeFileSync)(i,c)}else(0,l.copyFileSync)(s,i)}}function m(e){let t=(0,y.join)(e,"package.json");return JSON.parse((0,l.readFileSync)(t,"utf-8"))}function I(e,t){let r=(0,y.join)(e,"package.json");(0,l.writeFileSync)(r,JSON.stringify(t,null,2)+`
8
- `)}function R(e){return e.toLocaleLowerCase().split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function F(e){return e.toLocaleLowerCase().replace(/ /g,"-")}function k(e,t){["scripts","dependencies","devDependencies"].forEach(o=>{H(e,t,o)})}function H(e,t,r){if(t[r]){e[r]?Object.assign(e[r],h({},t[r])):e[r]=h({},t[r]);let o={},n=Object.keys(e[r]).sort();for(let s of n)o[s]=e[r][s];e[r]=o}}async function T(e){if(!D(e.projectName))throw new Error("Missing project name");if(!D(e.appId))throw new Error("Missing starter id");if(!D(e.outDir))throw new Error("Missing outDir");(0,g.existsSync)(e.outDir)||(0,g.mkdirSync)(e.outDir,{recursive:!0});let t={projectName:e.projectName,appId:e.appId,serverId:e.serverId,outDir:e.outDir},r=await w(),o=r.apps.find(i=>i.id===e.appId),n=r.servers.find(i=>i.id===e.serverId),s=r.features.filter(i=>e.featureIds.includes(i.id));if(o)Q(r,t,o,n,s);else throw new Error(`Invalid starter id "${e.appId}".`);return t}function Q(e,t,r,o,n){let s=[[/\bqwik-project-name\b/g,t.projectName]],i=e.apps.find(f=>f.id==="base");if(!i)throw new Error("Unable to find base app.");p(i.dir,t.outDir,s),p(r.dir,t.outDir,s);let a=m(i.dir),d=m(i.dir);k(a,d);let c=[r.description,"Vite.js tooling."];if(o){p(o.dir,t.outDir,s);let f=m(o.dir);k(a,f),f.description&&c.push(f.description)}for(let f of n){p(f.dir,t.outDir,s);let P=m(f.dir);k(a,P),P.description&&c.push(P.description)}a.name=F(t.projectName),a.description=c.join(" ").trim();let u=(0,L.join)(t.outDir,"README.md"),x=(0,g.readFileSync)(u,"utf-8"),b=c.map(f=>`- ${f}`).join(`
7
+ var C=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames,J=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var N=(e,t,r)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y=(e,t)=>{for(var r in t||(t={}))O.call(t,r)&&N(e,r,t[r]);if(J)for(var r of J(t))z.call(t,r)&&N(e,r,t[r]);return e};var M=(e,t)=>{for(var r in t)C(e,r,{get:t[r],enumerable:!0})},U=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of q(t))!O.call(e,n)&&n!==r&&C(e,n,{get:()=>t[n],enumerable:!(s=$(t,n))||s.enumerable});return e};var V=e=>U(C({},"__esModule",{value:!0}),e);var X={};M(X,{generateStarter:()=>T,getStarters:()=>w});module.exports=V(X);var g=require("fs"),L=require("path");var l=require("fs"),S=require("path");function B(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var E=function(t){B(t);let r=-1,s=0,n=-1,o=!0,i=0;for(let a=t.length-1;a>=0;--a){let c=t.charCodeAt(a);if(c===47){if(!o){s=a+1;break}continue}n===-1&&(o=!1,n=a+1),c===46?r===-1?r=a:i!==1&&(i=1):r!==-1&&(i=-1)}return r===-1||n===-1||i===0||i===1&&r===n-1&&r===s+1?"":t.slice(r,n)};function h(e,t,r){let s=(0,l.readdirSync)(e);for(let n of s){let o=n==="gitignore"?".gitignore":n,i=(0,S.join)(e,n),a=(0,S.join)(t,o),c=(0,l.statSync)(i);if(c.isDirectory())(0,l.mkdirSync)(a,{recursive:!0}),h(i,a,r);else if(c.isFile())if(r.length>0&&[".json",".toml",".md",".html"].includes(E(i))){let d=(0,l.readFileSync)(i,"utf8");for(let m of r)d=d.replace(m[0],m[1]);(0,l.writeFileSync)(a,d)}else(0,l.copyFileSync)(i,a)}}function p(e){let t=(0,S.join)(e,"package.json");return JSON.parse((0,l.readFileSync)(t,"utf-8"))}function I(e,t){let r=(0,S.join)(e,"package.json");(0,l.writeFileSync)(r,JSON.stringify(t,null,2)+`
8
+ `)}function R(e){return e.toLocaleLowerCase().split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function F(e){return e.toLocaleLowerCase().replace(/ /g,"-")}function k(e,t){["scripts","dependencies","devDependencies"].forEach(s=>{K(e,t,s)})}function K(e,t,r){if(t[r]){e[r]?Object.assign(e[r],y({},t[r])):e[r]=y({},t[r]);let s={},n=Object.keys(e[r]).sort();for(let o of n)s[o]=e[r][o];e[r]=s}}async function T(e){if(!D(e.projectName))throw new Error("Missing project name");if(!D(e.appId))throw new Error("Missing starter id");if(!D(e.outDir))throw new Error("Missing outDir");(0,g.existsSync)(e.outDir)||(0,g.mkdirSync)(e.outDir,{recursive:!0});let t={projectName:e.projectName,appId:e.appId,serverId:e.serverId,outDir:e.outDir},r=await w(),s=r.apps.find(i=>i.id===e.appId),n=r.servers.find(i=>i.id===e.serverId),o=r.features.filter(i=>e.featureIds.includes(i.id));if(s)H(r,t,s,n,o);else throw new Error(`Invalid starter id "${e.appId}".`);return t}function H(e,t,r,s,n){let o=[[/\bqwik-project-name\b/g,t.projectName]],i=e.apps.find(f=>f.id==="base");if(!i)throw new Error("Unable to find base app.");h(i.dir,t.outDir,o),h(r.dir,t.outDir,o);let a=p(i.dir),c=p(i.dir);k(a,c);let u=[r.description,"Vite.js tooling."];if(s){h(s.dir,t.outDir,o);let f=p(s.dir);k(a,f),f.description&&u.push(f.description)}for(let f of n){h(f.dir,t.outDir,o);let P=p(f.dir);k(a,P),P.description&&u.push(P.description)}a.name=F(t.projectName),a.description=u.join(" ").trim();let d=(0,L.join)(t.outDir,"README.md"),m=(0,g.readFileSync)(d,"utf-8"),b=u.map(f=>`- ${f}`).join(`
9
9
  `).trim(),G=`# ${t.projectName}
10
10
 
11
11
  ${b}
12
12
 
13
- ${x}`;(0,g.writeFileSync)(u,G.trim()+`
14
- `);let _=W(a);I(t.outDir,_)}function W(e){e=h({},e);let t={name:e.name,version:e.version,description:e.description,scripts:e.scripts,dependencies:e.dependencies,devDependencies:e.devDependencies};Object.keys(t).forEach(o=>{delete e[o]}),delete e.qwik;let r=Object.keys(e).sort();for(let o of r)t[o]=e[o];return t}function D(e){return typeof e=="string"&&e.trim().length>0}var A=require("fs"),S=require("path");var j=null;async function w(){return j==null&&(j=X((0,S.join)(__dirname,"starters"))),j}function X(e){return{apps:v(e,"apps"),servers:v(e,"servers"),features:v(e,"features")}}function v(e,t){let r=(0,S.join)(e,t);return(0,A.readdirSync)(r).filter(n=>(0,A.statSync)((0,S.join)(r,n)).isDirectory()).map(n=>{var d,c,u,x,b;let s=(0,S.join)(r,n),i=m(s);return{id:n,name:R(n),description:(d=i.description)!=null?d:"",dir:s,priority:(u=(c=i==null?void 0:i.qwik)==null?void 0:c.priority)!=null?u:0,featureOptions:(b=(x=i==null?void 0:i.qwik)==null?void 0:x.featureOptions)!=null?b:[]}}).sort((n,s)=>n.priority>s.priority?-1:n.priority<s.priority?1:n.name<s.name?-1:n.name>s.name?1:0)}module.exports=B(Y);0&&(module.exports={generateStarter,getStarters});
13
+ ${m}`;(0,g.writeFileSync)(d,G.trim()+`
14
+ `);let _=Q(a);I(t.outDir,_)}function Q(e){e=y({},e);let t={name:e.name,version:e.version,description:e.description,scripts:e.scripts,dependencies:e.dependencies,devDependencies:e.devDependencies};Object.keys(t).forEach(s=>{delete e[s]}),delete e.qwik;let r=Object.keys(e).sort();for(let s of r)t[s]=e[s];return t}function D(e){return typeof e=="string"&&e.trim().length>0}var A=require("fs"),x=require("path");var j=null;async function w(){return j==null&&(j=W((0,x.join)(__dirname,"starters"))),j}function W(e){return{apps:v(e,"apps"),servers:v(e,"servers"),features:v(e,"features")}}function v(e,t){let r=(0,x.join)(e,t);return(0,A.readdirSync)(r).filter(n=>(0,A.statSync)((0,x.join)(r,n)).isDirectory()).map(n=>{var c,u,d,m,b;let o=(0,x.join)(r,n),i=p(o);return{id:n,name:R(n),description:(c=i.description)!=null?c:"",dir:o,priority:(d=(u=i==null?void 0:i.qwik)==null?void 0:u.priority)!=null?d:0,featureOptions:(b=(m=i==null?void 0:i.qwik)==null?void 0:m.featureOptions)!=null?b:[]}}).sort((n,o)=>n.priority>o.priority?-1:n.priority<o.priority?1:n.name<o.name?-1:n.name>o.name?1:0)}0&&(module.exports={generateStarter,getStarters});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-qwik",
3
- "version": "0.0.18-6",
3
+ "version": "0.0.18-7",
4
4
  "description": "Interactive CLI and API for generating Qwik projects.",
5
5
  "bin": {
6
6
  "create-qwik": "create-qwik"
@@ -26,7 +26,7 @@
26
26
  "url": "https://github.com/BuilderIO/qwik/issues"
27
27
  },
28
28
  "engines": {
29
- "node": ">=10",
29
+ "node": ">=14",
30
30
  "npm": ">=6.0.0"
31
31
  }
32
32
  }
@@ -0,0 +1,31 @@
1
+ .cache
2
+ .rollup.cache
3
+ build
4
+ dist
5
+ node_modules
6
+ tsconfig.tsbuildinfo
7
+ q-symbols.json
8
+
9
+ # Logs
10
+ logs
11
+ *.log
12
+ npm-debug.log*
13
+ yarn-debug.log*
14
+ yarn-error.log*
15
+ pnpm-debug.log*
16
+ lerna-debug.log*
17
+
18
+ node_modules
19
+ dist
20
+ dist-ssr
21
+ *.local
22
+
23
+ # Editor directories and files
24
+ !.vscode/extensions.json
25
+ .idea
26
+ .DS_Store
27
+ *.suo
28
+ *.ntvs*
29
+ *.njsproj
30
+ *.sln
31
+ *.sw?
@@ -15,13 +15,13 @@
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/node": "17.0.17",
18
- "@builder.io/qwik": "0.0.18-6",
18
+ "@builder.io/qwik": "0.0.18-7",
19
19
  "typescript": "4.5.5",
20
20
  "vite": "2.8.6"
21
21
  },
22
22
  "author": "Builder.io Team",
23
23
  "license": "MIT",
24
24
  "engines": {
25
- "node": ">=14.14.0"
25
+ "node": ">=14"
26
26
  }
27
27
  }
@@ -4,6 +4,7 @@
4
4
  "priority": 0,
5
5
  "featureOptions": [
6
6
  "prettier",
7
+ "eslint",
7
8
  "tailwindcss"
8
9
  ]
9
10
  }
@@ -4,6 +4,7 @@
4
4
  "priority": 0,
5
5
  "featureOptions": [
6
6
  "prettier",
7
+ "eslint",
7
8
  "tailwindcss"
8
9
  ]
9
10
  }
@@ -7,6 +7,7 @@
7
7
  "priority": 0,
8
8
  "featureOptions": [
9
9
  "prettier",
10
+ "eslint",
10
11
  "tailwindcss"
11
12
  ]
12
13
  }
@@ -0,0 +1,29 @@
1
+ **/*.log
2
+ **/.DS_Store
3
+ *.
4
+ .vscode/settings.json
5
+ .history
6
+ .yarn
7
+ bazel-*
8
+ bazel-bin
9
+ bazel-out
10
+ bazel-qwik
11
+ bazel-testlogs
12
+ dist
13
+ dist-dev
14
+ etc
15
+ external
16
+ node_modules
17
+ temp
18
+ tsc-out
19
+ tsdoc-metadata.json
20
+ integration/**/*.js
21
+ target
22
+ output
23
+ rollup.config.js
24
+ build
25
+ .cache
26
+ .vscode
27
+ .rollup.cache
28
+ dist
29
+ tsconfig.tsbuildinfo
@@ -0,0 +1,34 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true,
5
+ node: true,
6
+ },
7
+ extends: [
8
+ 'eslint:recommended',
9
+ 'plugin:@typescript-eslint/recommended',
10
+ 'plugin:qwik/recommended',
11
+ ],
12
+ parser: '@typescript-eslint/parser',
13
+ parserOptions: {
14
+ ecmaVersion: 12,
15
+ sourceType: 'module',
16
+ },
17
+ plugins: ['@typescript-eslint'],
18
+ rules: {
19
+ '@typescript-eslint/no-explicit-any': 'off',
20
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
21
+ '@typescript-eslint/no-inferrable-types': 'off',
22
+ '@typescript-eslint/no-non-null-assertion': 'off',
23
+ '@typescript-eslint/no-empty-interface': 'off',
24
+ '@typescript-eslint/no-namespace': 'off',
25
+ '@typescript-eslint/no-empty-function': 'off',
26
+ '@typescript-eslint/no-this-alias': 'off',
27
+ '@typescript-eslint/ban-types': 'off',
28
+ '@typescript-eslint/ban-ts-comment': 'off',
29
+ 'prefer-spread': 'off',
30
+ 'no-case-declarations': 'off',
31
+ 'no-console': 'off',
32
+ '@typescript-eslint/no-unused-vars': ['error'],
33
+ },
34
+ };
@@ -0,0 +1,13 @@
1
+ {
2
+ "description": "Eslint code linting.",
3
+ "scripts": {
4
+ "lint": "eslint \"**/*.ts*\""
5
+ },
6
+ "devDependencies": {
7
+ "@types/eslint": "^8.4.1",
8
+ "@typescript-eslint/eslint-plugin": "5.14.0",
9
+ "@typescript-eslint/parser": "5.14.0",
10
+ "eslint-plugin-qwik": "latest",
11
+ "eslint": "^8.12.0"
12
+ }
13
+ }
@@ -4,11 +4,6 @@
4
4
  .vscode/settings.json
5
5
  .history
6
6
  .yarn
7
- bazel-*
8
- bazel-bin
9
- bazel-out
10
- bazel-qwik
11
- bazel-testlogs
12
7
  dist
13
8
  dist-dev
14
9
  etc