kodu 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +141 -0
- package/dist/index.js +146 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 uxname
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
**kodu** is a blazing fast CLI tool designed to prepare your codebase for Large Language Models (LLMs).
|
|
2
|
+
# kodu
|
|
3
|
+
|
|
4
|
+
**kodu** is a blazing fast CLI tool designed to prepare your codebase for Large Language Models (LLMs).
|
|
5
|
+
|
|
6
|
+
It scans your directory, ignores the junk (binaries, locks, `node_modules`), intelligently prioritizes critical files (
|
|
7
|
+
like `package.json` or `README`), and concatenates everything into a single text output.
|
|
8
|
+
|
|
9
|
+
**New:** Now includes a **Code Cleanup** tool to strip comments from your project!
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
## ✨ Features
|
|
15
|
+
|
|
16
|
+
- **🚀 Fast & Lightweight:** Built with Bun, runs anywhere Node.js runs.
|
|
17
|
+
- **🧠 Context-Aware:** Automatically puts `package.json`, docs, and entry points at the top of the file.
|
|
18
|
+
- **🛡️ Smart Filtering:**
|
|
19
|
+
- Respects `.gitignore`.
|
|
20
|
+
- Automatically excludes binary files, lockfiles, and huge directories (`node_modules`, `.git`, `dist`).
|
|
21
|
+
- Skips files larger than 1MB by default.
|
|
22
|
+
- **🧹 Code Cleanup:** Safely remove all comments from JS/TS files (`.ts`, `.js`, `.tsx`, `.jsx`) to reduce token usage
|
|
23
|
+
or minify code.
|
|
24
|
+
- **📜 Interactive History:** Run `kodu` without arguments to select from your recent commands.
|
|
25
|
+
- **📋 clipboard-ready:** Output to a file or pipe directly to stdout.
|
|
26
|
+
|
|
27
|
+
## 📦 Installation
|
|
28
|
+
|
|
29
|
+
Install globally via npm:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install -g kodu
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 🚀 Usage
|
|
36
|
+
|
|
37
|
+
### 1. Bundle Context (Default)
|
|
38
|
+
|
|
39
|
+
Scan the current directory and generate a text file for LLMs.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Basic usage
|
|
43
|
+
kodu
|
|
44
|
+
|
|
45
|
+
# Specify output file
|
|
46
|
+
kodu ./backend -o context.txt
|
|
47
|
+
|
|
48
|
+
# Pipe to clipboard (macOS)
|
|
49
|
+
kodu . --stdout | pbcopy
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 2. Strip Comments (Cleanup)
|
|
53
|
+
|
|
54
|
+
Remove all comments (`// ...`, `/* ... */`) from JavaScript and TypeScript files in a directory.
|
|
55
|
+
|
|
56
|
+
> **⚠️ Warning:** This command **modifies files in place**. Always commit your changes before running!
|
|
57
|
+
|
|
58
|
+
**Dry Run (Check what will happen):**
|
|
59
|
+
See which files will be modified without actually touching them.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
kodu strip --dry-run
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Execute Cleanup:**
|
|
66
|
+
This will ask for confirmation before proceeding.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
kodu strip
|
|
70
|
+
# or
|
|
71
|
+
kodu strip ./src
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Force Execute (No Prompt):**
|
|
75
|
+
Useful for scripts or CI/CD.
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
kodu strip -y
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## ⚙️ Options & Flags
|
|
82
|
+
|
|
83
|
+
### Bundle Command (`kodu [path]`)
|
|
84
|
+
|
|
85
|
+
| Flag | Description |
|
|
86
|
+
|-----------------------|-------------------------------------------------------------------------|
|
|
87
|
+
| `-o, --output <file>` | Specify the output file path. |
|
|
88
|
+
| `-s, --stdout` | Print to stdout instead of creating a file. |
|
|
89
|
+
| `--exclude <pattern>` | Add custom glob patterns to exclude (e.g. `--exclude "*.css"`). |
|
|
90
|
+
| `--no-gitignore` | Disable `.gitignore` parsing (scan everything except default excludes). |
|
|
91
|
+
|
|
92
|
+
### Strip Command (`kodu strip [path]`)
|
|
93
|
+
|
|
94
|
+
| Flag | Description |
|
|
95
|
+
|------------------|-------------------------------------------------------------|
|
|
96
|
+
| `-d, --dry-run` | Show which files would be processed without modifying them. |
|
|
97
|
+
| `-y, --yes` | Skip confirmation prompt (Danger!). |
|
|
98
|
+
| `-e, --exclude` | Exclude patterns from stripping. |
|
|
99
|
+
| `--no-gitignore` | Disable `.gitignore` parsing. |
|
|
100
|
+
|
|
101
|
+
## 🧠 How it Sorts (Priority Rules)
|
|
102
|
+
|
|
103
|
+
`kodu` sorts files to maximize LLM understanding:
|
|
104
|
+
|
|
105
|
+
1. **Manifests:** `package.json`, `Cargo.toml`, etc.
|
|
106
|
+
2. **Documentation:** `README.md`, `Dockerfile`.
|
|
107
|
+
3. **Entry Points:** `index.ts`, `main.go`.
|
|
108
|
+
4. **Config:** Configuration files.
|
|
109
|
+
5. **Source Code:** Files in `src/`, `lib/`.
|
|
110
|
+
6. **Tests:** Test files are placed last.
|
|
111
|
+
|
|
112
|
+
## 🚫 Default Exclusions
|
|
113
|
+
|
|
114
|
+
`kodu` automatically ignores:
|
|
115
|
+
|
|
116
|
+
- **Directories:** `.git`, `node_modules`, `dist`, `build`, `coverage`, `.vscode`, `__pycache__`, etc.
|
|
117
|
+
- **Files:** Lockfiles (`package-lock.json`, `yarn.lock`), `.DS_Store`, `.env`.
|
|
118
|
+
- **Extensions:** Images, videos, archives, binaries.
|
|
119
|
+
|
|
120
|
+
## 🛠 Development
|
|
121
|
+
|
|
122
|
+
If you want to contribute or build locally:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Clone repository
|
|
126
|
+
git clone https://github.com/uxname/pp.git
|
|
127
|
+
cd pp
|
|
128
|
+
|
|
129
|
+
# Install dependencies
|
|
130
|
+
bun install
|
|
131
|
+
|
|
132
|
+
# Run in dev mode
|
|
133
|
+
bun run dev
|
|
134
|
+
|
|
135
|
+
# Build for production
|
|
136
|
+
bun run build
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
MIT
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire as Q8}from"node:module";var R8=Object.create;var{getPrototypeOf:X8,defineProperty:W1,getOwnPropertyNames:J8}=Object;var Y8=Object.prototype.hasOwnProperty;var x0=(F,_,E)=>{E=F!=null?R8(X8(F)):{};let $=_||!F||!F.__esModule?W1(E,"default",{value:F,enumerable:!0}):E;for(let B of J8(F))if(!Y8.call($,B))W1($,B,{get:()=>F[B],enumerable:!0});return $};var X=(F,_)=>()=>(_||F((_={exports:{}}).exports,_),_.exports);var Z8=(F,_)=>{for(var E in _)W1(F,E,{get:_[E],enumerable:!0,configurable:!0,set:($)=>_[E]=()=>$})};var f=Q8(import.meta.url);var Z0=X((G8)=>{class L1 extends Error{constructor(F,_,E){super(E);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=_,this.exitCode=F,this.nestedError=void 0}}class I2 extends L1{constructor(F){super(1,"commander.invalidArgument",F);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}G8.CommanderError=L1;G8.InvalidArgumentError=I2});var y0=X((A8)=>{var{InvalidArgumentError:L8}=Z0();class q2{constructor(F,_){switch(this.description=_||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,F[0]){case"<":this.required=!0,this._name=F.slice(1,-1);break;case"[":this.required=!1,this._name=F.slice(1,-1);break;default:this.required=!0,this._name=F;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(F,_){if(_===this.defaultValue||!Array.isArray(_))return[F];return _.push(F),_}default(F,_){return this.defaultValue=F,this.defaultValueDescription=_,this}argParser(F){return this.parseArg=F,this}choices(F){return this.argChoices=F.slice(),this.parseArg=(_,E)=>{if(!this.argChoices.includes(_))throw new L8(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(_,E);return _},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function S8(F){let _=F.name()+(F.variadic===!0?"...":"");return F.required?"<"+_+">":"["+_+"]"}A8.Argument=q2;A8.humanReadableArgName=S8});var S1=X((V8)=>{var{humanReadableArgName:N8}=y0();class N2{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(F){this.helpWidth=this.helpWidth??F.helpWidth??80}visibleCommands(F){let _=F.commands.filter(($)=>!$._hidden),E=F._getHelpCommand();if(E&&!E._hidden)_.push(E);if(this.sortSubcommands)_.sort(($,B)=>{return $.name().localeCompare(B.name())});return _}compareOptions(F,_){let E=($)=>{return $.short?$.short.replace(/^-/,""):$.long.replace(/^--/,"")};return E(F).localeCompare(E(_))}visibleOptions(F){let _=F.options.filter(($)=>!$.hidden),E=F._getHelpOption();if(E&&!E.hidden){let $=E.short&&F._findOption(E.short),B=E.long&&F._findOption(E.long);if(!$&&!B)_.push(E);else if(E.long&&!B)_.push(F.createOption(E.long,E.description));else if(E.short&&!$)_.push(F.createOption(E.short,E.description))}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleGlobalOptions(F){if(!this.showGlobalOptions)return[];let _=[];for(let E=F.parent;E;E=E.parent){let $=E.options.filter((B)=>!B.hidden);_.push(...$)}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleArguments(F){if(F._argsDescription)F.registeredArguments.forEach((_)=>{_.description=_.description||F._argsDescription[_.name()]||""});if(F.registeredArguments.find((_)=>_.description))return F.registeredArguments;return[]}subcommandTerm(F){let _=F.registeredArguments.map((E)=>N8(E)).join(" ");return F._name+(F._aliases[0]?"|"+F._aliases[0]:"")+(F.options.length?" [options]":"")+(_?" "+_:"")}optionTerm(F){return F.flags}argumentTerm(F){return F.name()}longestSubcommandTermLength(F,_){return _.visibleCommands(F).reduce((E,$)=>{return Math.max(E,this.displayWidth(_.styleSubcommandTerm(_.subcommandTerm($))))},0)}longestOptionTermLength(F,_){return _.visibleOptions(F).reduce((E,$)=>{return Math.max(E,this.displayWidth(_.styleOptionTerm(_.optionTerm($))))},0)}longestGlobalOptionTermLength(F,_){return _.visibleGlobalOptions(F).reduce((E,$)=>{return Math.max(E,this.displayWidth(_.styleOptionTerm(_.optionTerm($))))},0)}longestArgumentTermLength(F,_){return _.visibleArguments(F).reduce((E,$)=>{return Math.max(E,this.displayWidth(_.styleArgumentTerm(_.argumentTerm($))))},0)}commandUsage(F){let _=F._name;if(F._aliases[0])_=_+"|"+F._aliases[0];let E="";for(let $=F.parent;$;$=$.parent)E=$.name()+" "+E;return E+_+" "+F.usage()}commandDescription(F){return F.description()}subcommandDescription(F){return F.summary()||F.description()}optionDescription(F){let _=[];if(F.argChoices)_.push(`choices: ${F.argChoices.map((E)=>JSON.stringify(E)).join(", ")}`);if(F.defaultValue!==void 0){if(F.required||F.optional||F.isBoolean()&&typeof F.defaultValue==="boolean")_.push(`default: ${F.defaultValueDescription||JSON.stringify(F.defaultValue)}`)}if(F.presetArg!==void 0&&F.optional)_.push(`preset: ${JSON.stringify(F.presetArg)}`);if(F.envVar!==void 0)_.push(`env: ${F.envVar}`);if(_.length>0){let E=`(${_.join(", ")})`;if(F.description)return`${F.description} ${E}`;return E}return F.description}argumentDescription(F){let _=[];if(F.argChoices)_.push(`choices: ${F.argChoices.map((E)=>JSON.stringify(E)).join(", ")}`);if(F.defaultValue!==void 0)_.push(`default: ${F.defaultValueDescription||JSON.stringify(F.defaultValue)}`);if(_.length>0){let E=`(${_.join(", ")})`;if(F.description)return`${F.description} ${E}`;return E}return F.description}formatItemList(F,_,E){if(_.length===0)return[];return[E.styleTitle(F),..._,""]}groupItems(F,_,E){let $=new Map;return F.forEach((B)=>{let D=E(B);if(!$.has(D))$.set(D,[])}),_.forEach((B)=>{let D=E(B);if(!$.has(D))$.set(D,[]);$.get(D).push(B)}),$}formatHelp(F,_){let E=_.padWidth(F,_),$=_.helpWidth??80;function B(R,J){return _.formatItem(R,E,J,_)}let D=[`${_.styleTitle("Usage:")} ${_.styleUsage(_.commandUsage(F))}`,""],U=_.commandDescription(F);if(U.length>0)D=D.concat([_.boxWrap(_.styleCommandDescription(U),$),""]);let z=_.visibleArguments(F).map((R)=>{return B(_.styleArgumentTerm(_.argumentTerm(R)),_.styleArgumentDescription(_.argumentDescription(R)))});if(D=D.concat(this.formatItemList("Arguments:",z,_)),this.groupItems(F.options,_.visibleOptions(F),(R)=>R.helpGroupHeading??"Options:").forEach((R,J)=>{let G=R.map((I)=>{return B(_.styleOptionTerm(_.optionTerm(I)),_.styleOptionDescription(_.optionDescription(I)))});D=D.concat(this.formatItemList(J,G,_))}),_.showGlobalOptions){let R=_.visibleGlobalOptions(F).map((J)=>{return B(_.styleOptionTerm(_.optionTerm(J)),_.styleOptionDescription(_.optionDescription(J)))});D=D.concat(this.formatItemList("Global Options:",R,_))}return this.groupItems(F.commands,_.visibleCommands(F),(R)=>R.helpGroup()||"Commands:").forEach((R,J)=>{let G=R.map((I)=>{return B(_.styleSubcommandTerm(_.subcommandTerm(I)),_.styleSubcommandDescription(_.subcommandDescription(I)))});D=D.concat(this.formatItemList(J,G,_))}),D.join(`
|
|
3
|
+
`)}displayWidth(F){return V2(F).length}styleTitle(F){return F}styleUsage(F){return F.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_==="[command]")return this.styleSubcommandText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleCommandText(_)}).join(" ")}styleCommandDescription(F){return this.styleDescriptionText(F)}styleOptionDescription(F){return this.styleDescriptionText(F)}styleSubcommandDescription(F){return this.styleDescriptionText(F)}styleArgumentDescription(F){return this.styleDescriptionText(F)}styleDescriptionText(F){return F}styleOptionTerm(F){return this.styleOptionText(F)}styleSubcommandTerm(F){return F.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleSubcommandText(_)}).join(" ")}styleArgumentTerm(F){return this.styleArgumentText(F)}styleOptionText(F){return F}styleArgumentText(F){return F}styleSubcommandText(F){return F}styleCommandText(F){return F}padWidth(F,_){return Math.max(_.longestOptionTermLength(F,_),_.longestGlobalOptionTermLength(F,_),_.longestSubcommandTermLength(F,_),_.longestArgumentTermLength(F,_))}preformatted(F){return/\n[^\S\r\n]/.test(F)}formatItem(F,_,E,$){let D=" ".repeat(2);if(!E)return D+F;let U=F.padEnd(_+F.length-$.displayWidth(F)),z=2,H=(this.helpWidth??80)-_-z-2,R;if(H<this.minWidthToWrap||$.preformatted(E))R=E;else R=$.boxWrap(E,H).replace(/\n/g,`
|
|
4
|
+
`+" ".repeat(_+z));return D+U+" ".repeat(z)+R.replace(/\n/g,`
|
|
5
|
+
${D}`)}boxWrap(F,_){if(_<this.minWidthToWrap)return F;let E=F.split(/\r\n|\n/),$=/[\s]*[^\s]+/g,B=[];return E.forEach((D)=>{let U=D.match($);if(U===null){B.push("");return}let z=[U.shift()],M=this.displayWidth(z[0]);U.forEach((H)=>{let R=this.displayWidth(H);if(M+R<=_){z.push(H),M+=R;return}B.push(z.join(""));let J=H.trimStart();z=[J],M=this.displayWidth(J)}),B.push(z.join(""))}),B.join(`
|
|
6
|
+
`)}}function V2(F){let _=/\x1b\[\d*(;\d*)*m/g;return F.replace(_,"")}V8.Help=N2;V8.stripColor=V2});var A1=X((O8)=>{var{InvalidArgumentError:T8}=Z0();class j2{constructor(F,_){this.flags=F,this.description=_||"",this.required=F.includes("<"),this.optional=F.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(F),this.mandatory=!1;let E=P8(F);if(this.short=E.shortFlag,this.long=E.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(F,_){return this.defaultValue=F,this.defaultValueDescription=_,this}preset(F){return this.presetArg=F,this}conflicts(F){return this.conflictsWith=this.conflictsWith.concat(F),this}implies(F){let _=F;if(typeof F==="string")_={[F]:!0};return this.implied=Object.assign(this.implied||{},_),this}env(F){return this.envVar=F,this}argParser(F){return this.parseArg=F,this}makeOptionMandatory(F=!0){return this.mandatory=!!F,this}hideHelp(F=!0){return this.hidden=!!F,this}_collectValue(F,_){if(_===this.defaultValue||!Array.isArray(_))return[F];return _.push(F),_}choices(F){return this.argChoices=F.slice(),this.parseArg=(_,E)=>{if(!this.argChoices.includes(_))throw new T8(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(_,E);return _},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return C2(this.name().replace(/^no-/,""));return C2(this.name())}helpGroup(F){return this.helpGroupHeading=F,this}is(F){return this.short===F||this.long===F}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class T2{constructor(F){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,F.forEach((_)=>{if(_.negate)this.negativeOptions.set(_.attributeName(),_);else this.positiveOptions.set(_.attributeName(),_)}),this.negativeOptions.forEach((_,E)=>{if(this.positiveOptions.has(E))this.dualOptions.add(E)})}valueFromOption(F,_){let E=_.attributeName();if(!this.dualOptions.has(E))return!0;let $=this.negativeOptions.get(E).presetArg,B=$!==void 0?$:!1;return _.negate===(B===F)}}function C2(F){return F.split("-").reduce((_,E)=>{return _+E[0].toUpperCase()+E.slice(1)})}function P8(F){let _,E,$=/^-[^-]$/,B=/^--[^-]/,D=F.split(/[ |,]+/).concat("guard");if($.test(D[0]))_=D.shift();if(B.test(D[0]))E=D.shift();if(!_&&$.test(D[0]))_=D.shift();if(!_&&B.test(D[0]))_=E,E=D.shift();if(D[0].startsWith("-")){let U=D[0],z=`option creation failed due to '${U}' in option flags '${F}'`;if(/^-[^-][^-]/.test(U))throw Error(`${z}
|
|
7
|
+
- a short flag is a single dash and a single character
|
|
8
|
+
- either use a single dash and a single character (for a short flag)
|
|
9
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if($.test(U))throw Error(`${z}
|
|
10
|
+
- too many short flags`);if(B.test(U))throw Error(`${z}
|
|
11
|
+
- too many long flags`);throw Error(`${z}
|
|
12
|
+
- unrecognised flag format`)}if(_===void 0&&E===void 0)throw Error(`option creation failed due to no flags found in '${F}'.`);return{shortFlag:_,longFlag:E}}O8.Option=j2;O8.DualOptions=T2});var P2=X((x8)=>{function k8(F,_){if(Math.abs(F.length-_.length)>3)return Math.max(F.length,_.length);let E=[];for(let $=0;$<=F.length;$++)E[$]=[$];for(let $=0;$<=_.length;$++)E[0][$]=$;for(let $=1;$<=_.length;$++)for(let B=1;B<=F.length;B++){let D=1;if(F[B-1]===_[$-1])D=0;else D=1;if(E[B][$]=Math.min(E[B-1][$]+1,E[B][$-1]+1,E[B-1][$-1]+D),B>1&&$>1&&F[B-1]===_[$-2]&&F[B-2]===_[$-1])E[B][$]=Math.min(E[B][$],E[B-2][$-2]+1)}return E[F.length][_.length]}function b8(F,_){if(!_||_.length===0)return"";_=Array.from(new Set(_));let E=F.startsWith("--");if(E)F=F.slice(2),_=_.map((U)=>U.slice(2));let $=[],B=3,D=0.4;if(_.forEach((U)=>{if(U.length<=1)return;let z=k8(F,U),M=Math.max(F.length,U.length);if((M-z)/M>D){if(z<B)B=z,$=[U];else if(z===B)$.push(U)}}),$.sort((U,z)=>U.localeCompare(z)),E)$=$.map((U)=>`--${U}`);if($.length>1)return`
|
|
13
|
+
(Did you mean one of ${$.join(", ")}?)`;if($.length===1)return`
|
|
14
|
+
(Did you mean ${$[0]}?)`;return""}x8.suggestSimilar=b8});var k2=X((m8)=>{var h8=f("node:events").EventEmitter,I1=f("node:child_process"),g=f("node:path"),h0=f("node:fs"),Z=f("node:process"),{Argument:v8,humanReadableArgName:u8}=y0(),{CommanderError:q1}=Z0(),{Help:g8,stripColor:d8}=S1(),{Option:O2,DualOptions:c8}=A1(),{suggestSimilar:w2}=P2();class V1 extends h8{constructor(F){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=F||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(_)=>Z.stdout.write(_),writeErr:(_)=>Z.stderr.write(_),outputError:(_,E)=>E(_),getOutHelpWidth:()=>Z.stdout.isTTY?Z.stdout.columns:void 0,getErrHelpWidth:()=>Z.stderr.isTTY?Z.stderr.columns:void 0,getOutHasColors:()=>N1()??(Z.stdout.isTTY&&Z.stdout.hasColors?.()),getErrHasColors:()=>N1()??(Z.stderr.isTTY&&Z.stderr.hasColors?.()),stripColor:(_)=>d8(_)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(F){return this._outputConfiguration=F._outputConfiguration,this._helpOption=F._helpOption,this._helpCommand=F._helpCommand,this._helpConfiguration=F._helpConfiguration,this._exitCallback=F._exitCallback,this._storeOptionsAsProperties=F._storeOptionsAsProperties,this._combineFlagAndOptionalValue=F._combineFlagAndOptionalValue,this._allowExcessArguments=F._allowExcessArguments,this._enablePositionalOptions=F._enablePositionalOptions,this._showHelpAfterError=F._showHelpAfterError,this._showSuggestionAfterError=F._showSuggestionAfterError,this}_getCommandAndAncestors(){let F=[];for(let _=this;_;_=_.parent)F.push(_);return F}command(F,_,E){let $=_,B=E;if(typeof $==="object"&&$!==null)B=$,$=null;B=B||{};let[,D,U]=F.match(/([^ ]+) *(.*)/),z=this.createCommand(D);if($)z.description($),z._executableHandler=!0;if(B.isDefault)this._defaultCommandName=z._name;if(z._hidden=!!(B.noHelp||B.hidden),z._executableFile=B.executableFile||null,U)z.arguments(U);if(this._registerCommand(z),z.parent=this,z.copyInheritedSettings(this),$)return this;return z}createCommand(F){return new V1(F)}createHelp(){return Object.assign(new g8,this.configureHelp())}configureHelp(F){if(F===void 0)return this._helpConfiguration;return this._helpConfiguration=F,this}configureOutput(F){if(F===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...F},this}showHelpAfterError(F=!0){if(typeof F!=="string")F=!!F;return this._showHelpAfterError=F,this}showSuggestionAfterError(F=!0){return this._showSuggestionAfterError=!!F,this}addCommand(F,_){if(!F._name)throw Error(`Command passed to .addCommand() must have a name
|
|
15
|
+
- specify the name in Command constructor or using .name()`);if(_=_||{},_.isDefault)this._defaultCommandName=F._name;if(_.noHelp||_.hidden)F._hidden=!0;return this._registerCommand(F),F.parent=this,F._checkForBrokenPassThrough(),this}createArgument(F,_){return new v8(F,_)}argument(F,_,E,$){let B=this.createArgument(F,_);if(typeof E==="function")B.default($).argParser(E);else B.default(E);return this.addArgument(B),this}arguments(F){return F.trim().split(/ +/).forEach((_)=>{this.argument(_)}),this}addArgument(F){let _=this.registeredArguments.slice(-1)[0];if(_?.variadic)throw Error(`only the last argument can be variadic '${_.name()}'`);if(F.required&&F.defaultValue!==void 0&&F.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${F.name()}'`);return this.registeredArguments.push(F),this}helpCommand(F,_){if(typeof F==="boolean"){if(this._addImplicitHelpCommand=F,F&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let E=F??"help [command]",[,$,B]=E.match(/([^ ]+) *(.*)/),D=_??"display help for command",U=this.createCommand($);if(U.helpOption(!1),B)U.arguments(B);if(D)U.description(D);if(this._addImplicitHelpCommand=!0,this._helpCommand=U,F||_)this._initCommandGroup(U);return this}addHelpCommand(F,_){if(typeof F!=="object")return this.helpCommand(F,_),this;return this._addImplicitHelpCommand=!0,this._helpCommand=F,this._initCommandGroup(F),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(F,_){let E=["preSubcommand","preAction","postAction"];if(!E.includes(F))throw Error(`Unexpected value for event passed to hook : '${F}'.
|
|
16
|
+
Expecting one of '${E.join("', '")}'`);if(this._lifeCycleHooks[F])this._lifeCycleHooks[F].push(_);else this._lifeCycleHooks[F]=[_];return this}exitOverride(F){if(F)this._exitCallback=F;else this._exitCallback=(_)=>{if(_.code!=="commander.executeSubCommandAsync")throw _};return this}_exit(F,_,E){if(this._exitCallback)this._exitCallback(new q1(F,_,E));Z.exit(F)}action(F){let _=(E)=>{let $=this.registeredArguments.length,B=E.slice(0,$);if(this._storeOptionsAsProperties)B[$]=this;else B[$]=this.opts();return B.push(this),F.apply(this,B)};return this._actionHandler=_,this}createOption(F,_){return new O2(F,_)}_callParseArg(F,_,E,$){try{return F.parseArg(_,E)}catch(B){if(B.code==="commander.invalidArgument"){let D=`${$} ${B.message}`;this.error(D,{exitCode:B.exitCode,code:B.code})}throw B}}_registerOption(F){let _=F.short&&this._findOption(F.short)||F.long&&this._findOption(F.long);if(_){let E=F.long&&this._findOption(F.long)?F.long:F.short;throw Error(`Cannot add option '${F.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${E}'
|
|
17
|
+
- already used by option '${_.flags}'`)}this._initOptionGroup(F),this.options.push(F)}_registerCommand(F){let _=($)=>{return[$.name()].concat($.aliases())},E=_(F).find(($)=>this._findCommand($));if(E){let $=_(this._findCommand(E)).join("|"),B=_(F).join("|");throw Error(`cannot add command '${B}' as already have command '${$}'`)}this._initCommandGroup(F),this.commands.push(F)}addOption(F){this._registerOption(F);let _=F.name(),E=F.attributeName();if(F.negate){let B=F.long.replace(/^--no-/,"--");if(!this._findOption(B))this.setOptionValueWithSource(E,F.defaultValue===void 0?!0:F.defaultValue,"default")}else if(F.defaultValue!==void 0)this.setOptionValueWithSource(E,F.defaultValue,"default");let $=(B,D,U)=>{if(B==null&&F.presetArg!==void 0)B=F.presetArg;let z=this.getOptionValue(E);if(B!==null&&F.parseArg)B=this._callParseArg(F,B,z,D);else if(B!==null&&F.variadic)B=F._collectValue(B,z);if(B==null)if(F.negate)B=!1;else if(F.isBoolean()||F.optional)B=!0;else B="";this.setOptionValueWithSource(E,B,U)};if(this.on("option:"+_,(B)=>{let D=`error: option '${F.flags}' argument '${B}' is invalid.`;$(B,D,"cli")}),F.envVar)this.on("optionEnv:"+_,(B)=>{let D=`error: option '${F.flags}' value '${B}' from env '${F.envVar}' is invalid.`;$(B,D,"env")});return this}_optionEx(F,_,E,$,B){if(typeof _==="object"&&_ instanceof O2)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let D=this.createOption(_,E);if(D.makeOptionMandatory(!!F.mandatory),typeof $==="function")D.default(B).argParser($);else if($ instanceof RegExp){let U=$;$=(z,M)=>{let H=U.exec(z);return H?H[0]:M},D.default(B).argParser($)}else D.default($);return this.addOption(D)}option(F,_,E,$){return this._optionEx({},F,_,E,$)}requiredOption(F,_,E,$){return this._optionEx({mandatory:!0},F,_,E,$)}combineFlagAndOptionalValue(F=!0){return this._combineFlagAndOptionalValue=!!F,this}allowUnknownOption(F=!0){return this._allowUnknownOption=!!F,this}allowExcessArguments(F=!0){return this._allowExcessArguments=!!F,this}enablePositionalOptions(F=!0){return this._enablePositionalOptions=!!F,this}passThroughOptions(F=!0){return this._passThroughOptions=!!F,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(F=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!F,this}getOptionValue(F){if(this._storeOptionsAsProperties)return this[F];return this._optionValues[F]}setOptionValue(F,_){return this.setOptionValueWithSource(F,_,void 0)}setOptionValueWithSource(F,_,E){if(this._storeOptionsAsProperties)this[F]=_;else this._optionValues[F]=_;return this._optionValueSources[F]=E,this}getOptionValueSource(F){return this._optionValueSources[F]}getOptionValueSourceWithGlobals(F){let _;return this._getCommandAndAncestors().forEach((E)=>{if(E.getOptionValueSource(F)!==void 0)_=E.getOptionValueSource(F)}),_}_prepareUserArgs(F,_){if(F!==void 0&&!Array.isArray(F))throw Error("first parameter to parse must be array or undefined");if(_=_||{},F===void 0&&_.from===void 0){if(Z.versions?.electron)_.from="electron";let $=Z.execArgv??[];if($.includes("-e")||$.includes("--eval")||$.includes("-p")||$.includes("--print"))_.from="eval"}if(F===void 0)F=Z.argv;this.rawArgs=F.slice();let E;switch(_.from){case void 0:case"node":this._scriptPath=F[1],E=F.slice(2);break;case"electron":if(Z.defaultApp)this._scriptPath=F[1],E=F.slice(2);else E=F.slice(1);break;case"user":E=F.slice(0);break;case"eval":E=F.slice(1);break;default:throw Error(`unexpected parse option { from: '${_.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",E}parse(F,_){this._prepareForParse();let E=this._prepareUserArgs(F,_);return this._parseCommand([],E),this}async parseAsync(F,_){this._prepareForParse();let E=this._prepareUserArgs(F,_);return await this._parseCommand([],E),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
18
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(F,_,E){if(h0.existsSync(F))return;let $=_?`searched for local subcommand relative to directory '${_}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",B=`'${F}' does not exist
|
|
19
|
+
- if '${E}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
20
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
21
|
+
- ${$}`;throw Error(B)}_executeSubCommand(F,_){_=_.slice();let E=!1,$=[".js",".ts",".tsx",".mjs",".cjs"];function B(H,R){let J=g.resolve(H,R);if(h0.existsSync(J))return J;if($.includes(g.extname(R)))return;let G=$.find((I)=>h0.existsSync(`${J}${I}`));if(G)return`${J}${G}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let D=F._executableFile||`${this._name}-${F._name}`,U=this._executableDir||"";if(this._scriptPath){let H;try{H=h0.realpathSync(this._scriptPath)}catch{H=this._scriptPath}U=g.resolve(g.dirname(H),U)}if(U){let H=B(U,D);if(!H&&!F._executableFile&&this._scriptPath){let R=g.basename(this._scriptPath,g.extname(this._scriptPath));if(R!==this._name)H=B(U,`${R}-${F._name}`)}D=H||D}E=$.includes(g.extname(D));let z;if(Z.platform!=="win32")if(E)_.unshift(D),_=f2(Z.execArgv).concat(_),z=I1.spawn(Z.argv[0],_,{stdio:"inherit"});else z=I1.spawn(D,_,{stdio:"inherit"});else this._checkForMissingExecutable(D,U,F._name),_.unshift(D),_=f2(Z.execArgv).concat(_),z=I1.spawn(Z.execPath,_,{stdio:"inherit"});if(!z.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((R)=>{Z.on(R,()=>{if(z.killed===!1&&z.exitCode===null)z.kill(R)})});let M=this._exitCallback;z.on("close",(H)=>{if(H=H??1,!M)Z.exit(H);else M(new q1(H,"commander.executeSubCommandAsync","(close)"))}),z.on("error",(H)=>{if(H.code==="ENOENT")this._checkForMissingExecutable(D,U,F._name);else if(H.code==="EACCES")throw Error(`'${D}' not executable`);if(!M)Z.exit(1);else{let R=new q1(1,"commander.executeSubCommandAsync","(error)");R.nestedError=H,M(R)}}),this.runningCommand=z}_dispatchSubcommand(F,_,E){let $=this._findCommand(F);if(!$)this.help({error:!0});$._prepareForParse();let B;return B=this._chainOrCallSubCommandHook(B,$,"preSubcommand"),B=this._chainOrCall(B,()=>{if($._executableHandler)this._executeSubCommand($,_.concat(E));else return $._parseCommand(_,E)}),B}_dispatchHelpCommand(F){if(!F)this.help();let _=this._findCommand(F);if(_&&!_._executableHandler)_.help();return this._dispatchSubcommand(F,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((F,_)=>{if(F.required&&this.args[_]==null)this.missingArgument(F.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let F=(E,$,B)=>{let D=$;if($!==null&&E.parseArg){let U=`error: command-argument value '${$}' is invalid for argument '${E.name()}'.`;D=this._callParseArg(E,$,B,U)}return D};this._checkNumberOfArguments();let _=[];this.registeredArguments.forEach((E,$)=>{let B=E.defaultValue;if(E.variadic){if($<this.args.length){if(B=this.args.slice($),E.parseArg)B=B.reduce((D,U)=>{return F(E,U,D)},E.defaultValue)}else if(B===void 0)B=[]}else if($<this.args.length){if(B=this.args[$],E.parseArg)B=F(E,B,E.defaultValue)}_[$]=B}),this.processedArgs=_}_chainOrCall(F,_){if(F?.then&&typeof F.then==="function")return F.then(()=>_());return _()}_chainOrCallHooks(F,_){let E=F,$=[];if(this._getCommandAndAncestors().reverse().filter((B)=>B._lifeCycleHooks[_]!==void 0).forEach((B)=>{B._lifeCycleHooks[_].forEach((D)=>{$.push({hookedCommand:B,callback:D})})}),_==="postAction")$.reverse();return $.forEach((B)=>{E=this._chainOrCall(E,()=>{return B.callback(B.hookedCommand,this)})}),E}_chainOrCallSubCommandHook(F,_,E){let $=F;if(this._lifeCycleHooks[E]!==void 0)this._lifeCycleHooks[E].forEach((B)=>{$=this._chainOrCall($,()=>{return B(this,_)})});return $}_parseCommand(F,_){let E=this.parseOptions(_);if(this._parseOptionsEnv(),this._parseOptionsImplied(),F=F.concat(E.operands),_=E.unknown,this.args=F.concat(_),F&&this._findCommand(F[0]))return this._dispatchSubcommand(F[0],F.slice(1),_);if(this._getHelpCommand()&&F[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(F[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(_),this._dispatchSubcommand(this._defaultCommandName,F,_);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(E.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let $=()=>{if(E.unknown.length>0)this.unknownOption(E.unknown[0])},B=`command:${this.name()}`;if(this._actionHandler){$(),this._processArguments();let D;if(D=this._chainOrCallHooks(D,"preAction"),D=this._chainOrCall(D,()=>this._actionHandler(this.processedArgs)),this.parent)D=this._chainOrCall(D,()=>{this.parent.emit(B,F,_)});return D=this._chainOrCallHooks(D,"postAction"),D}if(this.parent?.listenerCount(B))$(),this._processArguments(),this.parent.emit(B,F,_);else if(F.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",F,_);if(this.listenerCount("command:*"))this.emit("command:*",F,_);else if(this.commands.length)this.unknownCommand();else $(),this._processArguments()}else if(this.commands.length)$(),this.help({error:!0});else $(),this._processArguments()}_findCommand(F){if(!F)return;return this.commands.find((_)=>_._name===F||_._aliases.includes(F))}_findOption(F){return this.options.find((_)=>_.is(F))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((F)=>{F.options.forEach((_)=>{if(_.mandatory&&F.getOptionValue(_.attributeName())===void 0)F.missingMandatoryOptionValue(_)})})}_checkForConflictingLocalOptions(){let F=this.options.filter((E)=>{let $=E.attributeName();if(this.getOptionValue($)===void 0)return!1;return this.getOptionValueSource($)!=="default"});F.filter((E)=>E.conflictsWith.length>0).forEach((E)=>{let $=F.find((B)=>E.conflictsWith.includes(B.attributeName()));if($)this._conflictingOption(E,$)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((F)=>{F._checkForConflictingLocalOptions()})}parseOptions(F){let _=[],E=[],$=_;function B(H){return H.length>1&&H[0]==="-"}let D=(H)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(H))return!1;return!this._getCommandAndAncestors().some((R)=>R.options.map((J)=>J.short).some((J)=>/^-\d$/.test(J)))},U=null,z=null,M=0;while(M<F.length||z){let H=z??F[M++];if(z=null,H==="--"){if($===E)$.push(H);$.push(...F.slice(M));break}if(U&&(!B(H)||D(H))){this.emit(`option:${U.name()}`,H);continue}if(U=null,B(H)){let R=this._findOption(H);if(R){if(R.required){let J=F[M++];if(J===void 0)this.optionMissingArgument(R);this.emit(`option:${R.name()}`,J)}else if(R.optional){let J=null;if(M<F.length&&(!B(F[M])||D(F[M])))J=F[M++];this.emit(`option:${R.name()}`,J)}else this.emit(`option:${R.name()}`);U=R.variadic?R:null;continue}}if(H.length>2&&H[0]==="-"&&H[1]!=="-"){let R=this._findOption(`-${H[1]}`);if(R){if(R.required||R.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${R.name()}`,H.slice(2));else this.emit(`option:${R.name()}`),z=`-${H.slice(2)}`;continue}}if(/^--[^=]+=/.test(H)){let R=H.indexOf("="),J=this._findOption(H.slice(0,R));if(J&&(J.required||J.optional)){this.emit(`option:${J.name()}`,H.slice(R+1));continue}}if($===_&&B(H)&&!(this.commands.length===0&&D(H)))$=E;if((this._enablePositionalOptions||this._passThroughOptions)&&_.length===0&&E.length===0){if(this._findCommand(H)){_.push(H),E.push(...F.slice(M));break}else if(this._getHelpCommand()&&H===this._getHelpCommand().name()){_.push(H,...F.slice(M));break}else if(this._defaultCommandName){E.push(H,...F.slice(M));break}}if(this._passThroughOptions){$.push(H,...F.slice(M));break}$.push(H)}return{operands:_,unknown:E}}opts(){if(this._storeOptionsAsProperties){let F={},_=this.options.length;for(let E=0;E<_;E++){let $=this.options[E].attributeName();F[$]=$===this._versionOptionName?this._version:this[$]}return F}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((F,_)=>Object.assign(F,_.opts()),{})}error(F,_){if(this._outputConfiguration.outputError(`${F}
|
|
22
|
+
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
23
|
+
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
|
24
|
+
`),this.outputHelp({error:!0});let E=_||{},$=E.exitCode||1,B=E.code||"commander.error";this._exit($,B,F)}_parseOptionsEnv(){this.options.forEach((F)=>{if(F.envVar&&F.envVar in Z.env){let _=F.attributeName();if(this.getOptionValue(_)===void 0||["default","config","env"].includes(this.getOptionValueSource(_)))if(F.required||F.optional)this.emit(`optionEnv:${F.name()}`,Z.env[F.envVar]);else this.emit(`optionEnv:${F.name()}`)}})}_parseOptionsImplied(){let F=new c8(this.options),_=(E)=>{return this.getOptionValue(E)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(E))};this.options.filter((E)=>E.implied!==void 0&&_(E.attributeName())&&F.valueFromOption(this.getOptionValue(E.attributeName()),E)).forEach((E)=>{Object.keys(E.implied).filter(($)=>!_($)).forEach(($)=>{this.setOptionValueWithSource($,E.implied[$],"implied")})})}missingArgument(F){let _=`error: missing required argument '${F}'`;this.error(_,{code:"commander.missingArgument"})}optionMissingArgument(F){let _=`error: option '${F.flags}' argument missing`;this.error(_,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(F){let _=`error: required option '${F.flags}' not specified`;this.error(_,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(F,_){let E=(D)=>{let U=D.attributeName(),z=this.getOptionValue(U),M=this.options.find((R)=>R.negate&&U===R.attributeName()),H=this.options.find((R)=>!R.negate&&U===R.attributeName());if(M&&(M.presetArg===void 0&&z===!1||M.presetArg!==void 0&&z===M.presetArg))return M;return H||D},$=(D)=>{let U=E(D),z=U.attributeName();if(this.getOptionValueSource(z)==="env")return`environment variable '${U.envVar}'`;return`option '${U.flags}'`},B=`error: ${$(F)} cannot be used with ${$(_)}`;this.error(B,{code:"commander.conflictingOption"})}unknownOption(F){if(this._allowUnknownOption)return;let _="";if(F.startsWith("--")&&this._showSuggestionAfterError){let $=[],B=this;do{let D=B.createHelp().visibleOptions(B).filter((U)=>U.long).map((U)=>U.long);$=$.concat(D),B=B.parent}while(B&&!B._enablePositionalOptions);_=w2(F,$)}let E=`error: unknown option '${F}'${_}`;this.error(E,{code:"commander.unknownOption"})}_excessArguments(F){if(this._allowExcessArguments)return;let _=this.registeredArguments.length,E=_===1?"":"s",B=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${_} argument${E} but got ${F.length}.`;this.error(B,{code:"commander.excessArguments"})}unknownCommand(){let F=this.args[0],_="";if(this._showSuggestionAfterError){let $=[];this.createHelp().visibleCommands(this).forEach((B)=>{if($.push(B.name()),B.alias())$.push(B.alias())}),_=w2(F,$)}let E=`error: unknown command '${F}'${_}`;this.error(E,{code:"commander.unknownCommand"})}version(F,_,E){if(F===void 0)return this._version;this._version=F,_=_||"-V, --version",E=E||"output the version number";let $=this.createOption(_,E);return this._versionOptionName=$.attributeName(),this._registerOption($),this.on("option:"+$.name(),()=>{this._outputConfiguration.writeOut(`${F}
|
|
25
|
+
`),this._exit(0,"commander.version",F)}),this}description(F,_){if(F===void 0&&_===void 0)return this._description;if(this._description=F,_)this._argsDescription=_;return this}summary(F){if(F===void 0)return this._summary;return this._summary=F,this}alias(F){if(F===void 0)return this._aliases[0];let _=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)_=this.commands[this.commands.length-1];if(F===_._name)throw Error("Command alias can't be the same as its name");let E=this.parent?._findCommand(F);if(E){let $=[E.name()].concat(E.aliases()).join("|");throw Error(`cannot add alias '${F}' to command '${this.name()}' as already have command '${$}'`)}return _._aliases.push(F),this}aliases(F){if(F===void 0)return this._aliases;return F.forEach((_)=>this.alias(_)),this}usage(F){if(F===void 0){if(this._usage)return this._usage;let _=this.registeredArguments.map((E)=>{return u8(E)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?_:[]).join(" ")}return this._usage=F,this}name(F){if(F===void 0)return this._name;return this._name=F,this}helpGroup(F){if(F===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=F,this}commandsGroup(F){if(F===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=F,this}optionsGroup(F){if(F===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=F,this}_initOptionGroup(F){if(this._defaultOptionGroup&&!F.helpGroupHeading)F.helpGroup(this._defaultOptionGroup)}_initCommandGroup(F){if(this._defaultCommandGroup&&!F.helpGroup())F.helpGroup(this._defaultCommandGroup)}nameFromFilename(F){return this._name=g.basename(F,g.extname(F)),this}executableDir(F){if(F===void 0)return this._executableDir;return this._executableDir=F,this}helpInformation(F){let _=this.createHelp(),E=this._getOutputContext(F);_.prepareContext({error:E.error,helpWidth:E.helpWidth,outputHasColors:E.hasColors});let $=_.formatHelp(this,_);if(E.hasColors)return $;return this._outputConfiguration.stripColor($)}_getOutputContext(F){F=F||{};let _=!!F.error,E,$,B;if(_)E=(U)=>this._outputConfiguration.writeErr(U),$=this._outputConfiguration.getErrHasColors(),B=this._outputConfiguration.getErrHelpWidth();else E=(U)=>this._outputConfiguration.writeOut(U),$=this._outputConfiguration.getOutHasColors(),B=this._outputConfiguration.getOutHelpWidth();return{error:_,write:(U)=>{if(!$)U=this._outputConfiguration.stripColor(U);return E(U)},hasColors:$,helpWidth:B}}outputHelp(F){let _;if(typeof F==="function")_=F,F=void 0;let E=this._getOutputContext(F),$={error:E.error,write:E.write,command:this};this._getCommandAndAncestors().reverse().forEach((D)=>D.emit("beforeAllHelp",$)),this.emit("beforeHelp",$);let B=this.helpInformation({error:E.error});if(_){if(B=_(B),typeof B!=="string"&&!Buffer.isBuffer(B))throw Error("outputHelp callback must return a string or a Buffer")}if(E.write(B),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",$),this._getCommandAndAncestors().forEach((D)=>D.emit("afterAllHelp",$))}helpOption(F,_){if(typeof F==="boolean"){if(F){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(F??"-h, --help",_??"display help for command"),F||_)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(F){return this._helpOption=F,this._initOptionGroup(F),this}help(F){this.outputHelp(F);let _=Number(Z.exitCode??0);if(_===0&&F&&typeof F!=="function"&&F.error)_=1;this._exit(_,"commander.help","(outputHelp)")}addHelpText(F,_){let E=["beforeAll","before","after","afterAll"];if(!E.includes(F))throw Error(`Unexpected value for position to addHelpText.
|
|
26
|
+
Expecting one of '${E.join("', '")}'`);let $=`${F}Help`;return this.on($,(B)=>{let D;if(typeof _==="function")D=_({error:B.error,command:B.command});else D=_;if(D)B.write(`${D}
|
|
27
|
+
`)}),this}_outputHelpIfRequested(F){let _=this._getHelpOption();if(_&&F.find(($)=>_.is($)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function f2(F){return F.map((_)=>{if(!_.startsWith("--inspect"))return _;let E,$="127.0.0.1",B="9229",D;if((D=_.match(/^(--inspect(-brk)?)$/))!==null)E=D[1];else if((D=_.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(E=D[1],/^\d+$/.test(D[3]))B=D[3];else $=D[3];else if((D=_.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)E=D[1],$=D[3],B=D[4];if(E&&B!=="0")return`${E}=${$}:${parseInt(B)+1}`;return _})}function N1(){if(Z.env.NO_COLOR||Z.env.FORCE_COLOR==="0"||Z.env.FORCE_COLOR==="false")return!1;if(Z.env.FORCE_COLOR||Z.env.CLICOLOR_FORCE!==void 0)return!0;return}m8.Command=V1;m8.useColor=N1});var h2=X((t8)=>{var{Argument:b2}=y0(),{Command:C1}=k2(),{CommanderError:i8,InvalidArgumentError:x2}=Z0(),{Help:p8}=S1(),{Option:y2}=A1();t8.program=new C1;t8.createCommand=(F)=>new C1(F);t8.createOption=(F,_)=>new y2(F,_);t8.createArgument=(F,_)=>new b2(F,_);t8.Command=C1;t8.Option=y2;t8.Argument=b2;t8.Help=p8;t8.CommanderError=i8;t8.InvalidArgumentError=x2;t8.InvalidOptionArgumentError=x2});var S=X((zU,WF)=>{var{FORCE_COLOR:r9,NODE_DISABLE_COLORS:a9,TERM:o9}=process.env,Q={enabled:!a9&&o9!=="dumb"&&r9!=="0",reset:K(0,0),bold:K(1,22),dim:K(2,22),italic:K(3,23),underline:K(4,24),inverse:K(7,27),hidden:K(8,28),strikethrough:K(9,29),black:K(30,39),red:K(31,39),green:K(32,39),yellow:K(33,39),blue:K(34,39),magenta:K(35,39),cyan:K(36,39),white:K(37,39),gray:K(90,39),grey:K(90,39),bgBlack:K(40,49),bgRed:K(41,49),bgGreen:K(42,49),bgYellow:K(43,49),bgBlue:K(44,49),bgMagenta:K(45,49),bgCyan:K(46,49),bgWhite:K(47,49)};function KF(F,_){let E=0,$,B="",D="";for(;E<F.length;E++)if($=F[E],B+=$.open,D+=$.close,_.includes($.close))_=_.replace($.rgx,$.close+$.open);return B+_+D}function e9(F,_){let E={has:F,keys:_};return E.reset=Q.reset.bind(E),E.bold=Q.bold.bind(E),E.dim=Q.dim.bind(E),E.italic=Q.italic.bind(E),E.underline=Q.underline.bind(E),E.inverse=Q.inverse.bind(E),E.hidden=Q.hidden.bind(E),E.strikethrough=Q.strikethrough.bind(E),E.black=Q.black.bind(E),E.red=Q.red.bind(E),E.green=Q.green.bind(E),E.yellow=Q.yellow.bind(E),E.blue=Q.blue.bind(E),E.magenta=Q.magenta.bind(E),E.cyan=Q.cyan.bind(E),E.white=Q.white.bind(E),E.gray=Q.gray.bind(E),E.grey=Q.grey.bind(E),E.bgBlack=Q.bgBlack.bind(E),E.bgRed=Q.bgRed.bind(E),E.bgGreen=Q.bgGreen.bind(E),E.bgYellow=Q.bgYellow.bind(E),E.bgBlue=Q.bgBlue.bind(E),E.bgMagenta=Q.bgMagenta.bind(E),E.bgCyan=Q.bgCyan.bind(E),E.bgWhite=Q.bgWhite.bind(E),E}function K(F,_){let E={open:`\x1B[${F}m`,close:`\x1B[${_}m`,rgx:new RegExp(`\\x1b\\[${_}m`,"g")};return function($){if(this!==void 0&&this.has!==void 0)return this.has.includes(F)||(this.has.push(F),this.keys.push(E)),$===void 0?this:Q.enabled?KF(this.keys,$+""):$+"";return $===void 0?e9([F],[E]):Q.enabled?KF([E],$+""):$+""}}WF.exports=Q});var SF=X((HU,LF)=>{LF.exports=(F,_)=>{if(F.meta&&F.name!=="escape")return;if(F.ctrl){if(F.name==="a")return"first";if(F.name==="c")return"abort";if(F.name==="d")return"abort";if(F.name==="e")return"last";if(F.name==="g")return"reset"}if(_){if(F.name==="j")return"down";if(F.name==="k")return"up"}if(F.name==="return")return"submit";if(F.name==="enter")return"submit";if(F.name==="backspace")return"delete";if(F.name==="delete")return"deleteForward";if(F.name==="abort")return"abort";if(F.name==="escape")return"exit";if(F.name==="tab")return"next";if(F.name==="pagedown")return"nextPage";if(F.name==="pageup")return"prevPage";if(F.name==="home")return"home";if(F.name==="end")return"end";if(F.name==="up")return"up";if(F.name==="down")return"down";if(F.name==="right")return"right";if(F.name==="left")return"left";return!1}});var i0=X((MU,AF)=>{AF.exports=(F)=>{let _=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),E=new RegExp(_,"g");return typeof F==="string"?F.replace(E,""):F}});var A=X((RU,IF)=>{var m1={to(F,_){if(!_)return`\x1B[${F+1}G`;return`\x1B[${_+1};${F+1}H`},move(F,_){let E="";if(F<0)E+=`\x1B[${-F}D`;else if(F>0)E+=`\x1B[${F}C`;if(_<0)E+=`\x1B[${-_}A`;else if(_>0)E+=`\x1B[${_}B`;return E},up:(F=1)=>`\x1B[${F}A`,down:(F=1)=>`\x1B[${F}B`,forward:(F=1)=>`\x1B[${F}C`,backward:(F=1)=>`\x1B[${F}D`,nextLine:(F=1)=>"\x1B[E".repeat(F),prevLine:(F=1)=>"\x1B[F".repeat(F),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},F3={up:(F=1)=>"\x1B[S".repeat(F),down:(F=1)=>"\x1B[T".repeat(F)},_3={screen:"\x1B[2J",up:(F=1)=>"\x1B[1J".repeat(F),down:(F=1)=>"\x1B[J".repeat(F),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(F){let _="";for(let E=0;E<F;E++)_+=this.line+(E<F-1?m1.up():"");if(F)_+=m1.left;return _}};IF.exports={cursor:m1,scroll:F3,erase:_3,beep:"\x07"}});var jF=X((XU,CF)=>{function E3(F,_){var E=typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(!E){if(Array.isArray(F)||(E=$3(F))||_&&F&&typeof F.length==="number"){if(E)F=E;var $=0,B=function(){};return{s:B,n:function(){if($>=F.length)return{done:!0};return{done:!1,value:F[$++]}},e:function(H){throw H},f:B}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
28
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var D=!0,U=!1,z;return{s:function(){E=E.call(F)},n:function(){var H=E.next();return D=H.done,H},e:function(H){U=!0,z=H},f:function(){try{if(!D&&E.return!=null)E.return()}finally{if(U)throw z}}}}function $3(F,_){if(!F)return;if(typeof F==="string")return qF(F,_);var E=Object.prototype.toString.call(F).slice(8,-1);if(E==="Object"&&F.constructor)E=F.constructor.name;if(E==="Map"||E==="Set")return Array.from(F);if(E==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E))return qF(F,_)}function qF(F,_){if(_==null||_>F.length)_=F.length;for(var E=0,$=Array(_);E<_;E++)$[E]=F[E];return $}var B3=i0(),VF=A(),NF=VF.erase,D3=VF.cursor,U3=(F)=>[...B3(F)].length;CF.exports=function(F,_){if(!_)return NF.line+D3.to(0);let E=0,$=F.split(/\r?\n/);var B=E3($),D;try{for(B.s();!(D=B.n()).done;){let U=D.value;E+=1+Math.floor(Math.max(U3(U)-1,0)/_)}}catch(U){B.e(U)}finally{B.f()}return NF.lines(E)}});var l1=X((JU,TF)=>{var S0={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},z3={arrowUp:S0.arrowUp,arrowDown:S0.arrowDown,arrowLeft:S0.arrowLeft,arrowRight:S0.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},H3=process.platform==="win32"?z3:S0;TF.exports=H3});var OF=X((YU,PF)=>{var H0=S(),E0=l1(),n1=Object.freeze({password:{scale:1,render:(F)=>"*".repeat(F.length)},emoji:{scale:2,render:(F)=>"\uD83D\uDE03".repeat(F.length)},invisible:{scale:0,render:(F)=>""},default:{scale:1,render:(F)=>`${F}`}}),M3=(F)=>n1[F]||n1.default,A0=Object.freeze({aborted:H0.red(E0.cross),done:H0.green(E0.tick),exited:H0.yellow(E0.cross),default:H0.cyan("?")}),R3=(F,_,E)=>_?A0.aborted:E?A0.exited:F?A0.done:A0.default,X3=(F)=>H0.gray(F?E0.ellipsis:E0.pointerSmall),J3=(F,_)=>H0.gray(F?_?E0.pointerSmall:"+":E0.line);PF.exports={styles:n1,render:M3,symbols:A0,symbol:R3,delimiter:X3,item:J3}});var fF=X((ZU,wF)=>{var Y3=i0();wF.exports=function(F,_){let E=String(Y3(F)||"").split(/\r?\n/);if(!_)return E.length;return E.map(($)=>Math.ceil($.length/_)).reduce(($,B)=>$+B)}});var bF=X((QU,kF)=>{kF.exports=(F,_={})=>{let E=Number.isSafeInteger(parseInt(_.margin))?Array(parseInt(_.margin)).fill(" ").join(""):_.margin||"",$=_.width;return(F||"").split(/\r?\n/g).map((B)=>B.split(/\s+/g).reduce((D,U)=>{if(U.length+E.length>=$||D[D.length-1].length+U.length+1<$)D[D.length-1]+=` ${U}`;else D.push(`${E}${U}`);return D},[E]).join(`
|
|
29
|
+
`)).join(`
|
|
30
|
+
`)}});var yF=X((GU,xF)=>{xF.exports=(F,_,E)=>{E=E||_;let $=Math.min(_-E,F-Math.floor(E/2));if($<0)$=0;let B=Math.min($+E,_);return{startIndex:$,endIndex:B}}});var P=X((KU,hF)=>{hF.exports={action:SF(),clear:jF(),style:OF(),strip:i0(),figures:l1(),lines:fF(),wrap:bF(),entriesToDisplay:yF()}});var d=X((WU,dF)=>{var vF=f("readline"),Z3=P(),Q3=Z3.action,G3=f("events"),uF=A(),K3=uF.beep,W3=uF.cursor,L3=S();class gF extends G3{constructor(F={}){super();this.firstRender=!0,this.in=F.stdin||process.stdin,this.out=F.stdout||process.stdout,this.onRender=(F.onRender||(()=>{return})).bind(this);let _=vF.createInterface({input:this.in,escapeCodeTimeout:50});if(vF.emitKeypressEvents(this.in,_),this.in.isTTY)this.in.setRawMode(!0);let E=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,$=(B,D)=>{let U=Q3(D,E);if(U===!1)this._&&this._(B,D);else if(typeof this[U]==="function")this[U](D);else this.bell()};this.close=()=>{if(this.out.write(W3.show),this.in.removeListener("keypress",$),this.in.isTTY)this.in.setRawMode(!1);_.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",$)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(K3)}render(){if(this.onRender(L3),this.firstRender)this.firstRender=!1}}dF.exports=gF});var pF=X((LU,iF)=>{function cF(F,_,E,$,B,D,U){try{var z=F[D](U),M=z.value}catch(H){E(H);return}if(z.done)_(M);else Promise.resolve(M).then($,B)}function mF(F){return function(){var _=this,E=arguments;return new Promise(function($,B){var D=F.apply(_,E);function U(M){cF(D,$,B,U,z,"next",M)}function z(M){cF(D,$,B,U,z,"throw",M)}U(void 0)})}}var p0=S(),S3=d(),lF=A(),A3=lF.erase,I0=lF.cursor,t0=P(),i1=t0.style,p1=t0.clear,I3=t0.lines,q3=t0.figures;class nF extends S3{constructor(F={}){super(F);this.transform=i1.render(F.style),this.scale=this.transform.scale,this.msg=F.message,this.initial=F.initial||"",this.validator=F.validate||(()=>!0),this.value="",this.errorMsg=F.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=p1("",this.out.columns),this.render()}set value(F){if(!F&&this.initial)this.placeholder=!0,this.rendered=p0.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render(F);this._value=F,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
31
|
+
`),this.close()}validate(){var F=this;return mF(function*(){let _=yield F.validator(F.value);if(typeof _==="string")F.errorMsg=_,_=!1;F.error=!_})()}submit(){var F=this;return mF(function*(){if(F.value=F.value||F.initial,F.cursorOffset=0,F.cursor=F.rendered.length,yield F.validate(),F.error){F.red=!0,F.fire(),F.render();return}F.done=!0,F.aborted=!1,F.fire(),F.render(),F.out.write(`
|
|
32
|
+
`),F.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(F){if(this.placeholder)return;this.cursor=this.cursor+F,this.cursorOffset+=F}_(F,_){let E=this.value.slice(0,this.cursor),$=this.value.slice(this.cursor);this.value=`${E}${F}${$}`,this.red=!1,this.cursor=this.placeholder?0:E.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let F=this.value.slice(0,this.cursor-1),_=this.value.slice(this.cursor);if(this.value=`${F}${_}`,this.red=!1,this.isCursorAtStart())this.cursorOffset=0;else this.cursorOffset++,this.moveCursor(-1);this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let F=this.value.slice(0,this.cursor),_=this.value.slice(this.cursor+1);if(this.value=`${F}${_}`,this.red=!1,this.isCursorAtEnd())this.cursorOffset=0;else this.cursorOffset++;this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(I0.down(I3(this.outputError,this.out.columns)-1)+p1(this.outputError,this.out.columns));this.out.write(p1(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[i1.symbol(this.done,this.aborted),p0.bold(this.msg),i1.delimiter(this.done),this.red?p0.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
|
|
33
|
+
`).reduce((F,_,E)=>F+`
|
|
34
|
+
${E?" ":q3.pointerSmall} ${p0.red().italic(_)}`,"");this.out.write(A3.line+I0.to(0)+this.outputText+I0.save+this.outputError+I0.restore+I0.move(this.cursorOffset,0))}}iF.exports=nF});var oF=X((SU,aF)=>{var c=S(),N3=d(),q0=P(),tF=q0.style,sF=q0.clear,s0=q0.figures,V3=q0.wrap,C3=q0.entriesToDisplay,j3=A(),T3=j3.cursor;class rF extends N3{constructor(F={}){super(F);this.msg=F.message,this.hint=F.hint||"- Use arrow-keys. Return to submit.",this.warn=F.warn||"- This option is disabled",this.cursor=F.initial||0,this.choices=F.choices.map((_,E)=>{if(typeof _==="string")_={title:_,value:E};return{title:_&&(_.title||_.value||_),value:_&&(_.value===void 0?E:_.value),description:_&&_.description,selected:_&&_.selected,disabled:_&&_.disabled}}),this.optionsPerPage=F.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=sF("",this.out.columns),this.render()}moveCursor(F){this.cursor=F,this.value=this.choices[F].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
35
|
+
`),this.close()}submit(){if(!this.selection.disabled)this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
36
|
+
`),this.close();else this.bell()}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){if(this.cursor===0)this.moveCursor(this.choices.length-1);else this.moveCursor(this.cursor-1);this.render()}down(){if(this.cursor===this.choices.length-1)this.moveCursor(0);else this.moveCursor(this.cursor+1);this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(F,_){if(F===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(T3.hide);else this.out.write(sF(this.outputText,this.out.columns));super.render();let F=C3(this.cursor,this.choices.length,this.optionsPerPage),_=F.startIndex,E=F.endIndex;if(this.outputText=[tF.symbol(this.done,this.aborted),c.bold(this.msg),tF.delimiter(!1),this.done?this.selection.title:this.selection.disabled?c.yellow(this.warn):c.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
37
|
+
`;for(let $=_;$<E;$++){let B,D,U="",z=this.choices[$];if($===_&&_>0)D=s0.arrowUp;else if($===E-1&&E<this.choices.length)D=s0.arrowDown;else D=" ";if(z.disabled)B=this.cursor===$?c.gray().underline(z.title):c.strikethrough().gray(z.title),D=(this.cursor===$?c.bold().gray(s0.pointer)+" ":" ")+D;else if(B=this.cursor===$?c.cyan().underline(z.title):z.title,D=(this.cursor===$?c.cyan(s0.pointer)+" ":" ")+D,z.description&&this.cursor===$){if(U=` - ${z.description}`,D.length+B.length+U.length>=this.out.columns||z.description.split(/\r?\n/).length>1)U=`
|
|
38
|
+
`+V3(z.description,{margin:3,width:this.out.columns})}this.outputText+=`${D} ${B}${c.gray(U)}
|
|
39
|
+
`}}this.out.write(this.outputText)}}aF.exports=rF});var D_=X((AU,B_)=>{var r0=S(),P3=d(),__=P(),eF=__.style,O3=__.clear,E_=A(),F_=E_.cursor,w3=E_.erase;class $_ extends P3{constructor(F={}){super(F);this.msg=F.message,this.value=!!F.initial,this.active=F.active||"on",this.inactive=F.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
40
|
+
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
41
|
+
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(F,_){if(F===" ")this.value=!this.value;else if(F==="1")this.value=!0;else if(F==="0")this.value=!1;else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(F_.hide);else this.out.write(O3(this.outputText,this.out.columns));super.render(),this.outputText=[eF.symbol(this.done,this.aborted),r0.bold(this.msg),eF.delimiter(this.done),this.value?this.inactive:r0.cyan().underline(this.inactive),r0.gray("/"),this.value?r0.cyan().underline(this.active):this.active].join(" "),this.out.write(w3.line+F_.to(0)+this.outputText)}}B_.exports=$_});var b=X((IU,U_)=>{class a0{constructor({token:F,date:_,parts:E,locales:$}){this.token=F,this.date=_||new Date,this.parts=E||[this],this.locales=$||{}}up(){}down(){}next(){let F=this.parts.indexOf(this);return this.parts.find((_,E)=>E>F&&_ instanceof a0)}setTo(F){}prev(){let F=[].concat(this.parts).reverse(),_=F.indexOf(this);return F.find((E,$)=>$>_&&E instanceof a0)}toString(){return String(this.date)}}U_.exports=a0});var M_=X((qU,H_)=>{var f3=b();class z_ extends f3{constructor(F={}){super(F)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let F=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?F.toUpperCase():F}}H_.exports=z_});var J_=X((NU,X_)=>{var k3=b(),b3=(F)=>{return F=F%10,F===1?"st":F===2?"nd":F===3?"rd":"th"};class R_ extends k3{constructor(F={}){super(F)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(F){this.date.setDate(parseInt(F.substr(-2)))}toString(){let F=this.date.getDate(),_=this.date.getDay();return this.token==="DD"?String(F).padStart(2,"0"):this.token==="Do"?F+b3(F):this.token==="d"?_+1:this.token==="ddd"?this.locales.weekdaysShort[_]:this.token==="dddd"?this.locales.weekdays[_]:F}}X_.exports=R_});var Q_=X((VU,Z_)=>{var x3=b();class Y_ extends x3{constructor(F={}){super(F)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(F){this.date.setHours(parseInt(F.substr(-2)))}toString(){let F=this.date.getHours();if(/h/.test(this.token))F=F%12||12;return this.token.length>1?String(F).padStart(2,"0"):F}}Z_.exports=Y_});var W_=X((CU,K_)=>{var y3=b();class G_ extends y3{constructor(F={}){super(F)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(F){this.date.setMilliseconds(parseInt(F.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}K_.exports=G_});var A_=X((jU,S_)=>{var h3=b();class L_ extends h3{constructor(F={}){super(F)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(F){this.date.setMinutes(parseInt(F.substr(-2)))}toString(){let F=this.date.getMinutes();return this.token.length>1?String(F).padStart(2,"0"):F}}S_.exports=L_});var N_=X((TU,q_)=>{var v3=b();class I_ extends v3{constructor(F={}){super(F)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(F){F=parseInt(F.substr(-2))-1,this.date.setMonth(F<0?0:F)}toString(){let F=this.date.getMonth(),_=this.token.length;return _===2?String(F+1).padStart(2,"0"):_===3?this.locales.monthsShort[F]:_===4?this.locales.months[F]:String(F+1)}}q_.exports=I_});var j_=X((PU,C_)=>{var u3=b();class V_ extends u3{constructor(F={}){super(F)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(F){this.date.setSeconds(parseInt(F.substr(-2)))}toString(){let F=this.date.getSeconds();return this.token.length>1?String(F).padStart(2,"0"):F}}C_.exports=V_});var O_=X((OU,P_)=>{var g3=b();class T_ extends g3{constructor(F={}){super(F)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(F){this.date.setFullYear(F.substr(-4))}toString(){let F=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?F.substr(-2):F}}P_.exports=T_});var f_=X((wU,w_)=>{w_.exports={DatePart:b(),Meridiem:M_(),Day:J_(),Hours:Q_(),Milliseconds:W_(),Minutes:A_(),Month:N_(),Seconds:j_(),Year:O_()}});var m_=X((fU,c_)=>{function k_(F,_,E,$,B,D,U){try{var z=F[D](U),M=z.value}catch(H){E(H);return}if(z.done)_(M);else Promise.resolve(M).then($,B)}function b_(F){return function(){var _=this,E=arguments;return new Promise(function($,B){var D=F.apply(_,E);function U(M){k_(D,$,B,U,z,"next",M)}function z(M){k_(D,$,B,U,z,"throw",M)}U(void 0)})}}var t1=S(),d3=d(),s1=P(),x_=s1.style,y_=s1.clear,c3=s1.figures,g_=A(),m3=g_.erase,h_=g_.cursor,m=f_(),v_=m.DatePart,l3=m.Meridiem,n3=m.Day,i3=m.Hours,p3=m.Milliseconds,t3=m.Minutes,s3=m.Month,r3=m.Seconds,a3=m.Year,o3=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,u_={1:({token:F})=>F.replace(/\\(.)/g,"$1"),2:(F)=>new n3(F),3:(F)=>new s3(F),4:(F)=>new a3(F),5:(F)=>new l3(F),6:(F)=>new i3(F),7:(F)=>new t3(F),8:(F)=>new r3(F),9:(F)=>new p3(F)},e3={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class d_ extends d3{constructor(F={}){super(F);this.msg=F.message,this.cursor=0,this.typed="",this.locales=Object.assign(e3,F.locales),this._date=F.initial||new Date,this.errorMsg=F.error||"Please Enter A Valid Value",this.validator=F.validate||(()=>!0),this.mask=F.mask||"YYYY-MM-DD HH:mm:ss",this.clear=y_("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(F){if(F)this._date.setTime(F.getTime())}set mask(F){let _;this.parts=[];while(_=o3.exec(F)){let $=_.shift(),B=_.findIndex((D)=>D!=null);this.parts.push(B in u_?u_[B]({token:_[B]||$,date:this.date,parts:this.parts,locales:this.locales}):_[B]||$)}let E=this.parts.reduce(($,B)=>{if(typeof B==="string"&&typeof $[$.length-1]==="string")$[$.length-1]+=B;else $.push(B);return $},[]);this.parts.splice(0),this.parts.push(...E),this.reset()}moveCursor(F){this.typed="",this.cursor=F,this.fire()}reset(){this.moveCursor(this.parts.findIndex((F)=>F instanceof v_)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
42
|
+
`),this.close()}validate(){var F=this;return b_(function*(){let _=yield F.validator(F.value);if(typeof _==="string")F.errorMsg=_,_=!1;F.error=!_})()}submit(){var F=this;return b_(function*(){if(yield F.validate(),F.error){F.color="red",F.fire(),F.render();return}F.done=!0,F.aborted=!1,F.fire(),F.render(),F.out.write(`
|
|
43
|
+
`),F.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let F=this.parts[this.cursor].prev();if(F==null)return this.bell();this.moveCursor(this.parts.indexOf(F)),this.render()}right(){let F=this.parts[this.cursor].next();if(F==null)return this.bell();this.moveCursor(this.parts.indexOf(F)),this.render()}next(){let F=this.parts[this.cursor].next();this.moveCursor(F?this.parts.indexOf(F):this.parts.findIndex((_)=>_ instanceof v_)),this.render()}_(F){if(/\d/.test(F))this.typed+=F,this.parts[this.cursor].setTo(this.typed),this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(h_.hide);else this.out.write(y_(this.outputText,this.out.columns));if(super.render(),this.outputText=[x_.symbol(this.done,this.aborted),t1.bold(this.msg),x_.delimiter(!1),this.parts.reduce((F,_,E)=>F.concat(E===this.cursor&&!this.done?t1.cyan().underline(_.toString()):_),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split(`
|
|
44
|
+
`).reduce((F,_,E)=>F+`
|
|
45
|
+
${E?" ":c3.pointerSmall} ${t1.red().italic(_)}`,"");this.out.write(m3.line+h_.to(0)+this.outputText)}}c_.exports=d_});var a_=X((kU,r_)=>{function l_(F,_,E,$,B,D,U){try{var z=F[D](U),M=z.value}catch(H){E(H);return}if(z.done)_(M);else Promise.resolve(M).then($,B)}function n_(F){return function(){var _=this,E=arguments;return new Promise(function($,B){var D=F.apply(_,E);function U(M){l_(D,$,B,U,z,"next",M)}function z(M){l_(D,$,B,U,z,"throw",M)}U(void 0)})}}var o0=S(),F7=d(),t_=A(),e0=t_.cursor,_7=t_.erase,F1=P(),r1=F1.style,E7=F1.figures,i_=F1.clear,$7=F1.lines,B7=/[0-9]/,a1=(F)=>F!==void 0,p_=(F,_)=>{let E=Math.pow(10,_);return Math.round(F*E)/E};class s_ extends F7{constructor(F={}){super(F);this.transform=r1.render(F.style),this.msg=F.message,this.initial=a1(F.initial)?F.initial:"",this.float=!!F.float,this.round=F.round||2,this.inc=F.increment||1,this.min=a1(F.min)?F.min:-1/0,this.max=a1(F.max)?F.max:1/0,this.errorMsg=F.error||"Please Enter A Valid Value",this.validator=F.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(F){if(!F&&F!==0)this.placeholder=!0,this.rendered=o0.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${p_(F,this.round)}`),this._value=p_(F,this.round);this.fire()}get value(){return this._value}parse(F){return this.float?parseFloat(F):parseInt(F)}valid(F){return F==="-"||F==="."&&this.float||B7.test(F)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let F=this.value;this.value=F!==""?F:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
46
|
+
`),this.close()}validate(){var F=this;return n_(function*(){let _=yield F.validator(F.value);if(typeof _==="string")F.errorMsg=_,_=!1;F.error=!_})()}submit(){var F=this;return n_(function*(){if(yield F.validate(),F.error){F.color="red",F.fire(),F.render();return}let _=F.value;F.value=_!==""?_:F.initial,F.done=!0,F.aborted=!1,F.error=!1,F.fire(),F.render(),F.out.write(`
|
|
47
|
+
`),F.close()})()}up(){if(this.typed="",this.value==="")this.value=this.min-this.inc;if(this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value==="")this.value=this.min+this.inc;if(this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let F=this.value.toString();if(F.length===0)return this.bell();if(this.value=this.parse(F=F.slice(0,-1))||"",this.value!==""&&this.value<this.min)this.value=this.min;this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(F,_){if(!this.valid(F))return this.bell();let E=Date.now();if(E-this.lastHit>1000)this.typed="";if(this.typed+=F,this.lastHit=E,this.color="cyan",F===".")return this.fire();if(this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire(),this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(e0.down($7(this.outputError,this.out.columns)-1)+i_(this.outputError,this.out.columns));this.out.write(i_(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[r1.symbol(this.done,this.aborted),o0.bold(this.msg),r1.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o0[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
|
|
48
|
+
`).reduce((F,_,E)=>F+`
|
|
49
|
+
${E?" ":E7.pointerSmall} ${o0.red().italic(_)}`,"");this.out.write(_7.line+e0.to(0)+this.outputText+e0.save+this.outputError+e0.restore)}}r_.exports=s_});var o1=X((bU,_6)=>{var x=S(),D7=A(),U7=D7.cursor,z7=d(),N0=P(),o_=N0.clear,s=N0.figures,e_=N0.style,H7=N0.wrap,M7=N0.entriesToDisplay;class F6 extends z7{constructor(F={}){super(F);if(this.msg=F.message,this.cursor=F.cursor||0,this.scrollIndex=F.cursor||0,this.hint=F.hint||"",this.warn=F.warn||"- This option is disabled -",this.minSelected=F.min,this.showMinError=!1,this.maxChoices=F.max,this.instructions=F.instructions,this.optionsPerPage=F.optionsPerPage||10,this.value=F.choices.map((_,E)=>{if(typeof _==="string")_={title:_,value:E};return{title:_&&(_.title||_.value||_),description:_&&_.description,value:_&&(_.value===void 0?E:_.value),selected:_&&_.selected,disabled:_&&_.disabled}}),this.clear=o_("",this.out.columns),!F.overrideRender)this.render()}reset(){this.value.map((F)=>!F.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((F)=>F.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
50
|
+
`),this.close()}submit(){let F=this.value.filter((_)=>_.selected);if(this.minSelected&&F.length<this.minSelected)this.showMinError=!0,this.render();else this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
51
|
+
`),this.close()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){if(this.cursor===0)this.cursor=this.value.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.value.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((F)=>F.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let F=this.value[this.cursor];if(F.selected)F.selected=!1,this.render();else if(F.disabled||this.value.filter((_)=>_.selected).length>=this.maxChoices)return this.bell();else F.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let F=!this.value[this.cursor].selected;this.value.filter((_)=>!_.disabled).forEach((_)=>_.selected=F),this.render()}_(F,_){if(F===" ")this.handleSpaceToggle();else if(F==="a")this.toggleAll();else return this.bell()}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
|
|
52
|
+
Instructions:
|
|
53
|
+
${s.arrowUp}/${s.arrowDown}: Highlight option
|
|
54
|
+
${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection
|
|
55
|
+
`+(this.maxChoices===void 0?` a: Toggle all
|
|
56
|
+
`:"")+" enter/return: Complete answer"}return""}renderOption(F,_,E,$){let B=(_.selected?x.green(s.radioOn):s.radioOff)+" "+$+" ",D,U;if(_.disabled)D=F===E?x.gray().underline(_.title):x.strikethrough().gray(_.title);else if(D=F===E?x.cyan().underline(_.title):_.title,F===E&&_.description){if(U=` - ${_.description}`,B.length+D.length+U.length>=this.out.columns||_.description.split(/\r?\n/).length>1)U=`
|
|
57
|
+
`+H7(_.description,{margin:B.length,width:this.out.columns})}return B+D+x.gray(U||"")}paginateOptions(F){if(F.length===0)return x.red("No matches for this query.");let _=M7(this.cursor,F.length,this.optionsPerPage),E=_.startIndex,$=_.endIndex,B,D=[];for(let U=E;U<$;U++){if(U===E&&E>0)B=s.arrowUp;else if(U===$-1&&$<F.length)B=s.arrowDown;else B=" ";D.push(this.renderOption(this.cursor,F[U],U,B))}return`
|
|
58
|
+
`+D.join(`
|
|
59
|
+
`)}renderOptions(F){if(!this.done)return this.paginateOptions(F);return""}renderDoneOrInstructions(){if(this.done)return this.value.filter((_)=>_.selected).map((_)=>_.title).join(", ");let F=[x.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)F.push(x.yellow(this.warn));return F.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(U7.hide);super.render();let F=[e_.symbol(this.done,this.aborted),x.bold(this.msg),e_.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)F+=x.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;F+=this.renderOptions(this.value),this.out.write(this.clear+F),this.clear=o_(F,this.out.columns)}}_6.exports=F6});var M6=X((xU,H6)=>{function E6(F,_,E,$,B,D,U){try{var z=F[D](U),M=z.value}catch(H){E(H);return}if(z.done)_(M);else Promise.resolve(M).then($,B)}function R7(F){return function(){var _=this,E=arguments;return new Promise(function($,B){var D=F.apply(_,E);function U(M){E6(D,$,B,U,z,"next",M)}function z(M){E6(D,$,B,U,z,"throw",M)}U(void 0)})}}var V0=S(),X7=d(),U6=A(),J7=U6.erase,$6=U6.cursor,C0=P(),e1=C0.style,B6=C0.clear,F2=C0.figures,Y7=C0.wrap,Z7=C0.entriesToDisplay,D6=(F,_)=>F[_]&&(F[_].value||F[_].title||F[_]),Q7=(F,_)=>F[_]&&(F[_].title||F[_].value||F[_]),G7=(F,_)=>{let E=F.findIndex(($)=>$.value===_||$.title===_);return E>-1?E:void 0};class z6 extends X7{constructor(F={}){super(F);this.msg=F.message,this.suggest=F.suggest,this.choices=F.choices,this.initial=typeof F.initial==="number"?F.initial:G7(F.choices,F.initial),this.select=this.initial||F.cursor||0,this.i18n={noMatches:F.noMatches||"no matches found"},this.fallback=F.fallback||this.initial,this.clearFirst=F.clearFirst||!1,this.suggestions=[],this.input="",this.limit=F.limit||10,this.cursor=0,this.transform=e1.render(F.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=B6("",this.out.columns),this.complete(this.render),this.render()}set fallback(F){this._fb=Number.isSafeInteger(parseInt(F))?parseInt(F):F}get fallback(){let F;if(typeof this._fb==="number")F=this.choices[this._fb];else if(typeof this._fb==="string")F={title:this._fb};return F||this._fb||{title:this.i18n.noMatches}}moveSelect(F){if(this.select=F,this.suggestions.length>0)this.value=D6(this.suggestions,F);else this.value=this.fallback.value;this.fire()}complete(F){var _=this;return R7(function*(){let E=_.completing=_.suggest(_.input,_.choices),$=yield E;if(_.completing!==E)return;_.suggestions=$.map((D,U,z)=>({title:Q7(z,U),value:D6(z,U),description:D.description})),_.completing=!1;let B=Math.max($.length-1,0);_.moveSelect(Math.min(B,_.select)),F&&F()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){if(this.clearFirst&&this.input.length>0)this.reset();else this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
60
|
+
`),this.close()}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
61
|
+
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
62
|
+
`),this.close()}_(F,_){let E=this.input.slice(0,this.cursor),$=this.input.slice(this.cursor);this.input=`${E}${F}${$}`,this.cursor=E.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let F=this.input.slice(0,this.cursor-1),_=this.input.slice(this.cursor);this.input=`${F}${_}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let F=this.input.slice(0,this.cursor),_=this.input.slice(this.cursor+1);this.input=`${F}${_}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){if(this.select===0)this.moveSelect(this.suggestions.length-1);else this.moveSelect(this.select-1);this.render()}down(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}next(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(F,_,E,$){let B,D=E?F2.arrowUp:$?F2.arrowDown:" ",U=_?V0.cyan().underline(F.title):F.title;if(D=(_?V0.cyan(F2.pointer)+" ":" ")+D,F.description){if(B=` - ${F.description}`,D.length+U.length+B.length>=this.out.columns||F.description.split(/\r?\n/).length>1)B=`
|
|
63
|
+
`+Y7(F.description,{margin:3,width:this.out.columns})}return D+" "+U+V0.gray(B||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write($6.hide);else this.out.write(B6(this.outputText,this.out.columns));super.render();let F=Z7(this.select,this.choices.length,this.limit),_=F.startIndex,E=F.endIndex;if(this.outputText=[e1.symbol(this.done,this.aborted,this.exited),V0.bold(this.msg),e1.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let $=this.suggestions.slice(_,E).map((B,D)=>this.renderOption(B,this.select===D+_,D===0&&_>0,D+_===E-1&&E<this.choices.length)).join(`
|
|
64
|
+
`);this.outputText+=`
|
|
65
|
+
`+($||V0.gray(this.fallback.title))}this.out.write(J7.line+$6.to(0)+this.outputText)}}H6.exports=z6});var Z6=X((yU,Y6)=>{var l=S(),K7=A(),W7=K7.cursor,L7=o1(),_2=P(),R6=_2.clear,X6=_2.style,M0=_2.figures;class J6 extends L7{constructor(F={}){F.overrideRender=!0;super(F);this.inputValue="",this.clear=R6("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){if(this.cursor===0)this.cursor=this.filteredOptions.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.filteredOptions.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((F)=>F.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){if(this.inputValue.length)this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions()}updateFilteredOptions(){let F=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((E)=>{if(this.inputValue){if(typeof E.title==="string"){if(E.title.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}if(typeof E.value==="string"){if(E.value.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}return!1}return!0});let _=this.filteredOptions.findIndex((E)=>E===F);this.cursor=_<0?0:_,this.render()}handleSpaceToggle(){let F=this.filteredOptions[this.cursor];if(F.selected)F.selected=!1,this.render();else if(F.disabled||this.value.filter((_)=>_.selected).length>=this.maxChoices)return this.bell();else F.selected=!0,this.render()}handleInputChange(F){this.inputValue=this.inputValue+F,this.updateFilteredOptions()}_(F,_){if(F===" ")this.handleSpaceToggle();else this.handleInputChange(F)}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
|
|
66
|
+
Instructions:
|
|
67
|
+
${M0.arrowUp}/${M0.arrowDown}: Highlight option
|
|
68
|
+
${M0.arrowLeft}/${M0.arrowRight}/[space]: Toggle selection
|
|
69
|
+
[a,b,c]/delete: Filter choices
|
|
70
|
+
enter/return: Complete answer
|
|
71
|
+
`}return""}renderCurrentInput(){return`
|
|
72
|
+
Filtered results for: ${this.inputValue?this.inputValue:l.gray("Enter something to filter")}
|
|
73
|
+
`}renderOption(F,_,E){let $;if(_.disabled)$=F===E?l.gray().underline(_.title):l.strikethrough().gray(_.title);else $=F===E?l.cyan().underline(_.title):_.title;return(_.selected?l.green(M0.radioOn):M0.radioOff)+" "+$}renderDoneOrInstructions(){if(this.done)return this.value.filter((_)=>_.selected).map((_)=>_.title).join(", ");let F=[l.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled)F.push(l.yellow(this.warn));return F.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(W7.hide);super.render();let F=[X6.symbol(this.done,this.aborted),l.bold(this.msg),X6.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)F+=l.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;F+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+F),this.clear=R6(F,this.out.columns)}}Y6.exports=J6});var I6=X((hU,A6)=>{var Q6=S(),S7=d(),W6=P(),G6=W6.style,A7=W6.clear,L6=A(),I7=L6.erase,K6=L6.cursor;class S6 extends S7{constructor(F={}){super(F);this.msg=F.message,this.value=F.initial,this.initialValue=!!F.initial,this.yesMsg=F.yes||"yes",this.yesOption=F.yesOption||"(Y/n)",this.noMsg=F.no||"no",this.noOption=F.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
74
|
+
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
75
|
+
`),this.close()}_(F,_){if(F.toLowerCase()==="y")return this.value=!0,this.submit();if(F.toLowerCase()==="n")return this.value=!1,this.submit();return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(K6.hide);else this.out.write(A7(this.outputText,this.out.columns));super.render(),this.outputText=[G6.symbol(this.done,this.aborted),Q6.bold(this.msg),G6.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Q6.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(I7.line+K6.to(0)+this.outputText)}}A6.exports=S6});var N6=X((vU,q6)=>{q6.exports={TextPrompt:pF(),SelectPrompt:oF(),TogglePrompt:D_(),DatePrompt:m_(),NumberPrompt:a_(),MultiselectPrompt:o1(),AutocompletePrompt:M6(),AutocompleteMultiselectPrompt:Z6(),ConfirmPrompt:I6()}});var C6=X((V6)=>{var q=V6,q7=N6(),_1=(F)=>F;function y(F,_,E={}){return new Promise(($,B)=>{let D=new q7[F](_),U=E.onAbort||_1,z=E.onSubmit||_1,M=E.onExit||_1;D.on("state",_.onState||_1),D.on("submit",(H)=>$(z(H))),D.on("exit",(H)=>$(M(H))),D.on("abort",(H)=>B(U(H)))})}q.text=(F)=>y("TextPrompt",F);q.password=(F)=>{return F.style="password",q.text(F)};q.invisible=(F)=>{return F.style="invisible",q.text(F)};q.number=(F)=>y("NumberPrompt",F);q.date=(F)=>y("DatePrompt",F);q.confirm=(F)=>y("ConfirmPrompt",F);q.list=(F)=>{let _=F.separator||",";return y("TextPrompt",F,{onSubmit:(E)=>E.split(_).map(($)=>$.trim())})};q.toggle=(F)=>y("TogglePrompt",F);q.select=(F)=>y("SelectPrompt",F);q.multiselect=(F)=>{F.choices=[].concat(F.choices||[]);let _=(E)=>E.filter(($)=>$.selected).map(($)=>$.value);return y("MultiselectPrompt",F,{onAbort:_,onSubmit:_})};q.autocompleteMultiselect=(F)=>{F.choices=[].concat(F.choices||[]);let _=(E)=>E.filter(($)=>$.selected).map(($)=>$.value);return y("AutocompleteMultiselectPrompt",F,{onAbort:_,onSubmit:_})};var N7=(F,_)=>Promise.resolve(_.filter((E)=>E.title.slice(0,F.length).toLowerCase()===F.toLowerCase()));q.autocomplete=(F)=>{return F.suggest=F.suggest||N7,F.choices=[].concat(F.choices||[]),y("AutocompletePrompt",F)}});var b6=X((gU,k6)=>{function j6(F,_){var E=Object.keys(F);if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(F);if(_)$=$.filter(function(B){return Object.getOwnPropertyDescriptor(F,B).enumerable});E.push.apply(E,$)}return E}function T6(F){for(var _=1;_<arguments.length;_++){var E=arguments[_]!=null?arguments[_]:{};if(_%2)j6(Object(E),!0).forEach(function($){V7(F,$,E[$])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(F,Object.getOwnPropertyDescriptors(E));else j6(Object(E)).forEach(function($){Object.defineProperty(F,$,Object.getOwnPropertyDescriptor(E,$))})}return F}function V7(F,_,E){if(_ in F)Object.defineProperty(F,_,{value:E,enumerable:!0,configurable:!0,writable:!0});else F[_]=E;return F}function C7(F,_){var E=typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(!E){if(Array.isArray(F)||(E=j7(F))||_&&F&&typeof F.length==="number"){if(E)F=E;var $=0,B=function(){};return{s:B,n:function(){if($>=F.length)return{done:!0};return{done:!1,value:F[$++]}},e:function(H){throw H},f:B}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
76
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var D=!0,U=!1,z;return{s:function(){E=E.call(F)},n:function(){var H=E.next();return D=H.done,H},e:function(H){U=!0,z=H},f:function(){try{if(!D&&E.return!=null)E.return()}finally{if(U)throw z}}}}function j7(F,_){if(!F)return;if(typeof F==="string")return P6(F,_);var E=Object.prototype.toString.call(F).slice(8,-1);if(E==="Object"&&F.constructor)E=F.constructor.name;if(E==="Map"||E==="Set")return Array.from(F);if(E==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E))return P6(F,_)}function P6(F,_){if(_==null||_>F.length)_=F.length;for(var E=0,$=Array(_);E<_;E++)$[E]=F[E];return $}function O6(F,_,E,$,B,D,U){try{var z=F[D](U),M=z.value}catch(H){E(H);return}if(z.done)_(M);else Promise.resolve(M).then($,B)}function w6(F){return function(){var _=this,E=arguments;return new Promise(function($,B){var D=F.apply(_,E);function U(M){O6(D,$,B,U,z,"next",M)}function z(M){O6(D,$,B,U,z,"throw",M)}U(void 0)})}}var E2=C6(),T7=["suggest","format","onState","validate","onRender","type"],f6=()=>{};function r(){return $2.apply(this,arguments)}function $2(){return $2=w6(function*(F=[],{onSubmit:_=f6,onCancel:E=f6}={}){let $={},B=r._override||{};F=[].concat(F);let D,U,z,M,H,R,J=function(){var w=w6(function*(C,b0,A2=!1){if(!A2&&C.validate&&C.validate(b0)!==!0)return;return C.format?yield C.format(b0,$):b0});return function(b0,A2){return w.apply(this,arguments)}}();var G=C7(F),I;try{for(G.s();!(I=G.n()).done;){U=I.value;var e=U;if(M=e.name,H=e.type,typeof H==="function")H=yield H(D,T6({},$),U),U.type=H;if(!H)continue;for(let w in U){if(T7.includes(w))continue;let C=U[w];U[w]=typeof C==="function"?yield C(D,T6({},$),R):C}if(R=U,typeof U.message!=="string")throw Error("prompt message is required");var k0=U;if(M=k0.name,H=k0.type,E2[H]===void 0)throw Error(`prompt type (${H}) is not defined`);if(B[U.name]!==void 0){if(D=yield J(U,B[U.name]),D!==void 0){$[M]=D;continue}}try{D=r._injected?P7(r._injected,U.initial):yield E2[H](U),$[M]=D=yield J(U,D,!0),z=yield _(U,D,$)}catch(w){z=!(yield E(U,$))}if(z)return $}}catch(w){G.e(w)}finally{G.f()}return $}),$2.apply(this,arguments)}function P7(F,_){let E=F.shift();if(E instanceof Error)throw E;return E===void 0?_:E}function O7(F){r._injected=(r._injected||[]).concat(F)}function w7(F){r._override=Object.assign({},F)}k6.exports=Object.assign(r,{prompt:r,prompts:E2,inject:O7,override:w7})});var y6=X((dU,x6)=>{x6.exports=(F,_)=>{if(F.meta&&F.name!=="escape")return;if(F.ctrl){if(F.name==="a")return"first";if(F.name==="c")return"abort";if(F.name==="d")return"abort";if(F.name==="e")return"last";if(F.name==="g")return"reset"}if(_){if(F.name==="j")return"down";if(F.name==="k")return"up"}if(F.name==="return")return"submit";if(F.name==="enter")return"submit";if(F.name==="backspace")return"delete";if(F.name==="delete")return"deleteForward";if(F.name==="abort")return"abort";if(F.name==="escape")return"exit";if(F.name==="tab")return"next";if(F.name==="pagedown")return"nextPage";if(F.name==="pageup")return"prevPage";if(F.name==="home")return"home";if(F.name==="end")return"end";if(F.name==="up")return"up";if(F.name==="down")return"down";if(F.name==="right")return"right";if(F.name==="left")return"left";return!1}});var E1=X((cU,h6)=>{h6.exports=(F)=>{let _=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),E=new RegExp(_,"g");return typeof F==="string"?F.replace(E,""):F}});var g6=X((mU,u6)=>{var f7=E1(),{erase:v6,cursor:k7}=A(),b7=(F)=>[...f7(F)].length;u6.exports=function(F,_){if(!_)return v6.line+k7.to(0);let E=0,$=F.split(/\r?\n/);for(let B of $)E+=1+Math.floor(Math.max(b7(B)-1,0)/_);return v6.lines(E)}});var B2=X((lU,d6)=>{var j0={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},x7={arrowUp:j0.arrowUp,arrowDown:j0.arrowDown,arrowLeft:j0.arrowLeft,arrowRight:j0.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},y7=process.platform==="win32"?x7:j0;d6.exports=y7});var m6=X((nU,c6)=>{var R0=S(),$0=B2(),D2=Object.freeze({password:{scale:1,render:(F)=>"*".repeat(F.length)},emoji:{scale:2,render:(F)=>"\uD83D\uDE03".repeat(F.length)},invisible:{scale:0,render:(F)=>""},default:{scale:1,render:(F)=>`${F}`}}),h7=(F)=>D2[F]||D2.default,T0=Object.freeze({aborted:R0.red($0.cross),done:R0.green($0.tick),exited:R0.yellow($0.cross),default:R0.cyan("?")}),v7=(F,_,E)=>_?T0.aborted:E?T0.exited:F?T0.done:T0.default,u7=(F)=>R0.gray(F?$0.ellipsis:$0.pointerSmall),g7=(F,_)=>R0.gray(F?_?$0.pointerSmall:"+":$0.line);c6.exports={styles:D2,render:h7,symbols:T0,symbol:v7,delimiter:u7,item:g7}});var n6=X((iU,l6)=>{var d7=E1();l6.exports=function(F,_){let E=String(d7(F)||"").split(/\r?\n/);if(!_)return E.length;return E.map(($)=>Math.ceil($.length/_)).reduce(($,B)=>$+B)}});var p6=X((pU,i6)=>{i6.exports=(F,_={})=>{let E=Number.isSafeInteger(parseInt(_.margin))?Array(parseInt(_.margin)).fill(" ").join(""):_.margin||"",$=_.width;return(F||"").split(/\r?\n/g).map((B)=>B.split(/\s+/g).reduce((D,U)=>{if(U.length+E.length>=$||D[D.length-1].length+U.length+1<$)D[D.length-1]+=` ${U}`;else D.push(`${E}${U}`);return D},[E]).join(`
|
|
77
|
+
`)).join(`
|
|
78
|
+
`)}});var s6=X((tU,t6)=>{t6.exports=(F,_,E)=>{E=E||_;let $=Math.min(_-E,F-Math.floor(E/2));if($<0)$=0;let B=Math.min($+E,_);return{startIndex:$,endIndex:B}}});var O=X((sU,r6)=>{r6.exports={action:y6(),clear:g6(),style:m6(),strip:E1(),figures:B2(),lines:n6(),wrap:p6(),entriesToDisplay:s6()}});var n=X((rU,e6)=>{var a6=f("readline"),{action:c7}=O(),m7=f("events"),{beep:l7,cursor:n7}=A(),i7=S();class o6 extends m7{constructor(F={}){super();this.firstRender=!0,this.in=F.stdin||process.stdin,this.out=F.stdout||process.stdout,this.onRender=(F.onRender||(()=>{return})).bind(this);let _=a6.createInterface({input:this.in,escapeCodeTimeout:50});if(a6.emitKeypressEvents(this.in,_),this.in.isTTY)this.in.setRawMode(!0);let E=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,$=(B,D)=>{let U=c7(D,E);if(U===!1)this._&&this._(B,D);else if(typeof this[U]==="function")this[U](D);else this.bell()};this.close=()=>{if(this.out.write(n7.show),this.in.removeListener("keypress",$),this.in.isTTY)this.in.setRawMode(!1);_.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",$)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(l7)}render(){if(this.onRender(i7),this.firstRender)this.firstRender=!1}}e6.exports=o6});var E5=X((aU,_5)=>{var $1=S(),p7=n(),{erase:t7,cursor:P0}=A(),{style:U2,clear:z2,lines:s7,figures:r7}=O();class F5 extends p7{constructor(F={}){super(F);this.transform=U2.render(F.style),this.scale=this.transform.scale,this.msg=F.message,this.initial=F.initial||"",this.validator=F.validate||(()=>!0),this.value="",this.errorMsg=F.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=z2("",this.out.columns),this.render()}set value(F){if(!F&&this.initial)this.placeholder=!0,this.rendered=$1.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render(F);this._value=F,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
79
|
+
`),this.close()}async validate(){let F=await this.validator(this.value);if(typeof F==="string")this.errorMsg=F,F=!1;this.error=!F}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
80
|
+
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(F){if(this.placeholder)return;this.cursor=this.cursor+F,this.cursorOffset+=F}_(F,_){let E=this.value.slice(0,this.cursor),$=this.value.slice(this.cursor);this.value=`${E}${F}${$}`,this.red=!1,this.cursor=this.placeholder?0:E.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let F=this.value.slice(0,this.cursor-1),_=this.value.slice(this.cursor);if(this.value=`${F}${_}`,this.red=!1,this.isCursorAtStart())this.cursorOffset=0;else this.cursorOffset++,this.moveCursor(-1);this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let F=this.value.slice(0,this.cursor),_=this.value.slice(this.cursor+1);if(this.value=`${F}${_}`,this.red=!1,this.isCursorAtEnd())this.cursorOffset=0;else this.cursorOffset++;this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(P0.down(s7(this.outputError,this.out.columns)-1)+z2(this.outputError,this.out.columns));this.out.write(z2(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[U2.symbol(this.done,this.aborted),$1.bold(this.msg),U2.delimiter(this.done),this.red?$1.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
|
|
81
|
+
`).reduce((F,_,E)=>F+`
|
|
82
|
+
${E?" ":r7.pointerSmall} ${$1.red().italic(_)}`,"");this.out.write(t7.line+P0.to(0)+this.outputText+P0.save+this.outputError+P0.restore+P0.move(this.cursorOffset,0))}}_5.exports=F5});var z5=X((oU,U5)=>{var i=S(),a7=n(),{style:$5,clear:B5,figures:B1,wrap:o7,entriesToDisplay:e7}=O(),{cursor:FE}=A();class D5 extends a7{constructor(F={}){super(F);this.msg=F.message,this.hint=F.hint||"- Use arrow-keys. Return to submit.",this.warn=F.warn||"- This option is disabled",this.cursor=F.initial||0,this.choices=F.choices.map((_,E)=>{if(typeof _==="string")_={title:_,value:E};return{title:_&&(_.title||_.value||_),value:_&&(_.value===void 0?E:_.value),description:_&&_.description,selected:_&&_.selected,disabled:_&&_.disabled}}),this.optionsPerPage=F.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=B5("",this.out.columns),this.render()}moveCursor(F){this.cursor=F,this.value=this.choices[F].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
83
|
+
`),this.close()}submit(){if(!this.selection.disabled)this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
84
|
+
`),this.close();else this.bell()}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){if(this.cursor===0)this.moveCursor(this.choices.length-1);else this.moveCursor(this.cursor-1);this.render()}down(){if(this.cursor===this.choices.length-1)this.moveCursor(0);else this.moveCursor(this.cursor+1);this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(F,_){if(F===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(FE.hide);else this.out.write(B5(this.outputText,this.out.columns));super.render();let{startIndex:F,endIndex:_}=e7(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[$5.symbol(this.done,this.aborted),i.bold(this.msg),$5.delimiter(!1),this.done?this.selection.title:this.selection.disabled?i.yellow(this.warn):i.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
85
|
+
`;for(let E=F;E<_;E++){let $,B,D="",U=this.choices[E];if(E===F&&F>0)B=B1.arrowUp;else if(E===_-1&&_<this.choices.length)B=B1.arrowDown;else B=" ";if(U.disabled)$=this.cursor===E?i.gray().underline(U.title):i.strikethrough().gray(U.title),B=(this.cursor===E?i.bold().gray(B1.pointer)+" ":" ")+B;else if($=this.cursor===E?i.cyan().underline(U.title):U.title,B=(this.cursor===E?i.cyan(B1.pointer)+" ":" ")+B,U.description&&this.cursor===E){if(D=` - ${U.description}`,B.length+$.length+D.length>=this.out.columns||U.description.split(/\r?\n/).length>1)D=`
|
|
86
|
+
`+o7(U.description,{margin:3,width:this.out.columns})}this.outputText+=`${B} ${$}${i.gray(D)}
|
|
87
|
+
`}}this.out.write(this.outputText)}}U5.exports=D5});var J5=X((eU,X5)=>{var D1=S(),_E=n(),{style:H5,clear:EE}=O(),{cursor:M5,erase:$E}=A();class R5 extends _E{constructor(F={}){super(F);this.msg=F.message,this.value=!!F.initial,this.active=F.active||"on",this.inactive=F.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
88
|
+
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
89
|
+
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(F,_){if(F===" ")this.value=!this.value;else if(F==="1")this.value=!0;else if(F==="0")this.value=!1;else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(M5.hide);else this.out.write(EE(this.outputText,this.out.columns));super.render(),this.outputText=[H5.symbol(this.done,this.aborted),D1.bold(this.msg),H5.delimiter(this.done),this.value?this.inactive:D1.cyan().underline(this.inactive),D1.gray("/"),this.value?D1.cyan().underline(this.active):this.active].join(" "),this.out.write($E.line+M5.to(0)+this.outputText)}}X5.exports=R5});var h=X((Fz,Y5)=>{class U1{constructor({token:F,date:_,parts:E,locales:$}){this.token=F,this.date=_||new Date,this.parts=E||[this],this.locales=$||{}}up(){}down(){}next(){let F=this.parts.indexOf(this);return this.parts.find((_,E)=>E>F&&_ instanceof U1)}setTo(F){}prev(){let F=[].concat(this.parts).reverse(),_=F.indexOf(this);return F.find((E,$)=>$>_&&E instanceof U1)}toString(){return String(this.date)}}Y5.exports=U1});var G5=X((_z,Q5)=>{var BE=h();class Z5 extends BE{constructor(F={}){super(F)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let F=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?F.toUpperCase():F}}Q5.exports=Z5});var L5=X((Ez,W5)=>{var DE=h(),UE=(F)=>{return F=F%10,F===1?"st":F===2?"nd":F===3?"rd":"th"};class K5 extends DE{constructor(F={}){super(F)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(F){this.date.setDate(parseInt(F.substr(-2)))}toString(){let F=this.date.getDate(),_=this.date.getDay();return this.token==="DD"?String(F).padStart(2,"0"):this.token==="Do"?F+UE(F):this.token==="d"?_+1:this.token==="ddd"?this.locales.weekdaysShort[_]:this.token==="dddd"?this.locales.weekdays[_]:F}}W5.exports=K5});var I5=X(($z,A5)=>{var zE=h();class S5 extends zE{constructor(F={}){super(F)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(F){this.date.setHours(parseInt(F.substr(-2)))}toString(){let F=this.date.getHours();if(/h/.test(this.token))F=F%12||12;return this.token.length>1?String(F).padStart(2,"0"):F}}A5.exports=S5});var V5=X((Bz,N5)=>{var HE=h();class q5 extends HE{constructor(F={}){super(F)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(F){this.date.setMilliseconds(parseInt(F.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}N5.exports=q5});var T5=X((Dz,j5)=>{var ME=h();class C5 extends ME{constructor(F={}){super(F)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(F){this.date.setMinutes(parseInt(F.substr(-2)))}toString(){let F=this.date.getMinutes();return this.token.length>1?String(F).padStart(2,"0"):F}}j5.exports=C5});var w5=X((Uz,O5)=>{var RE=h();class P5 extends RE{constructor(F={}){super(F)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(F){F=parseInt(F.substr(-2))-1,this.date.setMonth(F<0?0:F)}toString(){let F=this.date.getMonth(),_=this.token.length;return _===2?String(F+1).padStart(2,"0"):_===3?this.locales.monthsShort[F]:_===4?this.locales.months[F]:String(F+1)}}O5.exports=P5});var b5=X((zz,k5)=>{var XE=h();class f5 extends XE{constructor(F={}){super(F)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(F){this.date.setSeconds(parseInt(F.substr(-2)))}toString(){let F=this.date.getSeconds();return this.token.length>1?String(F).padStart(2,"0"):F}}k5.exports=f5});var h5=X((Hz,y5)=>{var JE=h();class x5 extends JE{constructor(F={}){super(F)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(F){this.date.setFullYear(F.substr(-4))}toString(){let F=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?F.substr(-2):F}}y5.exports=x5});var u5=X((Mz,v5)=>{v5.exports={DatePart:h(),Meridiem:G5(),Day:L5(),Hours:I5(),Milliseconds:V5(),Minutes:T5(),Month:w5(),Seconds:b5(),Year:h5()}});var p5=X((Rz,i5)=>{var H2=S(),YE=n(),{style:g5,clear:d5,figures:ZE}=O(),{erase:QE,cursor:c5}=A(),{DatePart:m5,Meridiem:GE,Day:KE,Hours:WE,Milliseconds:LE,Minutes:SE,Month:AE,Seconds:IE,Year:qE}=u5(),NE=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,l5={1:({token:F})=>F.replace(/\\(.)/g,"$1"),2:(F)=>new KE(F),3:(F)=>new AE(F),4:(F)=>new qE(F),5:(F)=>new GE(F),6:(F)=>new WE(F),7:(F)=>new SE(F),8:(F)=>new IE(F),9:(F)=>new LE(F)},VE={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class n5 extends YE{constructor(F={}){super(F);this.msg=F.message,this.cursor=0,this.typed="",this.locales=Object.assign(VE,F.locales),this._date=F.initial||new Date,this.errorMsg=F.error||"Please Enter A Valid Value",this.validator=F.validate||(()=>!0),this.mask=F.mask||"YYYY-MM-DD HH:mm:ss",this.clear=d5("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(F){if(F)this._date.setTime(F.getTime())}set mask(F){let _;this.parts=[];while(_=NE.exec(F)){let $=_.shift(),B=_.findIndex((D)=>D!=null);this.parts.push(B in l5?l5[B]({token:_[B]||$,date:this.date,parts:this.parts,locales:this.locales}):_[B]||$)}let E=this.parts.reduce(($,B)=>{if(typeof B==="string"&&typeof $[$.length-1]==="string")$[$.length-1]+=B;else $.push(B);return $},[]);this.parts.splice(0),this.parts.push(...E),this.reset()}moveCursor(F){this.typed="",this.cursor=F,this.fire()}reset(){this.moveCursor(this.parts.findIndex((F)=>F instanceof m5)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
90
|
+
`),this.close()}async validate(){let F=await this.validator(this.value);if(typeof F==="string")this.errorMsg=F,F=!1;this.error=!F}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
91
|
+
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let F=this.parts[this.cursor].prev();if(F==null)return this.bell();this.moveCursor(this.parts.indexOf(F)),this.render()}right(){let F=this.parts[this.cursor].next();if(F==null)return this.bell();this.moveCursor(this.parts.indexOf(F)),this.render()}next(){let F=this.parts[this.cursor].next();this.moveCursor(F?this.parts.indexOf(F):this.parts.findIndex((_)=>_ instanceof m5)),this.render()}_(F){if(/\d/.test(F))this.typed+=F,this.parts[this.cursor].setTo(this.typed),this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(c5.hide);else this.out.write(d5(this.outputText,this.out.columns));if(super.render(),this.outputText=[g5.symbol(this.done,this.aborted),H2.bold(this.msg),g5.delimiter(!1),this.parts.reduce((F,_,E)=>F.concat(E===this.cursor&&!this.done?H2.cyan().underline(_.toString()):_),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split(`
|
|
92
|
+
`).reduce((F,_,E)=>F+`
|
|
93
|
+
${E?" ":ZE.pointerSmall} ${H2.red().italic(_)}`,"");this.out.write(QE.line+c5.to(0)+this.outputText)}}i5.exports=n5});var o5=X((Xz,a5)=>{var z1=S(),CE=n(),{cursor:H1,erase:jE}=A(),{style:M2,figures:TE,clear:t5,lines:PE}=O(),OE=/[0-9]/,R2=(F)=>F!==void 0,s5=(F,_)=>{let E=Math.pow(10,_);return Math.round(F*E)/E};class r5 extends CE{constructor(F={}){super(F);this.transform=M2.render(F.style),this.msg=F.message,this.initial=R2(F.initial)?F.initial:"",this.float=!!F.float,this.round=F.round||2,this.inc=F.increment||1,this.min=R2(F.min)?F.min:-1/0,this.max=R2(F.max)?F.max:1/0,this.errorMsg=F.error||"Please Enter A Valid Value",this.validator=F.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(F){if(!F&&F!==0)this.placeholder=!0,this.rendered=z1.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${s5(F,this.round)}`),this._value=s5(F,this.round);this.fire()}get value(){return this._value}parse(F){return this.float?parseFloat(F):parseInt(F)}valid(F){return F==="-"||F==="."&&this.float||OE.test(F)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let F=this.value;this.value=F!==""?F:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
94
|
+
`),this.close()}async validate(){let F=await this.validator(this.value);if(typeof F==="string")this.errorMsg=F,F=!1;this.error=!F}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let F=this.value;this.value=F!==""?F:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
95
|
+
`),this.close()}up(){if(this.typed="",this.value==="")this.value=this.min-this.inc;if(this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value==="")this.value=this.min+this.inc;if(this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let F=this.value.toString();if(F.length===0)return this.bell();if(this.value=this.parse(F=F.slice(0,-1))||"",this.value!==""&&this.value<this.min)this.value=this.min;this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(F,_){if(!this.valid(F))return this.bell();let E=Date.now();if(E-this.lastHit>1000)this.typed="";if(this.typed+=F,this.lastHit=E,this.color="cyan",F===".")return this.fire();if(this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire(),this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(H1.down(PE(this.outputError,this.out.columns)-1)+t5(this.outputError,this.out.columns));this.out.write(t5(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[M2.symbol(this.done,this.aborted),z1.bold(this.msg),M2.delimiter(this.done),!this.done||!this.done&&!this.placeholder?z1[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
|
|
96
|
+
`).reduce((F,_,E)=>F+`
|
|
97
|
+
${E?" ":TE.pointerSmall} ${z1.red().italic(_)}`,"");this.out.write(jE.line+H1.to(0)+this.outputText+H1.save+this.outputError+H1.restore)}}a5.exports=r5});var X2=X((Jz,E4)=>{var v=S(),{cursor:wE}=A(),fE=n(),{clear:e5,figures:a,style:F4,wrap:kE,entriesToDisplay:bE}=O();class _4 extends fE{constructor(F={}){super(F);if(this.msg=F.message,this.cursor=F.cursor||0,this.scrollIndex=F.cursor||0,this.hint=F.hint||"",this.warn=F.warn||"- This option is disabled -",this.minSelected=F.min,this.showMinError=!1,this.maxChoices=F.max,this.instructions=F.instructions,this.optionsPerPage=F.optionsPerPage||10,this.value=F.choices.map((_,E)=>{if(typeof _==="string")_={title:_,value:E};return{title:_&&(_.title||_.value||_),description:_&&_.description,value:_&&(_.value===void 0?E:_.value),selected:_&&_.selected,disabled:_&&_.disabled}}),this.clear=e5("",this.out.columns),!F.overrideRender)this.render()}reset(){this.value.map((F)=>!F.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((F)=>F.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
98
|
+
`),this.close()}submit(){let F=this.value.filter((_)=>_.selected);if(this.minSelected&&F.length<this.minSelected)this.showMinError=!0,this.render();else this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
99
|
+
`),this.close()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){if(this.cursor===0)this.cursor=this.value.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.value.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((F)=>F.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let F=this.value[this.cursor];if(F.selected)F.selected=!1,this.render();else if(F.disabled||this.value.filter((_)=>_.selected).length>=this.maxChoices)return this.bell();else F.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let F=!this.value[this.cursor].selected;this.value.filter((_)=>!_.disabled).forEach((_)=>_.selected=F),this.render()}_(F,_){if(F===" ")this.handleSpaceToggle();else if(F==="a")this.toggleAll();else return this.bell()}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
|
|
100
|
+
Instructions:
|
|
101
|
+
${a.arrowUp}/${a.arrowDown}: Highlight option
|
|
102
|
+
${a.arrowLeft}/${a.arrowRight}/[space]: Toggle selection
|
|
103
|
+
`+(this.maxChoices===void 0?` a: Toggle all
|
|
104
|
+
`:"")+" enter/return: Complete answer"}return""}renderOption(F,_,E,$){let B=(_.selected?v.green(a.radioOn):a.radioOff)+" "+$+" ",D,U;if(_.disabled)D=F===E?v.gray().underline(_.title):v.strikethrough().gray(_.title);else if(D=F===E?v.cyan().underline(_.title):_.title,F===E&&_.description){if(U=` - ${_.description}`,B.length+D.length+U.length>=this.out.columns||_.description.split(/\r?\n/).length>1)U=`
|
|
105
|
+
`+kE(_.description,{margin:B.length,width:this.out.columns})}return B+D+v.gray(U||"")}paginateOptions(F){if(F.length===0)return v.red("No matches for this query.");let{startIndex:_,endIndex:E}=bE(this.cursor,F.length,this.optionsPerPage),$,B=[];for(let D=_;D<E;D++){if(D===_&&_>0)$=a.arrowUp;else if(D===E-1&&E<F.length)$=a.arrowDown;else $=" ";B.push(this.renderOption(this.cursor,F[D],D,$))}return`
|
|
106
|
+
`+B.join(`
|
|
107
|
+
`)}renderOptions(F){if(!this.done)return this.paginateOptions(F);return""}renderDoneOrInstructions(){if(this.done)return this.value.filter((_)=>_.selected).map((_)=>_.title).join(", ");let F=[v.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)F.push(v.yellow(this.warn));return F.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(wE.hide);super.render();let F=[F4.symbol(this.done,this.aborted),v.bold(this.msg),F4.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)F+=v.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;F+=this.renderOptions(this.value),this.out.write(this.clear+F),this.clear=e5(F,this.out.columns)}}E4.exports=_4});var H4=X((Yz,z4)=>{var O0=S(),xE=n(),{erase:yE,cursor:$4}=A(),{style:J2,clear:B4,figures:Y2,wrap:hE,entriesToDisplay:vE}=O(),D4=(F,_)=>F[_]&&(F[_].value||F[_].title||F[_]),uE=(F,_)=>F[_]&&(F[_].title||F[_].value||F[_]),gE=(F,_)=>{let E=F.findIndex(($)=>$.value===_||$.title===_);return E>-1?E:void 0};class U4 extends xE{constructor(F={}){super(F);this.msg=F.message,this.suggest=F.suggest,this.choices=F.choices,this.initial=typeof F.initial==="number"?F.initial:gE(F.choices,F.initial),this.select=this.initial||F.cursor||0,this.i18n={noMatches:F.noMatches||"no matches found"},this.fallback=F.fallback||this.initial,this.clearFirst=F.clearFirst||!1,this.suggestions=[],this.input="",this.limit=F.limit||10,this.cursor=0,this.transform=J2.render(F.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=B4("",this.out.columns),this.complete(this.render),this.render()}set fallback(F){this._fb=Number.isSafeInteger(parseInt(F))?parseInt(F):F}get fallback(){let F;if(typeof this._fb==="number")F=this.choices[this._fb];else if(typeof this._fb==="string")F={title:this._fb};return F||this._fb||{title:this.i18n.noMatches}}moveSelect(F){if(this.select=F,this.suggestions.length>0)this.value=D4(this.suggestions,F);else this.value=this.fallback.value;this.fire()}async complete(F){let _=this.completing=this.suggest(this.input,this.choices),E=await _;if(this.completing!==_)return;this.suggestions=E.map((B,D,U)=>({title:uE(U,D),value:D4(U,D),description:B.description})),this.completing=!1;let $=Math.max(E.length-1,0);this.moveSelect(Math.min($,this.select)),F&&F()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){if(this.clearFirst&&this.input.length>0)this.reset();else this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
108
|
+
`),this.close()}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
109
|
+
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
110
|
+
`),this.close()}_(F,_){let E=this.input.slice(0,this.cursor),$=this.input.slice(this.cursor);this.input=`${E}${F}${$}`,this.cursor=E.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let F=this.input.slice(0,this.cursor-1),_=this.input.slice(this.cursor);this.input=`${F}${_}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let F=this.input.slice(0,this.cursor),_=this.input.slice(this.cursor+1);this.input=`${F}${_}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){if(this.select===0)this.moveSelect(this.suggestions.length-1);else this.moveSelect(this.select-1);this.render()}down(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}next(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(F,_,E,$){let B,D=E?Y2.arrowUp:$?Y2.arrowDown:" ",U=_?O0.cyan().underline(F.title):F.title;if(D=(_?O0.cyan(Y2.pointer)+" ":" ")+D,F.description){if(B=` - ${F.description}`,D.length+U.length+B.length>=this.out.columns||F.description.split(/\r?\n/).length>1)B=`
|
|
111
|
+
`+hE(F.description,{margin:3,width:this.out.columns})}return D+" "+U+O0.gray(B||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write($4.hide);else this.out.write(B4(this.outputText,this.out.columns));super.render();let{startIndex:F,endIndex:_}=vE(this.select,this.choices.length,this.limit);if(this.outputText=[J2.symbol(this.done,this.aborted,this.exited),O0.bold(this.msg),J2.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let E=this.suggestions.slice(F,_).map(($,B)=>this.renderOption($,this.select===B+F,B===0&&F>0,B+F===_-1&&_<this.choices.length)).join(`
|
|
112
|
+
`);this.outputText+=`
|
|
113
|
+
`+(E||O0.gray(this.fallback.title))}this.out.write(yE.line+$4.to(0)+this.outputText)}}z4.exports=U4});var Y4=X((Zz,J4)=>{var p=S(),{cursor:dE}=A(),cE=X2(),{clear:M4,style:R4,figures:X0}=O();class X4 extends cE{constructor(F={}){F.overrideRender=!0;super(F);this.inputValue="",this.clear=M4("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){if(this.cursor===0)this.cursor=this.filteredOptions.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.filteredOptions.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((F)=>F.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){if(this.inputValue.length)this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions()}updateFilteredOptions(){let F=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((E)=>{if(this.inputValue){if(typeof E.title==="string"){if(E.title.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}if(typeof E.value==="string"){if(E.value.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}return!1}return!0});let _=this.filteredOptions.findIndex((E)=>E===F);this.cursor=_<0?0:_,this.render()}handleSpaceToggle(){let F=this.filteredOptions[this.cursor];if(F.selected)F.selected=!1,this.render();else if(F.disabled||this.value.filter((_)=>_.selected).length>=this.maxChoices)return this.bell();else F.selected=!0,this.render()}handleInputChange(F){this.inputValue=this.inputValue+F,this.updateFilteredOptions()}_(F,_){if(F===" ")this.handleSpaceToggle();else this.handleInputChange(F)}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
|
|
114
|
+
Instructions:
|
|
115
|
+
${X0.arrowUp}/${X0.arrowDown}: Highlight option
|
|
116
|
+
${X0.arrowLeft}/${X0.arrowRight}/[space]: Toggle selection
|
|
117
|
+
[a,b,c]/delete: Filter choices
|
|
118
|
+
enter/return: Complete answer
|
|
119
|
+
`}return""}renderCurrentInput(){return`
|
|
120
|
+
Filtered results for: ${this.inputValue?this.inputValue:p.gray("Enter something to filter")}
|
|
121
|
+
`}renderOption(F,_,E){let $;if(_.disabled)$=F===E?p.gray().underline(_.title):p.strikethrough().gray(_.title);else $=F===E?p.cyan().underline(_.title):_.title;return(_.selected?p.green(X0.radioOn):X0.radioOff)+" "+$}renderDoneOrInstructions(){if(this.done)return this.value.filter((_)=>_.selected).map((_)=>_.title).join(", ");let F=[p.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled)F.push(p.yellow(this.warn));return F.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(dE.hide);super.render();let F=[R4.symbol(this.done,this.aborted),p.bold(this.msg),R4.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)F+=p.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;F+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+F),this.clear=M4(F,this.out.columns)}}J4.exports=X4});var L4=X((Qz,W4)=>{var Z4=S(),mE=n(),{style:Q4,clear:lE}=O(),{erase:nE,cursor:G4}=A();class K4 extends mE{constructor(F={}){super(F);this.msg=F.message,this.value=F.initial,this.initialValue=!!F.initial,this.yesMsg=F.yes||"yes",this.yesOption=F.yesOption||"(Y/n)",this.noMsg=F.no||"no",this.noOption=F.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
122
|
+
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
123
|
+
`),this.close()}_(F,_){if(F.toLowerCase()==="y")return this.value=!0,this.submit();if(F.toLowerCase()==="n")return this.value=!1,this.submit();return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(G4.hide);else this.out.write(lE(this.outputText,this.out.columns));super.render(),this.outputText=[Q4.symbol(this.done,this.aborted),Z4.bold(this.msg),Q4.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Z4.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(nE.line+G4.to(0)+this.outputText)}}W4.exports=K4});var A4=X((Gz,S4)=>{S4.exports={TextPrompt:E5(),SelectPrompt:z5(),TogglePrompt:J5(),DatePrompt:p5(),NumberPrompt:o5(),MultiselectPrompt:X2(),AutocompletePrompt:H4(),AutocompleteMultiselectPrompt:Y4(),ConfirmPrompt:L4()}});var q4=X((I4)=>{var N=I4,iE=A4(),M1=(F)=>F;function u(F,_,E={}){return new Promise(($,B)=>{let D=new iE[F](_),U=E.onAbort||M1,z=E.onSubmit||M1,M=E.onExit||M1;D.on("state",_.onState||M1),D.on("submit",(H)=>$(z(H))),D.on("exit",(H)=>$(M(H))),D.on("abort",(H)=>B(U(H)))})}N.text=(F)=>u("TextPrompt",F);N.password=(F)=>{return F.style="password",N.text(F)};N.invisible=(F)=>{return F.style="invisible",N.text(F)};N.number=(F)=>u("NumberPrompt",F);N.date=(F)=>u("DatePrompt",F);N.confirm=(F)=>u("ConfirmPrompt",F);N.list=(F)=>{let _=F.separator||",";return u("TextPrompt",F,{onSubmit:(E)=>E.split(_).map(($)=>$.trim())})};N.toggle=(F)=>u("TogglePrompt",F);N.select=(F)=>u("SelectPrompt",F);N.multiselect=(F)=>{F.choices=[].concat(F.choices||[]);let _=(E)=>E.filter(($)=>$.selected).map(($)=>$.value);return u("MultiselectPrompt",F,{onAbort:_,onSubmit:_})};N.autocompleteMultiselect=(F)=>{F.choices=[].concat(F.choices||[]);let _=(E)=>E.filter(($)=>$.selected).map(($)=>$.value);return u("AutocompleteMultiselectPrompt",F,{onAbort:_,onSubmit:_})};var pE=(F,_)=>Promise.resolve(_.filter((E)=>E.title.slice(0,F.length).toLowerCase()===F.toLowerCase()));N.autocomplete=(F)=>{return F.suggest=F.suggest||pE,F.choices=[].concat(F.choices||[]),u("AutocompletePrompt",F)}});var C4=X((Wz,V4)=>{var Z2=q4(),tE=["suggest","format","onState","validate","onRender","type"],N4=()=>{};async function o(F=[],{onSubmit:_=N4,onCancel:E=N4}={}){let $={},B=o._override||{};F=[].concat(F);let D,U,z,M,H,R,J=async(G,I,e=!1)=>{if(!e&&G.validate&&G.validate(I)!==!0)return;return G.format?await G.format(I,$):I};for(U of F){if({name:M,type:H}=U,typeof H==="function")H=await H(D,{...$},U),U.type=H;if(!H)continue;for(let G in U){if(tE.includes(G))continue;let I=U[G];U[G]=typeof I==="function"?await I(D,{...$},R):I}if(R=U,typeof U.message!=="string")throw Error("prompt message is required");if({name:M,type:H}=U,Z2[H]===void 0)throw Error(`prompt type (${H}) is not defined`);if(B[U.name]!==void 0){if(D=await J(U,B[U.name]),D!==void 0){$[M]=D;continue}}try{D=o._injected?sE(o._injected,U.initial):await Z2[H](U),$[M]=D=await J(U,D,!0),z=await _(U,D,$)}catch(G){z=!await E(U,$)}if(z)return $}return $}function sE(F,_){let E=F.shift();if(E instanceof Error)throw E;return E===void 0?_:E}function rE(F){o._injected=(o._injected||[]).concat(F)}function aE(F){o._override=Object.assign({},F)}V4.exports=Object.assign(o,{prompt:o,prompts:Z2,inject:rE,override:aE})});var Q2=X((Lz,j4)=>{function oE(F){F=(Array.isArray(F)?F:F.split(".")).map(Number);let _=0,E=process.versions.node.split(".").map(Number);for(;_<F.length;_++){if(E[_]>F[_])return!1;if(F[_]>E[_])return!0}return!1}j4.exports=oE("8.6.0")?b6():C4()});var s4=X((Oz,Q1)=>{function g4(F){return Array.isArray(F)?F:[F]}var $$=void 0,W2="",v4=" ",K2="\\",B$=/^\s+$/,D$=/(?:[^\\]|^)\\$/,U$=/^\\!/,z$=/^\\#/,H$=/\r?\n/g,M$=/^\.{0,2}\/|^\.{1,2}$/,R$=/\/$/,J0="/",d4="node-ignore";if(typeof Symbol<"u")d4=Symbol.for("node-ignore");var c4=d4,Y0=(F,_,E)=>{return Object.defineProperty(F,_,{value:E}),E},X$=/([0-z])-([0-z])/g,m4=()=>!1,J$=(F)=>F.replace(X$,(_,E,$)=>E.charCodeAt(0)<=$.charCodeAt(0)?_:W2),Y$=(F)=>{let{length:_}=F;return F.slice(0,_-_%2)},Z$=[[/^\uFEFF/,()=>W2],[/((?:\\\\)*?)(\\?\s+)$/,(F,_,E)=>_+(E.indexOf("\\")===0?v4:W2)],[/(\\+?)\s/g,(F,_)=>{let{length:E}=_;return _.slice(0,E-E%2)+v4}],[/[\\$.|*+(){^]/g,(F)=>`\\${F}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(F,_,E)=>_+6<E.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(F,_,E)=>{let $=E.replace(/\\\*/g,"[^\\/]*");return _+$}],[/\\\\\\(?=[$.|*+(){^])/g,()=>K2],[/\\\\/g,()=>K2],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(F,_,E,$,B)=>_===K2?`\\[${E}${Y$($)}${B}`:B==="]"?$.length%2===0?`[${J$(E)}${$}]`:"[]":"[]"],[/(?:[^*])$/,(F)=>/\/$/.test(F)?`${F}$`:`${F}(?=$|\\/$)`]],Q$=/(^|\\\/)?\\\*$/,f0="regex",Y1="checkRegex",u4="_",G$={[f0](F,_){return`${_?`${_}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Y1](F,_){return`${_?`${_}[^/]*`:"[^/]*"}(?=$|\\/$)`}},K$=(F)=>Z$.reduce((_,[E,$])=>_.replace(E,$.bind(F)),F),Z1=(F)=>typeof F==="string",W$=(F)=>F&&Z1(F)&&!B$.test(F)&&!D$.test(F)&&F.indexOf("#")!==0,L$=(F)=>F.split(H$).filter(Boolean);class l4{constructor(F,_,E,$,B,D){this.pattern=F,this.mark=_,this.negative=B,Y0(this,"body",E),Y0(this,"ignoreCase",$),Y0(this,"regexPrefix",D)}get regex(){let F=u4+f0;if(this[F])return this[F];return this._make(f0,F)}get checkRegex(){let F=u4+Y1;if(this[F])return this[F];return this._make(Y1,F)}_make(F,_){let E=this.regexPrefix.replace(Q$,G$[F]),$=this.ignoreCase?new RegExp(E,"i"):new RegExp(E);return Y0(this,_,$)}}var S$=({pattern:F,mark:_},E)=>{let $=!1,B=F;if(B.indexOf("!")===0)$=!0,B=B.substr(1);B=B.replace(U$,"!").replace(z$,"#");let D=K$(B);return new l4(F,_,B,E,$,D)};class n4{constructor(F){this._ignoreCase=F,this._rules=[]}_add(F){if(F&&F[c4]){this._rules=this._rules.concat(F._rules._rules),this._added=!0;return}if(Z1(F))F={pattern:F};if(W$(F.pattern)){let _=S$(F,this._ignoreCase);this._added=!0,this._rules.push(_)}}add(F){return this._added=!1,g4(Z1(F)?L$(F):F).forEach(this._add,this),this._added}test(F,_,E){let $=!1,B=!1,D;this._rules.forEach((z)=>{let{negative:M}=z;if(B===M&&$!==B||M&&!$&&!B&&!_)return;if(!z[E].test(F))return;$=!M,B=M,D=M?$$:z});let U={ignored:$,unignored:B};if(D)U.rule=D;return U}}var A$=(F,_)=>{throw new _(F)},t=(F,_,E)=>{if(!Z1(F))return E(`path must be a string, but got \`${_}\``,TypeError);if(!F)return E("path must not be empty",TypeError);if(t.isNotRelative(F))return E(`path should be a \`path.relative()\`d string, but got "${_}"`,RangeError);return!0},i4=(F)=>M$.test(F);t.isNotRelative=i4;t.convert=(F)=>F;class p4{constructor({ignorecase:F=!0,ignoreCase:_=F,allowRelativePaths:E=!1}={}){Y0(this,c4,!0),this._rules=new n4(_),this._strictPathCheck=!E,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(F){if(this._rules.add(F))this._initCache();return this}addPattern(F){return this.add(F)}_test(F,_,E,$){let B=F&&t.convert(F);return t(B,F,this._strictPathCheck?A$:m4),this._t(B,_,E,$)}checkIgnore(F){if(!R$.test(F))return this.test(F);let _=F.split(J0).filter(Boolean);if(_.pop(),_.length){let E=this._t(_.join(J0)+J0,this._testCache,!0,_);if(E.ignored)return E}return this._rules.test(F,!1,Y1)}_t(F,_,E,$){if(F in _)return _[F];if(!$)$=F.split(J0).filter(Boolean);if($.pop(),!$.length)return _[F]=this._rules.test(F,E,f0);let B=this._t($.join(J0)+J0,_,E,$);return _[F]=B.ignored?B:this._rules.test(F,E,f0)}ignores(F){return this._test(F,this._ignoreCache,!1).ignored}createFilter(){return(F)=>!this.ignores(F)}filter(F){return g4(F).filter(this.createFilter())}test(F){return this._test(F,this._testCache,!0)}}var L2=(F)=>new p4(F),I$=(F)=>t(F&&t.convert(F),F,m4),t4=()=>{let F=(E)=>/^\\\\\?\\/.test(E)||/["<>|\u0000-\u001F]+/u.test(E)?E:E.replace(/\\/g,"/");t.convert=F;let _=/^[a-z]:\//i;t.isNotRelative=(E)=>_.test(E)||i4(E)};if(typeof process<"u"&&process.platform==="win32")t4();Q1.exports=L2;L2.default=L2;Q1.exports.isPathValid=I$;Y0(Q1.exports,Symbol.for("setupWindows"),t4)});import{resolve as n$}from"node:path";import{cwd as i$}from"node:process";var v2=x0(h2(),1),{program:j,createCommand:$B,createArgument:BB,createOption:DB,CommanderError:UB,InvalidArgumentError:zB,InvalidOptionArgumentError:HB,Command:MB,Argument:RB,Option:XB,Help:JB}=v2.default;import n0 from"node:process";var u2=(F=0)=>(_)=>`\x1B[${_+F}m`,g2=(F=0)=>(_)=>`\x1B[${38+F};5;${_}m`,d2=(F=0)=>(_,E,$)=>`\x1B[${38+F};2;${_};${E};${$}m`,W={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},ZB=Object.keys(W.modifier),U9=Object.keys(W.color),z9=Object.keys(W.bgColor),QB=[...U9,...z9];function H9(){let F=new Map;for(let[_,E]of Object.entries(W)){for(let[$,B]of Object.entries(E))W[$]={open:`\x1B[${B[0]}m`,close:`\x1B[${B[1]}m`},E[$]=W[$],F.set(B[0],B[1]);Object.defineProperty(W,_,{value:E,enumerable:!1})}return Object.defineProperty(W,"codes",{value:F,enumerable:!1}),W.color.close="\x1B[39m",W.bgColor.close="\x1B[49m",W.color.ansi=u2(),W.color.ansi256=g2(),W.color.ansi16m=d2(),W.bgColor.ansi=u2(10),W.bgColor.ansi256=g2(10),W.bgColor.ansi16m=d2(10),Object.defineProperties(W,{rgbToAnsi256:{value(_,E,$){if(_===E&&E===$){if(_<8)return 16;if(_>248)return 231;return Math.round((_-8)/247*24)+232}return 16+36*Math.round(_/255*5)+6*Math.round(E/255*5)+Math.round($/255*5)},enumerable:!1},hexToRgb:{value(_){let E=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!E)return[0,0,0];let[$]=E;if($.length===3)$=[...$].map((D)=>D+D).join("");let B=Number.parseInt($,16);return[B>>16&255,B>>8&255,B&255]},enumerable:!1},hexToAnsi256:{value:(_)=>W.rgbToAnsi256(...W.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value(_){if(_<8)return 30+_;if(_<16)return 90+(_-8);let E,$,B;if(_>=232)E=((_-232)*10+8)/255,$=E,B=E;else{_-=16;let z=_%36;E=Math.floor(_/36)/5,$=Math.floor(z/6)/5,B=z%6/5}let D=Math.max(E,$,B)*2;if(D===0)return 30;let U=30+(Math.round(B)<<2|Math.round($)<<1|Math.round(E));if(D===2)U+=60;return U},enumerable:!1},rgbToAnsi:{value:(_,E,$)=>W.ansi256ToAnsi(W.rgbToAnsi256(_,E,$)),enumerable:!1},hexToAnsi:{value:(_)=>W.ansi256ToAnsi(W.hexToAnsi256(_)),enumerable:!1}}),W}var M9=H9(),T=M9;import j1 from"node:process";import R9 from"node:os";import c2 from"node:tty";function V(F,_=globalThis.Deno?globalThis.Deno.args:j1.argv){let E=F.startsWith("-")?"":F.length===1?"-":"--",$=_.indexOf(E+F),B=_.indexOf("--");return $!==-1&&(B===-1||$<B)}var{env:L}=j1,v0;if(V("no-color")||V("no-colors")||V("color=false")||V("color=never"))v0=0;else if(V("color")||V("colors")||V("color=true")||V("color=always"))v0=1;function X9(){if("FORCE_COLOR"in L){if(L.FORCE_COLOR==="true")return 1;if(L.FORCE_COLOR==="false")return 0;return L.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(L.FORCE_COLOR,10),3)}}function J9(F){if(F===0)return!1;return{level:F,hasBasic:!0,has256:F>=2,has16m:F>=3}}function Y9(F,{streamIsTTY:_,sniffFlags:E=!0}={}){let $=X9();if($!==void 0)v0=$;let B=E?v0:$;if(B===0)return 0;if(E){if(V("color=16m")||V("color=full")||V("color=truecolor"))return 3;if(V("color=256"))return 2}if("TF_BUILD"in L&&"AGENT_NAME"in L)return 1;if(F&&!_&&B===void 0)return 0;let D=B||0;if(L.TERM==="dumb")return D;if(j1.platform==="win32"){let U=R9.release().split(".");if(Number(U[0])>=10&&Number(U[2])>=10586)return Number(U[2])>=14931?3:2;return 1}if("CI"in L){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((U)=>(U in L)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((U)=>(U in L))||L.CI_NAME==="codeship")return 1;return D}if("TEAMCITY_VERSION"in L)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(L.TEAMCITY_VERSION)?1:0;if(L.COLORTERM==="truecolor")return 3;if(L.TERM==="xterm-kitty")return 3;if(L.TERM==="xterm-ghostty")return 3;if(L.TERM==="wezterm")return 3;if("TERM_PROGRAM"in L){let U=Number.parseInt((L.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(L.TERM_PROGRAM){case"iTerm.app":return U>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(L.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(L.TERM))return 1;if("COLORTERM"in L)return 1;return D}function m2(F,_={}){let E=Y9(F,{streamIsTTY:F&&F.isTTY,..._});return J9(E)}var Z9={stdout:m2({isTTY:c2.isatty(1)}),stderr:m2({isTTY:c2.isatty(2)})},l2=Z9;function n2(F,_,E){let $=F.indexOf(_);if($===-1)return F;let B=_.length,D=0,U="";do U+=F.slice(D,$)+_+E,D=$+B,$=F.indexOf(_,D);while($!==-1);return U+=F.slice(D),U}function i2(F,_,E,$){let B=0,D="";do{let U=F[$-1]==="\r";D+=F.slice(B,U?$-1:$)+_+(U?`\r
|
|
124
|
+
`:`
|
|
125
|
+
`)+E,B=$+1,$=F.indexOf(`
|
|
126
|
+
`,B)}while($!==-1);return D+=F.slice(B),D}var{stdout:p2,stderr:t2}=l2,T1=Symbol("GENERATOR"),B0=Symbol("STYLER"),Q0=Symbol("IS_EMPTY"),s2=["ansi","ansi","ansi256","ansi16m"],D0=Object.create(null),Q9=(F,_={})=>{if(_.level&&!(Number.isInteger(_.level)&&_.level>=0&&_.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let E=p2?p2.level:0;F.level=_.level===void 0?E:_.level};var G9=(F)=>{let _=(...E)=>E.join(" ");return Q9(_,F),Object.setPrototypeOf(_,G0.prototype),_};function G0(F){return G9(F)}Object.setPrototypeOf(G0.prototype,Function.prototype);for(let[F,_]of Object.entries(T))D0[F]={get(){let E=u0(this,O1(_.open,_.close,this[B0]),this[Q0]);return Object.defineProperty(this,F,{value:E}),E}};D0.visible={get(){let F=u0(this,this[B0],!0);return Object.defineProperty(this,"visible",{value:F}),F}};var P1=(F,_,E,...$)=>{if(F==="rgb"){if(_==="ansi16m")return T[E].ansi16m(...$);if(_==="ansi256")return T[E].ansi256(T.rgbToAnsi256(...$));return T[E].ansi(T.rgbToAnsi(...$))}if(F==="hex")return P1("rgb",_,E,...T.hexToRgb(...$));return T[E][F](...$)},K9=["rgb","hex","ansi256"];for(let F of K9){D0[F]={get(){let{level:E}=this;return function(...$){let B=O1(P1(F,s2[E],"color",...$),T.color.close,this[B0]);return u0(this,B,this[Q0])}}};let _="bg"+F[0].toUpperCase()+F.slice(1);D0[_]={get(){let{level:E}=this;return function(...$){let B=O1(P1(F,s2[E],"bgColor",...$),T.bgColor.close,this[B0]);return u0(this,B,this[Q0])}}}}var W9=Object.defineProperties(()=>{},{...D0,level:{enumerable:!0,get(){return this[T1].level},set(F){this[T1].level=F}}}),O1=(F,_,E)=>{let $,B;if(E===void 0)$=F,B=_;else $=E.openAll+F,B=_+E.closeAll;return{open:F,close:_,openAll:$,closeAll:B,parent:E}},u0=(F,_,E)=>{let $=(...B)=>L9($,B.length===1?""+B[0]:B.join(" "));return Object.setPrototypeOf($,W9),$[T1]=F,$[B0]=_,$[Q0]=E,$},L9=(F,_)=>{if(F.level<=0||!_)return F[Q0]?"":_;let E=F[B0];if(E===void 0)return _;let{openAll:$,closeAll:B}=E;if(_.includes("\x1B"))while(E!==void 0)_=n2(_,E.close,E.open),E=E.parent;let D=_.indexOf(`
|
|
127
|
+
`);if(D!==-1)_=i2(_,B,$,D);return $+_+B};Object.defineProperties(G0.prototype,D0);var S9=G0(),VB=G0({level:t2?t2.level:0});var r2=S9;import DF from"node:process";import c0 from"node:process";var A9=(F,_,E,$)=>{if(E==="length"||E==="prototype")return;if(E==="arguments"||E==="caller")return;let B=Object.getOwnPropertyDescriptor(F,E),D=Object.getOwnPropertyDescriptor(_,E);if(!I9(B,D)&&$)return;Object.defineProperty(F,E,D)},I9=function(F,_){return F===void 0||F.configurable||F.writable===_.writable&&F.enumerable===_.enumerable&&F.configurable===_.configurable&&(F.writable||F.value===_.value)},q9=(F,_)=>{let E=Object.getPrototypeOf(_);if(E===Object.getPrototypeOf(F))return;Object.setPrototypeOf(F,E)},N9=(F,_)=>`/* Wrapped ${F}*/
|
|
128
|
+
${_}`,V9=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),C9=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),j9=(F,_,E)=>{let $=E===""?"":`with ${E.trim()}() `,B=N9.bind(null,$,_.toString());Object.defineProperty(B,"name",C9);let{writable:D,enumerable:U,configurable:z}=V9;Object.defineProperty(F,"toString",{value:B,writable:D,enumerable:U,configurable:z})};function w1(F,_,{ignoreNonConfigurable:E=!1}={}){let{name:$}=F;for(let B of Reflect.ownKeys(_))A9(F,_,B,E);return q9(F,_),j9(F,_,$),F}var g0=new WeakMap,a2=(F,_={})=>{if(typeof F!=="function")throw TypeError("Expected a function");let E,$=0,B=F.displayName||F.name||"<anonymous>",D=function(...U){if(g0.set(D,++$),$===1)E=F.apply(this,U),F=void 0;else if(_.throw===!0)throw Error(`Function \`${B}\` can only be called once`);return E};return w1(D,F),g0.set(D,$),D};a2.callCount=(F)=>{if(!g0.has(F))throw Error(`The given function \`${F.name}\` is not wrapped by the \`onetime\` package`);return g0.get(F)};var o2=a2;var F0=[];F0.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")F0.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")F0.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var d0=(F)=>!!F&&typeof F==="object"&&typeof F.removeListener==="function"&&typeof F.emit==="function"&&typeof F.reallyExit==="function"&&typeof F.listeners==="function"&&typeof F.kill==="function"&&typeof F.pid==="number"&&typeof F.on==="function",f1=Symbol.for("signal-exit emitter"),k1=globalThis,T9=Object.defineProperty.bind(Object);class e2{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(k1[f1])return k1[f1];T9(k1,f1,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(F,_){this.listeners[F].push(_)}removeListener(F,_){let E=this.listeners[F],$=E.indexOf(_);if($===-1)return;if($===0&&E.length===1)E.length=0;else E.splice($,1)}emit(F,_,E){if(this.emitted[F])return!1;this.emitted[F]=!0;let $=!1;for(let B of this.listeners[F])$=B(_,E)===!0||$;if(F==="exit")$=this.emit("afterExit",_,E)||$;return $}}class x1{}var P9=(F)=>{return{onExit(_,E){return F.onExit(_,E)},load(){return F.load()},unload(){return F.unload()}}};class FF extends x1{onExit(){return()=>{}}load(){}unload(){}}class _F extends x1{#D=b1.platform==="win32"?"SIGINT":"SIGHUP";#$=new e2;#F;#B;#Y;#X={};#_=!1;constructor(F){super();this.#F=F,this.#X={};for(let _ of F0)this.#X[_]=()=>{let E=this.#F.listeners(_),{count:$}=this.#$,B=F;if(typeof B.__signal_exit_emitter__==="object"&&typeof B.__signal_exit_emitter__.count==="number")$+=B.__signal_exit_emitter__.count;if(E.length===$){this.unload();let D=this.#$.emit("exit",null,_),U=_==="SIGHUP"?this.#D:_;if(!D)F.kill(F.pid,U)}};this.#Y=F.reallyExit,this.#B=F.emit}onExit(F,_){if(!d0(this.#F))return()=>{};if(this.#_===!1)this.load();let E=_?.alwaysLast?"afterExit":"exit";return this.#$.on(E,F),()=>{if(this.#$.removeListener(E,F),this.#$.listeners.exit.length===0&&this.#$.listeners.afterExit.length===0)this.unload()}}load(){if(this.#_)return;this.#_=!0,this.#$.count+=1;for(let F of F0)try{let _=this.#X[F];if(_)this.#F.on(F,_)}catch(_){}this.#F.emit=(F,..._)=>{return this.#E(F,..._)},this.#F.reallyExit=(F)=>{return this.#U(F)}}unload(){if(!this.#_)return;this.#_=!1,F0.forEach((F)=>{let _=this.#X[F];if(!_)throw Error("Listener not defined for signal: "+F);try{this.#F.removeListener(F,_)}catch(E){}}),this.#F.emit=this.#B,this.#F.reallyExit=this.#Y,this.#$.count-=1}#U(F){if(!d0(this.#F))return 0;return this.#F.exitCode=F||0,this.#$.emit("exit",this.#F.exitCode,null),this.#Y.call(this.#F,this.#F.exitCode)}#E(F,..._){let E=this.#B;if(F==="exit"&&d0(this.#F)){if(typeof _[0]==="number")this.#F.exitCode=_[0];let $=E.call(this.#F,F,..._);return this.#$.emit("exit",this.#F.exitCode,null),$}else return E.call(this.#F,F,..._)}}var b1=globalThis.process,{onExit:EF,load:fB,unload:kB}=P9(d0(b1)?new _F(b1):new FF);var $F=c0.stderr.isTTY?c0.stderr:c0.stdout.isTTY?c0.stdout:void 0,O9=$F?o2(()=>{EF(()=>{$F.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},BF=O9;var m0=!1,U0={};U0.show=(F=DF.stderr)=>{if(!F.isTTY)return;m0=!1,F.write("\x1B[?25h")};U0.hide=(F=DF.stderr)=>{if(!F.isTTY)return;BF(),m0=!0,F.write("\x1B[?25l")};U0.toggle=(F,_)=>{if(F!==void 0)m0=F;if(m0)U0.show(_);else U0.hide(_)};var y1=U0;var h1={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:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]}};var K0=h1,lB=Object.keys(h1);var _0={};Z8(_0,{warning:()=>y9,success:()=>x9,info:()=>b9,error:()=>h9});import f9 from"node:tty";var k9=f9?.WriteStream?.prototype?.hasColors?.()??!1,Y=(F,_)=>{if(!k9)return(B)=>B;let E=`\x1B[${F}m`,$=`\x1B[${_}m`;return(B)=>{let D=B+"",U=D.indexOf($);if(U===-1)return E+D+$;let z=E,M=0,R=(_===22?$:"")+E;while(U!==-1)z+=D.slice(M,U)+R,M=U+$.length,U=D.indexOf($,M);return z+=D.slice(M)+$,z}},pB=Y(0,0),tB=Y(1,22),sB=Y(2,22),rB=Y(3,23),aB=Y(4,24),oB=Y(53,55),eB=Y(7,27),FD=Y(8,28),_D=Y(9,29),ED=Y(30,39),UF=Y(31,39),zF=Y(32,39),HF=Y(33,39),MF=Y(34,39),$D=Y(35,39),BD=Y(36,39),DD=Y(37,39),UD=Y(90,39),zD=Y(40,49),HD=Y(41,49),MD=Y(42,49),RD=Y(43,49),XD=Y(44,49),JD=Y(45,49),YD=Y(46,49),ZD=Y(47,49),QD=Y(100,49),GD=Y(91,39),KD=Y(92,39),WD=Y(93,39),LD=Y(94,39),SD=Y(95,39),AD=Y(96,39),ID=Y(97,39),qD=Y(101,49),ND=Y(102,49),VD=Y(103,49),CD=Y(104,49),jD=Y(105,49),TD=Y(106,49),PD=Y(107,49);import RF from"node:process";function W0(){let{env:F}=RF,{TERM:_,TERM_PROGRAM:E}=F;if(RF.platform!=="win32")return _!=="linux";return Boolean(F.WT_SESSION)||Boolean(F.TERMINUS_SUBLIME)||F.ConEmuTask==="{cmd::Cmder}"||E==="Terminus-Sublime"||E==="vscode"||_==="xterm-256color"||_==="alacritty"||_==="rxvt-unicode"||_==="rxvt-unicode-256color"||F.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var l0=W0(),b9=MF(l0?"ℹ":"i"),x9=zF(l0?"✔":"√"),y9=HF(l0?"⚠":"‼"),h9=UF(l0?"✖":"×");function v1({onlyFirst:F=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",F?void 0:"g")}var v9=v1();function L0(F){if(typeof F!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof F}\``);return F.replace(v9,"")}function XF(F){return F===161||F===164||F===167||F===168||F===170||F===173||F===174||F>=176&&F<=180||F>=182&&F<=186||F>=188&&F<=191||F===198||F===208||F===215||F===216||F>=222&&F<=225||F===230||F>=232&&F<=234||F===236||F===237||F===240||F===242||F===243||F>=247&&F<=250||F===252||F===254||F===257||F===273||F===275||F===283||F===294||F===295||F===299||F>=305&&F<=307||F===312||F>=319&&F<=322||F===324||F>=328&&F<=331||F===333||F===338||F===339||F===358||F===359||F===363||F===462||F===464||F===466||F===468||F===470||F===472||F===474||F===476||F===593||F===609||F===708||F===711||F>=713&&F<=715||F===717||F===720||F>=728&&F<=731||F===733||F===735||F>=768&&F<=879||F>=913&&F<=929||F>=931&&F<=937||F>=945&&F<=961||F>=963&&F<=969||F===1025||F>=1040&&F<=1103||F===1105||F===8208||F>=8211&&F<=8214||F===8216||F===8217||F===8220||F===8221||F>=8224&&F<=8226||F>=8228&&F<=8231||F===8240||F===8242||F===8243||F===8245||F===8251||F===8254||F===8308||F===8319||F>=8321&&F<=8324||F===8364||F===8451||F===8453||F===8457||F===8467||F===8470||F===8481||F===8482||F===8486||F===8491||F===8531||F===8532||F>=8539&&F<=8542||F>=8544&&F<=8555||F>=8560&&F<=8569||F===8585||F>=8592&&F<=8601||F===8632||F===8633||F===8658||F===8660||F===8679||F===8704||F===8706||F===8707||F===8711||F===8712||F===8715||F===8719||F===8721||F===8725||F===8730||F>=8733&&F<=8736||F===8739||F===8741||F>=8743&&F<=8748||F===8750||F>=8756&&F<=8759||F===8764||F===8765||F===8776||F===8780||F===8786||F===8800||F===8801||F>=8804&&F<=8807||F===8810||F===8811||F===8814||F===8815||F===8834||F===8835||F===8838||F===8839||F===8853||F===8857||F===8869||F===8895||F===8978||F>=9312&&F<=9449||F>=9451&&F<=9547||F>=9552&&F<=9587||F>=9600&&F<=9615||F>=9618&&F<=9621||F===9632||F===9633||F>=9635&&F<=9641||F===9650||F===9651||F===9654||F===9655||F===9660||F===9661||F===9664||F===9665||F>=9670&&F<=9672||F===9675||F>=9678&&F<=9681||F>=9698&&F<=9701||F===9711||F===9733||F===9734||F===9737||F===9742||F===9743||F===9756||F===9758||F===9792||F===9794||F===9824||F===9825||F>=9827&&F<=9829||F>=9831&&F<=9834||F===9836||F===9837||F===9839||F===9886||F===9887||F===9919||F>=9926&&F<=9933||F>=9935&&F<=9939||F>=9941&&F<=9953||F===9955||F===9960||F===9961||F>=9963&&F<=9969||F===9972||F>=9974&&F<=9977||F===9979||F===9980||F===9982||F===9983||F===10045||F>=10102&&F<=10111||F>=11094&&F<=11097||F>=12872&&F<=12879||F>=57344&&F<=63743||F>=65024&&F<=65039||F===65533||F>=127232&&F<=127242||F>=127248&&F<=127277||F>=127280&&F<=127337||F>=127344&&F<=127373||F===127375||F===127376||F>=127387&&F<=127404||F>=917760&&F<=917999||F>=983040&&F<=1048573||F>=1048576&&F<=1114109}function JF(F){return F===12288||F>=65281&&F<=65376||F>=65504&&F<=65510}function YF(F){return F>=4352&&F<=4447||F===8986||F===8987||F===9001||F===9002||F>=9193&&F<=9196||F===9200||F===9203||F===9725||F===9726||F===9748||F===9749||F>=9776&&F<=9783||F>=9800&&F<=9811||F===9855||F>=9866&&F<=9871||F===9875||F===9889||F===9898||F===9899||F===9917||F===9918||F===9924||F===9925||F===9934||F===9940||F===9962||F===9970||F===9971||F===9973||F===9978||F===9981||F===9989||F===9994||F===9995||F===10024||F===10060||F===10062||F>=10067&&F<=10069||F===10071||F>=10133&&F<=10135||F===10160||F===10175||F===11035||F===11036||F===11088||F===11093||F>=11904&&F<=11929||F>=11931&&F<=12019||F>=12032&&F<=12245||F>=12272&&F<=12287||F>=12289&&F<=12350||F>=12353&&F<=12438||F>=12441&&F<=12543||F>=12549&&F<=12591||F>=12593&&F<=12686||F>=12688&&F<=12773||F>=12783&&F<=12830||F>=12832&&F<=12871||F>=12880&&F<=42124||F>=42128&&F<=42182||F>=43360&&F<=43388||F>=44032&&F<=55203||F>=63744&&F<=64255||F>=65040&&F<=65049||F>=65072&&F<=65106||F>=65108&&F<=65126||F>=65128&&F<=65131||F>=94176&&F<=94180||F>=94192&&F<=94198||F>=94208&&F<=101589||F>=101631&&F<=101662||F>=101760&&F<=101874||F>=110576&&F<=110579||F>=110581&&F<=110587||F===110589||F===110590||F>=110592&&F<=110882||F===110898||F>=110928&&F<=110930||F===110933||F>=110948&&F<=110951||F>=110960&&F<=111355||F>=119552&&F<=119638||F>=119648&&F<=119670||F===126980||F===127183||F===127374||F>=127377&&F<=127386||F>=127488&&F<=127490||F>=127504&&F<=127547||F>=127552&&F<=127560||F===127568||F===127569||F>=127584&&F<=127589||F>=127744&&F<=127776||F>=127789&&F<=127797||F>=127799&&F<=127868||F>=127870&&F<=127891||F>=127904&&F<=127946||F>=127951&&F<=127955||F>=127968&&F<=127984||F===127988||F>=127992&&F<=128062||F===128064||F>=128066&&F<=128252||F>=128255&&F<=128317||F>=128331&&F<=128334||F>=128336&&F<=128359||F===128378||F===128405||F===128406||F===128420||F>=128507&&F<=128591||F>=128640&&F<=128709||F===128716||F>=128720&&F<=128722||F>=128725&&F<=128728||F>=128732&&F<=128735||F===128747||F===128748||F>=128756&&F<=128764||F>=128992&&F<=129003||F===129008||F>=129292&&F<=129338||F>=129340&&F<=129349||F>=129351&&F<=129535||F>=129648&&F<=129660||F>=129664&&F<=129674||F>=129678&&F<=129734||F===129736||F>=129741&&F<=129756||F>=129759&&F<=129770||F>=129775&&F<=129784||F>=131072&&F<=196605||F>=196608&&F<=262141}function u9(F){if(!Number.isSafeInteger(F))throw TypeError(`Expected a code point, got \`${typeof F}\`.`)}function u1(F,{ambiguousAsWide:_=!1}={}){if(u9(F),JF(F)||YF(F)||_&&XF(F))return 2;return 1}var g9=new Intl.Segmenter,d9=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v,c9=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,m9=/^\p{RGI_Emoji}$/v;function l9(F){return F.replace(c9,"")}function n9(F){return d9.test(F)}function i9(F,_){let E=0;if(F.length>1){for(let $ of F.slice(1))if($>=""&&$<="")E+=u1($.codePointAt(0),_)}return E}function g1(F,_={}){if(typeof F!=="string"||F.length===0)return 0;let{ambiguousIsNarrow:E=!0,countAnsiEscapeCodes:$=!1}=_,B=F;if(!$)B=L0(B);if(B.length===0)return 0;let D=0,U={ambiguousAsWide:!E};for(let{segment:z}of g9.segment(B)){if(n9(z))continue;if(m9.test(z)){D+=2;continue}let M=l9(z).codePointAt(0);D+=u1(M,U),D+=i9(z,U)}return D}function d1({stream:F=process.stdout}={}){return Boolean(F&&F.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import k from"node:process";var p9=3;class ZF{#D=0;start(){if(this.#D++,this.#D===1)this.#$()}stop(){if(this.#D<=0)throw Error("`stop` called more times than `start`");if(this.#D--,this.#D===0)this.#F()}#$(){if(k.platform==="win32"||!k.stdin.isTTY)return;k.stdin.setRawMode(!0),k.stdin.on("data",this.#B),k.stdin.resume()}#F(){if(!k.stdin.isTTY)return;k.stdin.off("data",this.#B),k.stdin.pause(),k.stdin.setRawMode(!1)}#B(F){if(F[0]===p9)k.emit("SIGINT")}}var t9=new ZF,c1=t9;class QF{#D=0;#$=!1;#F=0;#B=-1;#Y=0;#X=0;#_;#U;#E;#Z;#K;#z;#J;#H;#Q;#M;#R;color;constructor(F){if(typeof F==="string")F={text:F};if(this.#_={color:"cyan",stream:n0.stderr,discardStdin:!0,hideCursor:!0,...F},this.color=this.#_.color,this.spinner=this.#_.spinner,this.#K=this.#_.interval,this.#E=this.#_.stream,this.#z=typeof this.#_.isEnabled==="boolean"?this.#_.isEnabled:d1({stream:this.#E}),this.#J=typeof this.#_.isSilent==="boolean"?this.#_.isSilent:!1,this.text=this.#_.text,this.prefixText=this.#_.prefixText,this.suffixText=this.#_.suffixText,this.indent=this.#_.indent,n0.env.NODE_ENV==="test")this._stream=this.#E,this._isEnabled=this.#z,Object.defineProperty(this,"_linesToClear",{get(){return this.#D},set(_){this.#D=_}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#B}}),Object.defineProperty(this,"_lineCount",{get(){return this.#F}})}get indent(){return this.#H}set indent(F=0){if(!(F>=0&&Number.isInteger(F)))throw Error("The `indent` option must be an integer from 0 and up");this.#H=F,this.#G()}get interval(){return this.#K??this.#U.interval??100}get spinner(){return this.#U}set spinner(F){if(this.#B=-1,this.#K=void 0,typeof F==="object"){if(!Array.isArray(F.frames)||F.frames.length===0||F.frames.some((_)=>typeof _!=="string"))throw Error("The given spinner must have a non-empty `frames` array of strings");if(F.interval!==void 0&&!(Number.isInteger(F.interval)&&F.interval>0))throw Error("`spinner.interval` must be a positive integer if provided");this.#U=F}else if(!W0())this.#U=K0.line;else if(F===void 0)this.#U=K0.dots;else if(F!=="default"&&K0[F])this.#U=K0[F];else throw Error(`There is no built-in spinner named '${F}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#Q}set text(F=""){this.#Q=F,this.#G()}get prefixText(){return this.#M}set prefixText(F=""){this.#M=F,this.#G()}get suffixText(){return this.#R}set suffixText(F=""){this.#R=F,this.#G()}get isSpinning(){return this.#Z!==void 0}#A(F,_,E=!1){let $=typeof F==="function"?F():F;if(typeof $==="string"&&$!=="")return E?_+$:$+_;return""}#W(F=this.#M,_=" "){return this.#A(F,_,!1)}#L(F=this.#R,_=" "){return this.#A(F,_,!0)}#S(F,_){let E=0;for(let $ of L0(F).split(`
|
|
129
|
+
`))E+=Math.max(1,Math.ceil(g1($)/_));return E}#G(){let F=this.#E.columns??80,_=typeof this.#M==="function"?"":this.#M,E=typeof this.#R==="function"?"":this.#R,$=typeof _==="string"&&_!==""?_+" ":"",B=typeof E==="string"&&E!==""?" "+E:"",D="-",U=" ".repeat(this.#H)+$+"-"+(typeof this.#Q==="string"?" "+this.#Q:"")+B;this.#F=this.#S(U,F)}get isEnabled(){return this.#z&&!this.#J}set isEnabled(F){if(typeof F!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#z=F}get isSilent(){return this.#J}set isSilent(F){if(typeof F!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#J=F}frame(){let F=Date.now();if(this.#B===-1||F-this.#Y>=this.interval)this.#B=++this.#B%this.#U.frames.length,this.#Y=F;let{frames:_}=this.#U,E=_[this.#B];if(this.color)E=r2[this.color](E);let $=this.#W(this.#M," "),B=typeof this.text==="string"?" "+this.text:"",D=this.#L(this.#R," ");return $+E+B+D}clear(){if(!this.#z||!this.#E.isTTY)return this;this.#E.cursorTo(0);for(let F=0;F<this.#D;F++){if(F>0)this.#E.moveCursor(0,-1);this.#E.clearLine(1)}if(this.#H||this.#X!==this.#H)this.#E.cursorTo(this.#H);return this.#X=this.#H,this.#D=0,this}render(){if(!this.#z||this.#J)return this;this.clear();let F=this.frame(),_=this.#E.columns??80,E=this.#S(F,_),$=this.#E.rows;if($&&$>1&&E>$){let B=F.split(`
|
|
130
|
+
`),D=$-1;F=[...B.slice(0,D),"... (content truncated to fit terminal)"].join(`
|
|
131
|
+
`)}return this.#E.write(F),this.#D=this.#S(F,_),this}start(F){if(F)this.text=F;if(this.#J)return this;if(!this.#z){let _=" ".repeat(this.#H)+this.#W(this.#M," ")+(this.text?`- ${this.text}`:"")+this.#L(this.#R," ");if(_.trim()!=="")this.#E.write(_+`
|
|
132
|
+
`);return this}if(this.isSpinning)return this;if(this.#_.hideCursor)y1.hide(this.#E);if(this.#_.discardStdin&&n0.stdin.isTTY)this.#$=!0,c1.start();return this.render(),this.#Z=setInterval(this.render.bind(this),this.interval),this}stop(){if(clearInterval(this.#Z),this.#Z=void 0,this.#B=0,this.#z){if(this.clear(),this.#_.hideCursor)y1.show(this.#E)}if(this.#_.discardStdin&&n0.stdin.isTTY&&this.#$)c1.stop(),this.#$=!1;return this}succeed(F){return this.stopAndPersist({symbol:_0.success,text:F})}fail(F){return this.stopAndPersist({symbol:_0.error,text:F})}warn(F){return this.stopAndPersist({symbol:_0.warning,text:F})}info(F){return this.stopAndPersist({symbol:_0.info,text:F})}stopAndPersist(F={}){if(this.#J)return this;let _=F.prefixText??this.#M,E=this.#W(_," "),$=F.symbol??" ",B=F.text??this.text,U=typeof B==="string"?($?" ":"")+B:"",z=F.suffixText??this.#R,M=this.#L(z," "),H=E+$+U+M+`
|
|
133
|
+
`;return this.stop(),this.#E.write(H),this}}function z0(F){return new QF(F)}var GF={name:"kodu",version:"1.1.2",description:"kodu — A lightning-fast CLI tool to bundle your codebase into a single context file for LLMs (ChatGPT, Claude, DeepSeek). Features smart prioritization, interactive history, and gitignore support.",type:"module",bin:{kodu:"./dist/index.js"},files:["dist","README.md","LICENSE"],scripts:{"________________ BUILD AND RUN ________________":"",dev:"bun run src/index.ts",build:"bun build ./src/index.ts --outfile=./dist/index.js --target=node --minify",prepublishOnly:"bun run build","________________ FORMAT AND LINT ________________":"",lint:"biome check","lint:fix":"biome check --write","lint:fix:unsafe":"biome check --write --unsafe","ts:check":"tsc --noEmit",check:"run-p ts:check lint"},keywords:["cli","context","llm","ai","bundler"],author:"uxname",license:"MIT",repository:{type:"git",url:"git+https://github.com/uxname/pp.git"},bugs:{url:"https://github.com/uxname/pp/issues"},homepage:"https://github.com/uxname/pp#readme",devDependencies:{"@biomejs/biome":"^2.3.10","@types/bun":"latest","@types/strip-comments":"^2.0.4","npm-run-all":"^4.1.5"},dependencies:{"@types/prompts":"^2.4.9",commander:"^14.0.2",ignore:"^7.0.5",ora:"^9.0.0",prompts:"^2.4.2","strip-comments":"^2.0.1"}};var k4=x0(Q2(),1);import{existsSync as T4,mkdirSync as eE,readFileSync as F$,writeFileSync as O4}from"node:fs";import{homedir as w4}from"node:os";import{join as f4}from"node:path";var R1=f4(w4(),".config","kodu","history.json"),P4=50;function b4(){let F=f4(w4(),".config","kodu");if(!T4(F))eE(F,{recursive:!0});if(!T4(R1))O4(R1,JSON.stringify([],null,2),"utf-8")}function x4(){b4();try{let F=F$(R1,"utf-8");return JSON.parse(F)}catch{return[]}}function _$(F){b4();try{O4(R1,JSON.stringify(F,null,2),"utf-8")}catch(_){console.error("Error saving history:",_)}}function X1(F){let _=x4(),E=F.join(" "),$=_.findIndex((B)=>B.command===E);if($!==-1)_.splice($,1);if(_.unshift({command:E,timestamp:Date.now()}),_.length>P4)_.length=P4;_$(_)}async function y4(){let F=x4();if(F.length===0)return console.log("No history found."),null;let _=F.map(($,B)=>({title:$.command,value:B,description:new Date($.timestamp).toLocaleString()})),{value:E}=await k4.default({type:"select",name:"value",message:"Select a command to run",choices:[..._,{title:"Cancel",value:-1}]});if(E===-1||E===void 0||!F[E])return null;return F[E].command.split(" ")}import{writeFileSync as E$}from"node:fs";function G2(F){if(F===0)return"0 Bytes";let _=1024,E=["Bytes","KB","MB","GB"],$=Math.floor(Math.log(F)/Math.log(_));return`${parseFloat((F/_**$).toFixed(2))} ${E[$]}`}function h4(F,_,E={}){let $=Buffer.from(F).length;if(E.stdout||!E.output)console.log(F);if(E.output)E$(E.output,F,"utf-8"),console.log(`
|
|
134
|
+
Output written to ${E.output} (${G2($)})`);if(E.stdout&&E.output)console.log(`
|
|
135
|
+
Content size: ${G2($)}`)}import{existsSync as g$}from"node:fs";import{relative as d$,resolve as c$}from"node:path";import{cwd as m$}from"node:process";var U8=x0(Q2(),1);var w0={MAX_FILE_SIZE_BYTES:1048576,EXCLUDED_DIRS:new Set([".git",".github",".idea",".vscode","node_modules","dist","build","coverage","public","vendor",".cache",".next",".nuxt",".svelte-kit","__pycache__",".venv","env","target","out","bin","obj","log","logs"]),EXCLUDED_FILES:new Set(["package-lock.json","yarn.lock","pnpm-lock.yaml","bun.lockb",".env",".DS_Store"]),EXCLUDED_PATTERNS:new Set(["*.svg","*.png","*.jpg","*.jpeg","*.gif","*.webp","*.ico","*.mp4","*.mov","*.avi","*.webm","*.pdf","*.zip","*.rar","*.gz","*.lockb"]),INCLUDED_EXTENSIONS_AND_FILENAMES:new Set(["package.json","pom.xml","pyproject.toml","requirements.txt","go.mod","Cargo.toml","composer.json","Dockerfile","docker-compose.yml","Makefile","README.md",".js",".mjs",".cjs",".ts",".mts",".cts",".jsx",".tsx",".json",".html",".htm",".css",".scss",".sass",".md"])};var J1=[{score:100,test:(F,_)=>_==="README.md"||_==="package.json"||_==="Dockerfile"||_==="docker-compose.yml"||_==="Makefile"},{score:90,test:(F,_)=>_.endsWith(".md")&&!_.endsWith("CHANGELOG.md")},{score:80,test:(F,_)=>_.endsWith(".ts")||_.endsWith(".tsx")||_.endsWith(".js")||_.endsWith(".jsx")},{score:70,test:(F,_)=>_.endsWith(".py")||_.endsWith(".go")||_.endsWith(".rs")||_.endsWith(".java")||_.endsWith(".kt")||_.endsWith(".scala")},{score:60,test:(F,_)=>_.endsWith(".html")||_.endsWith(".css")||_.endsWith(".scss")||_.endsWith(".sass")},{score:50,test:(F,_)=>_.endsWith(".json")||_.endsWith(".yaml")||_.endsWith(".yml")||_.endsWith(".toml")},{score:10,test:(F,_)=>_.includes(".test.")||_.includes(".spec.")||_.includes("__tests__/")||F.includes("/test/")||F.startsWith("test/")},{score:5,test:(F,_)=>_.endsWith(".d.ts")||_.endsWith(".min.js")||_.endsWith(".bundle.js")}];import{lstatSync as P$,readdirSync as O$}from"node:fs";import{basename as w$,dirname as f$,join as k$,relative as b$}from"node:path";var a4=x0(s4(),1);import{closeSync as q$,existsSync as N$,openSync as V$,readFileSync as C$,readSync as j$,statSync as T$}from"node:fs";function G1(F,_=1024){if(!N$(F))return!1;try{let E=Buffer.alloc(_),$=V$(F,"r"),B=j$($,E,0,_,0);q$($);let D=E.slice(0,B);if(D.includes(0))return!0;return[[137,80,78,71],[255,216,255],[71,73,70,56],[37,80,68,70],[80,75,3,4],[82,97,114,33],[66,90,104],[31,139,8],[127,69,76,70]].some((z)=>{if(D.length<z.length)return!1;return z.every((M,H)=>D[H]===M)})}catch{return!0}}function r4(F,_){try{if(T$(F).size>_)return null;return C$(F,"utf-8")}catch(E){return null}}function o4(F){let _=`${F}/.gitignore`;try{let E=f("node:fs").readFileSync(_,"utf8");return a4.default().add(E)}catch(E){return null}}function e4(F,_,E,$,B,D){if(F.startsWith("."))return!0;if(E&&$.EXCLUDED_DIRS.has(F))return!0;if(!E&&$.EXCLUDED_FILES.has(F))return!0;if(!E&&Array.from($.EXCLUDED_PATTERNS).some((U)=>{return new RegExp(`^${U.replace(/\*/g,".*")}$`).test(F)}))return!0;if(!E){let U=F.includes(".")?F.substring(F.lastIndexOf(".")):"";if(!$.INCLUDED_EXTENSIONS_AND_FILENAMES.has(F)&&!$.INCLUDED_EXTENSIONS_AND_FILENAMES.has(U))return!0}if(B?.ignores(_))return!0;if(D.some((U)=>{return new RegExp(U).test(_)}))return!0;if(!E&&G1(_))return!0;return!1}function F8(F,_,E,$){for(let B of $)if(B.test(F,_,E))return B.score;return 0}function K1(F,_,E,$=!0,B=[]){let D=[],U=$?o4(F):null;function z(M){try{let H=O$(M);for(let R of H){let J=k$(M,R),G=b$(F,J).replace(/\\/g,"/"),I=P$(J),e=I.isDirectory();if(e4(R,G,e,_,U,B))continue;if(e)z(J);else{let k0=w$(J),w=f$(G),C=F8(G,k0,w,E);D.push({path:J,relativePath:G,score:C,size:I.size})}}}catch(H){let R=H;if(R.code!=="EACCES"&&R.code!=="EPERM")throw H}}return z(F),D}import{readFileSync as x$,writeFileSync as y$}from"node:fs";var h$=new Set([".js",".ts",".jsx",".tsx",".mjs",".cjs",".mts",".cts"]);function _8(F){let _=F.substring(F.lastIndexOf("."));return h$.has(_)}function E8(F){try{let _=x$(F,"utf-8"),E="\"(?:\\\\[\\s\\S]|[^\"\\\\])*\"|'(?:\\\\[\\s\\S]|[^'\\\\])*'|`(?:[^`\\\\]|\\\\.)*`",$="//[^\\n\\r]*|/\\*[\\s\\S]*?\\*/",B=new RegExp("(\"(?:\\\\[\\s\\S]|[^\"\\\\])*\"|'(?:\\\\[\\s\\S]|[^'\\\\])*'|`(?:[^`\\\\]|\\\\.)*`)|(//[^\\n\\r]*|/\\*[\\s\\S]*?\\*/)","g"),U=_.replace(B,(z,M,H)=>{if(typeof M<"u")return M;return""}).replace(/(\r\n|\r|\n){3,}/g,`
|
|
136
|
+
|
|
137
|
+
`);if(_===U)return!1;return y$(F,U,"utf-8"),!0}catch(_){return console.error(`Error stripping file ${F}:`,_),!1}}import{execSync as S2}from"node:child_process";import{existsSync as v$}from"node:fs";import{join as u$,resolve as $8}from"node:path";function B8(F){try{if(v$(u$(F,".git")))return!0;return S2("git rev-parse --is-inside-work-tree",{cwd:F,stdio:"ignore"}),!0}catch{return!1}}function D8(F){try{let _=S2("git rev-parse --show-toplevel",{cwd:F,encoding:"utf-8"}).trim(),$=S2("git status --porcelain",{cwd:_,encoding:"utf-8"}).split(`
|
|
138
|
+
`).filter((B)=>B.trim()!=="").map((B)=>{let D=B.substring(3).trim();if(D.startsWith('"')&&D.endsWith('"'))D=D.slice(1,-1);if(D.includes(" -> "))return $8(_,D.split(" -> ")[1]);return $8(_,D)});return Array.from(new Set($))}catch(_){return console.warn("Warning: Failed to read git status.",_),[]}}async function z8(F=".",_){let E=c$(m$(),F),$=[],B=z0("Analyzing files...").start(),D=!_.all&&B8(E);if(D){if(B.text="Checking git status for changed files...",$=D8(E).filter((J)=>J.startsWith(E)&&g$(J)).map((J)=>({path:J,relativePath:d$(E,J)})),$.length===0){B.fail("No changed or untracked files found via git (or files were deleted)."),console.log('\uD83D\uDCA1 Tip: Use "--all" to scan the entire directory.');return}}else B.text="Scanning directory...",$=K1(E,w0,J1,_.gitignore??!0,_.exclude??[]);let U=$.filter((H)=>_8(H.path));if(U.length===0){B.fail(D?"No changed JS/TS files found.":"No JS/TS files found matching criteria.");return}if(B.succeed(D?`Found ${U.length} changed script files (Git mode).`:`Found ${U.length} script files (Full scan).`),_.dryRun){if(console.log(`
|
|
139
|
+
Files that would be processed:`),U.slice(0,10).forEach((H)=>{console.log(`- ${H.relativePath}`)}),U.length>10)console.log(`...and ${U.length-10} more.`);return}if(!_.yes){let H=D?"modified/untracked":"found";if(!(await U8.default({type:"confirm",name:"value",message:`⚠️ Are you sure you want to remove ALL comments from ${U.length} ${H} files?`,initial:!1})).value){console.log("Operation cancelled.");return}}let z=z0(`Stripping comments from ${U.length} files...`).start(),M=0;for(let H of U)if(E8(H.path))M++;if(z.succeed(`Completed! Modified ${M} of ${U.length} files.`),!_.noHistory){let H=["strip",F];if(_.yes)H.push("--yes");if(_.all)H.push("--all");if(_.exclude)_.exclude.forEach((R)=>{H.push("--exclude",R)});X1(H)}}import{relative as l$}from"node:path";function H8(F,_,E){let $=[...F].sort((U,z)=>z.score-U.score),B=[],D=[];for(let U of $){let z=U.relativePath||l$(_,U.path);try{if(U.size>E){D.push(`${z} (file too large: ${U.size} bytes)`);continue}if(G1(U.path)){D.push(`${z} (binary file)`);continue}let M=r4(U.path,E);if(M===null){D.push(z);continue}B.push(`// File: ${z}
|
|
140
|
+
`),B.push(M),B.push(`
|
|
141
|
+
`.repeat(2))}catch(M){let H=M instanceof Error?M.message:String(M);console.error(`Error processing file ${z}:`,M),D.push(`${z} (error: ${H})`)}}if(D.length>0)B.push(`
|
|
142
|
+
// Skipped files:
|
|
143
|
+
`),B.push(D.map((U)=>`// - ${U}`).join(`
|
|
144
|
+
`));return{content:B.join(`
|
|
145
|
+
`),skippedFiles:D}}async function M8(F=[]){let _=z0("Scanning files...").start();try{let E=F[0]||".",$=n$(i$(),E),B=K1($,w0,J1,j.opts().gitignore,j.opts().exclude);_.succeed(`Found ${B.length} files`);let{content:D,skippedFiles:U}=H8(B,$,w0.MAX_FILE_SIZE_BYTES);if(U.length>0)console.log(`
|
|
146
|
+
Skipped ${U.length} files (too large, binary, or unreadable)`);if(h4(D,$,{stdout:j.opts().stdout,output:j.opts().output}),!j.opts().noHistory)X1(F)}catch(E){let $=E instanceof Error?E.message:String(E);_.fail(`Error: ${$}`),process.exit(1)}}async function p$(){if(j.version(GF.version).description("kodu — Codebase bundler & utility"),j.command("strip [path]").description("Remove all comments from JS/TS files").option("--no-gitignore","Disable .gitignore parsing").option("-e, --exclude <patterns...>","Exclude patterns",[]).option("-y, --yes","Skip confirmation prompt").option("-a, --all","Process ALL files (default: only git changed/untracked)").option("-d, --dry-run","Show which files would be processed without modifying them").option("--no-history","Disable history").action(async(_,E)=>{await z8(_,{gitignore:E.gitignore,exclude:E.exclude,yes:E.yes,dryRun:E.dryRun,noHistory:E.history===!1,all:E.all})}),j.arguments("[path]").option("-o, --output <file>","Output file").option("--stdout","Print output to stdout").option("--no-gitignore","Disable .gitignore").option("-e, --exclude <patterns...>","Exclude patterns",[]).option("--no-history","Disable history",!1).action(async(_,E)=>{let $=[_||"."];if(E.output)$.push("--output",E.output);if(E.stdout)$.push("--stdout");if(E.gitignore===!1)$.push("--no-gitignore");if(E.exclude&&E.exclude.length>0)E.exclude.forEach((B)=>{$.push("--exclude",B)});if(E.noHistory)$.push("--no-history");await M8($)}),process.argv.length<=2){let _=await y4();if(_)if(_[0]==="strip"){let E=process.argv[0]??"node",$=process.argv[1]??"kodu";await j.parseAsync([E,$,..._])}else await M8([..._,"--no-history"]);return}j.parse(process.argv)}p$().catch(console.error);
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kodu",
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"description": "kodu — A lightning-fast CLI tool to bundle your codebase into a single context file for LLMs (ChatGPT, Claude, DeepSeek). Features smart prioritization, interactive history, and gitignore support.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"kodu": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"________________ BUILD AND RUN ________________": "",
|
|
16
|
+
"dev": "bun run src/index.ts",
|
|
17
|
+
"build": "bun build ./src/index.ts --outfile=./dist/index.js --target=node --minify",
|
|
18
|
+
"prepublishOnly": "bun run build",
|
|
19
|
+
"________________ FORMAT AND LINT ________________": "",
|
|
20
|
+
"lint": "biome check",
|
|
21
|
+
"lint:fix": "biome check --write",
|
|
22
|
+
"lint:fix:unsafe": "biome check --write --unsafe",
|
|
23
|
+
"ts:check": "tsc --noEmit",
|
|
24
|
+
"check": "run-p ts:check lint"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"cli",
|
|
28
|
+
"context",
|
|
29
|
+
"llm",
|
|
30
|
+
"ai",
|
|
31
|
+
"bundler"
|
|
32
|
+
],
|
|
33
|
+
"author": "uxname",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/uxname/pp.git"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/uxname/pp/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/uxname/pp#readme",
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@biomejs/biome": "^2.3.10",
|
|
45
|
+
"@types/bun": "latest",
|
|
46
|
+
"@types/strip-comments": "^2.0.4",
|
|
47
|
+
"npm-run-all": "^4.1.5"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@types/prompts": "^2.4.9",
|
|
51
|
+
"commander": "^14.0.2",
|
|
52
|
+
"ignore": "^7.0.5",
|
|
53
|
+
"ora": "^9.0.0",
|
|
54
|
+
"prompts": "^2.4.2",
|
|
55
|
+
"strip-comments": "^2.0.1"
|
|
56
|
+
}
|
|
57
|
+
}
|