create-reactive-vscode 0.2.16 → 0.2.17

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.
Files changed (2) hide show
  1. package/dist/index.cjs +444 -101
  2. package/package.json +4 -4
package/dist/index.cjs CHANGED
@@ -1,106 +1,450 @@
1
- var fo=Object.create;var ni=Object.defineProperty;var po=Object.getOwnPropertyDescriptor;var mo=Object.getOwnPropertyNames;var go=Object.getPrototypeOf,bo=Object.prototype.hasOwnProperty;var u=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var vo=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of mo(e))!bo.call(i,r)&&r!==t&&ni(i,r,{get:()=>e[r],enumerable:!(s=po(e,r))||s.enumerable});return i};var B=(i,e,t)=>(t=i!=null?fo(go(i)):{},vo(e||!i||!i.__esModule?ni(t,"default",{value:i,enumerable:!0}):t,i));var p=u((Ku,vi)=>{"use strict";var{FORCE_COLOR:Ao,NODE_DISABLE_COLORS:Do,TERM:Ro}=process.env,c={enabled:!Do&&Ro!=="dumb"&&Ao!=="0",reset:d(0,0),bold:d(1,22),dim:d(2,22),italic:d(3,23),underline:d(4,24),inverse:d(7,27),hidden:d(8,28),strikethrough:d(9,29),black:d(30,39),red:d(31,39),green:d(32,39),yellow:d(33,39),blue:d(34,39),magenta:d(35,39),cyan:d(36,39),white:d(37,39),gray:d(90,39),grey:d(90,39),bgBlack:d(40,49),bgRed:d(41,49),bgGreen:d(42,49),bgYellow:d(43,49),bgBlue:d(44,49),bgMagenta:d(45,49),bgCyan:d(46,49),bgWhite:d(47,49)};function bi(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 ko(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 d(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:c.enabled?bi(this.keys,s+""):s+""):s===void 0?ko([i],[t]):c.enabled?bi([t],s+""):s+""}}vi.exports=c});var wi=u((Zu,yi)=>{"use strict";yi.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 Oe=u((Xu,xi)=>{"use strict";xi.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 g=u((Qu,Si)=>{"use strict";var He="\x1B",m=`${He}[`,jo="\x07",Ge={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:`${He}7`,restore:`${He}8`},Fo={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?Ge.up():"");return i&&(e+=Ge.left),e}};Si.exports={cursor:Ge,scroll:Fo,erase:No,beep:jo}});var qi=u((ea,Mi)=>{"use strict";function Vo(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=Yo(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.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,l;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return n=a.done,a},e:function(a){o=!0,l=a},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw l}}}}function Yo(i,e){if(i){if(typeof i=="string")return Oi(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 Oi(i,e)}}function Oi(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=Oe(),Ci=g(),Ti=Ci.erase,Bo=Ci.cursor,Ho=i=>[...Lo(i)].length;Mi.exports=function(i,e){if(!e)return Ti.line+Bo.to(0);let t=0,s=i.split(/\r?\n/);var r=Vo(s),n;try{for(r.s();!(n=r.n()).done;){let o=n.value;t+=1+Math.floor(Math.max(Ho(o)-1,0)/e)}}catch(o){r.e(o)}finally{r.f()}return Ti.lines(t)}});var Ue=u((ta,$i)=>{"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"},Go={arrowUp:oe.arrowUp,arrowDown:oe.arrowDown,arrowLeft:oe.arrowLeft,arrowRight:oe.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Uo=process.platform==="win32"?Go:oe;$i.exports=Uo});var _i=u((ia,Ii)=>{"use strict";var Q=p(),J=Ue(),We=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}`}}),Wo=i=>We[i]||We.default,le=Object.freeze({aborted:Q.red(J.cross),done:Q.green(J.tick),exited:Q.yellow(J.cross),default:Q.cyan("?")}),Jo=(i,e,t)=>e?le.aborted:t?le.exited:i?le.done:le.default,zo=i=>Q.gray(i?J.ellipsis:J.pointerSmall),Ko=(i,e)=>Q.gray(i?e?J.pointerSmall:"+":J.line);Ii.exports={styles:We,render:Wo,symbols:le,symbol:Jo,delimiter:zo,item:Ko}});var Ei=u((sa,Pi)=>{"use strict";var Zo=Oe();Pi.exports=function(i,e){let t=String(Zo(i)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,r)=>s+r):t.length}});var Di=u((ra,Ai)=>{"use strict";Ai.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(`
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const l=c(require(`node:fs`)),u=c(require(`node:path`)),d=c(require(`node:process`)),f=c(require(`node:os`)),p=c(require(`node:tty`)),m=10,h=(e=0)=>t=>`\u001B[${t+e}m`,g=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,_=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,v={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},y=Object.keys(v.modifier),b=Object.keys(v.color),x=Object.keys(v.bgColor),S=[...b,...x];function C(){let e=new Map;for(let[t,n]of Object.entries(v)){for(let[t,r]of Object.entries(n))v[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=v[t],e.set(r[0],r[1]);Object.defineProperty(v,t,{value:n,enumerable:!1})}return Object.defineProperty(v,`codes`,{value:e,enumerable:!1}),v.color.close=`\x1B[39m`,v.bgColor.close=`\x1B[49m`,v.color.ansi=h(),v.color.ansi256=g(),v.color.ansi16m=_(),v.bgColor.ansi=h(m),v.bgColor.ansi256=g(m),v.bgColor.ansi16m=_(m),Object.defineProperties(v,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>v.rgbToAnsi256(...v.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>v.ansi256ToAnsi(v.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>v.ansi256ToAnsi(v.hexToAnsi256(e)),enumerable:!1}}),v}const w=C();var T=w;function E(e,t=globalThis.Deno?globalThis.Deno.args:d.default.argv){let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}const{env:D}=d.default;let O;E(`no-color`)||E(`no-colors`)||E(`color=false`)||E(`color=never`)?O=0:(E(`color`)||E(`colors`)||E(`color=true`)||E(`color=always`))&&(O=1);function ee(){if(`FORCE_COLOR`in D)return D.FORCE_COLOR===`true`?1:D.FORCE_COLOR===`false`?0:D.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(D.FORCE_COLOR,10),3)}function te(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ne(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=ee();r!==void 0&&(O=r);let i=n?O:r;if(i===0)return 0;if(n){if(E(`color=16m`)||E(`color=full`)||E(`color=truecolor`))return 3;if(E(`color=256`))return 2}if(`TF_BUILD`in D&&`AGENT_NAME`in D)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(D.TERM===`dumb`)return a;if(d.default.platform===`win32`){let e=f.default.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in D)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in D)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in D)||D.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in D)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(D.TEAMCITY_VERSION)?1:0;if(D.COLORTERM===`truecolor`||D.TERM===`xterm-kitty`)return 3;if(`TERM_PROGRAM`in D){let e=Number.parseInt((D.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(D.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(D.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(D.TERM)||`COLORTERM`in D?1:a}function k(e,t={}){let n=ne(e,{streamIsTTY:e&&e.isTTY,...t});return te(n)}const re={stdout:k({isTTY:p.default.isatty(1)}),stderr:k({isTTY:p.default.isatty(2)})};var ie=re;function ae(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.slice(a),o}function oe(e,t,n,r){let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.slice(i,o?r-1:r)+t+(o?`\r
2
+ `:`
3
+ `)+n,i=r+1,r=e.indexOf(`
4
+ `,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:A,stderr:se}=ie,j=Symbol(`GENERATOR`),M=Symbol(`STYLER`),N=Symbol(`IS_EMPTY`),P=[`ansi`,`ansi`,`ansi256`,`ansi16m`],F=Object.create(null),ce=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=A?A.level:0;e.level=t.level===void 0?n:t.level},le=e=>{let t=(...e)=>e.join(` `);return ce(t,e),Object.setPrototypeOf(t,I.prototype),t};function I(e){return le(e)}Object.setPrototypeOf(I.prototype,Function.prototype);for(let[e,t]of Object.entries(T))F[e]={get(){let n=z(this,R(t.open,t.close,this[M]),this[N]);return Object.defineProperty(this,e,{value:n}),n}};F.visible={get(){let e=z(this,this[M],!0);return Object.defineProperty(this,`visible`,{value:e}),e}};const L=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?T[n].ansi16m(...r):t===`ansi256`?T[n].ansi256(T.rgbToAnsi256(...r)):T[n].ansi(T.rgbToAnsi(...r)):e===`hex`?L(`rgb`,t,n,...T.hexToRgb(...r)):T[n][e](...r),ue=[`rgb`,`hex`,`ansi256`];for(let e of ue){F[e]={get(){let{level:t}=this;return function(...n){let r=R(L(e,P[t],`color`,...n),T.color.close,this[M]);return z(this,r,this[N])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);F[t]={get(){let{level:t}=this;return function(...n){let r=R(L(e,P[t],`bgColor`,...n),T.bgColor.close,this[M]);return z(this,r,this[N])}}}}const de=Object.defineProperties(()=>{},{...F,level:{enumerable:!0,get(){return this[j].level},set(e){this[j].level=e}}}),R=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},z=(e,t,n)=>{let r=(...e)=>fe(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,de),r[j]=e,r[M]=t,r[N]=n,r},fe=(e,t)=>{if(e.level<=0||!t)return e[N]?``:t;let n=e[M];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=ae(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
5
+ `);return a!==-1&&(t=oe(t,i,r,a)),r+t+i};Object.defineProperties(I.prototype,F);const pe=I(),me=I({level:se?se.level:0});var B=pe,V=o((exports,t)=>{let{FORCE_COLOR:n,NODE_DISABLE_COLORS:r,TERM:i}=process.env,a={enabled:!r&&i!==`dumb`&&n!==`0`,reset:c(0,0),bold:c(1,22),dim:c(2,22),italic:c(3,23),underline:c(4,24),inverse:c(7,27),hidden:c(8,28),strikethrough:c(9,29),black:c(30,39),red:c(31,39),green:c(32,39),yellow:c(33,39),blue:c(34,39),magenta:c(35,39),cyan:c(36,39),white:c(37,39),gray:c(90,39),grey:c(90,39),bgBlack:c(40,49),bgRed:c(41,49),bgGreen:c(42,49),bgYellow:c(43,49),bgBlue:c(44,49),bgMagenta:c(45,49),bgCyan:c(46,49),bgWhite:c(47,49)};function o(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,t.includes(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function s(e,t){let n={has:e,keys:t};return n.reset=a.reset.bind(n),n.bold=a.bold.bind(n),n.dim=a.dim.bind(n),n.italic=a.italic.bind(n),n.underline=a.underline.bind(n),n.inverse=a.inverse.bind(n),n.hidden=a.hidden.bind(n),n.strikethrough=a.strikethrough.bind(n),n.black=a.black.bind(n),n.red=a.red.bind(n),n.green=a.green.bind(n),n.yellow=a.yellow.bind(n),n.blue=a.blue.bind(n),n.magenta=a.magenta.bind(n),n.cyan=a.cyan.bind(n),n.white=a.white.bind(n),n.gray=a.gray.bind(n),n.grey=a.grey.bind(n),n.bgBlack=a.bgBlack.bind(n),n.bgRed=a.bgRed.bind(n),n.bgGreen=a.bgGreen.bind(n),n.bgYellow=a.bgYellow.bind(n),n.bgBlue=a.bgBlue.bind(n),n.bgMagenta=a.bgMagenta.bind(n),n.bgCyan=a.bgCyan.bind(n),n.bgWhite=a.bgWhite.bind(n),n}function c(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(this.has.includes(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:a.enabled?o(this.keys,t+``):t+``):t===void 0?s([e],[n]):a.enabled?o([n],t+``):t+``}}t.exports=a}),he=o((exports,t)=>{t.exports=(e,t)=>{if(!(e.meta&&e.name!==`escape`)){if(e.ctrl){if(e.name===`a`)return`first`;if(e.name===`c`||e.name===`d`)return`abort`;if(e.name===`e`)return`last`;if(e.name===`g`)return`reset`}if(t){if(e.name===`j`)return`down`;if(e.name===`k`)return`up`}return e.name===`return`||e.name===`enter`?`submit`:e.name===`backspace`?`delete`:e.name===`delete`?`deleteForward`:e.name===`abort`?`abort`:e.name===`escape`?`exit`:e.name===`tab`?`next`:e.name===`pagedown`?`nextPage`:e.name===`pageup`?`prevPage`:e.name===`home`?`home`:e.name===`end`?`end`:e.name===`up`?`up`:e.name===`down`?`down`:e.name===`right`?`right`:e.name===`left`?`left`:!1}}}),H=o((exports,t)=>{t.exports=e=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))`].join(`|`),n=new RegExp(t,`g`);return typeof e==`string`?e.replace(n,``):e}}),U=o((exports,t)=>{let n=`\x1B`,r=`${n}[`,i=`\x07`,a={to(e,t){return t?`${r}${t+1};${e+1}H`:`${r}${e+1}G`},move(e,t){let n=``;return e<0?n+=`${r}${-e}D`:e>0&&(n+=`${r}${e}C`),t<0?n+=`${r}${-t}A`:t>0&&(n+=`${r}${t}B`),n},up:(e=1)=>`${r}${e}A`,down:(e=1)=>`${r}${e}B`,forward:(e=1)=>`${r}${e}C`,backward:(e=1)=>`${r}${e}D`,nextLine:(e=1)=>`${r}E`.repeat(e),prevLine:(e=1)=>`${r}F`.repeat(e),left:`${r}G`,hide:`${r}?25l`,show:`${r}?25h`,save:`${n}7`,restore:`${n}8`},o={up:(e=1)=>`${r}S`.repeat(e),down:(e=1)=>`${r}T`.repeat(e)},s={screen:`${r}2J`,up:(e=1)=>`${r}1J`.repeat(e),down:(e=1)=>`${r}J`.repeat(e),line:`${r}2K`,lineEnd:`${r}K`,lineStart:`${r}1K`,lines(e){let t=``;for(let n=0;n<e;n++)t+=this.line+(n<e-1?a.up():``);return e&&(t+=a.left),t}};t.exports={cursor:a,scroll:o,erase:s,beep:i}}),ge=o((exports,t)=>{function n(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
6
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,c;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,c=e},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(s)throw c}}}}function r(e,t){if(e){if(typeof e==`string`)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}}function i(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let a=H(),o=U(),s=o.erase,c=o.cursor,l=e=>[...a(e)].length;
7
+ /**
8
+ * @param {string} prompt
9
+ * @param {number} perLine
10
+ */
11
+ t.exports=function(e,t){if(!t)return s.line+c.to(0);let r=0,i=e.split(/\r?\n/);var a=n(i),o;try{for(a.s();!(o=a.n()).done;){let e=o.value;r+=1+Math.floor(Math.max(l(e)-1,0)/t)}}catch(e){a.e(e)}finally{a.f()}return s.lines(r)}}),W=o((exports,t)=>{let n={arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,radioOn:`◉`,radioOff:`◯`,tick:`✔`,cross:`✖`,ellipsis:`…`,pointerSmall:`›`,line:`─`,pointer:`❯`},r={arrowUp:n.arrowUp,arrowDown:n.arrowDown,arrowLeft:n.arrowLeft,arrowRight:n.arrowRight,radioOn:`(*)`,radioOff:`( )`,tick:`√`,cross:`×`,ellipsis:`...`,pointerSmall:`»`,line:`─`,pointer:`>`},i=process.platform===`win32`?r:n;t.exports=i}),_e=o((exports,t)=>{let n=V(),r=W(),i=Object.freeze({password:{scale:1,render:e=>`*`.repeat(e.length)},emoji:{scale:2,render:e=>`😃`.repeat(e.length)},invisible:{scale:0,render:e=>``},default:{scale:1,render:e=>`${e}`}}),a=e=>i[e]||i.default,o=Object.freeze({aborted:n.red(r.cross),done:n.green(r.tick),exited:n.yellow(r.cross),default:n.cyan(`?`)}),s=(e,t,n)=>t?o.aborted:n?o.exited:e?o.done:o.default,c=e=>n.gray(e?r.ellipsis:r.pointerSmall),l=(e,t)=>n.gray(e?t?r.pointerSmall:`+`:r.line);t.exports={styles:i,render:a,symbols:o,symbol:s,delimiter:c,item:l}}),ve=o((exports,t)=>{let n=H();
12
+ /**
13
+ * @param {string} msg
14
+ * @param {number} perLine
15
+ */
16
+ t.exports=function(e,t){let r=String(n(e)||``).split(/\r?\n/);return t?r.map(e=>Math.ceil(e.length/t)).reduce((e,t)=>e+t):r.length}}),ye=o((exports,t)=>{
17
+ /**
18
+ * @param {string} msg The message to wrap
19
+ * @param {object} opts
20
+ * @param {number|string} [opts.margin] Left margin
21
+ * @param {number} opts.width Maximum characters per line including the margin
22
+ */
23
+ t.exports=(e,t={})=>{let n=Number.isSafeInteger(parseInt(t.margin))?Array(parseInt(t.margin)).fill(` `).join(``):t.margin||``,r=t.width;return(e||``).split(/\r?\n/g).map(e=>e.split(/\s+/g).reduce((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1<r?e[e.length-1]+=` ${t}`:e.push(`${n}${t}`),e),[n]).join(`
3
24
  `)).join(`
4
- `)}});var ki=u((na,Ri)=>{"use strict";Ri.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 T=u((oa,ji)=>{"use strict";ji.exports={action:wi(),clear:qi(),style:_i(),strip:Oe(),figures:Ue(),lines:Ei(),wrap:Di(),entriesToDisplay:ki()}});var R=u((la,Vi)=>{"use strict";var Fi=require("readline"),Xo=T(),Qo=Xo.action,el=require("events"),Ni=g(),tl=Ni.beep,il=Ni.cursor,sl=p(),Je=class extends el{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=Fi.createInterface({input:this.in,escapeCodeTimeout:50});Fi.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(n,o)=>{let l=Qo(o,s);l===!1?this._&&this._(n,o):typeof this[l]=="function"?this[l](o):this.bell()};this.close=()=>{this.out.write(il.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(tl)}render(){this.onRender(sl),this.firstRender&&(this.firstRender=!1)}};Vi.exports=Je});var Gi=u((ha,Hi)=>{"use strict";function Yi(i,e,t,s,r,n,o){try{var l=i[n](o),h=l.value}catch(a){t(a);return}l.done?e(h):Promise.resolve(h).then(s,r)}function Li(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(h){Yi(n,s,r,o,l,"next",h)}function l(h){Yi(n,s,r,o,l,"throw",h)}o(void 0)})}}var Te=p(),rl=R(),Bi=g(),nl=Bi.erase,he=Bi.cursor,Ce=T(),ze=Ce.style,Ke=Ce.clear,ol=Ce.lines,ll=Ce.figures,Ze=class extends rl{constructor(e={}){super(e),this.transform=ze.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=+!!this.initial,this.cursorOffset=0,this.clear=Ke("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Te.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=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
5
- `),this.close()}validate(){var e=this;return Li(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Li(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(`
6
- `),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(he.down(ol(this.outputError,this.out.columns)-1)+Ke(this.outputError,this.out.columns)),this.out.write(Ke(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ze.symbol(this.done,this.aborted),Te.bold(this.msg),ze.delimiter(this.done),this.red?Te.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
7
- `).reduce((e,t,s)=>e+`
8
- ${s?" ":ll.pointerSmall} ${Te.red().italic(t)}`,"")),this.out.write(nl.line+he.to(0)+this.outputText+he.save+this.outputError+he.restore+he.move(this.cursorOffset,0)))}};Hi.exports=Ze});var zi=u((ua,Ji)=>{"use strict";var k=p(),hl=R(),ue=T(),Ui=ue.style,Wi=ue.clear,Me=ue.figures,ul=ue.wrap,al=ue.entriesToDisplay,cl=g(),dl=cl.cursor,Xe=class extends hl{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=Wi("",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(`
25
+ `)}}),be=o((exports,t)=>{
26
+ /**
27
+ * Determine what entries should be displayed on the screen, based on the
28
+ * currently selected index and the maximum visible. Used in list-based
29
+ * prompts like `select` and `multiselect`.
30
+ *
31
+ * @param {number} cursor the currently selected entry
32
+ * @param {number} total the total entries available to display
33
+ * @param {number} [maxVisible] the number of entries that can be displayed
34
+ */
35
+ t.exports=(e,t,n)=>{n||=t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let i=Math.min(r+n,t);return{startIndex:r,endIndex:i}}}),G=o((exports,t)=>{t.exports={action:he(),clear:ge(),style:_e(),strip:H(),figures:W(),lines:ve(),wrap:ye(),entriesToDisplay:be()}}),K=o((exports,t)=>{let n=require(`readline`),r=G(),i=r.action,a=require(`events`),o=U(),s=o.beep,c=o.cursor,l=V();
36
+ /**
37
+ * Base prompt skeleton
38
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
39
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
40
+ */
41
+ var u=class extends a{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>void 0)).bind(this);let t=n.createInterface({input:this.in,escapeCodeTimeout:50});n.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let r=[`SelectPrompt`,`MultiselectPrompt`].indexOf(this.constructor.name)>-1,a=(e,t)=>{let n=i(t,r);n===!1?this._&&this._(e,t):typeof this[n]==`function`?this[n](t):this.bell()};this.close=()=>{this.out.write(c.show),this.in.removeListener(`keypress`,a),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`,a)}fire(){this.emit(`state`,{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(s)}render(){this.onRender(l),this.firstRender&&=!1}};t.exports=u}),xe=o((exports,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=V(),a=K(),o=U(),s=o.erase,c=o.cursor,l=G(),u=l.style,d=l.clear,f=l.lines,p=l.figures;
42
+ /**
43
+ * TextPrompt Base Element
44
+ * @param {Object} opts Options
45
+ * @param {String} opts.message Message
46
+ * @param {String} [opts.style='default'] Render style
47
+ * @param {String} [opts.initial] Default value
48
+ * @param {Function} [opts.validate] Validate function
49
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
50
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
51
+ * @param {String} [opts.error] The invalid error label
52
+ */
53
+ var m=class extends a{constructor(e={}){super(e),this.transform=u.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=d(``,this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=i.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(`
54
+ `),this.close()}validate(){var e=this;return r(function*(){let t=yield e.validator(e.value);typeof t==`string`&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return r(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(`
55
+ `),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+=e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${n}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:n.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(c.down(f(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns)),this.out.write(d(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[u.symbol(this.done,this.aborted),i.bold(this.msg),u.delimiter(this.done),this.red?i.red(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
56
+ `).reduce((e,t,n)=>e+`\n${n?` `:p.pointerSmall} ${i.red().italic(t)}`,``)),this.out.write(s.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore+c.move(this.cursorOffset,0)))}};t.exports=m}),Se=o((exports,t)=>{let n=V(),r=K(),i=G(),a=i.style,o=i.clear,s=i.figures,c=i.wrap,l=i.entriesToDisplay,u=U(),d=u.cursor;
57
+ /**
58
+ * SelectPrompt Base Element
59
+ * @param {Object} opts Options
60
+ * @param {String} opts.message Message
61
+ * @param {Array} opts.choices Array of choice objects
62
+ * @param {String} [opts.hint] Hint to display
63
+ * @param {Number} [opts.initial] Index of default value
64
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
65
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
66
+ * @param {Number} [opts.optionsPerPage=10] Max options to display at once
67
+ */
68
+ var f=class extends r{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((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=o(``,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(`
9
69
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
10
- `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(dl.hide):this.out.write(Wi(this.outputText,this.out.columns)),super.render();let e=al(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,s=e.endIndex;if(this.outputText=[Ui.symbol(this.done,this.aborted),k.bold(this.msg),Ui.delimiter(!1),this.done?this.selection.title:this.selection.disabled?k.yellow(this.warn):k.gray(this.hint)].join(" "),!this.done){this.outputText+=`
11
- `;for(let r=t;r<s;r++){let n,o,l="",h=this.choices[r];r===t&&t>0?o=Me.arrowUp:r===s-1&&s<this.choices.length?o=Me.arrowDown:o=" ",h.disabled?(n=this.cursor===r?k.gray().underline(h.title):k.strikethrough().gray(h.title),o=(this.cursor===r?k.bold().gray(Me.pointer)+" ":" ")+o):(n=this.cursor===r?k.cyan().underline(h.title):h.title,o=(this.cursor===r?k.cyan(Me.pointer)+" ":" ")+o,h.description&&this.cursor===r&&(l=` - ${h.description}`,(o.length+n.length+l.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(l=`
12
- `+ul(h.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${k.gray(l)}
13
- `}}this.out.write(this.outputText)}};Ji.exports=Xe});var ts=u((aa,es)=>{"use strict";var qe=p(),fl=R(),Xi=T(),Ki=Xi.style,pl=Xi.clear,Qi=g(),Zi=Qi.cursor,ml=Qi.erase,Qe=class extends fl{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(`
70
+ `),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(d.hide):this.out.write(o(this.outputText,this.out.columns)),super.render();let e=l(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,r=e.endIndex;if(this.outputText=[a.symbol(this.done,this.aborted),n.bold(this.msg),a.delimiter(!1),this.done?this.selection.title:this.selection.disabled?n.yellow(this.warn):n.gray(this.hint)].join(` `),!this.done){this.outputText+=`
71
+ `;for(let e=t;e<r;e++){let i,a,o=``,l=this.choices[e];a=e===t&&t>0?s.arrowUp:e===r-1&&r<this.choices.length?s.arrowDown:` `,l.disabled?(i=this.cursor===e?n.gray().underline(l.title):n.strikethrough().gray(l.title),a=(this.cursor===e?n.bold().gray(s.pointer)+` `:` `)+a):(i=this.cursor===e?n.cyan().underline(l.title):l.title,a=(this.cursor===e?n.cyan(s.pointer)+` `:` `)+a,l.description&&this.cursor===e&&(o=` - ${l.description}`,(a.length+i.length+o.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(o=`
72
+ `+c(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${a} ${i}${n.gray(o)}\n`}}this.out.write(this.outputText)}};t.exports=f}),Ce=o((exports,t)=>{let n=V(),r=K(),i=G(),a=i.style,o=i.clear,s=U(),c=s.cursor,l=s.erase;
73
+ /**
74
+ * TogglePrompt Base Element
75
+ * @param {Object} opts Options
76
+ * @param {String} opts.message Message
77
+ * @param {Boolean} [opts.initial=false] Default value
78
+ * @param {String} [opts.active='no'] Active label
79
+ * @param {String} [opts.inactive='off'] Inactive label
80
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
81
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
82
+ */
83
+ var u=class extends r{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(`
14
84
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
15
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(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(Zi.hide):this.out.write(pl(this.outputText,this.out.columns)),super.render(),this.outputText=[Ki.symbol(this.done,this.aborted),qe.bold(this.msg),Ki.delimiter(this.done),this.value?this.inactive:qe.cyan().underline(this.inactive),qe.gray("/"),this.value?qe.cyan().underline(this.active):this.active].join(" "),this.out.write(ml.line+Zi.to(0)+this.outputText))}};es.exports=Qe});var q=u((ca,is)=>{"use strict";var et=class i{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 i)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,r)=>r>t&&s instanceof i)}toString(){return String(this.date)}};is.exports=et});var rs=u((da,ss)=>{"use strict";var gl=q(),tt=class extends gl{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}};ss.exports=tt});var os=u((fa,ns)=>{"use strict";var bl=q(),vl=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),it=class extends bl{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+vl(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};ns.exports=it});var hs=u((pa,ls)=>{"use strict";var yl=q(),st=class extends yl{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}};ls.exports=st});var as=u((ma,us)=>{"use strict";var wl=q(),rt=class extends wl{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)}};us.exports=rt});var ds=u((ga,cs)=>{"use strict";var xl=q(),nt=class extends xl{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}};cs.exports=nt});var ps=u((ba,fs)=>{"use strict";var Sl=q(),ot=class extends Sl{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)}};fs.exports=ot});var gs=u((va,ms)=>{"use strict";var Ol=q(),lt=class extends Ol{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}};ms.exports=lt});var vs=u((ya,bs)=>{"use strict";var Tl=q(),ht=class extends Tl{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}};bs.exports=ht});var ws=u((wa,ys)=>{"use strict";ys.exports={DatePart:q(),Meridiem:rs(),Day:os(),Hours:hs(),Milliseconds:as(),Minutes:ds(),Month:ps(),Seconds:gs(),Year:vs()}});var _s=u((xa,Is)=>{"use strict";function xs(i,e,t,s,r,n,o){try{var l=i[n](o),h=l.value}catch(a){t(a);return}l.done?e(h):Promise.resolve(h).then(s,r)}function Ss(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(h){xs(n,s,r,o,l,"next",h)}function l(h){xs(n,s,r,o,l,"throw",h)}o(void 0)})}}var ut=p(),Cl=R(),ct=T(),Os=ct.style,Ts=ct.clear,Ml=ct.figures,$s=g(),ql=$s.erase,Cs=$s.cursor,j=ws(),Ms=j.DatePart,$l=j.Meridiem,Il=j.Day,_l=j.Hours,Pl=j.Milliseconds,El=j.Minutes,Al=j.Month,Dl=j.Seconds,Rl=j.Year,kl=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,qs={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new Il(i),3:i=>new Al(i),4:i=>new Rl(i),5:i=>new $l(i),6:i=>new _l(i),7:i=>new El(i),8:i=>new Dl(i),9:i=>new Pl(i)},jl={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(",")},at=class extends Cl{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(jl,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=Ts("",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=kl.exec(e);){let r=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in qs?qs[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 Ms)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
16
- `),this.close()}validate(){var e=this;return Ss(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Ss(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(`
17
- `),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 Ms)),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(Cs.hide):this.out.write(Ts(this.outputText,this.out.columns)),super.render(),this.outputText=[Os.symbol(this.done,this.aborted),ut.bold(this.msg),Os.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?ut.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
18
- `).reduce((e,t,s)=>e+`
19
- ${s?" ":Ml.pointerSmall} ${ut.red().italic(t)}`,"")),this.out.write(ql.line+Cs.to(0)+this.outputText))}};Is.exports=at});var js=u((Sa,ks)=>{"use strict";function Ps(i,e,t,s,r,n,o){try{var l=i[n](o),h=l.value}catch(a){t(a);return}l.done?e(h):Promise.resolve(h).then(s,r)}function Es(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(h){Ps(n,s,r,o,l,"next",h)}function l(h){Ps(n,s,r,o,l,"throw",h)}o(void 0)})}}var $e=p(),Fl=R(),Rs=g(),Ie=Rs.cursor,Nl=Rs.erase,_e=T(),dt=_e.style,Vl=_e.figures,As=_e.clear,Yl=_e.lines,Ll=/[0-9]/,ft=i=>i!==void 0,Ds=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},pt=class extends Fl{constructor(e={}){super(e),this.transform=dt.render(e.style),this.msg=e.message,this.initial=ft(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=ft(e.min)?e.min:-1/0,this.max=ft(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(`${Ds(e,this.round)}`),this._value=Ds(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||Ll.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(`
20
- `),this.close()}validate(){var e=this;return Es(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Es(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(`
21
- `),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(Ie.down(Yl(this.outputError,this.out.columns)-1)+As(this.outputError,this.out.columns)),this.out.write(As(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[dt.symbol(this.done,this.aborted),$e.bold(this.msg),dt.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(`
22
- `).reduce((e,t,s)=>e+`
23
- ${s?" ":Vl.pointerSmall} ${$e.red().italic(t)}`,"")),this.out.write(Nl.line+Ie.to(0)+this.outputText+Ie.save+this.outputError+Ie.restore))}};ks.exports=pt});var gt=u((Oa,Vs)=>{"use strict";var $=p(),Bl=g(),Hl=Bl.cursor,Gl=R(),ae=T(),Fs=ae.clear,H=ae.figures,Ns=ae.style,Ul=ae.wrap,Wl=ae.entriesToDisplay,mt=class extends Gl{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=Fs("",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(`
24
- `),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(`
25
- `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(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:`
85
+ `),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(c.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),n.bold(this.msg),a.delimiter(this.done),this.value?this.inactive:n.cyan().underline(this.inactive),n.gray(`/`),this.value?n.cyan().underline(this.active):this.active].join(` `),this.out.write(l.line+c.to(0)+this.outputText))}};t.exports=u}),q=o((exports,t)=>{var n=class e{constructor({token:e,date:t,parts:n,locales:r}){this.token=e,this.date=t||new Date,this.parts=n||[this],this.locales=r||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((n,r)=>r>t&&n instanceof e)}setTo(e){}prev(){let t=[].concat(this.parts).reverse(),n=t.indexOf(this);return t.find((t,r)=>r>n&&t instanceof e)}toString(){return String(this.date)}};t.exports=n}),we=o((exports,t)=>{let n=q();var r=class extends n{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}};t.exports=r}),Te=o((exports,t)=>{let n=q(),r=e=>(e%=10,e===1?`st`:e===2?`nd`:e===3?`rd`:`th`);var i=class extends n{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+r(e):this.token===`d`?t+1:this.token===`ddd`?this.locales.weekdaysShort[t]:this.token===`dddd`?this.locales.weekdays[t]:e}};t.exports=i}),Ee=o((exports,t)=>{let n=q();var r=class extends n{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}};t.exports=r}),De=o((exports,t)=>{let n=q();var r=class extends n{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)}};t.exports=r}),Oe=o((exports,t)=>{let n=q();var r=class extends n{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}};t.exports=r}),ke=o((exports,t)=>{let n=q();var r=class extends n{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)}};t.exports=r}),Ae=o((exports,t)=>{let n=q();var r=class extends n{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}};t.exports=r}),je=o((exports,t)=>{let n=q();var r=class extends n{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}};t.exports=r}),Me=o((exports,t)=>{t.exports={DatePart:q(),Meridiem:we(),Day:Te(),Hours:Ee(),Milliseconds:De(),Minutes:Oe(),Month:ke(),Seconds:Ae(),Year:je()}}),Ne=o((exports,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=V(),a=K(),o=G(),s=o.style,c=o.clear,l=o.figures,u=U(),d=u.erase,f=u.cursor,p=Me(),m=p.DatePart,h=p.Meridiem,g=p.Day,_=p.Hours,v=p.Milliseconds,y=p.Minutes,b=p.Month,x=p.Seconds,S=p.Year,C=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,w={1:({token:e})=>e.replace(/\\(.)/g,`$1`),2:e=>new g(e),3:e=>new b(e),4:e=>new S(e),5:e=>new h(e),6:e=>new _(e),7:e=>new y(e),8:e=>new x(e),9:e=>new v(e)},T={months:`January,February,March,April,May,June,July,August,September,October,November,December`.split(`,`),monthsShort:`Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec`.split(`,`),weekdays:`Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday`.split(`,`),weekdaysShort:`Sun,Mon,Tue,Wed,Thu,Fri,Sat`.split(`,`)};
86
+ /**
87
+ * DatePrompt Base Element
88
+ * @param {Object} opts Options
89
+ * @param {String} opts.message Message
90
+ * @param {Number} [opts.initial] Index of default value
91
+ * @param {String} [opts.mask] The format mask
92
+ * @param {object} [opts.locales] The date locales
93
+ * @param {String} [opts.error] The error message shown on invalid value
94
+ * @param {Function} [opts.validate] Function to validate the submitted value
95
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
96
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
97
+ */
98
+ var E=class extends a{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed=``,this.locales=Object.assign(T,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=c(``,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=C.exec(e);){let e=t.shift(),n=t.findIndex(e=>e!=null);this.parts.push(n in w?w[n]({token:t[n]||e,date:this.date,parts:this.parts,locales:this.locales}):t[n]||e)}let n=this.parts.reduce((e,t)=>(typeof t==`string`&&typeof e[e.length-1]==`string`?e[e.length-1]+=t:e.push(t),e),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed=``,this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof m)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
99
+ `),this.close()}validate(){var e=this;return r(function*(){let t=yield e.validator(e.value);typeof t==`string`&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return r(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(`
100
+ `),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(e=>e instanceof m)),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(f.hide):this.out.write(c(this.outputText,this.out.columns)),super.render(),this.outputText=[s.symbol(this.done,this.aborted),i.bold(this.msg),s.delimiter(!1),this.parts.reduce((e,t,n)=>e.concat(n===this.cursor&&!this.done?i.cyan().underline(t.toString()):t),[]).join(``)].join(` `),this.error&&(this.outputText+=this.errorMsg.split(`
101
+ `).reduce((e,t,n)=>e+`\n${n?` `:l.pointerSmall} ${i.red().italic(t)}`,``)),this.out.write(d.line+f.to(0)+this.outputText))}};t.exports=E}),Pe=o((exports,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=V(),a=K(),o=U(),s=o.cursor,c=o.erase,l=G(),u=l.style,d=l.figures,f=l.clear,p=l.lines,m=/[0-9]/,h=e=>e!==void 0,g=(e,t)=>{let n=10**t;return Math.round(e*n)/n};
102
+ /**
103
+ * NumberPrompt Base Element
104
+ * @param {Object} opts Options
105
+ * @param {String} opts.message Message
106
+ * @param {String} [opts.style='default'] Render style
107
+ * @param {Number} [opts.initial] Default value
108
+ * @param {Number} [opts.max=+Infinity] Max value
109
+ * @param {Number} [opts.min=-Infinity] Min value
110
+ * @param {Boolean} [opts.float=false] Parse input as floats
111
+ * @param {Number} [opts.round=2] Round floats to x decimals
112
+ * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys
113
+ * @param {Function} [opts.validate] Validate function
114
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
115
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
116
+ * @param {String} [opts.error] The invalid error label
117
+ */
118
+ var _=class extends a{constructor(e={}){super(e),this.transform=u.render(e.style),this.msg=e.message,this.initial=h(e.initial)?e.initial:``,this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=h(e.min)?e.min:-1/0,this.max=h(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=i.gray(this.transform.render(`${this.initial}`)),this._value=``):(this.placeholder=!1,this.rendered=this.transform.render(`${g(e,this.round)}`),this._value=g(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||m.test(e)}reset(){this.typed=``,this.value=``,this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e===``?this.initial:e,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
119
+ `),this.close()}validate(){var e=this;return r(function*(){let t=yield e.validator(e.value);typeof t==`string`&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return r(function*(){if(yield e.validate(),e.error){e.color=`red`,e.fire(),e.render();return}let t=e.value;e.value=t===``?e.initial:t,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
120
+ `),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 n=Date.now();if(n-this.lastHit>1e3&&(this.typed=``),this.typed+=e,this.lastHit=n,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(s.down(p(this.outputError,this.out.columns)-1)+f(this.outputError,this.out.columns)),this.out.write(f(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[u.symbol(this.done,this.aborted),i.bold(this.msg),u.delimiter(this.done),!this.done||!this.done&&!this.placeholder?i[this.color]().underline(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
121
+ `).reduce((e,t,n)=>e+`\n${n?` `:d.pointerSmall} ${i.red().italic(t)}`,``)),this.out.write(c.line+s.to(0)+this.outputText+s.save+this.outputError+s.restore))}};t.exports=_}),J=o((exports,t)=>{let n=V(),r=U(),i=r.cursor,a=K(),o=G(),s=o.clear,c=o.figures,l=o.style,u=o.wrap,d=o.entriesToDisplay;
122
+ /**
123
+ * MultiselectPrompt Base Element
124
+ * @param {Object} opts Options
125
+ * @param {String} opts.message Message
126
+ * @param {Array} opts.choices Array of choice objects
127
+ * @param {String} [opts.hint] Hint to display
128
+ * @param {String} [opts.warn] Hint shown for disabled choices
129
+ * @param {Number} [opts.max] Max choices
130
+ * @param {Number} [opts.cursor=0] Cursor start position
131
+ * @param {Number} [opts.optionsPerPage=10] Max options to display at once
132
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
133
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
134
+ */
135
+ var f=class extends a{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((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=s(``,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(`
136
+ `),this.close()}submit(){let e=this.value.filter(e=>e.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(`
137
+ `),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(e=>e.selected).length>=this.maxChoices)return this.bell();else 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(e=>!e.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:`
26
138
  Instructions:
27
- ${H.arrowUp}/${H.arrowDown}: Highlight option
28
- ${H.arrowLeft}/${H.arrowRight}/[space]: Toggle selection
29
- `+(this.maxChoices===void 0?` a: Toggle all
30
- `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,r){let n=(t.selected?$.green(H.radioOn):H.radioOff)+" "+r+" ",o,l;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&&(l=` - ${t.description}`,(n.length+o.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(l=`
31
- `+Ul(t.description,{margin:n.length,width:this.out.columns})))),n+o+$.gray(l||"")}paginateOptions(e){if(e.length===0)return $.red("No matches for this query.");let t=Wl(this.cursor,e.length,this.optionsPerPage),s=t.startIndex,r=t.endIndex,n,o=[];for(let l=s;l<r;l++)l===s&&s>0?n=H.arrowUp:l===r-1&&r<e.length?n=H.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[l],l,n));return`
139
+ ${c.arrowUp}/${c.arrowDown}: Highlight option\n ${c.arrowLeft}/${c.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===void 0?` a: Toggle all
140
+ `:``)+` enter/return: Complete answer`:``}renderOption(e,t,r,i){let a=(t.selected?n.green(c.radioOn):c.radioOff)+` `+i+` `,o,s;return t.disabled?o=e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):(o=e===r?n.cyan().underline(t.title):t.title,e===r&&t.description&&(s=` - ${t.description}`,(a.length+o.length+s.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(s=`
141
+ `+u(t.description,{margin:a.length,width:this.out.columns})))),a+o+n.gray(s||``)}paginateOptions(e){if(e.length===0)return n.red(`No matches for this query.`);let t=d(this.cursor,e.length,this.optionsPerPage),r=t.startIndex,i=t.endIndex,a,o=[];for(let t=r;t<i;t++)a=t===r&&r>0?c.arrowUp:t===i-1&&i<e.length?c.arrowDown:` `,o.push(this.renderOption(this.cursor,e[t],t,a));return`
32
142
  `+o.join(`
33
- `)}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(Hl.hide),super.render();let e=[Ns.symbol(this.done,this.aborted),$.bold(this.msg),Ns.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=Fs(e,this.out.columns)}};Vs.exports=mt});var Ws=u((Ta,Us)=>{"use strict";function Ys(i,e,t,s,r,n,o){try{var l=i[n](o),h=l.value}catch(a){t(a);return}l.done?e(h):Promise.resolve(h).then(s,r)}function Jl(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(h){Ys(n,s,r,o,l,"next",h)}function l(h){Ys(n,s,r,o,l,"throw",h)}o(void 0)})}}var ce=p(),zl=R(),Gs=g(),Kl=Gs.erase,Ls=Gs.cursor,de=T(),bt=de.style,Bs=de.clear,vt=de.figures,Zl=de.wrap,Xl=de.entriesToDisplay,Hs=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),Ql=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),eh=(i,e)=>{let t=i.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},yt=class extends zl{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:eh(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=bt.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Bs("",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=Hs(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return Jl(function*(){let s=t.completing=t.suggest(t.input,t.choices),r=yield s;if(t.completing!==s)return;t.suggestions=r.map((o,l,h)=>({title:Ql(h,l),value:Hs(h,l),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(`
143
+ `)}renderOptions(e){return this.done?``:this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(i.hide),super.render();let e=[l.symbol(this.done,this.aborted),n.bold(this.msg),l.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&(e+=n.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=s(e,this.out.columns)}};t.exports=f}),Fe=o((exports,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=V(),a=K(),o=U(),s=o.erase,c=o.cursor,l=G(),u=l.style,d=l.clear,f=l.figures,p=l.wrap,m=l.entriesToDisplay,h=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),g=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),_=(e,t)=>{let n=e.findIndex(e=>e.value===t||e.title===t);return n>-1?n:void 0};
144
+ /**
145
+ * TextPrompt Base Element
146
+ * @param {Object} opts Options
147
+ * @param {String} opts.message Message
148
+ * @param {Array} opts.choices Array of auto-complete choices objects
149
+ * @param {Function} [opts.suggest] Filter function. Defaults to sort by title
150
+ * @param {Number} [opts.limit=10] Max number of results to show
151
+ * @param {Number} [opts.cursor=0] Cursor start position
152
+ * @param {String} [opts.style='default'] Render style
153
+ * @param {String} [opts.fallback] Fallback message - initial to default value
154
+ * @param {String} [opts.initial] Index of the default value
155
+ * @param {Boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input
156
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
157
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
158
+ * @param {String} [opts.noMatches] The no matches found label
159
+ */
160
+ var v=class extends a{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial==`number`?e.initial:_(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=u.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=d(``,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=h(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return r(function*(){let n=t.completing=t.suggest(t.input,t.choices),r=yield n;if(t.completing!==n)return;t.suggestions=r.map((e,t,n)=>({title:g(n,t),value:h(n,t),description:e.description})),t.completing=!1;let i=Math.max(r.length-1,0);t.moveSelect(Math.min(i,t.select)),e&&e()})()}reset(){this.input=``,this.complete(()=>{this.moveSelect(this.initial===void 0?0:this.initial),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
34
161
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
35
162
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
36
- `),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?vt.arrowUp:r?vt.arrowDown:" ",l=t?ce.cyan().underline(e.title):e.title;return o=(t?ce.cyan(vt.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+l.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
37
- `+Zl(e.description,{margin:3,width:this.out.columns}))),o+" "+l+ce.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Ls.hide):this.out.write(Bs(this.outputText,this.out.columns)),super.render();let e=Xl(this.select,this.choices.length,this.limit),t=e.startIndex,s=e.endIndex;if(this.outputText=[bt.symbol(this.done,this.aborted,this.exited),ce.bold(this.msg),bt.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(`
163
+ `),this.close()}_(e,t){let n=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${n}${e}${r}`,this.cursor=n.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.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.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor+=1,this.render()}renderOption(e,t,n,r){let a,o=n?f.arrowUp:r?f.arrowDown:` `,s=t?i.cyan().underline(e.title):e.title;return o=(t?i.cyan(f.pointer)+` `:` `)+o,e.description&&(a=` - ${e.description}`,(o.length+s.length+a.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(a=`
164
+ `+p(e.description,{margin:3,width:this.out.columns}))),o+` `+s+i.gray(a||``)}render(){if(this.closed)return;this.firstRender?this.out.write(c.hide):this.out.write(d(this.outputText,this.out.columns)),super.render();let e=m(this.select,this.choices.length,this.limit),t=e.startIndex,n=e.endIndex;if(this.outputText=[u.symbol(this.done,this.aborted,this.exited),i.bold(this.msg),u.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 e=this.suggestions.slice(t,n).map((e,r)=>this.renderOption(e,this.select===r+t,r===0&&t>0,r+t===n-1&&n<this.choices.length)).join(`
38
165
  `);this.outputText+=`
39
- `+(r||ce.gray(this.fallback.title))}this.out.write(Kl.line+Ls.to(0)+this.outputText)}};Us.exports=yt});var Zs=u((Ca,Ks)=>{"use strict";var F=p(),th=g(),ih=th.cursor,sh=gt(),xt=T(),Js=xt.clear,zs=xt.style,ee=xt.figures,wt=class extends sh{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=Js("",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:`
166
+ `+(e||i.gray(this.fallback.title))}this.out.write(s.line+c.to(0)+this.outputText)}};t.exports=v}),Ie=o((exports,t)=>{let n=V(),r=U(),i=r.cursor,a=J(),o=G(),s=o.clear,c=o.style,l=o.figures;
167
+ /**
168
+ * MultiselectPrompt Base Element
169
+ * @param {Object} opts Options
170
+ * @param {String} opts.message Message
171
+ * @param {Array} opts.choices Array of choice objects
172
+ * @param {String} [opts.hint] Hint to display
173
+ * @param {String} [opts.warn] Hint shown for disabled choices
174
+ * @param {Number} [opts.max] Max choices
175
+ * @param {Number} [opts.cursor=0] Cursor start position
176
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
177
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
178
+ */
179
+ var u=class extends a{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue=``,this.clear=s(``,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(e=>this.inputValue?!!(typeof e.title==`string`&&e.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof e.value==`string`&&e.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(t=>t===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(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}handleInputChange(e){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:`
40
180
  Instructions:
41
- ${ee.arrowUp}/${ee.arrowDown}: Highlight option
42
- ${ee.arrowLeft}/${ee.arrowRight}/[space]: Toggle selection
181
+ ${l.arrowUp}/${l.arrowDown}: Highlight option
182
+ ${l.arrowLeft}/${l.arrowRight}/[space]: Toggle selection
43
183
  [a,b,c]/delete: Filter choices
44
184
  enter/return: Complete answer
45
- `:""}renderCurrentInput(){return`
46
- Filtered results for: ${this.inputValue?this.inputValue:F.gray("Enter something to filter")}
47
- `}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(ee.radioOn):ee.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(ih.hide),super.render();let e=[zs.symbol(this.done,this.aborted),F.bold(this.msg),zs.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=Js(e,this.out.columns)}};Ks.exports=wt});var rr=u((Ma,sr)=>{"use strict";var Xs=p(),rh=R(),tr=T(),Qs=tr.style,nh=tr.clear,ir=g(),oh=ir.erase,er=ir.cursor,St=class extends rh{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(`
185
+ `:``}renderCurrentInput(){return`
186
+ Filtered results for: ${this.inputValue?this.inputValue:n.gray(`Enter something to filter`)}\n`}renderOption(e,t,r){let i;return i=t.disabled?e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):e===r?n.cyan().underline(t.title):t.title,(t.selected?n.green(l.radioOn):l.radioOff)+` `+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(i.hide),super.render();let e=[c.symbol(this.done,this.aborted),n.bold(this.msg),c.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&(e+=n.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=s(e,this.out.columns)}};t.exports=u}),Le=o((exports,t)=>{let n=V(),r=K(),i=G(),a=i.style,o=i.clear,s=U(),c=s.erase,l=s.cursor;
187
+ /**
188
+ * ConfirmPrompt Base Element
189
+ * @param {Object} opts Options
190
+ * @param {String} opts.message Message
191
+ * @param {Boolean} [opts.initial] Default value (true/false)
192
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
193
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
194
+ * @param {String} [opts.yes] The "Yes" label
195
+ * @param {String} [opts.yesOption] The "Yes" option when choosing between yes/no
196
+ * @param {String} [opts.no] The "No" label
197
+ * @param {String} [opts.noOption] The "No" option when choosing between yes/no
198
+ */
199
+ var u=class extends r{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(`
48
200
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
49
- `),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(er.hide):this.out.write(nh(this.outputText,this.out.columns)),super.render(),this.outputText=[Qs.symbol(this.done,this.aborted),Xs.bold(this.msg),Qs.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Xs.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(oh.line+er.to(0)+this.outputText))}};sr.exports=St});var or=u((qa,nr)=>{"use strict";nr.exports={TextPrompt:Gi(),SelectPrompt:zi(),TogglePrompt:ts(),DatePrompt:_s(),NumberPrompt:js(),MultiselectPrompt:gt(),AutocompletePrompt:Ws(),AutocompleteMultiselectPrompt:Zs(),ConfirmPrompt:rr()}});var hr=u(lr=>{"use strict";var y=lr,lh=or(),Pe=i=>i;function I(i,e,t={}){return new Promise((s,r)=>{let n=new lh[i](e),o=t.onAbort||Pe,l=t.onSubmit||Pe,h=t.onExit||Pe;n.on("state",e.onState||Pe),n.on("submit",a=>s(l(a))),n.on("exit",a=>s(h(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 hh=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));y.autocomplete=i=>(i.suggest=i.suggest||hh,i.choices=[].concat(i.choices||[]),I("AutocompletePrompt",i))});var gr=u((Ia,mr)=>{"use strict";function ur(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 ar(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ur(Object(t),!0).forEach(function(s){uh(i,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):ur(Object(t)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(t,s))})}return i}function uh(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ah(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.
50
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,l;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return n=a.done,a},e:function(a){o=!0,l=a},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw l}}}}function ch(i,e){if(i){if(typeof i=="string")return cr(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 cr(i,e)}}function cr(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 dr(i,e,t,s,r,n,o){try{var l=i[n](o),h=l.value}catch(a){t(a);return}l.done?e(h):Promise.resolve(h).then(s,r)}function fr(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(h){dr(n,s,r,o,l,"next",h)}function l(h){dr(n,s,r,o,l,"throw",h)}o(void 0)})}}var Ot=hr(),dh=["suggest","format","onState","validate","onRender","type"],pr=()=>{};function G(){return Tt.apply(this,arguments)}function Tt(){return Tt=fr(function*(i=[],{onSubmit:e=pr,onCancel:t=pr}={}){let s={},r=G._override||{};i=[].concat(i);let n,o,l,h,a,K,se=function(){var L=fr(function*(A,ye,ri=!1){if(!(!ri&&A.validate&&A.validate(ye)!==!0))return A.format?yield A.format(ye,s):ye});return function(ye,ri){return L.apply(this,arguments)}}();var v=ah(i),M;try{for(v.s();!(M=v.n()).done;){o=M.value;var ve=o;if(h=ve.name,a=ve.type,typeof a=="function"&&(a=yield a(n,ar({},s),o),o.type=a),!!a){for(let L in o){if(dh.includes(L))continue;let A=o[L];o[L]=typeof A=="function"?yield A(n,ar({},s),K):A}if(K=o,typeof o.message!="string")throw new Error("prompt message is required");var si=o;if(h=si.name,a=si.type,Ot[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[o.name]!==void 0&&(n=yield se(o,r[o.name]),n!==void 0)){s[h]=n;continue}try{n=G._injected?fh(G._injected,o.initial):yield Ot[a](o),s[h]=n=yield se(o,n,!0),l=yield e(o,n,s)}catch{l=!(yield t(o,s))}if(l)return s}}}catch(L){v.e(L)}finally{v.f()}return s}),Tt.apply(this,arguments)}function fh(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function ph(i){G._injected=(G._injected||[]).concat(i)}function mh(i){G._override=Object.assign({},i)}mr.exports=Object.assign(G,{prompt:G,prompts:Ot,inject:ph,override:mh})});var vr=u((_a,br)=>{"use strict";br.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 Ee=u((Pa,yr)=>{"use strict";yr.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 Sr=u((Ea,xr)=>{"use strict";var gh=Ee(),{erase:wr,cursor:bh}=g(),vh=i=>[...gh(i)].length;xr.exports=function(i,e){if(!e)return wr.line+bh.to(0);let t=0,s=i.split(/\r?\n/);for(let r of s)t+=1+Math.floor(Math.max(vh(r)-1,0)/e);return wr.lines(t)}});var Ct=u((Aa,Or)=>{"use strict";var fe={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:fe.arrowUp,arrowDown:fe.arrowDown,arrowLeft:fe.arrowLeft,arrowRight:fe.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},wh=process.platform==="win32"?yh:fe;Or.exports=wh});var Cr=u((Da,Tr)=>{"use strict";var te=p(),z=Ct(),Mt=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}`}}),xh=i=>Mt[i]||Mt.default,pe=Object.freeze({aborted:te.red(z.cross),done:te.green(z.tick),exited:te.yellow(z.cross),default:te.cyan("?")}),Sh=(i,e,t)=>e?pe.aborted:t?pe.exited:i?pe.done:pe.default,Oh=i=>te.gray(i?z.ellipsis:z.pointerSmall),Th=(i,e)=>te.gray(i?e?z.pointerSmall:"+":z.line);Tr.exports={styles:Mt,render:xh,symbols:pe,symbol:Sh,delimiter:Oh,item:Th}});var qr=u((Ra,Mr)=>{"use strict";var Ch=Ee();Mr.exports=function(i,e){let t=String(Ch(i)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,r)=>s+r):t.length}});var Ir=u((ka,$r)=>{"use strict";$r.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(`
201
+ `),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(l.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),n.bold(this.msg),a.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:n.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(c.line+l.to(0)+this.outputText))}};t.exports=u}),Re=o((exports,t)=>{t.exports={TextPrompt:xe(),SelectPrompt:Se(),TogglePrompt:Ce(),DatePrompt:Ne(),NumberPrompt:Pe(),MultiselectPrompt:J(),AutocompletePrompt:Fe(),AutocompleteMultiselectPrompt:Ie(),ConfirmPrompt:Le()}}),ze=o(exports=>{let t=exports,n=Re(),r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};let a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));
202
+ /**
203
+ * Interactive auto-complete prompt
204
+ * @param {string} args.message Prompt message to display
205
+ * @param {Array} args.choices Array of auto-complete choices objects `[{ title, value }, ...]`
206
+ * @param {Function} [args.suggest] Function to filter results based on user input. Defaults to sort by `title`
207
+ * @param {number} [args.limit=10] Max number of results to show
208
+ * @param {string} [args.style="default"] Render style ('default', 'password', 'invisible')
209
+ * @param {String} [args.initial] Index of the default value
210
+ * @param {boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input
211
+ * @param {String} [args.fallback] Fallback message - defaults to initial value
212
+ * @param {function} [args.onState] On state change callback
213
+ * @param {Stream} [args.stdin] The Readable stream to listen to
214
+ * @param {Stream} [args.stdout] The Writable stream to write readline data to
215
+ * @returns {Promise} Promise with user input
216
+ */
217
+ t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))}),Be=o((exports,t)=>{function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t];t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=o(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
218
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,c;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,c=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(s)throw c}}}}function o(e,t){if(e){if(typeof e==`string`)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}}function s(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function l(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){c(a,r,i,o,s,`next`,e)}function s(e){c(a,r,i,o,s,`throw`,e)}o(void 0)})}}let u=ze(),d=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],f=()=>{};
219
+ /**
220
+ * Prompt for a series of questions
221
+ * @param {Array|Object} questions Single question object or Array of question objects
222
+ * @param {Function} [onSubmit] Callback function called on prompt submit
223
+ * @param {Function} [onCancel] Callback function called on cancel/abort
224
+ * @returns {Object} Object with values from user input
225
+ */
226
+ function p(){return m.apply(this,arguments)}function m(){return m=l(function*(e=[],{onSubmit:t=f,onCancel:n=f}={}){let i={},o=p._override||{};e=[].concat(e);let s,c,m,g,_,v,y=/* @__PURE__ */ function(){var e=l(function*(e,t,n=!1){if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?yield e.format(t,i):t});return function(t,n){return e.apply(this,arguments)}}();var b=a(e),x;try{for(b.s();!(x=b.n()).done;){c=x.value;var S=c;if(g=S.name,_=S.type,typeof _==`function`&&(_=yield _(s,r({},i),c),c.type=_),_){for(let e in c){if(d.includes(e))continue;let t=c[e];c[e]=typeof t==`function`?yield t(s,r({},i),v):t}if(v=c,typeof c.message!=`string`)throw Error(`prompt message is required`);var C=c;if(g=C.name,_=C.type,u[_]===void 0)throw Error(`prompt type (${_}) is not defined`);if(o[c.name]!==void 0&&(s=yield y(c,o[c.name]),s!==void 0)){i[g]=s;continue}try{s=p._injected?h(p._injected,c.initial):yield u[_](c),i[g]=s=yield y(c,s,!0),m=yield t(c,s,i)}catch{m=!(yield n(c,i))}if(m)return i}}}catch(e){b.e(e)}finally{b.f()}return i}),m.apply(this,arguments)}function h(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function g(e){p._injected=(p._injected||[]).concat(e)}function _(e){p._override=Object.assign({},e)}t.exports=Object.assign(p,{prompt:p,prompts:u,inject:g,override:_})}),Ve=o((exports,t)=>{t.exports=(e,t)=>{if(!(e.meta&&e.name!==`escape`)){if(e.ctrl){if(e.name===`a`)return`first`;if(e.name===`c`||e.name===`d`)return`abort`;if(e.name===`e`)return`last`;if(e.name===`g`)return`reset`}if(t){if(e.name===`j`)return`down`;if(e.name===`k`)return`up`}return e.name===`return`||e.name===`enter`?`submit`:e.name===`backspace`?`delete`:e.name===`delete`?`deleteForward`:e.name===`abort`?`abort`:e.name===`escape`?`exit`:e.name===`tab`?`next`:e.name===`pagedown`?`nextPage`:e.name===`pageup`?`prevPage`:e.name===`home`?`home`:e.name===`end`?`end`:e.name===`up`?`up`:e.name===`down`?`down`:e.name===`right`?`right`:e.name===`left`?`left`:!1}}}),Y=o((exports,t)=>{t.exports=e=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))`].join(`|`),n=new RegExp(t,`g`);return typeof e==`string`?e.replace(n,``):e}}),He=o((exports,t)=>{let n=Y(),{erase:r,cursor:i}=U(),a=e=>[...n(e)].length;
227
+ /**
228
+ * @param {string} prompt
229
+ * @param {number} perLine
230
+ */
231
+ t.exports=function(e,t){if(!t)return r.line+i.to(0);let n=0,o=e.split(/\r?\n/);for(let e of o)n+=1+Math.floor(Math.max(a(e)-1,0)/t);return r.lines(n)}}),Ue=o((exports,t)=>{let n={arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,radioOn:`◉`,radioOff:`◯`,tick:`✔`,cross:`✖`,ellipsis:`…`,pointerSmall:`›`,line:`─`,pointer:`❯`},r={arrowUp:n.arrowUp,arrowDown:n.arrowDown,arrowLeft:n.arrowLeft,arrowRight:n.arrowRight,radioOn:`(*)`,radioOff:`( )`,tick:`√`,cross:`×`,ellipsis:`...`,pointerSmall:`»`,line:`─`,pointer:`>`},i=process.platform===`win32`?r:n;t.exports=i}),We=o((exports,t)=>{let n=V(),r=Ue(),i=Object.freeze({password:{scale:1,render:e=>`*`.repeat(e.length)},emoji:{scale:2,render:e=>`😃`.repeat(e.length)},invisible:{scale:0,render:e=>``},default:{scale:1,render:e=>`${e}`}}),a=e=>i[e]||i.default,o=Object.freeze({aborted:n.red(r.cross),done:n.green(r.tick),exited:n.yellow(r.cross),default:n.cyan(`?`)}),s=(e,t,n)=>t?o.aborted:n?o.exited:e?o.done:o.default,c=e=>n.gray(e?r.ellipsis:r.pointerSmall),l=(e,t)=>n.gray(e?t?r.pointerSmall:`+`:r.line);t.exports={styles:i,render:a,symbols:o,symbol:s,delimiter:c,item:l}}),Ge=o((exports,t)=>{let n=Y();
232
+ /**
233
+ * @param {string} msg
234
+ * @param {number} perLine
235
+ */
236
+ t.exports=function(e,t){let r=String(n(e)||``).split(/\r?\n/);return t?r.map(e=>Math.ceil(e.length/t)).reduce((e,t)=>e+t):r.length}}),Ke=o((exports,t)=>{
237
+ /**
238
+ * @param {string} msg The message to wrap
239
+ * @param {object} opts
240
+ * @param {number|string} [opts.margin] Left margin
241
+ * @param {number} opts.width Maximum characters per line including the margin
242
+ */
243
+ t.exports=(e,t={})=>{let n=Number.isSafeInteger(parseInt(t.margin))?Array(parseInt(t.margin)).fill(` `).join(``):t.margin||``,r=t.width;return(e||``).split(/\r?\n/g).map(e=>e.split(/\s+/g).reduce((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1<r?e[e.length-1]+=` ${t}`:e.push(`${n}${t}`),e),[n]).join(`
51
244
  `)).join(`
52
- `)}});var Pr=u((ja,_r)=>{"use strict";_r.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 C=u((Fa,Er)=>{"use strict";Er.exports={action:vr(),clear:Sr(),style:Cr(),strip:Ee(),figures:Ct(),lines:qr(),wrap:Ir(),entriesToDisplay:Pr()}});var N=u((Na,Dr)=>{"use strict";var Ar=require("readline"),{action:Mh}=C(),qh=require("events"),{beep:$h,cursor:Ih}=g(),_h=p(),qt=class extends qh{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=Ar.createInterface({input:this.in,escapeCodeTimeout:50});Ar.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(n,o)=>{let l=Mh(o,s);l===!1?this._&&this._(n,o):typeof this[l]=="function"?this[l](o):this.bell()};this.close=()=>{this.out.write(Ih.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($h)}render(){this.onRender(_h),this.firstRender&&(this.firstRender=!1)}};Dr.exports=qt});var kr=u((Va,Rr)=>{var Ae=p(),Ph=N(),{erase:Eh,cursor:me}=g(),{style:$t,clear:It,lines:Ah,figures:Dh}=C(),_t=class extends Ph{constructor(e={}){super(e),this.transform=$t.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=+!!this.initial,this.cursorOffset=0,this.clear=It("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Ae.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=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
53
- `),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(`
54
- `),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(me.down(Ah(this.outputError,this.out.columns)-1)+It(this.outputError,this.out.columns)),this.out.write(It(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[$t.symbol(this.done,this.aborted),Ae.bold(this.msg),$t.delimiter(this.done),this.red?Ae.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
55
- `).reduce((e,t,s)=>e+`
56
- ${s?" ":Dh.pointerSmall} ${Ae.red().italic(t)}`,"")),this.out.write(Eh.line+me.to(0)+this.outputText+me.save+this.outputError+me.restore+me.move(this.cursorOffset,0)))}};Rr.exports=_t});var Vr=u((Ya,Nr)=>{"use strict";var V=p(),Rh=N(),{style:jr,clear:Fr,figures:De,wrap:kh,entriesToDisplay:jh}=C(),{cursor:Fh}=g(),Pt=class extends Rh{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=Fr("",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(`
245
+ `)}}),qe=o((exports,t)=>{
246
+ /**
247
+ * Determine what entries should be displayed on the screen, based on the
248
+ * currently selected index and the maximum visible. Used in list-based
249
+ * prompts like `select` and `multiselect`.
250
+ *
251
+ * @param {number} cursor the currently selected entry
252
+ * @param {number} total the total entries available to display
253
+ * @param {number} [maxVisible] the number of entries that can be displayed
254
+ */
255
+ t.exports=(e,t,n)=>{n||=t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let i=Math.min(r+n,t);return{startIndex:r,endIndex:i}}}),X=o((exports,t)=>{t.exports={action:Ve(),clear:He(),style:We(),strip:Y(),figures:Ue(),lines:Ge(),wrap:Ke(),entriesToDisplay:qe()}}),Z=o((exports,t)=>{let n=require(`readline`),{action:r}=X(),i=require(`events`),{beep:a,cursor:o}=U(),s=V();
256
+ /**
257
+ * Base prompt skeleton
258
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
259
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
260
+ */
261
+ var c=class extends i{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>void 0)).bind(this);let t=n.createInterface({input:this.in,escapeCodeTimeout:50});n.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let i=[`SelectPrompt`,`MultiselectPrompt`].indexOf(this.constructor.name)>-1,a=(e,t)=>{let n=r(t,i);n===!1?this._&&this._(e,t):typeof this[n]==`function`?this[n](t):this.bell()};this.close=()=>{this.out.write(o.show),this.in.removeListener(`keypress`,a),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`,a)}fire(){this.emit(`state`,{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(a)}render(){this.onRender(s),this.firstRender&&=!1}};t.exports=c}),Je=o((exports,t)=>{let n=V(),r=Z(),{erase:i,cursor:a}=U(),{style:o,clear:s,lines:c,figures:l}=X();
262
+ /**
263
+ * TextPrompt Base Element
264
+ * @param {Object} opts Options
265
+ * @param {String} opts.message Message
266
+ * @param {String} [opts.style='default'] Render style
267
+ * @param {String} [opts.initial] Default value
268
+ * @param {Function} [opts.validate] Validate function
269
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
270
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
271
+ * @param {String} [opts.error] The invalid error label
272
+ */
273
+ var u=class extends r{constructor(e={}){super(e),this.transform=o.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=s(``,this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=n.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(`
274
+ `),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(`
275
+ `),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+=e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${n}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:n.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(a.down(c(this.outputError,this.out.columns)-1)+s(this.outputError,this.out.columns)),this.out.write(s(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(this.done),this.red?n.red(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
276
+ `).reduce((e,t,r)=>e+`\n${r?` `:l.pointerSmall} ${n.red().italic(t)}`,``)),this.out.write(i.line+a.to(0)+this.outputText+a.save+this.outputError+a.restore+a.move(this.cursorOffset,0)))}};t.exports=u}),Ye=o((exports,t)=>{let n=V(),r=Z(),{style:i,clear:a,figures:o,wrap:s,entriesToDisplay:c}=X(),{cursor:l}=U();
277
+ /**
278
+ * SelectPrompt Base Element
279
+ * @param {Object} opts Options
280
+ * @param {String} opts.message Message
281
+ * @param {Array} opts.choices Array of choice objects
282
+ * @param {String} [opts.hint] Hint to display
283
+ * @param {Number} [opts.initial] Index of default value
284
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
285
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
286
+ * @param {Number} [opts.optionsPerPage=10] Max options to display at once
287
+ */
288
+ var u=class extends r{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((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=a(``,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(`
57
289
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
58
- `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Fh.hide):this.out.write(Fr(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=jh(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[jr.symbol(this.done,this.aborted),V.bold(this.msg),jr.delimiter(!1),this.done?this.selection.title:this.selection.disabled?V.yellow(this.warn):V.gray(this.hint)].join(" "),!this.done){this.outputText+=`
59
- `;for(let s=e;s<t;s++){let r,n,o="",l=this.choices[s];s===e&&e>0?n=De.arrowUp:s===t-1&&t<this.choices.length?n=De.arrowDown:n=" ",l.disabled?(r=this.cursor===s?V.gray().underline(l.title):V.strikethrough().gray(l.title),n=(this.cursor===s?V.bold().gray(De.pointer)+" ":" ")+n):(r=this.cursor===s?V.cyan().underline(l.title):l.title,n=(this.cursor===s?V.cyan(De.pointer)+" ":" ")+n,l.description&&this.cursor===s&&(o=` - ${l.description}`,(n.length+r.length+o.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(o=`
60
- `+kh(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${r}${V.gray(o)}
61
- `}}this.out.write(this.outputText)}};Nr.exports=Pt});var Hr=u((La,Br)=>{var Re=p(),Nh=N(),{style:Yr,clear:Vh}=C(),{cursor:Lr,erase:Yh}=g(),Et=class extends Nh{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(`
290
+ `),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(l.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=c(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(!1),this.done?this.selection.title:this.selection.disabled?n.yellow(this.warn):n.gray(this.hint)].join(` `),!this.done){this.outputText+=`
291
+ `;for(let r=e;r<t;r++){let i,a,c=``,l=this.choices[r];a=r===e&&e>0?o.arrowUp:r===t-1&&t<this.choices.length?o.arrowDown:` `,l.disabled?(i=this.cursor===r?n.gray().underline(l.title):n.strikethrough().gray(l.title),a=(this.cursor===r?n.bold().gray(o.pointer)+` `:` `)+a):(i=this.cursor===r?n.cyan().underline(l.title):l.title,a=(this.cursor===r?n.cyan(o.pointer)+` `:` `)+a,l.description&&this.cursor===r&&(c=` - ${l.description}`,(a.length+i.length+c.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(c=`
292
+ `+s(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${a} ${i}${n.gray(c)}\n`}}this.out.write(this.outputText)}};t.exports=u}),Xe=o((exports,t)=>{let n=V(),r=Z(),{style:i,clear:a}=X(),{cursor:o,erase:s}=U();
293
+ /**
294
+ * TogglePrompt Base Element
295
+ * @param {Object} opts Options
296
+ * @param {String} opts.message Message
297
+ * @param {Boolean} [opts.initial=false] Default value
298
+ * @param {String} [opts.active='no'] Active label
299
+ * @param {String} [opts.inactive='off'] Inactive label
300
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
301
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
302
+ */
303
+ var c=class extends r{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(`
62
304
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
63
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(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(Lr.hide):this.out.write(Vh(this.outputText,this.out.columns)),super.render(),this.outputText=[Yr.symbol(this.done,this.aborted),Re.bold(this.msg),Yr.delimiter(this.done),this.value?this.inactive:Re.cyan().underline(this.inactive),Re.gray("/"),this.value?Re.cyan().underline(this.active):this.active].join(" "),this.out.write(Yh.line+Lr.to(0)+this.outputText))}};Br.exports=Et});var _=u((Ba,Gr)=>{"use strict";var At=class i{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 i)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,r)=>r>t&&s instanceof i)}toString(){return String(this.date)}};Gr.exports=At});var Wr=u((Ha,Ur)=>{"use strict";var Lh=_(),Dt=class extends Lh{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}};Ur.exports=Dt});var zr=u((Ga,Jr)=>{"use strict";var Bh=_(),Hh=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),Rt=class extends Bh{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+Hh(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};Jr.exports=Rt});var Zr=u((Ua,Kr)=>{"use strict";var Gh=_(),kt=class extends Gh{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}};Kr.exports=kt});var Qr=u((Wa,Xr)=>{"use strict";var Uh=_(),jt=class extends Uh{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)}};Xr.exports=jt});var tn=u((Ja,en)=>{"use strict";var Wh=_(),Ft=class extends Wh{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}};en.exports=Ft});var rn=u((za,sn)=>{"use strict";var Jh=_(),Nt=class extends Jh{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)}};sn.exports=Nt});var on=u((Ka,nn)=>{"use strict";var zh=_(),Vt=class extends zh{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}};nn.exports=Vt});var hn=u((Za,ln)=>{"use strict";var Kh=_(),Yt=class extends Kh{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}};ln.exports=Yt});var an=u((Xa,un)=>{"use strict";un.exports={DatePart:_(),Meridiem:Wr(),Day:zr(),Hours:Zr(),Milliseconds:Qr(),Minutes:tn(),Month:rn(),Seconds:on(),Year:hn()}});var bn=u((Qa,gn)=>{"use strict";var Lt=p(),Zh=N(),{style:cn,clear:dn,figures:Xh}=C(),{erase:Qh,cursor:fn}=g(),{DatePart:pn,Meridiem:eu,Day:tu,Hours:iu,Milliseconds:su,Minutes:ru,Month:nu,Seconds:ou,Year:lu}=an(),hu=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,mn={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new tu(i),3:i=>new nu(i),4:i=>new lu(i),5:i=>new eu(i),6:i=>new iu(i),7:i=>new ru(i),8:i=>new ou(i),9:i=>new su(i)},uu={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(",")},Bt=class extends Zh{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(uu,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=dn("",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=hu.exec(e);){let r=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in mn?mn[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 pn)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
64
- `),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(`
65
- `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let 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 pn)),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(fn.hide):this.out.write(dn(this.outputText,this.out.columns)),super.render(),this.outputText=[cn.symbol(this.done,this.aborted),Lt.bold(this.msg),cn.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?Lt.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
66
- `).reduce((e,t,s)=>e+`
67
- ${s?" ":Xh.pointerSmall} ${Lt.red().italic(t)}`,"")),this.out.write(Qh.line+fn.to(0)+this.outputText))}};gn.exports=Bt});var xn=u((ec,wn)=>{var ke=p(),au=N(),{cursor:je,erase:cu}=g(),{style:Ht,figures:du,clear:vn,lines:fu}=C(),pu=/[0-9]/,Gt=i=>i!==void 0,yn=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},Ut=class extends au{constructor(e={}){super(e),this.transform=Ht.render(e.style),this.msg=e.message,this.initial=Gt(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Gt(e.min)?e.min:-1/0,this.max=Gt(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=ke.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${yn(e,this.round)}`),this._value=yn(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||pu.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(`
68
- `),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(`
69
- `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let 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(je.down(fu(this.outputError,this.out.columns)-1)+vn(this.outputError,this.out.columns)),this.out.write(vn(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ht.symbol(this.done,this.aborted),ke.bold(this.msg),Ht.delimiter(this.done),!this.done||!this.done&&!this.placeholder?ke[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
70
- `).reduce((e,t,s)=>e+`
71
- ${s?" ":du.pointerSmall} ${ke.red().italic(t)}`,"")),this.out.write(cu.line+je.to(0)+this.outputText+je.save+this.outputError+je.restore))}};wn.exports=Ut});var Jt=u((tc,Tn)=>{"use strict";var P=p(),{cursor:mu}=g(),gu=N(),{clear:Sn,figures:U,style:On,wrap:bu,entriesToDisplay:vu}=C(),Wt=class extends gu{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=Sn("",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(`
72
- `),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(`
73
- `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(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:`
305
+ `),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(o.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(this.done),this.value?this.inactive:n.cyan().underline(this.inactive),n.gray(`/`),this.value?n.cyan().underline(this.active):this.active].join(` `),this.out.write(s.line+o.to(0)+this.outputText))}};t.exports=c}),Q=o((exports,t)=>{var n=class e{constructor({token:e,date:t,parts:n,locales:r}){this.token=e,this.date=t||new Date,this.parts=n||[this],this.locales=r||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((n,r)=>r>t&&n instanceof e)}setTo(e){}prev(){let t=[].concat(this.parts).reverse(),n=t.indexOf(this);return t.find((t,r)=>r>n&&t instanceof e)}toString(){return String(this.date)}};t.exports=n}),Ze=o((exports,t)=>{let n=Q();var r=class extends n{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}};t.exports=r}),Qe=o((exports,t)=>{let n=Q(),r=e=>(e%=10,e===1?`st`:e===2?`nd`:e===3?`rd`:`th`);var i=class extends n{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+r(e):this.token===`d`?t+1:this.token===`ddd`?this.locales.weekdaysShort[t]:this.token===`dddd`?this.locales.weekdays[t]:e}};t.exports=i}),$e=o((exports,t)=>{let n=Q();var r=class extends n{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}};t.exports=r}),et=o((exports,t)=>{let n=Q();var r=class extends n{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)}};t.exports=r}),tt=o((exports,t)=>{let n=Q();var r=class extends n{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}};t.exports=r}),nt=o((exports,t)=>{let n=Q();var r=class extends n{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)}};t.exports=r}),rt=o((exports,t)=>{let n=Q();var r=class extends n{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}};t.exports=r}),it=o((exports,t)=>{let n=Q();var r=class extends n{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}};t.exports=r}),at=o((exports,t)=>{t.exports={DatePart:Q(),Meridiem:Ze(),Day:Qe(),Hours:$e(),Milliseconds:et(),Minutes:tt(),Month:nt(),Seconds:rt(),Year:it()}}),ot=o((exports,t)=>{let n=V(),r=Z(),{style:i,clear:a,figures:o}=X(),{erase:s,cursor:c}=U(),{DatePart:l,Meridiem:u,Day:d,Hours:f,Milliseconds:p,Minutes:m,Month:h,Seconds:g,Year:_}=at(),v=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,y={1:({token:e})=>e.replace(/\\(.)/g,`$1`),2:e=>new d(e),3:e=>new h(e),4:e=>new _(e),5:e=>new u(e),6:e=>new f(e),7:e=>new m(e),8:e=>new g(e),9:e=>new p(e)},b={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(`,`)};
306
+ /**
307
+ * DatePrompt Base Element
308
+ * @param {Object} opts Options
309
+ * @param {String} opts.message Message
310
+ * @param {Number} [opts.initial] Index of default value
311
+ * @param {String} [opts.mask] The format mask
312
+ * @param {object} [opts.locales] The date locales
313
+ * @param {String} [opts.error] The error message shown on invalid value
314
+ * @param {Function} [opts.validate] Function to validate the submitted value
315
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
316
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
317
+ */
318
+ var x=class extends r{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed=``,this.locales=Object.assign(b,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=a(``,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=v.exec(e);){let e=t.shift(),n=t.findIndex(e=>e!=null);this.parts.push(n in y?y[n]({token:t[n]||e,date:this.date,parts:this.parts,locales:this.locales}):t[n]||e)}let n=this.parts.reduce((e,t)=>(typeof t==`string`&&typeof e[e.length-1]==`string`?e[e.length-1]+=t:e.push(t),e),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed=``,this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof l)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
319
+ `),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(`
320
+ `),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(e=>e instanceof l)),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(c.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(!1),this.parts.reduce((e,t,r)=>e.concat(r===this.cursor&&!this.done?n.cyan().underline(t.toString()):t),[]).join(``)].join(` `),this.error&&(this.outputText+=this.errorMsg.split(`
321
+ `).reduce((e,t,r)=>e+`\n${r?` `:o.pointerSmall} ${n.red().italic(t)}`,``)),this.out.write(s.line+c.to(0)+this.outputText))}};t.exports=x}),st=o((exports,t)=>{let n=V(),r=Z(),{cursor:i,erase:a}=U(),{style:o,figures:s,clear:c,lines:l}=X(),u=/[0-9]/,d=e=>e!==void 0,f=(e,t)=>{let n=10**t;return Math.round(e*n)/n};
322
+ /**
323
+ * NumberPrompt Base Element
324
+ * @param {Object} opts Options
325
+ * @param {String} opts.message Message
326
+ * @param {String} [opts.style='default'] Render style
327
+ * @param {Number} [opts.initial] Default value
328
+ * @param {Number} [opts.max=+Infinity] Max value
329
+ * @param {Number} [opts.min=-Infinity] Min value
330
+ * @param {Boolean} [opts.float=false] Parse input as floats
331
+ * @param {Number} [opts.round=2] Round floats to x decimals
332
+ * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys
333
+ * @param {Function} [opts.validate] Validate function
334
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
335
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
336
+ * @param {String} [opts.error] The invalid error label
337
+ */
338
+ var p=class extends r{constructor(e={}){super(e),this.transform=o.render(e.style),this.msg=e.message,this.initial=d(e.initial)?e.initial:``,this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=d(e.min)?e.min:-1/0,this.max=d(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=n.gray(this.transform.render(`${this.initial}`)),this._value=``):(this.placeholder=!1,this.rendered=this.transform.render(`${f(e,this.round)}`),this._value=f(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||u.test(e)}reset(){this.typed=``,this.value=``,this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e===``?this.initial:e,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
339
+ `),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===``?this.initial:e,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
340
+ `),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 n=Date.now();if(n-this.lastHit>1e3&&(this.typed=``),this.typed+=e,this.lastHit=n,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(i.down(l(this.outputError,this.out.columns)-1)+c(this.outputError,this.out.columns)),this.out.write(c(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(this.done),!this.done||!this.done&&!this.placeholder?n[this.color]().underline(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
341
+ `).reduce((e,t,r)=>e+`\n${r?` `:s.pointerSmall} ${n.red().italic(t)}`,``)),this.out.write(a.line+i.to(0)+this.outputText+i.save+this.outputError+i.restore))}};t.exports=p}),ct=o((exports,t)=>{let n=V(),{cursor:r}=U(),i=Z(),{clear:a,figures:o,style:s,wrap:c,entriesToDisplay:l}=X();
342
+ /**
343
+ * MultiselectPrompt Base Element
344
+ * @param {Object} opts Options
345
+ * @param {String} opts.message Message
346
+ * @param {Array} opts.choices Array of choice objects
347
+ * @param {String} [opts.hint] Hint to display
348
+ * @param {String} [opts.warn] Hint shown for disabled choices
349
+ * @param {Number} [opts.max] Max choices
350
+ * @param {Number} [opts.cursor=0] Cursor start position
351
+ * @param {Number} [opts.optionsPerPage=10] Max options to display at once
352
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
353
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
354
+ */
355
+ var u=class extends i{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((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=a(``,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(`
356
+ `),this.close()}submit(){let e=this.value.filter(e=>e.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(`
357
+ `),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(e=>e.selected).length>=this.maxChoices)return this.bell();else 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(e=>!e.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:`
74
358
  Instructions:
75
- ${U.arrowUp}/${U.arrowDown}: Highlight option
76
- ${U.arrowLeft}/${U.arrowRight}/[space]: Toggle selection
77
- `+(this.maxChoices===void 0?` a: Toggle all
78
- `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,r){let n=(t.selected?P.green(U.radioOn):U.radioOff)+" "+r+" ",o,l;return t.disabled?o=e===s?P.gray().underline(t.title):P.strikethrough().gray(t.title):(o=e===s?P.cyan().underline(t.title):t.title,e===s&&t.description&&(l=` - ${t.description}`,(n.length+o.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(l=`
79
- `+bu(t.description,{margin:n.length,width:this.out.columns})))),n+o+P.gray(l||"")}paginateOptions(e){if(e.length===0)return P.red("No matches for this query.");let{startIndex:t,endIndex:s}=vu(this.cursor,e.length,this.optionsPerPage),r,n=[];for(let o=t;o<s;o++)o===t&&t>0?r=U.arrowUp:o===s-1&&s<e.length?r=U.arrowDown:r=" ",n.push(this.renderOption(this.cursor,e[o],o,r));return`
80
- `+n.join(`
81
- `)}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=[P.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(P.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(mu.hide),super.render();let e=[On.symbol(this.done,this.aborted),P.bold(this.msg),On.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=P.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=Sn(e,this.out.columns)}};Tn.exports=Wt});var In=u((ic,$n)=>{"use strict";var ge=p(),yu=N(),{erase:wu,cursor:Cn}=g(),{style:zt,clear:Mn,figures:Kt,wrap:xu,entriesToDisplay:Su}=C(),qn=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),Ou=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),Tu=(i,e)=>{let t=i.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},Zt=class extends yu{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:Tu(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=zt.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Mn("",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=qn(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,l)=>({title:Ou(l,o),value:qn(l,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(`
359
+ ${o.arrowUp}/${o.arrowDown}: Highlight option\n ${o.arrowLeft}/${o.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===void 0?` a: Toggle all
360
+ `:``)+` enter/return: Complete answer`:``}renderOption(e,t,r,i){let a=(t.selected?n.green(o.radioOn):o.radioOff)+` `+i+` `,s,l;return t.disabled?s=e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):(s=e===r?n.cyan().underline(t.title):t.title,e===r&&t.description&&(l=` - ${t.description}`,(a.length+s.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(l=`
361
+ `+c(t.description,{margin:a.length,width:this.out.columns})))),a+s+n.gray(l||``)}paginateOptions(e){if(e.length===0)return n.red(`No matches for this query.`);let{startIndex:t,endIndex:r}=l(this.cursor,e.length,this.optionsPerPage),i,a=[];for(let n=t;n<r;n++)i=n===t&&t>0?o.arrowUp:n===r-1&&r<e.length?o.arrowDown:` `,a.push(this.renderOption(this.cursor,e[n],n,i));return`
362
+ `+a.join(`
363
+ `)}renderOptions(e){return this.done?``:this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let e=[s.symbol(this.done,this.aborted),n.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&(e+=n.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=a(e,this.out.columns)}};t.exports=u}),lt=o((exports,t)=>{let n=V(),r=Z(),{erase:i,cursor:a}=U(),{style:o,clear:s,figures:c,wrap:l,entriesToDisplay:u}=X(),d=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),f=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),p=(e,t)=>{let n=e.findIndex(e=>e.value===t||e.title===t);return n>-1?n:void 0};
364
+ /**
365
+ * TextPrompt Base Element
366
+ * @param {Object} opts Options
367
+ * @param {String} opts.message Message
368
+ * @param {Array} opts.choices Array of auto-complete choices objects
369
+ * @param {Function} [opts.suggest] Filter function. Defaults to sort by title
370
+ * @param {Number} [opts.limit=10] Max number of results to show
371
+ * @param {Number} [opts.cursor=0] Cursor start position
372
+ * @param {String} [opts.style='default'] Render style
373
+ * @param {String} [opts.fallback] Fallback message - initial to default value
374
+ * @param {String} [opts.initial] Index of the default value
375
+ * @param {Boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input
376
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
377
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
378
+ * @param {String} [opts.noMatches] The no matches found label
379
+ */
380
+ var m=class extends r{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial==`number`?e.initial:p(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=o.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=s(``,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=d(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),n=await t;if(this.completing!==t)return;this.suggestions=n.map((e,t,n)=>({title:f(n,t),value:d(n,t),description:e.description})),this.completing=!1;let r=Math.max(n.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}reset(){this.input=``,this.complete(()=>{this.moveSelect(this.initial===void 0?0:this.initial),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
82
381
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
83
382
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
84
- `),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?Kt.arrowUp:r?Kt.arrowDown:" ",l=t?ge.cyan().underline(e.title):e.title;return o=(t?ge.cyan(Kt.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+l.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
85
- `+xu(e.description,{margin:3,width:this.out.columns}))),o+" "+l+ge.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Cn.hide):this.out.write(Mn(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=Su(this.select,this.choices.length,this.limit);if(this.outputText=[zt.symbol(this.done,this.aborted,this.exited),ge.bold(this.msg),zt.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(`
383
+ `),this.close()}_(e,t){let n=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${n}${e}${r}`,this.cursor=n.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.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.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor+=1,this.render()}renderOption(e,t,r,i){let a,o=r?c.arrowUp:i?c.arrowDown:` `,s=t?n.cyan().underline(e.title):e.title;return o=(t?n.cyan(c.pointer)+` `:` `)+o,e.description&&(a=` - ${e.description}`,(o.length+s.length+a.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(a=`
384
+ `+l(e.description,{margin:3,width:this.out.columns}))),o+` `+s+n.gray(a||``)}render(){if(this.closed)return;this.firstRender?this.out.write(a.hide):this.out.write(s(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=u(this.select,this.choices.length,this.limit);if(this.outputText=[o.symbol(this.done,this.aborted,this.exited),n.bold(this.msg),o.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(` `),!this.done){let r=this.suggestions.slice(e,t).map((n,r)=>this.renderOption(n,this.select===r+e,r===0&&e>0,r+e===t-1&&t<this.choices.length)).join(`
86
385
  `);this.outputText+=`
87
- `+(s||ge.gray(this.fallback.title))}this.out.write(wu.line+Cn.to(0)+this.outputText)}};$n.exports=Zt});var An=u((sc,En)=>{"use strict";var Y=p(),{cursor:Cu}=g(),Mu=Jt(),{clear:_n,style:Pn,figures:ie}=C(),Xt=class extends Mu{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=_n("",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:`
386
+ `+(r||n.gray(this.fallback.title))}this.out.write(i.line+a.to(0)+this.outputText)}};t.exports=m}),ut=o((exports,t)=>{let n=V(),{cursor:r}=U(),i=ct(),{clear:a,style:o,figures:s}=X();
387
+ /**
388
+ * MultiselectPrompt Base Element
389
+ * @param {Object} opts Options
390
+ * @param {String} opts.message Message
391
+ * @param {Array} opts.choices Array of choice objects
392
+ * @param {String} [opts.hint] Hint to display
393
+ * @param {String} [opts.warn] Hint shown for disabled choices
394
+ * @param {Number} [opts.max] Max choices
395
+ * @param {Number} [opts.cursor=0] Cursor start position
396
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
397
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
398
+ */
399
+ var c=class extends i{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue=``,this.clear=a(``,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(e=>this.inputValue?!!(typeof e.title==`string`&&e.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof e.value==`string`&&e.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(t=>t===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(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}handleInputChange(e){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:`
88
400
  Instructions:
89
- ${ie.arrowUp}/${ie.arrowDown}: Highlight option
90
- ${ie.arrowLeft}/${ie.arrowRight}/[space]: Toggle selection
401
+ ${s.arrowUp}/${s.arrowDown}: Highlight option
402
+ ${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection
91
403
  [a,b,c]/delete: Filter choices
92
404
  enter/return: Complete answer
93
- `:""}renderCurrentInput(){return`
94
- Filtered results for: ${this.inputValue?this.inputValue:Y.gray("Enter something to filter")}
95
- `}renderOption(e,t,s){let r;return t.disabled?r=e===s?Y.gray().underline(t.title):Y.strikethrough().gray(t.title):r=e===s?Y.cyan().underline(t.title):t.title,(t.selected?Y.green(ie.radioOn):ie.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[Y.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Y.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Cu.hide),super.render();let e=[Pn.symbol(this.done,this.aborted),Y.bold(this.msg),Pn.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Y.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=_n(e,this.out.columns)}};En.exports=Xt});var Fn=u((rc,jn)=>{var Dn=p(),qu=N(),{style:Rn,clear:$u}=C(),{erase:Iu,cursor:kn}=g(),Qt=class extends qu{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(`
405
+ `:``}renderCurrentInput(){return`
406
+ Filtered results for: ${this.inputValue?this.inputValue:n.gray(`Enter something to filter`)}\n`}renderOption(e,t,r){let i;return i=t.disabled?e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):e===r?n.cyan().underline(t.title):t.title,(t.selected?n.green(s.radioOn):s.radioOff)+` `+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let e=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&(e+=n.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=a(e,this.out.columns)}};t.exports=c}),dt=o((exports,t)=>{let n=V(),r=Z(),{style:i,clear:a}=X(),{erase:o,cursor:s}=U();
407
+ /**
408
+ * ConfirmPrompt Base Element
409
+ * @param {Object} opts Options
410
+ * @param {String} opts.message Message
411
+ * @param {Boolean} [opts.initial] Default value (true/false)
412
+ * @param {Stream} [opts.stdin] The Readable stream to listen to
413
+ * @param {Stream} [opts.stdout] The Writable stream to write readline data to
414
+ * @param {String} [opts.yes] The "Yes" label
415
+ * @param {String} [opts.yesOption] The "Yes" option when choosing between yes/no
416
+ * @param {String} [opts.no] The "No" label
417
+ * @param {String} [opts.noOption] The "No" option when choosing between yes/no
418
+ */
419
+ var c=class extends r{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(`
96
420
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
97
- `),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(kn.hide):this.out.write($u(this.outputText,this.out.columns)),super.render(),this.outputText=[Rn.symbol(this.done,this.aborted),Dn.bold(this.msg),Rn.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Dn.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Iu.line+kn.to(0)+this.outputText))}};jn.exports=Qt});var Vn=u((nc,Nn)=>{"use strict";Nn.exports={TextPrompt:kr(),SelectPrompt:Vr(),TogglePrompt:Hr(),DatePrompt:bn(),NumberPrompt:xn(),MultiselectPrompt:Jt(),AutocompletePrompt:In(),AutocompleteMultiselectPrompt:An(),ConfirmPrompt:Fn()}});var Ln=u(Yn=>{"use strict";var w=Yn,_u=Vn(),Fe=i=>i;function E(i,e,t={}){return new Promise((s,r)=>{let n=new _u[i](e),o=t.onAbort||Fe,l=t.onSubmit||Fe,h=t.onExit||Fe;n.on("state",e.onState||Fe),n.on("submit",a=>s(l(a))),n.on("exit",a=>s(h(a))),n.on("abort",a=>r(o(a)))})}w.text=i=>E("TextPrompt",i);w.password=i=>(i.style="password",w.text(i));w.invisible=i=>(i.style="invisible",w.text(i));w.number=i=>E("NumberPrompt",i);w.date=i=>E("DatePrompt",i);w.confirm=i=>E("ConfirmPrompt",i);w.list=i=>{let e=i.separator||",";return E("TextPrompt",i,{onSubmit:t=>t.split(e).map(s=>s.trim())})};w.toggle=i=>E("TogglePrompt",i);w.select=i=>E("SelectPrompt",i);w.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return E("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 E("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var Pu=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));w.autocomplete=i=>(i.suggest=i.suggest||Pu,i.choices=[].concat(i.choices||[]),E("AutocompletePrompt",i))});var Gn=u((lc,Hn)=>{"use strict";var ei=Ln(),Eu=["suggest","format","onState","validate","onRender","type"],Bn=()=>{};async function W(i=[],{onSubmit:e=Bn,onCancel:t=Bn}={}){let s={},r=W._override||{};i=[].concat(i);let n,o,l,h,a,K,se=async(v,M,ve=!1)=>{if(!(!ve&&v.validate&&v.validate(M)!==!0))return v.format?await v.format(M,s):M};for(o of i)if({name:h,type:a}=o,typeof a=="function"&&(a=await a(n,{...s},o),o.type=a),!!a){for(let v in o){if(Eu.includes(v))continue;let M=o[v];o[v]=typeof M=="function"?await M(n,{...s},K):M}if(K=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:h,type:a}=o,ei[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[o.name]!==void 0&&(n=await se(o,r[o.name]),n!==void 0)){s[h]=n;continue}try{n=W._injected?Au(W._injected,o.initial):await ei[a](o),s[h]=n=await se(o,n,!0),l=await e(o,n,s)}catch{l=!await t(o,s)}if(l)return s}return s}function Au(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function Du(i){W._injected=(W._injected||[]).concat(i)}function Ru(i){W._override=Object.assign({},i)}Hn.exports=Object.assign(W,{prompt:W,prompts:ei,inject:Du,override:Ru})});var Wn=u((hc,Un)=>{function ku(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}Un.exports=ku("8.6.0")?gr():Gn()});var x=B(require("fs"),1),ii=B(require("path"),1),be=B(require("process"),1);var oi=(i=0)=>e=>`\x1B[${e+i}m`,li=(i=0)=>e=>`\x1B[${38+i};5;${e}m`,hi=(i=0)=>(e,t,s)=>`\x1B[${38+i};2;${e};${t};${s}m`,f={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Vu=Object.keys(f.modifier),yo=Object.keys(f.color),wo=Object.keys(f.bgColor),Yu=[...yo,...wo];function xo(){let i=new Map;for(let[e,t]of Object.entries(f)){for(let[s,r]of Object.entries(t))f[s]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},t[s]=f[s],i.set(r[0],r[1]);Object.defineProperty(f,e,{value:t,enumerable:!1})}return Object.defineProperty(f,"codes",{value:i,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",f.color.ansi=oi(),f.color.ansi256=li(),f.color.ansi16m=hi(),f.bgColor.ansi=oi(10),f.bgColor.ansi256=li(10),f.bgColor.ansi16m=hi(10),Object.defineProperties(f,{rgbToAnsi256:{value(e,t,s){return e===t&&t===s?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(s/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[s]=t;s.length===3&&(s=[...s].map(n=>n+n).join(""));let r=Number.parseInt(s,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>f.rgbToAnsi256(...f.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,s,r;if(e>=232)t=((e-232)*10+8)/255,s=t,r=t;else{e-=16;let l=e%36;t=Math.floor(e/36)/5,s=Math.floor(l/6)/5,r=l%6/5}let n=Math.max(t,s,r)*2;if(n===0)return 30;let o=30+(Math.round(r)<<2|Math.round(s)<<1|Math.round(t));return n===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,s)=>f.ansi256ToAnsi(f.rgbToAnsi256(e,t,s)),enumerable:!1},hexToAnsi:{value:e=>f.ansi256ToAnsi(f.hexToAnsi256(e)),enumerable:!1}}),f}var So=xo(),O=So;var xe=B(require("process"),1),ai=B(require("os"),1),Ve=B(require("tty"),1);function S(i,e=globalThis.Deno?globalThis.Deno.args:xe.default.argv){let t=i.startsWith("-")?"":i.length===1?"-":"--",s=e.indexOf(t+i),r=e.indexOf("--");return s!==-1&&(r===-1||s<r)}var{env:b}=xe.default,we;S("no-color")||S("no-colors")||S("color=false")||S("color=never")?we=0:(S("color")||S("colors")||S("color=true")||S("color=always"))&&(we=1);function Oo(){if("FORCE_COLOR"in b)return b.FORCE_COLOR==="true"?1:b.FORCE_COLOR==="false"?0:b.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(b.FORCE_COLOR,10),3)}function To(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function Co(i,{streamIsTTY:e,sniffFlags:t=!0}={}){let s=Oo();s!==void 0&&(we=s);let r=t?we:s;if(r===0)return 0;if(t){if(S("color=16m")||S("color=full")||S("color=truecolor"))return 3;if(S("color=256"))return 2}if("TF_BUILD"in b&&"AGENT_NAME"in b)return 1;if(i&&!e&&r===void 0)return 0;let n=r||0;if(b.TERM==="dumb")return n;if(xe.default.platform==="win32"){let o=ai.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in b)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in b)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in b)||b.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in b)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(b.TEAMCITY_VERSION)?1:0;if(b.COLORTERM==="truecolor"||b.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in b){let o=Number.parseInt((b.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(b.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(b.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(b.TERM)||"COLORTERM"in b?1:n}function ui(i,e={}){let t=Co(i,{streamIsTTY:i&&i.isTTY,...e});return To(t)}var Mo={stdout:ui({isTTY:Ve.default.isatty(1)}),stderr:ui({isTTY:Ve.default.isatty(2)})},ci=Mo;function di(i,e,t){let s=i.indexOf(e);if(s===-1)return i;let r=e.length,n=0,o="";do o+=i.slice(n,s)+e+t,n=s+r,s=i.indexOf(e,n);while(s!==-1);return o+=i.slice(n),o}function fi(i,e,t,s){let r=0,n="";do{let o=i[s-1]==="\r";n+=i.slice(r,o?s-1:s)+e+(o?`\r
98
- `:`
99
- `)+t,r=s+1,s=i.indexOf(`
100
- `,r)}while(s!==-1);return n+=i.slice(r),n}var{stdout:pi,stderr:mi}=ci,Ye=Symbol("GENERATOR"),Z=Symbol("STYLER"),re=Symbol("IS_EMPTY"),gi=["ansi","ansi","ansi256","ansi16m"],X=Object.create(null),qo=(i,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=pi?pi.level:0;i.level=e.level===void 0?t:e.level};var $o=i=>{let e=(...t)=>t.join(" ");return qo(e,i),Object.setPrototypeOf(e,ne.prototype),e};function ne(i){return $o(i)}Object.setPrototypeOf(ne.prototype,Function.prototype);for(let[i,e]of Object.entries(O))X[i]={get(){let t=Se(this,Be(e.open,e.close,this[Z]),this[re]);return Object.defineProperty(this,i,{value:t}),t}};X.visible={get(){let i=Se(this,this[Z],!0);return Object.defineProperty(this,"visible",{value:i}),i}};var Le=(i,e,t,...s)=>i==="rgb"?e==="ansi16m"?O[t].ansi16m(...s):e==="ansi256"?O[t].ansi256(O.rgbToAnsi256(...s)):O[t].ansi(O.rgbToAnsi(...s)):i==="hex"?Le("rgb",e,t,...O.hexToRgb(...s)):O[t][i](...s),Io=["rgb","hex","ansi256"];for(let i of Io){X[i]={get(){let{level:t}=this;return function(...s){let r=Be(Le(i,gi[t],"color",...s),O.color.close,this[Z]);return Se(this,r,this[re])}}};let e="bg"+i[0].toUpperCase()+i.slice(1);X[e]={get(){let{level:t}=this;return function(...s){let r=Be(Le(i,gi[t],"bgColor",...s),O.bgColor.close,this[Z]);return Se(this,r,this[re])}}}}var _o=Object.defineProperties(()=>{},{...X,level:{enumerable:!0,get(){return this[Ye].level},set(i){this[Ye].level=i}}}),Be=(i,e,t)=>{let s,r;return t===void 0?(s=i,r=e):(s=t.openAll+i,r=e+t.closeAll),{open:i,close:e,openAll:s,closeAll:r,parent:t}},Se=(i,e,t)=>{let s=(...r)=>Po(s,r.length===1?""+r[0]:r.join(" "));return Object.setPrototypeOf(s,_o),s[Ye]=i,s[Z]=e,s[re]=t,s},Po=(i,e)=>{if(i.level<=0||!e)return i[re]?"":e;let t=i[Z];if(t===void 0)return e;let{openAll:s,closeAll:r}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=di(e,t.close,t.open),t=t.parent;let n=e.indexOf(`
101
- `);return n!==-1&&(e=fi(e,r,s,n)),s+e+r};Object.defineProperties(ne.prototype,X);var Eo=ne(),Ju=ne({level:mi?mi.level:0});var D=Eo;var co=B(Wn(),1);var Jn={name:"reactive-vscode",type:"module",version:"0.2.16",description:"Develop VSCode extension with Vue Reactivity API",author:"_Kerman <kermanx@qq.com>",license:"MIT",homepage:"https://github.com/kermanx/reactive-vscode#readme",repository:{type:"git",url:"git+https://github.com/kermanx/reactive-vscode.git"},bugs:"https://github.com/kermanx/reactive-vscode/issues",keywords:["vscode","extension","extension-development","vue","composition-api","reactive","reactivity"],sideEffects:!1,exports:{".":{types:"./src/index.ts",import:"./src/index.ts"}},main:"./src/index.ts",types:"./src/index.ts",files:["README.md","dist"],scripts:{typecheck:"tsc --noEmit",build:"vite build",prepublishOnly:"pnpm typecheck && pnpm build"},peerDependencies:{"@types/vscode":"^1.89.0"},dependencies:{"@reactive-vscode/reactivity":"workspace:*"},devDependencies:{"@types/node":"^20.17.45","@types/vscode":"^1.99.1",typescript:"^5.8.3",vite:"^5.4.19","vite-plugin-dts":"^4.5.3"},publishConfig:{exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"}},main:"./dist/index.cjs",types:"./dist/index.d.ts"}};var zn=`dist
421
+ `),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(s.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:n.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(o.line+s.to(0)+this.outputText))}};t.exports=c}),ft=o((exports,t)=>{t.exports={TextPrompt:Je(),SelectPrompt:Ye(),TogglePrompt:Xe(),DatePrompt:ot(),NumberPrompt:st(),MultiselectPrompt:ct(),AutocompletePrompt:lt(),AutocompleteMultiselectPrompt:ut(),ConfirmPrompt:dt()}}),pt=o(exports=>{let t=exports,n=ft(),r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};let a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));
422
+ /**
423
+ * Interactive auto-complete prompt
424
+ * @param {string} args.message Prompt message to display
425
+ * @param {Array} args.choices Array of auto-complete choices objects `[{ title, value }, ...]`
426
+ * @param {Function} [args.suggest] Function to filter results based on user input. Defaults to sort by `title`
427
+ * @param {number} [args.limit=10] Max number of results to show
428
+ * @param {string} [args.style="default"] Render style ('default', 'password', 'invisible')
429
+ * @param {String} [args.initial] Index of the default value
430
+ * @param {boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input
431
+ * @param {String} [args.fallback] Fallback message - defaults to initial value
432
+ * @param {function} [args.onState] On state change callback
433
+ * @param {Stream} [args.stdin] The Readable stream to listen to
434
+ * @param {Stream} [args.stdout] The Writable stream to write readline data to
435
+ * @returns {Promise} Promise with user input
436
+ */
437
+ t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))}),mt=o((exports,t)=>{let n=pt(),r=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],i=()=>{};
438
+ /**
439
+ * Prompt for a series of questions
440
+ * @param {Array|Object} questions Single question object or Array of question objects
441
+ * @param {Function} [onSubmit] Callback function called on prompt submit
442
+ * @param {Function} [onCancel] Callback function called on cancel/abort
443
+ * @returns {Object} Object with values from user input
444
+ */
445
+ async function a(e=[],{onSubmit:t=i,onCancel:s=i}={}){let c={},l=a._override||{};e=[].concat(e);let u,d,f,p,m,h,g=async(e,t,n=!1)=>{if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?await e.format(t,c):t};for(d of e){if({name:p,type:m}=d,typeof m==`function`&&(m=await m(u,{...c},d),d.type=m),!m)continue;for(let e in d){if(r.includes(e))continue;let t=d[e];d[e]=typeof t==`function`?await t(u,{...c},h):t}if(h=d,typeof d.message!=`string`)throw Error(`prompt message is required`);if({name:p,type:m}=d,n[m]===void 0)throw Error(`prompt type (${m}) is not defined`);if(l[d.name]!==void 0&&(u=await g(d,l[d.name]),u!==void 0)){c[p]=u;continue}try{u=a._injected?o(a._injected,d.initial):await n[m](d),c[p]=u=await g(d,u,!0),f=await t(d,u,c)}catch{f=!await s(d,c)}if(f)return c}return c}function o(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function s(e){a._injected=(a._injected||[]).concat(e)}function c(e){a._override=Object.assign({},e)}t.exports=Object.assign(a,{prompt:a,prompts:n,inject:s,override:c})}),ht=o((exports,t)=>{function n(e){e=(Array.isArray(e)?e:e.split(`.`)).map(Number);let t=0,n=process.versions.node.split(`.`).map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}t.exports=n(`8.6.0`)?Be():mt()}),gt=`reactive-vscode`,_t=`module`,vt=`0.2.17`,yt=`Develop VSCode extension with Vue Reactivity API`,bt=`_Kerman <kermanx@qq.com>`,xt=`MIT`,St=`https://github.com/kermanx/reactive-vscode#readme`,Ct={type:`git`,url:`git+https://github.com/kermanx/reactive-vscode.git`},wt=`https://github.com/kermanx/reactive-vscode/issues`,Tt=[`vscode`,`extension`,`extension-development`,`vue`,`composition-api`,`reactive`,`reactivity`],Et=!1,Dt={".":{types:`./src/index.ts`,import:`./src/index.ts`}},Ot=`./src/index.ts`,kt=`./src/index.ts`,At=[`README.md`,`dist`],jt={typecheck:`tsc --noEmit`,build:`vite build`,prepublishOnly:`pnpm typecheck && pnpm build`},Mt={"@types/vscode":`^1.89.0`},Nt={"@reactive-vscode/reactivity":`workspace:*`},Pt={"@types/node":`^20.17.45`,"@types/vscode":`^1.99.1`,typescript:`^5.8.3`,vite:`^5.4.19`,"vite-plugin-dts":`^4.5.3`},Ft={exports:{".":{types:`./dist/index.d.ts`,import:`./dist/index.js`,require:`./dist/index.cjs`}},main:`./dist/index.cjs`,types:`./dist/index.d.ts`},It={name:gt,type:_t,version:vt,description:yt,author:bt,license:xt,homepage:St,repository:Ct,bugs:wt,keywords:Tt,sideEffects:Et,exports:Dt,main:Ot,types:kt,files:At,scripts:jt,peerDependencies:Mt,dependencies:Nt,devDependencies:Pt,publishConfig:Ft},Lt=`dist
102
446
  node_modules
103
- `;var Kn=`{
447
+ `,Rt=`{
104
448
  "version": "0.2.0",
105
449
  "configurations": [
106
450
  {
@@ -116,10 +460,10 @@ node_modules
116
460
  }
117
461
  ]
118
462
  }
119
- `;var Zn=(i,e,t,s)=>`{
120
- "publisher": "${i}",
121
- "name": "${e}",
122
- "displayName": "${t}",
463
+ `,zt=(e,t,n,r)=>`{
464
+ "publisher": "${e}",
465
+ "name": "${t}",
466
+ "displayName": "${n}",
123
467
  "type": "module",
124
468
  "version": "0.0.1",
125
469
  "private": true,
@@ -136,14 +480,14 @@ node_modules
136
480
  "contributes": {
137
481
  "commands": [
138
482
  {
139
- "command": "${e}.helloWorld",
483
+ "command": "${t}.helloWorld",
140
484
  "title": "Hello World"
141
485
  }
142
486
  ],
143
487
  "configuration": {
144
- "title": "${t}",
488
+ "title": "${n}",
145
489
  "properties": {
146
- "${e}.message": {
490
+ "${t}.message": {
147
491
  "type": "string",
148
492
  "default": "Hello World",
149
493
  "description": "The message to show in the notification"
@@ -152,22 +496,22 @@ node_modules
152
496
  }
153
497
  },
154
498
  "scripts": {
155
- "build": "tsup --env.NODE_ENV production --treeshake",
156
- "dev": "tsup --watch ./src --env.NODE_ENV development",
499
+ "build": "tsdown --env.NODE_ENV production",
500
+ "dev": "tsdown --watch ./src --env.NODE_ENV development",
157
501
  "typecheck": "tsc --noEmit",
158
502
  "vscode:prepublish": "pnpm run build"
159
503
  },
160
504
  "devDependencies": {
161
505
  "@types/node": "18.x",
162
506
  "@types/vscode": "^1.89.0",
163
- "reactive-vscode": "${s}",
164
- "tsup": "^8.0.2",
507
+ "reactive-vscode": "${r}",
508
+ "tsdown": "^0.11.5",
165
509
  "typescript": "^5.4.5"
166
510
  }
167
511
  }
168
- `;var Xn=(i,e,t)=>`# ${t}
512
+ `,Bt=(e,t,n)=>`# ${n}
169
513
 
170
- [![Version](https://img.shields.io/visual-studio-marketplace/v/${i}.${e})](https://marketplace.visualstudio.com/items?itemName=${i}.${e}) [![Installs](https://img.shields.io/visual-studio-marketplace/i/${i}.${e})](https://marketplace.visualstudio.com/items?itemName=${i}.${e}) [![Reactive VSCode](https://img.shields.io/badge/Reactive-VSCode-%23007ACC?style=flat&labelColor=%23229863)](https://kermanx.github.io/reactive-vscode/)
514
+ [![Version](https://img.shields.io/visual-studio-marketplace/v/${e}.${t})](https://marketplace.visualstudio.com/items?itemName=${e}.${t}) [![Installs](https://img.shields.io/visual-studio-marketplace/i/${e}.${t})](https://marketplace.visualstudio.com/items?itemName=${e}.${t}) [![Reactive VSCode](https://img.shields.io/badge/Reactive-VSCode-%23007ACC?style=flat&labelColor=%23229863)](https://kermanx.github.io/reactive-vscode/)
171
515
 
172
516
  A VS Code extension created with [Reactive VS Code](https://kermanx.github.io/reactive-vscode/).
173
517
 
@@ -196,7 +540,7 @@ A VS Code extension created with [Reactive VS Code](https://kermanx.github.io/re
196
540
  * [Follow UX guidelines](https://code.visualstudio.com/api/ux-guidelines/overview) to create extensions that seamlessly integrate with VS Code's native interface and patterns.
197
541
  * [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VS Code extension marketplace.
198
542
  * Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration).
199
- `;var Qn=(i,e)=>({extension:`import { defineExtension, useCommand, useIsDarkTheme, watchEffect } from 'reactive-vscode'
543
+ `,Vt=(e,t)=>({extension:`import { defineExtension, useCommand, useIsDarkTheme, watchEffect } from 'reactive-vscode'
200
544
  import { window } from 'vscode'
201
545
  import { message } from './configs'
202
546
  import { logger } from './utils'
@@ -204,7 +548,7 @@ import { logger } from './utils'
204
548
  export = defineExtension(() => {
205
549
  logger.info('Extension Activated')
206
550
 
207
- useCommand('${i}.helloWorld', () => {
551
+ useCommand('${e}.helloWorld', () => {
208
552
  window.showInformationMessage(message.value)
209
553
  })
210
554
 
@@ -215,13 +559,13 @@ export = defineExtension(() => {
215
559
  })
216
560
  `,configs:`import { defineConfigs } from 'reactive-vscode'
217
561
 
218
- export const { message } = defineConfigs('${i}', {
562
+ export const { message } = defineConfigs('${e}', {
219
563
  message: 'string',
220
564
  })
221
565
  `,utils:`import { defineLogger } from 'reactive-vscode'
222
566
 
223
- export const logger = defineLogger('${e}')
224
- `});var eo=`{
567
+ export const logger = defineLogger('${t}')
568
+ `}),Ht=`{
225
569
  "compilerOptions": {
226
570
  "target": "ES2022",
227
571
  "lib": ["ES2022"],
@@ -233,19 +577,18 @@ export const logger = defineLogger('${e}')
233
577
  "esModuleInterop": true
234
578
  }
235
579
  }
236
- `;var to=`import { defineConfig } from 'tsup'
580
+ `,Ut=`import { defineConfig } from 'tsdown'
237
581
 
238
582
  export default defineConfig({
239
583
  entry: ['src/extension.ts'],
240
584
  format: ['cjs'],
241
585
  target: 'node18',
242
- clean: true,
243
586
  minify: true,
244
587
  external: [
245
588
  'vscode',
246
589
  ],
247
590
  })
248
- `;var io=`.vscode/**
591
+ `,Wt=`.vscode/**
249
592
  .vscode-test/**
250
593
  src/**
251
594
  .gitignore
@@ -255,4 +598,4 @@ src/**
255
598
  **/*.map
256
599
  **/*.ts
257
600
  **/.vscode-test.*
258
- `;function so(i,e,t){function s(r){let n=r/i.length;return e.map((l,h)=>{let a=t[h];return Math.round(l+(a-l)*n)})}return i.split("").map((r,n)=>{let o=s(n);return D.rgb(...o)(r)}).join("")}var ro=[34,152,99],no=[31,156,240],oo=[so("Reactive VSCode",ro,no),D.gray("-"),so("Develop VSCode Extension with Vue Composition API",no,ro)].join(" ");var ho=B(require("process"),1),lo=ho.default.env.npm_config_user_agent??"",Ne=/pnpm/.test(lo)?"pnpm":/yarn/.test(lo)?"yarn":"npm",uo=Ne==="npm"?"npm run":Ne;function ti(i){return/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(i)}function ao(i){return i.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z0-9-~]+/g,"-")}async function Fu(){console.log(),console.log(oo),console.log();let i=be.default.cwd(),e=be.default.argv.slice(2).filter(l=>/^[\w\- ]+$/.test(l)).map(l=>l.trim()).join(" ")||"Your Extension",t="",s="",r="";await(0,co.default)([{name:"displayName",type:"text",message:"What's the display name of your extension?",initial:e,onState:l=>e=l.value||e},{name:"identifier",type:"text",message:"What's the package name of your extension?",initial:()=>s=ao(e),validate:l=>ti(l)||"Invalid package.json name",onState:l=>s=l.value||s},{name:"publisher",type:"text",message:"What's your publisher name?",initial:t,validate:l=>ti(l)||"Invalid publisher name",onState:l=>t=l.value||t},{name:"targetDir",type:"text",message:"Which directory do you want to scaffold the project in?",initial:()=>r=s,validate:l=>!x.default.existsSync(ii.default.resolve(i,l))||"Target directory already exists, please choose another name",onState:l=>r=l.value||r}],{onCancel:()=>{console.log(),console.log(`${D.red("\xD7")} Aborted.`),console.log(),be.default.exit(1)}});let n=ii.default.resolve(i,r);console.log(),console.log(`Scaffolding project in ${n}...`),x.default.mkdirSync(n,{recursive:!0}),be.default.chdir(n),x.default.writeFileSync("package.json",Zn(t,s,e,`^${Jn.version}`)),x.default.writeFileSync("tsconfig.json",eo),x.default.writeFileSync(".gitignore",zn),x.default.writeFileSync(".vscodeignore",io),x.default.writeFileSync("tsup.config.ts",to),x.default.writeFileSync("README.md",Xn(t,s,e)),x.default.mkdirSync("src");let o=Qn(s,e);for(let[l,h]of Object.entries(o))x.default.writeFileSync(`src/${l}.ts`,h);x.default.mkdirSync(".vscode"),x.default.writeFileSync(".vscode/launch.json",Kn),console.log(),console.log("Done. Now run:"),console.log(),console.log(D.bold.green(` cd ${r}`)),console.log(D.bold.green(` ${Ne} install`)),console.log(D.bold.green(" code .")),console.log(D.bold.green(` ${uo} dev`)),console.log()}Fu();
601
+ `;function Gt(e,t,n){function r(r){let i=r/e.length,a=t.map((e,t)=>{let r=n[t],a=Math.round(e+(r-e)*i);return a});return a}return e.split(``).map((e,t)=>{let n=r(t);return B.rgb(...n)(e)}).join(``)}const Kt=[34,152,99],qt=[31,156,240],Jt=[Gt(`Reactive VSCode`,Kt,qt),B.gray(`-`),Gt(`Develop VSCode Extension with Vue Composition API`,qt,Kt)].join(` `),Yt=d.default.env.npm_config_user_agent??``,$=/pnpm/.test(Yt)?`pnpm`:/yarn/.test(Yt)?`yarn`:`npm`,Xt=$===`npm`?`npm run`:$;function Zt(e){return/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(e)}function Qt(e){return e.trim().toLowerCase().replace(/\s+/g,`-`).replace(/^[._]/,``).replace(/[^a-z0-9-~]+/g,`-`)}var $t=c(ht(),1);async function en(){console.log(),console.log(Jt),console.log();let e=d.default.cwd(),t=d.default.argv.slice(2).filter(e=>/^[\w\- ]+$/.test(e)).map(e=>e.trim()).join(` `)||`Your Extension`,n=``,r=``,i=``;await(0,$t.default)([{name:`displayName`,type:`text`,message:`What's the display name of your extension?`,initial:t,onState:e=>t=e.value||t},{name:`identifier`,type:`text`,message:`What's the package name of your extension?`,initial:()=>r=Qt(t),validate:e=>Zt(e)||`Invalid package.json name`,onState:e=>r=e.value||r},{name:`publisher`,type:`text`,message:`What's your publisher name?`,initial:n,validate:e=>Zt(e)||`Invalid publisher name`,onState:e=>n=e.value||n},{name:`targetDir`,type:`text`,message:`Which directory do you want to scaffold the project in?`,initial:()=>i=r,validate:t=>!l.default.existsSync(u.default.resolve(e,t))||`Target directory already exists, please choose another name`,onState:e=>i=e.value||i}],{onCancel:()=>{console.log(),console.log(`${B.red(`×`)} Aborted.`),console.log(),d.default.exit(1)}});let a=u.default.resolve(e,i);console.log(),console.log(`Scaffolding project in ${a}...`),l.default.mkdirSync(a,{recursive:!0}),d.default.chdir(a),l.default.writeFileSync(`package.json`,zt(n,r,t,`^${It.version}`)),l.default.writeFileSync(`tsconfig.json`,Ht),l.default.writeFileSync(`.gitignore`,Lt),l.default.writeFileSync(`.vscodeignore`,Wt),l.default.writeFileSync(`tsdown.config.ts`,Ut),l.default.writeFileSync(`README.md`,Bt(n,r,t)),l.default.mkdirSync(`src`);let o=Vt(r,t);for(let[e,t]of Object.entries(o))l.default.writeFileSync(`src/${e}.ts`,t);l.default.mkdirSync(`.vscode`),l.default.writeFileSync(`.vscode/launch.json`,Rt),console.log(),console.log(`Done. Now run:`),console.log(),console.log(B.bold.green(` cd ${i}`)),console.log(B.bold.green(` ${$} install`)),console.log(B.bold.green(` code .`)),console.log(B.bold.green(` ${Xt} dev`)),console.log()}en();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-reactive-vscode",
3
3
  "type": "module",
4
- "version": "0.2.16",
4
+ "version": "0.2.17",
5
5
  "description": "Reactive-vscode project creator",
6
6
  "author": "_Kerman <kermanx@qq.com>",
7
7
  "license": "MIT",
@@ -28,12 +28,12 @@
28
28
  "@types/prompts": "^2.4.9",
29
29
  "chalk": "^5.4.1",
30
30
  "prompts": "^2.4.2",
31
- "tsup": "^8.4.0",
31
+ "tsdown": "^0.11.5",
32
32
  "typescript": "^5.8.3"
33
33
  },
34
34
  "scripts": {
35
- "dev": "tsup --watch",
36
- "build": "tsup",
35
+ "dev": "tsdown --watch",
36
+ "build": "tsdown",
37
37
  "check": "tsc --noEmit"
38
38
  }
39
39
  }