create-unibest 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +96 -0
- package/outfile.cjs +164 -0
- package/package.json +66 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 菲鸽
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
|
|
2
|
+
<h1 align="center">✨💚create uni💚✨</h1>
|
|
3
|
+
|
|
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>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<h2 align="center">
|
|
11
|
+
<sub>>_ Easy to use create uni▌</sub>
|
|
12
|
+
</h2>
|
|
13
|
+
|
|
14
|
+
# 📦 使用
|
|
15
|
+
|
|
16
|
+
```shell
|
|
17
|
+
# npm
|
|
18
|
+
npm create uni@latest
|
|
19
|
+
|
|
20
|
+
# yarn
|
|
21
|
+
yarn create uni
|
|
22
|
+
|
|
23
|
+
# pnpm
|
|
24
|
+
pnpm create uni
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
> [!TIP]
|
|
28
|
+
> 建议添加上标记名(@latest),否则 npm 可能会解析到缓存的过时软件包版本。
|
|
29
|
+
|
|
30
|
+
## 📖 介绍
|
|
31
|
+
|
|
32
|
+
`create-uni` 是一个用于快速创建 uni-app 项目的轻量脚手架工具,它可以帮助你快速创建一个基于`vite`和`vue3`的`uni-app`项目,同时提供了一些模板供你选择。
|
|
33
|
+
|
|
34
|
+
<p align="center"><img src=".github/image/demo.png"></p>
|
|
35
|
+
|
|
36
|
+
## 🚤 快速使用
|
|
37
|
+
|
|
38
|
+
```shell
|
|
39
|
+
npm create uni <项目名称> --ts -m pinia -m uniUse -u ano -e
|
|
40
|
+
```
|
|
41
|
+
|
|
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>
|
|
96
|
+
|
package/outfile.cjs
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
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={"&":"&","<":"<",">":">",'"':""","'":"'"},Qo=/[&<>'"]/g;function el(r){return Ko[r]||r}var tl=`var _ENCODE_HTML_RULES = {
|
|
3
|
+
"&": "&"
|
|
4
|
+
, "<": "<"
|
|
5
|
+
, ">": ">"
|
|
6
|
+
, '"': """
|
|
7
|
+
, "'": "'"
|
|
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(`
|
|
57
|
+
`)).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(`
|
|
63
|
+
`),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(`
|
|
68
|
+
`),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:`
|
|
80
|
+
Instructions:
|
|
81
|
+
${ne.arrowUp}/${ne.arrowDown}: Highlight option
|
|
82
|
+
${ne.arrowLeft}/${ne.arrowRight}/[space]: Toggle selection
|
|
83
|
+
`+(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(`
|
|
88
|
+
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
89
|
+
`),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(`
|
|
92
|
+
`);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:`
|
|
94
|
+
Instructions:
|
|
95
|
+
${ge.arrowUp}/${ge.arrowDown}: Highlight option
|
|
96
|
+
${ge.arrowLeft}/${ge.arrowRight}/[space]: Toggle selection
|
|
97
|
+
[a,b,c]/delete: Filter choices
|
|
98
|
+
enter/return: Complete answer
|
|
99
|
+
`:""}renderCurrentInput(){return`
|
|
100
|
+
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(`
|
|
102
|
+
`),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(`
|
|
105
|
+
`)).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(`
|
|
111
|
+
`),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(`
|
|
116
|
+
`),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:`
|
|
128
|
+
Instructions:
|
|
129
|
+
${le.arrowUp}/${le.arrowDown}: Highlight option
|
|
130
|
+
${le.arrowLeft}/${le.arrowRight}/[space]: Toggle selection
|
|
131
|
+
`+(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(`
|
|
136
|
+
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
137
|
+
`),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(`
|
|
140
|
+
`);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:`
|
|
142
|
+
Instructions:
|
|
143
|
+
${be.arrowUp}/${be.arrowDown}: Highlight option
|
|
144
|
+
${be.arrowLeft}/${be.arrowRight}/[space]: Toggle selection
|
|
145
|
+
[a,b,c]/delete: Filter choices
|
|
146
|
+
enter/return: Complete answer
|
|
147
|
+
`:""}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(`
|
|
150
|
+
`),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
|
+
*/
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-unibest",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.1",
|
|
5
|
+
"packageManager": "pnpm@8.15.1",
|
|
6
|
+
"description": "An easy way to start a unibest project",
|
|
7
|
+
"author": "菲鸽 <1020103647@qq.com>",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"homepage": "https://github.com/codercup/create-unibest#readme",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/codercup/create-unibest.git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": "https://github.com/codercup/create-unibest/issues",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"uni",
|
|
17
|
+
"uni-app",
|
|
18
|
+
"unibest",
|
|
19
|
+
"create-unibest",
|
|
20
|
+
"cli",
|
|
21
|
+
"vue",
|
|
22
|
+
"miniapp"
|
|
23
|
+
],
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"bin": {
|
|
26
|
+
"create-unibest": "outfile.cjs"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"outfile.cjs"
|
|
30
|
+
],
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@antfu/ni": "^0.21.12",
|
|
33
|
+
"@antfu/utils": "^0.7.7",
|
|
34
|
+
"@types/ejs": "^3.1.5",
|
|
35
|
+
"@types/minimist": "^1.2.5",
|
|
36
|
+
"@types/node": "^18.19.11",
|
|
37
|
+
"@types/prompts": "^2.4.9",
|
|
38
|
+
"@uni-helper/eslint-config": "^0.0.5",
|
|
39
|
+
"bumpp": "^9.3.0",
|
|
40
|
+
"ejs": "^3.1.9",
|
|
41
|
+
"esbuild": "^0.18.20",
|
|
42
|
+
"eslint": "^8.56.0",
|
|
43
|
+
"kolorist": "^1.8.0",
|
|
44
|
+
"lint-staged": "^15.2.1",
|
|
45
|
+
"minimist": "^1.2.8",
|
|
46
|
+
"pnpm": "^8.15.1",
|
|
47
|
+
"prompts": "^2.4.2",
|
|
48
|
+
"simple-git-hooks": "^2.9.0",
|
|
49
|
+
"typescript": "^5.3.3"
|
|
50
|
+
},
|
|
51
|
+
"simple-git-hooks": {
|
|
52
|
+
"pre-commit": "pnpm lint-staged"
|
|
53
|
+
},
|
|
54
|
+
"lint-staged": {
|
|
55
|
+
"*": "eslint --fix"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "node scripts/build.js",
|
|
59
|
+
"dev": "node outfile.cjs",
|
|
60
|
+
"lint": "eslint .",
|
|
61
|
+
"lint:fix": "eslint --fix .",
|
|
62
|
+
"release": "bumpp",
|
|
63
|
+
"typecheck": "tsc --noEmit",
|
|
64
|
+
"up": "cd ./template && pnpx taze@latest major -w -r && cd ./base && pnpx @dcloudio/uvm@latest --manager pnpm"
|
|
65
|
+
}
|
|
66
|
+
}
|