create-unibest 1.0.1 → 1.2.0

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 (3) hide show
  1. package/README.md +14 -70
  2. package/outfile.cjs +72 -136
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,27 +1,23 @@
1
1
 
2
- <h1 align="center">✨💚create uni💚✨</h1>
2
+ <h1 align="center">✨create unibest✨</h1>
3
3
 
4
4
  <p align="center">
5
- <a href="https://github.com/uni-helper/create-uni/stargazers"><img src="https://img.shields.io/github/stars/uni-helper/create-uni?colorA=363a4f&colorB=b7bdf8&style=for-the-badge"></a>
6
- <a href="https://www.npmjs.com/package/create-uni"><img src="https://img.shields.io/npm/dm/create-uni?colorA=363a4f&colorB=f5a97f&style=for-the-badge"></a>
7
- <a href="https://www.npmjs.com/package/create-uni"><img src="https://img.shields.io/npm/v/create-uni?colorA=363a4f&colorB=a6da95&style=for-the-badge"></a>
5
+ <a href="https://www.npmjs.com/package/create-unibest"><img src="https://img.shields.io/npm/dm/create-unibest?colorA=363a4f&colorB=f5a97f&style=for-the-badge"></a>
6
+ <a href="https://www.npmjs.com/package/create-unibest"><img src="https://img.shields.io/npm/v/create-unibest?colorA=363a4f&colorB=a6da95&style=for-the-badge"></a>
8
7
  </p>
9
8
 
10
9
  <h2 align="center">
11
- <sub>>_ Easy to use create uni▌</sub>
10
+ <sub>>_ Easy to use create unibest▌</sub>
12
11
  </h2>
13
12
 
14
13
  # 📦 使用
15
14
 
16
15
  ```shell
17
- # npm
18
- npm create uni@latest
19
-
20
- # yarn
21
- yarn create uni
22
-
23
16
  # pnpm
24
- pnpm create uni
17
+ pnpm create unibest
18
+
19
+ # npm
20
+ npm create unibest@latest
25
21
  ```
26
22
 
27
23
  > [!TIP]
@@ -29,68 +25,16 @@
29
25
 
30
26
  ## 📖 介绍
31
27
 
32
- `create-uni` 是一个用于快速创建 uni-app 项目的轻量脚手架工具,它可以帮助你快速创建一个基于`vite`和`vue3`的`uni-app`项目,同时提供了一些模板供你选择。
33
-
34
- <p align="center"><img src=".github/image/demo.png"></p>
28
+ `create-unibest` 是一个用于快速创建 `uni-app` 项目的轻量脚手架工具,它可以帮助你快速创建一个基于 `vite` 和 `vue3` 的 `uni-app` 项目,同时提供了一些模板供你选择。
35
29
 
36
30
  ## 🚤 快速使用
37
31
 
38
32
  ```shell
39
- npm create uni <项目名称> --ts -m pinia -m uniUse -u ano -e
33
+ pnpm create uni <项目名称> -t <模板>
40
34
  ```
41
35
 
