@mahameru/cli 0.0.11 → 0.0.13
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/README.md +5 -1
- package/dist/index.js +629 -416
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* ┌────────────────────────────────────────────┐
|
|
4
4
|
* │ │
|
|
5
5
|
* │ ▲ MahameruJS - CLI UTILITY │
|
|
6
|
-
* │ Version: 0.0.
|
|
6
|
+
* │ Version: 0.0.13 │
|
|
7
7
|
* │ Built: 2026 │
|
|
8
8
|
* │ │
|
|
9
9
|
* │ Copyright (c) Bintan <hello@bintvn.co> │
|
|
@@ -11,14 +11,20 @@
|
|
|
11
11
|
* │ │
|
|
12
12
|
* └────────────────────────────────────────────┘
|
|
13
13
|
*/
|
|
14
|
-
import{default as t,spawn as e}from"node:child_process"
|
|
15
|
-
;import{default as
|
|
16
|
-
;import{default as h
|
|
17
|
-
;import{
|
|
18
|
-
;import{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
import{default as t,spawn as e}from"node:child_process"
|
|
15
|
+
;import{default as i,join as s,relative as r,resolve as n,sep as o}from"node:path"
|
|
16
|
+
;import{default as a,existsSync as l,readFileSync as h,readdirSync as c,statSync as u}from"node:fs"
|
|
17
|
+
;import{stat as d,unwatchFile as p,watch as m,watchFile as f}from"fs"
|
|
18
|
+
;import{lstat as g,open as _,readdir as v,realpath as w,stat as b}from"fs/promises"
|
|
19
|
+
;import{EventEmitter as y}from"events"
|
|
20
|
+
;import{basename as x,dirname as O,extname as C,isAbsolute as E,join as T,normalize as A,relative as S,resolve as P}from"path"
|
|
21
|
+
;import{lstat as k,readdir as R,realpath as I,stat as $}from"node:fs/promises";import{Readable as D}from"node:stream"
|
|
22
|
+
;import{type as H}from"os";import{default as W}from"node:process";import{stripVTControlCharacters as M}from"node:util"
|
|
23
|
+
;import{default as F}from"node:os";import{default as N}from"node:tty";import{pathToFileURL as j}from"node:url"
|
|
24
|
+
;import{EventEmitter as G}from"node:events";var V={991(t){
|
|
25
|
+
let e=process||{},i=e.argv||[],s=e.env||{},r=!(s.NO_COLOR||i.includes("--no-color"))&&(!!s.FORCE_COLOR||i.includes("--color")||"win32"===e.platform||(e.stdout||{}).isTTY&&"dumb"!==s.TERM||!!s.CI),n=(t,e,i=t)=>s=>{
|
|
26
|
+
let r=""+s,n=r.indexOf(e,t.length);return~n?t+o(r,e,i,n)+e:t+r+e},o=(t,e,i,s)=>{let r="",n=0;do{r+=t.substring(n,s)+i,
|
|
27
|
+
n=s+e.length,s=t.indexOf(e,n)}while(~s);return r+t.substring(n)},a=(t=r)=>{let e=t?n:()=>String;return{
|
|
22
28
|
isColorSupported:t,reset:e("[0m","[0m"),bold:e("[1m","[22m","[22m[1m"),dim:e("[2m","[22m","[22m[2m"),
|
|
23
29
|
italic:e("[3m","[23m"),underline:e("[4m","[24m"),inverse:e("[7m","[27m"),hidden:e("[8m","[28m"),
|
|
24
30
|
strikethrough:e("[9m","[29m"),black:e("[30m","[39m"),red:e("[31m","[39m"),green:e("[32m","[39m"),
|
|
@@ -30,257 +36,448 @@ greenBright:e("[92m","[39m"),yellowBright:e("[93m","[39m"),blueBright:e("[9
|
|
|
30
36
|
magentaBright:e("[95m","[39m"),cyanBright:e("[96m","[39m"),whiteBright:e("[97m","[39m"),
|
|
31
37
|
bgBlackBright:e("[100m","[49m"),bgRedBright:e("[101m","[49m"),bgGreenBright:e("[102m","[49m"),
|
|
32
38
|
bgYellowBright:e("[103m","[49m"),bgBlueBright:e("[104m","[49m"),bgMagentaBright:e("[105m","[49m"),
|
|
33
|
-
bgCyanBright:e("[106m","[49m"),bgWhiteBright:e("[107m","[49m")}};t.exports=a(),t.exports.createColors=a}},
|
|
34
|
-
;function
|
|
35
|
-
|
|
36
|
-
for(var i in e)
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
bgCyanBright:e("[106m","[49m"),bgWhiteBright:e("[107m","[49m")}};t.exports=a(),t.exports.createColors=a}},L={}
|
|
40
|
+
;function B(t){var e=L[t];if(void 0!==e)return e.exports;var i=L[t]={exports:{}};return V[t](i,i.exports,B),i.exports}
|
|
41
|
+
B.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return B.d(e,{a:e}),e},B.d=(t,e)=>{
|
|
42
|
+
for(var i in e)B.o(e,i)&&!B.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},
|
|
43
|
+
B.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const U={rE:"0.0.13"
|
|
44
|
+
},z="files",Y="directories",q="files_directories",J="all",K={root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:z,
|
|
45
|
+
lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(K)
|
|
46
|
+
;const Q="READDIRP_RECURSIVE_ERROR",X=new Set(["ENOENT","EPERM","EACCES","ELOOP",Q]),Z=[Y,J,q,z],tt=new Set([Y,J,q]),et=new Set([J,q,z]),it="win32"===process.platform,st=t=>!0,rt=t=>{
|
|
47
|
+
if(void 0===t)return st;if("function"==typeof t)return t;if("string"==typeof t){const e=t.trim()
|
|
48
|
+
;return t=>t.basename===e}if(Array.isArray(t)){const e=t.map(t=>t.trim());return t=>e.some(e=>t.basename===e)}return st}
|
|
49
|
+
;class nt extends D{constructor(t={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:t.highWaterMark});const e={...K,
|
|
50
|
+
...t},{root:i,type:s}=e;this._fileFilter=rt(e.fileFilter),this._directoryFilter=rt(e.directoryFilter)
|
|
51
|
+
;const r=e.lstat?k:$;this._stat=it?t=>r(t,{bigint:!0}):r,this._maxDepth=e.depth??K.depth,this._wantsDir=!!s&&tt.has(s),
|
|
52
|
+
this._wantsFile=!!s&&et.has(s),this._wantsEverything=s===J,this._root=n(i),this._isDirent=!e.alwaysStat,
|
|
53
|
+
this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},
|
|
54
|
+
this.parents=[this._exploreDir(i,1)],this.reading=!1,this.parent=void 0}async _read(t){if(!this.reading){this.reading=!0
|
|
55
|
+
;try{for(;!this.destroyed&&t>0;){const e=this.parent,i=e&&e.files;if(i&&i.length>0){
|
|
56
|
+
const{path:s,depth:r}=e,n=i.splice(0,t).map(t=>this._formatEntry(t,s)),o=await Promise.all(n);for(const e of o){
|
|
57
|
+
if(!e)continue;if(this.destroyed)return;const i=await this._getEntryType(e)
|
|
58
|
+
;"directory"===i&&this._directoryFilter(e)?(r<=this._maxDepth&&this.parents.push(this._exploreDir(e.fullPath,r+1)),
|
|
59
|
+
this._wantsDir&&(this.push(e),
|
|
60
|
+
t--)):("file"===i||this._includeAsFile(e))&&this._fileFilter(e)&&this._wantsFile&&(this.push(e),t--)}}else{
|
|
61
|
+
const t=this.parents.pop();if(!t){this.push(null);break}if(this.parent=await t,this.destroyed)return}}}catch(t){
|
|
62
|
+
this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(t,e){let i;try{i=await R(t,this._rdOptions)}catch(t){
|
|
63
|
+
this._onError(t)}return{files:i,depth:e,path:t}}async _formatEntry(t,e){let i;const o=this._isDirent?t.name:t;try{
|
|
64
|
+
const a=n(s(e,o));i={path:r(this._root,a),fullPath:a,basename:o},i[this._statsProp]=this._isDirent?t:await this._stat(a)
|
|
65
|
+
}catch(t){return void this._onError(t)}return i}_onError(t){
|
|
66
|
+
(t=>X.has(t.code))(t)&&!this.destroyed?this.emit("warn",t):this.destroy(t)}async _getEntryType(t){
|
|
67
|
+
if(!t&&this._statsProp in t)return"";const e=t[this._statsProp];if(e.isFile())return"file"
|
|
68
|
+
;if(e.isDirectory())return"directory";if(e&&e.isSymbolicLink()){const e=t.fullPath;try{const t=await I(e),i=await k(t)
|
|
69
|
+
;if(i.isFile())return"file";if(i.isDirectory()){const i=t.length;if(e.startsWith(t)&&e.substr(i,1)===o){
|
|
70
|
+
const i=new Error(`Circular symlink detected: "${e}" points to "${t}"`);return i.code=Q,this._onError(i)}
|
|
71
|
+
return"directory"}}catch(t){return this._onError(t),""}}}_includeAsFile(t){const e=t&&t[this._statsProp]
|
|
72
|
+
;return e&&this._wantsEverything&&!e.isDirectory()}}function ot(t,e={}){let i=e.entryType||e.type;if("both"===i&&(i=q),
|
|
73
|
+
i&&(e.type=i),!t)throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)")
|
|
74
|
+
;if("string"!=typeof t)throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)")
|
|
75
|
+
;if(i&&!Z.includes(i))throw new Error(`readdirp: Invalid type passed. Use one of ${Z.join(", ")}`);return e.root=t,
|
|
76
|
+
new nt(e)}
|
|
77
|
+
const at=()=>{},lt=process.platform,ht="win32"===lt,ct="darwin"===lt,ut="linux"===lt,dt="freebsd"===lt,pt="OS400"===H(),mt={
|
|
78
|
+
ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",
|
|
79
|
+
ERROR:"error"},ft=mt,gt={lstat:g,stat:b
|
|
80
|
+
},_t="listeners",vt="errHandlers",wt="rawEmitters",bt=[_t,vt,wt],yt=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),xt=(t,e)=>{
|
|
81
|
+
t instanceof Set?t.forEach(e):e(t)},Ot=(t,e,i)=>{let s=t[e];s instanceof Set||(t[e]=s=new Set([s])),s.add(i)
|
|
82
|
+
},Ct=(t,e,i)=>{const s=t[e];s instanceof Set?s.delete(i):s===i&&delete t[e]
|
|
83
|
+
},Et=t=>t instanceof Set?0===t.size:!t,Tt=new Map;function At(t,e,i,s,r){const n=(e,s)=>{i(t),r(e,s,{watchedPath:t}),
|
|
84
|
+
s&&t!==s&&St(P(t,s),_t,T(t,s))};try{return m(t,{persistent:e.persistent},n)}catch(t){return void s(t)}}
|
|
85
|
+
const St=(t,e,i,s,r)=>{const n=Tt.get(t);n&&xt(n[e],t=>{t(i,s,r)})},Pt=(t,e,i,s)=>{
|
|
86
|
+
const{listener:r,errHandler:n,rawEmitter:o}=s;let a,l=Tt.get(e);if(!i.persistent){if(a=At(t,i,r,n,o),!a)return
|
|
87
|
+
;return a.close.bind(a)}if(l)Ot(l,_t,r),Ot(l,vt,n),Ot(l,wt,o);else{if(a=At(t,i,St.bind(null,e,_t),n,St.bind(null,e,wt)),
|
|
88
|
+
!a)return;a.on(ft.ERROR,async i=>{const s=St.bind(null,e,vt);if(l&&(l.watcherUnusable=!0),ht&&"EPERM"===i.code)try{
|
|
89
|
+
const e=await _(t,"r");await e.close(),s(i)}catch(t){}else s(i)}),l={listeners:r,errHandlers:n,rawEmitters:o,watcher:a},
|
|
90
|
+
Tt.set(e,l)}return()=>{Ct(l,_t,r),Ct(l,vt,n),Ct(l,wt,o),Et(l.listeners)&&(l.watcher.close(),Tt.delete(e),
|
|
91
|
+
bt.forEach((t=>e=>{const i=t[e];i instanceof Set?i.clear():delete t[e]})(l)),l.watcher=void 0,Object.freeze(l))}
|
|
92
|
+
},kt=new Map;class Rt{constructor(t){this.fsw=t,this._boundHandleError=e=>t._handleError(e)}_watchWithNodeFs(t,e){
|
|
93
|
+
const i=this.fsw.options,s=O(t),r=x(t);this.fsw._getWatchedDir(s).add(r);const n=P(t),o={persistent:i.persistent};let a
|
|
94
|
+
;if(e||(e=at),i.usePolling){const s=i.interval!==i.binaryInterval;o.interval=s&&(l=r,
|
|
95
|
+
yt.has(C(l).slice(1).toLowerCase()))?i.binaryInterval:i.interval,a=((t,e,i,s)=>{const{listener:r,rawEmitter:n}=s
|
|
96
|
+
;let o=kt.get(e);const a=o&&o.options;return a&&(a.persistent<i.persistent||a.interval>i.interval)&&(p(e),o=void 0),
|
|
97
|
+
o?(Ot(o,_t,r),Ot(o,wt,n)):(o={listeners:r,rawEmitters:n,options:i,watcher:f(e,i,(i,s)=>{xt(o.rawEmitters,t=>{
|
|
98
|
+
t(ft.CHANGE,e,{curr:i,prev:s})});const r=i.mtimeMs;(i.size!==s.size||r>s.mtimeMs||0===r)&&xt(o.listeners,e=>e(t,i))})},
|
|
99
|
+
kt.set(e,o)),()=>{Ct(o,_t,r),Ct(o,wt,n),Et(o.listeners)&&(kt.delete(e),p(e),o.options=o.watcher=void 0,Object.freeze(o))
|
|
100
|
+
}})(t,n,o,{listener:e,rawEmitter:this.fsw._emitRaw})}else a=Pt(t,n,o,{listener:e,errHandler:this._boundHandleError,
|
|
101
|
+
rawEmitter:this.fsw._emitRaw});var l;return a}_handleFile(t,e,i){if(this.fsw.closed)return
|
|
102
|
+
;const s=O(t),r=x(t),n=this.fsw._getWatchedDir(s);let o=e;if(n.has(r))return;const a=async(e,i)=>{
|
|
103
|
+
if(this.fsw._throttle("watch",t,5))if(i&&0!==i.mtimeMs){if(n.has(r)){const e=i.atimeMs,s=i.mtimeMs
|
|
104
|
+
;(!e||e<=s||s!==o.mtimeMs)&&this.fsw._emit(ft.CHANGE,t,i),o=i}}else try{const i=await b(t);if(this.fsw.closed)return
|
|
105
|
+
;const s=i.atimeMs,r=i.mtimeMs;if((!s||s<=r||r!==o.mtimeMs)&&this.fsw._emit(ft.CHANGE,t,i),(ct||ut||dt)&&o.ino!==i.ino){
|
|
106
|
+
this.fsw._closeFile(e),o=i;const s=this._watchWithNodeFs(t,a);s&&this.fsw._addPathCloser(e,s)}else o=i}catch(t){
|
|
107
|
+
this.fsw._remove(s,r)}},l=this._watchWithNodeFs(t,a)
|
|
108
|
+
;if((!i||!this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(t)){if(!this.fsw._throttle(ft.ADD,t,0))return
|
|
109
|
+
;this.fsw._emit(ft.ADD,t,e)}return l}async _handleSymlink(t,e,i,s){if(this.fsw.closed)return
|
|
110
|
+
;const r=t.fullPath,n=this.fsw._getWatchedDir(e);if(!this.fsw.options.followSymlinks){let e;this.fsw._incrReadyCount()
|
|
111
|
+
;try{e=await w(i)}catch(t){return this.fsw._emitReady(),!0}if(this.fsw.closed)return
|
|
112
|
+
;return n.has(s)?this.fsw._symlinkPaths.get(r)!==e&&(this.fsw._symlinkPaths.set(r,e),
|
|
113
|
+
this.fsw._emit(ft.CHANGE,i,t.stats)):(n.add(s),this.fsw._symlinkPaths.set(r,e),this.fsw._emit(ft.ADD,i,t.stats)),
|
|
114
|
+
this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(r))return!0;this.fsw._symlinkPaths.set(r,!0)}
|
|
115
|
+
_handleRead(t,e,i,s,r,n,o){if(t=T(t,""),!(o=this.fsw._throttle("readdir",t,1e3)))return
|
|
116
|
+
;const a=this.fsw._getWatchedDir(i.path),l=new Set;let h=this.fsw._readdirp(t,{fileFilter:t=>i.filterPath(t),
|
|
117
|
+
directoryFilter:t=>i.filterDir(t)});return h?(h.on("data",async o=>{if(this.fsw.closed)return void(h=void 0)
|
|
118
|
+
;const c=o.path;let u=T(t,c)
|
|
119
|
+
;l.add(c),o.stats.isSymbolicLink()&&await this._handleSymlink(o,t,u,c)||(this.fsw.closed?h=void 0:c!==s&&(s||a.has(c))||(this.fsw._incrReadyCount(),
|
|
120
|
+
u=T(r,S(r,u)),this._addToNodeFs(u,e,i,n+1)))}).on(ft.ERROR,this._boundHandleError),new Promise((e,c)=>{if(!h)return c()
|
|
121
|
+
;h.once("end",()=>{if(this.fsw.closed)return void(h=void 0);const c=!!o&&o.clear();e(void 0),
|
|
122
|
+
a.getChildren().filter(e=>e!==t&&!l.has(e)).forEach(e=>{this.fsw._remove(t,e)}),h=void 0,
|
|
123
|
+
c&&this._handleRead(t,!1,i,s,r,n,o)})})):void 0}async _handleDir(t,e,i,s,r,n,o){
|
|
124
|
+
const a=this.fsw._getWatchedDir(O(t)),l=a.has(x(t));let h,c
|
|
125
|
+
;i&&this.fsw.options.ignoreInitial||r||l||this.fsw._emit(ft.ADD_DIR,t,e),a.add(x(t)),this.fsw._getWatchedDir(t)
|
|
126
|
+
;const u=this.fsw.options.depth;if((null==u||s<=u)&&!this.fsw._symlinkPaths.has(o)){
|
|
127
|
+
if(!r&&(await this._handleRead(t,i,n,r,t,s,h),this.fsw.closed))return;c=this._watchWithNodeFs(t,(e,i)=>{
|
|
128
|
+
i&&0===i.mtimeMs||this._handleRead(e,!1,n,r,t,s,h)})}return c}async _addToNodeFs(t,e,i,s,r){const n=this.fsw._emitReady
|
|
129
|
+
;if(this.fsw._isIgnored(t)||this.fsw.closed)return n(),!1;const o=this.fsw._getWatchHelpers(t)
|
|
130
|
+
;i&&(o.filterPath=t=>i.filterPath(t),o.filterDir=t=>i.filterDir(t));try{const i=await gt[o.statMethod](o.watchPath)
|
|
131
|
+
;if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,i))return n(),!1;const a=this.fsw.options.followSymlinks
|
|
132
|
+
;let l;if(i.isDirectory()){const n=P(t),h=a?await w(t):t;if(this.fsw.closed)return
|
|
133
|
+
;if(l=await this._handleDir(o.watchPath,i,e,s,r,o,h),this.fsw.closed)return
|
|
134
|
+
;n!==h&&void 0!==h&&this.fsw._symlinkPaths.set(n,h)}else if(i.isSymbolicLink()){const r=a?await w(t):t
|
|
135
|
+
;if(this.fsw.closed)return;const n=O(o.watchPath);if(this.fsw._getWatchedDir(n).add(o.watchPath),
|
|
136
|
+
this.fsw._emit(ft.ADD,o.watchPath,i),l=await this._handleDir(n,i,e,s,t,o,r),this.fsw.closed)return
|
|
137
|
+
;void 0!==r&&this.fsw._symlinkPaths.set(P(t),r)}else l=this._handleFile(o.watchPath,i,e);return n(),
|
|
138
|
+
l&&this.fsw._addPathCloser(t,l),!1}catch(e){if(this.fsw._handleError(e))return n(),t}}}
|
|
139
|
+
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
|
|
140
|
+
const It=/\\/g,$t=/\/\//,Dt=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Ht=/^\.[/\\]/;function Wt(t){
|
|
141
|
+
return Array.isArray(t)?t:[t]}const Mt=t=>"object"==typeof t&&null!==t&&!(t instanceof RegExp);function Ft(t,e,i){
|
|
142
|
+
const s=function(t){if("string"!=typeof t)throw new Error("string expected");let e=!1
|
|
143
|
+
;(t=(t=A(t)).replace(/\\/g,"/")).startsWith("//")&&(e=!0);const i=/\/\//;for(;t.match(i);)t=t.replace(i,"/")
|
|
144
|
+
;return e&&(t="/"+t),t}(e);for(let e=0;e<t.length;e++){if((0,t[e])(s,i))return!0}return!1}function Nt(t,e){
|
|
145
|
+
if(null==t)throw new TypeError("anymatch: specify first argument");const i=Wt(t).map(t=>function(t){
|
|
146
|
+
return"function"==typeof t?t:"string"==typeof t?e=>t===e:t instanceof RegExp?e=>t.test(e):"object"==typeof t&&null!==t?e=>{
|
|
147
|
+
if(t.path===e)return!0;if(t.recursive){const i=S(t.path,e);return!!i&&!i.startsWith("..")&&!E(i)}return!1}:()=>!1}(t))
|
|
148
|
+
;return null==e?(t,e)=>Ft(i,t,e):Ft(i,e)}const jt=t=>{const e=Wt(t).flat()
|
|
149
|
+
;if(!e.every(t=>"string"==typeof t))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Vt)
|
|
150
|
+
},Gt=t=>{let e=t.replace(It,"/"),i=!1;for(e.startsWith("//")&&(i=!0);e.match($t);)e=e.replace($t,"/")
|
|
151
|
+
;return i&&(e="/"+e),e
|
|
152
|
+
},Vt=t=>Gt(A(Gt(t))),Lt=(t="")=>e=>"string"==typeof e?Vt(E(e)?e:T(t,e)):e,Bt=Object.freeze(new Set);class Ut{
|
|
153
|
+
constructor(t,e){this.path=t,this._removeWatcher=e,this.items=new Set}add(t){const{items:e}=this
|
|
154
|
+
;e&&"."!==t&&".."!==t&&e.add(t)}async remove(t){const{items:e}=this;if(!e)return;if(e.delete(t),e.size>0)return
|
|
155
|
+
;const i=this.path;try{await v(i)}catch(t){this._removeWatcher&&this._removeWatcher(O(i),x(i))}}has(t){
|
|
156
|
+
const{items:e}=this;if(e)return e.has(t)}getChildren(){const{items:t}=this;return t?[...t.values()]:[]}dispose(){
|
|
157
|
+
this.items.clear(),this.path="",this._removeWatcher=at,this.items=Bt,Object.freeze(this)}}class zt{constructor(t,e,i){
|
|
158
|
+
this.fsw=i;const s=t;this.path=t=t.replace(Ht,""),this.watchPath=s,this.fullWatchPath=P(s),this.dirParts=[],
|
|
159
|
+
this.dirParts.forEach(t=>{t.length>1&&t.pop()}),this.followSymlinks=e,this.statMethod=e?"stat":"lstat"}entryPath(t){
|
|
160
|
+
return T(this.watchPath,S(this.watchPath,t.fullPath))}filterPath(t){const{stats:e}=t
|
|
161
|
+
;if(e&&e.isSymbolicLink())return this.filterDir(t);const i=this.entryPath(t)
|
|
162
|
+
;return this.fsw._isntIgnored(i,e)&&this.fsw._hasReadPermissions(e)}filterDir(t){
|
|
163
|
+
return this.fsw._isntIgnored(this.entryPath(t),t.stats)}}class Yt extends y{constructor(t={}){super(),this.closed=!1,
|
|
164
|
+
this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,
|
|
165
|
+
this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,
|
|
166
|
+
this._readyCount=0,this._readyEmitted=!1;const e=t.awaitWriteFinish,i={stabilityThreshold:2e3,pollInterval:100},s={
|
|
167
|
+
persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,
|
|
168
|
+
usePolling:!1,atomic:!0,...t,ignored:t.ignored?Wt(t.ignored):Wt([]),awaitWriteFinish:!0===e?i:"object"==typeof e&&{...i,
|
|
169
|
+
...e}};pt&&(s.usePolling=!0),void 0===s.atomic&&(s.atomic=!s.usePolling);const r=process.env.CHOKIDAR_USEPOLLING
|
|
170
|
+
;if(void 0!==r){const t=r.toLowerCase();s.usePolling="false"!==t&&"0"!==t&&("true"===t||"1"===t||!!t)}
|
|
171
|
+
const n=process.env.CHOKIDAR_INTERVAL;n&&(s.interval=Number.parseInt(n,10));let o=0;this._emitReady=()=>{o++,
|
|
172
|
+
o>=this._readyCount&&(this._emitReady=at,this._readyEmitted=!0,process.nextTick(()=>this.emit(mt.READY)))},
|
|
173
|
+
this._emitRaw=(...t)=>this.emit(mt.RAW,...t),this._boundRemove=this._remove.bind(this),this.options=s,
|
|
174
|
+
this._nodeFsHandler=new Rt(this),Object.freeze(s)}_addIgnoredPath(t){
|
|
175
|
+
if(Mt(t))for(const e of this._ignoredPaths)if(Mt(e)&&e.path===t.path&&e.recursive===t.recursive)return
|
|
176
|
+
;this._ignoredPaths.add(t)}_removeIgnoredPath(t){if(this._ignoredPaths.delete(t),
|
|
177
|
+
"string"==typeof t)for(const e of this._ignoredPaths)Mt(e)&&e.path===t&&this._ignoredPaths.delete(e)}add(t,e,i){
|
|
178
|
+
const{cwd:s}=this.options;this.closed=!1,this._closePromise=void 0;let r=jt(t);return s&&(r=r.map(t=>{
|
|
179
|
+
const e=((t,e)=>E(t)?t:T(e,t))(t,s);return e})),r.forEach(t=>{this._removeIgnoredPath(t)}),this._userIgnored=void 0,
|
|
180
|
+
this._readyCount||(this._readyCount=0),this._readyCount+=r.length,Promise.all(r.map(async t=>{
|
|
181
|
+
const s=await this._nodeFsHandler._addToNodeFs(t,!i,void 0,0,e);return s&&this._emitReady(),s})).then(t=>{
|
|
182
|
+
this.closed||t.forEach(t=>{t&&this.add(O(t),x(e||t))})}),this}unwatch(t){if(this.closed)return this
|
|
183
|
+
;const e=jt(t),{cwd:i}=this.options;return e.forEach(t=>{E(t)||this._closers.has(t)||(i&&(t=T(i,t)),t=P(t)),
|
|
184
|
+
this._closePath(t),this._addIgnoredPath(t),this._watched.has(t)&&this._addIgnoredPath({path:t,recursive:!0}),
|
|
185
|
+
this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,
|
|
186
|
+
this.removeAllListeners();const t=[];return this._closers.forEach(e=>e.forEach(e=>{const i=e()
|
|
187
|
+
;i instanceof Promise&&t.push(i)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,
|
|
188
|
+
this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),this._closers.clear(),this._watched.clear(),
|
|
189
|
+
this._streams.clear(),
|
|
190
|
+
this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=t.length?Promise.all(t).then(()=>{}):Promise.resolve(),
|
|
191
|
+
this._closePromise}getWatched(){const t={};return this._watched.forEach((e,i)=>{
|
|
192
|
+
const s=this.options.cwd?S(this.options.cwd,i):i;t[s||"."]=e.getChildren().sort()}),t}emitWithAll(t,e){
|
|
193
|
+
this.emit(t,...e),t!==mt.ERROR&&this.emit(mt.ALL,t,...e)}async _emit(t,e,i){if(this.closed)return;const s=this.options
|
|
194
|
+
;ht&&(e=A(e)),s.cwd&&(e=S(s.cwd,e));const r=[e];null!=i&&r.push(i);const n=s.awaitWriteFinish;let o
|
|
195
|
+
;if(n&&(o=this._pendingWrites.get(e)))return o.lastChange=new Date,this;if(s.atomic){
|
|
196
|
+
if(t===mt.UNLINK)return this._pendingUnlinks.set(e,[t,...r]),setTimeout(()=>{this._pendingUnlinks.forEach((t,e)=>{
|
|
197
|
+
this.emit(...t),this.emit(mt.ALL,...t),this._pendingUnlinks.delete(e)})},"number"==typeof s.atomic?s.atomic:100),this
|
|
198
|
+
;t===mt.ADD&&this._pendingUnlinks.has(e)&&(t=mt.CHANGE,this._pendingUnlinks.delete(e))}
|
|
199
|
+
if(n&&(t===mt.ADD||t===mt.CHANGE)&&this._readyEmitted){const i=(e,i)=>{e?(t=mt.ERROR,r[0]=e,
|
|
200
|
+
this.emitWithAll(t,r)):i&&(r.length>1?r[1]=i:r.push(i),this.emitWithAll(t,r))}
|
|
201
|
+
;return this._awaitWriteFinish(e,n.stabilityThreshold,t,i),this}if(t===mt.CHANGE){
|
|
202
|
+
if(!this._throttle(mt.CHANGE,e,50))return this}
|
|
203
|
+
if(s.alwaysStat&&void 0===i&&(t===mt.ADD||t===mt.ADD_DIR||t===mt.CHANGE)){const t=s.cwd?T(s.cwd,e):e;let i;try{
|
|
204
|
+
i=await b(t)}catch(t){}if(!i||this.closed)return;r.push(i)}return this.emitWithAll(t,r),this}_handleError(t){
|
|
205
|
+
const e=t&&t.code
|
|
206
|
+
;return t&&"ENOENT"!==e&&"ENOTDIR"!==e&&(!this.options.ignorePermissionErrors||"EPERM"!==e&&"EACCES"!==e)&&this.emit(mt.ERROR,t),
|
|
207
|
+
t||this.closed}_throttle(t,e,i){this._throttled.has(t)||this._throttled.set(t,new Map);const s=this._throttled.get(t)
|
|
208
|
+
;if(!s)throw new Error("invalid throttle");const r=s.get(e);if(r)return r.count++,!1;let n;const o=()=>{
|
|
209
|
+
const t=s.get(e),i=t?t.count:0;return s.delete(e),clearTimeout(n),t&&clearTimeout(t.timeoutObject),i};n=setTimeout(o,i)
|
|
210
|
+
;const a={timeoutObject:n,clear:o,count:0};return s.set(e,a),a}_incrReadyCount(){return this._readyCount++}
|
|
211
|
+
_awaitWriteFinish(t,e,i,s){const r=this.options.awaitWriteFinish;if("object"!=typeof r)return;const n=r.pollInterval
|
|
212
|
+
;let o,a=t;this.options.cwd&&!E(t)&&(a=T(this.options.cwd,t));const l=new Date,h=this._pendingWrites
|
|
213
|
+
;h.has(t)||(h.set(t,{lastChange:l,cancelWait:()=>(h.delete(t),clearTimeout(o),i)}),o=setTimeout(function i(r){
|
|
214
|
+
d(a,(a,l)=>{if(a||!h.has(t))return void(a&&"ENOENT"!==a.code&&s(a));const c=Number(new Date)
|
|
215
|
+
;r&&l.size!==r.size&&(h.get(t).lastChange=c),c-h.get(t).lastChange>=e?(h.delete(t),s(void 0,l)):o=setTimeout(i,n,l)})
|
|
216
|
+
},n))}_isIgnored(t,e){if(this.options.atomic&&Dt.test(t))return!0;if(!this._userIgnored){
|
|
217
|
+
const{cwd:t}=this.options,e=(this.options.ignored||[]).map(Lt(t)),i=[...[...this._ignoredPaths].map(Lt(t)),...e]
|
|
218
|
+
;this._userIgnored=Nt(i,void 0)}return this._userIgnored(t,e)}_isntIgnored(t,e){return!this._isIgnored(t,e)}
|
|
219
|
+
_getWatchHelpers(t){return new zt(t,this.options.followSymlinks,this)}_getWatchedDir(t){const e=P(t)
|
|
220
|
+
;return this._watched.has(e)||this._watched.set(e,new Ut(e,this._boundRemove)),this._watched.get(e)}
|
|
221
|
+
_hasReadPermissions(t){return!!this.options.ignorePermissionErrors||Boolean(256&Number(t.mode))}_remove(t,e,i){
|
|
222
|
+
const s=T(t,e),r=P(s);if(i=null!=i?i:this._watched.has(s)||this._watched.has(r),!this._throttle("remove",s,100))return
|
|
223
|
+
;i||1!==this._watched.size||this.add(t,e,!0);this._getWatchedDir(s).getChildren().forEach(t=>this._remove(s,t))
|
|
224
|
+
;const n=this._getWatchedDir(t),o=n.has(e);n.remove(e),this._symlinkPaths.has(r)&&this._symlinkPaths.delete(r);let a=s
|
|
225
|
+
;if(this.options.cwd&&(a=S(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(a)){
|
|
226
|
+
if(this._pendingWrites.get(a).cancelWait()===mt.ADD)return}this._watched.delete(s),this._watched.delete(r)
|
|
227
|
+
;const l=i?mt.UNLINK_DIR:mt.UNLINK;o&&!this._isIgnored(s)&&this._emit(l,s),this._closePath(s)}_closePath(t){
|
|
228
|
+
this._closeFile(t);const e=O(t);this._getWatchedDir(e).remove(x(t))}_closeFile(t){const e=this._closers.get(t)
|
|
229
|
+
;e&&(e.forEach(t=>t()),this._closers.delete(t))}_addPathCloser(t,e){if(!e)return;let i=this._closers.get(t);i||(i=[],
|
|
230
|
+
this._closers.set(t,i)),i.push(e)}_readdirp(t,e){if(this.closed)return;let i=ot(t,{type:mt.ALL,alwaysStat:!0,lstat:!0,
|
|
231
|
+
...e,depth:0});return this._streams.add(i),i.once("close",()=>{i=void 0}),i.once("end",()=>{i&&(this._streams.delete(i),
|
|
232
|
+
i=void 0)}),i}}const qt={watch:function(t,e={}){const i=new Yt(e);return i.add(t),i},FSWatcher:Yt
|
|
233
|
+
},Jt=(t=0)=>e=>`[${e+t}m`,Kt=(t=0)=>e=>`[${38+t};5;${e}m`,Qt=(t=0)=>(e,i,s)=>`[${38+t};2;${e};${i};${s}m`,Xt={
|
|
234
|
+
modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],
|
|
235
|
+
hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],
|
|
236
|
+
magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],
|
|
237
|
+
greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]
|
|
238
|
+
},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],
|
|
239
|
+
bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],
|
|
240
|
+
bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],
|
|
241
|
+
bgWhiteBright:[107,49]}};Object.keys(Xt.modifier),Object.keys(Xt.color),Object.keys(Xt.bgColor);const Zt=function(){
|
|
242
|
+
const t=new Map;for(const[e,i]of Object.entries(Xt)){for(const[e,s]of Object.entries(i))Xt[e]={open:`[${s[0]}m`,
|
|
243
|
+
close:`[${s[1]}m`},i[e]=Xt[e],t.set(s[0],s[1]);Object.defineProperty(Xt,e,{value:i,enumerable:!1})}
|
|
244
|
+
return Object.defineProperty(Xt,"codes",{value:t,enumerable:!1}),Xt.color.close="[39m",Xt.bgColor.close="[49m",
|
|
245
|
+
Xt.color.ansi=Jt(),Xt.color.ansi256=Kt(),Xt.color.ansi16m=Qt(),Xt.bgColor.ansi=Jt(10),Xt.bgColor.ansi256=Kt(10),
|
|
246
|
+
Xt.bgColor.ansi16m=Qt(10),Object.defineProperties(Xt,{rgbToAnsi256:{
|
|
52
247
|
value:(t,e,i)=>t===e&&e===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(i/255*5),
|
|
53
248
|
enumerable:!1},hexToRgb:{value(t){const e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!e)return[0,0,0];let[i]=e
|
|
54
|
-
;3===i.length&&(i=[...i].map(t=>t+t).join(""));const
|
|
55
|
-
enumerable:!1},hexToAnsi256:{value:t=>
|
|
56
|
-
if(t<8)return 30+t;if(t<16)return t-8+90;let e,i,
|
|
57
|
-
;e=Math.floor(t/36)/5,i=Math.floor(
|
|
58
|
-
;let n=30+(Math.round(
|
|
59
|
-
value:(t,e,i)=>
|
|
60
|
-
value:t=>
|
|
61
|
-
;function
|
|
62
|
-
const i=t.startsWith("-")?"":1===t.length?"-":"--",
|
|
63
|
-
const{env:
|
|
64
|
-
if("FORCE_COLOR"in
|
|
65
|
-
}();void 0!==
|
|
66
|
-
if(
|
|
67
|
-
if("TF_BUILD"in
|
|
68
|
-
;if("win32"===
|
|
249
|
+
;3===i.length&&(i=[...i].map(t=>t+t).join(""));const s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,255&s]},
|
|
250
|
+
enumerable:!1},hexToAnsi256:{value:t=>Xt.rgbToAnsi256(...Xt.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){
|
|
251
|
+
if(t<8)return 30+t;if(t<16)return t-8+90;let e,i,s;if(t>=232)e=(10*(t-232)+8)/255,i=e,s=e;else{const r=(t-=16)%36
|
|
252
|
+
;e=Math.floor(t/36)/5,i=Math.floor(r/6)/5,s=r%6/5}const r=2*Math.max(e,i,s);if(0===r)return 30
|
|
253
|
+
;let n=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(e));return 2===r&&(n+=60),n},enumerable:!1},rgbToAnsi:{
|
|
254
|
+
value:(t,e,i)=>Xt.ansi256ToAnsi(Xt.rgbToAnsi256(t,e,i)),enumerable:!1},hexToAnsi:{
|
|
255
|
+
value:t=>Xt.ansi256ToAnsi(Xt.hexToAnsi256(t)),enumerable:!1}}),Xt}(),te=Zt
|
|
256
|
+
;function ee(t,e=(globalThis.Deno?globalThis.Deno.args:W.argv)){
|
|
257
|
+
const i=t.startsWith("-")?"":1===t.length?"-":"--",s=e.indexOf(i+t),r=e.indexOf("--");return-1!==s&&(-1===r||s<r)}
|
|
258
|
+
const{env:ie}=W;let se;function re(t,{streamIsTTY:e,sniffFlags:i=!0}={}){const s=function(){
|
|
259
|
+
if("FORCE_COLOR"in ie)return"true"===ie.FORCE_COLOR?1:"false"===ie.FORCE_COLOR?0:0===ie.FORCE_COLOR.length?1:Math.min(Number.parseInt(ie.FORCE_COLOR,10),3)
|
|
260
|
+
}();void 0!==s&&(se=s);const r=i?se:s;if(0===r)return 0;if(i){
|
|
261
|
+
if(ee("color=16m")||ee("color=full")||ee("color=truecolor"))return 3;if(ee("color=256"))return 2}
|
|
262
|
+
if("TF_BUILD"in ie&&"AGENT_NAME"in ie)return 1;if(t&&!e&&void 0===r)return 0;const n=r||0;if("dumb"===ie.TERM)return n
|
|
263
|
+
;if("win32"===W.platform){const t=F.release().split(".")
|
|
69
264
|
;return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}
|
|
70
|
-
if("CI"in
|
|
71
|
-
;if("TEAMCITY_VERSION"in
|
|
72
|
-
;if("truecolor"===
|
|
73
|
-
;if("wezterm"===
|
|
74
|
-
const t=Number.parseInt((
|
|
265
|
+
if("CI"in ie)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(t=>t in ie)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(t=>t in ie)||"codeship"===ie.CI_NAME?1:n
|
|
266
|
+
;if("TEAMCITY_VERSION"in ie)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ie.TEAMCITY_VERSION)?1:0
|
|
267
|
+
;if("truecolor"===ie.COLORTERM)return 3;if("xterm-kitty"===ie.TERM)return 3;if("xterm-ghostty"===ie.TERM)return 3
|
|
268
|
+
;if("wezterm"===ie.TERM)return 3;if("TERM_PROGRAM"in ie){
|
|
269
|
+
const t=Number.parseInt((ie.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ie.TERM_PROGRAM){case"iTerm.app":
|
|
75
270
|
return t>=3?3:2;case"Apple_Terminal":return 2}}
|
|
76
|
-
return/-256(color)?$/i.test(
|
|
77
|
-
}function
|
|
271
|
+
return/-256(color)?$/i.test(ie.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ie.TERM)||"COLORTERM"in ie?1:n
|
|
272
|
+
}function ne(t,e={}){return function(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}(re(t,{
|
|
78
273
|
streamIsTTY:t&&t.isTTY,...e}))}
|
|
79
|
-
|
|
80
|
-
;const
|
|
81
|
-
;if(-1===
|
|
274
|
+
ee("no-color")||ee("no-colors")||ee("color=false")||ee("color=never")?se=0:(ee("color")||ee("colors")||ee("color=true")||ee("color=always"))&&(se=1)
|
|
275
|
+
;const oe={stdout:ne({isTTY:N.isatty(1)}),stderr:ne({isTTY:N.isatty(2)})};function ae(t,e,i){let s=t.indexOf(e)
|
|
276
|
+
;if(-1===s)return t;const r=e.length;let n=0,o="";do{o+=t.slice(n,s)+e+i,n=s+r,s=t.indexOf(e,n)}while(-1!==s)
|
|
82
277
|
;return o+=t.slice(n),o}
|
|
83
|
-
const{stdout:
|
|
84
|
-
;const
|
|
278
|
+
const{stdout:le,stderr:he}=oe,ce=Symbol("GENERATOR"),ue=Symbol("STYLER"),de=Symbol("IS_EMPTY"),pe=["ansi","ansi","ansi256","ansi16m"],me=Object.create(null)
|
|
279
|
+
;const fe=t=>{const e=(...t)=>t.join(" ");return((t,e={})=>{
|
|
85
280
|
if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3")
|
|
86
|
-
;const i=
|
|
87
|
-
return
|
|
88
|
-
const i=
|
|
89
|
-
|
|
90
|
-
;
|
|
91
|
-
;
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
r
|
|
99
|
-
;
|
|
100
|
-
;
|
|
101
|
-
;
|
|
102
|
-
|
|
281
|
+
;const i=le?le.level:0;t.level=void 0===e.level?i:e.level})(e,t),Object.setPrototypeOf(e,ge.prototype),e}
|
|
282
|
+
;function ge(t){return fe(t)}Object.setPrototypeOf(ge.prototype,Function.prototype)
|
|
283
|
+
;for(const[t,e]of Object.entries(te))me[t]={get(){const i=ye(this,be(e.open,e.close,this[ue]),this[de])
|
|
284
|
+
;return Object.defineProperty(this,t,{value:i}),i}};me.visible={get(){const t=ye(this,this[ue],!0)
|
|
285
|
+
;return Object.defineProperty(this,"visible",{value:t}),t}}
|
|
286
|
+
;const _e=(t,e,i,...s)=>"rgb"===t?"ansi16m"===e?te[i].ansi16m(...s):"ansi256"===e?te[i].ansi256(te.rgbToAnsi256(...s)):te[i].ansi(te.rgbToAnsi(...s)):"hex"===t?_e("rgb",e,i,...te.hexToRgb(...s)):te[i][t](...s),ve=["rgb","hex","ansi256"]
|
|
287
|
+
;for(const t of ve){me[t]={get(){const{level:e}=this;return function(...i){
|
|
288
|
+
const s=be(_e(t,pe[e],"color",...i),te.color.close,this[ue]);return ye(this,s,this[de])}}}
|
|
289
|
+
;me["bg"+t[0].toUpperCase()+t.slice(1)]={get(){const{level:e}=this;return function(...i){
|
|
290
|
+
const s=be(_e(t,pe[e],"bgColor",...i),te.bgColor.close,this[ue]);return ye(this,s,this[de])}}}}
|
|
291
|
+
const we=Object.defineProperties(()=>{},{...me,level:{enumerable:!0,get(){return this[ce].level},set(t){this[ce].level=t
|
|
292
|
+
}}}),be=(t,e,i)=>{let s,r;return void 0===i?(s=t,r=e):(s=i.openAll+t,r=e+i.closeAll),{open:t,close:e,openAll:s,
|
|
293
|
+
closeAll:r,parent:i}},ye=(t,e,i)=>{const s=(...t)=>xe(s,1===t.length?""+t[0]:t.join(" "))
|
|
294
|
+
;return Object.setPrototypeOf(s,we),s[ce]=t,s[ue]=e,s[de]=i,s},xe=(t,e)=>{if(t.level<=0||!e)return t[de]?"":e
|
|
295
|
+
;let i=t[ue];if(void 0===i)return e;const{openAll:s,closeAll:r}=i
|
|
296
|
+
;if(e.includes(""))for(;void 0!==i;)e=ae(e,i.close,i.open),i=i.parent;const n=e.indexOf("\n")
|
|
297
|
+
;return-1!==n&&(e=function(t,e,i,s){let r=0,n="";do{const o="\r"===t[s-1];n+=t.slice(r,o?s-1:s)+e+(o?"\r\n":"\n")+i,
|
|
298
|
+
r=s+1,s=t.indexOf("\n",r)}while(-1!==s);return n+=t.slice(r),n}(e,r,s,n)),s+e+r}
|
|
299
|
+
;Object.defineProperties(ge.prototype,me);const Oe=ge(),Ce=(ge({level:he?he.level:0}),Oe),Ee=(t,e,i,s)=>{
|
|
103
300
|
if("length"===i||"prototype"===i)return;if("arguments"===i||"caller"===i)return
|
|
104
|
-
;const
|
|
105
|
-
;!
|
|
301
|
+
;const r=Object.getOwnPropertyDescriptor(t,i),n=Object.getOwnPropertyDescriptor(e,i)
|
|
302
|
+
;!Te(r,n)&&s||Object.defineProperty(t,i,n)},Te=function(t,e){
|
|
106
303
|
return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)
|
|
107
|
-
},
|
|
108
|
-
;function
|
|
304
|
+
},Ae=(t,e)=>`/* Wrapped ${t}*/\n${e}`,Se=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Pe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")
|
|
305
|
+
;function ke(t,e,{ignoreNonConfigurable:i=!1}={}){const{name:s}=t;for(const s of Reflect.ownKeys(e))Ee(t,e,s,i)
|
|
109
306
|
;return((t,e)=>{const i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)})(t,e),
|
|
110
|
-
((t,e,i)=>{const
|
|
111
|
-
;const{writable:n,enumerable:o,configurable:a}=
|
|
112
|
-
configurable:a})})(t,e,
|
|
113
|
-
if("function"!=typeof t)throw new TypeError("Expected a function");let i,
|
|
114
|
-
;const
|
|
115
|
-
t=void 0;else if(!0===e.throw)throw new Error(`Function \`${
|
|
116
|
-
|
|
117
|
-
if(!
|
|
118
|
-
;return
|
|
119
|
-
;
|
|
120
|
-
"linux"===process.platform&&
|
|
121
|
-
;const
|
|
122
|
-
;class
|
|
123
|
-
if(
|
|
124
|
-
this.listeners[t].push(e)}removeListener(t,e){const i=this.listeners[t],
|
|
125
|
-
;-1!==
|
|
126
|
-
;let
|
|
127
|
-
class
|
|
128
|
-
#t="win32"===
|
|
129
|
-
;for(const e of
|
|
130
|
-
;if("object"==typeof
|
|
131
|
-
i.length===
|
|
132
|
-
;this.#
|
|
307
|
+
((t,e,i)=>{const s=""===i?"":`with ${i.trim()}() `,r=Ae.bind(null,s,e.toString());Object.defineProperty(r,"name",Pe)
|
|
308
|
+
;const{writable:n,enumerable:o,configurable:a}=Se;Object.defineProperty(t,"toString",{value:r,writable:n,enumerable:o,
|
|
309
|
+
configurable:a})})(t,e,s),t}const Re=new WeakMap,Ie=(t,e={})=>{
|
|
310
|
+
if("function"!=typeof t)throw new TypeError("Expected a function");let i,s=0
|
|
311
|
+
;const r=t.displayName||t.name||"<anonymous>",n=function(...o){if(Re.set(n,++s),1===s)i=t.apply(this,o),
|
|
312
|
+
t=void 0;else if(!0===e.throw)throw new Error(`Function \`${r}\` can only be called once`);return i};return ke(n,t),
|
|
313
|
+
Re.set(n,s),n};Ie.callCount=t=>{
|
|
314
|
+
if(!Re.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`)
|
|
315
|
+
;return Re.get(t)};const $e=Ie,De=[]
|
|
316
|
+
;De.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&De.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),
|
|
317
|
+
"linux"===process.platform&&De.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")
|
|
318
|
+
;const He=t=>!!t&&"object"==typeof t&&"function"==typeof t.removeListener&&"function"==typeof t.emit&&"function"==typeof t.reallyExit&&"function"==typeof t.listeners&&"function"==typeof t.kill&&"number"==typeof t.pid&&"function"==typeof t.on,We=Symbol.for("signal-exit emitter"),Me=globalThis,Fe=Object.defineProperty.bind(Object)
|
|
319
|
+
;class Ne{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){
|
|
320
|
+
if(Me[We])return Me[We];Fe(Me,We,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,e){
|
|
321
|
+
this.listeners[t].push(e)}removeListener(t,e){const i=this.listeners[t],s=i.indexOf(e)
|
|
322
|
+
;-1!==s&&(0===s&&1===i.length?i.length=0:i.splice(s,1))}emit(t,e,i){if(this.emitted[t])return!1;this.emitted[t]=!0
|
|
323
|
+
;let s=!1;for(const r of this.listeners[t])s=!0===r(e,i)||s;return"exit"===t&&(s=this.emit("afterExit",e,i)||s),s}}
|
|
324
|
+
class je{}const Ge=globalThis.process,{onExit:Ve,load:Le,unload:Be}=(Ue=He(Ge)?new class extends je{
|
|
325
|
+
#t="win32"===Ge.platform?"SIGINT":"SIGHUP";#e=new Ne;#i;#s;#r;#n={};#o=!1;constructor(t){super(),this.#i=t,this.#n={}
|
|
326
|
+
;for(const e of De)this.#n[e]=()=>{const i=this.#i.listeners(e);let{count:s}=this.#e;const r=t
|
|
327
|
+
;if("object"==typeof r.__signal_exit_emitter__&&"number"==typeof r.__signal_exit_emitter__.count&&(s+=r.__signal_exit_emitter__.count),
|
|
328
|
+
i.length===s){this.unload();const i=this.#e.emit("exit",null,e),s="SIGHUP"===e?this.#t:e;i||t.kill(t.pid,s)}}
|
|
329
|
+
;this.#r=t.reallyExit,this.#s=t.emit}onExit(t,e){if(!He(this.#i))return()=>{};!1===this.#o&&this.load()
|
|
133
330
|
;const i=e?.alwaysLast?"afterExit":"exit";return this.#e.on(i,t),()=>{this.#e.removeListener(i,t),
|
|
134
331
|
0===this.#e.listeners.exit.length&&0===this.#e.listeners.afterExit.length&&this.unload()}}load(){if(!this.#o){
|
|
135
|
-
this.#o=!0,this.#e.count+=1;for(const t of
|
|
136
|
-
this.#i.emit=(t,...e)=>this.#a(t,...e),this.#i.reallyExit=t=>this.#l(t)}}unload(){this.#o&&(this.#o=!1,
|
|
332
|
+
this.#o=!0,this.#e.count+=1;for(const t of De)try{const e=this.#n[t];e&&this.#i.on(t,e)}catch(t){}
|
|
333
|
+
this.#i.emit=(t,...e)=>this.#a(t,...e),this.#i.reallyExit=t=>this.#l(t)}}unload(){this.#o&&(this.#o=!1,De.forEach(t=>{
|
|
137
334
|
const e=this.#n[t];if(!e)throw new Error("Listener not defined for signal: "+t);try{this.#i.removeListener(t,e)
|
|
138
|
-
}catch(t){}}),this.#i.emit=this.#
|
|
139
|
-
return
|
|
140
|
-
this.#
|
|
141
|
-
"number"==typeof e[0]&&(this.#i.exitCode=e[0]);const
|
|
142
|
-
;return this.#e.emit("exit",this.#i.exitCode,null),
|
|
143
|
-
return()=>{}}load(){}unload(){}},{onExit:(t,e)=>
|
|
144
|
-
;const
|
|
145
|
-
alwaysLast:!0})}):()=>{};let
|
|
146
|
-
hide:(t=
|
|
147
|
-
},xt=bt,Ot=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots13":{"interval":80,"frames":["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},"dots14":{"interval":80,"frames":["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"dotsCircle":{"interval":80,"frames":["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},"sand":{"interval":80,"frames":["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"rollingLine":{"interval":80,"frames":["/ "," - "," \\\\ "," |"," |"," \\\\ "," - ","/ "]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"binary":{"interval":80,"frames":["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","💗 "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜 🤛 ","🤜 🤛 ","🤜 🤛 "," 🤜 🤛 "," 🤜🤛 "," 🤜✨🤛 ","🤜 ✨ 🤛 "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ "," "," "," "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},"dwarfFortress":{"interval":80,"frames":[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]},"fish":{"interval":80,"frames":["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","º> ~~~~~~~~~~~~~~~~~","(º> ~~~~~~~~~~~~~~~~","((º> ~~~~~~~~~~~~~~~","<((º> ~~~~~~~~~~~~~~","><((º> ~~~~~~~~~~~~~"," ><((º> ~~~~~~~~~~~~","~ ><((º> ~~~~~~~~~~~","~~ <>((º> ~~~~~~~~~~","~~~ ><((º> ~~~~~~~~~","~~~~ <>((º> ~~~~~~~~","~~~~~ ><((º> ~~~~~~~","~~~~~~ <>((º> ~~~~~~","~~~~~~~ ><((º> ~~~~~","~~~~~~~~ <>((º> ~~~~","~~~~~~~~~ ><((º> ~~~","~~~~~~~~~~ <>((º> ~~","~~~~~~~~~~~ ><((º> ~","~~~~~~~~~~~~ <>((º> ","~~~~~~~~~~~~~ ><((º>","~~~~~~~~~~~~~~ <>((º","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]}}')
|
|
148
|
-
;const
|
|
149
|
-
;const i=`[${t}m`,
|
|
150
|
-
;const l=(22===e?
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const{env:t}=
|
|
156
|
-
;return"win32"!==
|
|
157
|
-
}const
|
|
158
|
-
;const
|
|
335
|
+
}catch(t){}}),this.#i.emit=this.#s,this.#i.reallyExit=this.#r,this.#e.count-=1)}#l(t){
|
|
336
|
+
return He(this.#i)?(this.#i.exitCode=t||0,this.#e.emit("exit",this.#i.exitCode,null),
|
|
337
|
+
this.#r.call(this.#i,this.#i.exitCode)):0}#a(t,...e){const i=this.#s;if("exit"===t&&He(this.#i)){
|
|
338
|
+
"number"==typeof e[0]&&(this.#i.exitCode=e[0]);const s=i.call(this.#i,t,...e)
|
|
339
|
+
;return this.#e.emit("exit",this.#i.exitCode,null),s}return i.call(this.#i,t,...e)}}(Ge):new class extends je{onExit(){
|
|
340
|
+
return()=>{}}load(){}unload(){}},{onExit:(t,e)=>Ue.onExit(t,e),load:()=>Ue.load(),unload:()=>Ue.unload()});var Ue
|
|
341
|
+
;const ze=W.stderr.isTTY?W.stderr:W.stdout.isTTY?W.stdout:void 0,Ye=ze?$e(()=>{Ve(()=>{ze.write("[?25h")},{
|
|
342
|
+
alwaysLast:!0})}):()=>{};let qe=!1;const Je={show:(t=W.stderr)=>{t.isTTY&&(qe=!1,t.write("[?25h"))},
|
|
343
|
+
hide:(t=W.stderr)=>{t.isTTY&&(Ye(),qe=!0,t.write("[?25l"))},toggle:(t,e)=>{void 0!==t&&(qe=t),qe?Je.show(e):Je.hide(e)}
|
|
344
|
+
},Ke=Je,Qe=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots13":{"interval":80,"frames":["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},"dots14":{"interval":80,"frames":["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"dotsCircle":{"interval":80,"frames":["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},"sand":{"interval":80,"frames":["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"rollingLine":{"interval":80,"frames":["/ "," - "," \\\\ "," |"," |"," \\\\ "," - ","/ "]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"binary":{"interval":80,"frames":["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","💗 "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜 🤛 ","🤜 🤛 ","🤜 🤛 "," 🤜 🤛 "," 🤜🤛 "," 🤜✨🤛 ","🤜 ✨ 🤛 "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ "," "," "," "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},"dwarfFortress":{"interval":80,"frames":[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]},"fish":{"interval":80,"frames":["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","º> ~~~~~~~~~~~~~~~~~","(º> ~~~~~~~~~~~~~~~~","((º> ~~~~~~~~~~~~~~~","<((º> ~~~~~~~~~~~~~~","><((º> ~~~~~~~~~~~~~"," ><((º> ~~~~~~~~~~~~","~ ><((º> ~~~~~~~~~~~","~~ <>((º> ~~~~~~~~~~","~~~ ><((º> ~~~~~~~~~","~~~~ <>((º> ~~~~~~~~","~~~~~ ><((º> ~~~~~~~","~~~~~~ <>((º> ~~~~~~","~~~~~~~ ><((º> ~~~~~","~~~~~~~~ <>((º> ~~~~","~~~~~~~~~ ><((º> ~~~","~~~~~~~~~~ <>((º> ~~","~~~~~~~~~~~ ><((º> ~","~~~~~~~~~~~~ <>((º> ","~~~~~~~~~~~~~ ><((º>","~~~~~~~~~~~~~~ <>((º","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]}}')
|
|
345
|
+
;const Xe=Qe;Object.keys(Qe);const Ze=N?.WriteStream?.prototype?.hasColors?.()??!1,ti=(t,e)=>{if(!Ze)return t=>t
|
|
346
|
+
;const i=`[${t}m`,s=`[${e}m`;return t=>{const r=t+"";let n=r.indexOf(s);if(-1===n)return i+r+s;let o=i,a=0
|
|
347
|
+
;const l=(22===e?s:"")+i;for(;-1!==n;)o+=r.slice(a,n)+l,a=n+s.length,n=r.indexOf(s,a);return o+=r.slice(a)+s,o}
|
|
348
|
+
},ei=(ti(0,0),ti(1,22),ti(2,22),ti(3,23),ti(4,24),ti(53,55),ti(7,27),ti(8,28),ti(9,29),ti(30,39),
|
|
349
|
+
ti(31,39)),ii=ti(32,39),si=ti(33,39),ri=ti(34,39);ti(35,39),ti(36,39),ti(37,39),ti(90,39),ti(40,49),ti(41,49),ti(42,49),
|
|
350
|
+
ti(43,49),ti(44,49),ti(45,49),ti(46,49),ti(47,49),ti(100,49),ti(91,39),ti(92,39),ti(93,39),ti(94,39),ti(95,39),
|
|
351
|
+
ti(96,39),ti(97,39),ti(101,49),ti(102,49),ti(103,49),ti(104,49),ti(105,49),ti(106,49),ti(107,49);function ni(){
|
|
352
|
+
const{env:t}=W,{TERM:e,TERM_PROGRAM:i}=t
|
|
353
|
+
;return"win32"!==W.platform?"linux"!==e:Boolean(t.WT_SESSION)||Boolean(t.TERMINUS_SUBLIME)||"{cmd::Cmder}"===t.ConEmuTask||"Terminus-Sublime"===i||"vscode"===i||"xterm-256color"===e||"alacritty"===e||"rxvt-unicode"===e||"rxvt-unicode-256color"===e||"JetBrains-JediTerm"===t.TERMINAL_EMULATOR
|
|
354
|
+
}const oi=ni(),ai=ri(oi?"ℹ":"i"),li=ii(oi?"✔":"√"),hi=si(oi?"⚠":"‼"),ci=ei(oi?"✖":"×")
|
|
355
|
+
;const ui=function({onlyFirst:t=!1}={}){
|
|
159
356
|
return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",t?void 0:"g")
|
|
160
357
|
}()
|
|
161
|
-
;const
|
|
162
|
-
let i=0,
|
|
163
|
-
if(!(e>t[n+1]))return!0;i=
|
|
164
|
-
;for(let
|
|
165
|
-
const
|
|
166
|
-
;function
|
|
167
|
-
function
|
|
168
|
-
const
|
|
169
|
-
;function
|
|
170
|
-
;return null!==e&&e.length>=2}return!1}function
|
|
171
|
-
function
|
|
172
|
-
function
|
|
173
|
-
const i=[];for(const e of t)
|
|
174
|
-
;for(let t=0;t<i.length;t++){const
|
|
175
|
-
|
|
176
|
-
;for(const
|
|
177
|
-
if("string"!=typeof t||0===t.length)return 0;const{ambiguousIsNarrow:i=!0,countAnsiEscapeCodes:
|
|
178
|
-
;if(r
|
|
358
|
+
;const di=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],pi=[12288,12288,65281,65376,65504,65510],mi=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],fi=(t,e)=>{
|
|
359
|
+
let i=0,s=Math.floor(t.length/2)-1;for(;i<=s;){const r=Math.floor((i+s)/2),n=2*r;if(e<t[n])s=r-1;else{
|
|
360
|
+
if(!(e>t[n+1]))return!0;i=r+1}}return!1};const[gi,_i]=vi(mi);function vi(t){let e=t[0],i=t[1]
|
|
361
|
+
;for(let s=0;s<t.length;s+=2){const r=t[s],n=t[s+1];if(19968>=r&&19968<=n)return[r,n];n-r>i-e&&(e=r,i=n)}return[e,i]}
|
|
362
|
+
const wi=t=>!(t<161||t>1114109)&&fi(di,t),bi=t=>!(t<12288||t>65510)&&fi(pi,t),yi=t=>t>=gi&&t<=_i||!(t<4352||t>262141)&&fi(mi,t)
|
|
363
|
+
;function xi(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}
|
|
364
|
+
function Oi(t,{ambiguousAsWide:e=!1}={}){return xi(t),bi(t)||yi(t)||e&&wi(t)?2:1}
|
|
365
|
+
const Ci=new Intl.Segmenter,Ei=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,Ti=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,Ai=/^\p{RGI_Emoji}$/v,Si=/^[\d#*]\u20E3$/,Pi=/\p{Extended_Pictographic}/gu
|
|
366
|
+
;function ki(t){if(t.length>50)return!1;if(Si.test(t))return!0;if(t.includes("")){const e=t.match(Pi)
|
|
367
|
+
;return null!==e&&e.length>=2}return!1}function Ri(t){return t.replace(Ti,"")}function Ii(t){return Ei.test(t)}
|
|
368
|
+
function $i(t){return t>=4352&&t<=4447||t>=43360&&t<=43388}function Di(t){return t>=4448&&t<=4519||t>=55216&&t<=55238}
|
|
369
|
+
function Hi(t){return t>=4520&&t<=4607||t>=55243&&t<=55291}function Wi(t){return $i(t)||Di(t)||Hi(t)}function Mi(t,e){
|
|
370
|
+
const i=[];for(const e of t)Ei.test(e)||i.push(e.codePointAt(0));if(0===i.length)return;let s=0
|
|
371
|
+
;for(let t=0;t<i.length;t++){const r=i[t];if(!Wi(r)){if(0===s)return;for(let r=t;r<i.length;r++)s+=Oi(i[r],e);return s}
|
|
372
|
+
$i(r)&&Di(i[t+1])?(s+=2,t+=Hi(i[t+2])?2:1):s+=Oi(r,e)}return s}function Fi(t,e){let i=0,s=!0
|
|
373
|
+
;for(const r of t)s?s=!1:r>=""&&r<=""&&(i+=Oi(r.codePointAt(0),e));return i}function Ni(t,e={}){
|
|
374
|
+
if("string"!=typeof t||0===t.length)return 0;const{ambiguousIsNarrow:i=!0,countAnsiEscapeCodes:s=!1}=e;let r=t
|
|
375
|
+
;if(s||!r.includes("")&&!r.includes("")||(r=function(t){
|
|
179
376
|
if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``)
|
|
180
|
-
;return t.includes("")||t.includes("")?t.replace(
|
|
181
|
-
;if(/^[\u0020-\u007E]*$/.test(
|
|
182
|
-
;for(const{segment:t}of
|
|
183
|
-
;if(void 0!==i){n+=i;continue}n+=
|
|
184
|
-
;#p=t=>{if(!t?.length)return;3===("string"==typeof t?t.codePointAt(0):t[0])&&
|
|
185
|
-
1===this.#h&&this.#
|
|
186
|
-
;"win32"!==
|
|
187
|
-
this.#
|
|
188
|
-
if(!this.#c)return;const t=this.#c;t.off("data",this.#p),t.isTTY&&t.setRawMode?.(this.#
|
|
189
|
-
this.#c=void 0,this.#u=!1,this.#
|
|
190
|
-
},
|
|
191
|
-
;class
|
|
192
|
-
}}#
|
|
377
|
+
;return t.includes("")||t.includes("")?t.replace(ui,""):t}(r)),0===r.length)return 0
|
|
378
|
+
;if(/^[\u0020-\u007E]*$/.test(r))return r.length;let n=0;const o={ambiguousAsWide:!i}
|
|
379
|
+
;for(const{segment:t}of Ci.segment(r)){if(Ii(t))continue;if(Ai.test(t)||ki(t)){n+=2;continue}const e=Ri(t),i=Mi(e,o)
|
|
380
|
+
;if(void 0!==i){n+=i;continue}n+=Oi(e.codePointAt(0),o),n+=Fi(e,o)}return n}const ji=new class{#h=0;#c;#u=!1;#d=!1
|
|
381
|
+
;#p=t=>{if(!t?.length)return;3===("string"==typeof t?t.codePointAt(0):t[0])&&W.kill(W.pid,"SIGINT")};start(){this.#h++,
|
|
382
|
+
1===this.#h&&this.#m()}stop(){0!==this.#h&&0===--this.#h&&this.#f()}#m(){const{stdin:t}=W
|
|
383
|
+
;"win32"!==W.platform&&t?.isTTY&&"function"==typeof t.setRawMode?(this.#c=t,this.#u=t.isPaused(),
|
|
384
|
+
this.#d=Boolean(t.isRaw),t.setRawMode(!0),t.prependListener("data",this.#p),this.#u&&t.resume()):this.#c=void 0}#f(){
|
|
385
|
+
if(!this.#c)return;const t=this.#c;t.off("data",this.#p),t.isTTY&&t.setRawMode?.(this.#d),this.#u&&t.pause(),
|
|
386
|
+
this.#c=void 0,this.#u=!1,this.#d=!1}
|
|
387
|
+
},Gi=Object.freeze(ji),Vi=new Map,Li=new Set(["black","red","green","yellow","blue","magenta","cyan","white","gray"])
|
|
388
|
+
;class Bi{#g=0;#_=-1;#v=0;#w;#b;#y;#x;#O=new Map;#C=!1;#E;#T;#A=!1;#S;#P(t){this.#C=!0;try{return t()}finally{this.#C=!1
|
|
389
|
+
}}#k(){this.isSpinning&&this.render()}#R(t,e){if(null==t)return"";if("string"==typeof t)return t
|
|
193
390
|
;if(Buffer.isBuffer(t)||ArrayBuffer.isView(t)){const i="string"==typeof e&&e&&"buffer"!==e?e:"utf8"
|
|
194
|
-
;return Buffer.from(t).toString(i)}return String(t)}#
|
|
195
|
-
this.#
|
|
196
|
-
"function"==typeof this.#
|
|
197
|
-
return this.#
|
|
198
|
-
text:t}),this.#
|
|
199
|
-
this.#
|
|
200
|
-
return Boolean(t&&t.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}({stream:this.#
|
|
201
|
-
"boolean"!=typeof this.#
|
|
202
|
-
void 0!==this.#
|
|
203
|
-
;const e=this.#
|
|
204
|
-
this.prefixText=this.#
|
|
205
|
-
return this.#
|
|
206
|
-
if(!(t>=0&&Number.isInteger(t)))throw new Error("The `indent` option must be an integer from 0 and up");this.#
|
|
207
|
-
}get interval(){return this.#
|
|
208
|
-
if(this.#_=-1,this.#
|
|
391
|
+
;return Buffer.from(t).toString(i)}return String(t)}#I(t){if(!t)return!1;const e=t.at(-1);return"\n"===e||"\r"===e}#$(){
|
|
392
|
+
this.#T||(this.#T=setTimeout(()=>{this.#T=void 0,this.isSpinning&&this.#k()},200),
|
|
393
|
+
"function"==typeof this.#T?.unref&&this.#T.unref())}#D(){this.#T&&(clearTimeout(this.#T),this.#T=void 0)}#H(t,e,i,s){
|
|
394
|
+
return this.#W(i," ")+t+("string"==typeof e?(t?" ":"")+e:"")+this.#M(s," ")}constructor(t){if("string"==typeof t&&(t={
|
|
395
|
+
text:t}),this.#w={color:"cyan",stream:W.stderr,discardStdin:!0,hideCursor:!0,...t},this.color=this.#w.color,
|
|
396
|
+
this.#y=this.#w.stream,"boolean"!=typeof this.#w.isEnabled&&(this.#w.isEnabled=function({stream:t=process.stdout}={}){
|
|
397
|
+
return Boolean(t&&t.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}({stream:this.#y})),
|
|
398
|
+
"boolean"!=typeof this.#w.isSilent&&(this.#w.isSilent=!1),
|
|
399
|
+
void 0!==this.#w.interval&&!(Number.isInteger(this.#w.interval)&&this.#w.interval>0))throw new Error("The `interval` option must be a positive integer")
|
|
400
|
+
;const e=this.#w.interval;this.spinner=this.#w.spinner,this.#w.interval=e,this.text=this.#w.text,
|
|
401
|
+
this.prefixText=this.#w.prefixText,this.suffixText=this.#w.suffixText,this.indent=this.#w.indent}get indent(){
|
|
402
|
+
return this.#w.indent}set indent(t=0){
|
|
403
|
+
if(!(t>=0&&Number.isInteger(t)))throw new Error("The `indent` option must be an integer from 0 and up");this.#w.indent=t
|
|
404
|
+
}get interval(){return this.#w.interval??this.#b.interval??100}get spinner(){return this.#b}set spinner(t){
|
|
405
|
+
if(this.#_=-1,this.#w.interval=void 0,"object"==typeof t){
|
|
209
406
|
if(!Array.isArray(t.frames)||0===t.frames.length||t.frames.some(t=>"string"!=typeof t))throw new Error("The given spinner must have a non-empty `frames` array of strings")
|
|
210
407
|
;if(void 0!==t.interval&&!(Number.isInteger(t.interval)&&t.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided")
|
|
211
|
-
;this.#
|
|
212
|
-
if("default"===t||!
|
|
213
|
-
;this.#
|
|
214
|
-
return this.#
|
|
215
|
-
set suffixText(t=""){this.#
|
|
216
|
-
const
|
|
217
|
-
return this.#
|
|
218
|
-
;for(const
|
|
219
|
-
if(void 0!==t&&!1!==t&&!
|
|
220
|
-
;this.#S=t}get isEnabled(){return this.#
|
|
221
|
-
if("boolean"!=typeof t)throw new TypeError("The `isEnabled` option must be a boolean");this.#
|
|
222
|
-
get isSilent(){return this.#
|
|
223
|
-
if("boolean"!=typeof t)throw new TypeError("The `isSilent` option must be a boolean");this.#
|
|
224
|
-
const t=Date.now();(-1===this.#_||t-this.#v>=this.interval)&&(this.#_=(this.#_+1)%this.#
|
|
225
|
-
;const{frames:e}=this.#
|
|
226
|
-
;return this.#
|
|
227
|
-
clear(){return this.isEnabled&&this.#
|
|
228
|
-
;for(let t=0;t<this.#g;t++)t>0&&this.#
|
|
229
|
-
;this.#
|
|
230
|
-
if(!t||this.#
|
|
231
|
-
;
|
|
232
|
-
;const e=t.write;this.#
|
|
233
|
-
if(!this.isEnabled||this.#
|
|
234
|
-
for(const[t,e]of this.#
|
|
235
|
-
if("function"==typeof
|
|
236
|
-
;const n=this.#
|
|
237
|
-
this.isSpinning&&!this.#
|
|
238
|
-
;const t=this.#
|
|
239
|
-
;const
|
|
408
|
+
;this.#b=t}else if(ni())if(void 0===t)this.#b=Xe.dots;else{
|
|
409
|
+
if("default"===t||!Xe[t])throw new Error(`There is no built-in spinner named '${t}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)
|
|
410
|
+
;this.#b=Xe[t]}else this.#b=Xe.line}get text(){return this.#w.text}set text(t=""){this.#w.text=t}get prefixText(){
|
|
411
|
+
return this.#w.prefixText}set prefixText(t=""){this.#w.prefixText=t}get suffixText(){return this.#w.suffixText}
|
|
412
|
+
set suffixText(t=""){this.#w.suffixText=t}get isSpinning(){return void 0!==this.#x}#F(t,e,i=!1){
|
|
413
|
+
const s="function"==typeof t?t():t;return"string"==typeof s&&""!==s?i?e+s:s+e:""}#W(t=this.#w.prefixText,e=" "){
|
|
414
|
+
return this.#F(t,e,!1)}#M(t=this.#w.suffixText,e=" "){return this.#F(t,e,!0)}#N(t,e){let i=0
|
|
415
|
+
;for(const s of M(t).split("\n"))i+=Math.max(1,Math.ceil(Ni(s)/e));return i}get color(){return this.#S}set color(t){
|
|
416
|
+
if(void 0!==t&&!1!==t&&!Li.has(t))throw new Error("The `color` option must be a valid color or `false` to disable")
|
|
417
|
+
;this.#S=t}get isEnabled(){return this.#w.isEnabled&&!this.#w.isSilent}set isEnabled(t){
|
|
418
|
+
if("boolean"!=typeof t)throw new TypeError("The `isEnabled` option must be a boolean");this.#w.isEnabled=t}
|
|
419
|
+
get isSilent(){return this.#w.isSilent}set isSilent(t){
|
|
420
|
+
if("boolean"!=typeof t)throw new TypeError("The `isSilent` option must be a boolean");this.#w.isSilent=t}frame(){
|
|
421
|
+
const t=Date.now();(-1===this.#_||t-this.#v>=this.interval)&&(this.#_=(this.#_+1)%this.#b.frames.length,this.#v=t)
|
|
422
|
+
;const{frames:e}=this.#b;let i=e[this.#_];this.#S&&(i=Ce[this.#S](i))
|
|
423
|
+
;return this.#W(this.#w.prefixText," ")+i+("string"==typeof this.text?" "+this.text:"")+this.#M(this.#w.suffixText," ")}
|
|
424
|
+
clear(){return this.isEnabled&&this.#y.isTTY?(this.#P(()=>{this.#y.cursorTo(0)
|
|
425
|
+
;for(let t=0;t<this.#g;t++)t>0&&this.#y.moveCursor(0,-1),this.#y.clearLine(1)
|
|
426
|
+
;this.#w.indent&&this.#y.cursorTo(this.#w.indent)}),this.#g=0,this):this}#j(t){
|
|
427
|
+
if(!t||this.#O.has(t)||!t.isTTY||"function"!=typeof t.write)return
|
|
428
|
+
;Vi.has(t)&&console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.")
|
|
429
|
+
;const e=t.write;this.#O.set(t,e),Vi.set(t,this),t.write=(i,s,r)=>this.#G(t,e,i,s,r)}#V(){
|
|
430
|
+
if(!this.isEnabled||this.#O.size>0)return;const t=new Set([this.#y,W.stdout,W.stderr]);for(const e of t)this.#j(e)}#L(){
|
|
431
|
+
for(const[t,e]of this.#O)t.write=e,Vi.get(t)===this&&Vi.delete(t);this.#O.clear()}#G(t,e,i,s,r){
|
|
432
|
+
if("function"==typeof s&&(r=s,s=void 0),this.#C)return e.call(t,i,s,r);this.clear()
|
|
433
|
+
;const n=this.#R(i,s),o=this.#I(n),a=e.call(t,i,s,r);return o?this.#D():n.length>0&&this.#$(),
|
|
434
|
+
this.isSpinning&&!this.#T&&this.render(),a}render(){if(!this.isEnabled||this.#E||this.#T)return this
|
|
435
|
+
;const t=this.#y.isTTY;let e=!1;try{t&&(this.#P(()=>this.#y.write("[?2026h")),e=!0),this.clear();let i=this.frame()
|
|
436
|
+
;const s=this.#y.columns??80,r=this.#N(i,s),n=this.#y.rows;if(n&&n>1&&r>n){const t=i.split("\n"),e=n-1
|
|
240
437
|
;i=[...t.slice(0,e),"... (content truncated to fit terminal)"].join("\n")}
|
|
241
|
-
!1===this
|
|
242
|
-
this.#
|
|
438
|
+
!1===this.#P(()=>this.#y.write(i))&&this.#y.isTTY&&(this.#E=()=>{this.#E=void 0,this.#k()},
|
|
439
|
+
this.#y.once("drain",this.#E)),this.#g=this.#N(i,s)}finally{e&&this.#P(()=>this.#y.write("[?2026l"))}return this}
|
|
243
440
|
start(t){if(void 0!==t&&(this.text=t),this.isSilent)return this;if(!this.isEnabled){
|
|
244
|
-
const t=this.text?"-":"",e=" ".repeat(this.#
|
|
245
|
-
;return""!==e.trim()&&this
|
|
246
|
-
return this.isSpinning||(this.#
|
|
247
|
-
this.#
|
|
248
|
-
return clearInterval(this.#
|
|
249
|
-
this.#
|
|
250
|
-
this.#
|
|
251
|
-
symbol:
|
|
252
|
-
text:t})}info(t){return this.stopAndPersist({symbol:
|
|
253
|
-
;const e=t.symbol??" ",i=t.text??this.text,
|
|
254
|
-
;return this.stop(),this
|
|
255
|
-
;class
|
|
256
|
-
this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}}class
|
|
441
|
+
const t=this.text?"-":"",e=" ".repeat(this.#w.indent)+this.#H(t,this.text,this.#w.prefixText,this.#w.suffixText)
|
|
442
|
+
;return""!==e.trim()&&this.#P(()=>this.#y.write(e+"\n")),this}
|
|
443
|
+
return this.isSpinning||(this.#w.hideCursor&&Ke.hide(this.#y),this.#w.discardStdin&&W.stdin.isTTY&&(Gi.start(),
|
|
444
|
+
this.#A=!0),this.#V(),this.render(),this.#x=setInterval(this.render.bind(this),this.interval)),this}stop(){
|
|
445
|
+
return clearInterval(this.#x),this.#x=void 0,this.#_=-1,this.#v=0,this.#D(),this.#L(),
|
|
446
|
+
this.#E&&(this.#y.removeListener("drain",this.#E),this.#E=void 0),this.isEnabled&&(this.clear(),
|
|
447
|
+
this.#w.hideCursor&&Ke.show(this.#y)),this.#A&&(this.#A=!1,Gi.stop()),this}succeed(t){return this.stopAndPersist({
|
|
448
|
+
symbol:li,text:t})}fail(t){return this.stopAndPersist({symbol:ci,text:t})}warn(t){return this.stopAndPersist({symbol:hi,
|
|
449
|
+
text:t})}info(t){return this.stopAndPersist({symbol:ai,text:t})}stopAndPersist(t={}){if(this.isSilent)return this
|
|
450
|
+
;const e=t.symbol??" ",i=t.text??this.text,s=t.prefixText??this.#w.prefixText,r=t.suffixText??this.#w.suffixText,n=this.#H(e,i,s,r)+"\n"
|
|
451
|
+
;return this.stop(),this.#P(()=>this.#y.write(n)),this}}function Ui(t){return new Bi(t)}var zi=B(991),Yi=B.n(zi)
|
|
452
|
+
;class qi extends Error{constructor(t,e,i){super(i),Error.captureStackTrace(this,this.constructor),
|
|
453
|
+
this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}}class Ji extends qi{constructor(t){
|
|
257
454
|
super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}
|
|
258
|
-
class
|
|
455
|
+
class Ki{constructor(t,e){switch(this.description=e||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,
|
|
259
456
|
this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break
|
|
260
457
|
;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t}
|
|
261
458
|
this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}
|
|
262
459
|
_collectValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?(e.push(t),e):[t]}default(t,e){
|
|
263
460
|
return this.defaultValue=t,this.defaultValueDescription=e,this}argParser(t){return this.parseArg=t,this}choices(t){
|
|
264
461
|
return this.argChoices=t.slice(),this.parseArg=(t,e)=>{
|
|
265
|
-
if(!this.argChoices.includes(t))throw new
|
|
462
|
+
if(!this.argChoices.includes(t))throw new Ji(`Allowed choices are ${this.argChoices.join(", ")}.`)
|
|
266
463
|
;return this.variadic?this._collectValue(t,e):t},this}argRequired(){return this.required=!0,this}argOptional(){
|
|
267
|
-
return this.required=!1,this}}function
|
|
268
|
-
;return t.required?"<"+e+">":"["+e+"]"}class
|
|
464
|
+
return this.required=!1,this}}function Qi(t){const e=t.name()+(!0===t.variadic?"...":"")
|
|
465
|
+
;return t.required?"<"+e+">":"["+e+"]"}class Xi{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,
|
|
269
466
|
this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){
|
|
270
467
|
this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){
|
|
271
468
|
const e=t.commands.filter(t=>!t._hidden),i=t._getHelpCommand();return i&&!i._hidden&&e.push(i),
|
|
272
469
|
this.sortSubcommands&&e.sort((t,e)=>t.name().localeCompare(e.name())),e}compareOptions(t,e){
|
|
273
470
|
const i=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");return i(t).localeCompare(i(e))}visibleOptions(t){
|
|
274
471
|
const e=t.options.filter(t=>!t.hidden),i=t._getHelpOption();if(i&&!i.hidden){
|
|
275
|
-
const
|
|
276
|
-
;r
|
|
472
|
+
const s=i.short&&t._findOption(i.short),r=i.long&&t._findOption(i.long)
|
|
473
|
+
;s||r?i.long&&!r?e.push(t.createOption(i.long,i.description)):i.short&&!s&&e.push(t.createOption(i.short,i.description)):e.push(i)
|
|
277
474
|
}return this.sortOptions&&e.sort(this.compareOptions),e}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[]
|
|
278
475
|
;const e=[];for(let i=t.parent;i;i=i.parent){const t=i.options.filter(t=>!t.hidden);e.push(...t)}
|
|
279
476
|
return this.sortOptions&&e.sort(this.compareOptions),e}visibleArguments(t){
|
|
280
477
|
return t._argsDescription&&t.registeredArguments.forEach(e=>{
|
|
281
478
|
e.description=e.description||t._argsDescription[e.name()]||""
|
|
282
479
|
}),t.registeredArguments.find(t=>t.description)?t.registeredArguments:[]}subcommandTerm(t){
|
|
283
|
-
const e=t.registeredArguments.map(t=>
|
|
480
|
+
const e=t.registeredArguments.map(t=>Qi(t)).join(" ")
|
|
284
481
|
;return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){
|
|
285
482
|
return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){
|
|
286
483
|
return e.visibleCommands(t).reduce((t,i)=>Math.max(t,this.displayWidth(e.styleSubcommandTerm(e.subcommandTerm(i)))),0)}
|
|
@@ -301,21 +498,21 @@ void 0!==t.envVar&&e.push(`env: ${t.envVar}`),e.length>0){const i=`(${e.join(",
|
|
|
301
498
|
;if(t.argChoices&&e.push(`choices: ${t.argChoices.map(t=>JSON.stringify(t)).join(", ")}`),
|
|
302
499
|
void 0!==t.defaultValue&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),e.length>0){
|
|
303
500
|
const i=`(${e.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatItemList(t,e,i){
|
|
304
|
-
return 0===e.length?[]:[i.styleTitle(t),...e,""]}groupItems(t,e,i){const
|
|
305
|
-
;
|
|
306
|
-
const i=e.padWidth(t,e),
|
|
501
|
+
return 0===e.length?[]:[i.styleTitle(t),...e,""]}groupItems(t,e,i){const s=new Map;return t.forEach(t=>{const e=i(t)
|
|
502
|
+
;s.has(e)||s.set(e,[])}),e.forEach(t=>{const e=i(t);s.has(e)||s.set(e,[]),s.get(e).push(t)}),s}formatHelp(t,e){
|
|
503
|
+
const i=e.padWidth(t,e),s=e.helpWidth??80;function r(t,s){return e.formatItem(t,i,s,e)}
|
|
307
504
|
let n=[`${e.styleTitle("Usage:")} ${e.styleUsage(e.commandUsage(t))}`,""];const o=e.commandDescription(t)
|
|
308
|
-
;o.length>0&&(n=n.concat([e.boxWrap(e.styleCommandDescription(o),
|
|
309
|
-
;const a=e.visibleArguments(t).map(t=>
|
|
505
|
+
;o.length>0&&(n=n.concat([e.boxWrap(e.styleCommandDescription(o),s),""]))
|
|
506
|
+
;const a=e.visibleArguments(t).map(t=>r(e.styleArgumentTerm(e.argumentTerm(t)),e.styleArgumentDescription(e.argumentDescription(t))))
|
|
310
507
|
;n=n.concat(this.formatItemList("Arguments:",a,e))
|
|
311
508
|
;if(this.groupItems(t.options,e.visibleOptions(t),t=>t.helpGroupHeading??"Options:").forEach((t,i)=>{
|
|
312
|
-
const
|
|
313
|
-
;n=n.concat(this.formatItemList(i,
|
|
314
|
-
const i=e.visibleGlobalOptions(t).map(t=>
|
|
509
|
+
const s=t.map(t=>r(e.styleOptionTerm(e.optionTerm(t)),e.styleOptionDescription(e.optionDescription(t))))
|
|
510
|
+
;n=n.concat(this.formatItemList(i,s,e))}),e.showGlobalOptions){
|
|
511
|
+
const i=e.visibleGlobalOptions(t).map(t=>r(e.styleOptionTerm(e.optionTerm(t)),e.styleOptionDescription(e.optionDescription(t))))
|
|
315
512
|
;n=n.concat(this.formatItemList("Global Options:",i,e))}
|
|
316
513
|
return this.groupItems(t.commands,e.visibleCommands(t),t=>t.helpGroup()||"Commands:").forEach((t,i)=>{
|
|
317
|
-
const
|
|
318
|
-
;n=n.concat(this.formatItemList(i,
|
|
514
|
+
const s=t.map(t=>r(e.styleSubcommandTerm(e.subcommandTerm(t)),e.styleSubcommandDescription(e.subcommandDescription(t))))
|
|
515
|
+
;n=n.concat(this.formatItemList(i,s,e))}),n.join("\n")}displayWidth(t){return M(t).length}styleTitle(t){return t}
|
|
319
516
|
styleUsage(t){
|
|
320
517
|
return t.split(" ").map(t=>"[options]"===t?this.styleOptionText(t):"[command]"===t?this.styleSubcommandText(t):"["===t[0]||"<"===t[0]?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")
|
|
321
518
|
}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){
|
|
@@ -326,22 +523,22 @@ return t.split(" ").map(t=>"[options]"===t?this.styleOptionText(t):"["===t[0]||"
|
|
|
326
523
|
}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}
|
|
327
524
|
styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,e){
|
|
328
525
|
return Math.max(e.longestOptionTermLength(t,e),e.longestGlobalOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))
|
|
329
|
-
}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,e,i,
|
|
330
|
-
;const n=t.padEnd(e+t.length-
|
|
331
|
-
;if(o<this.minWidthToWrap||
|
|
332
|
-
return
|
|
333
|
-
;const i=t.split(/\r\n|\n/),
|
|
334
|
-
;if(null===i)return void
|
|
335
|
-
const i=this.displayWidth(t);if(o+i<=e)return n.push(t),void(o+=i);
|
|
336
|
-
o=this.displayWidth(
|
|
526
|
+
}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,e,i,s){const r=" ".repeat(2);if(!i)return r+t
|
|
527
|
+
;const n=t.padEnd(e+t.length-s.displayWidth(t)),o=(this.helpWidth??80)-e-2-2;let a
|
|
528
|
+
;if(o<this.minWidthToWrap||s.preformatted(i))a=i;else{a=s.boxWrap(i,o).replace(/\n/g,"\n"+" ".repeat(e+2))}
|
|
529
|
+
return r+n+" ".repeat(2)+a.replace(/\n/g,`\n${r}`)}boxWrap(t,e){if(e<this.minWidthToWrap)return t
|
|
530
|
+
;const i=t.split(/\r\n|\n/),s=/[\s]*[^\s]+/g,r=[];return i.forEach(t=>{const i=t.match(s)
|
|
531
|
+
;if(null===i)return void r.push("");let n=[i.shift()],o=this.displayWidth(n[0]);i.forEach(t=>{
|
|
532
|
+
const i=this.displayWidth(t);if(o+i<=e)return n.push(t),void(o+=i);r.push(n.join(""));const s=t.trimStart();n=[s],
|
|
533
|
+
o=this.displayWidth(s)}),r.push(n.join(""))}),r.join("\n")}}class Zi{constructor(t,e){this.flags=t,
|
|
337
534
|
this.description=e||"",this.required=t.includes("<"),this.optional=t.includes("["),
|
|
338
535
|
this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;const i=function(t){let e,i
|
|
339
|
-
;const
|
|
340
|
-
;
|
|
536
|
+
;const s=/^-[^-]$/,r=/^--[^-]/,n=t.split(/[ |,]+/).concat("guard");s.test(n[0])&&(e=n.shift())
|
|
537
|
+
;r.test(n[0])&&(i=n.shift());!e&&s.test(n[0])&&(e=n.shift());!e&&r.test(n[0])&&(e=i,i=n.shift())
|
|
341
538
|
;if(n[0].startsWith("-")){const e=n[0],i=`option creation failed due to '${e}' in option flags '${t}'`
|
|
342
539
|
;if(/^-[^-][^-]/.test(e))throw new Error(`${i}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`)
|
|
343
|
-
;if(
|
|
344
|
-
;if(
|
|
540
|
+
;if(s.test(e))throw new Error(`${i}\n- too many short flags`)
|
|
541
|
+
;if(r.test(e))throw new Error(`${i}\n- too many long flags`);throw new Error(`${i}\n- unrecognised flag format`)}
|
|
345
542
|
if(void 0===e&&void 0===i)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,
|
|
346
543
|
longFlag:i}}(t)
|
|
347
544
|
;this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),
|
|
@@ -353,27 +550,27 @@ return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflic
|
|
|
353
550
|
this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){
|
|
354
551
|
return this.hidden=!!t,this}_collectValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?(e.push(t),e):[t]}
|
|
355
552
|
choices(t){return this.argChoices=t.slice(),this.parseArg=(t,e)=>{
|
|
356
|
-
if(!this.argChoices.includes(t))throw new
|
|
553
|
+
if(!this.argChoices.includes(t))throw new Ji(`Allowed choices are ${this.argChoices.join(", ")}.`)
|
|
357
554
|
;return this.variadic?this._collectValue(t,e):t},this}name(){
|
|
358
555
|
return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){
|
|
359
|
-
return this.negate?
|
|
360
|
-
is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class
|
|
556
|
+
return this.negate?es(this.name().replace(/^no-/,"")):es(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}
|
|
557
|
+
is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class ts{
|
|
361
558
|
constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(t=>{
|
|
362
559
|
t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),
|
|
363
560
|
this.negativeOptions.forEach((t,e)=>{this.positiveOptions.has(e)&&this.dualOptions.add(e)})}valueFromOption(t,e){
|
|
364
561
|
const i=e.attributeName();if(!this.dualOptions.has(i))return!0
|
|
365
|
-
;const
|
|
366
|
-
return t.split("-").reduce((t,e)=>t+e[0].toUpperCase()+e.slice(1))}function
|
|
367
|
-
;e=Array.from(new Set(e));const i=t.startsWith("--");i&&(t=t.slice(2),e=e.map(t=>t.slice(2)));let
|
|
562
|
+
;const s=this.negativeOptions.get(i).presetArg,r=void 0!==s&&s;return e.negate===(r===t)}}function es(t){
|
|
563
|
+
return t.split("-").reduce((t,e)=>t+e[0].toUpperCase()+e.slice(1))}function is(t,e){if(!e||0===e.length)return""
|
|
564
|
+
;e=Array.from(new Set(e));const i=t.startsWith("--");i&&(t=t.slice(2),e=e.map(t=>t.slice(2)));let s=[],r=3
|
|
368
565
|
;return e.forEach(e=>{if(e.length<=1)return;const i=function(t,e){
|
|
369
566
|
if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);const i=[];for(let e=0;e<=t.length;e++)i[e]=[e]
|
|
370
|
-
;for(let t=0;t<=e.length;t++)i[0][t]=t;for(let
|
|
371
|
-
;n=t[
|
|
372
|
-
i[
|
|
373
|
-
}return i[t.length][e.length]}(t,e),n=Math.max(t.length,e.length);(n-i)/n>.4&&(i<
|
|
374
|
-
|
|
375
|
-
i&&(
|
|
376
|
-
}class
|
|
567
|
+
;for(let t=0;t<=e.length;t++)i[0][t]=t;for(let s=1;s<=e.length;s++)for(let r=1;r<=t.length;r++){let n
|
|
568
|
+
;n=t[r-1]===e[s-1]?0:1,
|
|
569
|
+
i[r][s]=Math.min(i[r-1][s]+1,i[r][s-1]+1,i[r-1][s-1]+n),r>1&&s>1&&t[r-1]===e[s-2]&&t[r-2]===e[s-1]&&(i[r][s]=Math.min(i[r][s],i[r-2][s-2]+1))
|
|
570
|
+
}return i[t.length][e.length]}(t,e),n=Math.max(t.length,e.length);(n-i)/n>.4&&(i<r?(r=i,s=[e]):i===r&&s.push(e))}),
|
|
571
|
+
s.sort((t,e)=>t.localeCompare(e)),
|
|
572
|
+
i&&(s=s.map(t=>`--${t}`)),s.length>1?`\n(Did you mean one of ${s.join(", ")}?)`:1===s.length?`\n(Did you mean ${s[0]}?)`:""
|
|
573
|
+
}class ss extends G{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,
|
|
377
574
|
this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],
|
|
378
575
|
this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,
|
|
379
576
|
this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,
|
|
@@ -381,11 +578,11 @@ this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,th
|
|
|
381
578
|
this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,
|
|
382
579
|
this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,
|
|
383
580
|
this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,
|
|
384
|
-
this._savedState=null,this._outputConfiguration={writeOut:t=>
|
|
385
|
-
outputError:(t,e)=>e(t),getOutHelpWidth:()=>
|
|
386
|
-
getErrHelpWidth:()=>
|
|
387
|
-
getOutHasColors:()
|
|
388
|
-
getErrHasColors:()
|
|
581
|
+
this._savedState=null,this._outputConfiguration={writeOut:t=>W.stdout.write(t),writeErr:t=>W.stderr.write(t),
|
|
582
|
+
outputError:(t,e)=>e(t),getOutHelpWidth:()=>W.stdout.isTTY?W.stdout.columns:void 0,
|
|
583
|
+
getErrHelpWidth:()=>W.stderr.isTTY?W.stderr.columns:void 0,
|
|
584
|
+
getOutHasColors:()=>ns()??(W.stdout.isTTY&&W.stdout.hasColors?.()),
|
|
585
|
+
getErrHasColors:()=>ns()??(W.stderr.isTTY&&W.stderr.hasColors?.()),stripColor:t=>M(t)},this._hidden=!1,
|
|
389
586
|
this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},
|
|
390
587
|
this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){
|
|
391
588
|
return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,
|
|
@@ -394,29 +591,29 @@ this._storeOptionsAsProperties=t._storeOptionsAsProperties,
|
|
|
394
591
|
this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,
|
|
395
592
|
this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,
|
|
396
593
|
this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){const t=[]
|
|
397
|
-
;for(let e=this;e;e=e.parent)t.push(e);return t}command(t,e,i){let
|
|
398
|
-
|
|
399
|
-
a._executableHandler=!0),
|
|
400
|
-
a._executableFile=
|
|
401
|
-
a.copyInheritedSettings(this),
|
|
402
|
-
return Object.assign(new
|
|
594
|
+
;for(let e=this;e;e=e.parent)t.push(e);return t}command(t,e,i){let s=e,r=i;"object"==typeof s&&null!==s&&(r=s,s=null),
|
|
595
|
+
r=r||{};const[,n,o]=t.match(/([^ ]+) *(.*)/),a=this.createCommand(n);return s&&(a.description(s),
|
|
596
|
+
a._executableHandler=!0),r.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!r.noHelp&&!r.hidden),
|
|
597
|
+
a._executableFile=r.executableFile||null,o&&a.arguments(o),this._registerCommand(a),a.parent=this,
|
|
598
|
+
a.copyInheritedSettings(this),s?this:a}createCommand(t){return new ss(t)}createHelp(){
|
|
599
|
+
return Object.assign(new Xi,this.configureHelp())}configureHelp(t){
|
|
403
600
|
return void 0===t?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){
|
|
404
601
|
return void 0===t?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}
|
|
405
602
|
showHelpAfterError(t=!0){return"string"!=typeof t&&(t=!!t),this._showHelpAfterError=t,this}
|
|
406
603
|
showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,e){
|
|
407
604
|
if(!t._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()")
|
|
408
605
|
;return(e=e||{}).isDefault&&(this._defaultCommandName=t._name),(e.noHelp||e.hidden)&&(t._hidden=!0),
|
|
409
|
-
this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,e){return new
|
|
410
|
-
argument(t,e,i,
|
|
411
|
-
this.addArgument(
|
|
606
|
+
this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,e){return new Ki(t,e)}
|
|
607
|
+
argument(t,e,i,s){const r=this.createArgument(t,e);return"function"==typeof i?r.default(s).argParser(i):r.default(i),
|
|
608
|
+
this.addArgument(r),this}arguments(t){return t.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(t){
|
|
412
609
|
const e=this.registeredArguments.slice(-1)[0]
|
|
413
610
|
;if(e?.variadic)throw new Error(`only the last argument can be variadic '${e.name()}'`)
|
|
414
611
|
;if(t.required&&void 0!==t.defaultValue&&void 0===t.parseArg)throw new Error(`a default value for a required argument is never used: '${t.name()}'`)
|
|
415
612
|
;return this.registeredArguments.push(t),this}helpCommand(t,e){
|
|
416
613
|
if("boolean"==typeof t)return this._addImplicitHelpCommand=t,
|
|
417
614
|
t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this
|
|
418
|
-
;const i=t??"help [command]",[,r
|
|
419
|
-
;return o.helpOption(!1),
|
|
615
|
+
;const i=t??"help [command]",[,s,r]=i.match(/([^ ]+) *(.*)/),n=e??"display help for command",o=this.createCommand(s)
|
|
616
|
+
;return o.helpOption(!1),r&&o.arguments(r),n&&o.description(n),this._addImplicitHelpCommand=!0,this._helpCommand=o,
|
|
420
617
|
(t||e)&&this._initCommandGroup(o),this}addHelpCommand(t,e){return"object"!=typeof t?(this.helpCommand(t,e),
|
|
421
618
|
this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){
|
|
422
619
|
return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(void 0===this._helpCommand&&this.helpCommand(void 0,void 0),
|
|
@@ -424,33 +621,33 @@ this._helpCommand):null}hook(t,e){const i=["preSubcommand","preAction","postActi
|
|
|
424
621
|
;if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`)
|
|
425
622
|
;return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(e):this._lifeCycleHooks[t]=[e],this}exitOverride(t){
|
|
426
623
|
return this._exitCallback=t||(t=>{if("commander.executeSubCommandAsync"!==t.code)throw t}),this}_exit(t,e,i){
|
|
427
|
-
this._exitCallback&&this._exitCallback(new
|
|
428
|
-
const i=this.registeredArguments.length,
|
|
429
|
-
|
|
430
|
-
return t.parseArg(e,i)}catch(t){if("commander.invalidArgument"===t.code){const e=`${
|
|
624
|
+
this._exitCallback&&this._exitCallback(new qi(t,e,i)),W.exit(t)}action(t){return this._actionHandler=e=>{
|
|
625
|
+
const i=this.registeredArguments.length,s=e.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),
|
|
626
|
+
s.push(this),t.apply(this,s)},this}createOption(t,e){return new Zi(t,e)}_callParseArg(t,e,i,s){try{
|
|
627
|
+
return t.parseArg(e,i)}catch(t){if("commander.invalidArgument"===t.code){const e=`${s} ${t.message}`;this.error(e,{
|
|
431
628
|
exitCode:t.exitCode,code:t.code})}throw t}}_registerOption(t){
|
|
432
629
|
const e=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(e){
|
|
433
630
|
const i=t.long&&this._findOption(t.long)?t.long:t.short
|
|
434
631
|
;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'\n- already used by option '${e.flags}'`)
|
|
435
632
|
}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){
|
|
436
633
|
const e=t=>[t.name()].concat(t.aliases()),i=e(t).find(t=>this._findCommand(t));if(i){
|
|
437
|
-
const
|
|
438
|
-
;throw new Error(`cannot add command '${
|
|
634
|
+
const s=e(this._findCommand(i)).join("|"),r=e(t).join("|")
|
|
635
|
+
;throw new Error(`cannot add command '${r}' as already have command '${s}'`)}this._initCommandGroup(t),
|
|
439
636
|
this.commands.push(t)}addOption(t){this._registerOption(t);const e=t.name(),i=t.attributeName()
|
|
440
|
-
;void 0!==t.defaultValue&&this.setOptionValueWithSource(i,t.defaultValue,"default");const
|
|
637
|
+
;void 0!==t.defaultValue&&this.setOptionValueWithSource(i,t.defaultValue,"default");const s=(e,s,r)=>{
|
|
441
638
|
null==e&&void 0!==t.presetArg&&(e=t.presetArg);const n=this.getOptionValue(i)
|
|
442
|
-
;null!==e&&t.parseArg?e=this._callParseArg(t,e,n,
|
|
443
|
-
null==e&&(e=!t.negate&&(!(!t.isBoolean()&&!t.optional)||"")),this.setOptionValueWithSource(i,e,
|
|
444
|
-
;return this.on("option:"+e,e=>{const i=`error: option '${t.flags}' argument '${e}' is invalid.`;
|
|
639
|
+
;null!==e&&t.parseArg?e=this._callParseArg(t,e,n,s):null!==e&&t.variadic&&(e=t._collectValue(e,n)),
|
|
640
|
+
null==e&&(e=!t.negate&&(!(!t.isBoolean()&&!t.optional)||"")),this.setOptionValueWithSource(i,e,r)}
|
|
641
|
+
;return this.on("option:"+e,e=>{const i=`error: option '${t.flags}' argument '${e}' is invalid.`;s(e,i,"cli")}),
|
|
445
642
|
t.envVar&&this.on("optionEnv:"+e,e=>{
|
|
446
|
-
const i=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;
|
|
447
|
-
_optionEx(t,e,i,r
|
|
448
|
-
if("object"==typeof e&&e instanceof
|
|
643
|
+
const i=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;s(e,i,"env")}),this}
|
|
644
|
+
_optionEx(t,e,i,s,r){
|
|
645
|
+
if("object"==typeof e&&e instanceof Zi)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")
|
|
449
646
|
;const n=this.createOption(e,i)
|
|
450
|
-
;if(n.makeOptionMandatory(!!t.mandatory),"function"==typeof
|
|
451
|
-
const t=
|
|
452
|
-
;return this.addOption(n)}option(t,e,i,
|
|
453
|
-
return this._optionEx({mandatory:!0},t,e,i,
|
|
647
|
+
;if(n.makeOptionMandatory(!!t.mandatory),"function"==typeof s)n.default(r).argParser(s);else if(s instanceof RegExp){
|
|
648
|
+
const t=s;s=(e,i)=>{const s=t.exec(e);return s?s[0]:i},n.default(r).argParser(s)}else n.default(s)
|
|
649
|
+
;return this.addOption(n)}option(t,e,i,s){return this._optionEx({},t,e,i,s)}requiredOption(t,e,i,s){
|
|
650
|
+
return this._optionEx({mandatory:!0},t,e,i,s)}combineFlagAndOptionalValue(t=!0){
|
|
454
651
|
return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}
|
|
455
652
|
allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){
|
|
456
653
|
return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,
|
|
@@ -467,10 +664,10 @@ getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceW
|
|
|
467
664
|
;return this._getCommandAndAncestors().forEach(i=>{void 0!==i.getOptionValueSource(t)&&(e=i.getOptionValueSource(t))}),e
|
|
468
665
|
}_prepareUserArgs(t,e){
|
|
469
666
|
if(void 0!==t&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(e=e||{},
|
|
470
|
-
void 0===t&&void 0===e.from){
|
|
667
|
+
void 0===t&&void 0===e.from){W.versions?.electron&&(e.from="electron");const t=W.execArgv??[]
|
|
471
668
|
;(t.includes("-e")||t.includes("--eval")||t.includes("-p")||t.includes("--print"))&&(e.from="eval")}let i
|
|
472
|
-
;switch(void 0===t&&(t=
|
|
473
|
-
;break;case"electron":
|
|
669
|
+
;switch(void 0===t&&(t=W.argv),this.rawArgs=t.slice(),e.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2)
|
|
670
|
+
;break;case"electron":W.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break
|
|
474
671
|
;case"eval":i=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}
|
|
475
672
|
return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}
|
|
476
673
|
parse(t,e){this._prepareForParse();const i=this._prepareUserArgs(t,e);return this._parseCommand([],i),this}
|
|
@@ -484,42 +681,42 @@ restoreStateBeforeParse(){
|
|
|
484
681
|
if(this._storeOptionsAsProperties)throw new Error("Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties")
|
|
485
682
|
;this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={
|
|
486
683
|
...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],
|
|
487
|
-
this.processedArgs=[]}_checkForMissingExecutable(t,e,i){if(
|
|
684
|
+
this.processedArgs=[]}_checkForMissingExecutable(t,e,i){if(a.existsSync(t))return
|
|
488
685
|
;throw new Error(`'${t}' does not exist\n - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${e?`searched for local subcommand relative to directory '${e}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory"}`)
|
|
489
|
-
}_executeSubCommand(e,
|
|
490
|
-
;if(
|
|
491
|
-
;return
|
|
492
|
-
;let
|
|
493
|
-
t=
|
|
494
|
-
;if(!t&&!e._executableFile&&this._scriptPath){const
|
|
495
|
-
;
|
|
496
|
-
;if("win32"!==
|
|
497
|
-
})):
|
|
498
|
-
|
|
499
|
-
["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(t=>{
|
|
500
|
-
})}const
|
|
501
|
-
t=t??1,
|
|
502
|
-
if("ENOENT"===t.code)this._checkForMissingExecutable(
|
|
503
|
-
;if(
|
|
504
|
-
this.runningCommand=
|
|
505
|
-
|
|
506
|
-
if(!
|
|
686
|
+
}_executeSubCommand(e,s){s=s.slice();const r=[".js",".ts",".tsx",".mjs",".cjs"];function n(t,e){const s=i.resolve(t,e)
|
|
687
|
+
;if(a.existsSync(s))return s;if(r.includes(i.extname(e)))return;const n=r.find(t=>a.existsSync(`${s}${t}`))
|
|
688
|
+
;return n?`${s}${n}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions()
|
|
689
|
+
;let o=e._executableFile||`${this._name}-${e._name}`,l=this._executableDir||"";if(this._scriptPath){let t;try{
|
|
690
|
+
t=a.realpathSync(this._scriptPath)}catch{t=this._scriptPath}l=i.resolve(i.dirname(t),l)}if(l){let t=n(l,o)
|
|
691
|
+
;if(!t&&!e._executableFile&&this._scriptPath){const s=i.basename(this._scriptPath,i.extname(this._scriptPath))
|
|
692
|
+
;s!==this._name&&(t=n(l,`${s}-${e._name}`))}o=t||o}const h=r.includes(i.extname(o));let c
|
|
693
|
+
;if("win32"!==W.platform?h?(s.unshift(o),s=rs(W.execArgv).concat(s),c=t.spawn(W.argv[0],s,{stdio:"inherit"
|
|
694
|
+
})):c=t.spawn(o,s,{stdio:"inherit"}):(this._checkForMissingExecutable(o,l,e._name),s.unshift(o),
|
|
695
|
+
s=rs(W.execArgv).concat(s),c=t.spawn(W.execPath,s,{stdio:"inherit"})),!c.killed){
|
|
696
|
+
["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(t=>{W.on(t,()=>{!1===c.killed&&null===c.exitCode&&c.kill(t)})
|
|
697
|
+
})}const u=this._exitCallback;c.on("close",t=>{
|
|
698
|
+
t=t??1,u?u(new qi(t,"commander.executeSubCommandAsync","(close)")):W.exit(t)}),c.on("error",t=>{
|
|
699
|
+
if("ENOENT"===t.code)this._checkForMissingExecutable(o,l,e._name);else if("EACCES"===t.code)throw new Error(`'${o}' not executable`)
|
|
700
|
+
;if(u){const e=new qi(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,u(e)}else W.exit(1)}),
|
|
701
|
+
this.runningCommand=c}_dispatchSubcommand(t,e,i){const s=this._findCommand(t);let r;return s||this.help({error:!0}),
|
|
702
|
+
s._prepareForParse(),r=this._chainOrCallSubCommandHook(r,s,"preSubcommand"),r=this._chainOrCall(r,()=>{
|
|
703
|
+
if(!s._executableHandler)return s._parseCommand(e,i);this._executeSubCommand(s,e.concat(i))}),r}_dispatchHelpCommand(t){
|
|
507
704
|
t||this.help();const e=this._findCommand(t);return e&&!e._executableHandler&&e.help(),
|
|
508
705
|
this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}
|
|
509
706
|
_checkNumberOfArguments(){this.registeredArguments.forEach((t,e)=>{
|
|
510
707
|
t.required&&null==this.args[e]&&this.missingArgument(t.name())
|
|
511
708
|
}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic||this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)
|
|
512
|
-
}_processArguments(){const t=(t,e,i)=>{let
|
|
513
|
-
const
|
|
514
|
-
return
|
|
515
|
-
;i.variadic?
|
|
516
|
-
i.parseArg&&(
|
|
517
|
-
i.parseArg&&(
|
|
518
|
-
return t?.then&&"function"==typeof t.then?t.then(()=>e()):e()}_chainOrCallHooks(t,e){let i=t;const
|
|
709
|
+
}_processArguments(){const t=(t,e,i)=>{let s=e;if(null!==e&&t.parseArg){
|
|
710
|
+
const r=`error: command-argument value '${e}' is invalid for argument '${t.name()}'.`;s=this._callParseArg(t,e,i,r)}
|
|
711
|
+
return s};this._checkNumberOfArguments();const e=[];this.registeredArguments.forEach((i,s)=>{let r=i.defaultValue
|
|
712
|
+
;i.variadic?s<this.args.length?(r=this.args.slice(s),
|
|
713
|
+
i.parseArg&&(r=r.reduce((e,s)=>t(i,s,e),i.defaultValue))):void 0===r&&(r=[]):s<this.args.length&&(r=this.args[s],
|
|
714
|
+
i.parseArg&&(r=t(i,r,i.defaultValue))),e[s]=r}),this.processedArgs=e}_chainOrCall(t,e){
|
|
715
|
+
return t?.then&&"function"==typeof t.then?t.then(()=>e()):e()}_chainOrCallHooks(t,e){let i=t;const s=[]
|
|
519
716
|
;return this._getCommandAndAncestors().reverse().filter(t=>void 0!==t._lifeCycleHooks[e]).forEach(t=>{
|
|
520
|
-
t._lifeCycleHooks[e].forEach(e=>{
|
|
521
|
-
i=this._chainOrCall(i,()=>t.callback(t.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,e,i){let
|
|
522
|
-
;return void 0!==this._lifeCycleHooks[i]&&this._lifeCycleHooks[i].forEach(t=>{
|
|
717
|
+
t._lifeCycleHooks[e].forEach(e=>{s.push({hookedCommand:t,callback:e})})}),"postAction"===e&&s.reverse(),s.forEach(t=>{
|
|
718
|
+
i=this._chainOrCall(i,()=>t.callback(t.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,e,i){let s=t
|
|
719
|
+
;return void 0!==this._lifeCycleHooks[i]&&this._lifeCycleHooks[i].forEach(t=>{s=this._chainOrCall(s,()=>t(this,e))}),s}
|
|
523
720
|
_parseCommand(t,e){const i=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),
|
|
524
721
|
t=t.concat(i.operands),
|
|
525
722
|
e=i.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),e)
|
|
@@ -528,14 +725,14 @@ e=i.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispat
|
|
|
528
725
|
this._dispatchSubcommand(this._defaultCommandName,t,e)
|
|
529
726
|
;!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),
|
|
530
727
|
this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions()
|
|
531
|
-
;const
|
|
532
|
-
let i;return
|
|
728
|
+
;const s=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},r=`command:${this.name()}`;if(this._actionHandler){
|
|
729
|
+
let i;return s(),this._processArguments(),i=this._chainOrCallHooks(i,"preAction"),
|
|
533
730
|
i=this._chainOrCall(i,()=>this._actionHandler(this.processedArgs)),this.parent&&(i=this._chainOrCall(i,()=>{
|
|
534
|
-
this.parent.emit(
|
|
535
|
-
this._processArguments(),this.parent.emit(
|
|
731
|
+
this.parent.emit(r,t,e)})),i=this._chainOrCallHooks(i,"postAction"),i}if(this.parent?.listenerCount(r))s(),
|
|
732
|
+
this._processArguments(),this.parent.emit(r,t,e);else if(t.length){
|
|
536
733
|
if(this._findCommand("*"))return this._dispatchSubcommand("*",t,e)
|
|
537
|
-
;this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(
|
|
538
|
-
this._processArguments())}else this.commands.length?(
|
|
734
|
+
;this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(s(),
|
|
735
|
+
this._processArguments())}else this.commands.length?(s(),this.help({error:!0})):(s(),this._processArguments())}
|
|
539
736
|
_findCommand(t){if(t)return this.commands.find(e=>e._name===t||e._aliases.includes(t))}_findOption(t){
|
|
540
737
|
return this.options.find(e=>e.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{
|
|
541
738
|
t.options.forEach(e=>{e.mandatory&&void 0===t.getOptionValue(e.attributeName())&&t.missingMandatoryOptionValue(e)})})}
|
|
@@ -543,33 +740,33 @@ _checkForConflictingLocalOptions(){const t=this.options.filter(t=>{const e=t.att
|
|
|
543
740
|
;return void 0!==this.getOptionValue(e)&&"default"!==this.getOptionValueSource(e)})
|
|
544
741
|
;t.filter(t=>t.conflictsWith.length>0).forEach(e=>{const i=t.find(t=>e.conflictsWith.includes(t.attributeName()))
|
|
545
742
|
;i&&this._conflictingOption(e,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{
|
|
546
|
-
t._checkForConflictingLocalOptions()})}parseOptions(t){const e=[],i=[];let
|
|
743
|
+
t._checkForConflictingLocalOptions()})}parseOptions(t){const e=[],i=[];let s=e;function r(t){
|
|
547
744
|
return t.length>1&&"-"===t[0]}
|
|
548
745
|
const n=t=>!!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(t)&&!this._getCommandAndAncestors().some(t=>t.options.map(t=>t.short).some(t=>/^-\d$/.test(t)))
|
|
549
|
-
;let o=null,a=null,l=0;for(;l<t.length||a;){const h=a??t[l++];if(a=null,"--"===h){
|
|
550
|
-
;break}if(!o||
|
|
746
|
+
;let o=null,a=null,l=0;for(;l<t.length||a;){const h=a??t[l++];if(a=null,"--"===h){s===i&&s.push(h),s.push(...t.slice(l))
|
|
747
|
+
;break}if(!o||r(h)&&!n(h)){if(o=null,r(h)){const e=this._findOption(h);if(e){if(e.required){const i=t[l++]
|
|
551
748
|
;void 0===i&&this.optionMissingArgument(e),this.emit(`option:${e.name()}`,i)}else if(e.optional){let i=null
|
|
552
|
-
;l<t.length&&(!
|
|
749
|
+
;l<t.length&&(!r(t[l])||n(t[l]))&&(i=t[l++]),this.emit(`option:${e.name()}`,i)}else this.emit(`option:${e.name()}`)
|
|
553
750
|
;o=e.variadic?e:null;continue}}if(h.length>2&&"-"===h[0]&&"-"!==h[1]){const t=this._findOption(`-${h[1]}`);if(t){
|
|
554
751
|
t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,h.slice(2)):(this.emit(`option:${t.name()}`),
|
|
555
752
|
a=`-${h.slice(2)}`);continue}}if(/^--[^=]+=/.test(h)){const t=h.indexOf("="),e=this._findOption(h.slice(0,t))
|
|
556
753
|
;if(e&&(e.required||e.optional)){this.emit(`option:${e.name()}`,h.slice(t+1));continue}}
|
|
557
|
-
if(
|
|
754
|
+
if(s!==e||!r(h)||0===this.commands.length&&n(h)||(s=i),
|
|
558
755
|
(this._enablePositionalOptions||this._passThroughOptions)&&0===e.length&&0===i.length){if(this._findCommand(h)){
|
|
559
756
|
e.push(h),i.push(...t.slice(l));break}if(this._getHelpCommand()&&h===this._getHelpCommand().name()){
|
|
560
757
|
e.push(h,...t.slice(l));break}if(this._defaultCommandName){i.push(h,...t.slice(l));break}}if(this._passThroughOptions){
|
|
561
|
-
|
|
758
|
+
s.push(h,...t.slice(l));break}s.push(h)}else this.emit(`option:${o.name()}`,h)}return{operands:e,unknown:i}}opts(){
|
|
562
759
|
if(this._storeOptionsAsProperties){const t={},e=this.options.length;for(let i=0;i<e;i++){
|
|
563
760
|
const e=this.options[i].attributeName();t[e]=e===this._versionOptionName?this._version:this[e]}return t}
|
|
564
761
|
return this._optionValues}optsWithGlobals(){
|
|
565
762
|
return this._getCommandAndAncestors().reduce((t,e)=>Object.assign(t,e.opts()),{})}error(t,e){
|
|
566
763
|
this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr),
|
|
567
764
|
"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),
|
|
568
|
-
this.outputHelp({error:!0}));const i=e||{},
|
|
569
|
-
_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in
|
|
570
|
-
;(void 0===this.getOptionValue(e)||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,
|
|
765
|
+
this.outputHelp({error:!0}));const i=e||{},s=i.exitCode||1,r=i.code||"commander.error";this._exit(s,r,t)}
|
|
766
|
+
_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in W.env){const e=t.attributeName()
|
|
767
|
+
;(void 0===this.getOptionValue(e)||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,W.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))
|
|
571
768
|
}})}_parseOptionsImplied(){
|
|
572
|
-
const t=new
|
|
769
|
+
const t=new ts(this.options),e=t=>void 0!==this.getOptionValue(t)&&!["default","implied"].includes(this.getOptionValueSource(t))
|
|
573
770
|
;this.options.filter(i=>void 0!==i.implied&&e(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(t=>{
|
|
574
771
|
Object.keys(t.implied).filter(t=>!e(t)).forEach(e=>{this.setOptionValueWithSource(e,t.implied[e],"implied")})})}
|
|
575
772
|
missingArgument(t){const e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}
|
|
@@ -577,22 +774,22 @@ optionMissingArgument(t){const e=`error: option '${t.flags}' argument missing`;t
|
|
|
577
774
|
code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){
|
|
578
775
|
const e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})
|
|
579
776
|
}_conflictingOption(t,e){const i=t=>{
|
|
580
|
-
const e=t.attributeName(),i=this.getOptionValue(e),
|
|
581
|
-
;return
|
|
582
|
-
const e=i(t),
|
|
583
|
-
;return"env"===this.getOptionValueSource(
|
|
584
|
-
},
|
|
585
|
-
if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],
|
|
586
|
-
const t=
|
|
587
|
-
}while(
|
|
777
|
+
const e=t.attributeName(),i=this.getOptionValue(e),s=this.options.find(t=>t.negate&&e===t.attributeName()),r=this.options.find(t=>!t.negate&&e===t.attributeName())
|
|
778
|
+
;return s&&(void 0===s.presetArg&&!1===i||void 0!==s.presetArg&&i===s.presetArg)?s:r||t},s=t=>{
|
|
779
|
+
const e=i(t),s=e.attributeName()
|
|
780
|
+
;return"env"===this.getOptionValueSource(s)?`environment variable '${e.envVar}'`:`option '${e.flags}'`
|
|
781
|
+
},r=`error: ${s(t)} cannot be used with ${s(e)}`;this.error(r,{code:"commander.conflictingOption"})}unknownOption(t){
|
|
782
|
+
if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{
|
|
783
|
+
const t=s.createHelp().visibleOptions(s).filter(t=>t.long).map(t=>t.long);i=i.concat(t),s=s.parent
|
|
784
|
+
}while(s&&!s._enablePositionalOptions);e=is(t,i)}const i=`error: unknown option '${t}'${e}`;this.error(i,{
|
|
588
785
|
code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return
|
|
589
|
-
;const e=this.registeredArguments.length,i=1===e?"":"s",
|
|
590
|
-
;this.error(
|
|
786
|
+
;const e=this.registeredArguments.length,i=1===e?"":"s",s=t.length,r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${e} argument${i} but got ${s}: ${t.join(", ")}.`
|
|
787
|
+
;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let e=""
|
|
591
788
|
;if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach(t=>{i.push(t.name()),
|
|
592
|
-
t.alias()&&i.push(t.alias())}),e=
|
|
789
|
+
t.alias()&&i.push(t.alias())}),e=is(t,i)}const i=`error: unknown command '${t}'${e}`;this.error(i,{
|
|
593
790
|
code:"commander.unknownCommand"})}version(t,e,i){if(void 0===t)return this._version;this._version=t,
|
|
594
|
-
e=e||"-V, --version",i=i||"output the version number";const
|
|
595
|
-
;return this._versionOptionName=
|
|
791
|
+
e=e||"-V, --version",i=i||"output the version number";const s=this.createOption(e,i)
|
|
792
|
+
;return this._versionOptionName=s.attributeName(),this._registerOption(s),this.on("option:"+s.name(),()=>{
|
|
596
793
|
this._outputConfiguration.writeOut(`${t}\n`),this._exit(0,"commander.version",t)}),this}description(t,e){
|
|
597
794
|
return void 0===t&&void 0===e?this._description:(this._description=t,e&&(this._argsDescription=e),this)}summary(t){
|
|
598
795
|
return void 0===t?this._summary:(this._summary=t,this)}alias(t){if(void 0===t)return this._aliases[0];let e=this
|
|
@@ -601,7 +798,7 @@ t===e._name)throw new Error("Command alias can't be the same as its name");const
|
|
|
601
798
|
const e=[i.name()].concat(i.aliases()).join("|")
|
|
602
799
|
;throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${e}'`)}
|
|
603
800
|
return e._aliases.push(t),this}aliases(t){return void 0===t?this._aliases:(t.forEach(t=>this.alias(t)),this)}usage(t){
|
|
604
|
-
if(void 0===t){if(this._usage)return this._usage;const t=this.registeredArguments.map(t=>
|
|
801
|
+
if(void 0===t){if(this._usage)return this._usage;const t=this.registeredArguments.map(t=>Qi(t))
|
|
605
802
|
;return[].concat(this.options.length||null!==this._helpOption?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")
|
|
606
803
|
}return this._usage=t,this}name(t){return void 0===t?this._name:(this._name=t,this)}helpGroup(t){
|
|
607
804
|
return void 0===t?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){
|
|
@@ -612,82 +809,98 @@ this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup
|
|
|
612
809
|
return this._name=i.basename(t,i.extname(t)),this}executableDir(t){
|
|
613
810
|
return void 0===t?this._executableDir:(this._executableDir=t,this)}helpInformation(t){
|
|
614
811
|
const e=this.createHelp(),i=this._getOutputContext(t);e.prepareContext({error:i.error,helpWidth:i.helpWidth,
|
|
615
|
-
outputHasColors:i.hasColors});const
|
|
616
|
-
_getOutputContext(t){const e=!!(t=t||{}).error;let i,r
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
write:t=>(
|
|
621
|
-
;"function"==typeof t&&(e=t,t=void 0);const i=this._getOutputContext(t),
|
|
622
|
-
;this._getCommandAndAncestors().reverse().forEach(t=>t.emit("beforeAllHelp",
|
|
623
|
-
;let
|
|
624
|
-
;if(e&&(
|
|
625
|
-
;i.write(
|
|
626
|
-
this._getCommandAndAncestors().forEach(t=>t.emit("afterAllHelp",
|
|
812
|
+
outputHasColors:i.hasColors});const s=e.formatHelp(this,e);return i.hasColors?s:this._outputConfiguration.stripColor(s)}
|
|
813
|
+
_getOutputContext(t){const e=!!(t=t||{}).error;let i,s,r;e?(i=t=>this._outputConfiguration.writeErr(t),
|
|
814
|
+
s=this._outputConfiguration.getErrHasColors(),
|
|
815
|
+
r=this._outputConfiguration.getErrHelpWidth()):(i=t=>this._outputConfiguration.writeOut(t),
|
|
816
|
+
s=this._outputConfiguration.getOutHasColors(),r=this._outputConfiguration.getOutHelpWidth());return{error:e,
|
|
817
|
+
write:t=>(s||(t=this._outputConfiguration.stripColor(t)),i(t)),hasColors:s,helpWidth:r}}outputHelp(t){let e
|
|
818
|
+
;"function"==typeof t&&(e=t,t=void 0);const i=this._getOutputContext(t),s={error:i.error,write:i.write,command:this}
|
|
819
|
+
;this._getCommandAndAncestors().reverse().forEach(t=>t.emit("beforeAllHelp",s)),this.emit("beforeHelp",s)
|
|
820
|
+
;let r=this.helpInformation({error:i.error})
|
|
821
|
+
;if(e&&(r=e(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer")
|
|
822
|
+
;i.write(r),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",s),
|
|
823
|
+
this._getCommandAndAncestors().forEach(t=>t.emit("afterAllHelp",s))}helpOption(t,e){
|
|
627
824
|
return"boolean"==typeof t?(t?(null===this._helpOption&&(this._helpOption=void 0),
|
|
628
825
|
this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,
|
|
629
826
|
this):(this._helpOption=this.createOption(t??"-h, --help",e??"display help for command"),
|
|
630
827
|
(t||e)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){
|
|
631
828
|
return void 0===this._helpOption&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){
|
|
632
|
-
return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let e=Number(
|
|
829
|
+
return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let e=Number(W.exitCode??0)
|
|
633
830
|
;0===e&&t&&"function"!=typeof t&&t.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){
|
|
634
831
|
const i=["beforeAll","before","after","afterAll"]
|
|
635
832
|
;if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`)
|
|
636
|
-
;const
|
|
833
|
+
;const s=`${t}Help`;return this.on(s,t=>{let i;i="function"==typeof e?e({error:t.error,command:t.command}):e,
|
|
637
834
|
i&&t.write(`${i}\n`)}),this}_outputHelpIfRequested(t){const e=this._getHelpOption()
|
|
638
|
-
;e&&t.find(t=>e.is(t))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function
|
|
639
|
-
return t.map(t=>{if(!t.startsWith("--inspect"))return t;let e,i,
|
|
835
|
+
;e&&t.find(t=>e.is(t))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function rs(t){
|
|
836
|
+
return t.map(t=>{if(!t.startsWith("--inspect"))return t;let e,i,s="127.0.0.1",r="9229"
|
|
640
837
|
;return null!==(i=t.match(/^(--inspect(-brk)?)$/))?e=i[1]:null!==(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(e=i[1],
|
|
641
|
-
/^\d+$/.test(i[3])?
|
|
642
|
-
|
|
643
|
-
return!
|
|
644
|
-
}new
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
t
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
console.error(
|
|
656
|
-
|
|
657
|
-
;
|
|
658
|
-
console.error(
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
;
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
;const
|
|
665
|
-
|
|
666
|
-
})
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
;
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
t.command("
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
;
|
|
690
|
-
;
|
|
691
|
-
|
|
838
|
+
/^\d+$/.test(i[3])?r=i[3]:s=i[3]):null!==(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(e=i[1],s=i[3],
|
|
839
|
+
r=i[4]),e&&"0"!==r?`${e}=${s}:${parseInt(r)+1}`:t})}function ns(){
|
|
840
|
+
return!W.env.NO_COLOR&&"0"!==W.env.FORCE_COLOR&&"false"!==W.env.FORCE_COLOR&&(!(!W.env.FORCE_COLOR&&void 0===W.env.CLICOLOR_FORCE)||void 0)
|
|
841
|
+
}new ss;const os=process.cwd(),as=200;function ls(){return l(s(os,"package.json"))&&l(s(os,"node_modules"))}
|
|
842
|
+
function hs(t){
|
|
843
|
+
return`\n import mahameru from "mahameru";\n\n mahameru(${JSON.stringify(t)}).then(app =>\n app.initialize().then(() => {\n console.log("\\x1b[32m Mahameru Server Ready! 🚀\\x1b[0m");\n console.log(" \\x1b[1mMode:\\x1b[22m \\x1b[36m${t.dev?"Development":"Production"}\\x1b[0m");\n console.log(" \\x1b[1mLocal:\\x1b[22m \\x1b[36mhttp://${t.host}:${t.port}\\x1b[0m");\n console.log(" \\x1b[1mHost:\\x1b[22m ${t.host}");\n console.log(" \\x1b[1mPort:\\x1b[22m ${t.port}\\n");\n console.log("\\x1b[90mPress Ctrl+C to stop server\\x1b[0m\\n");\n }).catch(error => {\n console.error(error);\n process.exitCode = 1;\n })\n ).catch(error => {\n console.error(error);\n process.exitCode = 1;\n });\n `
|
|
844
|
+
}function cs(t){console.log(`${Yi().bold(Yi().cyan("▲ Mahameru"))} ${Yi().dim(`CLI v${t}`)}\n`)}function us(t){
|
|
845
|
+
const e=parseInt(t,10);if(!isNaN(e))return e}function ds(t,i,s){return new Promise((r,n)=>{
|
|
846
|
+
const o=e(process.execPath,[t,...i],{stdio:"inherit",cwd:s});o.on("close",t=>r(t??1)),o.on("error",n)})}function ps(t){
|
|
847
|
+
return new Promise(e=>{t&&null===t.exitCode&&!t.killed?(t.once("close",()=>e()),t.kill("SIGTERM")):e()})}(async()=>{
|
|
848
|
+
const t=new ss,{rE:i}=U;try{
|
|
849
|
+
t.name("mahameru").description(`${Yi().bold(Yi().cyan("▲ Mahameru"))} ${Yi().dim(`CLI v${i}`)}`).version(i,"-v, --version","Display help for command"),
|
|
850
|
+
t.command("dev").option("-p, --port <number>","Port to run the server on",us).option("-h, --host <string>","Host to run the server on").action(async({host:t,port:r})=>{
|
|
851
|
+
ls()||(console.error(Yi().red(" Current directory is not a Node.js project.")),process.exit(1));const n=function(){
|
|
852
|
+
const t="mahameru.config.ts",e=s(os,t);l(e)||(console.error(Yi().red(`❌ Error: Config file '${t}' is not found.`)),
|
|
853
|
+
console.error(Yi().yellow("Please create project by running: npm create mahameru")),process.exit(1))
|
|
854
|
+
;const i=s(os,"node_modules","tsx","dist","cli.mjs")
|
|
855
|
+
;l(i)||(console.error(Yi().red("❌ Error: Runner 'tsx' is not installed.")),
|
|
856
|
+
console.error(Yi().yellow("Please install it by running: npm install -D tsx")),process.exit(1))
|
|
857
|
+
;const r=s(os,"node_modules","tsx","dist","esm","api")
|
|
858
|
+
;l(r)||(console.error(Yi().red("❌ Error: Runner 'tsx' API is not installed.")),
|
|
859
|
+
console.error(Yi().yellow("Please install it by running: npm install -D tsx")),process.exit(1));return{configFileName:t,
|
|
860
|
+
configFilePath:e,tsxJsPath:i}}();console.clear(),cs(i),await async function({environment:t,host:i,port:r}){
|
|
861
|
+
let n=null,o=null,a=null,l=!1,h=!1,c=0;const u=async o=>{if(!h){l=!0,o&&(console.clear(),
|
|
862
|
+
console.log(Yi().yellow(`\nFile changed (${o}), restarting dev server...\n`))),await ps(n),n=null;try{
|
|
863
|
+
n=await async function({environment:t,host:i,port:r}){const n=await async function(t,{host:e,port:i}){
|
|
864
|
+
const r=await import("tsx/esm/api").catch(()=>{console.error(Yi().red("❌ Error: Runner 'tsx' api is not installed.")),
|
|
865
|
+
console.error(Yi().yellow("Please install it by running: npm install -D tsx")),process.exit(1)
|
|
866
|
+
}),n=j(t.configFilePath).href;let o=(await r.tsImport(n,"file:///F:/Projects/@mahameru/cli/src/index.ts")).default
|
|
867
|
+
;return o={...o,dev:!0,appPath:s(os,"src"),port:void 0!==i?i:void 0!==o.port?o.port:3e3,
|
|
868
|
+
host:void 0!==e?e:void 0!==o.host?o.host:"localhost",modulesPath:s(os,"src","modules"),routesPath:s(os,"src","routes")},
|
|
869
|
+
o}(t,{host:i,port:r}),o=hs(n);return function(t,i,s,r){return e(process.execPath,[t,...i],{stdio:"inherit",cwd:s,env:r})
|
|
870
|
+
}(t.tsxJsPath,["-e",o],os,{...process.env,NODE_ENV:"development"})}({environment:t,host:i,port:r}),c+=1,
|
|
871
|
+
n.once("exit",(t,e)=>{
|
|
872
|
+
h||l||(e?console.error(Yi().red(`Mahameru dev server stopped by signal ${e}.`)):"number"==typeof t&&0!==t&&console.error(Yi().red(`Mahameru dev server exited with code ${t}. Watching for changes...`)))
|
|
873
|
+
})}catch(t){console.error(Yi().red("Failed to start dev server. Watching for changes...")),console.error(t),
|
|
874
|
+
0===c&&console.log(Yi().dim("Fix the error above and save a file to try again.\n"))}finally{l=!1}}},d=t=>{
|
|
875
|
+
h||(a&&clearTimeout(a),a=setTimeout(()=>{u(t)},as))},p=async(t=0)=>{h||(h=!0,a&&clearTimeout(a),await(o?.close()),
|
|
876
|
+
await ps(n),process.exit(t))};process.once("SIGINT",()=>{p(0)}),process.once("SIGTERM",()=>{p(0)}),
|
|
877
|
+
o=qt.watch([t.configFilePath,s(os,"src")],{ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:as,pollInterval:50},
|
|
878
|
+
ignored:[/(^|[\\/])\../,/(^|[\\/])dist([\\/]|$)/,/(^|[\\/])node_modules([\\/]|$)/]}),o.on("all",(t,e)=>{d(e)
|
|
879
|
+
}).on("error",t=>{console.error(Yi().red("File watcher error:")),console.error(t)}),
|
|
880
|
+
console.log(Yi().dim("Watching src/** and mahameru.config.ts for changes...\n")),await u()}({environment:n,host:t,port:r
|
|
881
|
+
})}),t.command("build").description("Build Mahameru production application.").action(async()=>{
|
|
882
|
+
console.log(`${Yi().bold(Yi().cyan("▲ Mahameru"))} ${Yi().dim(`CLI v${i}`)}\n`)
|
|
883
|
+
;const t=Ui(Yi().cyan(" Checking environment...")).start()
|
|
884
|
+
;ls()||(t.fail(Yi().red(" Current directory is not a Node.js project.")),process.exit(1))
|
|
885
|
+
;const e=s(os,"node_modules","typescript","bin","tsc")
|
|
886
|
+
;l(e)||(t.fail(Yi().red(" TypeScript compiler (tsc) is not installed in this project.")),process.exit(1))
|
|
887
|
+
;const r=s(os,"node_modules","tsc-alias","dist","bin","index.js");l(r)||(t.fail(Yi().red(" tsc-alias not installed.")),
|
|
888
|
+
process.exit(1));try{t.text=Yi().cyan(" Starting build...");const i=await ds(e,["--project","tsconfig.json"],os)
|
|
889
|
+
;0!==i&&(t.fail(Yi().red(" Build failed!")),process.exit(i))
|
|
890
|
+
;0!==await ds(e,["--project","config.tsconfig.json"],os)&&(t.fail(Yi().red(" Build failed!")),process.exit(i))
|
|
891
|
+
;const n=await ds(r,["-p","tsconfig.json"],os);0!==n&&(t.fail(Yi().red(" tsc-alias failed.")),process.exit(n))
|
|
892
|
+
;const o=function(t){if(!l(t))return[];const e=[t],i=new Set;for(;e.length>0;){const t=e.pop();for(const r of c(t)){
|
|
893
|
+
const n=s(t,r);if(u(n).isDirectory()){e.push(n);continue}if(!n.endsWith(".js"))continue;const o=h(n,"utf8")
|
|
894
|
+
;(o.includes("'@/")||o.includes('"@/')||o.includes("'#/")||o.includes('"#/'))&&i.add(n)}}return[...i]}(s(os,"dist"))
|
|
895
|
+
;if(o.length>0){
|
|
896
|
+
t.fail(Yi().red(" Build produced unresolved path aliases.")),console.error(Yi().yellow("Please use tsconfig path aliases such as @/* and avoid package.json imports for app source files."))
|
|
897
|
+
;for(const t of o)console.error(Yi().red(` - ${t}`));process.exit(1)}t.succeed(Yi().green(" Build success."))}catch(e){
|
|
898
|
+
t.fail(Yi().red(" Terjadi kesalahan internal.")),console.error(e),process.exit(1)}}),
|
|
899
|
+
t.command("start").description("Start Mahameru production server.").option("-p, --port <number>","Port to run the server on",us).option("-h, --host <string>","Host to run the server on").action(async({host:t,port:r})=>{
|
|
900
|
+
const n=s(os,"dist","mahameru.config.js"),o=j(n).href;let a=(await import(o).catch(()=>{
|
|
901
|
+
console.error(Yi().red("❌ Error: mahameru.config.js is not found.")),process.exit(1)})).default;a={...a,
|
|
902
|
+
appPath:s(os,"dist"),port:void 0!==r?r:void 0!==a.port?a.port:3e3,host:void 0!==t?t:void 0!==a.host?a.host:"localhost",
|
|
903
|
+
modulesPath:s(os,"dist","modules"),routesPath:s(os,"dist","routes")};const l=hs(a);cs(i),e(process.execPath,["-e",l],{
|
|
904
|
+
stdio:"inherit",cwd:os,env:{...process.env,NODE_ENV:"production"}}).on("exit",t=>{0!==t&&process.exit(t)
|
|
692
905
|
}).on("error",t=>{console.error(t)}).on("message",t=>{console.log(t)})}),await t.parseAsync(process.argv)}catch(t){
|
|
693
906
|
console.error(t),process.exit(1)}})();
|