42
- ### 参数说明
43
-
44
- | 配置项 | 参数 | 别名 | 可选值 |
45
- | :---: | :---: | :---: | :---: |
46
- | Template | —— | t | vitesse |
47
- | TypeScript | ts | —— | —— |
48
- | Plugin | pluginList | p | 见[插件列表](#插件列表) |
49
- | Module | moduleList | m | 见[模块列表](#模块列表) |
50
- | UI | ui | u | uni/ano |
51
- | Eslint | eslint | -e | —— |
52
-
53
- #### 📦插件列表
54
-
55
- | 插件名 | 描述 | 参数名 |
56
- | :---: | :---: | :---: |
57
- | [vite-plugin-uni-components](https://github.com/uni-helper/vite-plugin-uni-components) | 按需自动引入组件 | import |
58
- | [vite-plugin-uni-pages](https://github.com/uni-helper/vite-plugin-uni-pages) | 提供基于文件系统的路由 | pages |
59
- | [vite-plugin-uni-layouts](https://github.com/uni-helper/vite-plugin-uni-layouts) | 提供类 nuxt 的 layouts 系统 | layouts |
60
- | [vite-plugin-uni-manifest](https://github.com/uni-helper/vite-plugin-uni-manifest) | 自动生成 manifest.json 文件 | manifest |
61
- | [vite-plugin-uni-platform](https://github.com/uni-helper/vite-plugin-uni-platform) | 基于文件名 (*.<h5\|mp-weixin\|app>.*) 的按平台编译插件 | filePlatform |
62
- | [vite-plugin-uni-platform-modifier](https://github.com/uni-helper/vite-plugin-uni-platform-modifier) | 为属性、指令提供平台修饰符并按需编译 | platformModifier |
63
- | [vite-plugin-uni-middleware](https://github.com/uni-helper/vite-plugin-uni-middleware) | 使用路由中间件 | middleware |
64
-
65
- #### 📦模块列表
66
-
67
- | 模块名 | 描述 | 参数名 |
68
- | :---: | :---: | :---: |
69
- | [pinia](https://github.com/vuejs/pinia) | 符合直觉的 Vue.js 状态管理库 | pinia |
70
- | [unocss](https://github.com/antfu/unocss) | 即时按需的原子级 CSS 引擎 | unocss |
71
- | [uni-network](https://github.com/uni-helper/uni-network) | 为 uni-app 打造的基于 Promise 的网络请求库 | uniNetwork |
72
- | [uni-use](https://github.com/uni-helper/uni-use) | uni-app 组合式工具集 | uniUse |
73
- | [uni-promises](https://github.com/uni-helper/uni-promises) | 为 uni-app 提供的 Promise 包装器 | uniPromises |
74
-
75
- ## 🤝 参与贡献
76
-
77
- - 提交新功能
78
- - 解决[`issues`](https://github.com/uni-helper/create-uni/issues)
79
- - 提交新[`模板`](./src/question/template/)/[`Plugin`](./src/question/plugin/choices.ts)/[`module`](./src/question/module/choices.ts)/[`UI`](./src/question/UI/)
80
-
81
- ## 🌸 感谢
82
-
83
- 项目灵感及部分代码来自 [create-vue](https://github.com/vuejs/create-vue)
84
-
85
- ## 📄 License
86
-
87
- [MIT LICENSE](./LICENSE)
88
-
89
- ## [Sponsors](https://github.com/FliPPeDround/sponsors)
90
-
91
- <p align="center">
92
- <a href="https://cdn.jsdelivr.net/gh/FliPPeDround/sponsors/sponsorkit/sponsors.svg">
93
- <img alt="sponsors" src="https://cdn.jsdelivr.net/gh/FliPPeDround/sponsors/sponsorkit/sponsors.svg"/>
94
- </a>
95
- </p>
36
+ 目前支持 `base`、`demo`、`i18n` 三种模板。
96
37
 
38
+ - 如果想学习所有的 `demo`,可以通过 `pnpm create unibest my-unibest -t demo` 生成。(包含了所有的 `demo` 和 `i18n` 代码)
39
+ - 如果是新开发一个项目,建议使用 `base` 模板,可以通过 `pnpm create unibest my-unibest -t base` 生成。(不含 `demo` 代码)
40
+ - 如果项目有多语言需求,建议使用 `i18n` 模板,可以通过 `pnpm create unibest my-unibest -t i18n` 生成。(不含 `demo` 代码)
package/outfile.cjs CHANGED
@@ -1,164 +1,100 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var ko=Object.create;var qr=Object.defineProperty;var Uo=Object.getOwnPropertyDescriptor;var Wo=Object.getOwnPropertyNames;var Go=Object.getPrototypeOf,Jo=Object.prototype.hasOwnProperty;var a=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var zo=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Wo(e))!Jo.call(r,s)&&s!==t&&qr(r,s,{get:()=>e[s],enumerable:!(i=Uo(e,s))||i.enumerable});return r};var D=(r,e,t)=>(t=r!=null?ko(Go(r)):{},zo(e||!r||!r.__esModule?qr(t,"default",{value:r,enumerable:!0}):t,r));var Pr=a(H=>{"use strict";var Zo=/[|\\{}()[\]^$+*?.]/g,Xo=Object.prototype.hasOwnProperty,Er=function(r,e){return Xo.apply(r,[e])};H.escapeRegExpChars=function(r){return r?String(r).replace(Zo,"\\$&"):""};var Ko={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},Qo=/[&<>'"]/g;function el(r){return Ko[r]||r}var tl=`var _ENCODE_HTML_RULES = {
3
- "&": "&amp;"
4
- , "<": "&lt;"
5
- , ">": "&gt;"
6
- , '"': "&#34;"
7
- , "'": "&#39;"
8
- }
9
- , _MATCH_HTML = /[&<>'"]/g;
10
- function encode_char(c) {
11
- return _ENCODE_HTML_RULES[c] || c;
12
- };
13
- `;H.escapeXML=function(r){return r==null?"":String(r).replace(Qo,el)};function Mr(){return Function.prototype.toString.call(this)+`;
14
- `+tl}try{typeof Object.defineProperty=="function"?Object.defineProperty(H.escapeXML,"toString",{value:Mr}):H.escapeXML.toString=Mr}catch{console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}H.shallowCopy=function(r,e){if(e=e||{},r!=null)for(var t in e)Er(e,t)&&(t==="__proto__"||t==="constructor"||(r[t]=e[t]));return r};H.shallowCopyFromList=function(r,e,t){if(t=t||[],e=e||{},r!=null)for(var i=0;i<t.length;i++){var s=t[i];if(typeof e[s]<"u"){if(!Er(e,s)||s==="__proto__"||s==="constructor")continue;r[s]=e[s]}}return r};H.cache={_data:{},set:function(r,e){this._data[r]=e},get:function(r){return this._data[r]},remove:function(r){delete this._data[r]},reset:function(){this._data={}}};H.hyphenToCamel=function(r){return r.replace(/-[a-z]/g,function(e){return e[1].toUpperCase()})};H.createNullProtoObjWherePossible=function(){return typeof Object.create=="function"?function(){return Object.create(null)}:{__proto__:null}instanceof Object?function(){return{}}:function(){return{__proto__:null}}}()});var Cr=a((Ta,rl)=>{rl.exports={name:"ejs",description:"Embedded JavaScript templates",keywords:["template","engine","ejs"],version:"3.1.9",author:"Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",license:"Apache-2.0",bin:{ejs:"./bin/cli.js"},main:"./lib/ejs.js",jsdelivr:"ejs.min.js",unpkg:"ejs.min.js",repository:{type:"git",url:"git://github.com/mde/ejs.git"},bugs:"https://github.com/mde/ejs/issues",homepage:"https://github.com/mde/ejs",dependencies:{jake:"^10.8.5"},devDependencies:{browserify:"^16.5.1",eslint:"^6.8.0","git-directory-deploy":"^1.5.1",jsdoc:"^4.0.2","lru-cache":"^4.0.1",mocha:"^10.2.0","uglify-js":"^3.3.16"},engines:{node:">=0.10.0"},scripts:{test:"mocha -u tdd"}}});var Hr=a(v=>{"use strict";var ot=require("fs"),xe=require("path"),$=Pr(),Ir=!1,il=Cr().version,sl="<",nl=">",ol="%",Fr="locals",ll="ejs",hl="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",Nr=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],ul=Nr.concat("cache"),Dr=/^\uFEFF/,nt=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/;v.cache=$.cache;v.fileLoader=ot.readFileSync;v.localsName=Fr;v.promiseImpl=new Function("return this;")().Promise;v.resolveInclude=function(r,e,t){var i=xe.dirname,s=xe.extname,n=xe.resolve,o=n(t?e:i(e),r),l=s(r);return l||(o+=".ejs"),o};function Ar(r,e){var t;if(e.some(function(i){return t=v.resolveInclude(r,i,!0),ot.existsSync(t)}))return t}function al(r,e){var t,i,s=e.views,n=/^[A-Za-z]+:\\|^\//.exec(r);if(n&&n.length)r=r.replace(/^\/*/,""),Array.isArray(e.root)?t=Ar(r,e.root):t=v.resolveInclude(r,e.root||"/",!0);else if(e.filename&&(i=v.resolveInclude(r,e.filename),ot.existsSync(i)&&(t=i)),!t&&Array.isArray(s)&&(t=Ar(r,s)),!t&&typeof e.includer!="function")throw new Error('Could not find the include file "'+e.escapeFunction(r)+'"');return t}function Se(r,e){var t,i=r.filename,s=arguments.length>1;if(r.cache){if(!i)throw new Error("cache option requires a filename");if(t=v.cache.get(i),t)return t;s||(e=jr(i).toString().replace(Dr,""))}else if(!s){if(!i)throw new Error("Internal EJS error: no file name or template provided");e=jr(i).toString().replace(Dr,"")}return t=v.compile(e,r),r.cache&&v.cache.set(i,t),t}function cl(r,e,t){var i;if(t){try{i=Se(r)(e)}catch(s){return t(s)}t(null,i)}else{if(typeof v.promiseImpl=="function")return new v.promiseImpl(function(s,n){try{i=Se(r)(e),s(i)}catch(o){n(o)}});throw new Error("Please provide a callback function")}}function jr(r){return v.fileLoader(r)}function dl(r,e){var t=$.shallowCopy($.createNullProtoObjWherePossible(),e);if(t.filename=al(r,t),typeof e.includer=="function"){var i=e.includer(r,t.filename);if(i&&(i.filename&&(t.filename=i.filename),i.template))return Se(t,i.template)}return Se(t)}function Lr(r,e,t,i,s){var n=e.split(`
15
- `),o=Math.max(i-3,0),l=Math.min(n.length,i+3),h=s(t),u=n.slice(o,l).map(function(E,d){var c=d+o+1;return(c==i?" >> ":" ")+c+"| "+E}).join(`
16
- `);throw r.path=h,r.message=(h||"ejs")+":"+i+`
17
- `+u+`
18
-
19
- `+r.message,r}function Rr(r){return r.replace(/;(\s*$)/,"$1")}v.compile=function(e,t){var i;return t&&t.scope&&(Ir||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),Ir=!0),t.context||(t.context=t.scope),delete t.scope),i=new M(e,t),i.compile()};v.render=function(r,e,t){var i=e||$.createNullProtoObjWherePossible(),s=t||$.createNullProtoObjWherePossible();return arguments.length==2&&$.shallowCopyFromList(s,i,Nr),Se(s,r)(i)};v.renderFile=function(){var r=Array.prototype.slice.call(arguments),e=r.shift(),t,i={filename:e},s,n;return typeof arguments[arguments.length-1]=="function"&&(t=r.pop()),r.length?(s=r.shift(),r.length?$.shallowCopy(i,r.pop()):(s.settings&&(s.settings.views&&(i.views=s.settings.views),s.settings["view cache"]&&(i.cache=!0),n=s.settings["view options"],n&&$.shallowCopy(i,n)),$.shallowCopyFromList(i,s,ul)),i.filename=e):s=$.createNullProtoObjWherePossible(),cl(i,s,t)};v.Template=M;v.clearCache=function(){v.cache.reset()};function M(r,e){e=e||$.createNullProtoObjWherePossible();var t=$.createNullProtoObjWherePossible();this.templateText=r,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",t.client=e.client||!1,t.escapeFunction=e.escape||e.escapeFunction||$.escapeXML,t.compileDebug=e.compileDebug!==!1,t.debug=!!e.debug,t.filename=e.filename,t.openDelimiter=e.openDelimiter||v.openDelimiter||sl,t.closeDelimiter=e.closeDelimiter||v.closeDelimiter||nl,t.delimiter=e.delimiter||v.delimiter||ol,t.strict=e.strict||!1,t.context=e.context,t.cache=e.cache||!1,t.rmWhitespace=e.rmWhitespace,t.root=e.root,t.includer=e.includer,t.outputFunctionName=e.outputFunctionName,t.localsName=e.localsName||v.localsName||Fr,t.views=e.views,t.async=e.async,t.destructuredLocals=e.destructuredLocals,t.legacyInclude=typeof e.legacyInclude<"u"?!!e.legacyInclude:!0,t.strict?t._with=!1:t._with=typeof e._with<"u"?e._with:!0,this.opts=t,this.regex=this.createRegex()}M.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};M.prototype={createRegex:function(){var r=hl,e=$.escapeRegExpChars(this.opts.delimiter),t=$.escapeRegExpChars(this.opts.openDelimiter),i=$.escapeRegExpChars(this.opts.closeDelimiter);return r=r.replace(/%/g,e).replace(/</g,t).replace(/>/g,i),new RegExp(r)},compile:function(){var r,e,t=this.opts,i="",s="",n=t.escapeFunction,o,l=t.filename?JSON.stringify(t.filename):"undefined";if(!this.source){if(this.generateSource(),i+=` var __output = "";
20
- function __append(s) { if (s !== undefined && s !== null) __output += s }
21
- `,t.outputFunctionName){if(!nt.test(t.outputFunctionName))throw new Error("outputFunctionName is not a valid JS identifier.");i+=" var "+t.outputFunctionName+` = __append;
22
- `}if(t.localsName&&!nt.test(t.localsName))throw new Error("localsName is not a valid JS identifier.");if(t.destructuredLocals&&t.destructuredLocals.length){for(var h=" var __locals = ("+t.localsName+` || {}),
23
- `,u=0;u<t.destructuredLocals.length;u++){var E=t.destructuredLocals[u];if(!nt.test(E))throw new Error("destructuredLocals["+u+"] is not a valid JS identifier.");u>0&&(h+=`,
24
- `),h+=E+" = __locals."+E}i+=h+`;
25
- `}t._with!==!1&&(i+=" with ("+t.localsName+` || {}) {
26
- `,s+=` }
27
- `),s+=` return __output;
28
- `,this.source=i+this.source+s}t.compileDebug?r=`var __line = 1
29
- , __lines = `+JSON.stringify(this.templateText)+`
30
- , __filename = `+l+`;
31
- try {
32
- `+this.source+`} catch (e) {
33
- rethrow(e, __lines, __filename, __line, escapeFn);
34
- }
35
- `:r=this.source,t.client&&(r="escapeFn = escapeFn || "+n.toString()+`;
36
- `+r,t.compileDebug&&(r="rethrow = rethrow || "+Lr.toString()+`;
37
- `+r)),t.strict&&(r=`"use strict";
38
- `+r),t.debug&&console.log(r),t.compileDebug&&t.filename&&(r=r+`
39
- //# sourceURL=`+l+`
40
- `);try{if(t.async)try{o=new Function("return (async function(){}).constructor;")()}catch(g){throw g instanceof SyntaxError?new Error("This environment does not support async/await"):g}else o=Function;e=new o(t.localsName+", escapeFn, include, rethrow",r)}catch(g){throw g instanceof SyntaxError&&(t.filename&&(g.message+=" in "+t.filename),g.message+=` while compiling ejs
41
-
42
- `,g.message+=`If the above error is not helpful, you may want to try EJS-Lint:
43
- `,g.message+="https://github.com/RyanZim/EJS-Lint",t.async||(g.message+=`
44
- `,g.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),g}var d=t.client?e:function(re){var I=function(x,L){var T=$.shallowCopy($.createNullProtoObjWherePossible(),re);return L&&(T=$.shallowCopy(T,L)),dl(x,t)(T)};return e.apply(t.context,[re||$.createNullProtoObjWherePossible(),n,I,Lr])};if(t.filename&&typeof Object.defineProperty=="function"){var c=t.filename,p=xe.basename(c,xe.extname(c));try{Object.defineProperty(d,"name",{value:p,writable:!1,enumerable:!1,configurable:!0})}catch{}}return d},generateSource:function(){var r=this.opts;r.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,`
45
- `).replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var e=this,t=this.parseTemplateText(),i=this.opts.delimiter,s=this.opts.openDelimiter,n=this.opts.closeDelimiter;t&&t.length&&t.forEach(function(o,l){var h;if(o.indexOf(s+i)===0&&o.indexOf(s+i+i)!==0&&(h=t[l+2],!(h==i+n||h=="-"+i+n||h=="_"+i+n)))throw new Error('Could not find matching close tag for "'+o+'".');e.scanLine(o)})},parseTemplateText:function(){for(var r=this.templateText,e=this.regex,t=e.exec(r),i=[],s;t;)s=t.index,s!==0&&(i.push(r.substring(0,s)),r=r.slice(s)),i.push(t[0]),r=r.slice(t[0].length),t=e.exec(r);return r&&i.push(r),i},_addOutput:function(r){if(this.truncate&&(r=r.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!r)return r;r=r.replace(/\\/g,"\\\\"),r=r.replace(/\n/g,"\\n"),r=r.replace(/\r/g,"\\r"),r=r.replace(/"/g,'\\"'),this.source+=' ; __append("'+r+`")
46
- `},scanLine:function(r){var e=this,t=this.opts.delimiter,i=this.opts.openDelimiter,s=this.opts.closeDelimiter,n=0;switch(n=r.split(`
47
- `).length-1,r){case i+t:case i+t+"_":this.mode=M.modes.EVAL;break;case i+t+"=":this.mode=M.modes.ESCAPED;break;case i+t+"-":this.mode=M.modes.RAW;break;case i+t+"#":this.mode=M.modes.COMMENT;break;case i+t+t:this.mode=M.modes.LITERAL,this.source+=' ; __append("'+r.replace(i+t+t,i+t)+`")
48
- `;break;case t+t+s:this.mode=M.modes.LITERAL,this.source+=' ; __append("'+r.replace(t+t+s,t+s)+`")
49
- `;break;case t+s:case"-"+t+s:case"_"+t+s:this.mode==M.modes.LITERAL&&this._addOutput(r),this.mode=null,this.truncate=r.indexOf("-")===0||r.indexOf("_")===0;break;default:if(this.mode){switch(this.mode){case M.modes.EVAL:case M.modes.ESCAPED:case M.modes.RAW:r.lastIndexOf("//")>r.lastIndexOf(`
50
- `)&&(r+=`
51
- `)}switch(this.mode){case M.modes.EVAL:this.source+=" ; "+r+`
52
- `;break;case M.modes.ESCAPED:this.source+=" ; __append(escapeFn("+Rr(r)+`))
53
- `;break;case M.modes.RAW:this.source+=" ; __append("+Rr(r)+`)
54
- `;break;case M.modes.COMMENT:break;case M.modes.LITERAL:this._addOutput(r);break}}else this._addOutput(r)}e.opts.compileDebug&&n&&(this.currentLine+=n,this.source+=" ; __line = "+this.currentLine+`
55
- `)}};v.escapeXML=$.escapeXML;v.__express=v.renderFile;v.VERSION=il;v.name=ll;typeof window<"u"&&(window.ejs=v)});var Wr=a((ac,Ur)=>{"use strict";function fl(r,e){var t=r;e.slice(0,-1).forEach(function(s){t=t[s]||{}});var i=e[e.length-1];return i in t}function Vr(r){return typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function kr(r,e){return e==="constructor"&&typeof r[e]=="function"||e==="__proto__"}Ur.exports=function(r,e){e||(e={});var t={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(t.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?t.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(m){t.bools[m]=!0});var i={};function s(m){return i[m].some(function(q){return t.bools[q]})}Object.keys(e.alias||{}).forEach(function(m){i[m]=[].concat(e.alias[m]),i[m].forEach(function(q){i[q]=[m].concat(i[m].filter(function(G){return q!==G}))})}),[].concat(e.string).filter(Boolean).forEach(function(m){t.strings[m]=!0,i[m]&&[].concat(i[m]).forEach(function(q){t.strings[q]=!0})});var n=e.default||{},o={_:[]};function l(m,q){return t.allBools&&/^--[^=]+$/.test(q)||t.strings[m]||t.bools[m]||i[m]}function h(m,q,G){for(var w=m,ye=0;ye<q.length-1;ye++){var N=q[ye];if(kr(w,N))return;w[N]===void 0&&(w[N]={}),(w[N]===Object.prototype||w[N]===Number.prototype||w[N]===String.prototype)&&(w[N]={}),w[N]===Array.prototype&&(w[N]=[]),w=w[N]}var J=q[q.length-1];kr(w,J)||((w===Object.prototype||w===Number.prototype||w===String.prototype)&&(w={}),w===Array.prototype&&(w=[]),w[J]===void 0||t.bools[J]||typeof w[J]=="boolean"?w[J]=G:Array.isArray(w[J])?w[J].push(G):w[J]=[w[J],G])}function u(m,q,G){if(!(G&&t.unknownFn&&!l(m,G)&&t.unknownFn(G)===!1)){var w=!t.strings[m]&&Vr(q)?Number(q):q;h(o,m.split("."),w),(i[m]||[]).forEach(function(ye){h(o,ye.split("."),w)})}}Object.keys(t.bools).forEach(function(m){u(m,n[m]===void 0?!1:n[m])});var E=[];r.indexOf("--")!==-1&&(E=r.slice(r.indexOf("--")+1),r=r.slice(0,r.indexOf("--")));for(var d=0;d<r.length;d++){var c=r[d],p,g;if(/^--.+=/.test(c)){var re=c.match(/^--([^=]+)=([\s\S]*)$/);p=re[1];var I=re[2];t.bools[p]&&(I=I!=="false"),u(p,I,c)}else if(/^--no-.+/.test(c))p=c.match(/^--no-(.+)/)[1],u(p,!1,c);else if(/^--.+/.test(c))p=c.match(/^--(.+)/)[1],g=r[d+1],g!==void 0&&!/^(-|--)[^-]/.test(g)&&!t.bools[p]&&!t.allBools&&(!i[p]||!s(p))?(u(p,g,c),d+=1):/^(true|false)$/.test(g)?(u(p,g==="true",c),d+=1):u(p,t.strings[p]?"":!0,c);else if(/^-[^-]+/.test(c)){for(var x=c.slice(1,-1).split(""),L=!1,T=0;T<x.length;T++){if(g=c.slice(T+2),g==="-"){u(x[T],g,c);continue}if(/[A-Za-z]/.test(x[T])&&g[0]==="="){u(x[T],g.slice(1),c),L=!0;break}if(/[A-Za-z]/.test(x[T])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(g)){u(x[T],g,c),L=!0;break}if(x[T+1]&&x[T+1].match(/\W/)){u(x[T],c.slice(T+2),c),L=!0;break}else u(x[T],t.strings[x[T]]?"":!0,c)}p=c.slice(-1)[0],!L&&p!=="-"&&(r[d+1]&&!/^(-|--)[^-]/.test(r[d+1])&&!t.bools[p]&&(!i[p]||!s(p))?(u(p,r[d+1],c),d+=1):r[d+1]&&/^(true|false)$/.test(r[d+1])?(u(p,r[d+1]==="true",c),d+=1):u(p,t.strings[p]?"":!0,c))}else if((!t.unknownFn||t.unknownFn(c)!==!1)&&o._.push(t.strings._||!Vr(c)?c:Number(c)),e.stopEarly){o._.push.apply(o._,r.slice(d+1));break}}return Object.keys(n).forEach(function(m){fl(o,m.split("."))||(h(o,m.split("."),n[m]),(i[m]||[]).forEach(function(q){h(o,q.split("."),n[m])}))}),e["--"]?o["--"]=E.slice():E.forEach(function(m){o._.push(m)}),o}});var S=a((cc,Jr)=>{"use strict";var{FORCE_COLOR:pl,NODE_DISABLE_COLORS:ml,TERM:gl}=process.env,b={enabled:!ml&&gl!=="dumb"&&pl!=="0",reset:y(0,0),bold:y(1,22),dim:y(2,22),italic:y(3,23),underline:y(4,24),inverse:y(7,27),hidden:y(8,28),strikethrough:y(9,29),black:y(30,39),red:y(31,39),green:y(32,39),yellow:y(33,39),blue:y(34,39),magenta:y(35,39),cyan:y(36,39),white:y(37,39),gray:y(90,39),grey:y(90,39),bgBlack:y(40,49),bgRed:y(41,49),bgGreen:y(42,49),bgYellow:y(43,49),bgBlue:y(44,49),bgMagenta:y(45,49),bgCyan:y(46,49),bgWhite:y(47,49)};function Gr(r,e){let t=0,i,s="",n="";for(;t<r.length;t++)i=r[t],s+=i.open,n+=i.close,e.includes(i.close)&&(e=e.replace(i.rgx,i.close+i.open));return s+e+n}function vl(r,e){let t={has:r,keys:e};return t.reset=b.reset.bind(t),t.bold=b.bold.bind(t),t.dim=b.dim.bind(t),t.italic=b.italic.bind(t),t.underline=b.underline.bind(t),t.inverse=b.inverse.bind(t),t.hidden=b.hidden.bind(t),t.strikethrough=b.strikethrough.bind(t),t.black=b.black.bind(t),t.red=b.red.bind(t),t.green=b.green.bind(t),t.yellow=b.yellow.bind(t),t.blue=b.blue.bind(t),t.magenta=b.magenta.bind(t),t.cyan=b.cyan.bind(t),t.white=b.white.bind(t),t.gray=b.gray.bind(t),t.grey=b.grey.bind(t),t.bgBlack=b.bgBlack.bind(t),t.bgRed=b.bgRed.bind(t),t.bgGreen=b.bgGreen.bind(t),t.bgYellow=b.bgYellow.bind(t),t.bgBlue=b.bgBlue.bind(t),t.bgMagenta=b.bgMagenta.bind(t),t.bgCyan=b.bgCyan.bind(t),t.bgWhite=b.bgWhite.bind(t),t}function y(r,e){let t={open:`\x1B[${r}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(r)||(this.has.push(r),this.keys.push(t)),i===void 0?this:b.enabled?Gr(this.keys,i+""):i+""):i===void 0?vl([r],[t]):b.enabled?Gr([t],i+""):i+""}}Jr.exports=b});var Zr=a((dc,zr)=>{"use strict";zr.exports=(r,e)=>{if(!(r.meta&&r.name!=="escape")){if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c"||r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(e){if(r.name==="j")return"down";if(r.name==="k")return"up"}return r.name==="return"||r.name==="enter"?"submit":r.name==="backspace"?"delete":r.name==="delete"?"deleteForward":r.name==="abort"?"abort":r.name==="escape"?"exit":r.name==="tab"?"next":r.name==="pagedown"?"nextPage":r.name==="pageup"?"prevPage":r.name==="home"?"home":r.name==="end"?"end":r.name==="up"?"up":r.name==="down"?"down":r.name==="right"?"right":r.name==="left"?"left":!1}}});var Le=a((fc,Xr)=>{"use strict";Xr.exports=r=>{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 r=="string"?r.replace(t,""):r}});var O=a((pc,Kr)=>{"use strict";var lt="\x1B",_=`${lt}[`,bl="\x07",ht={to(r,e){return e?`${_}${e+1};${r+1}H`:`${_}${r+1}G`},move(r,e){let t="";return r<0?t+=`${_}${-r}D`:r>0&&(t+=`${_}${r}C`),e<0?t+=`${_}${-e}A`:e>0&&(t+=`${_}${e}B`),t},up:(r=1)=>`${_}${r}A`,down:(r=1)=>`${_}${r}B`,forward:(r=1)=>`${_}${r}C`,backward:(r=1)=>`${_}${r}D`,nextLine:(r=1)=>`${_}E`.repeat(r),prevLine:(r=1)=>`${_}F`.repeat(r),left:`${_}G`,hide:`${_}?25l`,show:`${_}?25h`,save:`${lt}7`,restore:`${lt}8`},wl={up:(r=1)=>`${_}S`.repeat(r),down:(r=1)=>`${_}T`.repeat(r)},yl={screen:`${_}2J`,up:(r=1)=>`${_}1J`.repeat(r),down:(r=1)=>`${_}J`.repeat(r),line:`${_}2K`,lineEnd:`${_}K`,lineStart:`${_}1K`,lines(r){let e="";for(let t=0;t<r;t++)e+=this.line+(t<r-1?ht.up():"");return r&&(e+=ht.left),e}};Kr.exports={cursor:ht,scroll:wl,erase:yl,beep:bl}});var ii=a((mc,ri)=>{"use strict";function xl(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Sl(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var i=0,s=function(){};return{s,n:function(){return i>=r.length?{done:!0}:{done:!1,value:r[i++]}},e:function(u){throw u},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
56
- 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(r)},n:function(){var u=t.next();return n=u.done,u},e:function(u){o=!0,l=u},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw l}}}}function Sl(r,e){if(r){if(typeof r=="string")return Qr(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Qr(r,e)}}function Qr(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=r[t];return i}var _l=Le(),ti=O(),ei=ti.erase,Ol=ti.cursor,Tl=r=>[..._l(r)].length;ri.exports=function(r,e){if(!e)return ei.line+Ol.to(0);let t=0,i=r.split(/\r?\n/);var s=xl(i),n;try{for(s.s();!(n=s.n()).done;){let o=n.value;t+=1+Math.floor(Math.max(Tl(o)-1,0)/e)}}catch(o){s.e(o)}finally{s.f()}return ei.lines(t)}});var ut=a((gc,si)=>{"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"},$l={arrowUp:Oe.arrowUp,arrowDown:Oe.arrowDown,arrowLeft:Oe.arrowLeft,arrowRight:Oe.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},ql=process.platform==="win32"?$l:Oe;si.exports=ql});var oi=a((vc,ni)=>{"use strict";var me=S(),ce=ut(),at=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"\u{1F603}".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}}),Ml=r=>at[r]||at.default,Te=Object.freeze({aborted:me.red(ce.cross),done:me.green(ce.tick),exited:me.yellow(ce.cross),default:me.cyan("?")}),El=(r,e,t)=>e?Te.aborted:t?Te.exited:r?Te.done:Te.default,Pl=r=>me.gray(r?ce.ellipsis:ce.pointerSmall),Cl=(r,e)=>me.gray(r?e?ce.pointerSmall:"+":ce.line);ni.exports={styles:at,render:Ml,symbols:Te,symbol:El,delimiter:Pl,item:Cl}});var hi=a((bc,li)=>{"use strict";var Il=Le();li.exports=function(r,e){let t=String(Il(r)||"").split(/\r?\n/);return e?t.map(i=>Math.ceil(i.length/e)).reduce((i,s)=>i+s):t.length}});var ai=a((wc,ui)=>{"use strict";ui.exports=(r,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return(r||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=i||n[n.length-1].length+o.length+1<i?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
2
+ "use strict";var yo=Object.create;var bi=Object.defineProperty;var xo=Object.getOwnPropertyDescriptor;var So=Object.getOwnPropertyNames;var Oo=Object.getPrototypeOf,$o=Object.prototype.hasOwnProperty;var a=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var qo=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of So(t))!$o.call(i,s)&&s!==e&&bi(i,s,{get:()=>t[s],enumerable:!(r=xo(t,s))||r.enumerable});return i};var I=(i,t,e)=>(e=i!=null?yo(Oo(i)):{},qo(t||!i||!i.__esModule?bi(e,"default",{value:i,enumerable:!0}):e,i));var Oi=a((xa,Si)=>{"use strict";function To(i,t){var e=i;t.slice(0,-1).forEach(function(s){e=e[s]||{}});var r=t[t.length-1];return r in e}function yi(i){return typeof i=="number"||/^0x[0-9a-f]+$/i.test(i)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(i)}function xi(i,t){return t==="constructor"&&typeof i[t]=="function"||t==="__proto__"}Si.exports=function(i,t){t||(t={});var e={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(e.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?e.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(f){e.bools[f]=!0});var r={};function s(f){return r[f].some(function($){return e.bools[$]})}Object.keys(t.alias||{}).forEach(function(f){r[f]=[].concat(t.alias[f]),r[f].forEach(function($){r[$]=[f].concat(r[f].filter(function(U){return $!==U}))})}),[].concat(t.string).filter(Boolean).forEach(function(f){e.strings[f]=!0,r[f]&&[].concat(r[f]).forEach(function($){e.strings[$]=!0})});var o=t.default||{},n={_:[]};function h(f,$){return e.allBools&&/^--[^=]+$/.test($)||e.strings[f]||e.bools[f]||r[f]}function l(f,$,U){for(var b=f,pt=0;pt<$.length-1;pt++){var j=$[pt];if(xi(b,j))return;b[j]===void 0&&(b[j]={}),(b[j]===Object.prototype||b[j]===Number.prototype||b[j]===String.prototype)&&(b[j]={}),b[j]===Array.prototype&&(b[j]=[]),b=b[j]}var G=$[$.length-1];xi(b,G)||((b===Object.prototype||b===Number.prototype||b===String.prototype)&&(b={}),b===Array.prototype&&(b=[]),b[G]===void 0||e.bools[G]||typeof b[G]=="boolean"?b[G]=U:Array.isArray(b[G])?b[G].push(U):b[G]=[b[G],U])}function u(f,$,U){if(!(U&&e.unknownFn&&!h(f,U)&&e.unknownFn(U)===!1)){var b=!e.strings[f]&&yi($)?Number($):$;l(n,f.split("."),b),(r[f]||[]).forEach(function(pt){l(n,pt.split("."),b)})}}Object.keys(e.bools).forEach(function(f){u(f,o[f]===void 0?!1:o[f])});var S=[];i.indexOf("--")!==-1&&(S=i.slice(i.indexOf("--")+1),i=i.slice(0,i.indexOf("--")));for(var m=0;m<i.length;m++){var c=i[m],p,q;if(/^--.+=/.test(c)){var ft=c.match(/^--([^=]+)=([\s\S]*)$/);p=ft[1];var D=ft[2];e.bools[p]&&(D=D!=="false"),u(p,D,c)}else if(/^--no-.+/.test(c))p=c.match(/^--no-(.+)/)[1],u(p,!1,c);else if(/^--.+/.test(c))p=c.match(/^--(.+)/)[1],q=i[m+1],q!==void 0&&!/^(-|--)[^-]/.test(q)&&!e.bools[p]&&!e.allBools&&(!r[p]||!s(p))?(u(p,q,c),m+=1):/^(true|false)$/.test(q)?(u(p,q==="true",c),m+=1):u(p,e.strings[p]?"":!0,c);else if(/^-[^-]+/.test(c)){for(var O=c.slice(1,-1).split(""),k=!1,T=0;T<O.length;T++){if(q=c.slice(T+2),q==="-"){u(O[T],q,c);continue}if(/[A-Za-z]/.test(O[T])&&q[0]==="="){u(O[T],q.slice(1),c),k=!0;break}if(/[A-Za-z]/.test(O[T])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(q)){u(O[T],q,c),k=!0;break}if(O[T+1]&&O[T+1].match(/\W/)){u(O[T],c.slice(T+2),c),k=!0;break}else u(O[T],e.strings[O[T]]?"":!0,c)}p=c.slice(-1)[0],!k&&p!=="-"&&(i[m+1]&&!/^(-|--)[^-]/.test(i[m+1])&&!e.bools[p]&&(!r[p]||!s(p))?(u(p,i[m+1],c),m+=1):i[m+1]&&/^(true|false)$/.test(i[m+1])?(u(p,i[m+1]==="true",c),m+=1):u(p,e.strings[p]?"":!0,c))}else if((!e.unknownFn||e.unknownFn(c)!==!1)&&n._.push(e.strings._||!yi(c)?c:Number(c)),t.stopEarly){n._.push.apply(n._,i.slice(m+1));break}}return Object.keys(o).forEach(function(f){To(n,f.split("."))||(l(n,f.split("."),o[f]),(r[f]||[]).forEach(function($){l(n,$.split("."),o[f])}))}),t["--"]?n["--"]=S.slice():S.forEach(function(f){n._.push(f)}),n}});var w=a((Sa,qi)=>{"use strict";var{FORCE_COLOR:Mo,NODE_DISABLE_COLORS:Po,TERM:_o}=process.env,g={enabled:!Po&&_o!=="dumb"&&Mo!=="0",reset:v(0,0),bold:v(1,22),dim:v(2,22),italic:v(3,23),underline:v(4,24),inverse:v(7,27),hidden:v(8,28),strikethrough:v(9,29),black:v(30,39),red:v(31,39),green:v(32,39),yellow:v(33,39),blue:v(34,39),magenta:v(35,39),cyan:v(36,39),white:v(37,39),gray:v(90,39),grey:v(90,39),bgBlack:v(40,49),bgRed:v(41,49),bgGreen:v(42,49),bgYellow:v(43,49),bgBlue:v(44,49),bgMagenta:v(45,49),bgCyan:v(46,49),bgWhite:v(47,49)};function $i(i,t){let e=0,r,s="",o="";for(;e<i.length;e++)r=i[e],s+=r.open,o+=r.close,t.includes(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return s+t+o}function Co(i,t){let e={has:i,keys:t};return e.reset=g.reset.bind(e),e.bold=g.bold.bind(e),e.dim=g.dim.bind(e),e.italic=g.italic.bind(e),e.underline=g.underline.bind(e),e.inverse=g.inverse.bind(e),e.hidden=g.hidden.bind(e),e.strikethrough=g.strikethrough.bind(e),e.black=g.black.bind(e),e.red=g.red.bind(e),e.green=g.green.bind(e),e.yellow=g.yellow.bind(e),e.blue=g.blue.bind(e),e.magenta=g.magenta.bind(e),e.cyan=g.cyan.bind(e),e.white=g.white.bind(e),e.gray=g.gray.bind(e),e.grey=g.grey.bind(e),e.bgBlack=g.bgBlack.bind(e),e.bgRed=g.bgRed.bind(e),e.bgGreen=g.bgGreen.bind(e),e.bgYellow=g.bgYellow.bind(e),e.bgBlue=g.bgBlue.bind(e),e.bgMagenta=g.bgMagenta.bind(e),e.bgCyan=g.bgCyan.bind(e),e.bgWhite=g.bgWhite.bind(e),e}function v(i,t){let e={open:`\x1B[${i}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(this.has.includes(i)||(this.has.push(i),this.keys.push(e)),r===void 0?this:g.enabled?$i(this.keys,r+""):r+""):r===void 0?Co([i],[e]):g.enabled?$i([e],r+""):r+""}}qi.exports=g});var Mi=a((Oa,Ti)=>{"use strict";Ti.exports=(i,t)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(t){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var Ct=a(($a,Pi)=>{"use strict";Pi.exports=i=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),e=new RegExp(t,"g");return typeof i=="string"?i.replace(e,""):i}});var x=a((qa,_i)=>{"use strict";var Qt="\x1B",y=`${Qt}[`,Io="\x07",te={to(i,t){return t?`${y}${t+1};${i+1}H`:`${y}${i+1}G`},move(i,t){let e="";return i<0?e+=`${y}${-i}D`:i>0&&(e+=`${y}${i}C`),t<0?e+=`${y}${-t}A`:t>0&&(e+=`${y}${t}B`),e},up:(i=1)=>`${y}${i}A`,down:(i=1)=>`${y}${i}B`,forward:(i=1)=>`${y}${i}C`,backward:(i=1)=>`${y}${i}D`,nextLine:(i=1)=>`${y}E`.repeat(i),prevLine:(i=1)=>`${y}F`.repeat(i),left:`${y}G`,hide:`${y}?25l`,show:`${y}?25h`,save:`${Qt}7`,restore:`${Qt}8`},Do={up:(i=1)=>`${y}S`.repeat(i),down:(i=1)=>`${y}T`.repeat(i)},Eo={screen:`${y}2J`,up:(i=1)=>`${y}1J`.repeat(i),down:(i=1)=>`${y}J`.repeat(i),line:`${y}2K`,lineEnd:`${y}K`,lineStart:`${y}1K`,lines(i){let t="";for(let e=0;e<i;e++)t+=this.line+(e<i-1?te.up():"");return i&&(t+=te.left),t}};_i.exports={cursor:te,scroll:Do,erase:Eo,beep:Io}});var Ai=a((Ta,Ei)=>{"use strict";function Ao(i,t){var e=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!e){if(Array.isArray(i)||(e=jo(i))||t&&i&&typeof i.length=="number"){e&&(i=e);var r=0,s=function(){};return{s,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(u){throw u},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,n=!1,h;return{s:function(){e=e.call(i)},n:function(){var u=e.next();return o=u.done,u},e:function(u){n=!0,h=u},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(n)throw h}}}}function jo(i,t){if(i){if(typeof i=="string")return Ci(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Ci(i,t)}}function Ci(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,r=new Array(t);e<t;e++)r[e]=i[e];return r}var Ro=Ct(),Di=x(),Ii=Di.erase,Fo=Di.cursor,Lo=i=>[...Ro(i)].length;Ei.exports=function(i,t){if(!t)return Ii.line+Fo.to(0);let e=0,r=i.split(/\r?\n/);var s=Ao(r),o;try{for(s.s();!(o=s.n()).done;){let n=o.value;e+=1+Math.floor(Math.max(Lo(n)-1,0)/t)}}catch(n){s.e(n)}finally{s.f()}return Ii.lines(e)}});var ee=a((Ma,ji)=>{"use strict";var gt={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Bo={arrowUp:gt.arrowUp,arrowDown:gt.arrowDown,arrowLeft:gt.arrowLeft,arrowRight:gt.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Yo=process.platform==="win32"?Bo:gt;ji.exports=Yo});var Fi=a((Pa,Ri)=>{"use strict";var ut=w(),nt=ee(),ie=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}`}}),Ho=i=>ie[i]||ie.default,bt=Object.freeze({aborted:ut.red(nt.cross),done:ut.green(nt.tick),exited:ut.yellow(nt.cross),default:ut.cyan("?")}),No=(i,t,e)=>t?bt.aborted:e?bt.exited:i?bt.done:bt.default,Vo=i=>ut.gray(i?nt.ellipsis:nt.pointerSmall),ko=(i,t)=>ut.gray(i?t?nt.pointerSmall:"+":nt.line);Ri.exports={styles:ie,render:Ho,symbols:bt,symbol:No,delimiter:Vo,item:ko}});var Bi=a((_a,Li)=>{"use strict";var Uo=Ct();Li.exports=function(i,t){let e=String(Uo(i)||"").split(/\r?\n/);return t?e.map(r=>Math.ceil(r.length/t)).reduce((r,s)=>r+s):e.length}});var Hi=a((Ca,Yi)=>{"use strict";Yi.exports=(i,t={})=>{let e=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",r=t.width;return(i||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((o,n)=>(n.length+e.length>=r||o[o.length-1].length+n.length+1<r?o[o.length-1]+=` ${n}`:o.push(`${e}${n}`),o),[e]).join(`
57
4
  `)).join(`
58
- `)}});var di=a((yc,ci)=>{"use strict";ci.exports=(r,e,t)=>{t=t||e;let i=Math.min(e-t,r-Math.floor(t/2));i<0&&(i=0);let s=Math.min(i+t,e);return{startIndex:i,endIndex:s}}});var R=a((xc,fi)=>{"use strict";fi.exports={action:Zr(),clear:ii(),style:oi(),strip:Le(),figures:ut(),lines:hi(),wrap:ai(),entriesToDisplay:di()}});var z=a((Sc,gi)=>{"use strict";var pi=require("readline"),Dl=R(),Al=Dl.action,jl=require("events"),mi=O(),Ll=mi.beep,Rl=mi.cursor,Fl=S(),ct=class extends jl{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=pi.createInterface({input:this.in,escapeCodeTimeout:50});pi.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(n,o)=>{let l=Al(o,i);l===!1?this._&&this._(n,o):typeof this[l]=="function"?this[l](o):this.bell()};this.close=()=>{this.out.write(Rl.show),this.in.removeListener("keypress",s),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",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Ll)}render(){this.onRender(Fl),this.firstRender&&(this.firstRender=!1)}};gi.exports=ct});var xi=a((_c,yi)=>{"use strict";function vi(r,e,t,i,s,n,o){try{var l=r[n](o),h=l.value}catch(u){t(u);return}l.done?e(h):Promise.resolve(h).then(i,s)}function bi(r){return function(){var e=this,t=arguments;return new Promise(function(i,s){var n=r.apply(e,t);function o(h){vi(n,i,s,o,l,"next",h)}function l(h){vi(n,i,s,o,l,"throw",h)}o(void 0)})}}var Re=S(),Nl=z(),wi=O(),Hl=wi.erase,$e=wi.cursor,Fe=R(),dt=Fe.style,ft=Fe.clear,Bl=Fe.lines,Yl=Fe.figures,pt=class extends Nl{constructor(e={}){super(e),this.transform=dt.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=ft("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Re.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(`
59
- `),this.close()}validate(){var e=this;return bi(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return bi(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(`
60
- `),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 i=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${i}${e}${s}`,this.red=!1,this.cursor=this.placeholder?0:i.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($e.down(Bl(this.outputError,this.out.columns)-1)+ft(this.outputError,this.out.columns)),this.out.write(ft(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[dt.symbol(this.done,this.aborted),Re.bold(this.msg),dt.delimiter(this.done),this.red?Re.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
61
- `).reduce((e,t,i)=>e+`
62
- ${i?" ":Yl.pointerSmall} ${Re.red().italic(t)}`,"")),this.out.write(Hl.line+$e.to(0)+this.outputText+$e.save+this.outputError+$e.restore+$e.move(this.cursorOffset,0)))}};yi.exports=pt});var Ti=a((Oc,Oi)=>{"use strict";var Z=S(),Vl=z(),qe=R(),Si=qe.style,_i=qe.clear,Ne=qe.figures,kl=qe.wrap,Ul=qe.entriesToDisplay,Wl=O(),Gl=Wl.cursor,mt=class extends Vl{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,i)=>(typeof t=="string"&&(t={title:t,value:i}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?i: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=_i("",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(`
5
+ `)}});var Vi=a((Ia,Ni)=>{"use strict";Ni.exports=(i,t,e)=>{e=e||t;let r=Math.min(t-e,i-Math.floor(e/2));r<0&&(r=0);let s=Math.min(r+e,t);return{startIndex:r,endIndex:s}}});var E=a((Da,ki)=>{"use strict";ki.exports={action:Mi(),clear:Ai(),style:Fi(),strip:Ct(),figures:ee(),lines:Bi(),wrap:Hi(),entriesToDisplay:Vi()}});var J=a((Ea,Ji)=>{"use strict";var Ui=require("readline"),Go=E(),Jo=Go.action,zo=require("events"),Gi=x(),Wo=Gi.beep,Ko=Gi.cursor,Zo=w(),re=class extends zo{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);let e=Ui.createInterface({input:this.in,escapeCodeTimeout:50});Ui.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);let r=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(o,n)=>{let h=Jo(n,r);h===!1?this._&&this._(o,n):typeof this[h]=="function"?this[h](n):this.bell()};this.close=()=>{this.out.write(Ko.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Wo)}render(){this.onRender(Zo),this.firstRender&&(this.firstRender=!1)}};Ji.exports=re});var Xi=a((Aa,Zi)=>{"use strict";function zi(i,t,e,r,s,o,n){try{var h=i[o](n),l=h.value}catch(u){e(u);return}h.done?t(l):Promise.resolve(l).then(r,s)}function Wi(i){return function(){var t=this,e=arguments;return new Promise(function(r,s){var o=i.apply(t,e);function n(l){zi(o,r,s,n,h,"next",l)}function h(l){zi(o,r,s,n,h,"throw",l)}n(void 0)})}}var It=w(),Xo=J(),Ki=x(),Qo=Ki.erase,vt=Ki.cursor,Dt=E(),se=Dt.style,ne=Dt.clear,th=Dt.lines,eh=Dt.figures,oe=class extends Xo{constructor(t={}){super(t),this.transform=se.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=ne("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=It.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
6
+ `),this.close()}validate(){var t=this;return Wi(function*(){let e=yield t.validator(t.value);typeof e=="string"&&(t.errorMsg=e,e=!1),t.error=!e})()}submit(){var t=this;return Wi(function*(){if(t.value=t.value||t.initial,t.cursorOffset=0,t.cursor=t.rendered.length,yield t.validate(),t.error){t.red=!0,t.fire(),t.render();return}t.done=!0,t.aborted=!1,t.fire(),t.render(),t.out.write(`
7
+ `),t.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,e){let r=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${r}${t}${s}`,this.red=!1,this.cursor=this.placeholder?0:r.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),e=this.value.slice(this.cursor);this.value=`${t}${e}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor+1);this.value=`${t}${e}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(vt.down(th(this.outputError,this.out.columns)-1)+ne(this.outputError,this.out.columns)),this.out.write(ne(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[se.symbol(this.done,this.aborted),It.bold(this.msg),se.delimiter(this.done),this.red?It.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
8
+ `).reduce((t,e,r)=>t+`
9
+ ${r?" ":eh.pointerSmall} ${It.red().italic(e)}`,"")),this.out.write(Qo.line+vt.to(0)+this.outputText+vt.save+this.outputError+vt.restore+vt.move(this.cursorOffset,0)))}};Zi.exports=oe});var ir=a((ja,er)=>{"use strict";var z=w(),ih=J(),wt=E(),Qi=wt.style,tr=wt.clear,Et=wt.figures,rh=wt.wrap,sh=wt.entriesToDisplay,nh=x(),oh=nh.cursor,he=class extends ih{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((e,r)=>(typeof e=="string"&&(e={title:e,value:r}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?r:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=tr("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
63
10
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
64
- `),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(Gl.hide):this.out.write(_i(this.outputText,this.out.columns)),super.render();let e=Ul(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,i=e.endIndex;if(this.outputText=[Si.symbol(this.done,this.aborted),Z.bold(this.msg),Si.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Z.yellow(this.warn):Z.gray(this.hint)].join(" "),!this.done){this.outputText+=`
65
- `;for(let s=t;s<i;s++){let n,o,l="",h=this.choices[s];s===t&&t>0?o=Ne.arrowUp:s===i-1&&i<this.choices.length?o=Ne.arrowDown:o=" ",h.disabled?(n=this.cursor===s?Z.gray().underline(h.title):Z.strikethrough().gray(h.title),o=(this.cursor===s?Z.bold().gray(Ne.pointer)+" ":" ")+o):(n=this.cursor===s?Z.cyan().underline(h.title):h.title,o=(this.cursor===s?Z.cyan(Ne.pointer)+" ":" ")+o,h.description&&this.cursor===s&&(l=` - ${h.description}`,(o.length+n.length+l.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(l=`
66
- `+kl(h.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${Z.gray(l)}
67
- `}}this.out.write(this.outputText)}};Oi.exports=mt});var Ci=a((Tc,Pi)=>{"use strict";var He=S(),Jl=z(),Mi=R(),$i=Mi.style,zl=Mi.clear,Ei=O(),qi=Ei.cursor,Zl=Ei.erase,gt=class extends Jl{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(`
11
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,e){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(oh.hide):this.out.write(tr(this.outputText,this.out.columns)),super.render();let t=sh(this.cursor,this.choices.length,this.optionsPerPage),e=t.startIndex,r=t.endIndex;if(this.outputText=[Qi.symbol(this.done,this.aborted),z.bold(this.msg),Qi.delimiter(!1),this.done?this.selection.title:this.selection.disabled?z.yellow(this.warn):z.gray(this.hint)].join(" "),!this.done){this.outputText+=`
12
+ `;for(let s=e;s<r;s++){let o,n,h="",l=this.choices[s];s===e&&e>0?n=Et.arrowUp:s===r-1&&r<this.choices.length?n=Et.arrowDown:n=" ",l.disabled?(o=this.cursor===s?z.gray().underline(l.title):z.strikethrough().gray(l.title),n=(this.cursor===s?z.bold().gray(Et.pointer)+" ":" ")+n):(o=this.cursor===s?z.cyan().underline(l.title):l.title,n=(this.cursor===s?z.cyan(Et.pointer)+" ":" ")+n,l.description&&this.cursor===s&&(h=` - ${l.description}`,(n.length+o.length+h.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(h=`
13
+ `+rh(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${o}${z.gray(h)}
14
+ `}}this.out.write(this.outputText)}};er.exports=he});var lr=a((Ra,hr)=>{"use strict";var At=w(),hh=J(),nr=E(),rr=nr.style,lh=nr.clear,or=x(),sr=or.cursor,uh=or.erase,le=class extends hh{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
68
15
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
69
- `),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(qi.hide):this.out.write(zl(this.outputText,this.out.columns)),super.render(),this.outputText=[$i.symbol(this.done,this.aborted),He.bold(this.msg),$i.delimiter(this.done),this.value?this.inactive:He.cyan().underline(this.inactive),He.gray("/"),this.value?He.cyan().underline(this.active):this.active].join(" "),this.out.write(Zl.line+qi.to(0)+this.outputText))}};Pi.exports=gt});var B=a(($c,Ii)=>{"use strict";var vt=class r{constructor({token:e,date:t,parts:i,locales:s}){this.token=e,this.date=t||new Date,this.parts=i||[this],this.locales=s||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,i)=>i>e&&t instanceof r)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((i,s)=>s>t&&i instanceof r)}toString(){return String(this.date)}};Ii.exports=vt});var Ai=a((qc,Di)=>{"use strict";var Xl=B(),bt=class extends Xl{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}};Di.exports=bt});var Li=a((Mc,ji)=>{"use strict";var Kl=B(),Ql=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),wt=class extends Kl{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+Ql(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};ji.exports=wt});var Fi=a((Ec,Ri)=>{"use strict";var eh=B(),yt=class extends eh{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}};Ri.exports=yt});var Hi=a((Pc,Ni)=>{"use strict";var th=B(),xt=class extends th{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)}};Ni.exports=xt});var Yi=a((Cc,Bi)=>{"use strict";var rh=B(),St=class extends rh{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}};Bi.exports=St});var ki=a((Ic,Vi)=>{"use strict";var ih=B(),_t=class extends ih{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)}};Vi.exports=_t});var Wi=a((Dc,Ui)=>{"use strict";var sh=B(),Ot=class extends sh{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}};Ui.exports=Ot});var Ji=a((Ac,Gi)=>{"use strict";var nh=B(),Tt=class extends nh{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}};Gi.exports=Tt});var Zi=a((jc,zi)=>{"use strict";zi.exports={DatePart:B(),Meridiem:Ai(),Day:Li(),Hours:Fi(),Milliseconds:Hi(),Minutes:Yi(),Month:ki(),Seconds:Wi(),Year:Ji()}});var os=a((Lc,ns)=>{"use strict";function Xi(r,e,t,i,s,n,o){try{var l=r[n](o),h=l.value}catch(u){t(u);return}l.done?e(h):Promise.resolve(h).then(i,s)}function Ki(r){return function(){var e=this,t=arguments;return new Promise(function(i,s){var n=r.apply(e,t);function o(h){Xi(n,i,s,o,l,"next",h)}function l(h){Xi(n,i,s,o,l,"throw",h)}o(void 0)})}}var $t=S(),oh=z(),Mt=R(),Qi=Mt.style,es=Mt.clear,lh=Mt.figures,ss=O(),hh=ss.erase,ts=ss.cursor,X=Zi(),rs=X.DatePart,uh=X.Meridiem,ah=X.Day,ch=X.Hours,dh=X.Milliseconds,fh=X.Minutes,ph=X.Month,mh=X.Seconds,gh=X.Year,vh=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,is={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new ah(r),3:r=>new ph(r),4:r=>new gh(r),5:r=>new uh(r),6:r=>new ch(r),7:r=>new fh(r),8:r=>new mh(r),9:r=>new dh(r)},bh={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(",")},qt=class extends oh{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(bh,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=es("",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=vh.exec(e);){let s=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in is?is[n]({token:t[n]||s,date:this.date,parts:this.parts,locales:this.locales}):t[n]||s)}let i=this.parts.reduce((s,n)=>(typeof n=="string"&&typeof s[s.length-1]=="string"?s[s.length-1]+=n:s.push(n),s),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof rs)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
70
- `),this.close()}validate(){var e=this;return Ki(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Ki(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(`
71
- `),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 rs)),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(ts.hide):this.out.write(es(this.outputText,this.out.columns)),super.render(),this.outputText=[Qi.symbol(this.done,this.aborted),$t.bold(this.msg),Qi.delimiter(!1),this.parts.reduce((e,t,i)=>e.concat(i===this.cursor&&!this.done?$t.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
72
- `).reduce((e,t,i)=>e+`
73
- ${i?" ":lh.pointerSmall} ${$t.red().italic(t)}`,"")),this.out.write(hh.line+ts.to(0)+this.outputText))}};ns.exports=qt});var fs=a((Rc,ds)=>{"use strict";function ls(r,e,t,i,s,n,o){try{var l=r[n](o),h=l.value}catch(u){t(u);return}l.done?e(h):Promise.resolve(h).then(i,s)}function hs(r){return function(){var e=this,t=arguments;return new Promise(function(i,s){var n=r.apply(e,t);function o(h){ls(n,i,s,o,l,"next",h)}function l(h){ls(n,i,s,o,l,"throw",h)}o(void 0)})}}var Be=S(),wh=z(),cs=O(),Ye=cs.cursor,yh=cs.erase,Ve=R(),Et=Ve.style,xh=Ve.figures,us=Ve.clear,Sh=Ve.lines,_h=/[0-9]/,Pt=r=>r!==void 0,as=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},Ct=class extends wh{constructor(e={}){super(e),this.transform=Et.render(e.style),this.msg=e.message,this.initial=Pt(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Pt(e.min)?e.min:-1/0,this.max=Pt(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=Be.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${as(e,this.round)}`),this._value=as(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||_h.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
74
- `),this.close()}validate(){var e=this;return hs(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return hs(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(`
75
- `),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 i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,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(Ye.down(Sh(this.outputError,this.out.columns)-1)+us(this.outputError,this.out.columns)),this.out.write(us(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Et.symbol(this.done,this.aborted),Be.bold(this.msg),Et.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Be[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
76
- `).reduce((e,t,i)=>e+`
77
- ${i?" ":xh.pointerSmall} ${Be.red().italic(t)}`,"")),this.out.write(yh.line+Ye.to(0)+this.outputText+Ye.save+this.outputError+Ye.restore))}};ds.exports=Ct});var Dt=a((Fc,gs)=>{"use strict";var Y=S(),Oh=O(),Th=Oh.cursor,$h=z(),Me=R(),ps=Me.clear,ne=Me.figures,ms=Me.style,qh=Me.wrap,Mh=Me.entriesToDisplay,It=class extends $h{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,i)=>(typeof t=="string"&&(t={title:t,value:i}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?i:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=ps("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
78
- `),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(`
79
- `),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:`
16
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,e){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(sr.hide):this.out.write(lh(this.outputText,this.out.columns)),super.render(),this.outputText=[rr.symbol(this.done,this.aborted),At.bold(this.msg),rr.delimiter(this.done),this.value?this.inactive:At.cyan().underline(this.inactive),At.gray("/"),this.value?At.cyan().underline(this.active):this.active].join(" "),this.out.write(uh.line+sr.to(0)+this.outputText))}};hr.exports=le});var F=a((Fa,ur)=>{"use strict";var ue=class i{constructor({token:t,date:e,parts:r,locales:s}){this.token=t,this.date=e||new Date,this.parts=r||[this],this.locales=s||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((e,r)=>r>t&&e instanceof i)}setTo(t){}prev(){let t=[].concat(this.parts).reverse(),e=t.indexOf(this);return t.find((r,s)=>s>e&&r instanceof i)}toString(){return String(this.date)}};ur.exports=ue});var cr=a((La,ar)=>{"use strict";var ah=F(),ae=class extends ah{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}};ar.exports=ae});var fr=a((Ba,dr)=>{"use strict";var ch=F(),dh=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),ce=class extends ch{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),e=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+dh(t):this.token==="d"?e+1:this.token==="ddd"?this.locales.weekdaysShort[e]:this.token==="dddd"?this.locales.weekdays[e]:t}};dr.exports=ce});var mr=a((Ya,pr)=>{"use strict";var fh=F(),de=class extends fh{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}};pr.exports=de});var br=a((Ha,gr)=>{"use strict";var ph=F(),fe=class extends ph{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};gr.exports=fe});var wr=a((Na,vr)=>{"use strict";var mh=F(),pe=class extends mh{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}};vr.exports=pe});var xr=a((Va,yr)=>{"use strict";var gh=F(),me=class extends gh{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),e=this.token.length;return e===2?String(t+1).padStart(2,"0"):e===3?this.locales.monthsShort[t]:e===4?this.locales.months[t]:String(t+1)}};yr.exports=me});var Or=a((ka,Sr)=>{"use strict";var bh=F(),ge=class extends bh{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}};Sr.exports=ge});var qr=a((Ua,$r)=>{"use strict";var vh=F(),be=class extends vh{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}};$r.exports=be});var Mr=a((Ga,Tr)=>{"use strict";Tr.exports={DatePart:F(),Meridiem:cr(),Day:fr(),Hours:mr(),Milliseconds:br(),Minutes:wr(),Month:xr(),Seconds:Or(),Year:qr()}});var Fr=a((Ja,Rr)=>{"use strict";function Pr(i,t,e,r,s,o,n){try{var h=i[o](n),l=h.value}catch(u){e(u);return}h.done?t(l):Promise.resolve(l).then(r,s)}function _r(i){return function(){var t=this,e=arguments;return new Promise(function(r,s){var o=i.apply(t,e);function n(l){Pr(o,r,s,n,h,"next",l)}function h(l){Pr(o,r,s,n,h,"throw",l)}n(void 0)})}}var ve=w(),wh=J(),ye=E(),Cr=ye.style,Ir=ye.clear,yh=ye.figures,jr=x(),xh=jr.erase,Dr=jr.cursor,W=Mr(),Er=W.DatePart,Sh=W.Meridiem,Oh=W.Day,$h=W.Hours,qh=W.Milliseconds,Th=W.Minutes,Mh=W.Month,Ph=W.Seconds,_h=W.Year,Ch=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Ar={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new Oh(i),3:i=>new Mh(i),4:i=>new _h(i),5:i=>new Sh(i),6:i=>new $h(i),7:i=>new Th(i),8:i=>new Ph(i),9:i=>new qh(i)},Ih={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(",")},we=class extends wh{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(Ih,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Ir("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let e;for(this.parts=[];e=Ch.exec(t);){let s=e.shift(),o=e.findIndex(n=>n!=null);this.parts.push(o in Ar?Ar[o]({token:e[o]||s,date:this.date,parts:this.parts,locales:this.locales}):e[o]||s)}let r=this.parts.reduce((s,o)=>(typeof o=="string"&&typeof s[s.length-1]=="string"?s[s.length-1]+=o:s.push(o),s),[]);this.parts.splice(0),this.parts.push(...r),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex(t=>t instanceof Er)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
17
+ `),this.close()}validate(){var t=this;return _r(function*(){let e=yield t.validator(t.value);typeof e=="string"&&(t.errorMsg=e,e=!1),t.error=!e})()}submit(){var t=this;return _r(function*(){if(yield t.validate(),t.error){t.color="red",t.fire(),t.render();return}t.done=!0,t.aborted=!1,t.fire(),t.render(),t.out.write(`
18
+ `),t.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex(e=>e instanceof Er)),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Dr.hide):this.out.write(Ir(this.outputText,this.out.columns)),super.render(),this.outputText=[Cr.symbol(this.done,this.aborted),ve.bold(this.msg),Cr.delimiter(!1),this.parts.reduce((t,e,r)=>t.concat(r===this.cursor&&!this.done?ve.cyan().underline(e.toString()):e),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
19
+ `).reduce((t,e,r)=>t+`
20
+ ${r?" ":yh.pointerSmall} ${ve.red().italic(e)}`,"")),this.out.write(xh.line+Dr.to(0)+this.outputText))}};Rr.exports=we});var kr=a((za,Vr)=>{"use strict";function Lr(i,t,e,r,s,o,n){try{var h=i[o](n),l=h.value}catch(u){e(u);return}h.done?t(l):Promise.resolve(l).then(r,s)}function Br(i){return function(){var t=this,e=arguments;return new Promise(function(r,s){var o=i.apply(t,e);function n(l){Lr(o,r,s,n,h,"next",l)}function h(l){Lr(o,r,s,n,h,"throw",l)}n(void 0)})}}var jt=w(),Dh=J(),Nr=x(),Rt=Nr.cursor,Eh=Nr.erase,Ft=E(),xe=Ft.style,Ah=Ft.figures,Yr=Ft.clear,jh=Ft.lines,Rh=/[0-9]/,Se=i=>i!==void 0,Hr=(i,t)=>{let e=Math.pow(10,t);return Math.round(i*e)/e},Oe=class extends Dh{constructor(t={}){super(t),this.transform=xe.render(t.style),this.msg=t.message,this.initial=Se(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=Se(t.min)?t.min:-1/0,this.max=Se(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){!t&&t!==0?(this.placeholder=!0,this.rendered=jt.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Hr(t,this.round)}`),this._value=Hr(t,this.round)),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t==="-"||t==="."&&this.float||Rh.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==""?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
21
+ `),this.close()}validate(){var t=this;return Br(function*(){let e=yield t.validator(t.value);typeof e=="string"&&(t.errorMsg=e,e=!1),t.error=!e})()}submit(){var t=this;return Br(function*(){if(yield t.validate(),t.error){t.color="red",t.fire(),t.render();return}let e=t.value;t.value=e!==""?e:t.initial,t.done=!0,t.aborted=!1,t.error=!1,t.fire(),t.render(),t.out.write(`
22
+ `),t.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(t,e){if(!this.valid(t))return this.bell();let r=Date.now();if(r-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=r,this.color="cyan",t===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Rt.down(jh(this.outputError,this.out.columns)-1)+Yr(this.outputError,this.out.columns)),this.out.write(Yr(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[xe.symbol(this.done,this.aborted),jt.bold(this.msg),xe.delimiter(this.done),!this.done||!this.done&&!this.placeholder?jt[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
23
+ `).reduce((t,e,r)=>t+`
24
+ ${r?" ":Ah.pointerSmall} ${jt.red().italic(e)}`,"")),this.out.write(Eh.line+Rt.to(0)+this.outputText+Rt.save+this.outputError+Rt.restore))}};Vr.exports=Oe});var qe=a((Wa,Jr)=>{"use strict";var L=w(),Fh=x(),Lh=Fh.cursor,Bh=J(),yt=E(),Ur=yt.clear,tt=yt.figures,Gr=yt.style,Yh=yt.wrap,Hh=yt.entriesToDisplay,$e=class extends Bh{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map((e,r)=>(typeof e=="string"&&(e={title:e,value:r}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?r:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=Ur("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map(t=>!t.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(t=>t.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
25
+ `),this.close()}submit(){let t=this.value.filter(e=>e.selected);this.minSelected&&t.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
26
+ `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let t=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(e=>e.selected=t),this.render()}_(t,e){if(t===" ")this.handleSpaceToggle();else if(t==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
80
27
  Instructions:
81
- ${ne.arrowUp}/${ne.arrowDown}: Highlight option
82
- ${ne.arrowLeft}/${ne.arrowRight}/[space]: Toggle selection
28
+ ${tt.arrowUp}/${tt.arrowDown}: Highlight option
29
+ ${tt.arrowLeft}/${tt.arrowRight}/[space]: Toggle selection
83
30
  `+(this.maxChoices===void 0?` a: Toggle all
84
- `:"")+" enter/return: Complete answer":""}renderOption(e,t,i,s){let n=(t.selected?Y.green(ne.radioOn):ne.radioOff)+" "+s+" ",o,l;return t.disabled?o=e===i?Y.gray().underline(t.title):Y.strikethrough().gray(t.title):(o=e===i?Y.cyan().underline(t.title):t.title,e===i&&t.description&&(l=` - ${t.description}`,(n.length+o.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(l=`
85
- `+qh(t.description,{margin:n.length,width:this.out.columns})))),n+o+Y.gray(l||"")}paginateOptions(e){if(e.length===0)return Y.red("No matches for this query.");let t=Mh(this.cursor,e.length,this.optionsPerPage),i=t.startIndex,s=t.endIndex,n,o=[];for(let l=i;l<s;l++)l===i&&i>0?n=ne.arrowUp:l===s-1&&s<e.length?n=ne.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[l],l,n));return`
86
- `+o.join(`
87
- `)}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=[Y.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Y.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Th.hide),super.render();let e=[ms.symbol(this.done,this.aborted),Y.bold(this.msg),ms.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.value),this.out.write(this.clear+e),this.clear=ps(e,this.out.columns)}};gs.exports=It});var _s=a((Nc,Ss)=>{"use strict";function vs(r,e,t,i,s,n,o){try{var l=r[n](o),h=l.value}catch(u){t(u);return}l.done?e(h):Promise.resolve(h).then(i,s)}function Eh(r){return function(){var e=this,t=arguments;return new Promise(function(i,s){var n=r.apply(e,t);function o(h){vs(n,i,s,o,l,"next",h)}function l(h){vs(n,i,s,o,l,"throw",h)}o(void 0)})}}var Ee=S(),Ph=z(),xs=O(),Ch=xs.erase,bs=xs.cursor,Pe=R(),At=Pe.style,ws=Pe.clear,jt=Pe.figures,Ih=Pe.wrap,Dh=Pe.entriesToDisplay,ys=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),Ah=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),jh=(r,e)=>{let t=r.findIndex(i=>i.value===e||i.title===e);return t>-1?t:void 0},Lt=class extends Ph{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:jh(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=At.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=ws("",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=ys(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return Eh(function*(){let i=t.completing=t.suggest(t.input,t.choices),s=yield i;if(t.completing!==i)return;t.suggestions=s.map((o,l,h)=>({title:Ah(h,l),value:ys(h,l),description:o.description})),t.completing=!1;let n=Math.max(s.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(`
31
+ `:"")+" enter/return: Complete answer":""}renderOption(t,e,r,s){let o=(e.selected?L.green(tt.radioOn):tt.radioOff)+" "+s+" ",n,h;return e.disabled?n=t===r?L.gray().underline(e.title):L.strikethrough().gray(e.title):(n=t===r?L.cyan().underline(e.title):e.title,t===r&&e.description&&(h=` - ${e.description}`,(o.length+n.length+h.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(h=`
32
+ `+Yh(e.description,{margin:o.length,width:this.out.columns})))),o+n+L.gray(h||"")}paginateOptions(t){if(t.length===0)return L.red("No matches for this query.");let e=Hh(this.cursor,t.length,this.optionsPerPage),r=e.startIndex,s=e.endIndex,o,n=[];for(let h=r;h<s;h++)h===r&&r>0?o=tt.arrowUp:h===s-1&&s<t.length?o=tt.arrowDown:o=" ",n.push(this.renderOption(this.cursor,t[h],h,o));return`
33
+ `+n.join(`
34
+ `)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");let t=[L.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(L.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Lh.hide),super.render();let t=[Gr.symbol(this.done,this.aborted),L.bold(this.msg),Gr.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=L.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=Ur(t,this.out.columns)}};Jr.exports=$e});var ts=a((Ka,Qr)=>{"use strict";function zr(i,t,e,r,s,o,n){try{var h=i[o](n),l=h.value}catch(u){e(u);return}h.done?t(l):Promise.resolve(l).then(r,s)}function Nh(i){return function(){var t=this,e=arguments;return new Promise(function(r,s){var o=i.apply(t,e);function n(l){zr(o,r,s,n,h,"next",l)}function h(l){zr(o,r,s,n,h,"throw",l)}n(void 0)})}}var xt=w(),Vh=J(),Xr=x(),kh=Xr.erase,Wr=Xr.cursor,St=E(),Te=St.style,Kr=St.clear,Me=St.figures,Uh=St.wrap,Gh=St.entriesToDisplay,Zr=(i,t)=>i[t]&&(i[t].value||i[t].title||i[t]),Jh=(i,t)=>i[t]&&(i[t].title||i[t].value||i[t]),zh=(i,t)=>{let e=i.findIndex(r=>r.value===t||r.title===t);return e>-1?e:void 0},Pe=class extends Vh{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial=typeof t.initial=="number"?t.initial:zh(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=Te.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Kr("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return typeof this._fb=="number"?t=this.choices[this._fb]:typeof this._fb=="string"&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=Zr(this.suggestions,t):this.value=this.fallback.value,this.fire()}complete(t){var e=this;return Nh(function*(){let r=e.completing=e.suggest(e.input,e.choices),s=yield r;if(e.completing!==r)return;e.suggestions=s.map((n,h,l)=>({title:Jh(l,h),value:Zr(l,h),description:n.description})),e.completing=!1;let o=Math.max(s.length-1,0);e.moveSelect(Math.min(o,e.select)),t&&t()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
88
35
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
89
36
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
90
- `),this.close()}_(e,t){let i=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${i}${e}${s}`,this.cursor=i.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,i,s){let n,o=i?jt.arrowUp:s?jt.arrowDown:" ",l=t?Ee.cyan().underline(e.title):e.title;return o=(t?Ee.cyan(jt.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+l.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
91
- `+Ih(e.description,{margin:3,width:this.out.columns}))),o+" "+l+Ee.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(bs.hide):this.out.write(ws(this.outputText,this.out.columns)),super.render();let e=Dh(this.select,this.choices.length,this.limit),t=e.startIndex,i=e.endIndex;if(this.outputText=[At.symbol(this.done,this.aborted,this.exited),Ee.bold(this.msg),At.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let s=this.suggestions.slice(t,i).map((n,o)=>this.renderOption(n,this.select===o+t,o===0&&t>0,o+t===i-1&&i<this.choices.length)).join(`
37
+ `),this.close()}_(t,e){let r=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${r}${t}${s}`,this.cursor=r.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,e,r,s){let o,n=r?Me.arrowUp:s?Me.arrowDown:" ",h=e?xt.cyan().underline(t.title):t.title;return n=(e?xt.cyan(Me.pointer)+" ":" ")+n,t.description&&(o=` - ${t.description}`,(n.length+h.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o=`
38
+ `+Uh(t.description,{margin:3,width:this.out.columns}))),n+" "+h+xt.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Wr.hide):this.out.write(Kr(this.outputText,this.out.columns)),super.render();let t=Gh(this.select,this.choices.length,this.limit),e=t.startIndex,r=t.endIndex;if(this.outputText=[Te.symbol(this.done,this.aborted,this.exited),xt.bold(this.msg),Te.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,r).map((o,n)=>this.renderOption(o,this.select===n+e,n===0&&e>0,n+e===r-1&&r<this.choices.length)).join(`
92
39
  `);this.outputText+=`
93
- `+(s||Ee.gray(this.fallback.title))}this.out.write(Ch.line+bs.to(0)+this.outputText)}};Ss.exports=Lt});var qs=a((Hc,$s)=>{"use strict";var K=S(),Lh=O(),Rh=Lh.cursor,Fh=Dt(),Ft=R(),Os=Ft.clear,Ts=Ft.style,ge=Ft.figures,Rt=class extends Fh{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=Os("",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(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(i=>i===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:`
40
+ `+(s||xt.gray(this.fallback.title))}this.out.write(kh.line+Wr.to(0)+this.outputText)}};Qr.exports=Pe});var ss=a((Za,rs)=>{"use strict";var K=w(),Wh=x(),Kh=Wh.cursor,Zh=qe(),Ce=E(),es=Ce.clear,is=Ce.style,at=Ce.figures,_e=class extends Zh{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=es("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(r=>this.inputValue?!!(typeof r.title=="string"&&r.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof r.value=="string"&&r.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let e=this.filteredOptions.findIndex(r=>r===t);this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){let t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
94
41
  Instructions:
95
- ${ge.arrowUp}/${ge.arrowDown}: Highlight option
96
- ${ge.arrowLeft}/${ge.arrowRight}/[space]: Toggle selection
42
+ ${at.arrowUp}/${at.arrowDown}: Highlight option
43
+ ${at.arrowLeft}/${at.arrowRight}/[space]: Toggle selection
97
44
  [a,b,c]/delete: Filter choices
98
45
  enter/return: Complete answer
99
46
  `:""}renderCurrentInput(){return`
100
47
  Filtered results for: ${this.inputValue?this.inputValue:K.gray("Enter something to filter")}
101
- `}renderOption(e,t,i){let s;return t.disabled?s=e===i?K.gray().underline(t.title):K.strikethrough().gray(t.title):s=e===i?K.cyan().underline(t.title):t.title,(t.selected?K.green(ge.radioOn):ge.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[K.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(K.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Rh.hide),super.render();let e=[Ts.symbol(this.done,this.aborted),K.bold(this.msg),Ts.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=K.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=Os(e,this.out.columns)}};$s.exports=Rt});var As=a((Bc,Ds)=>{"use strict";var Ms=S(),Nh=z(),Cs=R(),Es=Cs.style,Hh=Cs.clear,Is=O(),Bh=Is.erase,Ps=Is.cursor,Nt=class extends Nh{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
+ `}renderOption(t,e,r){let s;return e.disabled?s=t===r?K.gray().underline(e.title):K.strikethrough().gray(e.title):s=t===r?K.cyan().underline(e.title):e.title,(e.selected?K.green(at.radioOn):at.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");let t=[K.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(K.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Kh.hide),super.render();let t=[is.symbol(this.done,this.aborted),K.bold(this.msg),is.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=K.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=es(t,this.out.columns)}};rs.exports=_e});var cs=a((Xa,as)=>{"use strict";var ns=w(),Xh=J(),ls=E(),os=ls.style,Qh=ls.clear,us=x(),tl=us.erase,hs=us.cursor,Ie=class extends Xh{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
102
49
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
103
- `),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Ps.hide):this.out.write(Hh(this.outputText,this.out.columns)),super.render(),this.outputText=[Es.symbol(this.done,this.aborted),Ms.bold(this.msg),Es.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Ms.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Bh.line+Ps.to(0)+this.outputText))}};Ds.exports=Nt});var Ls=a((Yc,js)=>{"use strict";js.exports={TextPrompt:xi(),SelectPrompt:Ti(),TogglePrompt:Ci(),DatePrompt:os(),NumberPrompt:fs(),MultiselectPrompt:Dt(),AutocompletePrompt:_s(),AutocompleteMultiselectPrompt:qs(),ConfirmPrompt:As()}});var Fs=a(Rs=>{"use strict";var A=Rs,Yh=Ls(),ke=r=>r;function V(r,e,t={}){return new Promise((i,s)=>{let n=new Yh[r](e),o=t.onAbort||ke,l=t.onSubmit||ke,h=t.onExit||ke;n.on("state",e.onState||ke),n.on("submit",u=>i(l(u))),n.on("exit",u=>i(h(u))),n.on("abort",u=>s(o(u)))})}A.text=r=>V("TextPrompt",r);A.password=r=>(r.style="password",A.text(r));A.invisible=r=>(r.style="invisible",A.text(r));A.number=r=>V("NumberPrompt",r);A.date=r=>V("DatePrompt",r);A.confirm=r=>V("ConfirmPrompt",r);A.list=r=>{let e=r.separator||",";return V("TextPrompt",r,{onSubmit:t=>t.split(e).map(i=>i.trim())})};A.toggle=r=>V("TogglePrompt",r);A.select=r=>V("SelectPrompt",r);A.multiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(i=>i.selected).map(i=>i.value);return V("MultiselectPrompt",r,{onAbort:e,onSubmit:e})};A.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(i=>i.selected).map(i=>i.value);return V("AutocompleteMultiselectPrompt",r,{onAbort:e,onSubmit:e})};var Vh=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));A.autocomplete=r=>(r.suggest=r.suggest||Vh,r.choices=[].concat(r.choices||[]),V("AutocompletePrompt",r))});var Ws=a((kc,Us)=>{"use strict";function Ns(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,i)}return t}function Hs(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ns(Object(t),!0).forEach(function(i){kh(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ns(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function kh(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Uh(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Wh(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var i=0,s=function(){};return{s,n:function(){return i>=r.length?{done:!0}:{done:!1,value:r[i++]}},e:function(u){throw u},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
104
- 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(r)},n:function(){var u=t.next();return n=u.done,u},e:function(u){o=!0,l=u},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw l}}}}function Wh(r,e){if(r){if(typeof r=="string")return Bs(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Bs(r,e)}}function Bs(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=r[t];return i}function Ys(r,e,t,i,s,n,o){try{var l=r[n](o),h=l.value}catch(u){t(u);return}l.done?e(h):Promise.resolve(h).then(i,s)}function Vs(r){return function(){var e=this,t=arguments;return new Promise(function(i,s){var n=r.apply(e,t);function o(h){Ys(n,i,s,o,l,"next",h)}function l(h){Ys(n,i,s,o,l,"throw",h)}o(void 0)})}}var Ht=Fs(),Gh=["suggest","format","onState","validate","onRender","type"],ks=()=>{};function oe(){return Bt.apply(this,arguments)}function Bt(){return Bt=Vs(function*(r=[],{onSubmit:e=ks,onCancel:t=ks}={}){let i={},s=oe._override||{};r=[].concat(r);let n,o,l,h,u,E,d=function(){var I=Vs(function*(x,L,T=!1){if(!(!T&&x.validate&&x.validate(L)!==!0))return x.format?yield x.format(L,i):L});return function(L,T){return I.apply(this,arguments)}}();var c=Uh(r),p;try{for(c.s();!(p=c.n()).done;){o=p.value;var g=o;if(h=g.name,u=g.type,typeof u=="function"&&(u=yield u(n,Hs({},i),o),o.type=u),!!u){for(let I in o){if(Gh.includes(I))continue;let x=o[I];o[I]=typeof x=="function"?yield x(n,Hs({},i),E):x}if(E=o,typeof o.message!="string")throw new Error("prompt message is required");var re=o;if(h=re.name,u=re.type,Ht[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(s[o.name]!==void 0&&(n=yield d(o,s[o.name]),n!==void 0)){i[h]=n;continue}try{n=oe._injected?Jh(oe._injected,o.initial):yield Ht[u](o),i[h]=n=yield d(o,n,!0),l=yield e(o,n,i)}catch{l=!(yield t(o,i))}if(l)return i}}}catch(I){c.e(I)}finally{c.f()}return i}),Bt.apply(this,arguments)}function Jh(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function zh(r){oe._injected=(oe._injected||[]).concat(r)}function Zh(r){oe._override=Object.assign({},r)}Us.exports=Object.assign(oe,{prompt:oe,prompts:Ht,inject:zh,override:Zh})});var Js=a((Uc,Gs)=>{"use strict";Gs.exports=(r,e)=>{if(!(r.meta&&r.name!=="escape")){if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c"||r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(e){if(r.name==="j")return"down";if(r.name==="k")return"up"}return r.name==="return"||r.name==="enter"?"submit":r.name==="backspace"?"delete":r.name==="delete"?"deleteForward":r.name==="abort"?"abort":r.name==="escape"?"exit":r.name==="tab"?"next":r.name==="pagedown"?"nextPage":r.name==="pageup"?"prevPage":r.name==="home"?"home":r.name==="end"?"end":r.name==="up"?"up":r.name==="down"?"down":r.name==="right"?"right":r.name==="left"?"left":!1}}});var Ue=a((Wc,zs)=>{"use strict";zs.exports=r=>{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 r=="string"?r.replace(t,""):r}});var Ks=a((Gc,Xs)=>{"use strict";var Xh=Ue(),{erase:Zs,cursor:Kh}=O(),Qh=r=>[...Xh(r)].length;Xs.exports=function(r,e){if(!e)return Zs.line+Kh.to(0);let t=0,i=r.split(/\r?\n/);for(let s of i)t+=1+Math.floor(Math.max(Qh(s)-1,0)/e);return Zs.lines(t)}});var de=a((Jc,Qs)=>{"use strict";var Ce={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},eu={arrowUp:Ce.arrowUp,arrowDown:Ce.arrowDown,arrowLeft:Ce.arrowLeft,arrowRight:Ce.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},tu=process.platform==="win32"?eu:Ce;Qs.exports=tu});var tn=a((zc,en)=>{"use strict";var ve=S(),fe=de(),Yt=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"\u{1F603}".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}}),ru=r=>Yt[r]||Yt.default,Ie=Object.freeze({aborted:ve.red(fe.cross),done:ve.green(fe.tick),exited:ve.yellow(fe.cross),default:ve.cyan("?")}),iu=(r,e,t)=>e?Ie.aborted:t?Ie.exited:r?Ie.done:Ie.default,su=r=>ve.gray(r?fe.ellipsis:fe.pointerSmall),nu=(r,e)=>ve.gray(r?e?fe.pointerSmall:"+":fe.line);en.exports={styles:Yt,render:ru,symbols:Ie,symbol:iu,delimiter:su,item:nu}});var sn=a((Zc,rn)=>{"use strict";var ou=Ue();rn.exports=function(r,e){let t=String(ou(r)||"").split(/\r?\n/);return e?t.map(i=>Math.ceil(i.length/e)).reduce((i,s)=>i+s):t.length}});var on=a((Xc,nn)=>{"use strict";nn.exports=(r,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return(r||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=i||n[n.length-1].length+o.length+1<i?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
50
+ `),this.close()}_(t,e){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(hs.hide):this.out.write(Qh(this.outputText,this.out.columns)),super.render(),this.outputText=[os.symbol(this.done,this.aborted),ns.bold(this.msg),os.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:ns.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(tl.line+hs.to(0)+this.outputText))}};as.exports=Ie});var fs=a((Qa,ds)=>{"use strict";ds.exports={TextPrompt:Xi(),SelectPrompt:ir(),TogglePrompt:lr(),DatePrompt:Fr(),NumberPrompt:kr(),MultiselectPrompt:qe(),AutocompletePrompt:ts(),AutocompleteMultiselectPrompt:ss(),ConfirmPrompt:cs()}});var ms=a(ps=>{"use strict";var _=ps,el=fs(),Lt=i=>i;function B(i,t,e={}){return new Promise((r,s)=>{let o=new el[i](t),n=e.onAbort||Lt,h=e.onSubmit||Lt,l=e.onExit||Lt;o.on("state",t.onState||Lt),o.on("submit",u=>r(h(u))),o.on("exit",u=>r(l(u))),o.on("abort",u=>s(n(u)))})}_.text=i=>B("TextPrompt",i);_.password=i=>(i.style="password",_.text(i));_.invisible=i=>(i.style="invisible",_.text(i));_.number=i=>B("NumberPrompt",i);_.date=i=>B("DatePrompt",i);_.confirm=i=>B("ConfirmPrompt",i);_.list=i=>{let t=i.separator||",";return B("TextPrompt",i,{onSubmit:e=>e.split(t).map(r=>r.trim())})};_.toggle=i=>B("TogglePrompt",i);_.select=i=>B("SelectPrompt",i);_.multiselect=i=>{i.choices=[].concat(i.choices||[]);let t=e=>e.filter(r=>r.selected).map(r=>r.value);return B("MultiselectPrompt",i,{onAbort:t,onSubmit:t})};_.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let t=e=>e.filter(r=>r.selected).map(r=>r.value);return B("AutocompleteMultiselectPrompt",i,{onAbort:t,onSubmit:t})};var il=(i,t)=>Promise.resolve(t.filter(e=>e.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));_.autocomplete=i=>(i.suggest=i.suggest||il,i.choices=[].concat(i.choices||[]),B("AutocompletePrompt",i))});var Os=a((ec,Ss)=>{"use strict";function gs(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),e.push.apply(e,r)}return e}function bs(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?gs(Object(e),!0).forEach(function(r){rl(i,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):gs(Object(e)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(e,r))})}return i}function rl(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function sl(i,t){var e=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!e){if(Array.isArray(i)||(e=nl(i))||t&&i&&typeof i.length=="number"){e&&(i=e);var r=0,s=function(){};return{s,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(u){throw u},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
51
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,n=!1,h;return{s:function(){e=e.call(i)},n:function(){var u=e.next();return o=u.done,u},e:function(u){n=!0,h=u},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(n)throw h}}}}function nl(i,t){if(i){if(typeof i=="string")return vs(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return vs(i,t)}}function vs(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,r=new Array(t);e<t;e++)r[e]=i[e];return r}function ws(i,t,e,r,s,o,n){try{var h=i[o](n),l=h.value}catch(u){e(u);return}h.done?t(l):Promise.resolve(l).then(r,s)}function ys(i){return function(){var t=this,e=arguments;return new Promise(function(r,s){var o=i.apply(t,e);function n(l){ws(o,r,s,n,h,"next",l)}function h(l){ws(o,r,s,n,h,"throw",l)}n(void 0)})}}var De=ms(),ol=["suggest","format","onState","validate","onRender","type"],xs=()=>{};function et(){return Ee.apply(this,arguments)}function Ee(){return Ee=ys(function*(i=[],{onSubmit:t=xs,onCancel:e=xs}={}){let r={},s=et._override||{};i=[].concat(i);let o,n,h,l,u,S,m=function(){var D=ys(function*(O,k,T=!1){if(!(!T&&O.validate&&O.validate(k)!==!0))return O.format?yield O.format(k,r):k});return function(k,T){return D.apply(this,arguments)}}();var c=sl(i),p;try{for(c.s();!(p=c.n()).done;){n=p.value;var q=n;if(l=q.name,u=q.type,typeof u=="function"&&(u=yield u(o,bs({},r),n),n.type=u),!!u){for(let D in n){if(ol.includes(D))continue;let O=n[D];n[D]=typeof O=="function"?yield O(o,bs({},r),S):O}if(S=n,typeof n.message!="string")throw new Error("prompt message is required");var ft=n;if(l=ft.name,u=ft.type,De[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(s[n.name]!==void 0&&(o=yield m(n,s[n.name]),o!==void 0)){r[l]=o;continue}try{o=et._injected?hl(et._injected,n.initial):yield De[u](n),r[l]=o=yield m(n,o,!0),h=yield t(n,o,r)}catch{h=!(yield e(n,r))}if(h)return r}}}catch(D){c.e(D)}finally{c.f()}return r}),Ee.apply(this,arguments)}function hl(i,t){let e=i.shift();if(e instanceof Error)throw e;return e===void 0?t:e}function ll(i){et._injected=(et._injected||[]).concat(i)}function ul(i){et._override=Object.assign({},i)}Ss.exports=Object.assign(et,{prompt:et,prompts:De,inject:ll,override:ul})});var qs=a((ic,$s)=>{"use strict";$s.exports=(i,t)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(t){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var Bt=a((rc,Ts)=>{"use strict";Ts.exports=i=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),e=new RegExp(t,"g");return typeof i=="string"?i.replace(e,""):i}});var _s=a((sc,Ps)=>{"use strict";var al=Bt(),{erase:Ms,cursor:cl}=x(),dl=i=>[...al(i)].length;Ps.exports=function(i,t){if(!t)return Ms.line+cl.to(0);let e=0,r=i.split(/\r?\n/);for(let s of r)e+=1+Math.floor(Math.max(dl(s)-1,0)/t);return Ms.lines(e)}});var ot=a((nc,Cs)=>{"use strict";var Ot={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},fl={arrowUp:Ot.arrowUp,arrowDown:Ot.arrowDown,arrowLeft:Ot.arrowLeft,arrowRight:Ot.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},pl=process.platform==="win32"?fl:Ot;Cs.exports=pl});var Ds=a((oc,Is)=>{"use strict";var ct=w(),ht=ot(),Ae=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}`}}),ml=i=>Ae[i]||Ae.default,$t=Object.freeze({aborted:ct.red(ht.cross),done:ct.green(ht.tick),exited:ct.yellow(ht.cross),default:ct.cyan("?")}),gl=(i,t,e)=>t?$t.aborted:e?$t.exited:i?$t.done:$t.default,bl=i=>ct.gray(i?ht.ellipsis:ht.pointerSmall),vl=(i,t)=>ct.gray(i?t?ht.pointerSmall:"+":ht.line);Is.exports={styles:Ae,render:ml,symbols:$t,symbol:gl,delimiter:bl,item:vl}});var As=a((hc,Es)=>{"use strict";var wl=Bt();Es.exports=function(i,t){let e=String(wl(i)||"").split(/\r?\n/);return t?e.map(r=>Math.ceil(r.length/t)).reduce((r,s)=>r+s):e.length}});var Rs=a((lc,js)=>{"use strict";js.exports=(i,t={})=>{let e=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",r=t.width;return(i||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((o,n)=>(n.length+e.length>=r||o[o.length-1].length+n.length+1<r?o[o.length-1]+=` ${n}`:o.push(`${e}${n}`),o),[e]).join(`
105
52
  `)).join(`
106
- `)}});var hn=a((Kc,ln)=>{"use strict";ln.exports=(r,e,t)=>{t=t||e;let i=Math.min(e-t,r-Math.floor(t/2));i<0&&(i=0);let s=Math.min(i+t,e);return{startIndex:i,endIndex:s}}});var F=a((Qc,un)=>{"use strict";un.exports={action:Js(),clear:Ks(),style:tn(),strip:Ue(),figures:de(),lines:sn(),wrap:on(),entriesToDisplay:hn()}});var Q=a((ed,cn)=>{"use strict";var an=require("readline"),{action:lu}=F(),hu=require("events"),{beep:uu,cursor:au}=O(),cu=S(),Vt=class extends hu{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=an.createInterface({input:this.in,escapeCodeTimeout:50});an.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(n,o)=>{let l=lu(o,i);l===!1?this._&&this._(n,o):typeof this[l]=="function"?this[l](o):this.bell()};this.close=()=>{this.out.write(au.show),this.in.removeListener("keypress",s),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",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(uu)}render(){this.onRender(cu),this.firstRender&&(this.firstRender=!1)}};cn.exports=Vt});var fn=a((td,dn)=>{var We=S(),du=Q(),{erase:fu,cursor:De}=O(),{style:kt,clear:Ut,lines:pu,figures:mu}=F(),Wt=class extends du{constructor(e={}){super(e),this.transform=kt.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=Ut("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=We.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!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(`
107
- `),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(`
108
- `),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 i=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${i}${e}${s}`,this.red=!1,this.cursor=this.placeholder?0:i.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(De.down(pu(this.outputError,this.out.columns)-1)+Ut(this.outputError,this.out.columns)),this.out.write(Ut(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[kt.symbol(this.done,this.aborted),We.bold(this.msg),kt.delimiter(this.done),this.red?We.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
109
- `).reduce((e,t,i)=>e+`
110
- ${i?" ":mu.pointerSmall} ${We.red().italic(t)}`,"")),this.out.write(fu.line+De.to(0)+this.outputText+De.save+this.outputError+De.restore+De.move(this.cursorOffset,0)))}};dn.exports=Wt});var vn=a((rd,gn)=>{"use strict";var ee=S(),gu=Q(),{style:pn,clear:mn,figures:Ge,wrap:vu,entriesToDisplay:bu}=F(),{cursor:wu}=O(),Gt=class extends gu{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,i)=>(typeof t=="string"&&(t={title:t,value:i}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?i: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=mn("",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(`
53
+ `)}});var Ls=a((uc,Fs)=>{"use strict";Fs.exports=(i,t,e)=>{e=e||t;let r=Math.min(t-e,i-Math.floor(e/2));r<0&&(r=0);let s=Math.min(r+e,t);return{startIndex:r,endIndex:s}}});var A=a((ac,Bs)=>{"use strict";Bs.exports={action:qs(),clear:_s(),style:Ds(),strip:Bt(),figures:ot(),lines:As(),wrap:Rs(),entriesToDisplay:Ls()}});var Z=a((cc,Hs)=>{"use strict";var Ys=require("readline"),{action:yl}=A(),xl=require("events"),{beep:Sl,cursor:Ol}=x(),$l=w(),je=class extends xl{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);let e=Ys.createInterface({input:this.in,escapeCodeTimeout:50});Ys.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);let r=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(o,n)=>{let h=yl(n,r);h===!1?this._&&this._(o,n):typeof this[h]=="function"?this[h](n):this.bell()};this.close=()=>{this.out.write(Ol.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Sl)}render(){this.onRender($l),this.firstRender&&(this.firstRender=!1)}};Hs.exports=je});var Vs=a((dc,Ns)=>{var Yt=w(),ql=Z(),{erase:Tl,cursor:qt}=x(),{style:Re,clear:Fe,lines:Ml,figures:Pl}=A(),Le=class extends ql{constructor(t={}){super(t),this.transform=Re.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=Fe("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=Yt.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
54
+ `),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
55
+ `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,e){let r=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${r}${t}${s}`,this.red=!1,this.cursor=this.placeholder?0:r.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),e=this.value.slice(this.cursor);this.value=`${t}${e}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor+1);this.value=`${t}${e}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(qt.down(Ml(this.outputError,this.out.columns)-1)+Fe(this.outputError,this.out.columns)),this.out.write(Fe(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Re.symbol(this.done,this.aborted),Yt.bold(this.msg),Re.delimiter(this.done),this.red?Yt.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
56
+ `).reduce((t,e,r)=>t+`
57
+ ${r?" ":Pl.pointerSmall} ${Yt.red().italic(e)}`,"")),this.out.write(Tl.line+qt.to(0)+this.outputText+qt.save+this.outputError+qt.restore+qt.move(this.cursorOffset,0)))}};Ns.exports=Le});var Js=a((fc,Gs)=>{"use strict";var X=w(),_l=Z(),{style:ks,clear:Us,figures:Ht,wrap:Cl,entriesToDisplay:Il}=A(),{cursor:Dl}=x(),Be=class extends _l{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((e,r)=>(typeof e=="string"&&(e={title:e,value:r}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?r:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Us("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
111
58
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
112
- `),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(wu.hide):this.out.write(mn(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=bu(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[pn.symbol(this.done,this.aborted),ee.bold(this.msg),pn.delimiter(!1),this.done?this.selection.title:this.selection.disabled?ee.yellow(this.warn):ee.gray(this.hint)].join(" "),!this.done){this.outputText+=`
113
- `;for(let i=e;i<t;i++){let s,n,o="",l=this.choices[i];i===e&&e>0?n=Ge.arrowUp:i===t-1&&t<this.choices.length?n=Ge.arrowDown:n=" ",l.disabled?(s=this.cursor===i?ee.gray().underline(l.title):ee.strikethrough().gray(l.title),n=(this.cursor===i?ee.bold().gray(Ge.pointer)+" ":" ")+n):(s=this.cursor===i?ee.cyan().underline(l.title):l.title,n=(this.cursor===i?ee.cyan(Ge.pointer)+" ":" ")+n,l.description&&this.cursor===i&&(o=` - ${l.description}`,(n.length+s.length+o.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(o=`
114
- `+vu(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${s}${ee.gray(o)}
115
- `}}this.out.write(this.outputText)}};gn.exports=Gt});var xn=a((id,yn)=>{var Je=S(),yu=Q(),{style:bn,clear:xu}=F(),{cursor:wn,erase:Su}=O(),Jt=class extends yu{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(`
59
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,e){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Dl.hide):this.out.write(Us(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=Il(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[ks.symbol(this.done,this.aborted),X.bold(this.msg),ks.delimiter(!1),this.done?this.selection.title:this.selection.disabled?X.yellow(this.warn):X.gray(this.hint)].join(" "),!this.done){this.outputText+=`
60
+ `;for(let r=t;r<e;r++){let s,o,n="",h=this.choices[r];r===t&&t>0?o=Ht.arrowUp:r===e-1&&e<this.choices.length?o=Ht.arrowDown:o=" ",h.disabled?(s=this.cursor===r?X.gray().underline(h.title):X.strikethrough().gray(h.title),o=(this.cursor===r?X.bold().gray(Ht.pointer)+" ":" ")+o):(s=this.cursor===r?X.cyan().underline(h.title):h.title,o=(this.cursor===r?X.cyan(Ht.pointer)+" ":" ")+o,h.description&&this.cursor===r&&(n=` - ${h.description}`,(o.length+s.length+n.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(n=`
61
+ `+Cl(h.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${s}${X.gray(n)}
62
+ `}}this.out.write(this.outputText)}};Gs.exports=Be});var Zs=a((pc,Ks)=>{var Nt=w(),El=Z(),{style:zs,clear:Al}=A(),{cursor:Ws,erase:jl}=x(),Ye=class extends El{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
116
63
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
117
- `),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(wn.hide):this.out.write(xu(this.outputText,this.out.columns)),super.render(),this.outputText=[bn.symbol(this.done,this.aborted),Je.bold(this.msg),bn.delimiter(this.done),this.value?this.inactive:Je.cyan().underline(this.inactive),Je.gray("/"),this.value?Je.cyan().underline(this.active):this.active].join(" "),this.out.write(Su.line+wn.to(0)+this.outputText))}};yn.exports=Jt});var k=a((sd,Sn)=>{"use strict";var zt=class r{constructor({token:e,date:t,parts:i,locales:s}){this.token=e,this.date=t||new Date,this.parts=i||[this],this.locales=s||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,i)=>i>e&&t instanceof r)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((i,s)=>s>t&&i instanceof r)}toString(){return String(this.date)}};Sn.exports=zt});var On=a((nd,_n)=>{"use strict";var _u=k(),Zt=class extends _u{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}};_n.exports=Zt});var $n=a((od,Tn)=>{"use strict";var Ou=k(),Tu=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),Xt=class extends Ou{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+Tu(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};Tn.exports=Xt});var Mn=a((ld,qn)=>{"use strict";var $u=k(),Kt=class extends $u{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}};qn.exports=Kt});var Pn=a((hd,En)=>{"use strict";var qu=k(),Qt=class extends qu{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)}};En.exports=Qt});var In=a((ud,Cn)=>{"use strict";var Mu=k(),er=class extends Mu{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}};Cn.exports=er});var An=a((ad,Dn)=>{"use strict";var Eu=k(),tr=class extends Eu{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)}};Dn.exports=tr});var Ln=a((cd,jn)=>{"use strict";var Pu=k(),rr=class extends Pu{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}};jn.exports=rr});var Fn=a((dd,Rn)=>{"use strict";var Cu=k(),ir=class extends Cu{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}};Rn.exports=ir});var Hn=a((fd,Nn)=>{"use strict";Nn.exports={DatePart:k(),Meridiem:On(),Day:$n(),Hours:Mn(),Milliseconds:Pn(),Minutes:In(),Month:An(),Seconds:Ln(),Year:Fn()}});var Gn=a((pd,Wn)=>{"use strict";var sr=S(),Iu=Q(),{style:Bn,clear:Yn,figures:Du}=F(),{erase:Au,cursor:Vn}=O(),{DatePart:kn,Meridiem:ju,Day:Lu,Hours:Ru,Milliseconds:Fu,Minutes:Nu,Month:Hu,Seconds:Bu,Year:Yu}=Hn(),Vu=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Un={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new Lu(r),3:r=>new Hu(r),4:r=>new Yu(r),5:r=>new ju(r),6:r=>new Ru(r),7:r=>new Nu(r),8:r=>new Bu(r),9:r=>new Fu(r)},ku={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(",")},nr=class extends Iu{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(ku,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=Yn("",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=Vu.exec(e);){let s=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in Un?Un[n]({token:t[n]||s,date:this.date,parts:this.parts,locales:this.locales}):t[n]||s)}let i=this.parts.reduce((s,n)=>(typeof n=="string"&&typeof s[s.length-1]=="string"?s[s.length-1]+=n:s.push(n),s),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof kn)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
118
- `),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(`
119
- `),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 kn)),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(Vn.hide):this.out.write(Yn(this.outputText,this.out.columns)),super.render(),this.outputText=[Bn.symbol(this.done,this.aborted),sr.bold(this.msg),Bn.delimiter(!1),this.parts.reduce((e,t,i)=>e.concat(i===this.cursor&&!this.done?sr.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
120
- `).reduce((e,t,i)=>e+`
121
- ${i?" ":Du.pointerSmall} ${sr.red().italic(t)}`,"")),this.out.write(Au.line+Vn.to(0)+this.outputText))}};Wn.exports=nr});var Xn=a((md,Zn)=>{var ze=S(),Uu=Q(),{cursor:Ze,erase:Wu}=O(),{style:or,figures:Gu,clear:Jn,lines:Ju}=F(),zu=/[0-9]/,lr=r=>r!==void 0,zn=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},hr=class extends Uu{constructor(e={}){super(e),this.transform=or.render(e.style),this.msg=e.message,this.initial=lr(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=lr(e.min)?e.min:-1/0,this.max=lr(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=ze.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${zn(e,this.round)}`),this._value=zn(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||zu.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(`
122
- `),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(`
123
- `),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 i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,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(Ze.down(Ju(this.outputError,this.out.columns)-1)+Jn(this.outputError,this.out.columns)),this.out.write(Jn(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[or.symbol(this.done,this.aborted),ze.bold(this.msg),or.delimiter(this.done),!this.done||!this.done&&!this.placeholder?ze[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
124
- `).reduce((e,t,i)=>e+`
125
- ${i?" ":Gu.pointerSmall} ${ze.red().italic(t)}`,"")),this.out.write(Wu.line+Ze.to(0)+this.outputText+Ze.save+this.outputError+Ze.restore))}};Zn.exports=hr});var ar=a((gd,eo)=>{"use strict";var U=S(),{cursor:Zu}=O(),Xu=Q(),{clear:Kn,figures:le,style:Qn,wrap:Ku,entriesToDisplay:Qu}=F(),ur=class extends Xu{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,i)=>(typeof t=="string"&&(t={title:t,value:i}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?i:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=Kn("",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(`
126
- `),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(`
127
- `),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:`
64
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,e){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Ws.hide):this.out.write(Al(this.outputText,this.out.columns)),super.render(),this.outputText=[zs.symbol(this.done,this.aborted),Nt.bold(this.msg),zs.delimiter(this.done),this.value?this.inactive:Nt.cyan().underline(this.inactive),Nt.gray("/"),this.value?Nt.cyan().underline(this.active):this.active].join(" "),this.out.write(jl.line+Ws.to(0)+this.outputText))}};Ks.exports=Ye});var Y=a((mc,Xs)=>{"use strict";var He=class i{constructor({token:t,date:e,parts:r,locales:s}){this.token=t,this.date=e||new Date,this.parts=r||[this],this.locales=s||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((e,r)=>r>t&&e instanceof i)}setTo(t){}prev(){let t=[].concat(this.parts).reverse(),e=t.indexOf(this);return t.find((r,s)=>s>e&&r instanceof i)}toString(){return String(this.date)}};Xs.exports=He});var tn=a((gc,Qs)=>{"use strict";var Rl=Y(),Ne=class extends Rl{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}};Qs.exports=Ne});var rn=a((bc,en)=>{"use strict";var Fl=Y(),Ll=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),Ve=class extends Fl{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),e=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+Ll(t):this.token==="d"?e+1:this.token==="ddd"?this.locales.weekdaysShort[e]:this.token==="dddd"?this.locales.weekdays[e]:t}};en.exports=Ve});var nn=a((vc,sn)=>{"use strict";var Bl=Y(),ke=class extends Bl{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}};sn.exports=ke});var hn=a((wc,on)=>{"use strict";var Yl=Y(),Ue=class extends Yl{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};on.exports=Ue});var un=a((yc,ln)=>{"use strict";var Hl=Y(),Ge=class extends Hl{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}};ln.exports=Ge});var cn=a((xc,an)=>{"use strict";var Nl=Y(),Je=class extends Nl{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),e=this.token.length;return e===2?String(t+1).padStart(2,"0"):e===3?this.locales.monthsShort[t]:e===4?this.locales.months[t]:String(t+1)}};an.exports=Je});var fn=a((Sc,dn)=>{"use strict";var Vl=Y(),ze=class extends Vl{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}};dn.exports=ze});var mn=a((Oc,pn)=>{"use strict";var kl=Y(),We=class extends kl{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}};pn.exports=We});var bn=a(($c,gn)=>{"use strict";gn.exports={DatePart:Y(),Meridiem:tn(),Day:rn(),Hours:nn(),Milliseconds:hn(),Minutes:un(),Month:cn(),Seconds:fn(),Year:mn()}});var $n=a((qc,On)=>{"use strict";var Ke=w(),Ul=Z(),{style:vn,clear:wn,figures:Gl}=A(),{erase:Jl,cursor:yn}=x(),{DatePart:xn,Meridiem:zl,Day:Wl,Hours:Kl,Milliseconds:Zl,Minutes:Xl,Month:Ql,Seconds:tu,Year:eu}=bn(),iu=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Sn={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new Wl(i),3:i=>new Ql(i),4:i=>new eu(i),5:i=>new zl(i),6:i=>new Kl(i),7:i=>new Xl(i),8:i=>new tu(i),9:i=>new Zl(i)},ru={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(",")},Ze=class extends Ul{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(ru,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=wn("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let e;for(this.parts=[];e=iu.exec(t);){let s=e.shift(),o=e.findIndex(n=>n!=null);this.parts.push(o in Sn?Sn[o]({token:e[o]||s,date:this.date,parts:this.parts,locales:this.locales}):e[o]||s)}let r=this.parts.reduce((s,o)=>(typeof o=="string"&&typeof s[s.length-1]=="string"?s[s.length-1]+=o:s.push(o),s),[]);this.parts.splice(0),this.parts.push(...r),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex(t=>t instanceof xn)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
65
+ `),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
66
+ `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex(e=>e instanceof xn)),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(yn.hide):this.out.write(wn(this.outputText,this.out.columns)),super.render(),this.outputText=[vn.symbol(this.done,this.aborted),Ke.bold(this.msg),vn.delimiter(!1),this.parts.reduce((t,e,r)=>t.concat(r===this.cursor&&!this.done?Ke.cyan().underline(e.toString()):e),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
67
+ `).reduce((t,e,r)=>t+`
68
+ ${r?" ":Gl.pointerSmall} ${Ke.red().italic(e)}`,"")),this.out.write(Jl.line+yn.to(0)+this.outputText))}};On.exports=Ze});var Pn=a((Tc,Mn)=>{var Vt=w(),su=Z(),{cursor:kt,erase:nu}=x(),{style:Xe,figures:ou,clear:qn,lines:hu}=A(),lu=/[0-9]/,Qe=i=>i!==void 0,Tn=(i,t)=>{let e=Math.pow(10,t);return Math.round(i*e)/e},ti=class extends su{constructor(t={}){super(t),this.transform=Xe.render(t.style),this.msg=t.message,this.initial=Qe(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=Qe(t.min)?t.min:-1/0,this.max=Qe(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){!t&&t!==0?(this.placeholder=!0,this.rendered=Vt.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Tn(t,this.round)}`),this._value=Tn(t,this.round)),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t==="-"||t==="."&&this.float||lu.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==""?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
69
+ `),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let t=this.value;this.value=t!==""?t:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
70
+ `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(t,e){if(!this.valid(t))return this.bell();let r=Date.now();if(r-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=r,this.color="cyan",t===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(kt.down(hu(this.outputError,this.out.columns)-1)+qn(this.outputError,this.out.columns)),this.out.write(qn(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Xe.symbol(this.done,this.aborted),Vt.bold(this.msg),Xe.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Vt[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
71
+ `).reduce((t,e,r)=>t+`
72
+ ${r?" ":ou.pointerSmall} ${Vt.red().italic(e)}`,"")),this.out.write(nu.line+kt.to(0)+this.outputText+kt.save+this.outputError+kt.restore))}};Mn.exports=ti});var ii=a((Mc,In)=>{"use strict";var H=w(),{cursor:uu}=x(),au=Z(),{clear:_n,figures:it,style:Cn,wrap:cu,entriesToDisplay:du}=A(),ei=class extends au{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map((e,r)=>(typeof e=="string"&&(e={title:e,value:r}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?r:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=_n("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map(t=>!t.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(t=>t.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
73
+ `),this.close()}submit(){let t=this.value.filter(e=>e.selected);this.minSelected&&t.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
74
+ `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let t=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(e=>e.selected=t),this.render()}_(t,e){if(t===" ")this.handleSpaceToggle();else if(t==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
128
75
  Instructions:
129
- ${le.arrowUp}/${le.arrowDown}: Highlight option
130
- ${le.arrowLeft}/${le.arrowRight}/[space]: Toggle selection
76
+ ${it.arrowUp}/${it.arrowDown}: Highlight option
77
+ ${it.arrowLeft}/${it.arrowRight}/[space]: Toggle selection
131
78
  `+(this.maxChoices===void 0?` a: Toggle all
132
- `:"")+" enter/return: Complete answer":""}renderOption(e,t,i,s){let n=(t.selected?U.green(le.radioOn):le.radioOff)+" "+s+" ",o,l;return t.disabled?o=e===i?U.gray().underline(t.title):U.strikethrough().gray(t.title):(o=e===i?U.cyan().underline(t.title):t.title,e===i&&t.description&&(l=` - ${t.description}`,(n.length+o.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(l=`
133
- `+Ku(t.description,{margin:n.length,width:this.out.columns})))),n+o+U.gray(l||"")}paginateOptions(e){if(e.length===0)return U.red("No matches for this query.");let{startIndex:t,endIndex:i}=Qu(this.cursor,e.length,this.optionsPerPage),s,n=[];for(let o=t;o<i;o++)o===t&&t>0?s=le.arrowUp:o===i-1&&i<e.length?s=le.arrowDown:s=" ",n.push(this.renderOption(this.cursor,e[o],o,s));return`
134
- `+n.join(`
135
- `)}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=[U.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(U.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Zu.hide),super.render();let e=[Qn.symbol(this.done,this.aborted),U.bold(this.msg),Qn.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=U.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=Kn(e,this.out.columns)}};eo.exports=ur});var no=a((vd,so)=>{"use strict";var Ae=S(),ea=Q(),{erase:ta,cursor:to}=O(),{style:cr,clear:ro,figures:dr,wrap:ra,entriesToDisplay:ia}=F(),io=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),sa=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),na=(r,e)=>{let t=r.findIndex(i=>i.value===e||i.title===e);return t>-1?t:void 0},fr=class extends ea{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:na(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=cr.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=ro("",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=io(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),i=await t;if(this.completing!==t)return;this.suggestions=i.map((n,o,l)=>({title:sa(l,o),value:io(l,o),description:n.description})),this.completing=!1;let s=Math.max(i.length-1,0);this.moveSelect(Math.min(s,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(`
79
+ `:"")+" enter/return: Complete answer":""}renderOption(t,e,r,s){let o=(e.selected?H.green(it.radioOn):it.radioOff)+" "+s+" ",n,h;return e.disabled?n=t===r?H.gray().underline(e.title):H.strikethrough().gray(e.title):(n=t===r?H.cyan().underline(e.title):e.title,t===r&&e.description&&(h=` - ${e.description}`,(o.length+n.length+h.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(h=`
80
+ `+cu(e.description,{margin:o.length,width:this.out.columns})))),o+n+H.gray(h||"")}paginateOptions(t){if(t.length===0)return H.red("No matches for this query.");let{startIndex:e,endIndex:r}=du(this.cursor,t.length,this.optionsPerPage),s,o=[];for(let n=e;n<r;n++)n===e&&e>0?s=it.arrowUp:n===r-1&&r<t.length?s=it.arrowDown:s=" ",o.push(this.renderOption(this.cursor,t[n],n,s));return`
81
+ `+o.join(`
82
+ `)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");let t=[H.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(H.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(uu.hide),super.render();let t=[Cn.symbol(this.done,this.aborted),H.bold(this.msg),Cn.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=H.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=_n(t,this.out.columns)}};In.exports=ei});var Rn=a((Pc,jn)=>{"use strict";var Tt=w(),fu=Z(),{erase:pu,cursor:Dn}=x(),{style:ri,clear:En,figures:si,wrap:mu,entriesToDisplay:gu}=A(),An=(i,t)=>i[t]&&(i[t].value||i[t].title||i[t]),bu=(i,t)=>i[t]&&(i[t].title||i[t].value||i[t]),vu=(i,t)=>{let e=i.findIndex(r=>r.value===t||r.title===t);return e>-1?e:void 0},ni=class extends fu{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial=typeof t.initial=="number"?t.initial:vu(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=ri.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=En("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return typeof this._fb=="number"?t=this.choices[this._fb]:typeof this._fb=="string"&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=An(this.suggestions,t):this.value=this.fallback.value,this.fire()}async complete(t){let e=this.completing=this.suggest(this.input,this.choices),r=await e;if(this.completing!==e)return;this.suggestions=r.map((o,n,h)=>({title:bu(h,n),value:An(h,n),description:o.description})),this.completing=!1;let s=Math.max(r.length-1,0);this.moveSelect(Math.min(s,this.select)),t&&t()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
136
83
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
137
84
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
138
- `),this.close()}_(e,t){let i=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${i}${e}${s}`,this.cursor=i.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,i,s){let n,o=i?dr.arrowUp:s?dr.arrowDown:" ",l=t?Ae.cyan().underline(e.title):e.title;return o=(t?Ae.cyan(dr.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+l.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
139
- `+ra(e.description,{margin:3,width:this.out.columns}))),o+" "+l+Ae.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(to.hide):this.out.write(ro(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=ia(this.select,this.choices.length,this.limit);if(this.outputText=[cr.symbol(this.done,this.aborted,this.exited),Ae.bold(this.msg),cr.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 i=this.suggestions.slice(e,t).map((s,n)=>this.renderOption(s,this.select===n+e,n===0&&e>0,n+e===t-1&&t<this.choices.length)).join(`
85
+ `),this.close()}_(t,e){let r=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${r}${t}${s}`,this.cursor=r.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,e,r,s){let o,n=r?si.arrowUp:s?si.arrowDown:" ",h=e?Tt.cyan().underline(t.title):t.title;return n=(e?Tt.cyan(si.pointer)+" ":" ")+n,t.description&&(o=` - ${t.description}`,(n.length+h.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o=`
86
+ `+mu(t.description,{margin:3,width:this.out.columns}))),n+" "+h+Tt.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Dn.hide):this.out.write(En(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=gu(this.select,this.choices.length,this.limit);if(this.outputText=[ri.symbol(this.done,this.aborted,this.exited),Tt.bold(this.msg),ri.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,e).map((s,o)=>this.renderOption(s,this.select===o+t,o===0&&t>0,o+t===e-1&&e<this.choices.length)).join(`
140
87
  `);this.outputText+=`
141
- `+(i||Ae.gray(this.fallback.title))}this.out.write(ta.line+to.to(0)+this.outputText)}};so.exports=fr});var uo=a((bd,ho)=>{"use strict";var te=S(),{cursor:oa}=O(),la=ar(),{clear:oo,style:lo,figures:be}=F(),pr=class extends la{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=oo("",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(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(i=>i===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:`
88
+ `+(r||Tt.gray(this.fallback.title))}this.out.write(pu.line+Dn.to(0)+this.outputText)}};jn.exports=ni});var Yn=a((_c,Bn)=>{"use strict";var Q=w(),{cursor:wu}=x(),yu=ii(),{clear:Fn,style:Ln,figures:dt}=A(),oi=class extends yu{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=Fn("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(r=>this.inputValue?!!(typeof r.title=="string"&&r.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof r.value=="string"&&r.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let e=this.filteredOptions.findIndex(r=>r===t);this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){let t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
142
89
  Instructions:
143
- ${be.arrowUp}/${be.arrowDown}: Highlight option
144
- ${be.arrowLeft}/${be.arrowRight}/[space]: Toggle selection
90
+ ${dt.arrowUp}/${dt.arrowDown}: Highlight option
91
+ ${dt.arrowLeft}/${dt.arrowRight}/[space]: Toggle selection
145
92
  [a,b,c]/delete: Filter choices
146
93
  enter/return: Complete answer
147
94
  `:""}renderCurrentInput(){return`
148
- Filtered results for: ${this.inputValue?this.inputValue:te.gray("Enter something to filter")}
149
- `}renderOption(e,t,i){let s;return t.disabled?s=e===i?te.gray().underline(t.title):te.strikethrough().gray(t.title):s=e===i?te.cyan().underline(t.title):t.title,(t.selected?te.green(be.radioOn):be.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[te.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(te.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(oa.hide),super.render();let e=[lo.symbol(this.done,this.aborted),te.bold(this.msg),lo.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=te.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=oo(e,this.out.columns)}};ho.exports=pr});var mo=a((wd,po)=>{var ao=S(),ha=Q(),{style:co,clear:ua}=F(),{erase:aa,cursor:fo}=O(),mr=class extends ha{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(`
95
+ Filtered results for: ${this.inputValue?this.inputValue:Q.gray("Enter something to filter")}
96
+ `}renderOption(t,e,r){let s;return e.disabled?s=t===r?Q.gray().underline(e.title):Q.strikethrough().gray(e.title):s=t===r?Q.cyan().underline(e.title):e.title,(e.selected?Q.green(dt.radioOn):dt.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");let t=[Q.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(Q.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(wu.hide),super.render();let t=[Ln.symbol(this.done,this.aborted),Q.bold(this.msg),Ln.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=Q.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=Fn(t,this.out.columns)}};Bn.exports=oi});var Un=a((Cc,kn)=>{var Hn=w(),xu=Z(),{style:Nn,clear:Su}=A(),{erase:Ou,cursor:Vn}=x(),hi=class extends xu{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
150
97
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
151
- `),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(fo.hide):this.out.write(ua(this.outputText,this.out.columns)),super.render(),this.outputText=[co.symbol(this.done,this.aborted),ao.bold(this.msg),co.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:ao.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(aa.line+fo.to(0)+this.outputText))}};po.exports=mr});var vo=a((yd,go)=>{"use strict";go.exports={TextPrompt:fn(),SelectPrompt:vn(),TogglePrompt:xn(),DatePrompt:Gn(),NumberPrompt:Xn(),MultiselectPrompt:ar(),AutocompletePrompt:no(),AutocompleteMultiselectPrompt:uo(),ConfirmPrompt:mo()}});var wo=a(bo=>{"use strict";var j=bo,ca=vo(),Xe=r=>r;function W(r,e,t={}){return new Promise((i,s)=>{let n=new ca[r](e),o=t.onAbort||Xe,l=t.onSubmit||Xe,h=t.onExit||Xe;n.on("state",e.onState||Xe),n.on("submit",u=>i(l(u))),n.on("exit",u=>i(h(u))),n.on("abort",u=>s(o(u)))})}j.text=r=>W("TextPrompt",r);j.password=r=>(r.style="password",j.text(r));j.invisible=r=>(r.style="invisible",j.text(r));j.number=r=>W("NumberPrompt",r);j.date=r=>W("DatePrompt",r);j.confirm=r=>W("ConfirmPrompt",r);j.list=r=>{let e=r.separator||",";return W("TextPrompt",r,{onSubmit:t=>t.split(e).map(i=>i.trim())})};j.toggle=r=>W("TogglePrompt",r);j.select=r=>W("SelectPrompt",r);j.multiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(i=>i.selected).map(i=>i.value);return W("MultiselectPrompt",r,{onAbort:e,onSubmit:e})};j.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(i=>i.selected).map(i=>i.value);return W("AutocompleteMultiselectPrompt",r,{onAbort:e,onSubmit:e})};var da=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));j.autocomplete=r=>(r.suggest=r.suggest||da,r.choices=[].concat(r.choices||[]),W("AutocompletePrompt",r))});var So=a((Sd,xo)=>{"use strict";var gr=wo(),fa=["suggest","format","onState","validate","onRender","type"],yo=()=>{};async function he(r=[],{onSubmit:e=yo,onCancel:t=yo}={}){let i={},s=he._override||{};r=[].concat(r);let n,o,l,h,u,E,d=async(c,p,g=!1)=>{if(!(!g&&c.validate&&c.validate(p)!==!0))return c.format?await c.format(p,i):p};for(o of r)if({name:h,type:u}=o,typeof u=="function"&&(u=await u(n,{...i},o),o.type=u),!!u){for(let c in o){if(fa.includes(c))continue;let p=o[c];o[c]=typeof p=="function"?await p(n,{...i},E):p}if(E=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:h,type:u}=o,gr[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(s[o.name]!==void 0&&(n=await d(o,s[o.name]),n!==void 0)){i[h]=n;continue}try{n=he._injected?pa(he._injected,o.initial):await gr[u](o),i[h]=n=await d(o,n,!0),l=await e(o,n,i)}catch{l=!await t(o,i)}if(l)return i}return i}function pa(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function ma(r){he._injected=(he._injected||[]).concat(r)}function ga(r){he._override=Object.assign({},r)}xo.exports=Object.assign(he,{prompt:he,prompts:gr,inject:ma,override:ga})});var vr=a((_d,_o)=>{function va(r){r=(Array.isArray(r)?r:r.split(".")).map(Number);let e=0,t=process.versions.node.split(".").map(Number);for(;e<r.length;e++){if(t[e]>r[e])return!1;if(r[e]>t[e])return!0}return!1}_o.exports=va("8.6.0")?Ws():So()});var C=require("fs"),No=require("path"),we=D(require("process"),1),Ho=D(Hr(),1);var ae=!0,pe=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{},_e=0;if(pe.process&&pe.process.env&&pe.process.stdout){let{FORCE_COLOR:r,NODE_DISABLE_COLORS:e,NO_COLOR:t,TERM:i,COLORTERM:s}=pe.process.env;e||t||r==="0"?ae=!1:r==="1"||r==="2"||r==="3"?ae=!0:i==="dumb"?ae=!1:"CI"in pe.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(n=>n in pe.process.env)?ae=!0:ae=process.stdout.isTTY,ae&&(process.platform==="win32"||s&&(s==="truecolor"||s==="24bit")?_e=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?_e=2:_e=1)}var Br={enabled:ae,supportLevel:_e};function f(r,e,t=1){let i=`\x1B[${r}m`,s=`\x1B[${e}m`,n=new RegExp(`\\x1b\\[${e}m`,"g");return o=>Br.enabled&&Br.supportLevel>=t?i+(""+o).replace(n,i)+s:""+o}var qa=f(0,0),P=f(1,22),Ma=f(2,22),Ea=f(3,23),Pa=f(4,24),Ca=f(7,27),Ia=f(8,28),Da=f(9,29),Aa=f(30,39),ie=f(31,39),se=f(32,39),ja=f(33,39),La=f(34,39),Ra=f(35,39),Fa=f(36,39),Na=f(97,39),Ha=f(90,39),Ba=f(37,39),Ya=f(91,39),Va=f(92,39),ka=f(93,39),Ua=f(94,39),Wa=f(95,39),Yr=f(96,39),Ga=f(40,49),Ja=f(41,49),za=f(42,49),Za=f(43,49),Xa=f(44,49),Ka=f(45,49),Qa=f(46,49),ec=f(107,49),tc=f(100,49),rc=f(101,49),ic=f(102,49),sc=f(103,49),nc=f(104,49),oc=f(105,49),lc=f(106,49),hc=f(47,49);var Bo=D(Wr(),1),Yo=D(vr(),1),Vo=D(de(),1);var Lo=D(vr(),1);var Ro=D(de(),1);var Do=D(de(),1);var Ke=require("fs");function Qe(r){if(!(0,Ke.existsSync)(r))return!0;let e=(0,Ke.readdirSync)(r);return e.length===0||e.length===1&&e[0]===".git"}var To=require("child_process"),$o=require("fs"),qo=require("path"),Mo=D(require("process"),1);var et=require("fs"),br=require("path");function Oo(r,e){let t=JSON.parse((0,et.readFileSync)(r,"utf8"));t.name=e,(0,et.writeFileSync)(r,JSON.stringify(t,null,2))}function tt(r,e){let t=e.toLocaleLowerCase().replace(/\s/g,"-"),i=(0,br.join)(r,"package.json"),s=(0,br.join)(r,"src","manifest.json");Oo(s,t),Oo(i,t)}async function ba(r){let e=(0,qo.join)(r,".git");await $o.promises.rm(e,{recursive:!0,force:!0})}async function wa(r,e){let t=null;for(let i of r)try{await new Promise((s,n)=>{(0,To.exec)(`git clone ${i} ${e}`,async o=>{if(o){n(o);return}try{await ba(e),s()}catch(l){n(l)}})});return}catch(s){t=s}if(t)throw new Error("All URLs failed")}function ya(r){let{github:e,gitee:t}=r;return[t,e==null?void 0:e.replace("github.com","githubfast.com"),e].filter(Boolean)}async function Eo(r,e,t,i){var n;let s=ya(r.url);try{await wa(s,t)}catch{i.fail(`${P("\u6A21\u677F\u521B\u5EFA\u5931\u8D25\uFF01")}`),Mo.default.exit(1)}tt(t,e),(n=r.callBack)==null||n.call(r,t)}var wr=D(require("process"),1);function Po(){let r="Unibest-creator - \u5FEB\u901F\u521B\u5EFA unibest(uni-app) \u9879\u76EE",e="",t={r:59,g:209,b:145},i={r:43,g:76,b:238};for(let n=0;n<r.length;n++){let o=n/(r.length-1),l=Math.round(t.r+(i.r-t.r)*o),h=Math.round(t.g+(i.g-t.g)*o),u=Math.round(t.b+(i.b-t.b)*o);e+=`\x1B[38;2;${l};${h};${u}m${r[n]}\x1B[0m`}let s=wr.default.stdout.isTTY&&wr.default.stdout.getColorDepth()>8?e:Yr(r);console.log(),console.log(s),console.log()}var rt=D(require("process"),1);var yr=D(de(),1),xa=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],xr=class{constructor(e){this.message=e,this.interval=null}setFinishMessage(e){return e+" ".repeat(this.message.length-e.length)}start(){let e=0;return this.interval=setInterval(()=>{rt.default.stdout.write(`\r${xa[e%9]} ${this.message}`),e++},100),this}fail(e){this.interval&&(clearInterval(this.interval),rt.default.stdout.write(`\r${ie(yr.default.cross)} ${this.setFinishMessage(e)}
152
- `))}succeed(e){this.interval&&(clearInterval(this.interval),rt.default.stdout.write(`\r${se(yr.default.tick)} ${this.setFinishMessage(e)}
153
- `))}};function Co(r){return new xr(r)}var ue=D(require("fs"),1),Sr=D(require("path"),1),_r=(r,e,t)=>{for(let i of ue.readdirSync(r)){if(i===".git")continue;let s=Sr.resolve(r,i);if(ue.lstatSync(s).isDirectory()){e(s),ue.existsSync(s)&&_r(s,e,t);continue}t(s)}},Or=(r,e,t)=>{for(let i of ue.readdirSync(r)){if(i===".git")continue;let s=Sr.resolve(r,i);if(ue.lstatSync(s).isDirectory()){Or(s,e,t),e(s);continue}t(s)}};var Io=require("path");function Tr(r,e,t){return e==="install"?r==="yarn"?"yarn":`${r} install`:t?r==="npm"?`npm run ${e} -- ${t}`:`${r} ${e} ${t}`:r==="npm"?`npm run ${e}`:`${r} ${e}`}function $r(r,e,t,i){if(i.succeed(`${P("\u6A21\u677F\u521B\u5EFA\u5B8C\u6210\uFF01")}`),console.log(),r!==e){let s=(0,Io.relative)(e,r);console.log(` ${P(se(`cd ${s.includes(" ")?`"${s}"`:s}`))}`)}console.log(` ${P(se(Tr(t,"install")))}`),console.log(` ${P(se(Tr(t,"dev")))}`),console.log()}var it=r=>[{name:"shouldOverwrite",type:e=>Qe(r??e)?null:"toggle",message:e=>{let t=r??e;return`${t==="."?"\u5F53\u524D\u6587\u4EF6":`\u76EE\u6807\u6587\u4EF6"${t}"`}\u975E\u7A7A\uFF0C\u662F\u5426\u8986\u76D6\uFF1F`},initial:!1,active:"\u662F",inactive:"\u5426"},{name:"overwriteChecker",type:e=>{if(e===!1)throw new Error(`${ie(Do.default.cross)} ${P("\u64CD\u4F5C\u5DF2\u53D6\u6D88")}`);return null}}];var Ao=()=>[{name:"projectName",type:"text",message:"\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0:",initial:"unibest"},...it()];var st=[{title:`unibest${se("(\u63A8\u8350)")}`,description:"\u591A\u4E2ATAB\u7684\u5B8C\u6574\u9879\u76EE",value:{type:"unibest",url:{gitee:"https://gitee.com/codercup/unibest.git",github:"https://github.com/codercup/unibest.git"}}}];var jo=()=>({name:"templateType",type:"select",message:"\u8BF7\u9009\u62E9 uni-app \u6A21\u677F\uFF1F",hint:"\u4F7F\u7528\u65B9\u5411\u952E\u9009\u62E9\uFF0C\u56DE\u8F66\u786E\u8BA4",choices:[...st],initial:0});async function Fo(){let r=[...Ao(),jo()];return await(0,Lo.default)(r,{onCancel:()=>{throw new Error(`${ie(Ro.default.cross)} ${P("\u64CD\u4F5C\u5DF2\u53D6\u6D88")}`)}})}var je;async function Sa(){var E;Po();let r=(0,Bo.default)(we.default.argv.slice(2),{alias:{templateType:["t"]},string:["_"]}),e=r._[0],t={};if(e){let d=(E=st.find(c=>c.value.type===(r==null?void 0:r.t)))==null?void 0:E.value;!d&&(r!=null&&r.templateType)&&(console.log(`${ie(Vo.default.cross)} ${P(`\u672A\u83B7\u53D6\u5230${d}\u6A21\u677F`)}`),we.default.exit(1)),t={projectName:e,shouldOverwrite:Qe(e)?!0:(await(0,Yo.default)(it(e))).shouldOverwrite,templateType:d||{type:"custom"}}}else try{t=await Fo()}catch(d){console.log(d.message),we.default.exit(1)}je=Co(`${P("\u6B63\u5728\u521B\u5EFA\u6A21\u677F...")}`).start();let i=we.default.cwd(),s=(0,No.join)(i,t.projectName),n=we.default.env.npm_config_user_agent??"",o=/pnpm/.test(n)?"pnpm":/yarn/.test(n)?"yarn":"npm";function l(d){(0,C.existsSync)(d)&&Or(d,c=>(0,C.rmdirSync)(c),c=>(0,C.unlinkSync)(c))}if((0,C.existsSync)(s)&&t.shouldOverwrite?l(s):(0,C.existsSync)(s)||(0,C.mkdirSync)(s),t.templateType.type!=="custom"){let{templateType:d,projectName:c}=t;await Eo(d,c,s,je),$r(s,i,o,je);return}let h=[],u={};for(let d of h)await d(u);_r(s,()=>{},d=>{if(d.endsWith(".ejs")){let c=(0,C.readFileSync)(d,"utf-8"),p=d.replace(/\.ejs$/,""),g=Ho.default.render(c,u[p]);(0,C.writeFileSync)(p,g),(0,C.unlinkSync)(d)}}),tt(s,t.projectName),$r(s,i,o,je)}Sa().catch(r=>{je.fail(`${P("\u6A21\u677F\u521B\u5EFA\u5931\u8D25\uFF01")}`),console.error(r)});
154
- /*! Bundled license information:
155
-
156
- ejs/lib/ejs.js:
157
- (**
158
- * @file Embedded JavaScript templating engine. {@link http://ejs.co}
159
- * @author Matthew Eernisse <mde@fleegix.org>
160
- * @author Tiancheng "Timothy" Gu <timothygu99@gmail.com>
161
- * @project EJS
162
- * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
163
- *)
164
- */
98
+ `),this.close()}_(t,e){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Vn.hide):this.out.write(Su(this.outputText,this.out.columns)),super.render(),this.outputText=[Nn.symbol(this.done,this.aborted),Hn.bold(this.msg),Nn.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Hn.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Ou.line+Vn.to(0)+this.outputText))}};kn.exports=hi});var Jn=a((Ic,Gn)=>{"use strict";Gn.exports={TextPrompt:Vs(),SelectPrompt:Js(),TogglePrompt:Zs(),DatePrompt:$n(),NumberPrompt:Pn(),MultiselectPrompt:ii(),AutocompletePrompt:Rn(),AutocompleteMultiselectPrompt:Yn(),ConfirmPrompt:Un()}});var Wn=a(zn=>{"use strict";var C=zn,$u=Jn(),Ut=i=>i;function N(i,t,e={}){return new Promise((r,s)=>{let o=new $u[i](t),n=e.onAbort||Ut,h=e.onSubmit||Ut,l=e.onExit||Ut;o.on("state",t.onState||Ut),o.on("submit",u=>r(h(u))),o.on("exit",u=>r(l(u))),o.on("abort",u=>s(n(u)))})}C.text=i=>N("TextPrompt",i);C.password=i=>(i.style="password",C.text(i));C.invisible=i=>(i.style="invisible",C.text(i));C.number=i=>N("NumberPrompt",i);C.date=i=>N("DatePrompt",i);C.confirm=i=>N("ConfirmPrompt",i);C.list=i=>{let t=i.separator||",";return N("TextPrompt",i,{onSubmit:e=>e.split(t).map(r=>r.trim())})};C.toggle=i=>N("TogglePrompt",i);C.select=i=>N("SelectPrompt",i);C.multiselect=i=>{i.choices=[].concat(i.choices||[]);let t=e=>e.filter(r=>r.selected).map(r=>r.value);return N("MultiselectPrompt",i,{onAbort:t,onSubmit:t})};C.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let t=e=>e.filter(r=>r.selected).map(r=>r.value);return N("AutocompleteMultiselectPrompt",i,{onAbort:t,onSubmit:t})};var qu=(i,t)=>Promise.resolve(t.filter(e=>e.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));C.autocomplete=i=>(i.suggest=i.suggest||qu,i.choices=[].concat(i.choices||[]),N("AutocompletePrompt",i))});var Xn=a((Ec,Zn)=>{"use strict";var li=Wn(),Tu=["suggest","format","onState","validate","onRender","type"],Kn=()=>{};async function rt(i=[],{onSubmit:t=Kn,onCancel:e=Kn}={}){let r={},s=rt._override||{};i=[].concat(i);let o,n,h,l,u,S,m=async(c,p,q=!1)=>{if(!(!q&&c.validate&&c.validate(p)!==!0))return c.format?await c.format(p,r):p};for(n of i)if({name:l,type:u}=n,typeof u=="function"&&(u=await u(o,{...r},n),n.type=u),!!u){for(let c in n){if(Tu.includes(c))continue;let p=n[c];n[c]=typeof p=="function"?await p(o,{...r},S):p}if(S=n,typeof n.message!="string")throw new Error("prompt message is required");if({name:l,type:u}=n,li[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(s[n.name]!==void 0&&(o=await m(n,s[n.name]),o!==void 0)){r[l]=o;continue}try{o=rt._injected?Mu(rt._injected,n.initial):await li[u](n),r[l]=o=await m(n,o,!0),h=await t(n,o,r)}catch{h=!await e(n,r)}if(h)return r}return r}function Mu(i,t){let e=i.shift();if(e instanceof Error)throw e;return e===void 0?t:e}function Pu(i){rt._injected=(rt._injected||[]).concat(i)}function _u(i){rt._override=Object.assign({},i)}Zn.exports=Object.assign(rt,{prompt:rt,prompts:li,inject:Pu,override:_u})});var ui=a((Ac,Qn)=>{function Cu(i){i=(Array.isArray(i)?i:i.split(".")).map(Number);let t=0,e=process.versions.node.split(".").map(Number);for(;t<i.length;t++){if(e[t]>i[t])return!1;if(i[t]>e[t])return!0}return!1}Qn.exports=Cu("8.6.0")?Os():Xn()});var V=require("fs"),bo=require("path"),Pt=I(require("process"),1);var st=!0,lt=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{},mt=0;if(lt.process&&lt.process.env&&lt.process.stdout){let{FORCE_COLOR:i,NODE_DISABLE_COLORS:t,NO_COLOR:e,TERM:r,COLORTERM:s}=lt.process.env;t||e||i==="0"?st=!1:i==="1"||i==="2"||i==="3"?st=!0:r==="dumb"?st=!1:"CI"in lt.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in lt.process.env)?st=!0:st=process.stdout.isTTY,st&&(process.platform==="win32"||s&&(s==="truecolor"||s==="24bit")?mt=3:r&&(r.endsWith("-256color")||r.endsWith("256"))?mt=2:mt=1)}var vi={enabled:st,supportLevel:mt};function d(i,t,e=1){let r=`\x1B[${i}m`,s=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return n=>vi.enabled&&vi.supportLevel>=e?r+(""+n).replace(o,r)+s:""+n}var Lu=d(0,0),M=d(1,22),Bu=d(2,22),Yu=d(3,23),Hu=d(4,24),Nu=d(7,27),Vu=d(8,28),ku=d(9,29),Uu=d(30,39),P=d(31,39),R=d(32,39),Gu=d(33,39),Ju=d(34,39),zu=d(35,39),Wu=d(36,39),Ku=d(97,39),Zu=d(90,39),Xu=d(37,39),Qu=d(91,39),ta=d(92,39),ea=d(93,39),ia=d(94,39),ra=d(95,39),wi=d(96,39),sa=d(40,49),na=d(41,49),oa=d(42,49),ha=d(43,49),la=d(44,49),ua=d(45,49),aa=d(46,49),ca=d(107,49),da=d(100,49),fa=d(101,49),pa=d(102,49),ma=d(103,49),ga=d(104,49),ba=d(105,49),va=d(106,49),wa=d(47,49);var vo=I(Oi(),1),wo=I(ui(),1),gi=I(ot(),1);var po=I(ui(),1);var mo=I(ot(),1);var ao=I(ot(),1);var Gt=require("fs");function Jt(i){if(!(0,Gt.existsSync)(i))return!0;let t=(0,Gt.readdirSync)(i);return t.length===0||t.length===1&&t[0]===".git"}var eo=require("child_process"),io=require("fs"),ro=require("path"),so=I(require("process"),1);var zt=require("fs"),to=require("path");function Iu(i,t){let e=JSON.parse((0,zt.readFileSync)(i,"utf8"));e.name=t,(0,zt.writeFileSync)(i,JSON.stringify(e,null,2))}function Wt(i,t){let e=t.toLocaleLowerCase().replace(/\s/g,"-"),r=(0,to.join)(i,"package.json");Iu(r,e)}async function Du(i){let t=(0,ro.join)(i,".git");await io.promises.rm(t,{recursive:!0,force:!0})}async function Eu(i,t,e){let r=null;for(let s of i)try{await new Promise((o,n)=>{let h=`git clone -b ${t} ${s} ${e}`;(0,eo.exec)(h,async l=>{if(l){console.error(`${P("exec error:")} ${l}`),n(l);return}try{await Du(e),o()}catch(u){n(u)}})});return}catch(o){console.error(`${P("cloneRepo error:")} ${o}`),r=o}if(r)throw new Error("All URLs failed")}function Au(i){let{github:t,gitee:e}=i;return[e,t].filter(Boolean)}async function no(i,t,e,r){var o;let s=Au(i.url);try{await Eu(s,i.branch||"main",e)}catch{r.fail(`${M("\u6A21\u677F\u521B\u5EFA\u5931\u8D25\uFF01")}`),so.default.exit(1)}Wt(e,t),(o=i.callBack)==null||o.call(i,e)}var ai=I(require("process"),1);function oo(){let i="Unibest-creator - \u5FEB\u901F\u521B\u5EFA unibest(uni-app) \u9879\u76EE",t="",e={r:59,g:209,b:145},r={r:43,g:76,b:238};for(let o=0;o<i.length;o++){let n=o/(i.length-1),h=Math.round(e.r+(r.r-e.r)*n),l=Math.round(e.g+(r.g-e.g)*n),u=Math.round(e.b+(r.b-e.b)*n);t+=`\x1B[38;2;${h};${l};${u}m${i[o]}\x1B[0m`}let s=ai.default.stdout.isTTY&&ai.default.stdout.getColorDepth()>8?t:wi(i);console.log(),console.log(s),console.log()}var Kt=I(require("process"),1);var ci=I(ot(),1),ju=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],di=class{constructor(t){this.message=t,this.interval=null}setFinishMessage(t){return t+" ".repeat(this.message.length-t.length)}start(){let t=0;return this.interval=setInterval(()=>{Kt.default.stdout.write(`\r${ju[t%9]} ${this.message}`),t++},100),this}fail(t){this.interval&&(clearInterval(this.interval),Kt.default.stdout.write(`\r${P(ci.default.cross)} ${this.setFinishMessage(t)}
99
+ `))}succeed(t){this.interval&&(clearInterval(this.interval),Kt.default.stdout.write(`\r${R(ci.default.tick)} ${this.setFinishMessage(t)}
100
+ `))}};function ho(i){return new di(i)}var Mt=I(require("fs"),1),lo=I(require("path"),1);var fi=(i,t,e)=>{for(let r of Mt.readdirSync(i)){if(r===".git")continue;let s=lo.resolve(i,r);if(Mt.lstatSync(s).isDirectory()){fi(s,t,e),t(s);continue}e(s)}};var uo=require("path");function pi(i,t,e){return t==="install"?i==="yarn"?"yarn":`${i} install`:e?i==="npm"?`npm run ${t} -- ${e}`:`${i} ${t} ${e}`:i==="npm"?`npm run ${t}`:`${i} ${t}`}function mi(i,t,e,r){if(r.succeed(`${M("\u6A21\u677F\u521B\u5EFA\u5B8C\u6210\uFF01")}`),console.log(),i!==t){let s=(0,uo.relative)(t,i);console.log(` ${M(R(`cd ${s.includes(" ")?`"${s}"`:s}`))}`)}console.log(` ${M(R(pi(e,"i")))}`),console.log(` ${M(R(pi(e,"dev")))}`),console.log()}var Zt=i=>[{name:"shouldOverwrite",type:t=>Jt(i??t)?null:"toggle",message:t=>{let e=i??t;return`${e==="."?"\u5F53\u524D\u6587\u4EF6":`\u76EE\u6807\u6587\u4EF6"${e}"`}\u975E\u7A7A\uFF0C\u662F\u5426\u8986\u76D6\uFF1F`},initial:!1,active:"\u662F",inactive:"\u5426"},{name:"overwriteChecker",type:t=>{if(t===!1)throw new Error(`${P(ao.default.cross)} ${M("\u64CD\u4F5C\u5DF2\u53D6\u6D88")}`);return null}}];var co=()=>[{name:"projectName",type:"text",message:"\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0:",initial:"unibest"},...Zt()];var Xt=[{title:`base${R("(\u63A8\u8350)")}`,description:`${P("(\u591ATAB base\u9879\u76EE)")}`,value:{type:"base",branch:"base",url:{gitee:"https://gitee.com/codercup/unibest.git",github:"https://github.com/codercup/unibest.git"}}},{title:`demo${R("(\u6F14\u793A\u9879\u76EE)")}`,description:`${P("(\u591ATAB\u6F14\u793A\u9879\u76EE)")}`,value:{type:"demo",branch:"demo",url:{gitee:"https://gitee.com/codercup/unibest.git",github:"https://github.com/codercup/unibest.git"}}},{title:`i18n${R("(\u591A\u8BED\u8A00)")}`,description:`${P("(\u591ATAB\u591A\u8BED\u8A00\u9879\u76EE)")}`,value:{type:"i18n",branch:"i18n",url:{gitee:"https://gitee.com/codercup/unibest.git",github:"https://github.com/codercup/unibest.git"}}}];var fo=()=>({name:"templateType",type:"select",message:"\u8BF7\u9009\u62E9 uni-app \u6A21\u677F\uFF1F",hint:"\u4F7F\u7528\u65B9\u5411\u952E\u9009\u62E9\uFF0C\u56DE\u8F66\u786E\u8BA4",choices:[...Xt],initial:0});async function go(){let i=[...co(),fo()];return await(0,po.default)(i,{onCancel:()=>{throw new Error(`${P(mo.default.cross)} ${M("\u64CD\u4F5C\u5DF2\u53D6\u6D88")}`)}})}var _t;async function Ru(){var u;oo();let i=(0,vo.default)(Pt.default.argv.slice(2),{alias:{templateType:["t"]},string:["_"]}),t=i._[0],e={};if(t){let S=(u=Xt.find(c=>c.value.type===(i==null?void 0:i.t)))==null?void 0:u.value;!S&&(i!=null&&i.templateType)&&(console.log(`${P(gi.default.cross)} ${M(`\u672A\u83B7\u53D6\u5230${i==null?void 0:i.templateType}\u6A21\u677F`)}`),Pt.default.exit(1));let m=()=>{throw new Error(`${P(gi.default.cross)} ${M("\u64CD\u4F5C\u5DF2\u53D6\u6D88")}`)};e={projectName:t,shouldOverwrite:Jt(t)?!0:(await(0,wo.default)(Zt(t),{onCancel:m})).shouldOverwrite,templateType:S||{type:"base",branch:"base",url:{gitee:"https://gitee.com/codercup/unibest.git",github:"https://github.com/codercup/unibest.git"}}}}else try{e=await go()}catch(S){console.log(S.message),Pt.default.exit(1)}_t=ho(`${M("\u6B63\u5728\u521B\u5EFA\u6A21\u677F...")}`).start();let r=Pt.default.cwd(),s=(0,bo.join)(r,e.projectName),o="pnpm";function n(S){(0,V.existsSync)(S)&&fi(S,m=>(0,V.rmdirSync)(m),m=>(0,V.unlinkSync)(m))}if((0,V.existsSync)(s)&&e.shouldOverwrite?n(s):(0,V.existsSync)(s)||(0,V.mkdirSync)(s),e.templateType.type!=="custom"){let{templateType:S,projectName:m}=e;await no(S,m,s,_t),mi(s,r,o,_t);return}let h=[],l={};for(let S of h)await S(l);Wt(s,e.projectName),mi(s,r,o,_t)}Ru().catch(i=>{_t.fail(`${M("\u6A21\u677F\u521B\u5EFA\u5931\u8D25\uFF01")}`),console.error(i)});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-unibest",
3
3
  "type": "module",
4
- "version": "1.0.1",
4
+ "version": "1.2.0",
5
5
  "packageManager": "pnpm@8.15.1",
6
6
  "description": "An easy way to start a unibest project",
7
7
  "author": "菲鸽 <1020103647@qq.com>",