create-ripple 0.2.151 → 0.2.153
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 +1 -1
- package/README.md +21 -6
- package/package.json +4 -52
- package/src/index.js +5 -0
- package/dist/index.js +0 -151
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# create-ripple
|
|
2
2
|
|
|
3
|
-
Interactive CLI tool for creating new Ripple applications.
|
|
3
|
+
Interactive CLI tool for creating new Ripple applications. Alias for the `@ripple-ts/cli` package.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
### Interactive Mode
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm create ripple
|
|
11
|
-
# or
|
|
12
10
|
npx create-ripple
|
|
13
11
|
# or
|
|
12
|
+
npm create ripple
|
|
13
|
+
# or
|
|
14
14
|
yarn create ripple
|
|
15
15
|
# or
|
|
16
16
|
pnpm create ripple
|
|
@@ -18,11 +18,24 @@ pnpm create ripple
|
|
|
18
18
|
|
|
19
19
|
### With Arguments
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
- `project-name`: Optional. Name of the project to create
|
|
22
|
+
- `-p, --package-manager <pm>`: Package manager to use - npm, yarn, pnpm (default: npm)
|
|
23
|
+
- `--template <template>`: Choose a predefined template (default and currently only option: basic)
|
|
24
|
+
- `--yes` or `-y`: Skip all prompts and use defaults
|
|
25
|
+
- `--no-git`: Skip initializing a Git repository
|
|
26
|
+
|
|
27
|
+
Examples:
|
|
28
|
+
|
|
29
|
+
````bash
|
|
22
30
|
npm create ripple my-app
|
|
23
31
|
# or
|
|
24
32
|
npx create-ripple my-app
|
|
25
|
-
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm create ripple my-app --yes --no-git
|
|
36
|
+
# or
|
|
37
|
+
npx create ripple my-app --yes --no-git
|
|
38
|
+
````
|
|
26
39
|
|
|
27
40
|
## Features
|
|
28
41
|
|
|
@@ -35,7 +48,9 @@ npx create-ripple my-app
|
|
|
35
48
|
## Templates
|
|
36
49
|
|
|
37
50
|
### Basic
|
|
51
|
+
|
|
38
52
|
A minimal Ripple application with:
|
|
53
|
+
|
|
39
54
|
- Vite for development and building
|
|
40
55
|
- TypeScript support
|
|
41
56
|
- Prettier for code formatting
|
|
@@ -43,7 +58,7 @@ A minimal Ripple application with:
|
|
|
43
58
|
|
|
44
59
|
## Requirements
|
|
45
60
|
|
|
46
|
-
- Node.js
|
|
61
|
+
- Node.js 20.0.0 or higher
|
|
47
62
|
|
|
48
63
|
## License
|
|
49
64
|
|
package/package.json
CHANGED
|
@@ -1,58 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ripple",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Interactive CLI tool for creating Ripple applications",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"author": "Ripple Team",
|
|
8
|
-
"keywords": [
|
|
9
|
-
"ripple",
|
|
10
|
-
"cli",
|
|
11
|
-
"scaffold",
|
|
12
|
-
"template",
|
|
13
|
-
"create-app"
|
|
14
|
-
],
|
|
15
|
-
"repository": {
|
|
16
|
-
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/trueadm/ripple.git",
|
|
18
|
-
"directory": "packages/create-ripple"
|
|
19
|
-
},
|
|
20
|
-
"bugs": {
|
|
21
|
-
"url": "https://github.com/trueadm/ripple/issues"
|
|
22
|
-
},
|
|
23
|
-
"homepage": "https://ripplejs.com",
|
|
24
|
-
"files": [
|
|
25
|
-
"./dist/index.js"
|
|
26
|
-
],
|
|
3
|
+
"version": "0.2.153",
|
|
27
4
|
"bin": {
|
|
28
|
-
"create-ripple": "./
|
|
29
|
-
},
|
|
30
|
-
"engines": {
|
|
31
|
-
"node": ">=20.0.0"
|
|
32
|
-
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@types/prompts": "^2.4.9",
|
|
35
|
-
"commander": "^12.1.0",
|
|
36
|
-
"degit": "^2.8.4",
|
|
37
|
-
"jsdom": "^26.1.0",
|
|
38
|
-
"kleur": "^4.1.5",
|
|
39
|
-
"ora": "^8.1.0",
|
|
40
|
-
"prettier": "^3.6.2",
|
|
41
|
-
"prompts": "^2.4.2",
|
|
42
|
-
"tsdown": "^0.15.4",
|
|
43
|
-
"vitest": "^3.2.4"
|
|
44
|
-
},
|
|
45
|
-
"publishConfig": {
|
|
46
|
-
"access": "public",
|
|
47
|
-
"tag": "next"
|
|
5
|
+
"create-ripple": "./src/index.js"
|
|
48
6
|
},
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"test": "vitest run",
|
|
52
|
-
"test:watch": "vitest",
|
|
53
|
-
"test:coverage": "vitest run --coverage",
|
|
54
|
-
"test:ui": "vitest --ui",
|
|
55
|
-
"format": "prettier --write .",
|
|
56
|
-
"format:check": "prettier --check ."
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@ripple-ts/cli": "0.2.153"
|
|
57
9
|
}
|
|
58
10
|
}
|
package/src/index.js
ADDED
package/dist/index.js
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as e}from"node:module";import{execSync as t}from"node:child_process";import{basename as n,dirname as r,join as i,relative as a,resolve as o}from"node:path";import{cpSync as s,existsSync as c,lstatSync as l,mkdirSync as u,readFileSync as d,readdirSync as f,rmSync as p,writeFileSync as m}from"node:fs";import h from"node:process";import{fileURLToPath as g}from"node:url";import _,{tmpdir as v}from"node:os";import y from"node:tty";var b=Object.create,x=Object.defineProperty,S=Object.getOwnPropertyDescriptor,C=Object.getOwnPropertyNames,ee=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),te=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=C(t),a=0,o=i.length,s;a<o;a++)s=i[a],!w.call(e,s)&&s!==n&&x(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=S(t,s))||r.enumerable});return e},E=(e,t,n)=>(n=e==null?{}:b(ee(e)),te(t||!e||!e.__esModule?x(n,`default`,{value:e,enumerable:!0}):n,e)),D=e(import.meta.url),ne=T((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),re=T((e=>{let{InvalidArgumentError:t}=ne();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)===`...`&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._concatValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),ie=T((e=>{let{humanReadableArgName:t}=re();e.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,t.subcommandTerm(n).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,t.optionTerm(n).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,t.optionTerm(n).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,t.argumentTerm(n).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(`, `)})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth||80;function i(e,i){if(i){let a=`${e.padEnd(n+2)}${i}`;return t.wrap(a,r-2,n+2)}return e}function a(e){return e.join(`
|
|
3
|
-
`).replace(/^/gm,` `.repeat(2))}let o=[`Usage: ${t.commandUsage(e)}`,``],s=t.commandDescription(e);s.length>0&&(o=o.concat([t.wrap(s,r,0),``]));let c=t.visibleArguments(e).map(e=>i(t.argumentTerm(e),t.argumentDescription(e)));c.length>0&&(o=o.concat([`Arguments:`,a(c),``]));let l=t.visibleOptions(e).map(e=>i(t.optionTerm(e),t.optionDescription(e)));if(l.length>0&&(o=o.concat([`Options:`,a(l),``])),this.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.optionTerm(e),t.optionDescription(e)));n.length>0&&(o=o.concat([`Global Options:`,a(n),``]))}let u=t.visibleCommands(e).map(e=>i(t.subcommandTerm(e),t.subcommandDescription(e)));return u.length>0&&(o=o.concat([`Commands:`,a(u),``])),o.join(`
|
|
4
|
-
`)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,r=40){let i=RegExp(`[\\n][ \\f\\t\\v\xA0 - ]+`);if(e.match(i))return e;let a=t-n;if(a<r)return e;let o=e.slice(0,n),s=e.slice(n).replace(`\r
|
|
5
|
-
`,`
|
|
6
|
-
`),c=` `.repeat(n),l=`\\s`,u=RegExp(`\n|.{1,${a-1}}([${l}]|$)|[^${l}]+?([${l}]|$)`,`g`);return o+(s.match(u)||[]).map((e,t)=>e===`
|
|
7
|
-
`?``:(t>0?c:``)+e.trimEnd()).join(`
|
|
8
|
-
`)}}})),ae=T((e=>{let{InvalidArgumentError:t}=ne();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.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}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._concatValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return i(this.name().replace(/^no-/,``))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r===void 0?!1:r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=e.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(t=r.shift()),n=r.shift(),!t&&/^-[^-]$/.test(n)&&(t=n,n=void 0),{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),oe=T((e=>{function t(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a=1;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function n(e,n){if(!n||n.length===0)return``;n=Array.from(new Set(n));let r=e.startsWith(`--`);r&&(e=e.slice(2),n=n.map(e=>e.slice(2)));let i=[],a=3;return n.forEach(n=>{if(n.length<=1)return;let r=t(e,n),o=Math.max(e.length,n.length);(o-r)/o>.4&&(r<a?(a=r,i=[n]):r===a&&i.push(n))}),i.sort((e,t)=>e.localeCompare(t)),r&&(i=i.map(e=>`--${e}`)),i.length>1?`\n(Did you mean one of ${i.join(`, `)}?)`:i.length===1?`\n(Did you mean ${i[0]}?)`:``}e.suggestSimilar=n})),se=T((e=>{let t=D(`node:events`).EventEmitter,n=D(`node:child_process`),r=D(`node:path`),i=D(`node:fs`),a=D(`node:process`),{Argument:o,humanReadableArgName:s}=re(),{CommanderError:c}=ne(),{Help:l}=ie(),{Option:u,DualOptions:d}=ae(),{suggestSimilar:f}=oe();var p=class e extends t{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,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._outputConfiguration={writeOut:e=>a.stdout.write(e),writeErr:e=>a.stderr.write(e),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:void 0,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new l,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
|
|
9
|
-
- specify the name in Command constructor or using .name()`);return t||={},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new o(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,this;e??=`help [command]`;let[,n,r]=e.match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
|
|
10
|
-
Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new c(e,t,n)),a.exit(e)}action(e){return this._actionHandler=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new u(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
11
|
-
- already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,`default`)}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._concatValue(t,a)),t??=e.negate?!1:e.isBoolean()||e.optional?!0:``,this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{r(t,`error: option '${e.flags}' argument '${t}' is invalid.`,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{r(t,`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof u)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,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(e=!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=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t||={},e===void 0&&t.from===void 0){a.versions?.electron&&(t.from=`electron`);let e=a.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=a.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:a.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let o=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function l(e,t){let n=r.resolve(e,t);if(i.existsSync(n))return n;if(s.includes(r.extname(t)))return;let a=s.find(e=>i.existsSync(`${n}${e}`));if(a)return`${n}${a}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=i.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=r.resolve(r.dirname(e),d)}if(d){let t=l(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=r.basename(this._scriptPath,r.extname(this._scriptPath));n!==this._name&&(t=l(d,`${n}-${e._name}`))}u=t||u}o=s.includes(r.extname(u));let f;a.platform===`win32`?(t.unshift(u),t=m(a.execArgv).concat(t),f=n.spawn(a.execPath,t,{stdio:`inherit`})):o?(t.unshift(u),t=m(a.execArgv).concat(t),f=n.spawn(a.argv[0],t,{stdio:`inherit`})):f=n.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{a.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new c(e,`commander.executeSubCommandAsync`,`(close)`)):a.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`){let t=d?`searched for local subcommand relative to directory '${d}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`,n=`'${u}' does not exist
|
|
12
|
-
- if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
13
|
-
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
14
|
-
- ${t}`;throw Error(n)}else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)a.exit(1);else{let e=new c(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0});let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent&&this.parent.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)===void 0?!1:this.getOptionValueSource(t)!==`default`});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t,i=e.slice();function a(e){return e.length>1&&e[0]===`-`}let o=null;for(;i.length;){let e=i.shift();if(e===`--`){r===n&&r.push(e),r.push(...i);break}if(o&&!a(e)){this.emit(`option:${o.name()}`,e);continue}if(o=null,a(e)){let t=this._findOption(e);if(t){if(t.required){let e=i.shift();e===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;i.length>0&&!a(i[0])&&(e=i.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(e.length>2&&e[0]===`-`&&e[1]!==`-`){let t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),i.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){let t=e.indexOf(`=`),n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,e.slice(t+1));continue}}if(a(e)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(e)){t.push(e),i.length>0&&n.push(...i);break}else if(this._getHelpCommand()&&e===this._getHelpCommand().name()){t.push(e),i.length>0&&t.push(...i);break}else if(this._defaultCommandName){n.push(e),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){r.push(e),i.length>0&&r.push(...i);break}r.push(e)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
15
|
-
`),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in a.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,a.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new d(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=f(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=f(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>s(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=r.basename(e,r.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e||={};let t={error:!!e.error},n;return n=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,n)),this.emit(`beforeHelp`,n);let r=this.helpInformation(n);if(t&&(r=t(r),typeof r!=`string`&&!Buffer.isBuffer(r)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(r),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,n),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,n))}helpOption(e,t){return typeof e==`boolean`?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e??=`-h, --help`,t??=`display help for command`,this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=a.exitCode||0;t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
|
|
16
|
-
Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function m(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}e.Command=p}));const{program:ce,createCommand:le,createArgument:ue,createOption:de,CommanderError:fe,InvalidArgumentError:pe,InvalidOptionArgumentError:me,Command:he,Argument:ge,Option:O,Help:_e}=E(T((e=>{let{Argument:t}=re(),{Command:n}=se(),{CommanderError:r,InvalidArgumentError:i}=ne(),{Help:a}=ie(),{Option:o}=ae();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i}))(),1).default;let ve,ye,be,xe,Se=!0;typeof process<`u`&&({FORCE_COLOR:ve,NODE_DISABLE_COLORS:ye,NO_COLOR:be,TERM:xe}=process.env||{},Se=process.stdout&&process.stdout.isTTY);const Ce={enabled:!ye&&be==null&&xe!==`dumb`&&(ve!=null&&ve!==`0`||Se)};function k(e,t){let n=RegExp(`\\x1b\\[${t}m`,`g`),r=`\x1b[${e}m`,i=`\x1b[${t}m`;return function(e){return!Ce.enabled||e==null?e:r+(~(``+e).indexOf(i)?e.replace(n,i+r):e)+i}}k(0,0),k(1,22);const we=k(2,22);k(3,23),k(4,24),k(7,27),k(8,28),k(9,29),k(30,39);const A=k(31,39),Te=k(32,39);k(33,39);const Ee=k(34,39);k(35,39);const De=k(36,39);k(37,39),k(90,39),k(90,39),k(40,49),k(41,49),k(42,49),k(43,49),k(44,49),k(45,49),k(46,49),k(47,49);function j(e){if(typeof e!=`string`||e==null)return{valid:!1,message:`Project name is required`};if(typeof e==`string`&&e.trim().length===0)return{valid:!1,message:`Project name cannot be empty`};let t=n(o(process.cwd(),e.trim()));return t.length>214?{valid:!1,message:`Project name must be less than 214 characters`}:/^[a-z0-9._-]+$/.test(t)?t.startsWith(`.`)||t.startsWith(`_`)?{valid:!1,message:`Project name cannot start with a dot or underscore`}:t.endsWith(`.`)?{valid:!1,message:`Project name cannot end with a dot`}:t.includes(`..`)?{valid:!1,message:`Project name cannot contain consecutive dots`}:[`node_modules`,`favicon.ico`,`con`,`prn`,`aux`,`nul`,`com1`,`com2`,`com3`,`com4`,`com5`,`com6`,`com7`,`com8`,`com9`,`lpt1`,`lpt2`,`lpt3`,`lpt4`,`lpt5`,`lpt6`,`lpt7`,`lpt8`,`lpt9`].includes(t.toLowerCase())?{valid:!1,message:`"${t}" is a reserved name and cannot be used`}:{valid:!0,message:``}:{valid:!1,message:`Project name can only contain lowercase letters, numbers, hyphens, dots, and underscores`}}var Oe=T((e=>{var t=D(`fs`),n=D(`path`),r=D(`events`),i=D(`stream`),a=D(`string_decoder`),o=D(`assert`),s=D(`buffer`),c=D(`zlib`),l=D(`util`),u=D(`crypto`),d=D(`os`),f=D(`tty`),p=D(`constants`),m=D(`https`),h=D(`child_process`),g=D(`url`),_=D(`net`),v=D(`tls`);function y(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var b=y(t),x=y(n),S=y(r),C=y(i),ee=y(a),w=y(o),T=y(s),te=y(c),E=y(l),ne=y(u),re=y(d),ie=y(f),ae=y(p),oe=y(m),se=y(h),ce=y(g),le=y(_),ue=y(v),de=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function fe(e){var t={exports:{}};return e(t,t.exports),t.exports}let pe=new Map([[`C`,`cwd`],[`f`,`file`],[`z`,`gzip`],[`P`,`preservePaths`],[`U`,`unlink`],[`strip-components`,`strip`],[`stripComponents`,`strip`],[`keep-newer`,`newer`],[`keepNewer`,`newer`],[`keep-newer-files`,`newer`],[`keepNewerFiles`,`newer`],[`k`,`keep`],[`keep-existing`,`keep`],[`keepExisting`,`keep`],[`m`,`noMtime`],[`no-mtime`,`noMtime`],[`p`,`preserveOwner`],[`L`,`follow`],[`h`,`follow`]]);var me=e=>e?Object.keys(e).map(t=>[pe.has(t)?pe.get(t):t,e[t]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{},he=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}},ge=O;O.Node=be,O.create=O;function O(e){var t=this;if(t instanceof O||(t=new O),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach==`function`)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}O.prototype.removeNode=function(e){if(e.list!==this)throw Error(`removing node which does not belong to this list`);var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},O.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||=e,this.length++}},O.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||=e,this.length++}},O.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)ve(this,arguments[e]);return this.length},O.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)ye(this,arguments[e]);return this.length},O.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},O.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},O.prototype.forEach=function(e,t){t||=this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next},O.prototype.forEachReverse=function(e,t){t||=this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev},O.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value},O.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value},O.prototype.map=function(e,t){t||=this;for(var n=new O,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n},O.prototype.mapReverse=function(e,t){t||=this;for(var n=new O,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n},O.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw TypeError(`Reduce of empty list with no initial value`);for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n},O.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw TypeError(`Reduce of empty list with no initial value`);for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n},O.prototype.toArray=function(){for(var e=Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e},O.prototype.toArrayReverse=function(){for(var e=Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e},O.prototype.slice=function(e,t){t||=this.length,t<0&&(t+=this.length),e||=0,e<0&&(e+=this.length);var n=new O;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(;i!==null&&r<t;r++,i=i.next)n.push(i.value);return n},O.prototype.sliceReverse=function(e,t){t||=this.length,t<0&&(t+=this.length),e||=0,e<0&&(e+=this.length);var n=new O;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,i=this.tail;i!==null&&r>t;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)n.push(i.value);return n},O.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(var a=[],r=0;i&&r<t;r++)a.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=_e(this,i,n[r]);return a},O.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function _e(e,t,n){var r=t===e.head?new be(n,null,t,e):new be(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function ve(e,t){e.tail=new be(t,e.tail,null,e),e.head||=e.tail,e.length++}function ye(e,t){e.head=new be(t,null,e.head,e),e.tail||=e.head,e.length++}function be(e,t,n,r){if(!(this instanceof be))return new be(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{he(O)}catch{}let xe=ee.default.StringDecoder,Se=Symbol(`EOF`),Ce=Symbol(`maybeEmitEnd`),k=Symbol(`emittedEnd`),we=Symbol(`emittingEnd`),A=Symbol(`closed`),Te=Symbol(`read`),Ee=Symbol(`flush`),De=Symbol(`flushChunk`),j=Symbol(`encoding`),Oe=Symbol(`decoder`),ke=Symbol(`flowing`),Ae=Symbol(`paused`),je=Symbol(`resume`),M=Symbol(`bufferLength`),Me=Symbol(`bufferPush`),Ne=Symbol(`bufferShift`),N=Symbol(`objectMode`),P=Symbol(`destroyed`),Pe=de._MP_NO_ITERATOR_SYMBOLS_!==`1`,Fe=Pe&&Symbol.asyncIterator||Symbol(`asyncIterator not implemented`),F=Pe&&Symbol.iterator||Symbol(`iterator not implemented`),Ie=e=>e===`end`||e===`finish`||e===`prefinish`,Le=e=>e instanceof ArrayBuffer||typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,I=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e);var Re=class e extends C.default{constructor(e){super(),this[ke]=!1,this[Ae]=!1,this.pipes=new ge,this.buffer=new ge,this[N]=e&&e.objectMode||!1,this[N]?this[j]=null:this[j]=e&&e.encoding||null,this[j]===`buffer`&&(this[j]=null),this[Oe]=this[j]?new xe(this[j]):null,this[Se]=!1,this[k]=!1,this[we]=!1,this[A]=!1,this.writable=!0,this.readable=!0,this[M]=0,this[P]=!1}get bufferLength(){return this[M]}get encoding(){return this[j]}set encoding(e){if(this[N])throw Error(`cannot set encoding in objectMode`);if(this[j]&&e!==this[j]&&(this[Oe]&&this[Oe].lastNeed||this[M]))throw Error(`cannot change encoding`);this[j]!==e&&(this[Oe]=e?new xe(e):null,this.buffer.length&&(this.buffer=this.buffer.map(e=>this[Oe].write(e)))),this[j]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[N]}set objectMode(e){this[N]=this[N]||!!e}write(e,t,n){if(this[Se])throw Error(`write after end`);return this[P]?(this.emit(`error`,Object.assign(Error(`Cannot call write after a stream was destroyed`),{code:`ERR_STREAM_DESTROYED`})),!0):(typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`,!this[N]&&!Buffer.isBuffer(e)&&(I(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Le(e)?e=Buffer.from(e):typeof e!=`string`&&(this.objectMode=!0)),!this.objectMode&&!e.length?(this[M]!==0&&this.emit(`readable`),n&&n(),this.flowing):(typeof e==`string`&&!this[N]&&!(t===this[j]&&!this[Oe].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[j]&&(e=this[Oe].write(e)),this.flowing?(this[M]!==0&&this[Ee](!0),this.emit(`data`,e)):this[Me](e),this[M]!==0&&this.emit(`readable`),n&&n(),this.flowing))}read(e){if(this[P])return null;try{return this[M]===0||e===0||e>this[M]?null:(this[N]&&(e=null),this.buffer.length>1&&!this[N]&&(this.encoding?this.buffer=new ge([Array.from(this.buffer).join(``)]):this.buffer=new ge([Buffer.concat(Array.from(this.buffer),this[M])])),this[Te](e||null,this.buffer.head.value))}finally{this[Ce]()}}[Te](e,t){return e===t.length||e===null?this[Ne]():(this.buffer.head.value=t.slice(e),t=t.slice(0,e),this[M]-=e),this.emit(`data`,t),!this.buffer.length&&!this[Se]&&this.emit(`drain`),t}end(e,t,n){return typeof e==`function`&&(n=e,e=null),typeof t==`function`&&(n=t,t=`utf8`),e&&this.write(e,t),n&&this.once(`end`,n),this[Se]=!0,this.writable=!1,(this.flowing||!this[Ae])&&this[Ce](),this}[je](){this[P]||(this[Ae]=!1,this[ke]=!0,this.emit(`resume`),this.buffer.length?this[Ee]():this[Se]?this[Ce]():this.emit(`drain`))}resume(){return this[je]()}pause(){this[ke]=!1,this[Ae]=!0}get destroyed(){return this[P]}get flowing(){return this[ke]}get paused(){return this[Ae]}[Me](e){return this[N]?this[M]+=1:this[M]+=e.length,this.buffer.push(e)}[Ne](){return this.buffer.length&&(this[N]?--this[M]:this[M]-=this.buffer.head.value.length),this.buffer.shift()}[Ee](e){do;while(this[De](this[Ne]()));!e&&!this.buffer.length&&!this[Se]&&this.emit(`drain`)}[De](e){return e?(this.emit(`data`,e),this.flowing):!1}pipe(e,t){if(this[P])return;let n=this[k];t||={},e===process.stdout||e===process.stderr?t.end=!1:t.end=t.end!==!1;let r={dest:e,opts:t,ondrain:e=>this[je]()};return this.pipes.push(r),e.on(`drain`,r.ondrain),this[je](),n&&r.opts.end&&r.dest.end(),e}addListener(e,t){return this.on(e,t)}on(e,t){try{return super.on(e,t)}finally{e===`data`&&!this.pipes.length&&!this.flowing?this[je]():Ie(e)&&this[k]&&(super.emit(e),this.removeAllListeners(e))}}get emittedEnd(){return this[k]}[Ce](){!this[we]&&!this[k]&&!this[P]&&this.buffer.length===0&&this[Se]&&(this[we]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[A]&&this.emit(`close`),this[we]=!1)}emit(e,t){if(e!==`error`&&e!==`close`&&e!==P&&this[P])return;if(e===`data`){if(!t)return;this.pipes.length&&this.pipes.forEach(e=>e.dest.write(t)===!1&&this.pause())}else if(e===`end`){if(this[k]===!0)return;this[k]=!0,this.readable=!1,this[Oe]&&(t=this[Oe].end(),t&&(this.pipes.forEach(e=>e.dest.write(t)),super.emit(`data`,t))),this.pipes.forEach(e=>{e.dest.removeListener(`drain`,e.ondrain),e.opts.end&&e.dest.end()})}else if(e===`close`&&(this[A]=!0,!this[k]&&!this[P]))return;let n=Array(arguments.length);if(n[0]=e,n[1]=t,arguments.length>2)for(let e=2;e<arguments.length;e++)n[e]=arguments[e];try{return super.emit.apply(this,n)}finally{Ie(e)?this.removeAllListeners(e):this[Ce]()}}collect(){let e=[];this[N]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[N]||(e.dataLength+=t.length)}),t.then(()=>e)}concat(){return this[N]?Promise.reject(Error(`cannot concat in objectMode`)):this.collect().then(e=>this[N]?Promise.reject(Error(`cannot concat in objectMode`)):this[j]?e.join(``):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(P,()=>t(Error(`stream destroyed`))),this.on(`end`,()=>e()),this.on(`error`,e=>t(e))})}[Fe](){return{next:()=>{let e=this.read();if(e!==null)return Promise.resolve({done:!1,value:e});if(this[Se])return Promise.resolve({done:!0});let t=null,n=null,r=e=>{this.removeListener(`data`,i),this.removeListener(`end`,a),n(e)},i=e=>{this.removeListener(`error`,r),this.removeListener(`end`,a),this.pause(),t({value:e,done:!!this[Se]})},a=()=>{this.removeListener(`error`,r),this.removeListener(`data`,i),t({done:!0})},o=()=>r(Error(`stream destroyed`));return new Promise((e,s)=>{n=s,t=e,this.once(P,o),this.once(`error`,r),this.once(`end`,a),this.once(`data`,i)})}}}[F](){return{next:()=>{let e=this.read();return{value:e,done:e===null}}}}destroy(e){return this[P]?(e?this.emit(`error`,e):this.emit(P),this):(this[P]=!0,this.buffer=new ge,this[M]=0,typeof this.close==`function`&&!this[A]&&this.close(),e?this.emit(`error`,e):this.emit(P),this)}static isStream(t){return!!t&&(t instanceof e||t instanceof C.default||t instanceof S.default&&(typeof t.pipe==`function`||typeof t.write==`function`&&typeof t.end==`function`))}};let ze=te.default.constants||{ZLIB_VERNUM:4736};var Be=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},ze)),Ve=fe(function(e,t){let n=T.default.Buffer,r=t.constants=Be,i=n.concat,a=Symbol(`_superWrite`);class o extends Error{constructor(e){super(`zlib: `+e.message),this.code=e.code,this.errno=e.errno,this.code||=`ZLIB_ERROR`,this.message=`zlib: `+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return`ZlibError`}}let s=Symbol(`opts`),c=Symbol(`flushFlag`),l=Symbol(`finishFlushFlag`),u=Symbol(`fullFlushFlag`),d=Symbol(`handle`),f=Symbol(`onError`),p=Symbol(`sawError`),m=Symbol(`level`),h=Symbol(`strategy`),g=Symbol(`ended`);class _ extends Re{constructor(e,t){if(!e||typeof e!=`object`)throw TypeError(`invalid options for ZlibBase constructor`);super(e),this[p]=!1,this[g]=!1,this[s]=e,this[c]=e.flush,this[l]=e.finishFlush;try{this[d]=new te.default[t](e)}catch(e){throw new o(e)}this[f]=e=>{this[p]||(this[p]=!0,this.close(),this.emit(`error`,e))},this[d].on(`error`,e=>this[f](new o(e))),this.once(`end`,()=>this.close)}close(){this[d]&&(this[d].close(),this[d]=null,this.emit(`close`))}reset(){if(!this[p])return w.default(this[d],`zlib binding closed`),this[d].reset()}flush(e){this.ended||(typeof e!=`number`&&(e=this[u]),this.write(Object.assign(n.alloc(0),{[c]:e})))}end(e,t,n){return e&&this.write(e,t),this.flush(this[l]),this[g]=!0,super.end(null,null,n)}get ended(){return this[g]}write(e,t,r){if(typeof t==`function`&&(r=t,t=`utf8`),typeof e==`string`&&(e=n.from(e,t)),this[p])return;w.default(this[d],`zlib binding closed`);let s=this[d]._handle,l=s.close;s.close=()=>{};let u=this[d].close;this[d].close=()=>{},n.concat=e=>e;let m;try{let t=typeof e[c]==`number`?e[c]:this[c];m=this[d]._processChunk(e,t),n.concat=i}catch(e){n.concat=i,this[f](new o(e))}finally{this[d]&&(this[d]._handle=s,s.close=l,this[d].close=u,this[d].removeAllListeners(`error`))}this[d]&&this[d].on(`error`,e=>this[f](new o(e)));let h;if(m)if(Array.isArray(m)&&m.length>0){h=this[a](n.from(m[0]));for(let e=1;e<m.length;e++)h=this[a](m[e])}else h=this[a](n.from(m));return r&&r(),h}[a](e){return super.write(e)}}class v extends _{constructor(e,t){e||={},e.flush=e.flush||r.Z_NO_FLUSH,e.finishFlush=e.finishFlush||r.Z_FINISH,super(e,t),this[u]=r.Z_FULL_FLUSH,this[m]=e.level,this[h]=e.strategy}params(e,t){if(!this[p]){if(!this[d])throw Error(`cannot switch params when binding is closed`);if(!this[d].params)throw Error(`not supported in this implementation`);if(this[m]!==e||this[h]!==t){this.flush(r.Z_SYNC_FLUSH),w.default(this[d],`zlib binding closed`);let n=this[d].flush;this[d].flush=(e,t)=>{this.flush(e),t()};try{this[d].params(e,t)}finally{this[d].flush=n}this[d]&&(this[m]=e,this[h]=t)}}}}class y extends v{constructor(e){super(e,`Deflate`)}}class b extends v{constructor(e){super(e,`Inflate`)}}let x=Symbol(`_portable`);class S extends v{constructor(e){super(e,`Gzip`),this[x]=e&&!!e.portable}[a](e){return this[x]?(this[x]=!1,e[9]=255,super[a](e)):super[a](e)}}class C extends v{constructor(e){super(e,`Gunzip`)}}class ee extends v{constructor(e){super(e,`DeflateRaw`)}}class E extends v{constructor(e){super(e,`InflateRaw`)}}class D extends v{constructor(e){super(e,`Unzip`)}}class ne extends _{constructor(e,t){e||={},e.flush=e.flush||r.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||r.BROTLI_OPERATION_FINISH,super(e,t),this[u]=r.BROTLI_OPERATION_FLUSH}}class re extends ne{constructor(e){super(e,`BrotliCompress`)}}class ie extends ne{constructor(e){super(e,`BrotliDecompress`)}}t.Deflate=y,t.Inflate=b,t.Gzip=S,t.Gunzip=C,t.DeflateRaw=ee,t.InflateRaw=E,t.Unzip=D,typeof te.default.BrotliCompress==`function`?(t.BrotliCompress=re,t.BrotliDecompress=ie):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw Error(`Brotli is not supported in this version of Node.js`)}}});let He=Symbol(`slurp`);var Ue=class extends Re{constructor(e,t,n){switch(super(),this.pause(),this.extended=t,this.globalExtended=n,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case`File`:case`OldFile`:case`Link`:case`SymbolicLink`:case`CharacterDevice`:case`BlockDevice`:case`Directory`:case`FIFO`:case`ContiguousFile`:case`GNUDumpDir`:break;case`NextFileHasLongLinkpath`:case`NextFileHasLongPath`:case`OldGnuLongPath`:case`GlobalExtendedHeader`:case`ExtendedHeader`:case`OldExtendedHeader`:this.meta=!0;break;default:this.ignore=!0}this.path=e.path,this.mode=e.mode,this.mode&&(this.mode&=4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath,this.uname=e.uname,this.gname=e.gname,t&&this[He](t),n&&this[He](n,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw Error(`writing more to entry than is appropriate`);let n=this.remain,r=this.blockRemain;return this.remain=Math.max(0,n-t),this.blockRemain=Math.max(0,r-t),this.ignore?!0:n>=t?super.write(e):super.write(e.slice(0,n))}[He](e,t){for(let n in e)e[n]!==null&&e[n]!==void 0&&!(t&&n===`path`)&&(this[n]=e[n])}},L=fe(function(e,t){t.name=new Map([[`0`,`File`],[``,`OldFile`],[`1`,`Link`],[`2`,`SymbolicLink`],[`3`,`CharacterDevice`],[`4`,`BlockDevice`],[`5`,`Directory`],[`6`,`FIFO`],[`7`,`ContiguousFile`],[`g`,`GlobalExtendedHeader`],[`x`,`ExtendedHeader`],[`A`,`SolarisACL`],[`D`,`GNUDumpDir`],[`I`,`Inode`],[`K`,`NextFileHasLongLinkpath`],[`L`,`NextFileHasLongPath`],[`M`,`ContinuationFile`],[`N`,`OldGnuLongPath`],[`S`,`SparseFile`],[`V`,`TapeVolumeHeader`],[`X`,`OldExtendedHeader`]]),t.code=new Map(Array.from(t.name).map(e=>[e[1],e[0]]))});let We=(e,t)=>{if(Number.isSafeInteger(e))e<0?Ke(e,t):Ge(e,t);else throw Error(`cannot encode number outside of javascript safe integer range`);return t},Ge=(e,t)=>{t[0]=128;for(var n=t.length;n>1;n--)t[n-1]=e&255,e=Math.floor(e/256)},Ke=(e,t)=>{t[0]=255;var n=!1;e*=-1;for(var r=t.length;r>1;r--){var i=e&255;e=Math.floor(e/256),n?t[r-1]=Xe(i):i===0?t[r-1]=0:(n=!0,t[r-1]=Ze(i))}},qe=e=>{let t=e[0],n=t===128?Ye(e.slice(1,e.length)):t===255?Je(e):null;if(n===null)throw Error(`invalid base256 encoding`);if(!Number.isSafeInteger(n))throw Error(`parsed number outside of javascript safe integer range`);return n},Je=e=>{for(var t=e.length,n=0,r=!1,i=t-1;i>-1;i--){var a=e[i],o;r?o=Xe(a):a===0?o=a:(r=!0,o=Ze(a)),o!==0&&(n-=o*256**(t-i-1))}return n},Ye=e=>{for(var t=e.length,n=0,r=t-1;r>-1;r--){var i=e[r];i!==0&&(n+=i*256**(t-r-1))}return n},Xe=e=>(255^e)&255,Ze=e=>(255^e)+1&255;var Qe={encode:We,parse:qe};let $e=x.default.posix,et=Symbol(`slurp`),tt=Symbol(`type`);var nt=class{constructor(e,t,n,r){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[tt]=`0`,this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,n,r):e&&this.set(e)}decode(e,t,n,r){if(t||=0,!e||!(e.length>=t+512))throw Error(`need 512 bytes for header`);if(this.path=it(e,t,100),this.mode=st(e,t+100,8),this.uid=st(e,t+108,8),this.gid=st(e,t+116,8),this.size=st(e,t+124,12),this.mtime=at(e,t+136,12),this.cksum=st(e,t+148,12),this[et](n),this[et](r,!0),this[tt]=it(e,t+156,1),this[tt]===``&&(this[tt]=`0`),this[tt]===`0`&&this.path.substr(-1)===`/`&&(this[tt]=`5`),this[tt]===`5`&&(this.size=0),this.linkpath=it(e,t+157,100),e.slice(t+257,t+265).toString()===`ustar\x0000`)if(this.uname=it(e,t+265,32),this.gname=it(e,t+297,32),this.devmaj=st(e,t+329,8),this.devmin=st(e,t+337,8),e[t+475]!==0)this.path=it(e,t+345,155)+`/`+this.path;else{let n=it(e,t+345,130);n&&(this.path=n+`/`+this.path),this.atime=at(e,t+476,12),this.ctime=at(e,t+488,12)}let i=256;for(let n=t;n<t+148;n++)i+=e[n];for(let n=t+156;n<t+512;n++)i+=e[n];this.cksumValid=i===this.cksum,this.cksum===null&&i===256&&(this.nullBlock=!0)}[et](e,t){for(let n in e)e[n]!==null&&e[n]!==void 0&&!(t&&n===`path`)&&(this[n]=e[n])}encode(e,t){if(e||(e=this.block=Buffer.alloc(512),t=0),t||=0,!(e.length>=t+512))throw Error(`need 512 bytes for header`);let n=this.ctime||this.atime?130:155,r=rt(this.path||``,n),i=r[0],a=r[1];this.needPax=r[2],this.needPax=_t(e,t,100,i)||this.needPax,this.needPax=dt(e,t+100,8,this.mode)||this.needPax,this.needPax=dt(e,t+108,8,this.uid)||this.needPax,this.needPax=dt(e,t+116,8,this.gid)||this.needPax,this.needPax=dt(e,t+124,12,this.size)||this.needPax,this.needPax=ht(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[tt].charCodeAt(0),this.needPax=_t(e,t+157,100,this.linkpath)||this.needPax,e.write(`ustar\x0000`,t+257,8),this.needPax=_t(e,t+265,32,this.uname)||this.needPax,this.needPax=_t(e,t+297,32,this.gname)||this.needPax,this.needPax=dt(e,t+329,8,this.devmaj)||this.needPax,this.needPax=dt(e,t+337,8,this.devmin)||this.needPax,this.needPax=_t(e,t+345,n,a)||this.needPax,e[t+475]===0?(this.needPax=_t(e,t+345,130,a)||this.needPax,this.needPax=ht(e,t+476,12,this.atime)||this.needPax,this.needPax=ht(e,t+488,12,this.ctime)||this.needPax):this.needPax=_t(e,t+345,155,a)||this.needPax;let o=256;for(let n=t;n<t+148;n++)o+=e[n];for(let n=t+156;n<t+512;n++)o+=e[n];return this.cksum=o,dt(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let t in e)e[t]!==null&&e[t]!==void 0&&(this[t]=e[t])}get type(){return L.name.get(this[tt])||this[tt]}get typeKey(){return this[tt]}set type(e){L.code.has(e)?this[tt]=L.code.get(e):this[tt]=e}};let rt=(e,t)=>{let n=e,r=``,i,a=$e.parse(e).root||`.`;if(Buffer.byteLength(n)<100)i=[n,r,!1];else{r=$e.dirname(n),n=$e.basename(n);do Buffer.byteLength(n)<=100&&Buffer.byteLength(r)<=t?i=[n,r,!1]:Buffer.byteLength(n)>100&&Buffer.byteLength(r)<=t?i=[n.substr(0,99),r,!0]:(n=$e.join($e.basename(r),n),r=$e.dirname(r));while(r!==a&&!i);i||=[e.substr(0,99),``,!0]}return i},it=(e,t,n)=>e.slice(t,t+n).toString(`utf8`).replace(/\0.*/,``),at=(e,t,n)=>ot(st(e,t,n)),ot=e=>e===null?null:new Date(e*1e3),st=(e,t,n)=>e[t]&128?Qe.parse(e.slice(t,t+n)):lt(e,t,n),ct=e=>isNaN(e)?null:e,lt=(e,t,n)=>ct(parseInt(e.slice(t,t+n).toString(`utf8`).replace(/\0.*$/,``).trim(),8)),ut={12:8589934591,8:2097151},dt=(e,t,n,r)=>r===null?!1:r>ut[n]||r<0?(Qe.encode(r,e.slice(t,t+n)),!0):(ft(e,t,n,r),!1),ft=(e,t,n,r)=>e.write(pt(r,n),t,n,`ascii`),pt=(e,t)=>mt(Math.floor(e).toString(8),t),mt=(e,t)=>(e.length===t-1?e:Array(t-e.length-1).join(`0`)+e+` `)+`\0`,ht=(e,t,n,r)=>r===null?!1:dt(e,t,n,r.getTime()/1e3),gt=Array(156).join(`\0`),_t=(e,t,n,r)=>r===null?!1:(e.write(r+gt,t,n,`utf8`),r.length!==Buffer.byteLength(r)||r.length>n);var vt=nt,yt=class{constructor(e,t){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=t||!1}encode(){let e=this.encodeBody();if(e===``)return null;let t=Buffer.byteLength(e),n=512*Math.ceil(1+t/512),r=Buffer.allocUnsafe(n);for(let e=0;e<512;e++)r[e]=0;new vt({path:(`PaxHeader/`+x.default.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?`GlobalExtendedHeader`:`ExtendedHeader`,linkpath:``,uname:this.uname||``,gname:this.gname||``,devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(r),r.write(e,512,t,`utf8`);for(let e=t+512;e<r.length;e++)r[e]=0;return r}encodeBody(){return this.encodeField(`path`)+this.encodeField(`ctime`)+this.encodeField(`atime`)+this.encodeField(`dev`)+this.encodeField(`ino`)+this.encodeField(`nlink`)+this.encodeField(`charset`)+this.encodeField(`comment`)+this.encodeField(`gid`)+this.encodeField(`gname`)+this.encodeField(`linkpath`)+this.encodeField(`mtime`)+this.encodeField(`size`)+this.encodeField(`uid`)+this.encodeField(`uname`)}encodeField(e){if(this[e]===null||this[e]===void 0)return``;let t=this[e]instanceof Date?this[e].getTime()/1e3:this[e],n=` `+(e===`dev`||e===`ino`||e===`nlink`?`SCHILY.`:``)+e+`=`+t+`
|
|
17
|
-
`,r=Buffer.byteLength(n),i=Math.floor(Math.log(r)/Math.log(10))+1;return r+i>=10**i&&(i+=1),i+r+n}};yt.parse=(e,t,n)=>new yt(bt(xt(e),t),n);let bt=(e,t)=>t?Object.keys(e).reduce((t,n)=>(t[n]=e[n],t),t):e,xt=e=>e.replace(/\n$/,``).split(`
|
|
18
|
-
`).reduce(St,Object.create(null)),St=(e,t)=>{let n=parseInt(t,10);if(n!==Buffer.byteLength(t)+1)return e;t=t.substr((n+` `).length);let r=t.split(`=`),i=r.shift().replace(/^SCHILY\.(dev|ino|nlink)/,`$1`);if(!i)return e;let a=r.join(`=`);return e[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(a*1e3):/^[0-9]+$/.test(a)?+a:a,e};var Ct=yt,wt=e=>class extends e{warn(e,t,n={}){this.file&&(n.file=this.file),this.cwd&&(n.cwd=this.cwd),n.code=t instanceof Error&&t.code||e,n.tarCode=e,!this.strict&&n.recoverable!==!1?(t instanceof Error&&(n=Object.assign(t,n),t=t.message),this.emit(`warn`,n.tarCode,t,n)):t instanceof Error?this.emit(`error`,Object.assign(t,n)):this.emit(`error`,Object.assign(Error(`${e}: ${t}`),n))}};let Tt=[`|`,`<`,`>`,`?`,`:`],Et=Tt.map(e=>String.fromCharCode(61440+e.charCodeAt(0))),Dt=new Map(Tt.map((e,t)=>[e,Et[t]])),Ot=new Map(Et.map((e,t)=>[e,Tt[t]]));var kt={encode:e=>Tt.reduce((e,t)=>e.split(t).join(Dt.get(t)),e),decode:e=>Et.reduce((e,t)=>e.split(t).join(Ot.get(t)),e)},At=(e,t,n)=>(e&=4095,n&&(e=(e|384)&-19),t&&(e&256&&(e|=64),e&32&&(e|=8),e&4&&(e|=1)),e);let jt=Symbol(`process`),Mt=Symbol(`file`),Nt=Symbol(`directory`),Pt=Symbol(`symlink`),Ft=Symbol(`hardlink`),It=Symbol(`header`),Lt=Symbol(`read`),Rt=Symbol(`lstat`),zt=Symbol(`onlstat`),Bt=Symbol(`onread`),Vt=Symbol(`onreadlink`),Ht=Symbol(`openfile`),Ut=Symbol(`onopenfile`),Wt=Symbol(`close`),Gt=Symbol(`mode`),Kt=wt(class extends Re{constructor(e,t){if(t||={},super(t),typeof e!=`string`)throw TypeError(`path is required`);this.path=e,this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid(),this.myuser=process.env.USER||``,this.maxReadSize=t.maxReadSize||16777216,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=t.cwd||process.cwd(),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,typeof t.onwarn==`function`&&this.on(`warn`,t.onwarn);let n=!1;if(!this.preservePaths&&x.default.win32.isAbsolute(e)){let t=x.default.win32.parse(e);this.path=e.substr(t.root.length),n=t.root}this.win32=!!t.win32||process.platform===`win32`,this.win32&&(this.path=kt.decode(this.path.replace(/\\/g,`/`)),e=e.replace(/\\/g,`/`)),this.absolute=t.absolute||x.default.resolve(this.cwd,e),this.path===``&&(this.path=`./`),n&&this.warn(`TAR_ENTRY_INFO`,`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.statCache.has(this.absolute)?this[zt](this.statCache.get(this.absolute)):this[Rt]()}[Rt](){b.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit(`error`,e);this[zt](t)})}[zt](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Yt(e),this.emit(`stat`,e),this[jt]()}[jt](){switch(this.type){case`File`:return this[Mt]();case`Directory`:return this[Nt]();case`SymbolicLink`:return this[Pt]();default:return this.end()}}[Gt](e){return At(e,this.type===`Directory`,this.portable)}[It](){this.type===`Directory`&&this.portable&&(this.noMtime=!0),this.header=new vt({path:this.path,linkpath:this.linkpath,mode:this[Gt](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:``,atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&this.write(new Ct({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),this.write(this.header.block)}[Nt](){this.path.substr(-1)!==`/`&&(this.path+=`/`),this.stat.size=0,this[It](),this.end()}[Pt](){b.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit(`error`,e);this[Vt](t)})}[Vt](e){this.linkpath=e.replace(/\\/g,`/`),this[It](),this.end()}[Ft](e){this.type=`Link`,this.linkpath=x.default.relative(this.cwd,e).replace(/\\/g,`/`),this.stat.size=0,this[It](),this.end()}[Mt](){if(this.stat.nlink>1){let e=this.stat.dev+`:`+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[Ft](t)}this.linkCache.set(e,this.absolute)}if(this[It](),this.stat.size===0)return this.end();this[Ht]()}[Ht](){b.default.open(this.absolute,`r`,(e,t)=>{if(e)return this.emit(`error`,e);this[Ut](t)})}[Ut](e){let t=512*Math.ceil(this.stat.size/512),n=Math.min(t,this.maxReadSize),r=Buffer.allocUnsafe(n);this[Lt](e,r,0,r.length,0,this.stat.size,t)}[Lt](e,t,n,r,i,a,o){b.default.read(e,t,n,r,i,(s,c)=>{if(s)return this[Wt](e,()=>this.emit(`error`,s));this[Bt](e,t,n,r,i,a,o,c)})}[Wt](e,t){b.default.close(e,t)}[Bt](e,t,n,r,i,a,o,s){if(s<=0&&a>0){let t=Error(`encountered unexpected EOF`);return t.path=this.absolute,t.syscall=`read`,t.code=`EOF`,this[Wt](e,()=>this.emit(`error`,t))}if(s>a){let t=Error(`did not encounter expected EOF`);return t.path=this.absolute,t.syscall=`read`,t.code=`EOF`,this[Wt](e,()=>this.emit(`error`,t))}if(s===a)for(let e=s;e<r&&s<o;e++)t[e+n]=0,s++,a++;let c=n===0&&s===t.length?t:t.slice(n,n+s);if(a-=s,o-=s,i+=s,n+=s,this.write(c),!a)return o&&this.write(Buffer.alloc(o)),this[Wt](e,e=>e?this.emit(`error`,e):this.end());n>=r&&(t=Buffer.allocUnsafe(r),n=0),r=t.length-n,this[Lt](e,t,n,r,i,a,o)}});var qt=class extends Kt{[Rt](){this[zt](b.default.lstatSync(this.absolute))}[Pt](){this[Vt](b.default.readlinkSync(this.absolute))}[Ht](){this[Ut](b.default.openSync(this.absolute,`r`))}[Lt](e,t,n,r,i,a,o){let s=!0;try{let c=b.default.readSync(e,t,n,r,i);this[Bt](e,t,n,r,i,a,o,c),s=!1}finally{if(s)try{this[Wt](e,()=>{})}catch{}}}[Wt](e,t){b.default.closeSync(e),t()}};let Jt=wt(class extends Re{constructor(e,t){t||={},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type===`Directory`&&this.portable&&(this.noMtime=!0),this.path=e.path,this.mode=this[Gt](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=e.linkpath,typeof t.onwarn==`function`&&this.on(`warn`,t.onwarn);let n=!1;if(x.default.isAbsolute(this.path)&&!this.preservePaths){let e=x.default.parse(this.path);n=e.root,this.path=this.path.substr(e.root.length)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new vt({path:this.path,linkpath:this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),n&&this.warn(`TAR_ENTRY_INFO`,`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new Ct({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this.path,linkpath:this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[Gt](e){return At(e,this.type===`Directory`,this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw Error(`writing more to entry than is appropriate`);return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&this.write(Buffer.alloc(this.blockRemain)),super.end()}});Kt.Sync=qt,Kt.Tar=Jt;let Yt=e=>e.isFile()?`File`:e.isDirectory()?`Directory`:e.isSymbolicLink()?`SymbolicLink`:`Unsupported`;var Xt=Kt,Zt=class{constructor(e,t){this.path=e||`./`,this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}};let Qt=Xt.Sync,$t=Xt.Tar,R=Buffer.alloc(1024),en=Symbol(`onStat`),tn=Symbol(`ended`),nn=Symbol(`queue`),z=Symbol(`current`),B=Symbol(`process`),V=Symbol(`processing`),rn=Symbol(`processJob`),an=Symbol(`jobs`),on=Symbol(`jobDone`),sn=Symbol(`addFSEntry`),cn=Symbol(`addTarEntry`),ln=Symbol(`stat`),un=Symbol(`readdir`),dn=Symbol(`onreaddir`),fn=Symbol(`pipe`),pn=Symbol(`entry`),mn=Symbol(`entryOpt`),hn=Symbol(`writeEntryClass`),gn=Symbol(`write`),_n=Symbol(`ondrain`),vn=wt(class extends Re{constructor(e){super(e),e||=Object.create(null),this.opt=e,this.file=e.file||``,this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(e.prefix||``).replace(/(\\|\/)+$/,``),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[hn]=Xt,typeof e.onwarn==`function`&&this.on(`warn`,e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!=`object`&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new Ve.Gzip(e.gzip),this.zip.on(`data`,e=>super.write(e)),this.zip.on(`end`,e=>super.end()),this.zip.on(`drain`,e=>this[_n]()),this.on(`resume`,e=>this.zip.resume())):this.on(`drain`,this[_n]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter==`function`?e.filter:e=>!0,this[nn]=new ge,this[an]=0,this.jobs=+e.jobs||4,this[V]=!1,this[tn]=!1}[gn](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[tn]=!0,this[B](),this}write(e){if(this[tn])throw Error(`write after end`);return e instanceof Ue?this[cn](e):this[sn](e),this.flowing}[cn](e){let t=x.default.resolve(this.cwd,e.path);if(this.prefix&&(e.path=this.prefix+`/`+e.path.replace(/^\.(\/+|$)/,``)),!this.filter(e.path,e))e.resume();else{let n=new Zt(e.path,t,!1);n.entry=new $t(e,this[mn](n)),n.entry.on(`end`,e=>this[on](n)),this[an]+=1,this[nn].push(n)}this[B]()}[sn](e){let t=x.default.resolve(this.cwd,e);this.prefix&&(e=this.prefix+`/`+e.replace(/^\.(\/+|$)/,``)),this[nn].push(new Zt(e,t)),this[B]()}[ln](e){e.pending=!0,this[an]+=1;let t=this.follow?`stat`:`lstat`;b.default[t](e.absolute,(t,n)=>{e.pending=!1,--this[an],t?this.emit(`error`,t):this[en](e,n)})}[en](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[B]()}[un](e){e.pending=!0,this[an]+=1,b.default.readdir(e.absolute,(t,n)=>{if(e.pending=!1,--this[an],t)return this.emit(`error`,t);this[dn](e,n)})}[dn](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[B]()}[B](){if(!this[V]){this[V]=!0;for(let e=this[nn].head;e!==null&&this[an]<this.jobs;e=e.next)if(this[rn](e.value),e.value.ignore){let t=e.next;this[nn].removeNode(e),e.next=t}this[V]=!1,this[tn]&&!this[nn].length&&this[an]===0&&(this.zip?this.zip.end(R):(super.write(R),super.end()))}}get[z](){return this[nn]&&this[nn].head&&this[nn].head.value}[on](e){this[nn].shift(),--this[an],this[B]()}[rn](e){if(!e.pending){if(e.entry){e===this[z]&&!e.piped&&this[fn](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[en](e,this.statCache.get(e.absolute)):this[ln](e)),e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[dn](e,this.readdirCache.get(e.absolute)):this[un](e),!e.readdir))){if(e.entry=this[pn](e),!e.entry){e.ignore=!0;return}e===this[z]&&!e.piped&&this[fn](e)}}}[mn](e){return{onwarn:(e,t,n)=>this.warn(e,t,n),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime}}[pn](e){this[an]+=1;try{return new this[hn](e.path,this[mn](e)).on(`end`,()=>this[on](e)).on(`error`,e=>this.emit(`error`,e))}catch(e){this.emit(`error`,e)}}[_n](){this[z]&&this[z].entry&&this[z].entry.resume()}[fn](e){e.piped=!0,e.readdir&&e.readdir.forEach(t=>{let n=this.prefix?e.path.slice(this.prefix.length+1)||`./`:e.path,r=n===`./`?``:n.replace(/\/*$/,`/`);this[sn](r+t)});let t=e.entry,n=this.zip;n?t.on(`data`,e=>{n.write(e)||t.pause()}):t.on(`data`,e=>{super.write(e)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}});vn.Sync=class extends vn{constructor(e){super(e),this[hn]=Qt}pause(){}resume(){}[ln](e){let t=this.follow?`statSync`:`lstatSync`;this[en](e,b.default[t](e.absolute))}[un](e,t){this[dn](e,b.default.readdirSync(e.absolute))}[fn](e){let t=e.entry,n=this.zip;e.readdir&&e.readdir.forEach(t=>{let n=this.prefix?e.path.slice(this.prefix.length+1)||`./`:e.path,r=n===`./`?``:n.replace(/\/*$/,`/`);this[sn](r+t)}),n?t.on(`data`,e=>{n.write(e)}):t.on(`data`,e=>{super[gn](e)})}};var yn=vn;let bn=S.default.EventEmitter,xn=b.default.writev;if(!xn){let e=process.binding(`fs`),t=e.FSReqWrap||e.FSReqCallback;xn=(n,r,i,a)=>{let o=(e,t)=>a(e,t,r),s=new t;s.oncomplete=o,e.writeBuffers(n,r,i,s)}}let Sn=Symbol(`_autoClose`),Cn=Symbol(`_close`),wn=Symbol(`_ended`),H=Symbol(`_fd`),Tn=Symbol(`_finished`),En=Symbol(`_flags`),Dn=Symbol(`_flush`),On=Symbol(`_handleChunk`),kn=Symbol(`_makeBuf`),An=Symbol(`_mode`),jn=Symbol(`_needDrain`),Mn=Symbol(`_onerror`),Nn=Symbol(`_onopen`),Pn=Symbol(`_onread`),Fn=Symbol(`_onwrite`),In=Symbol(`_open`),Ln=Symbol(`_path`),Rn=Symbol(`_pos`),U=Symbol(`_queue`),zn=Symbol(`_read`),Bn=Symbol(`_readSize`),Vn=Symbol(`_reading`),Hn=Symbol(`_remain`),Un=Symbol(`_size`),Wn=Symbol(`_write`),Gn=Symbol(`_writing`),Kn=Symbol(`_defaultFlag`),qn=Symbol(`_errored`);var Jn=class extends Re{constructor(e,t){if(t||={},super(t),this.readable=!0,this.writable=!1,typeof e!=`string`)throw TypeError(`path must be a string`);this[qn]=!1,this[H]=typeof t.fd==`number`?t.fd:null,this[Ln]=e,this[Bn]=t.readSize||16*1024*1024,this[Vn]=!1,this[Un]=typeof t.size==`number`?t.size:1/0,this[Hn]=this[Un],this[Sn]=typeof t.autoClose==`boolean`?t.autoClose:!0,typeof this[H]==`number`?this[zn]():this[In]()}get fd(){return this[H]}get path(){return this[Ln]}write(){throw TypeError(`this is a readable stream`)}end(){throw TypeError(`this is a readable stream`)}[In](){b.default.open(this[Ln],`r`,(e,t)=>this[Nn](e,t))}[Nn](e,t){e?this[Mn](e):(this[H]=t,this.emit(`open`,t),this[zn]())}[kn](){return Buffer.allocUnsafe(Math.min(this[Bn],this[Hn]))}[zn](){if(!this[Vn]){this[Vn]=!0;let e=this[kn]();if(e.length===0)return process.nextTick(()=>this[Pn](null,0,e));b.default.read(this[H],e,0,e.length,null,(e,t,n)=>this[Pn](e,t,n))}}[Pn](e,t,n){this[Vn]=!1,e?this[Mn](e):this[On](t,n)&&this[zn]()}[Cn](){if(this[Sn]&&typeof this[H]==`number`){let e=this[H];this[H]=null,b.default.close(e,e=>e?this.emit(`error`,e):this.emit(`close`))}}[Mn](e){this[Vn]=!0,this[Cn](),this.emit(`error`,e)}[On](e,t){let n=!1;return this[Hn]-=e,e>0&&(n=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[Hn]<=0)&&(n=!1,this[Cn](),super.end()),n}emit(e,t){switch(e){case`prefinish`:case`finish`:break;case`drain`:typeof this[H]==`number`&&this[zn]();break;case`error`:return this[qn]?void 0:(this[qn]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Yn=class extends Jn{[In](){let e=!0;try{this[Nn](null,b.default.openSync(this[Ln],`r`)),e=!1}finally{e&&this[Cn]()}}[zn](){let e=!0;try{if(!this[Vn]){this[Vn]=!0;do{let e=this[kn](),t=e.length===0?0:b.default.readSync(this[H],e,0,e.length,null);if(!this[On](t,e))break}while(!0);this[Vn]=!1}e=!1}finally{e&&this[Cn]()}}[Cn](){if(this[Sn]&&typeof this[H]==`number`){let e=this[H];this[H]=null,b.default.closeSync(e),this.emit(`close`)}}},Xn=class extends bn{constructor(e,t){t||={},super(t),this.readable=!1,this.writable=!0,this[qn]=!1,this[Gn]=!1,this[wn]=!1,this[jn]=!1,this[U]=[],this[Ln]=e,this[H]=typeof t.fd==`number`?t.fd:null,this[An]=t.mode===void 0?438:t.mode,this[Rn]=typeof t.start==`number`?t.start:null,this[Sn]=typeof t.autoClose==`boolean`?t.autoClose:!0;let n=this[Rn]===null?`w`:`r+`;this[Kn]=t.flags===void 0,this[En]=this[Kn]?n:t.flags,this[H]===null&&this[In]()}emit(e,t){if(e===`error`){if(this[qn])return;this[qn]=!0}return super.emit(e,t)}get fd(){return this[H]}get path(){return this[Ln]}[Mn](e){this[Cn](),this[Gn]=!0,this.emit(`error`,e)}[In](){b.default.open(this[Ln],this[En],this[An],(e,t)=>this[Nn](e,t))}[Nn](e,t){this[Kn]&&this[En]===`r+`&&e&&e.code===`ENOENT`?(this[En]=`w`,this[In]()):e?this[Mn](e):(this[H]=t,this.emit(`open`,t),this[Dn]())}end(e,t){return e&&this.write(e,t),this[wn]=!0,!this[Gn]&&!this[U].length&&typeof this[H]==`number`&&this[Fn](null,0),this}write(e,t){return typeof e==`string`&&(e=Buffer.from(e,t)),this[wn]?(this.emit(`error`,Error(`write() after end()`)),!1):this[H]===null||this[Gn]||this[U].length?(this[U].push(e),this[jn]=!0,!1):(this[Gn]=!0,this[Wn](e),!0)}[Wn](e){b.default.write(this[H],e,0,e.length,this[Rn],(e,t)=>this[Fn](e,t))}[Fn](e,t){e?this[Mn](e):(this[Rn]!==null&&(this[Rn]+=t),this[U].length?this[Dn]():(this[Gn]=!1,this[wn]&&!this[Tn]?(this[Tn]=!0,this[Cn](),this.emit(`finish`)):this[jn]&&(this[jn]=!1,this.emit(`drain`))))}[Dn](){if(this[U].length===0)this[wn]&&this[Fn](null,0);else if(this[U].length===1)this[Wn](this[U].pop());else{let e=this[U];this[U]=[],xn(this[H],e,this[Rn],(e,t)=>this[Fn](e,t))}}[Cn](){if(this[Sn]&&typeof this[H]==`number`){let e=this[H];this[H]=null,b.default.close(e,e=>e?this.emit(`error`,e):this.emit(`close`))}}},Zn={ReadStream:Jn,ReadStreamSync:Yn,WriteStream:Xn,WriteStreamSync:class extends Xn{[In](){let e;if(this[Kn]&&this[En]===`r+`)try{e=b.default.openSync(this[Ln],this[En],this[An])}catch(e){if(e.code===`ENOENT`)return this[En]=`w`,this[In]();throw e}else e=b.default.openSync(this[Ln],this[En],this[An]);this[Nn](null,e)}[Cn](){if(this[Sn]&&typeof this[H]==`number`){let e=this[H];this[H]=null,b.default.closeSync(e),this.emit(`close`)}}[Wn](e){let t=!0;try{this[Fn](null,b.default.writeSync(this[H],e,0,e.length,this[Rn])),t=!1}finally{if(t)try{this[Cn]()}catch{}}}}};let Qn=Buffer.from([31,139]),$n=Symbol(`state`),er=Symbol(`writeEntry`),W=Symbol(`readEntry`),tr=Symbol(`nextEntry`),nr=Symbol(`processEntry`),G=Symbol(`extendedHeader`),rr=Symbol(`globalExtendedHeader`),ir=Symbol(`meta`),ar=Symbol(`emitMeta`),K=Symbol(`buffer`),or=Symbol(`queue`),sr=Symbol(`ended`),cr=Symbol(`emittedEnd`),lr=Symbol(`emit`),q=Symbol(`unzip`),ur=Symbol(`consumeChunk`),dr=Symbol(`consumeChunkSub`),fr=Symbol(`consumeBody`),pr=Symbol(`consumeMeta`),mr=Symbol(`consumeHeader`),hr=Symbol(`consuming`),gr=Symbol(`bufferConcat`),_r=Symbol(`maybeEnd`),vr=Symbol(`writing`),yr=Symbol(`aborted`),br=Symbol(`onDone`),xr=Symbol(`sawValidEntry`),Sr=Symbol(`sawNullBlock`),Cr=Symbol(`sawEOF`),wr=e=>!0;var Tr=wt(class extends S.default{constructor(e){e||={},super(e),this.file=e.file||``,this[xr]=null,this.on(br,e=>{(this[$n]===`begin`||this[xr]===!1)&&this.warn(`TAR_BAD_ARCHIVE`,`Unrecognized archive format`)}),e.ondone?this.on(br,e.ondone):this.on(br,e=>{this.emit(`prefinish`),this.emit(`finish`),this.emit(`end`),this.emit(`close`)}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||1048576,this.filter=typeof e.filter==`function`?e.filter:wr,this.writable=!0,this.readable=!1,this[or]=new ge,this[K]=null,this[W]=null,this[er]=null,this[$n]=`begin`,this[ir]=``,this[G]=null,this[rr]=null,this[sr]=!1,this[q]=null,this[yr]=!1,this[Sr]=!1,this[Cr]=!1,typeof e.onwarn==`function`&&this.on(`warn`,e.onwarn),typeof e.onentry==`function`&&this.on(`entry`,e.onentry)}[mr](e,t){this[xr]===null&&(this[xr]=!1);let n;try{n=new vt(e,t,this[G],this[rr])}catch(e){return this.warn(`TAR_ENTRY_INVALID`,e)}if(n.nullBlock)this[Sr]?(this[Cr]=!0,this[$n]===`begin`&&(this[$n]=`header`),this[lr](`eof`)):(this[Sr]=!0,this[lr](`nullBlock`));else if(this[Sr]=!1,!n.cksumValid)this.warn(`TAR_ENTRY_INVALID`,`checksum failure`,{header:n});else if(!n.path)this.warn(`TAR_ENTRY_INVALID`,`path is required`,{header:n});else{let e=n.type;if(/^(Symbolic)?Link$/.test(e)&&!n.linkpath)this.warn(`TAR_ENTRY_INVALID`,`linkpath required`,{header:n});else if(!/^(Symbolic)?Link$/.test(e)&&n.linkpath)this.warn(`TAR_ENTRY_INVALID`,`linkpath forbidden`,{header:n});else{let e=this[er]=new Ue(n,this[G],this[rr]);this[xr]||(e.remain?e.on(`end`,()=>{e.invalid||(this[xr]=!0)}):this[xr]=!0),e.meta?e.size>this.maxMetaEntrySize?(e.ignore=!0,this[lr](`ignoredEntry`,e),this[$n]=`ignore`,e.resume()):e.size>0&&(this[ir]=``,e.on(`data`,e=>this[ir]+=e),this[$n]=`meta`):(this[G]=null,e.ignore=e.ignore||!this.filter(e.path,e),e.ignore?(this[lr](`ignoredEntry`,e),this[$n]=e.remain?`ignore`:`header`,e.resume()):(e.remain?this[$n]=`body`:(this[$n]=`header`,e.end()),this[W]?this[or].push(e):(this[or].push(e),this[tr]())))}}}[nr](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[W]=e,this.emit(`entry`,e),e.emittedEnd||(e.on(`end`,e=>this[tr]()),t=!1)):(this[W]=null,t=!1),t}[tr](){do;while(this[nr](this[or].shift()));if(!this[or].length){let e=this[W];!e||e.flowing||e.size===e.remain?this[vr]||this.emit(`drain`):e.once(`drain`,e=>this.emit(`drain`))}}[fr](e,t){let n=this[er],r=n.blockRemain,i=r>=e.length&&t===0?e:e.slice(t,t+r);return n.write(i),n.blockRemain||(this[$n]=`header`,this[er]=null,n.end()),i.length}[pr](e,t){let n=this[er],r=this[fr](e,t);return this[er]||this[ar](n),r}[lr](e,t,n){!this[or].length&&!this[W]?this.emit(e,t,n):this[or].push([e,t,n])}[ar](e){switch(this[lr](`meta`,this[ir]),e.type){case`ExtendedHeader`:case`OldExtendedHeader`:this[G]=Ct.parse(this[ir],this[G],!1);break;case`GlobalExtendedHeader`:this[rr]=Ct.parse(this[ir],this[rr],!0);break;case`NextFileHasLongPath`:case`OldGnuLongPath`:this[G]=this[G]||Object.create(null),this[G].path=this[ir].replace(/\0.*/,``);break;case`NextFileHasLongLinkpath`:this[G]=this[G]||Object.create(null),this[G].linkpath=this[ir].replace(/\0.*/,``);break;default:throw Error(`unknown meta: `+e.type)}}abort(e){this[yr]=!0,this.emit(`abort`,e),this.warn(`TAR_ABORT`,e,{recoverable:!1})}write(e){if(this[yr])return;if(this[q]===null&&e){if(this[K]&&(e=Buffer.concat([this[K],e]),this[K]=null),e.length<Qn.length)return this[K]=e,!0;for(let t=0;this[q]===null&&t<Qn.length;t++)e[t]!==Qn[t]&&(this[q]=!1);if(this[q]===null){let t=this[sr];this[sr]=!1,this[q]=new Ve.Unzip,this[q].on(`data`,e=>this[ur](e)),this[q].on(`error`,e=>this.abort(e)),this[q].on(`end`,e=>{this[sr]=!0,this[ur]()}),this[vr]=!0;let n=this[q][t?`end`:`write`](e);return this[vr]=!1,n}}this[vr]=!0,this[q]?this[q].write(e):this[ur](e),this[vr]=!1;let t=this[or].length?!1:this[W]?this[W].flowing:!0;return!t&&!this[or].length&&this[W].once(`drain`,e=>this.emit(`drain`)),t}[gr](e){e&&!this[yr]&&(this[K]=this[K]?Buffer.concat([this[K],e]):e)}[_r](){if(this[sr]&&!this[cr]&&!this[yr]&&!this[hr]){this[cr]=!0;let e=this[er];if(e&&e.blockRemain){let t=this[K]?this[K].length:0;this.warn(`TAR_BAD_ARCHIVE`,`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[K]&&e.write(this[K]),e.end()}this[lr](br)}}[ur](e){if(this[hr])this[gr](e);else if(!e&&!this[K])this[_r]();else{if(this[hr]=!0,this[K]){this[gr](e);let t=this[K];this[K]=null,this[dr](t)}else this[dr](e);for(;this[K]&&this[K].length>=512&&!this[yr]&&!this[Cr];){let e=this[K];this[K]=null,this[dr](e)}this[hr]=!1}(!this[K]||this[sr])&&this[_r]()}[dr](e){let t=0,n=e.length;for(;t+512<=n&&!this[yr]&&!this[Cr];)switch(this[$n]){case`begin`:case`header`:this[mr](e,t),t+=512;break;case`ignore`:case`body`:t+=this[fr](e,t);break;case`meta`:t+=this[pr](e,t);break;default:throw Error(`invalid state: `+this[$n])}t<n&&(this[K]?this[K]=Buffer.concat([e.slice(t),this[K]]):this[K]=e.slice(t))}end(e){this[yr]||(this[q]?this[q].end(e):(this[sr]=!0,this.write(e)))}}),Er=(e,t,n)=>{typeof e==`function`?(n=e,t=null,e={}):Array.isArray(e)&&(t=e,e={}),typeof t==`function`&&(n=t,t=null),t=t?Array.from(t):[];let r=me(e);if(r.sync&&typeof n==`function`)throw TypeError(`callback not supported for sync tar functions`);if(!r.file&&typeof n==`function`)throw TypeError(`callback only supported with file option`);return t.length&&Or(r,t),r.noResume||Dr(r),r.file&&r.sync?kr(r):r.file?Ar(r,n):jr(r)};let Dr=e=>{let t=e.onentry;e.onentry=t?e=>{t(e),e.resume()}:e=>e.resume()},Or=(e,t)=>{let n=new Map(t.map(e=>[e.replace(/\/+$/,``),!0])),r=e.filter,i=(e,t)=>{let r=t||x.default.parse(e).root||`.`,a=e===r?!1:n.has(e)?n.get(e):i(x.default.dirname(e),r);return n.set(e,a),a};e.filter=r?(e,t)=>r(e,t)&&i(e.replace(/\/+$/,``)):e=>i(e.replace(/\/+$/,``))},kr=e=>{let t=jr(e),n=e.file,r=!0,i;try{let a=b.default.statSync(n),o=e.maxReadSize||16*1024*1024;if(a.size<o)t.end(b.default.readFileSync(n));else{let e=0,r=Buffer.allocUnsafe(o);for(i=b.default.openSync(n,`r`);e<a.size;){let n=b.default.readSync(i,r,0,o,e);e+=n,t.write(r.slice(0,n))}t.end()}r=!1}finally{if(r&&i)try{b.default.closeSync(i)}catch{}}},Ar=(e,t)=>{let n=new Tr(e),r=e.maxReadSize||16*1024*1024,i=e.file,a=new Promise((e,t)=>{n.on(`error`,t),n.on(`end`,e),b.default.stat(i,(e,a)=>{if(e)t(e);else{let e=new Zn.ReadStream(i,{readSize:r,size:a.size});e.on(`error`,t),e.pipe(n)}})});return t?a.then(t,t):a},jr=e=>new Tr(e);var Mr=(e,t,n)=>{if(typeof t==`function`&&(n=t),Array.isArray(e)&&(t=e,e={}),!t||!Array.isArray(t)||!t.length)throw TypeError(`no files or directories specified`);t=Array.from(t);let r=me(e);if(r.sync&&typeof n==`function`)throw TypeError(`callback not supported for sync tar functions`);if(!r.file&&typeof n==`function`)throw TypeError(`callback only supported with file option`);return r.file&&r.sync?Nr(r,t):r.file?Pr(r,t,n):r.sync?Lr(r,t):Rr(r,t)};let Nr=(e,t)=>{let n=new yn.Sync(e),r=new Zn.WriteStreamSync(e.file,{mode:e.mode||438});n.pipe(r),Fr(n,t)},Pr=(e,t,n)=>{let r=new yn(e),i=new Zn.WriteStream(e.file,{mode:e.mode||438});r.pipe(i);let a=new Promise((e,t)=>{i.on(`error`,t),i.on(`close`,e),r.on(`error`,t)});return Ir(r,t),n?a.then(n,n):a},Fr=(e,t)=>{t.forEach(t=>{t.charAt(0)===`@`?Er({file:x.default.resolve(e.cwd,t.substr(1)),sync:!0,noResume:!0,onentry:t=>e.add(t)}):e.add(t)}),e.end()},Ir=(e,t)=>{for(;t.length;){let n=t.shift();if(n.charAt(0)===`@`)return Er({file:x.default.resolve(e.cwd,n.substr(1)),noResume:!0,onentry:t=>e.add(t)}).then(n=>Ir(e,t));e.add(n)}e.end()},Lr=(e,t)=>{let n=new yn.Sync(e);return Fr(n,t),n},Rr=(e,t)=>{let n=new yn(e);return Ir(n,t),n};var zr=(e,t,n)=>{let r=me(e);if(!r.file)throw TypeError(`file is required`);if(r.gzip)throw TypeError(`cannot append to compressed archives`);if(!t||!Array.isArray(t)||!t.length)throw TypeError(`no files or directories specified`);return t=Array.from(t),r.sync?Br(r,t):Hr(r,t,n)};let Br=(e,t)=>{let n=new yn.Sync(e),r=!0,i,a;try{try{i=b.default.openSync(e.file,`r+`)}catch(t){if(t.code===`ENOENT`)i=b.default.openSync(e.file,`w+`);else throw t}let o=b.default.fstatSync(i),s=Buffer.alloc(512);POSITION:for(a=0;a<o.size;a+=512){for(let e=0,t=0;e<512;e+=t){if(t=b.default.readSync(i,s,e,s.length-e,a+e),a===0&&s[0]===31&&s[1]===139)throw Error(`cannot append to compressed archives`);if(!t)break POSITION}let t=new vt(s);if(!t.cksumValid)break;let n=512*Math.ceil(t.size/512);if(a+n+512>o.size)break;a+=n,e.mtimeCache&&e.mtimeCache.set(t.path,t.mtime)}r=!1,Vr(e,n,a,i,t)}finally{if(r)try{b.default.closeSync(i)}catch{}}},Vr=(e,t,n,r,i)=>{let a=new Zn.WriteStreamSync(e.file,{fd:r,start:n});t.pipe(a),Ur(t,i)},Hr=(e,t,n)=>{t=Array.from(t);let r=new yn(e),i=(t,n,r)=>{let i=(e,n)=>{e?b.default.close(t,t=>r(e)):r(null,n)},a=0;if(n===0)return i(null,0);let o=0,s=Buffer.alloc(512),c=(r,l)=>{if(r)return i(r);if(o+=l,o<512&&l)return b.default.read(t,s,o,s.length-o,a+o,c);if(a===0&&s[0]===31&&s[1]===139)return i(Error(`cannot append to compressed archives`));if(o<512)return i(null,a);let u=new vt(s);if(!u.cksumValid)return i(null,a);let d=512*Math.ceil(u.size/512);if(a+d+512>n||(a+=d+512,a>=n))return i(null,a);e.mtimeCache&&e.mtimeCache.set(u.path,u.mtime),o=0,b.default.read(t,s,0,512,a,c)};b.default.read(t,s,0,512,a,c)},a=new Promise((n,a)=>{r.on(`error`,a);let o=`r+`,s=(c,l)=>{if(c&&c.code===`ENOENT`&&o===`r+`)return o=`w+`,b.default.open(e.file,o,s);if(c)return a(c);b.default.fstat(l,(o,s)=>{if(o)return a(o);i(l,s.size,(i,o)=>{if(i)return a(i);let s=new Zn.WriteStream(e.file,{fd:l,start:o});r.pipe(s),s.on(`error`,a),s.on(`close`,n),Wr(r,t)})})};b.default.open(e.file,o,s)});return n?a.then(n,n):a},Ur=(e,t)=>{t.forEach(t=>{t.charAt(0)===`@`?Er({file:x.default.resolve(e.cwd,t.substr(1)),sync:!0,noResume:!0,onentry:t=>e.add(t)}):e.add(t)}),e.end()},Wr=(e,t)=>{for(;t.length;){let n=t.shift();if(n.charAt(0)===`@`)return Er({file:x.default.resolve(e.cwd,n.substr(1)),noResume:!0,onentry:t=>e.add(t)}).then(n=>Wr(e,t));e.add(n)}e.end()};var Gr=(e,t,n)=>{let r=me(e);if(!r.file)throw TypeError(`file is required`);if(r.gzip)throw TypeError(`cannot append to compressed archives`);if(!t||!Array.isArray(t)||!t.length)throw TypeError(`no files or directories specified`);return t=Array.from(t),Kr(r),zr(r,t,n)};let Kr=e=>{let t=e.filter;e.mtimeCache||=new Map,e.filter=t?(n,r)=>t(n,r)&&!(e.mtimeCache.get(n)>r.mtime):(t,n)=>!(e.mtimeCache.get(t)>n.mtime)},{promisify:qr}=E.default;var Jr=e=>{if(!e)e={mode:511,fs:b.default};else if(typeof e==`object`)e={mode:511,fs:b.default,...e};else if(typeof e==`number`)e={mode:e,fs:b.default};else if(typeof e==`string`)e={mode:parseInt(e,8),fs:b.default};else throw TypeError(`invalid options argument`);return e.mkdir=e.mkdir||e.fs.mkdir||b.default.mkdir,e.mkdirAsync=qr(e.mkdir),e.stat=e.stat||e.fs.stat||b.default.stat,e.statAsync=qr(e.stat),e.statSync=e.statSync||e.fs.statSync||b.default.statSync,e.mkdirSync=e.mkdirSync||e.fs.mkdirSync||b.default.mkdirSync,e};let Yr=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:Xr,parse:Zr}=x.default;var Qr=e=>{if(/\0/.test(e))throw Object.assign(TypeError(`path must be a string without null bytes`),{path:e,code:`ERR_INVALID_ARG_VALUE`});if(e=Xr(e),Yr===`win32`){let t=/[*|"<>?:]/,{root:n}=Zr(e);if(t.test(e.substr(n.length)))throw Object.assign(Error(`Illegal characters in path.`),{path:e,code:`EINVAL`})}return e};let{dirname:$r}=x.default,ei=(e,t,n=void 0)=>n===t?Promise.resolve():e.statAsync(t).then(e=>e.isDirectory()?n:void 0,n=>n.code===`ENOENT`?ei(e,$r(t),t):void 0),ti=(e,t,n=void 0)=>{if(n!==t)try{return e.statSync(t).isDirectory()?n:void 0}catch(n){return n.code===`ENOENT`?ti(e,$r(t),t):void 0}};var ni={findMade:ei,findMadeSync:ti};let{dirname:ri}=x.default,ii=(e,t,n)=>{t.recursive=!1;let r=ri(e);return r===e?t.mkdirAsync(e,t).catch(e=>{if(e.code!==`EISDIR`)throw e}):t.mkdirAsync(e,t).then(()=>n||e,i=>{if(i.code===`ENOENT`)return ii(r,t).then(n=>ii(e,t,n));if(i.code!==`EEXIST`&&i.code!==`EROFS`)throw i;return t.statAsync(e).then(e=>{if(e.isDirectory())return n;throw i},()=>{throw i})})},ai=(e,t,n)=>{let r=ri(e);if(t.recursive=!1,r===e)try{return t.mkdirSync(e,t)}catch(e){if(e.code!==`EISDIR`)throw e;return}try{return t.mkdirSync(e,t),n||e}catch(i){if(i.code===`ENOENT`)return ai(e,t,ai(r,t,n));if(i.code!==`EEXIST`&&i.code!==`EROFS`)throw i;try{if(!t.statSync(e).isDirectory())throw i}catch{throw i}}};var oi={mkdirpManual:ii,mkdirpManualSync:ai};let{dirname:si}=x.default,{findMade:ci,findMadeSync:li}=ni,{mkdirpManual:ui,mkdirpManualSync:di}=oi;var fi={mkdirpNative:(e,t)=>(t.recursive=!0,si(e)===e?t.mkdirAsync(e,t):ci(t,e).then(n=>t.mkdirAsync(e,t).then(()=>n).catch(n=>{if(n.code===`ENOENT`)return ui(e,t);throw n}))),mkdirpNativeSync:(e,t)=>{if(t.recursive=!0,si(e)===e)return t.mkdirSync(e,t);let n=li(t,e);try{return t.mkdirSync(e,t),n}catch(n){if(n.code===`ENOENT`)return di(e,t);throw n}}};let pi=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,``).split(`.`),mi=+pi[0]>10||+pi[0]==10&&+pi[1]>=12;var hi={useNative:mi?e=>e.mkdir===b.default.mkdir:()=>!1,useNativeSync:mi?e=>e.mkdirSync===b.default.mkdirSync:()=>!1};let{mkdirpNative:gi,mkdirpNativeSync:_i}=fi,{mkdirpManual:vi,mkdirpManualSync:yi}=oi,{useNative:bi,useNativeSync:xi}=hi,Si=(e,t)=>(e=Qr(e),t=Jr(t),bi(t)?gi(e,t):vi(e,t));Si.sync=(e,t)=>(e=Qr(e),t=Jr(t),xi(t)?_i(e,t):yi(e,t)),Si.native=(e,t)=>gi(Qr(e),Jr(t)),Si.manual=(e,t)=>vi(Qr(e),Jr(t)),Si.nativeSync=(e,t)=>_i(Qr(e),Jr(t)),Si.manualSync=(e,t)=>yi(Qr(e),Jr(t));var Ci=Si;let wi=b.default.lchown?`lchown`:`chown`,Ti=b.default.lchownSync?`lchownSync`:`chownSync`,Ei=b.default.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Di=(e,t,n)=>{try{return b.default[Ti](e,t,n)}catch(e){if(e.code!==`ENOENT`)throw e}},Oi=(e,t,n)=>{try{return b.default.chownSync(e,t,n)}catch(e){if(e.code!==`ENOENT`)throw e}},ki=Ei?(e,t,n,r)=>i=>{!i||i.code!==`EISDIR`?r(i):b.default.chown(e,t,n,r)}:(e,t,n,r)=>r,Ai=Ei?(e,t,n)=>{try{return Di(e,t,n)}catch(r){if(r.code!==`EISDIR`)throw r;Oi(e,t,n)}}:(e,t,n)=>Di(e,t,n),ji=process.version,Mi=(e,t,n)=>b.default.readdir(e,t,n),Ni=(e,t)=>b.default.readdirSync(e,t);/^v4\./.test(ji)&&(Mi=(e,t,n)=>b.default.readdir(e,n));let Pi=(e,t,n,r)=>{b.default[wi](e,t,n,ki(e,t,n,e=>{r(e&&e.code!==`ENOENT`?e:null)}))},Fi=(e,t,n,r,i)=>{if(typeof t==`string`)return b.default.lstat(x.default.resolve(e,t),(a,o)=>{if(a)return i(a.code===`ENOENT`?null:a);o.name=t,Fi(e,o,n,r,i)});t.isDirectory()?Ii(x.default.resolve(e,t.name),n,r,a=>{if(a)return i(a);Pi(x.default.resolve(e,t.name),n,r,i)}):Pi(x.default.resolve(e,t.name),n,r,i)},Ii=(e,t,n,r)=>{Mi(e,{withFileTypes:!0},(i,a)=>{if(i){if(i.code===`ENOENT`)return r();if(i.code!==`ENOTDIR`&&i.code!==`ENOTSUP`)return r(i)}if(i||!a.length)return Pi(e,t,n,r);let o=a.length,s=null,c=i=>{if(!s){if(i)return r(s=i);if(--o===0)return Pi(e,t,n,r)}};a.forEach(r=>Fi(e,r,t,n,c))})},Li=(e,t,n,r)=>{if(typeof t==`string`)try{let n=b.default.lstatSync(x.default.resolve(e,t));n.name=t,t=n}catch(e){if(e.code===`ENOENT`)return;throw e}t.isDirectory()&&Ri(x.default.resolve(e,t.name),n,r),Ai(x.default.resolve(e,t.name),n,r)},Ri=(e,t,n)=>{let r;try{r=Ni(e,{withFileTypes:!0})}catch(r){if(r.code===`ENOENT`)return;if(r.code===`ENOTDIR`||r.code===`ENOTSUP`)return Ai(e,t,n);throw r}return r&&r.length&&r.forEach(r=>Li(e,r,t,n)),Ai(e,t,n)};var zi=Ii;Ii.sync=Ri;var Bi=class extends Error{constructor(e,t){super(`Cannot extract through symbolic link`),this.path=t,this.symlink=e}get name(){return`SylinkError`}},Vi=class extends Error{constructor(e,t){super(t+`: Cannot cd into '`+e+`'`),this.path=e,this.code=t}get name(){return`CwdError`}},Hi=(e,t,n)=>{let r=t.umask,i=t.mode|448,a=(i&r)!==0,o=t.uid,s=t.gid,c=typeof o==`number`&&typeof s==`number`&&(o!==t.processUid||s!==t.processGid),l=t.preserve,u=t.unlink,d=t.cache,f=t.cwd,p=(t,r)=>{t?n(t):(d.set(e,!0),r&&c?zi(r,o,s,e=>p(e)):a?b.default.chmod(e,i,n):n())};if(d&&d.get(e)===!0)return p();if(e===f)return b.default.stat(e,(t,n)=>{(t||!n.isDirectory())&&(t=new Vi(e,t&&t.code||`ENOTDIR`)),p(t)});if(l)return Ci(e,{mode:i}).then(e=>p(null,e),p);Ui(f,x.default.relative(f,e).split(/\/|\\/),i,d,u,f,null,p)};let Ui=(e,t,n,r,i,a,o,s)=>{if(!t.length)return s(null,o);let c=t.shift(),l=e+`/`+c;if(r.get(l))return Ui(l,t,n,r,i,a,o,s);b.default.mkdir(l,n,Wi(l,t,n,r,i,a,o,s))},Wi=(e,t,n,r,i,a,o,s)=>c=>{if(c){if(c.path&&x.default.dirname(c.path)===a&&(c.code===`ENOTDIR`||c.code===`ENOENT`))return s(new Vi(a,c.code));b.default.lstat(e,(l,u)=>{if(l)s(l);else if(u.isDirectory())Ui(e,t,n,r,i,a,o,s);else if(i)b.default.unlink(e,c=>{if(c)return s(c);b.default.mkdir(e,n,Wi(e,t,n,r,i,a,o,s))});else if(u.isSymbolicLink())return s(new Bi(e,e+`/`+t.join(`/`)));else s(c)})}else o||=e,Ui(e,t,n,r,i,a,o,s)};Hi.sync=(e,t)=>{let n=t.umask,r=t.mode|448,i=(r&n)!==0,a=t.uid,o=t.gid,s=typeof a==`number`&&typeof o==`number`&&(a!==t.processUid||o!==t.processGid),c=t.preserve,l=t.unlink,u=t.cache,d=t.cwd,f=t=>{u.set(e,!0),t&&s&&zi.sync(t,a,o),i&&b.default.chmodSync(e,r)};if(u&&u.get(e)===!0)return f();if(e===d){let t=!1,n=`ENOTDIR`;try{t=b.default.statSync(e).isDirectory()}catch(e){n=e.code}finally{if(!t)throw new Vi(e,n)}f();return}if(c)return f(Ci.sync(e,r));let p=x.default.relative(d,e).split(/\/|\\/),m=null;for(let e=p.shift(),t=d;e&&(t+=`/`+e);e=p.shift())if(!u.get(t))try{b.default.mkdirSync(t,r),m||=t,u.set(t,!0)}catch(e){if(e.path&&x.default.dirname(e.path)===d&&(e.code===`ENOTDIR`||e.code===`ENOENT`))return new Vi(d,e.code);let n=b.default.lstatSync(t);if(n.isDirectory()){u.set(t,!0);continue}else if(l){b.default.unlinkSync(t),b.default.mkdirSync(t,r),m||=t,u.set(t,!0);continue}else if(n.isSymbolicLink())return new Bi(t,t+`/`+p.join(`/`))}return f(m)};var Gi=()=>{let e=new Map,t=new Map,{join:n}=x.default,r=e=>n(e).split(/[\\/]/).slice(0,-1).reduce((e,t)=>e.length?e.concat(n(e[e.length-1],t)):[t],[]),i=new Set,a=n=>{let r=t.get(n);if(!r)throw Error(`function does not have any path reservations`);return{paths:r.paths.map(t=>e.get(t)),dirs:[...r.dirs].map(t=>e.get(t))}},o=e=>{let{paths:t,dirs:n}=a(e);return t.every(t=>t[0]===e)&&n.every(t=>t[0]instanceof Set&&t[0].has(e))},s=e=>i.has(e)||!o(e)?!1:(i.add(e),e(()=>c(e)),!0),c=n=>{if(!i.has(n))return!1;let{paths:r,dirs:a}=t.get(n),o=new Set;return r.forEach(t=>{let r=e.get(t);w.default.equal(r[0],n),r.length===1?e.delete(t):(r.shift(),typeof r[0]==`function`?o.add(r[0]):r[0].forEach(e=>o.add(e)))}),a.forEach(t=>{let r=e.get(t);w.default(r[0]instanceof Set),r[0].size===1&&r.length===1?e.delete(t):r[0].size===1?(r.shift(),o.add(r[0])):r[0].delete(n)}),i.delete(n),o.forEach(e=>s(e)),!0};return{check:o,reserve:(n,i)=>{let a=new Set(n.map(e=>r(e)).reduce((e,t)=>e.concat(t)));return t.set(i,{dirs:a,paths:n}),n.forEach(t=>{let n=e.get(t);n?n.push(i):e.set(t,[i])}),a.forEach(t=>{let n=e.get(t);n?n[n.length-1]instanceof Set?n[n.length-1].add(i):n.push(new Set([i])):e.set(t,[new Set([i])])}),s(i)}}};let Ki=(process.env.__FAKE_PLATFORM__||process.platform)===`win32`,{O_CREAT:qi,O_TRUNC:Ji,O_WRONLY:Yi,UV_FS_O_FILEMAP:Xi=0}=(de.__FAKE_TESTING_FS__||b.default).constants,Zi=Ki&&!!Xi,Qi=Xi|Ji|qi|Yi;var $i=Zi?e=>e<524288?Qi:`w`:()=>`w`;let ea=Symbol(`onEntry`),ta=Symbol(`checkFs`),na=Symbol(`checkFs2`),ra=Symbol(`isReusable`),ia=Symbol(`makeFs`),aa=Symbol(`file`),oa=Symbol(`directory`),sa=Symbol(`link`),ca=Symbol(`symlink`),la=Symbol(`hardlink`),ua=Symbol(`unsupported`),da=Symbol(`checkPath`),fa=Symbol(`mkdir`),J=Symbol(`onError`),pa=Symbol(`pending`),ma=Symbol(`pend`),ha=Symbol(`unpend`),ga=Symbol(`ended`),_a=Symbol(`maybeClose`),va=Symbol(`skip`),ya=Symbol(`doChown`),ba=Symbol(`uid`),xa=Symbol(`gid`),Sa=()=>{throw Error(`sync function called cb somehow?!?`)},Ca=(e,t)=>{if(process.platform!==`win32`)return b.default.unlink(e,t);let n=e+`.DELETE.`+ne.default.randomBytes(16).toString(`hex`);b.default.rename(e,n,e=>{if(e)return t(e);b.default.unlink(n,t)})},wa=e=>{if(process.platform!==`win32`)return b.default.unlinkSync(e);let t=e+`.DELETE.`+ne.default.randomBytes(16).toString(`hex`);b.default.renameSync(e,t),b.default.unlinkSync(t)},Ta=(e,t,n)=>e===e>>>0?e:t===t>>>0?t:n;var Ea=class extends Tr{constructor(e){if(e||={},e.ondone=e=>{this[ga]=!0,this[_a]()},super(e),this.reservations=Gi(),this.transform=typeof e.transform==`function`?e.transform:null,this.writable=!0,this.readable=!1,this[pa]=0,this[ga]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid==`number`||typeof e.gid==`number`){if(typeof e.uid!=`number`||typeof e.gid!=`number`)throw TypeError(`cannot set owner without number uid and gid`);if(e.preserveOwner)throw TypeError(`cannot preserve owner in archive and also set owner explicitly`);this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!=`number`?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||process.platform===`win32`,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=x.default.resolve(e.cwd||process.cwd()),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask==`number`?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on(`entry`,e=>this[ea](e))}warn(e,t,n={}){return(e===`TAR_BAD_ARCHIVE`||e===`TAR_ABORT`)&&(n.recoverable=!1),super.warn(e,t,n)}[_a](){this[ga]&&this[pa]===0&&(this.emit(`prefinish`),this.emit(`finish`),this.emit(`end`),this.emit(`close`))}[da](e){if(this.strip){let t=e.path.split(/\/|\\/);if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join(`/`),e.type===`Link`){let t=e.linkpath.split(/\/|\\/);t.length>=this.strip&&(e.linkpath=t.slice(this.strip).join(`/`))}}if(!this.preservePaths){let t=e.path;if(t.match(/(^|\/|\\)\.\.(\\|\/|$)/))return this.warn(`TAR_ENTRY_ERROR`,`path contains '..'`,{entry:e,path:t}),!1;if(x.default.win32.isAbsolute(t)){let n=x.default.win32.parse(t);e.path=t.substr(n.root.length);let r=n.root;this.warn(`TAR_ENTRY_INFO`,`stripping ${r} from absolute path`,{entry:e,path:t})}}if(this.win32){let t=x.default.win32.parse(e.path);e.path=t.root===``?kt.encode(e.path):t.root+kt.encode(e.path.substr(t.root.length))}return x.default.isAbsolute(e.path)?e.absolute=e.path:e.absolute=x.default.resolve(this.cwd,e.path),!0}[ea](e){if(!this[da](e))return e.resume();switch(w.default.equal(typeof e.absolute,`string`),e.type){case`Directory`:case`GNUDumpDir`:e.mode&&(e.mode|=448);case`File`:case`OldFile`:case`ContiguousFile`:case`Link`:case`SymbolicLink`:return this[ta](e);case`CharacterDevice`:case`BlockDevice`:case`FIFO`:default:return this[ua](e)}}[J](e,t){e.name===`CwdError`?this.emit(`error`,e):(this.warn(`TAR_ENTRY_ERROR`,e,{entry:t}),this[ha](),t.resume())}[fa](e,t,n){Hi(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t,noChmod:this.noChmod},n)}[ya](e){return this.forceChown||this.preserveOwner&&(typeof e.uid==`number`&&e.uid!==this.processUid||typeof e.gid==`number`&&e.gid!==this.processGid)||typeof this.uid==`number`&&this.uid!==this.processUid||typeof this.gid==`number`&&this.gid!==this.processGid}[ba](e){return Ta(this.uid,e.uid,this.processUid)}[xa](e){return Ta(this.gid,e.gid,this.processGid)}[aa](e,t){let n=e.mode&4095||this.fmode,r=new Zn.WriteStream(e.absolute,{flags:$i(e.size),mode:n,autoClose:!1});r.on(`error`,t=>this[J](t,e));let i=1,a=n=>{if(n)return this[J](n,e);--i===0&&b.default.close(r.fd,n=>{t(),n?this[J](n,e):this[ha]()})};r.on(`finish`,t=>{let n=e.absolute,o=r.fd;if(e.mtime&&!this.noMtime){i++;let t=e.atime||new Date,r=e.mtime;b.default.futimes(o,t,r,e=>e?b.default.utimes(n,t,r,t=>a(t&&e)):a())}if(this[ya](e)){i++;let t=this[ba](e),r=this[xa](e);b.default.fchown(o,t,r,e=>e?b.default.chown(n,t,r,t=>a(t&&e)):a())}a()});let o=this.transform&&this.transform(e)||e;o!==e&&(o.on(`error`,t=>this[J](t,e)),e.pipe(o)),o.pipe(r)}[oa](e,t){let n=e.mode&4095||this.dmode;this[fa](e.absolute,n,n=>{if(n)return t(),this[J](n,e);let r=1,i=n=>{--r===0&&(t(),this[ha](),e.resume())};e.mtime&&!this.noMtime&&(r++,b.default.utimes(e.absolute,e.atime||new Date,e.mtime,i)),this[ya](e)&&(r++,b.default.chown(e.absolute,this[ba](e),this[xa](e),i)),i()})}[ua](e){e.unsupported=!0,this.warn(`TAR_ENTRY_UNSUPPORTED`,`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[ca](e,t){this[sa](e,e.linkpath,`symlink`,t)}[la](e,t){this[sa](e,x.default.resolve(this.cwd,e.linkpath),`link`,t)}[ma](){this[pa]++}[ha](){this[pa]--,this[_a]()}[va](e){this[ha](),e.resume()}[ra](e,t){return e.type===`File`&&!this.unlink&&t.isFile()&&t.nlink<=1&&process.platform!==`win32`}[ta](e){this[ma]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,t=>this[na](e,t))}[na](e,t){this[fa](x.default.dirname(e.absolute),this.dmode,n=>{if(n)return t(),this[J](n,e);b.default.lstat(e.absolute,(n,r)=>{r&&(this.keep||this.newer&&r.mtime>e.mtime)?(this[va](e),t()):n||this[ra](e,r)?this[ia](null,e,t):r.isDirectory()?e.type===`Directory`?!this.noChmod&&(!e.mode||(r.mode&4095)===e.mode)?this[ia](null,e,t):b.default.chmod(e.absolute,e.mode,n=>this[ia](n,e,t)):b.default.rmdir(e.absolute,n=>this[ia](n,e,t)):Ca(e.absolute,n=>this[ia](n,e,t))})})}[ia](e,t,n){if(e)return this[J](e,t);switch(t.type){case`File`:case`OldFile`:case`ContiguousFile`:return this[aa](t,n);case`Link`:return this[la](t,n);case`SymbolicLink`:return this[ca](t,n);case`Directory`:case`GNUDumpDir`:return this[oa](t,n)}}[sa](e,t,n,r){b.default[n](t,e.absolute,t=>{if(t)return this[J](t,e);r(),this[ha](),e.resume()})}};Ea.Sync=class extends Ea{[ta](e){let t=this[fa](x.default.dirname(e.absolute),this.dmode,Sa);if(t)return this[J](t,e);try{let t=b.default.lstatSync(e.absolute);if(this.keep||this.newer&&t.mtime>e.mtime)return this[va](e);if(this[ra](e,t))return this[ia](null,e,Sa);try{return t.isDirectory()?e.type===`Directory`?!this.noChmod&&e.mode&&(t.mode&4095)!==e.mode&&b.default.chmodSync(e.absolute,e.mode):b.default.rmdirSync(e.absolute):wa(e.absolute),this[ia](null,e,Sa)}catch(t){return this[J](t,e)}}catch{return this[ia](null,e,Sa)}}[aa](e,t){let n=e.mode&4095||this.fmode,r=t=>{let n;try{b.default.closeSync(i)}catch(e){n=e}(t||n)&&this[J](t||n,e)},i;try{i=b.default.openSync(e.absolute,$i(e.size),n)}catch(e){return r(e)}let a=this.transform&&this.transform(e)||e;a!==e&&(a.on(`error`,t=>this[J](t,e)),e.pipe(a)),a.on(`data`,e=>{try{b.default.writeSync(i,e,0,e.length)}catch(e){r(e)}}),a.on(`end`,t=>{let n=null;if(e.mtime&&!this.noMtime){let t=e.atime||new Date,r=e.mtime;try{b.default.futimesSync(i,t,r)}catch(i){try{b.default.utimesSync(e.absolute,t,r)}catch{n=i}}}if(this[ya](e)){let t=this[ba](e),r=this[xa](e);try{b.default.fchownSync(i,t,r)}catch(i){try{b.default.chownSync(e.absolute,t,r)}catch{n||=i}}}r(n)})}[oa](e,t){let n=e.mode&4095||this.dmode,r=this[fa](e.absolute,n);if(r)return this[J](r,e);if(e.mtime&&!this.noMtime)try{b.default.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[ya](e))try{b.default.chownSync(e.absolute,this[ba](e),this[xa](e))}catch{}e.resume()}[fa](e,t){try{return Hi.sync(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(e){return e}}[sa](e,t,n,r){try{b.default[n+`Sync`](t,e.absolute),e.resume()}catch(t){return this[J](t,e)}}};var Da=Ea,Oa=(e,t,n)=>{typeof e==`function`?(n=e,t=null,e={}):Array.isArray(e)&&(t=e,e={}),typeof t==`function`&&(n=t,t=null),t=t?Array.from(t):[];let r=me(e);if(r.sync&&typeof n==`function`)throw TypeError(`callback not supported for sync tar functions`);if(!r.file&&typeof n==`function`)throw TypeError(`callback only supported with file option`);return t.length&&ka(r,t),r.file&&r.sync?Aa(r):r.file?ja(r,n):r.sync?Ma(r):Na(r)};let ka=(e,t)=>{let n=new Map(t.map(e=>[e.replace(/\/+$/,``),!0])),r=e.filter,i=(e,t)=>{let r=t||x.default.parse(e).root||`.`,a=e===r?!1:n.has(e)?n.get(e):i(x.default.dirname(e),r);return n.set(e,a),a};e.filter=r?(e,t)=>r(e,t)&&i(e.replace(/\/+$/,``)):e=>i(e.replace(/\/+$/,``))},Aa=e=>{let t=new Da.Sync(e),n=e.file,r=b.default.statSync(n),i=e.maxReadSize||16*1024*1024;new Zn.ReadStreamSync(n,{readSize:i,size:r.size}).pipe(t)},ja=(e,t)=>{let n=new Da(e),r=e.maxReadSize||16*1024*1024,i=e.file,a=new Promise((e,t)=>{n.on(`error`,t),n.on(`close`,e),b.default.stat(i,(e,a)=>{if(e)t(e);else{let e=new Zn.ReadStream(i,{readSize:r,size:a.size});e.on(`error`,t),e.pipe(n)}})});return t?a.then(t,t):a},Ma=e=>new Da.Sync(e),Na=e=>new Da(e);var Pa=fe(function(e,t){t.c=t.create=Mr,t.r=t.replace=zr,t.t=t.list=Er,t.u=t.update=Gr,t.x=t.extract=Oa,t.Pack=yn,t.Unpack=Da,t.Parse=Tr,t.ReadEntry=Ue,t.WriteEntry=Xt,t.Header=vt,t.Pax=Ct,t.types=L}),Fa={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};let Ia={};for(let e of Object.keys(Fa))Ia[Fa[e]]=e;let Y={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},lch:{channels:3,labels:`lch`},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}};var La=Y;for(let e of Object.keys(Y)){if(!(`channels`in Y[e]))throw Error(`missing channels property: `+e);if(!(`labels`in Y[e]))throw Error(`missing channel labels property: `+e);if(Y[e].labels.length!==Y[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=Y[e];delete Y[e].channels,delete Y[e].labels,Object.defineProperty(Y[e],`channels`,{value:t}),Object.defineProperty(Y[e],`labels`,{value:n})}Y.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},Y.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};return u===0?(i=0,a=0):(a=u/l,t=d(o),n=d(s),r=d(c),o===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&--i),[i*360,a*100,l*100]},Y.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=Y.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,a*100,r*100]},Y.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function Ra(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}Y.rgb.keyword=function(e){let t=Ia[e];if(t)return t;let n=1/0,r;for(let t of Object.keys(Fa)){let i=Fa[t],a=Ra(e,i);a<n&&(n=a,r=t)}return r},Y.keyword.rgb=function(e){return Fa[e]},Y.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]},Y.rgb.lab=function(e){let t=Y.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*r-16,500*(n-r),200*(r-i)]},Y.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o;if(n===0)return o=r*255,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;let s=2*r-i,c=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+(i-s)*6*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,c[e]=o*255;return c},Y.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2;return[t,(r===0?2*i/(a+i):2*n/(r+n))*100,o*100]},Y.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},Y.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,a*100,o*100]},Y.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},Y.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},Y.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]},Y.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},Y.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,l=o**3;return a=s>.008856?s:(a-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},Y.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},Y.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},Y.rgb.ansi16=function(e,t=null){let[n,r,i]=e,a=t===null?Y.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(o+=60),o},Y.hsv.ansi16=function(e){return Y.rgb.ansi16(Y.hsv.rgb(e),e[2])},Y.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},Y.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5;return[(t&1)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},Y.ansi256.rgb=function(e){if(e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},Y.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.substring(t.length)+t},Y.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split(``).map(e=>e+e).join(``));let r=parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},Y.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c;return s=o<1?a/(1-o):0,c=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,c/=6,c%=1,[c*360,o*100,s*100]},Y.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},Y.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},Y.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},Y.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],r*100,n*100]},Y.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},Y.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},Y.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},Y.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},Y.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},Y.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},Y.gray.hsl=function(e){return[0,0,e[0]]},Y.gray.hsv=Y.gray.hsl,Y.gray.hwb=function(e){return[0,100,e[0]]},Y.gray.cmyk=function(e){return[0,0,0,e[0]]},Y.gray.lab=function(e){return[e[0],0,0]},Y.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.substring(n.length)+n},Y.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function za(){let e={},t=Object.keys(La);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function Ba(e){let t=za(),n=[e];for(t[e].distance=0;n.length;){let e=n.pop(),r=Object.keys(La[e]);for(let i=r.length,a=0;a<i;a++){let i=r[a],o=t[i];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,n.unshift(i))}}return t}function Va(e,t){return function(n){return t(e(n))}}function Ha(e,t){let n=[t[e].parent,e],r=La[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=Va(La[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}var Ua=function(e){let t=Ba(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=Ha(e,t))}return n};let Wa={},Ga=Object.keys(La);function Ka(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function qa(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}Ga.forEach(e=>{Wa[e]={},Object.defineProperty(Wa[e],`channels`,{value:La[e].channels}),Object.defineProperty(Wa[e],`labels`,{value:La[e].labels});let t=Ua(e);Object.keys(t).forEach(n=>{let r=t[n];Wa[e][n]=qa(r),Wa[e][n].raw=Ka(r)})});var Ja=Wa,Ya=fe(function(e){let t=(e,t)=>(...n)=>`\u001B[${e(...n)+t}m`,n=(e,t)=>(...n)=>{let r=e(...n);return`\u001B[${38+t};5;${r}m`},r=(e,t)=>(...n)=>{let r=e(...n);return`\u001B[${38+t};2;${r[0]};${r[1]};${r[2]}m`},i=e=>e,a=(e,t,n)=>[e,t,n],o=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{let r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})},s,c=(e,t,n,r)=>{s===void 0&&(s=Ja);let i=r?10:0,a={};for(let[r,o]of Object.entries(s)){let s=r===`ansi16`?`ansi`:r;r===t?a[s]=e(n,i):typeof o==`object`&&(a[s]=e(o[t],i))}return a};function l(){let e=new Map,s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};s.color.gray=s.color.blackBright,s.bgColor.bgGray=s.bgColor.bgBlackBright,s.color.grey=s.color.blackBright,s.bgColor.bgGrey=s.bgColor.bgBlackBright;for(let[t,n]of Object.entries(s)){for(let[t,r]of Object.entries(n))s[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=s[t],e.set(r[0],r[1]);Object.defineProperty(s,t,{value:n,enumerable:!1})}return Object.defineProperty(s,`codes`,{value:e,enumerable:!1}),s.color.close=`\x1B[39m`,s.bgColor.close=`\x1B[49m`,o(s.color,`ansi`,()=>c(t,`ansi16`,i,!1)),o(s.color,`ansi256`,()=>c(n,`ansi256`,i,!1)),o(s.color,`ansi16m`,()=>c(r,`rgb`,a,!1)),o(s.bgColor,`ansi`,()=>c(t,`ansi16`,i,!0)),o(s.bgColor,`ansi256`,()=>c(n,`ansi256`,i,!0)),o(s.bgColor,`ansi16m`,()=>c(r,`rgb`,a,!0)),s}Object.defineProperty(e,`exports`,{enumerable:!0,get:l})}),Xa=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)};let{env:X}=process,Za;Xa(`no-color`)||Xa(`no-colors`)||Xa(`color=false`)||Xa(`color=never`)?Za=0:(Xa(`color`)||Xa(`colors`)||Xa(`color=true`)||Xa(`color=always`))&&(Za=1),`FORCE_COLOR`in X&&(Za=X.FORCE_COLOR===`true`?1:X.FORCE_COLOR===`false`?0:X.FORCE_COLOR.length===0?1:Math.min(parseInt(X.FORCE_COLOR,10),3));function Qa(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function $a(e,t){if(Za===0)return 0;if(Xa(`color=16m`)||Xa(`color=full`)||Xa(`color=truecolor`))return 3;if(Xa(`color=256`))return 2;if(e&&!t&&Za===void 0)return 0;let n=Za||0;if(X.TERM===`dumb`)return n;if(process.platform===`win32`){let e=re.default.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in X)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in X)||X.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in X)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(X.TEAMCITY_VERSION)?1:0;if(X.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in X){let e=parseInt((X.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(X.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(X.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(X.TERM)||`COLORTERM`in X?1:n}function eo(e){return Qa($a(e,e&&e.isTTY))}var to={supportsColor:eo,stdout:Qa($a(!0,ie.default.isatty(1))),stderr:Qa($a(!0,ie.default.isatty(2)))},no={stringReplaceAll:(e,t,n)=>{let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.substr(a,r-a)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.substr(a),o},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.substr(i,(o?r-1:r)-i)+t+(o?`\r
|
|
19
|
-
`:`
|
|
20
|
-
`)+n,i=r+1,r=e.indexOf(`
|
|
21
|
-
`,i)}while(r!==-1);return a+=e.substr(i),a}};let ro=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,io=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,ao=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,oo=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,so=new Map([[`n`,`
|
|
22
|
-
`],[`r`,`\r`],[`t`,` `],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`0`,`\0`],[`\\`,`\\`],[`e`,`\x1B`],[`a`,`\x07`]]);function co(e){let t=e[0]===`u`,n=e[1]===`{`;return t&&!n&&e.length===5||e[0]===`x`&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):so.get(e)||e}function lo(e,t){let n=[],r=t.trim().split(/\s*,\s*/g),i;for(let t of r){let r=Number(t);if(!Number.isNaN(r))n.push(r);else if(i=t.match(ao))n.push(i[2].replace(oo,(e,t,n)=>t?co(t):n));else throw Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}return n}function uo(e){io.lastIndex=0;let t=[],n;for(;(n=io.exec(e))!==null;){let e=n[1];if(n[2]){let r=lo(e,n[2]);t.push([e].concat(r))}else t.push([e])}return t}function fo(e,t){let n={};for(let e of t)for(let t of e.styles)n[t[0]]=e.inverse?null:t.slice(1);let r=e;for(let[e,t]of Object.entries(n))if(Array.isArray(t)){if(!(e in r))throw Error(`Unknown Chalk style: ${e}`);r=t.length>0?r[e](...t):r[e]}return r}var po=(e,t)=>{let n=[],r=[],i=[];if(t.replace(ro,(t,a,o,s,c,l)=>{if(a)i.push(co(a));else if(s){let t=i.join(``);i=[],r.push(n.length===0?t:fo(e,n)(t)),n.push({inverse:o,styles:uo(s)})}else if(c){if(n.length===0)throw Error(`Found extraneous } in Chalk template literal`);r.push(fo(e,n)(i.join(``))),i=[],n.pop()}else i.push(l)}),r.push(i.join(``)),n.length>0){let e=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?``:`s`} (\`}\`)`;throw Error(e)}return r.join(``)};let{stdout:mo,stderr:ho}=to,{stringReplaceAll:go,stringEncaseCRLFWithFirstIndex:_o}=no,{isArray:vo}=Array,yo=[`ansi`,`ansi`,`ansi256`,`ansi16m`],bo=Object.create(null),xo=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=mo?mo.level:0;e.level=t.level===void 0?n:t.level};var So=class{constructor(e){return Co(e)}};let Co=e=>{let t={};return xo(t,e),t.template=(...e)=>jo(t.template,...e),Object.setPrototypeOf(t,wo.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=So,t.template};function wo(e){return Co(e)}for(let[e,t]of Object.entries(Ya))bo[e]={get(){let n=Oo(this,Do(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};bo.visible={get(){let e=Oo(this,this._styler,!0);return Object.defineProperty(this,`visible`,{value:e}),e}};let To=[`rgb`,`hex`,`keyword`,`hsl`,`hsv`,`hwb`,`ansi`,`ansi256`];for(let e of To)bo[e]={get(){let{level:t}=this;return function(...n){let r=Do(Ya.color[yo[t]][e](...n),Ya.color.close,this._styler);return Oo(this,r,this._isEmpty)}}};for(let e of To){let t=`bg`+e[0].toUpperCase()+e.slice(1);bo[t]={get(){let{level:t}=this;return function(...n){let r=Do(Ya.bgColor[yo[t]][e](...n),Ya.bgColor.close,this._styler);return Oo(this,r,this._isEmpty)}}}}let Eo=Object.defineProperties(()=>{},{...bo,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),Do=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},Oo=(e,t,n)=>{let r=(...e)=>vo(e[0])&&vo(e[0].raw)?ko(r,jo(r,...e)):ko(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,Eo),r._generator=e,r._styler=t,r._isEmpty=n,r},ko=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?``:t;let n=e._styler;if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.indexOf(`\x1B`)!==-1)for(;n!==void 0;)t=go(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
|
|
23
|
-
`);return a!==-1&&(t=_o(t,i,r,a)),r+t+i},Ao,jo=(e,...t)=>{let[n]=t;if(!vo(n)||!vo(n.raw))return t.join(` `);let r=t.slice(1),i=[n.raw[0]];for(let e=1;e<n.length;e++)i.push(String(r[e-1]).replace(/[{}\\]/g,`\\$&`),String(n.raw[e]));return Ao===void 0&&(Ao=po),Ao(e,i.join(``))};Object.defineProperties(wo.prototype,bo);let Mo=wo();Mo.supportsColor=mo,Mo.stderr=wo({level:ho?ho.level:0}),Mo.stderr.supportsColor=ho;var No=Mo,Po=Fo(b.default);function Fo(e){if(typeof e!=`object`||!e)return e;if(e instanceof Object)var t={__proto__:e.__proto__};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}var Io=process.cwd,Lo=null,Ro=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Lo||=Io.call(process),Lo};try{process.cwd()}catch{}var zo=process.chdir;process.chdir=function(e){Lo=null,zo.call(process,e)};var Bo=Vo;function Vo(e){ae.default.hasOwnProperty(`O_SYMLINK`)&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&Ho(e),e.lutimes||Uo(e),e.chown=Ko(e.chown),e.fchown=Ko(e.fchown),e.lchown=Ko(e.lchown),e.chmod=Wo(e.chmod),e.fchmod=Wo(e.fchmod),e.lchmod=Wo(e.lchmod),e.chownSync=qo(e.chownSync),e.fchownSync=qo(e.fchownSync),e.lchownSync=qo(e.lchownSync),e.chmodSync=Go(e.chmodSync),e.fchmodSync=Go(e.fchmodSync),e.lchmodSync=Go(e.lchmodSync),e.stat=Jo(e.stat),e.fstat=Jo(e.fstat),e.lstat=Jo(e.lstat),e.statSync=Yo(e.statSync),e.fstatSync=Yo(e.fstatSync),e.lstatSync=Yo(e.lstatSync),e.lchmod||(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){}),e.lchown||(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){}),Ro===`win32`&&(e.rename=(function(t){return function(n,r,i){var a=Date.now(),o=0;t(n,r,function s(c){if(c&&(c.code===`EACCES`||c.code===`EPERM`)&&Date.now()-a<6e4){setTimeout(function(){e.stat(r,function(e,a){e&&e.code===`ENOENT`?t(n,r,s):i(c)})},o),o<100&&(o+=10);return}i&&i(c)})}})(e.rename)),e.read=(function(t){return function(n,r,i,a,o,s){var c;if(s&&typeof s==`function`){var l=0;c=function(u,d,f){if(u&&u.code===`EAGAIN`&&l<10)return l++,t.call(e,n,r,i,a,o,c);s.apply(this,arguments)}}return t.call(e,n,r,i,a,o,c)}})(e.read),e.readSync=(function(t){return function(n,r,i,a,o){for(var s=0;;)try{return t.call(e,n,r,i,a,o)}catch(e){if(e.code===`EAGAIN`&&s<10){s++;continue}throw e}}})(e.readSync)}function Ho(e){e.lchmod=function(t,n,r){e.open(t,ae.default.O_WRONLY|ae.default.O_SYMLINK,n,function(t,i){if(t){r&&r(t);return}e.fchmod(i,n,function(t){e.close(i,function(e){r&&r(t||e)})})})},e.lchmodSync=function(t,n){var r=e.openSync(t,ae.default.O_WRONLY|ae.default.O_SYMLINK,n),i=!0,a;try{a=e.fchmodSync(r,n),i=!1}finally{if(i)try{e.closeSync(r)}catch{}else e.closeSync(r)}return a}}function Uo(e){ae.default.hasOwnProperty(`O_SYMLINK`)?(e.lutimes=function(t,n,r,i){e.open(t,ae.default.O_SYMLINK,function(t,a){if(t){i&&i(t);return}e.futimes(a,n,r,function(t){e.close(a,function(e){i&&i(t||e)})})})},e.lutimesSync=function(t,n,r){var i=e.openSync(t,ae.default.O_SYMLINK),a,o=!0;try{a=e.futimesSync(i,n,r),o=!1}finally{if(o)try{e.closeSync(i)}catch{}else e.closeSync(i)}return a}):(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}function Wo(e){return e&&function(t,n,r){return e.call(Po,t,n,function(e){Xo(e)&&(e=null),r&&r.apply(this,arguments)})}}function Go(e){return e&&function(t,n){try{return e.call(Po,t,n)}catch(e){if(!Xo(e))throw e}}}function Ko(e){return e&&function(t,n,r,i){return e.call(Po,t,n,r,function(e){Xo(e)&&(e=null),i&&i.apply(this,arguments)})}}function qo(e){return e&&function(t,n,r){try{return e.call(Po,t,n,r)}catch(e){if(!Xo(e))throw e}}}function Jo(e){return e&&function(t,n){return e.call(Po,t,function(e,t){if(!t)return n.apply(this,arguments);t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296),n&&n.apply(this,arguments)})}}function Yo(e){return e&&function(t){var n=e.call(Po,t);return n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296),n}}function Xo(e){return!e||e.code===`ENOSYS`||(!process.getuid||process.getuid()!==0)&&(e.code===`EINVAL`||e.code===`EPERM`)}var Zo=C.default.Stream,Qo=$o;function $o(e){return{ReadStream:t,WriteStream:n};function t(n,r){if(!(this instanceof t))return new t(n,r);Zo.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags=`r`,this.mode=438,this.bufferSize=64*1024,r||={};for(var a=Object.keys(r),o=0,s=a.length;o<s;o++){var c=a[o];this[c]=r[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!=`number`)throw TypeError(`start must be a Number`);if(this.end===void 0)this.end=1/0;else if(typeof this.end!=`number`)throw TypeError(`end must be a Number`);if(this.start>this.end)throw Error(`start must be <= end`);this.pos=this.start}if(this.fd!==null){process.nextTick(function(){i._read()});return}e.open(this.path,this.flags,this.mode,function(e,t){if(e){i.emit(`error`,e),i.readable=!1;return}i.fd=t,i.emit(`open`,t),i._read()})}function n(t,r){if(!(this instanceof n))return new n(t,r);Zo.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags=`w`,this.encoding=`binary`,this.mode=438,this.bytesWritten=0,r||={};for(var i=Object.keys(r),a=0,o=i.length;a<o;a++){var s=i[a];this[s]=r[s]}if(this.start!==void 0){if(typeof this.start!=`number`)throw TypeError(`start must be a Number`);if(this.start<0)throw Error(`start must be >= zero`);this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}var es=fe(function(e){var t=[];function n(){}var r=n;E.default.debuglog?r=E.default.debuglog(`gfs4`):/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&(r=function(){var e=E.default.format.apply(E.default,arguments);e=`GFS4: `+e.split(/\n/).join(`
|
|
24
|
-
GFS4: `),console.error(e)}),/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&process.on(`exit`,function(){r(t),w.default.equal(t.length,0)}),e.exports=i(Po),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&(e.exports=i(b.default)),e.exports.close=b.default.close=(function(e){return function(t,n){return e.call(b.default,t,function(e){e||o(),typeof n==`function`&&n.apply(this,arguments)})}})(b.default.close),e.exports.closeSync=b.default.closeSync=(function(e){return function(t){var n=e.apply(b.default,arguments);return o(),n}})(b.default.closeSync);function i(e){Bo(e),e.gracefulify=i,e.FileReadStream=g,e.FileWriteStream=v,e.createReadStream=b,e.createWriteStream=x;var t=e.readFile;e.readFile=n;function n(e,n,r){return typeof n==`function`&&(r=n,n=null),i(e,n,r);function i(e,n,r){return t(e,n,function(t){t&&(t.code===`EMFILE`||t.code===`ENFILE`)?a([i,[e,n,r]]):(typeof r==`function`&&r.apply(this,arguments),o())})}}var r=e.writeFile;e.writeFile=s;function s(e,t,n,i){return typeof n==`function`&&(i=n,n=null),s(e,t,n,i);function s(e,t,n,i){return r(e,t,n,function(r){r&&(r.code===`EMFILE`||r.code===`ENFILE`)?a([s,[e,t,n,i]]):(typeof i==`function`&&i.apply(this,arguments),o())})}}var c=e.appendFile;c&&(e.appendFile=l);function l(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r){return c(e,t,n,function(s){s&&(s.code===`EMFILE`||s.code===`ENFILE`)?a([i,[e,t,n,r]]):(typeof r==`function`&&r.apply(this,arguments),o())})}}var u=e.readdir;e.readdir=d;function d(e,t,n){var r=[e];return typeof t==`function`?n=t:r.push(t),r.push(i),f(r);function i(e,t){t&&t.sort&&t.sort(),e&&(e.code===`EMFILE`||e.code===`ENFILE`)?a([f,[r]]):(typeof n==`function`&&n.apply(this,arguments),o())}}function f(t){return u.apply(e,t)}if(process.version.substr(0,4)===`v0.8`){var p=Qo(e);g=p.ReadStream,v=p.WriteStream}var m=e.ReadStream;g.prototype=Object.create(m.prototype),g.prototype.open=_;var h=e.WriteStream;v.prototype=Object.create(h.prototype),v.prototype.open=y,e.ReadStream=g,e.WriteStream=v;function g(e,t){return this instanceof g?(m.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function _(){var e=this;C(e.path,e.flags,e.mode,function(t,n){t?(e.autoClose&&e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n),e.read())})}function v(e,t){return this instanceof v?(h.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function y(){var e=this;C(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n))})}function b(e,t){return new g(e,t)}function x(e,t){return new v(e,t)}var S=e.open;e.open=C;function C(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r){return S(e,t,n,function(s,c){s&&(s.code===`EMFILE`||s.code===`ENFILE`)?a([i,[e,t,n,r]]):(typeof r==`function`&&r.apply(this,arguments),o())})}}return e}function a(e){r(`ENQUEUE`,e[0].name,e[1]),t.push(e)}function o(){var e=t.shift();e&&(r(`RETRY`,e[0].name,e[1]),e[0].apply(null,e[1]))}}),ts=511,ns=rs.mkdirp=rs.mkdirP=rs;function rs(e,t,n,r){typeof t==`function`?(n=t,t={}):(!t||typeof t!=`object`)&&(t={mode:t});var i=t.mode,a=t.fs||b.default;i===void 0&&(i=ts&~process.umask()),r||=null;var o=n||function(){};e=x.default.resolve(e),a.mkdir(e,i,function(n){if(!n)return r||=e,o(null,r);switch(n.code){case`ENOENT`:rs(x.default.dirname(e),t,function(n,r){n?o(n,r):rs(e,t,o,r)});break;default:a.stat(e,function(e,t){e||!t.isDirectory()?o(n,r):o(null,r)});break}})}rs.sync=function e(t,n,r){(!n||typeof n!=`object`)&&(n={mode:n});var i=n.mode,a=n.fs||b.default;i===void 0&&(i=ts&~process.umask()),r||=null,t=x.default.resolve(t);try{a.mkdirSync(t,i),r||=t}catch(i){switch(i.code){case`ENOENT`:r=e(x.default.dirname(t),n,r),e(t,n,r);break;default:var o;try{o=a.statSync(t)}catch{throw i}if(!o.isDirectory())throw i;break}}return r};var is=process.platform===`win32`,as=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function os(){var e;if(as){var t=Error();e=n}else e=r;return e;function n(e){e&&(t.message=e.message,e=t,r(e))}function r(e){if(e){if(process.throwDeprecation)throw e;if(!process.noDeprecation){var t=`fs: missing callback `+(e.stack||e.message);process.traceDeprecation?console.trace(t):console.error(t)}}}}function ss(e){return typeof e==`function`?e:os()}if(x.default.normalize,is)var cs=/(.*?)(?:[\/\\]+|$)/g;else var cs=/(.*?)(?:[\/]+|$)/g;if(is)var ls=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else var ls=/^[\/]*/;var us={realpathSync:function(e,t){if(e=x.default.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var n=e,r={},i={},a,o,s,c;l();function l(){var t=ls.exec(e);a=t[0].length,o=t[0],s=t[0],c=``,is&&!i[s]&&(b.default.lstatSync(s),i[s]=!0)}for(;a<e.length;){cs.lastIndex=a;var u=cs.exec(e);if(c=o,o+=u[0],s=c+u[1],a=cs.lastIndex,!(i[s]||t&&t[s]===s)){var d;if(t&&Object.prototype.hasOwnProperty.call(t,s))d=t[s];else{var f=b.default.lstatSync(s);if(!f.isSymbolicLink()){i[s]=!0,t&&(t[s]=s);continue}var p=null;if(!is){var m=f.dev.toString(32)+`:`+f.ino.toString(32);r.hasOwnProperty(m)&&(p=r[m])}p===null&&(b.default.statSync(s),p=b.default.readlinkSync(s)),d=x.default.resolve(c,p),t&&(t[s]=d),is||(r[m]=p)}e=x.default.resolve(d,e.slice(a)),l()}}return t&&(t[n]=e),e},realpath:function(e,t,n){if(typeof n!=`function`&&(n=ss(t),t=null),e=x.default.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return process.nextTick(n.bind(null,null,t[e]));var r=e,i={},a={},o,s,c,l;u();function u(){var t=ls.exec(e);o=t[0].length,s=t[0],c=t[0],l=``,is&&!a[c]?b.default.lstat(c,function(e){if(e)return n(e);a[c]=!0,d()}):process.nextTick(d)}function d(){if(o>=e.length)return t&&(t[r]=e),n(null,e);cs.lastIndex=o;var i=cs.exec(e);return l=s,s+=i[0],c=l+i[1],o=cs.lastIndex,a[c]||t&&t[c]===c?process.nextTick(d):t&&Object.prototype.hasOwnProperty.call(t,c)?m(t[c]):b.default.lstat(c,f)}function f(e,r){if(e)return n(e);if(!r.isSymbolicLink())return a[c]=!0,t&&(t[c]=c),process.nextTick(d);if(!is){var o=r.dev.toString(32)+`:`+r.ino.toString(32);if(i.hasOwnProperty(o))return p(null,i[o],c)}b.default.stat(c,function(e){if(e)return n(e);b.default.readlink(c,function(e,t){is||(i[o]=t),p(e,t)})})}function p(e,r,i){if(e)return n(e);var a=x.default.resolve(l,r);t&&(t[i]=a),m(a)}function m(t){e=x.default.resolve(t,e.slice(o)),u()}}},ds=_s;_s.realpath=_s,_s.sync=vs,_s.realpathSync=vs,_s.monkeypatch=ys,_s.unmonkeypatch=bs;var fs=b.default.realpath,ps=b.default.realpathSync,ms=process.version,hs=/^v[0-5]\./.test(ms);function gs(e){return e&&e.syscall===`realpath`&&(e.code===`ELOOP`||e.code===`ENOMEM`||e.code===`ENAMETOOLONG`)}function _s(e,t,n){if(hs)return fs(e,t,n);typeof t==`function`&&(n=t,t=null),fs(e,t,function(r,i){gs(r)?us.realpath(e,t,n):n(r,i)})}function vs(e,t){if(hs)return ps(e,t);try{return ps(e,t)}catch(n){if(gs(n))return us.realpathSync(e,t);throw n}}function ys(){b.default.realpath=_s,b.default.realpathSync=vs}function bs(){b.default.realpath=fs,b.default.realpathSync=ps}var xs=function(e,t){for(var n=[],r=0;r<e.length;r++){var i=t(e[r],r);Ss(i)?n.push.apply(n,i):n.push(i)}return n},Ss=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`},Cs=ws;function ws(e,t,n){e instanceof RegExp&&(e=Ts(e,n)),t instanceof RegExp&&(t=Ts(t,n));var r=Es(e,t,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+e.length,r[1]),post:n.slice(r[1]+t.length)}}function Ts(e,t){var n=t.match(e);return n?n[0]:null}ws.range=Es;function Es(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}var Ds=Ls,Os=`\0SLASH`+Math.random()+`\0`,ks=`\0OPEN`+Math.random()+`\0`,As=`\0CLOSE`+Math.random()+`\0`,js=`\0COMMA`+Math.random()+`\0`,Ms=`\0PERIOD`+Math.random()+`\0`;function Ns(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function Ps(e){return e.split(`\\\\`).join(Os).split(`\\{`).join(ks).split(`\\}`).join(As).split(`\\,`).join(js).split(`\\.`).join(Ms)}function Fs(e){return e.split(Os).join(`\\`).split(ks).join(`{`).split(As).join(`}`).split(js).join(`,`).split(Ms).join(`.`)}function Is(e){if(!e)return[``];var t=[],n=Cs(`{`,`}`,e);if(!n)return e.split(`,`);var r=n.pre,i=n.body,a=n.post,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;var s=Is(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function Ls(e){return e?(e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),Hs(Ps(e),!0).map(Fs)):[]}function Rs(e){return`{`+e+`}`}function zs(e){return/^-?0\d/.test(e)}function Bs(e,t){return e<=t}function Vs(e,t){return e>=t}function Hs(e,t){var n=[],r=Cs(`{`,`}`,e);if(!r||/\$$/.test(r.pre))return[e];var i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),o=i||a,s=r.body.indexOf(`,`)>=0;if(!o&&!s)return r.post.match(/,.*\}/)?(e=r.pre+`{`+r.body+As+r.post,Hs(e)):[e];var c;if(o)c=r.body.split(/\.\./);else if(c=Is(r.body),c.length===1&&(c=Hs(c[0],!1).map(Rs),c.length===1)){var l=r.post.length?Hs(r.post,!1):[``];return l.map(function(e){return r.pre+c[0]+e})}var u=r.pre,l=r.post.length?Hs(r.post,!1):[``],d;if(o){var f=Ns(c[0]),p=Ns(c[1]),m=Math.max(c[0].length,c[1].length),h=c.length==3?Math.abs(Ns(c[2])):1,g=Bs;p<f&&(h*=-1,g=Vs);var _=c.some(zs);d=[];for(var v=f;g(v,p);v+=h){var y;if(a)y=String.fromCharCode(v),y===`\\`&&(y=``);else if(y=String(v),_){var b=m-y.length;if(b>0){var x=Array(b+1).join(`0`);y=v<0?`-`+x+y.slice(1):x+y}}d.push(y)}}else d=xs(c,function(e){return Hs(e,!1)});for(var S=0;S<d.length;S++)for(var C=0;C<l.length;C++){var ee=u+d[S]+l[C];(!t||o||ee)&&n.push(ee)}return n}var Us=nc;nc.Minimatch=Z;var Ws={sep:`/`};try{Ws=x.default}catch{}var Gs=nc.GLOBSTAR=Z.GLOBSTAR={},Ks={"!":{open:`(?:(?!(?:`,close:`))[^/]*?)`},"?":{open:`(?:`,close:`)?`},"+":{open:`(?:`,close:`)+`},"*":{open:`(?:`,close:`)*`},"@":{open:`(?:`,close:`)`}},qs=`[^/]`,Js=qs+`*?`,Ys=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,Xs=`(?:(?!(?:\\/|^)\\.).)*?`,Zs=Qs(`().*{}+?[]^$\\!`);function Qs(e){return e.split(``).reduce(function(e,t){return e[t]=!0,e},{})}var $s=/\/+/;nc.filter=ec;function ec(e,t){return t||={},function(n,r,i){return nc(n,e,t)}}function tc(e,t){e||={},t||={};var n={};return Object.keys(t).forEach(function(e){n[e]=t[e]}),Object.keys(e).forEach(function(t){n[t]=e[t]}),n}nc.defaults=function(e){if(!e||!Object.keys(e).length)return nc;var t=nc,n=function(n,r,i){return t.minimatch(n,r,tc(e,i))};return n.Minimatch=function(n,r){return new t.Minimatch(n,tc(e,r))},n},Z.defaults=function(e){return!e||!Object.keys(e).length?Z:nc.defaults(e).Minimatch};function nc(e,t,n){if(typeof t!=`string`)throw TypeError(`glob pattern string required`);return n||={},!n.nocomment&&t.charAt(0)===`#`?!1:t.trim()===``?e===``:new Z(t,n).match(e)}function Z(e,t){if(!(this instanceof Z))return new Z(e,t);if(typeof e!=`string`)throw TypeError(`glob pattern string required`);t||={},e=e.trim(),Ws.sep!==`/`&&(e=e.split(Ws.sep).join(`/`)),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}Z.prototype.debug=function(){},Z.prototype.make=rc;function rc(){if(!this._made){var e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error),this.debug(this.pattern,n),n=this.globParts=n.map(function(e){return e.split($s)}),this.debug(this.pattern,n),n=n.map(function(e,t,n){return e.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(e){return e.indexOf(!1)===-1}),this.debug(this.pattern,n),this.set=n}}Z.prototype.parseNegate=ic;function ic(){var e=this.pattern,t=!1,n=this.options,r=0;if(!n.nonegate){for(var i=0,a=e.length;i<a&&e.charAt(i)===`!`;i++)t=!t,r++;r&&(this.pattern=e.substr(r)),this.negate=t}}nc.braceExpand=function(e,t){return ac(e,t)},Z.prototype.braceExpand=ac;function ac(e,t){if(t||=this instanceof Z?this.options:{},e=e===void 0?this.pattern:e,e===void 0)throw TypeError(`undefined pattern`);return t.nobrace||!e.match(/\{.*\}/)?[e]:Ds(e)}Z.prototype.parse=sc;var oc={};function sc(e,t){if(e.length>1024*64)throw TypeError(`pattern is too long`);var n=this.options;if(!n.noglobstar&&e===`**`)return Gs;if(e===``)return``;var r=``,i=!!n.nocase,a=!1,o=[],s=[],c,l=!1,u=-1,d=-1,f=e.charAt(0)===`.`?``:n.dot?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,p=this;function m(){if(c){switch(c){case`*`:r+=Js,i=!0;break;case`?`:r+=qs,i=!0;break;default:r+=`\\`+c;break}p.debug(`clearStateChar %j %j`,c,r),c=!1}}for(var h=0,g=e.length,_;h<g&&(_=e.charAt(h));h++){if(this.debug(`%s %s %s %j`,e,h,r,_),a&&Zs[_]){r+=`\\`+_,a=!1;continue}switch(_){case`/`:return!1;case`\\`:m(),a=!0;continue;case`?`:case`*`:case`+`:case`@`:case`!`:if(this.debug(`%s %s %s %j <-- stateChar`,e,h,r,_),l){this.debug(` in class`),_===`!`&&h===d+1&&(_=`^`),r+=_;continue}p.debug(`call clearStateChar %j`,c),m(),c=_,n.noext&&m();continue;case`(`:if(l){r+=`(`;continue}if(!c){r+=`\\(`;continue}o.push({type:c,start:h-1,reStart:r.length,open:Ks[c].open,close:Ks[c].close}),r+=c===`!`?`(?:(?!(?:`:`(?:`,this.debug(`plType %j %j`,c,r),c=!1;continue;case`)`:if(l||!o.length){r+=`\\)`;continue}m(),i=!0;var v=o.pop();r+=v.close,v.type===`!`&&s.push(v),v.reEnd=r.length;continue;case`|`:if(l||!o.length||a){r+=`\\|`,a=!1;continue}m(),r+=`|`;continue;case`[`:if(m(),l){r+=`\\`+_;continue}l=!0,d=h,u=r.length,r+=_;continue;case`]`:if(h===d+1||!l){r+=`\\`+_,a=!1;continue}if(l){var y=e.substring(d+1,h);try{RegExp(`[`+y+`]`)}catch{var b=this.parse(y,oc);r=r.substr(0,u)+`\\[`+b[0]+`\\]`,i||=b[1],l=!1;continue}}i=!0,l=!1,r+=_;continue;default:m(),a?a=!1:Zs[_]&&!(_===`^`&&l)&&(r+=`\\`),r+=_}}for(l&&(y=e.substr(d+1),b=this.parse(y,oc),r=r.substr(0,u)+`\\[`+b[0],i||=b[1]),v=o.pop();v;v=o.pop()){var x=r.slice(v.reStart+v.open.length);this.debug(`setting tail`,r,v),x=x.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(e,t,n){return n||=`\\`,t+t+n+`|`}),this.debug(`tail=%j
|
|
25
|
-
%s`,x,x,v,r);var S=v.type===`*`?Js:v.type===`?`?qs:`\\`+v.type;i=!0,r=r.slice(0,v.reStart)+S+`\\(`+x}m(),a&&(r+=`\\\\`);var C=!1;switch(r.charAt(0)){case`.`:case`[`:case`(`:C=!0}for(var ee=s.length-1;ee>-1;ee--){var w=s[ee],T=r.slice(0,w.reStart),te=r.slice(w.reStart,w.reEnd-8),E=r.slice(w.reEnd-8,w.reEnd),D=r.slice(w.reEnd);E+=D;var ne=T.split(`(`).length-1,re=D;for(h=0;h<ne;h++)re=re.replace(/\)[+*?]?/,``);D=re;var ie=``;D===``&&t!==oc&&(ie=`$`),r=T+te+D+ie+E}if(r!==``&&i&&(r=`(?=.)`+r),C&&(r=f+r),t===oc)return[r,i];if(!i)return uc(e);var ae=n.nocase?`i`:``;try{var oe=RegExp(`^`+r+`$`,ae)}catch{return RegExp(`$.`)}return oe._glob=e,oe._src=r,oe}nc.makeRe=function(e,t){return new Z(e,t||{}).makeRe()},Z.prototype.makeRe=cc;function cc(){if(this.regexp||this.regexp===!1)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var t=this.options,n=t.noglobstar?Js:t.dot?Ys:Xs,r=t.nocase?`i`:``,i=e.map(function(e){return e.map(function(e){return e===Gs?n:typeof e==`string`?dc(e):e._src}).join(`\\/`)}).join(`|`);i=`^(?:`+i+`)$`,this.negate&&(i=`^(?!`+i+`).*$`);try{this.regexp=new RegExp(i,r)}catch{this.regexp=!1}return this.regexp}nc.match=function(e,t,n){n||={};var r=new Z(t,n);return e=e.filter(function(e){return r.match(e)}),r.options.nonull&&!e.length&&e.push(t),e},Z.prototype.match=lc;function lc(e,t){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;var n=this.options;Ws.sep!==`/`&&(e=e.split(Ws.sep).join(`/`)),e=e.split($s),this.debug(this.pattern,`split`,e);var r=this.set;this.debug(this.pattern,`set`,r);var i,a;for(a=e.length-1;a>=0&&(i=e[a],!i);a--);for(a=0;a<r.length;a++){var o=r[a],s=e;if(n.matchBase&&o.length===1&&(s=[i]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}Z.prototype.matchOne=function(e,t,n){var r=this.options;this.debug(`matchOne`,{this:this,file:e,pattern:t}),this.debug(`matchOne`,e.length,t.length);for(var i=0,a=0,o=e.length,s=t.length;i<o&&a<s;i++,a++){this.debug(`matchOne loop`);var c=t[a],l=e[i];if(this.debug(t,c,l),c===!1)return!1;if(c===Gs){this.debug(`GLOBSTAR`,[t,c,l]);var u=i,d=a+1;if(d===s){for(this.debug(`** at the end`);i<o;i++)if(e[i]===`.`||e[i]===`..`||!r.dot&&e[i].charAt(0)===`.`)return!1;return!0}for(;u<o;){var f=e[u];if(this.debug(`
|
|
26
|
-
globstar while`,e,u,t,d,f),this.matchOne(e.slice(u),t.slice(d),n))return this.debug(`globstar found match!`,u,o,f),!0;if(f===`.`||f===`..`||!r.dot&&f.charAt(0)===`.`){this.debug(`dot detected!`,e,u,t,d);break}this.debug(`globstar swallow a segment, and continue`),u++}return!!(n&&(this.debug(`
|
|
27
|
-
>>> no match, partial?`,e,u,t,d),u===o))}var p;if(typeof c==`string`?(p=r.nocase?l.toLowerCase()===c.toLowerCase():l===c,this.debug(`string match`,c,l,p)):(p=l.match(c),this.debug(`pattern match`,c,l,p)),!p)return!1}if(i===o&&a===s)return!0;if(i===o)return n;if(a===s)return i===o-1&&e[i]===``;throw Error(`wtf?`)};function uc(e){return e.replace(/\\(.)/g,`$1`)}function dc(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`)}var fc=fe(function(e){typeof Object.create==`function`?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),pc=fe(function(e){try{var t=E.default;if(typeof t.inherits!=`function`)throw``;e.exports=t.inherits}catch{e.exports=fc}});function mc(e){return e.charAt(0)===`/`}function hc(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),n=t[1]||``,r=!!(n&&n.charAt(1)!==`:`);return!!(t[2]||r)}var gc=process.platform===`win32`?hc:mc,_c=mc,vc=hc;gc.posix=_c,gc.win32=vc;var yc=jc,bc=Ac,xc=Pc,Sc=Oc,Cc=Lc,wc=Fc,Tc=Ic,Ec=Rc,Dc=zc;function Oc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var kc=Us.Minimatch;function Ac(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}function jc(e,t){return e.localeCompare(t)}function Mc(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]),e.ignore.length&&(e.ignore=e.ignore.map(Nc))}function Nc(e){var t=null;return e.slice(-3)===`/**`&&(t=new kc(e.replace(/(\/\*\*)+$/,``),{dot:!0})),{matcher:new kc(e,{dot:!0}),gmatcher:t}}function Pc(e,t,n){if(n||={},n.matchBase&&t.indexOf(`/`)===-1){if(n.noglobstar)throw Error(`base matching requires globstar`);t=`**/`+t}e.silent=!!n.silent,e.pattern=t,e.strict=n.strict!==!1,e.realpath=!!n.realpath,e.realpathCache=n.realpathCache||Object.create(null),e.follow=!!n.follow,e.dot=!!n.dot,e.mark=!!n.mark,e.nodir=!!n.nodir,e.nodir&&(e.mark=!0),e.sync=!!n.sync,e.nounique=!!n.nounique,e.nonull=!!n.nonull,e.nosort=!!n.nosort,e.nocase=!!n.nocase,e.stat=!!n.stat,e.noprocess=!!n.noprocess,e.absolute=!!n.absolute,e.maxLength=n.maxLength||1/0,e.cache=n.cache||Object.create(null),e.statCache=n.statCache||Object.create(null),e.symlinks=n.symlinks||Object.create(null),Mc(e,n),e.changedCwd=!1;var r=process.cwd();Oc(n,`cwd`)?(e.cwd=x.default.resolve(n.cwd),e.changedCwd=e.cwd!==r):e.cwd=r,e.root=n.root||x.default.resolve(e.cwd,`/`),e.root=x.default.resolve(e.root),process.platform===`win32`&&(e.root=e.root.replace(/\\/g,`/`)),e.cwdAbs=gc(e.cwd)?e.cwd:Lc(e,e.cwd),process.platform===`win32`&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,`/`)),e.nomount=!!n.nomount,n.nonegate=!0,n.nocomment=!0,e.minimatch=new kc(t,n),e.options=e.minimatch.options}function Fc(e){for(var t=e.nounique,n=t?[]:Object.create(null),r=0,i=e.matches.length;r<i;r++){var a=e.matches[r];if(!a||Object.keys(a).length===0){if(e.nonull){var o=e.minimatch.globSet[r];t?n.push(o):n[o]=!0}}else{var s=Object.keys(a);t?n.push.apply(n,s):s.forEach(function(e){n[e]=!0})}}if(t||(n=Object.keys(n)),e.nosort||(n=n.sort(e.nocase?Ac:jc)),e.mark){for(var r=0;r<n.length;r++)n[r]=e._mark(n[r]);e.nodir&&(n=n.filter(function(t){var n=!/\/$/.test(t),r=e.cache[t]||e.cache[Lc(e,t)];return n&&r&&(n=r!==`DIR`&&!Array.isArray(r)),n}))}e.ignore.length&&(n=n.filter(function(t){return!Rc(e,t)})),e.found=n}function Ic(e,t){var n=Lc(e,t),r=e.cache[n],i=t;if(r){var a=r===`DIR`||Array.isArray(r),o=t.slice(-1)===`/`;if(a&&!o?i+=`/`:!a&&o&&(i=i.slice(0,-1)),i!==t){var s=Lc(e,i);e.statCache[s]=e.statCache[n],e.cache[s]=e.cache[n]}}return i}function Lc(e,t){var n=t;return n=t.charAt(0)===`/`?x.default.join(e.root,t):gc(t)||t===``?t:e.changedCwd?x.default.resolve(e.cwd,t):x.default.resolve(t),process.platform===`win32`&&(n=n.replace(/\\/g,`/`)),n}function Rc(e,t){return e.ignore.length?e.ignore.some(function(e){return e.matcher.match(t)||!!(e.gmatcher&&e.gmatcher.match(t))}):!1}function zc(e,t){return e.ignore.length?e.ignore.some(function(e){return!!(e.gmatcher&&e.gmatcher.match(t))}):!1}var Bc={alphasort:yc,alphasorti:bc,setopts:xc,ownProp:Sc,makeAbs:Cc,finish:wc,mark:Tc,isIgnored:Ec,childrenIgnored:Dc},Vc=Kc;Kc.GlobSync=Q;var Hc=Bc.setopts,Uc=Bc.ownProp,Wc=Bc.childrenIgnored,Gc=Bc.isIgnored;function Kc(e,t){if(typeof t==`function`||arguments.length===3)throw TypeError(`callback provided to sync glob
|
|
28
|
-
See: https://github.com/isaacs/node-glob/issues/167`);return new Q(e,t).found}function Q(e,t){if(!e)throw Error(`must provide pattern`);if(typeof t==`function`||arguments.length===3)throw TypeError(`callback provided to sync glob
|
|
29
|
-
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof Q))return new Q(e,t);if(Hc(this,e,t),this.noprocess)return this;var n=this.minimatch.set.length;this.matches=Array(n);for(var r=0;r<n;r++)this._process(this.minimatch.set[r],r,!1);this._finish()}Q.prototype._finish=function(){if(w.default(this instanceof Q),this.realpath){var e=this;this.matches.forEach(function(t,n){var r=e.matches[n]=Object.create(null);for(var i in t)try{i=e._makeAbs(i);var a=ds.realpathSync(i,e.realpathCache);r[a]=!0}catch(t){if(t.syscall===`stat`)r[e._makeAbs(i)]=!0;else throw t}})}Bc.finish(this)},Q.prototype._process=function(e,t,n){w.default(this instanceof Q);for(var r=0;typeof e[r]==`string`;)r++;var i;switch(r){case e.length:this._processSimple(e.join(`/`),t);return;case 0:i=null;break;default:i=e.slice(0,r).join(`/`);break}var a=e.slice(r),o;i===null?o=`.`:((gc(i)||gc(e.join(`/`)))&&(!i||!gc(i))&&(i=`/`+i),o=i);var s=this._makeAbs(o);Wc(this,o)||(a[0]===Us.GLOBSTAR?this._processGlobStar(i,o,s,a,t,n):this._processReaddir(i,o,s,a,t,n))},Q.prototype._processReaddir=function(e,t,n,r,i,a){var o=this._readdir(n,a);if(o){for(var s=r[0],c=!!this.minimatch.negate,l=s._glob,u=this.dot||l.charAt(0)===`.`,d=[],f=0;f<o.length;f++){var p=o[f];(p.charAt(0)!==`.`||u)&&(c&&!e?!p.match(s):p.match(s))&&d.push(p)}var m=d.length;if(m!==0){if(r.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var f=0;f<m;f++){var p=d[f];e&&(p=e.slice(-1)===`/`?e+p:e+`/`+p),p.charAt(0)===`/`&&!this.nomount&&(p=x.default.join(this.root,p)),this._emitMatch(i,p)}return}r.shift();for(var f=0;f<m;f++){var p=d[f],h=e?[e,p]:[p];this._process(h.concat(r),i,a)}}}},Q.prototype._emitMatch=function(e,t){if(!Gc(this,t)){var n=this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=n),!this.matches[e][t]){if(this.nodir){var r=this.cache[n];if(r===`DIR`||Array.isArray(r))return}this.matches[e][t]=!0,this.stat&&this._stat(t)}}},Q.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var t,n;try{n=b.default.lstatSync(e)}catch(e){if(e.code===`ENOENT`)return null}var r=n&&n.isSymbolicLink();return this.symlinks[e]=r,!r&&n&&!n.isDirectory()?this.cache[e]=`FILE`:t=this._readdir(e,!1),t},Q.prototype._readdir=function(e,t){if(t&&!Uc(this.symlinks,e))return this._readdirInGlobStar(e);if(Uc(this.cache,e)){var n=this.cache[e];if(!n||n===`FILE`)return null;if(Array.isArray(n))return n}try{return this._readdirEntries(e,b.default.readdirSync(e))}catch(t){return this._readdirError(e,t),null}},Q.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var r=t[n];r=e===`/`?e+r:e+`/`+r,this.cache[r]=!0}return this.cache[e]=t,t},Q.prototype._readdirError=function(e,t){switch(t.code){case`ENOTSUP`:case`ENOTDIR`:var n=this._makeAbs(e);if(this.cache[n]=`FILE`,n===this.cwdAbs){var r=Error(t.code+` invalid cwd `+this.cwd);throw r.path=this.cwd,r.code=t.code,r}break;case`ENOENT`:case`ELOOP`:case`ENAMETOOLONG`:case`UNKNOWN`:this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw t;this.silent||console.error(`glob error`,t);break}},Q.prototype._processGlobStar=function(e,t,n,r,i,a){var o=this._readdir(n,a);if(o){var s=r.slice(1),c=e?[e]:[],l=c.concat(s);this._process(l,i,!1);var u=o.length;if(!(this.symlinks[n]&&a)){for(var d=0;d<u;d++)if(!(o[d].charAt(0)===`.`&&!this.dot)){var f=c.concat(o[d],s);this._process(f,i,!0);var p=c.concat(o[d],r);this._process(p,i,!0)}}}},Q.prototype._processSimple=function(e,t){var n=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),n){if(e&&gc(e)&&!this.nomount){var r=/[\/\\]$/.test(e);e.charAt(0)===`/`?e=x.default.join(this.root,e):(e=x.default.resolve(this.root,e),r&&(e+=`/`))}process.platform===`win32`&&(e=e.replace(/\\/g,`/`)),this._emitMatch(t,e)}},Q.prototype._stat=function(e){var t=this._makeAbs(e),n=e.slice(-1)===`/`;if(e.length>this.maxLength)return!1;if(!this.stat&&Uc(this.cache,t)){var r=this.cache[t];if(Array.isArray(r)&&(r=`DIR`),!n||r===`DIR`)return r;if(n&&r===`FILE`)return!1}var i=this.statCache[t];if(!i){var a;try{a=b.default.lstatSync(t)}catch(e){if(e&&(e.code===`ENOENT`||e.code===`ENOTDIR`))return this.statCache[t]=!1,!1}if(a&&a.isSymbolicLink())try{i=b.default.statSync(t)}catch{i=a}else i=a}this.statCache[t]=i;var r=!0;return i&&(r=i.isDirectory()?`DIR`:`FILE`),this.cache[t]=this.cache[t]||r,n&&r===`FILE`?!1:r},Q.prototype._mark=function(e){return Bc.mark(this,e)},Q.prototype._makeAbs=function(e){return Bc.makeAbs(this,e)};var qc=Jc;function Jc(e,t){if(e&&t)return Jc(e)(t);if(typeof e!=`function`)throw TypeError(`need wrapper function`);return Object.keys(e).forEach(function(t){n[t]=e[t]}),n;function n(){for(var t=Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];var r=e.apply(this,t),i=t[t.length-1];return typeof r==`function`&&r!==i&&Object.keys(i).forEach(function(e){r[e]=i[e]}),r}}var Yc=qc(Zc),Xc=qc(Qc);Zc.proto=Zc(function(){Object.defineProperty(Function.prototype,`once`,{value:function(){return Zc(this)},configurable:!0}),Object.defineProperty(Function.prototype,`onceStrict`,{value:function(){return Qc(this)},configurable:!0})});function Zc(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function Qc(e){var t=function(){if(t.called)throw Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)};return t.onceError=(e.name||"Function wrapped with `once`")+` shouldn't be called more than once`,t.called=!1,t}Yc.strict=Xc;var $c=Object.create(null),el=qc(tl);function tl(e,t){return $c[e]?($c[e].push(t),null):($c[e]=[t],nl(e))}function nl(e){return Yc(function t(){var n=$c[e],r=n.length,i=rl(arguments);try{for(var a=0;a<r;a++)n[a].apply(null,i)}finally{n.length>r?(n.splice(0,r),process.nextTick(function(){t.apply(null,i)})):delete $c[e]}})}function rl(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r]=e[r];return n}var il=ul,al=S.default.EventEmitter,ol=Bc.setopts,sl=Bc.ownProp,cl=Bc.childrenIgnored,ll=Bc.isIgnored;function ul(e,t,n){if(typeof t==`function`&&(n=t,t={}),t||={},t.sync){if(n)throw TypeError(`callback provided to sync glob`);return Vc(e,t)}return new $(e,t,n)}ul.sync=Vc;var dl=ul.GlobSync=Vc.GlobSync;ul.glob=ul;function fl(e,t){if(typeof t!=`object`||!t)return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}ul.hasMagic=function(e,t){var n=fl({},t);n.noprocess=!0;var r=new $(e,n).minimatch.set;if(!e)return!1;if(r.length>1)return!0;for(var i=0;i<r[0].length;i++)if(typeof r[0][i]!=`string`)return!0;return!1},ul.Glob=$,pc($,al);function $(e,t,n){if(typeof t==`function`&&(n=t,t=null),t&&t.sync){if(n)throw TypeError(`callback provided to sync glob`);return new dl(e,t)}if(!(this instanceof $))return new $(e,t,n);ol(this,e,t),this._didRealPath=!1;var r=this.minimatch.set.length;this.matches=Array(r),typeof n==`function`&&(n=Yc(n),this.on(`error`,n),this.on(`end`,function(e){n(null,e)}));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(r===0)return s();for(var a=!0,o=0;o<r;o++)this._process(this.minimatch.set[o],o,!1,s);a=!1;function s(){--i._processing,i._processing<=0&&(a?process.nextTick(function(){i._finish()}):i._finish())}}$.prototype._finish=function(){if(w.default(this instanceof $),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();Bc.finish(this),this.emit(`end`,this.found)}},$.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=!0;var e=this.matches.length;if(e===0)return this._finish();for(var t=this,n=0;n<this.matches.length;n++)this._realpathSet(n,r);function r(){--e===0&&t._finish()}},$.prototype._realpathSet=function(e,t){var n=this.matches[e];if(!n)return t();var r=Object.keys(n),i=this,a=r.length;if(a===0)return t();var o=this.matches[e]=Object.create(null);r.forEach(function(n,r){n=i._makeAbs(n),ds.realpath(n,i.realpathCache,function(r,s){r?r.syscall===`stat`?o[n]=!0:i.emit(`error`,r):o[s]=!0,--a===0&&(i.matches[e]=o,t())})})},$.prototype._mark=function(e){return Bc.mark(this,e)},$.prototype._makeAbs=function(e){return Bc.makeAbs(this,e)},$.prototype.abort=function(){this.aborted=!0,this.emit(`abort`)},$.prototype.pause=function(){this.paused||(this.paused=!0,this.emit(`pause`))},$.prototype.resume=function(){if(this.paused){if(this.emit(`resume`),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var n=e[t];this._emitMatch(n[0],n[1])}}if(this._processQueue.length){var r=this._processQueue.slice(0);this._processQueue.length=0;for(var t=0;t<r.length;t++){var i=r[t];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}},$.prototype._process=function(e,t,n,r){if(w.default(this instanceof $),w.default(typeof r==`function`),!this.aborted){if(this._processing++,this.paused){this._processQueue.push([e,t,n,r]);return}for(var i=0;typeof e[i]==`string`;)i++;var a;switch(i){case e.length:this._processSimple(e.join(`/`),t,r);return;case 0:a=null;break;default:a=e.slice(0,i).join(`/`);break}var o=e.slice(i),s;a===null?s=`.`:((gc(a)||gc(e.join(`/`)))&&(!a||!gc(a))&&(a=`/`+a),s=a);var c=this._makeAbs(s);if(cl(this,s))return r();o[0]===Us.GLOBSTAR?this._processGlobStar(a,s,c,o,t,n,r):this._processReaddir(a,s,c,o,t,n,r)}},$.prototype._processReaddir=function(e,t,n,r,i,a,o){var s=this;this._readdir(n,a,function(c,l){return s._processReaddir2(e,t,n,r,i,a,l,o)})},$.prototype._processReaddir2=function(e,t,n,r,i,a,o,s){if(!o)return s();for(var c=r[0],l=!!this.minimatch.negate,u=c._glob,d=this.dot||u.charAt(0)===`.`,f=[],p=0;p<o.length;p++){var m=o[p];(m.charAt(0)!==`.`||d)&&(l&&!e?!m.match(c):m.match(c))&&f.push(m)}var h=f.length;if(h===0)return s();if(r.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var p=0;p<h;p++){var m=f[p];e&&(m=e===`/`?e+m:e+`/`+m),m.charAt(0)===`/`&&!this.nomount&&(m=x.default.join(this.root,m)),this._emitMatch(i,m)}return s()}r.shift();for(var p=0;p<h;p++){var m=f[p];e&&(m=e===`/`?e+m:e+`/`+m),this._process([m].concat(r),i,a,s)}s()},$.prototype._emitMatch=function(e,t){if(!this.aborted&&!ll(this,t)){if(this.paused){this._emitQueue.push([e,t]);return}var n=gc(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=n),!this.matches[e][t]){if(this.nodir){var r=this.cache[n];if(r===`DIR`||Array.isArray(r))return}this.matches[e][t]=!0;var i=this.statCache[n];i&&this.emit(`stat`,t,i),this.emit(`match`,t)}}},$.prototype._readdirInGlobStar=function(e,t){if(this.aborted)return;if(this.follow)return this._readdir(e,!1,t);var n=`lstat\0`+e,r=this,i=el(n,a);i&&b.default.lstat(e,i);function a(n,i){if(n&&n.code===`ENOENT`)return t();var a=i&&i.isSymbolicLink();r.symlinks[e]=a,!a&&i&&!i.isDirectory()?(r.cache[e]=`FILE`,t()):r._readdir(e,!1,t)}},$.prototype._readdir=function(e,t,n){if(!this.aborted&&(n=el(`readdir\0`+e+`\0`+t,n),n)){if(t&&!sl(this.symlinks,e))return this._readdirInGlobStar(e,n);if(sl(this.cache,e)){var r=this.cache[e];if(!r||r===`FILE`)return n();if(Array.isArray(r))return n(null,r)}b.default.readdir(e,pl(this,e,n))}};function pl(e,t,n){return function(r,i){r?e._readdirError(t,r,n):e._readdirEntries(t,i,n)}}$.prototype._readdirEntries=function(e,t,n){if(!this.aborted){if(!this.mark&&!this.stat)for(var r=0;r<t.length;r++){var i=t[r];i=e===`/`?e+i:e+`/`+i,this.cache[i]=!0}return this.cache[e]=t,n(null,t)}},$.prototype._readdirError=function(e,t,n){if(!this.aborted){switch(t.code){case`ENOTSUP`:case`ENOTDIR`:var r=this._makeAbs(e);if(this.cache[r]=`FILE`,r===this.cwdAbs){var i=Error(t.code+` invalid cwd `+this.cwd);i.path=this.cwd,i.code=t.code,this.emit(`error`,i),this.abort()}break;case`ENOENT`:case`ELOOP`:case`ENAMETOOLONG`:case`UNKNOWN`:this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit(`error`,t),this.abort()),this.silent||console.error(`glob error`,t);break}return n()}},$.prototype._processGlobStar=function(e,t,n,r,i,a,o){var s=this;this._readdir(n,a,function(c,l){s._processGlobStar2(e,t,n,r,i,a,l,o)})},$.prototype._processGlobStar2=function(e,t,n,r,i,a,o,s){if(!o)return s();var c=r.slice(1),l=e?[e]:[],u=l.concat(c);this._process(u,i,!1,s);var d=this.symlinks[n],f=o.length;if(d&&a)return s();for(var p=0;p<f;p++)if(!(o[p].charAt(0)===`.`&&!this.dot)){var m=l.concat(o[p],c);this._process(m,i,!0,s);var h=l.concat(o[p],r);this._process(h,i,!0,s)}s()},$.prototype._processSimple=function(e,t,n){var r=this;this._stat(e,function(i,a){r._processSimple2(e,t,i,a,n)})},$.prototype._processSimple2=function(e,t,n,r,i){if(this.matches[t]||(this.matches[t]=Object.create(null)),!r)return i();if(e&&gc(e)&&!this.nomount){var a=/[\/\\]$/.test(e);e.charAt(0)===`/`?e=x.default.join(this.root,e):(e=x.default.resolve(this.root,e),a&&(e+=`/`))}process.platform===`win32`&&(e=e.replace(/\\/g,`/`)),this._emitMatch(t,e),i()},$.prototype._stat=function(e,t){var n=this._makeAbs(e),r=e.slice(-1)===`/`;if(e.length>this.maxLength)return t();if(!this.stat&&sl(this.cache,n)){var i=this.cache[n];if(Array.isArray(i)&&(i=`DIR`),!r||i===`DIR`)return t(null,i);if(r&&i===`FILE`)return t()}var a=this.statCache[n];if(a!==void 0){if(a===!1)return t(null,a);var o=a.isDirectory()?`DIR`:`FILE`;return r&&o===`FILE`?t():t(null,o,a)}var s=this,c=el(`stat\0`+n,l);c&&b.default.lstat(n,c);function l(r,i){if(i&&i.isSymbolicLink())return b.default.stat(n,function(r,a){r?s._stat2(e,n,null,i,t):s._stat2(e,n,r,a,t)});s._stat2(e,n,r,i,t)}},$.prototype._stat2=function(e,t,n,r,i){if(n&&(n.code===`ENOENT`||n.code===`ENOTDIR`))return this.statCache[t]=!1,i();var a=e.slice(-1)===`/`;if(this.statCache[t]=r,t.slice(-1)===`/`&&r&&!r.isDirectory())return i(null,!1,r);var o=!0;return r&&(o=r.isDirectory()?`DIR`:`FILE`),this.cache[t]=this.cache[t]||o,a&&o===`FILE`?i():i(null,o,r)};var ml=xl;xl.sync=Dl;var hl=void 0;try{hl=il}catch{}var gl=438,_l={nosort:!0,silent:!0},vl=0,yl=process.platform===`win32`;function bl(e){if([`unlink`,`chmod`,`stat`,`lstat`,`rmdir`,`readdir`].forEach(function(t){e[t]=e[t]||b.default[t],t+=`Sync`,e[t]=e[t]||b.default[t]}),e.maxBusyTries=e.maxBusyTries||3,e.emfileWait=e.emfileWait||1e3,e.glob===!1&&(e.disableGlob=!0),e.disableGlob!==!0&&hl===void 0)throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");e.disableGlob=e.disableGlob||!1,e.glob=e.glob||_l}function xl(e,t,n){typeof t==`function`&&(n=t,t={}),w.default(e,`rimraf: missing path`),w.default.equal(typeof e,`string`,`rimraf: path should be a string`),w.default.equal(typeof n,`function`,`rimraf: callback function required`),w.default(t,`rimraf: invalid options argument provided`),w.default.equal(typeof t,`object`,`rimraf: options should be object`),bl(t);var r=0,i=null,a=0;if(t.disableGlob||!hl.hasMagic(e))return s(null,[e]);t.lstat(e,function(n,r){if(!n)return s(null,[e]);hl(e,t.glob,s)});function o(e){i||=e,--a===0&&n(i)}function s(e,i){if(e)return n(e);if(a=i.length,a===0)return n();i.forEach(function(e){Sl(e,t,function n(i){if(i){if((i.code===`EBUSY`||i.code===`ENOTEMPTY`||i.code===`EPERM`)&&r<t.maxBusyTries){r++;var a=r*100;return setTimeout(function(){Sl(e,t,n)},a)}if(i.code===`EMFILE`&&vl<t.emfileWait)return setTimeout(function(){Sl(e,t,n)},vl++);i.code===`ENOENT`&&(i=null)}vl=0,o(i)})})}}function Sl(e,t,n){w.default(e),w.default(t),w.default(typeof n==`function`),t.lstat(e,function(r,i){if(r&&r.code===`ENOENT`)return n(null);if(r&&r.code===`EPERM`&&yl&&Cl(e,t,r,n),i&&i.isDirectory())return Tl(e,t,r,n);t.unlink(e,function(r){if(r){if(r.code===`ENOENT`)return n(null);if(r.code===`EPERM`)return yl?Cl(e,t,r,n):Tl(e,t,r,n);if(r.code===`EISDIR`)return Tl(e,t,r,n)}return n(r)})})}function Cl(e,t,n,r){w.default(e),w.default(t),w.default(typeof r==`function`),n&&w.default(n instanceof Error),t.chmod(e,gl,function(i){i?r(i.code===`ENOENT`?null:n):t.stat(e,function(i,a){i?r(i.code===`ENOENT`?null:n):a.isDirectory()?Tl(e,t,n,r):t.unlink(e,r)})})}function wl(e,t,n){w.default(e),w.default(t),n&&w.default(n instanceof Error);try{t.chmodSync(e,gl)}catch(e){if(e.code===`ENOENT`)return;throw n}try{var r=t.statSync(e)}catch(e){if(e.code===`ENOENT`)return;throw n}r.isDirectory()?Ol(e,t,n):t.unlinkSync(e)}function Tl(e,t,n,r){w.default(e),w.default(t),n&&w.default(n instanceof Error),w.default(typeof r==`function`),t.rmdir(e,function(i){i&&(i.code===`ENOTEMPTY`||i.code===`EEXIST`||i.code===`EPERM`)?El(e,t,r):i&&i.code===`ENOTDIR`?r(n):r(i)})}function El(e,t,n){w.default(e),w.default(t),w.default(typeof n==`function`),t.readdir(e,function(r,i){if(r)return n(r);var a=i.length;if(a===0)return t.rmdir(e,n);var o;i.forEach(function(r){xl(x.default.join(e,r),t,function(r){if(!o){if(r)return n(o=r);--a===0&&t.rmdir(e,n)}})})})}function Dl(e,t){t||={},bl(t),w.default(e,`rimraf: missing path`),w.default.equal(typeof e,`string`,`rimraf: path should be a string`),w.default(t,`rimraf: missing options`),w.default.equal(typeof t,`object`,`rimraf: options should be object`);var n;if(t.disableGlob||!hl.hasMagic(e))n=[e];else try{t.lstatSync(e),n=[e]}catch{n=hl.sync(e,t.glob)}if(n.length)for(var r=0;r<n.length;r++){var e=n[r];try{var i=t.lstatSync(e)}catch(n){if(n.code===`ENOENT`)return;n.code===`EPERM`&&yl&&wl(e,t,n)}try{i&&i.isDirectory()?Ol(e,t,null):t.unlinkSync(e)}catch(n){if(n.code===`ENOENT`)return;if(n.code===`EPERM`)return yl?wl(e,t,n):Ol(e,t,n);if(n.code!==`EISDIR`)throw n;Ol(e,t,n)}}}function Ol(e,t,n){w.default(e),w.default(t),n&&w.default(n instanceof Error);try{t.rmdirSync(e)}catch(r){if(r.code===`ENOENT`)return;if(r.code===`ENOTDIR`)throw n;(r.code===`ENOTEMPTY`||r.code===`EEXIST`||r.code===`EPERM`)&&kl(e,t)}}function kl(e,t){w.default(e),w.default(t),t.readdirSync(e).forEach(function(n){Dl(x.default.join(e,n),t)});var n=yl?100:1,r=0;do{var i=!0;try{var a=t.rmdirSync(e,t);return i=!1,a}finally{if(++r<n&&i)continue}}while(!0)}function Al(e){return e&&typeof e==`object`&&`default`in e?e.default:e}var jl=Al(ns),Ml=Al(ml);function Nl(e){return x.default.resolve.apply(null,e)}function Pl(e){var t,n;if(typeof e[e.length-1]==`object`){t=e[e.length-1];var r=e.length-1;for(n=Array(r);r--;)n[r]=e[r]}else t={},n=e;var i=x.default.resolve.apply(null,n);return{options:t,resolvedPath:i}}function Fl(){var e=Pl(arguments),t=e.resolvedPath,n=e.options;return{to:function(){var e=Pl(arguments),r=e.resolvedPath,i=e.options;function a(e,t){jl.sync(t),es.readdirSync(e).forEach(function(r){var o=e+x.default.sep+r,s=t+x.default.sep+r;if(es.statSync(o).isDirectory())return a(o,s);var c=es.readFileSync(o,n);es.writeFileSync(s,c,i)})}a(t,r)}}}function Il(){Ml.sync(Nl(arguments))}process.platform,es.closeSync,es.fchmodSync,es.fchownSync,es.fstatSync,es.fsyncSync,es.ftruncateSync,es.futimesSync,es.readSync;var Ll=Fl,Rl=Il,zl=re.default.homedir()||re.default.tmpdir(),Bl=1e3,Vl=Bl*60,Hl=Vl*60,Ul=Hl*24,Wl=Ul*7,Gl=Ul*365.25,Kl=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return ql(e);if(n===`number`&&isFinite(e))return t.long?Yl(e):Jl(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function ql(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return n*Gl;case`weeks`:case`week`:case`w`:return n*Wl;case`days`:case`day`:case`d`:return n*Ul;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return n*Hl;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return n*Vl;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return n*Bl;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return n;default:return}}}}function Jl(e){var t=Math.abs(e);return t>=Ul?Math.round(e/Ul)+`d`:t>=Hl?Math.round(e/Hl)+`h`:t>=Vl?Math.round(e/Vl)+`m`:t>=Bl?Math.round(e/Bl)+`s`:e+`ms`}function Yl(e){var t=Math.abs(e);return t>=Ul?Xl(e,t,Ul,`day`):t>=Hl?Xl(e,t,Hl,`hour`):t>=Vl?Xl(e,t,Vl,`minute`):t>=Bl?Xl(e,t,Bl,`second`):e+` ms`}function Xl(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}function Zl(e){n.debug=n,n.default=n,n.coerce=c,n.disable=a,n.enable=i,n.enabled=o,n.humanize=Kl,n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null;function a(...e){if(!a.enabled)return;let r=a,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;o++;let a=n.formatters[i];if(typeof a==`function`){let n=e[o];t=a.call(r,n),e.splice(o,1),o--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return a.namespace=e,a.useColors=n.useColors(),a.color=n.selectColor(e),a.extend=r,a.destroy=n.destroy,Object.defineProperty(a,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?n.enabled(e):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(a),a}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.names=[],n.skips=[];let t,r=(typeof e==`string`?e:``).split(/[\s,]+/),i=r.length;for(t=0;t<i;t++)r[t]&&(e=r[t].replace(/\*/g,`.*?`),e[0]===`-`?n.skips.push(RegExp(`^`+e.substr(1)+`$`)):n.names.push(RegExp(`^`+e+`$`)))}function a(){let e=[...n.names.map(s),...n.skips.map(s).map(e=>`-`+e)].join(`,`);return n.enable(``),e}function o(e){if(e[e.length-1]===`*`)return!0;let t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,`*`)}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var Ql=Zl,$l=fe(function(e,t){t.formatArgs=r,t.save=i,t.load=a,t.useColors=n,t.storage=o(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){return typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs)?!0:typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(t){if(t[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+t[0]+(this.useColors?`%c `:` `)+`+`+e.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;t.splice(1,0,n,`color: inherit`);let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),t.splice(i,0,n)}t.log=console.debug||console.log||(()=>{});function i(e){try{e?t.storage.setItem(`debug`,e):t.storage.removeItem(`debug`)}catch{}}function a(){let e;try{e=t.storage.getItem(`debug`)}catch{}return!e&&typeof process<`u`&&`env`in process&&(e=process.env.DEBUG),e}function o(){try{return localStorage}catch{}}e.exports=Ql(t);let{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}}),eu=fe(function(e,t){t.init=c,t.log=a,t.formatArgs=r,t.save=o,t.load=s,t.useColors=n,t.destroy=E.default.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{let e=to;e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function n(){return`colors`in t.inspectOpts?!!t.inspectOpts.colors:ie.default.isatty(process.stderr.fd)}function r(t){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \u001B[0m`;t[0]=a+t[0].split(`
|
|
30
|
-
`).join(`
|
|
31
|
-
`+a),t.push(i+`m+`+e.exports.humanize(this.diff)+`\x1B[0m`)}else t[0]=i()+n+` `+t[0]}function i(){return t.inspectOpts.hideDate?``:new Date().toISOString()+` `}function a(...e){return process.stderr.write(E.default.format(...e)+`
|
|
32
|
-
`)}function o(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function s(){return process.env.DEBUG}function c(e){e.inspectOpts={};let n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]}e.exports=Ql(t);let{formatters:l}=e.exports;l.o=function(e){return this.inspectOpts.colors=this.useColors,E.default.inspect(e,this.inspectOpts).split(`
|
|
33
|
-
`).map(e=>e.trim()).join(` `)},l.O=function(e){return this.inspectOpts.colors=this.useColors,E.default.inspect(e,this.inspectOpts)}}),tu=fe(function(e){typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?e.exports=$l:e.exports=eu});function nu(e){return function(t,n){return new Promise((r,i)=>{e.call(this,t,n,(e,t)=>{e?i(e):r(t)})})}}var ru=nu,iu=Object.defineProperty({default:ru},`__esModule`,{value:!0}),au=de&&de.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};let ou=au(tu),su=au(iu),cu=ou.default(`agent-base`);function lu(e){return!!e&&typeof e.addRequest==`function`}function uu(){let{stack:e}=Error();return typeof e==`string`?e.split(`
|
|
34
|
-
`).some(e=>e.indexOf(`(https.js:`)!==-1||e.indexOf(`node:https:`)!==-1):!1}function du(e,t){return new du.Agent(e,t)}(function(e){class t extends S.default.EventEmitter{constructor(e,t){super();let n=t;typeof e==`function`?this.callback=e:e&&(n=e),this.timeout=null,n&&typeof n.timeout==`number`&&(this.timeout=n.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort==`number`?this.explicitDefaultPort:uu()?443:80}set defaultPort(e){this.explicitDefaultPort=e}get protocol(){return typeof this.explicitProtocol==`string`?this.explicitProtocol:uu()?`https:`:`http:`}set protocol(e){this.explicitProtocol=e}callback(e,t,n){throw Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(e,t){let n=Object.assign({},t);typeof n.secureEndpoint!=`boolean`&&(n.secureEndpoint=uu()),n.host??=`localhost`,n.port??=n.secureEndpoint?443:80,n.protocol??=n.secureEndpoint?`https:`:`http:`,n.host&&n.path&&delete n.path,delete n.agent,delete n.hostname,delete n._defaultAgent,delete n.defaultPort,delete n.createConnection,e._last=!0,e.shouldKeepAlive=!1;let r=!1,i=null,a=n.timeout||this.timeout,o=t=>{e._hadError||=(e.emit(`error`,t),!0)},s=()=>{i=null,r=!0;let e=Error(`A "socket" was not created for HTTP request before ${a}ms`);e.code=`ETIMEOUT`,o(e)},c=e=>{r||(i!==null&&(clearTimeout(i),i=null),o(e))},l=t=>{if(!r){if(i!=null&&(clearTimeout(i),i=null),lu(t)){cu(`Callback returned another Agent instance %o`,t.constructor.name),t.addRequest(e,n);return}if(t){t.once(`free`,()=>{this.freeSocket(t,n)}),e.onSocket(t);return}o(Error(`no Duplex stream was returned to agent-base for \`${e.method} ${e.path}\``))}};if(typeof this.callback!=`function`){o(Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(cu(`Converting legacy callback function to promise`),this.promisifiedCallback=su.default(this.callback)):this.promisifiedCallback=this.callback),typeof a==`number`&&a>0&&(i=setTimeout(s,a)),`port`in n&&typeof n.port!=`number`&&(n.port=Number(n.port));try{cu(`Resolving socket for %o request: %o`,n.protocol,`${e.method} ${e.path}`),Promise.resolve(this.promisifiedCallback(e,n)).then(l,c)}catch(e){Promise.reject(e).catch(c)}}freeSocket(e,t){cu(`Freeing socket %o %o`,e.constructor.name,t),e.destroy()}destroy(){cu(`Destroying agent %o`,this.constructor.name)}}e.Agent=t,e.prototype=e.Agent.prototype})(du||={});var fu=du;let pu=(de&&de.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(tu).default(`https-proxy-agent:parse-proxy-response`);function mu(e){return new Promise((t,n)=>{let r=0,i=[];function a(){let t=e.read();t?u(t):e.once(`readable`,a)}function o(){e.removeListener(`end`,c),e.removeListener(`error`,l),e.removeListener(`close`,s),e.removeListener(`readable`,a)}function s(e){pu(`onclose had error %o`,e)}function c(){pu(`onend`)}function l(e){o(),pu(`onerror %o`,e),n(e)}function u(e){i.push(e),r+=e.length;let n=Buffer.concat(i,r);if(n.indexOf(`\r
|
|
35
|
-
\r
|
|
36
|
-
`)===-1){pu(`have not received end of HTTP headers yet...`),a();return}let o=n.toString(`ascii`,0,n.indexOf(`\r
|
|
37
|
-
`)),s=+o.split(` `)[1];pu(`got proxy server response: %o`,o),t({statusCode:s,buffered:n})}e.on(`error`,l),e.on(`close`,s),e.on(`end`,c),a()})}var hu=mu,gu=Object.defineProperty({default:hu},`__esModule`,{value:!0}),_u=de&&de.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},vu=de&&de.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};let yu=vu(le.default),bu=vu(ue.default),xu=vu(ce.default),Su=vu(w.default),Cu=vu(tu),wu=vu(gu),Tu=Cu.default(`https-proxy-agent:agent`);var Eu=class extends fu.Agent{constructor(e){let t;if(t=typeof e==`string`?xu.default.parse(e):e,!t)throw Error("an HTTP(S) proxy server `host` and `port` must be specified!");Tu(`creating new HttpsProxyAgent instance: %o`,t),super(t);let n=Object.assign({},t);this.secureProxy=t.secureProxy||ku(n.protocol),n.host=n.hostname||n.host,typeof n.port==`string`&&(n.port=parseInt(n.port,10)),!n.port&&n.host&&(n.port=this.secureProxy?443:80),this.secureProxy&&!(`ALPNProtocols`in n)&&(n.ALPNProtocols=[`http 1.1`]),n.host&&n.path&&(delete n.path,delete n.pathname),this.proxy=n}callback(e,t){return _u(this,void 0,void 0,function*(){let{proxy:n,secureProxy:r}=this,i;r?(Tu("Creating `tls.Socket`: %o",n),i=bu.default.connect(n)):(Tu("Creating `net.Socket`: %o",n),i=yu.default.connect(n));let a=Object.assign({},n.headers),o=`CONNECT ${`${t.host}:${t.port}`} HTTP/1.1\r\n`;n.auth&&(a[`Proxy-Authorization`]=`Basic ${Buffer.from(n.auth).toString(`base64`)}`);let{host:s,port:c,secureEndpoint:l}=t;Ou(c,l)||(s+=`:${c}`),a.Host=s,a.Connection=`close`;for(let e of Object.keys(a))o+=`${e}: ${a[e]}\r\n`;let u=wu.default(i);i.write(`${o}\r\n`);let{statusCode:d,buffered:f}=yield u;if(d===200){if(e.once(`socket`,Du),t.secureEndpoint){let e=t.servername||t.host;if(!e)throw Error(`Could not determine "servername"`);return Tu(`Upgrading socket connection to TLS`),bu.default.connect(Object.assign(Object.assign({},Au(t,`host`,`hostname`,`path`,`port`)),{socket:i,servername:e}))}return i}i.destroy();let p=new yu.default.Socket;return p.readable=!0,e.once(`socket`,e=>{Tu(`replaying proxy buffer for failed request`),Su.default(e.listenerCount(`data`)>0),e.push(f),e.push(null)}),p})}};function Du(e){e.resume()}function Ou(e,t){return!!(!t&&e===80||t&&e===443)}function ku(e){return typeof e==`string`?/^https:?$/i.test(e):!1}function Au(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}var ju=Object.defineProperty({default:Eu},`__esModule`,{value:!0});let Mu=(de&&de.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ju);function Nu(e){return new Mu.default(e)}(function(e){e.HttpsProxyAgent=Mu.default,e.prototype=Mu.default.prototype})(Nu||={});var Pu=Nu,Fu=class extends Error{constructor(e,t){super(e),Object.assign(this,t)}};function Iu(e,t){try{return t&&t.clearCache===!0&&delete D.cache[D.resolve(e)],D(e)}catch{return null}}function Lu(e){return new Promise((t,n)=>{se.default.exec(e,(e,r,i)=>{if(e){n(e);return}t({stdout:r,stderr:i})})})}function Ru(e){let t=x.default.dirname(e);if(t!==e){Ru(t);try{b.default.mkdirSync(e)}catch(e){if(e.code!==`EEXIST`)throw e}}}function zu(e,t,n){return new Promise((r,i)=>{let a=e;if(n){let t=ce.default.parse(e);a={hostname:t.host,path:t.path,agent:new Pu(n)}}oe.default.get(a,e=>{let a=e.statusCode;a>=400?i({code:a,message:e.statusMessage}):a>=300?zu(e.headers.location,t,n).then(r,i):e.pipe(b.default.createWriteStream(t)).on(`finish`,()=>r()).on(`error`,i)}).on(`error`,i)})}function Bu(e,t){let n=x.default.join(e,`tmp`);Rl(n),Ru(n),b.default.readdirSync(t).forEach(e=>{let r=x.default.join(t,e),i=x.default.join(n,e);b.default.lstatSync(r).isDirectory()?(Ll(r).to(i),Rl(r)):(b.default.copyFileSync(r,i),b.default.unlinkSync(r))})}function Vu(e,t){let n=x.default.join(e,`tmp`);b.default.readdirSync(n).forEach(e=>{let r=x.default.join(n,e),i=x.default.join(t,e);b.default.lstatSync(r).isDirectory()?(Ll(r).to(i),Rl(r)):(e!==`degit.json`&&b.default.copyFileSync(r,i),b.default.unlinkSync(r))}),Rl(n)}let Hu=x.default.join(zl,`.degit`),Uu=new Set([`tar`,`git`]);function Wu(e,t){return new Gu(e,t)}var Gu=class extends S.default{constructor(e,t={}){if(super(),this.src=e,this.cache=t.cache,this.force=t.force,this.verbose=t.verbose,this.proxy=process.env.https_proxy,this.repo=qu(e),this.mode=t.mode||this.repo.mode,!Uu.has(this.mode))throw Error(`Valid modes are ${Array.from(Uu).join(`, `)}`);this._hasStashed=!1,this.directiveActions={clone:async(e,t,n)=>{this._hasStashed===!1&&(Bu(e,t),this._hasStashed=!0);let r=Object.assign({force:!0},{cache:n.cache,verbose:n.verbose}),i=Wu(n.src,r);i.on(`info`,e=>{console.error(No.cyan(`> ${e.message.replace(`options.`,`--`)}`))}),i.on(`warn`,e=>{console.error(No.magenta(`! ${e.message.replace(`options.`,`--`)}`))}),await i.clone(t).catch(e=>{console.error(No.red(`! ${e.message}`)),process.exit(1)})},remove:this.remove.bind(this)}}_getDirectives(e){let t=x.default.resolve(e,`degit.json`),n=Iu(t,{clearCache:!0})||!1;return n&&b.default.unlinkSync(t),n}async clone(e){this._checkDirIsEmpty(e);let{repo:t}=this,n=x.default.join(Hu,t.site,t.user,t.name);this.mode===`tar`?await this._cloneWithTar(n,e):await this._cloneWithGit(n,e),this._info({code:`SUCCESS`,message:`cloned ${No.bold(t.user+`/`+t.name)}#${No.bold(t.ref)}${e===`.`?``:` to ${e}`}`,repo:t,dest:e});let r=this._getDirectives(e);if(r){for(let t of r)await this.directiveActions[t.action](n,e,t);this._hasStashed===!0&&Vu(n,e)}}remove(e,t,n){let r=n.files;Array.isArray(r)||(r=[r]);let i=r.map(e=>{let n=x.default.resolve(t,e);return b.default.existsSync(n)?b.default.lstatSync(n).isDirectory()?(Rl(n),e+`/`):(b.default.unlinkSync(n),e):(this._warn({code:`FILE_DOES_NOT_EXIST`,message:`action wants to remove ${No.bold(e)} but it does not exist`}),null)}).filter(e=>e);i.length>0&&this._info({code:`REMOVED`,message:`removed: ${No.bold(i.map(e=>No.bold(e)).join(`, `))}`})}_checkDirIsEmpty(e){try{if(b.default.readdirSync(e).length>0)if(this.force)this._info({code:`DEST_NOT_EMPTY`,message:`destination directory is not empty. Using options.force, continuing`});else throw new Fu(`destination directory is not empty, aborting. Use options.force to override`,{code:`DEST_NOT_EMPTY`});else this._verbose({code:`DEST_IS_EMPTY`,message:`destination directory is empty`})}catch(e){if(e.code!==`ENOENT`)throw e}}_info(e){this.emit(`info`,e)}_warn(e){this.emit(`warn`,e)}_verbose(e){this.verbose&&this._info(e)}async _getHash(e,t){try{let t=await Yu(e);return e.ref===`HEAD`?t.find(e=>e.type===`HEAD`).hash:this._selectRef(t,e.ref)}catch(n){return this._warn(n),this._verbose(n.original),this._getHashFromCache(e,t)}}_getHashFromCache(e,t){if(e.ref in t){let n=t[e.ref];return this._info({code:`USING_CACHE`,message:`using cached commit hash ${n}`}),n}}_selectRef(e,t){for(let n of e)if(n.name===t)return this._verbose({code:`FOUND_MATCH`,message:`found matching commit hash: ${n.hash}`}),n.hash;if(t.length<8)return null;for(let n of e)if(n.hash.startsWith(t))return n.hash}async _cloneWithTar(e,t){let{repo:n}=this,r=Iu(x.default.join(e,`map.json`))||{},i=this.cache?this._getHashFromCache(n,r):await this._getHash(n,r),a=n.subdir?`${n.name}-${i}${n.subdir}`:null;if(!i)throw new Fu(`could not find commit hash for ${n.ref}`,{code:`MISSING_REF`,ref:n.ref});let o=`${e}/${i}.tar.gz`,s=n.site===`gitlab`?`${n.url}/repository/archive.tar.gz?ref=${i}`:n.site===`bitbucket`?`${n.url}/get/${i}.tar.gz`:`${n.url}/archive/${i}.tar.gz`;try{if(!this.cache)try{b.default.statSync(o),this._verbose({code:`FILE_EXISTS`,message:`${o} already exists locally`})}catch{Ru(x.default.dirname(o)),this.proxy&&this._verbose({code:`PROXY`,message:`using proxy ${this.proxy}`}),this._verbose({code:`DOWNLOADING`,message:`downloading ${s} to ${o}`}),await zu(s,o,this.proxy)}}catch(e){throw new Fu(`could not download ${s}`,{code:`COULD_NOT_DOWNLOAD`,url:s,original:e})}Xu(e,n,i,r),this._verbose({code:`EXTRACTING`,message:`extracting ${a?n.subdir+` from `:``}${o} to ${t}`}),Ru(t),await Ju(o,t,a)}async _cloneWithGit(e,t){await Lu(`git clone ${this.repo.ssh} ${t}`),await Lu(`rm -rf ${x.default.resolve(t,`.git`)}`)}};let Ku=new Set([`github`,`gitlab`,`bitbucket`,`git.sr.ht`]);function qu(e){let t=/^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(e);if(!t)throw new Fu(`could not parse ${e}`,{code:`BAD_SRC`});let n=(t[1]||t[2]||t[3]||`github`).replace(/\.(com|org)$/,``);if(!Ku.has(n))throw new Fu(`degit supports GitHub, GitLab, Sourcehut and BitBucket`,{code:`UNSUPPORTED_HOST`});let r=t[4],i=t[5].replace(/\.git$/,``),a=t[6],o=t[7]||`HEAD`,s=`${n}.${n===`bitbucket`?`org`:n===`git.sr.ht`?``:`com`}`;return{site:n,user:r,name:i,ref:o,url:`https://${s}/${r}/${i}`,ssh:`git@${s}:${r}/${i}`,subdir:a,mode:Ku.has(n)?`tar`:`git`}}async function Ju(e,t,n=null){return Pa.extract({file:e,strip:n?n.split(`/`).length:1,C:t},n?[n]:[])}async function Yu(e){try{let{stdout:t}=await Lu(`git ls-remote ${e.url}`);return t.split(`
|
|
38
|
-
`).filter(Boolean).map(e=>{let[t,n]=e.split(` `);if(n===`HEAD`)return{type:`HEAD`,hash:t};let r=/refs\/(\w+)\/(.+)/.exec(n);if(!r)throw new Fu(`could not parse ${n}`,{code:`BAD_REF`});return{type:r[1]===`heads`?`branch`:r[1]===`refs`?`ref`:r[1],name:r[2],hash:t}})}catch(t){throw new Fu(`could not fetch remote ${e.url}`,{code:`COULD_NOT_FETCH`,url:e.url,original:t})}}function Xu(e,t,n,r){let i=Iu(x.default.join(e,`access.json`))||{};if(i[t.ref]=new Date().toISOString(),b.default.writeFileSync(x.default.join(e,`access.json`),JSON.stringify(i,null,` `)),r[t.ref]===n)return;let a=r[t.ref];if(a){let t=!1;for(let e in r)if(r[e]===n){t=!0;break}if(!t)try{b.default.unlinkSync(x.default.join(e,`${a}.tar.gz`))}catch{}}r[t.ref]=n,b.default.writeFileSync(x.default.join(e,`map.json`),JSON.stringify(r,null,` `))}e.base=Hu,e.createCommonjsModule=fe,e.degit=Wu,e.source=No,e.tryRequire=Iu})),ke=E(T(((e,t)=>{D(`fs`),D(`path`);var n=Oe();D(`events`),D(`stream`),D(`string_decoder`),D(`assert`),D(`buffer`),D(`zlib`),D(`util`),D(`crypto`),D(`os`),D(`tty`),D(`constants`),D(`https`),D(`child_process`),D(`url`),D(`net`),D(`tls`),t.exports=n.degit}))(),1);const Ae=[{name:`basic`,display:`Basic Ripple App`,description:`A minimal Ripple application with Vite and TypeScript`}],je=r(g(import.meta.url));function M(e){return Ae.find(t=>t.name===e)||null}function Me(){return Ae.map(e=>e.name)}function Ne(){return Ae.map(e=>({title:e.display,description:e.description,value:e.name}))}function N(e){return e?M(e)!==null:!1}async function P(e){if(!N(e))throw Error(`Template "${e}" not found`);let t=i(v(),`ripple-template-${e}-${Date.now()}`);u(t,{recursive:!0});let n=(0,ke.default)(`trueadm/ripple/templates/${e}`,{cache:!1,force:!0,verbose:!1});try{return await n.clone(t),t}catch(t){throw Error(`Failed to download template "${e}": ${t.message}`)}}function Pe(e){return i(i(je,`../../../../`),`templates`,e)}function Fe(){return c(i(i(je,`../../../../`),`templates`))}var F=T(((e,t)=>{let{FORCE_COLOR:n,NODE_DISABLE_COLORS:r,TERM:i}=process.env,a={enabled:!r&&i!==`dumb`&&n!==`0`,reset:c(0,0),bold:c(1,22),dim:c(2,22),italic:c(3,23),underline:c(4,24),inverse:c(7,27),hidden:c(8,28),strikethrough:c(9,29),black:c(30,39),red:c(31,39),green:c(32,39),yellow:c(33,39),blue:c(34,39),magenta:c(35,39),cyan:c(36,39),white:c(37,39),gray:c(90,39),grey:c(90,39),bgBlack:c(40,49),bgRed:c(41,49),bgGreen:c(42,49),bgYellow:c(43,49),bgBlue:c(44,49),bgMagenta:c(45,49),bgCyan:c(46,49),bgWhite:c(47,49)};function o(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,t.includes(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function s(e,t){let n={has:e,keys:t};return n.reset=a.reset.bind(n),n.bold=a.bold.bind(n),n.dim=a.dim.bind(n),n.italic=a.italic.bind(n),n.underline=a.underline.bind(n),n.inverse=a.inverse.bind(n),n.hidden=a.hidden.bind(n),n.strikethrough=a.strikethrough.bind(n),n.black=a.black.bind(n),n.red=a.red.bind(n),n.green=a.green.bind(n),n.yellow=a.yellow.bind(n),n.blue=a.blue.bind(n),n.magenta=a.magenta.bind(n),n.cyan=a.cyan.bind(n),n.white=a.white.bind(n),n.gray=a.gray.bind(n),n.grey=a.grey.bind(n),n.bgBlack=a.bgBlack.bind(n),n.bgRed=a.bgRed.bind(n),n.bgGreen=a.bgGreen.bind(n),n.bgYellow=a.bgYellow.bind(n),n.bgBlue=a.bgBlue.bind(n),n.bgMagenta=a.bgMagenta.bind(n),n.bgCyan=a.bgCyan.bind(n),n.bgWhite=a.bgWhite.bind(n),n}function c(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(this.has.includes(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:a.enabled?o(this.keys,t+``):t+``):t===void 0?s([e],[n]):a.enabled?o([n],t+``):t+``}}t.exports=a})),Ie=T(((e,t)=>{t.exports=(e,t)=>{if(!(e.meta&&e.name!==`escape`)){if(e.ctrl){if(e.name===`a`)return`first`;if(e.name===`c`||e.name===`d`)return`abort`;if(e.name===`e`)return`last`;if(e.name===`g`)return`reset`}if(t){if(e.name===`j`)return`down`;if(e.name===`k`)return`up`}return e.name===`return`||e.name===`enter`?`submit`:e.name===`backspace`?`delete`:e.name===`delete`?`deleteForward`:e.name===`abort`?`abort`:e.name===`escape`?`exit`:e.name===`tab`?`next`:e.name===`pagedown`?`nextPage`:e.name===`pageup`?`prevPage`:e.name===`home`?`home`:e.name===`end`?`end`:e.name===`up`?`up`:e.name===`down`?`down`:e.name===`right`?`right`:e.name===`left`?`left`:!1}}})),Le=T(((e,t)=>{t.exports=e=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))`].join(`|`),n=new RegExp(t,`g`);return typeof e==`string`?e.replace(n,``):e}})),I=T(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),Re=T(((e,t)=>{function n(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
39
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,c;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,c=e},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(s)throw c}}}}function r(e,t){if(e){if(typeof e==`string`)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}}function i(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let a=Le(),o=I(),s=o.erase,c=o.cursor,l=e=>[...a(e)].length;t.exports=function(e,t){if(!t)return s.line+c.to(0);let r=0;var i=n(e.split(/\r?\n/)),a;try{for(i.s();!(a=i.n()).done;){let e=a.value;r+=1+Math.floor(Math.max(l(e)-1,0)/t)}}catch(e){i.e(e)}finally{i.f()}return s.lines(r)}})),ze=T(((e,t)=>{let n={arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,radioOn:`◉`,radioOff:`◯`,tick:`✔`,cross:`✖`,ellipsis:`…`,pointerSmall:`›`,line:`─`,pointer:`❯`},r={arrowUp:n.arrowUp,arrowDown:n.arrowDown,arrowLeft:n.arrowLeft,arrowRight:n.arrowRight,radioOn:`(*)`,radioOff:`( )`,tick:`√`,cross:`×`,ellipsis:`...`,pointerSmall:`»`,line:`─`,pointer:`>`};t.exports=process.platform===`win32`?r:n})),Be=T(((e,t)=>{let n=F(),r=ze(),i=Object.freeze({password:{scale:1,render:e=>`*`.repeat(e.length)},emoji:{scale:2,render:e=>`😃`.repeat(e.length)},invisible:{scale:0,render:e=>``},default:{scale:1,render:e=>`${e}`}}),a=e=>i[e]||i.default,o=Object.freeze({aborted:n.red(r.cross),done:n.green(r.tick),exited:n.yellow(r.cross),default:n.cyan(`?`)});t.exports={styles:i,render:a,symbols:o,symbol:(e,t,n)=>t?o.aborted:n?o.exited:e?o.done:o.default,delimiter:e=>n.gray(e?r.ellipsis:r.pointerSmall),item:(e,t)=>n.gray(e?t?r.pointerSmall:`+`:r.line)}})),Ve=T(((e,t)=>{let n=Le();t.exports=function(e,t){let r=String(n(e)||``).split(/\r?\n/);return t?r.map(e=>Math.ceil(e.length/t)).reduce((e,t)=>e+t):r.length}})),He=T(((e,t)=>{t.exports=(e,t={})=>{let n=Number.isSafeInteger(parseInt(t.margin))?Array(parseInt(t.margin)).fill(` `).join(``):t.margin||``,r=t.width;return(e||``).split(/\r?\n/g).map(e=>e.split(/\s+/g).reduce((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1<r?e[e.length-1]+=` ${t}`:e.push(`${n}${t}`),e),[n]).join(`
|
|
40
|
-
`)).join(`
|
|
41
|
-
`)}})),Ue=T(((e,t)=>{t.exports=(e,t,n)=>{n||=t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let i=Math.min(r+n,t);return{startIndex:r,endIndex:i}}})),L=T(((e,t)=>{t.exports={action:Ie(),clear:Re(),style:Be(),strip:Le(),figures:ze(),lines:Ve(),wrap:He(),entriesToDisplay:Ue()}})),We=T(((e,t)=>{let n=D(`readline`),r=L().action,i=D(`events`),a=I(),o=a.beep,s=a.cursor,c=F();t.exports=class extends i{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>void 0)).bind(this);let t=n.createInterface({input:this.in,escapeCodeTimeout:50});n.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let i=[`SelectPrompt`,`MultiselectPrompt`].indexOf(this.constructor.name)>-1,a=(e,t)=>{let n=r(t,i);n===!1?this._&&this._(e,t):typeof this[n]==`function`?this[n](t):this.bell()};this.close=()=>{this.out.write(s.show),this.in.removeListener(`keypress`,a),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?`abort`:this.exited?`exit`:`submit`,this.value),this.closed=!0},this.in.on(`keypress`,a)}fire(){this.emit(`state`,{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(o)}render(){this.onRender(c),this.firstRender&&=!1}}})),Ge=T(((e,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=F(),a=We(),o=I(),s=o.erase,c=o.cursor,l=L(),u=l.style,d=l.clear,f=l.lines,p=l.figures;t.exports=class extends a{constructor(e={}){super(e),this.transform=u.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||``,this.validator=e.validate||(()=>!0),this.value=``,this.errorMsg=e.error||`Please Enter A Valid Value`,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=d(``,this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=i.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value=``,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
42
|
-
`),this.close()}validate(){var e=this;return r(function*(){let t=yield e.validator(e.value);typeof t==`string`&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return r(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
|
|
43
|
-
`),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor+=e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor);this.value=`${n}${e}${this.value.slice(this.cursor)}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();this.value=`${this.value.slice(0,this.cursor-1)}${this.value.slice(this.cursor)}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.value=`${this.value.slice(0,this.cursor)}${this.value.slice(this.cursor+1)}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(c.down(f(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns)),this.out.write(d(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[u.symbol(this.done,this.aborted),i.bold(this.msg),u.delimiter(this.done),this.red?i.red(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
44
|
-
`).reduce((e,t,n)=>e+`\n${n?` `:p.pointerSmall} ${i.red().italic(t)}`,``)),this.out.write(s.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore+c.move(this.cursorOffset,0)))}}})),Ke=T(((e,t)=>{let n=F(),r=We(),i=L(),a=i.style,o=i.clear,s=i.figures,c=i.wrap,l=i.entriesToDisplay,u=I().cursor;t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||`- Use arrow-keys. Return to submit.`,this.warn=e.warn||`- This option is disabled`,this.cursor=e.initial||0,this.choices=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=o(``,this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
45
|
-
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
46
|
-
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===` `)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(u.hide):this.out.write(o(this.outputText,this.out.columns)),super.render();let e=l(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,r=e.endIndex;if(this.outputText=[a.symbol(this.done,this.aborted),n.bold(this.msg),a.delimiter(!1),this.done?this.selection.title:this.selection.disabled?n.yellow(this.warn):n.gray(this.hint)].join(` `),!this.done){this.outputText+=`
|
|
47
|
-
`;for(let e=t;e<r;e++){let i,a,o=``,l=this.choices[e];a=e===t&&t>0?s.arrowUp:e===r-1&&r<this.choices.length?s.arrowDown:` `,l.disabled?(i=this.cursor===e?n.gray().underline(l.title):n.strikethrough().gray(l.title),a=(this.cursor===e?n.bold().gray(s.pointer)+` `:` `)+a):(i=this.cursor===e?n.cyan().underline(l.title):l.title,a=(this.cursor===e?n.cyan(s.pointer)+` `:` `)+a,l.description&&this.cursor===e&&(o=` - ${l.description}`,(a.length+i.length+o.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(o=`
|
|
48
|
-
`+c(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${a} ${i}${n.gray(o)}\n`}}this.out.write(this.outputText)}}})),qe=T(((e,t)=>{let n=F(),r=We(),i=L(),a=i.style,o=i.clear,s=I(),c=s.cursor,l=s.erase;t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||`on`,this.inactive=e.inactive||`off`,this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
49
|
-
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
50
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===` `)this.value=!this.value;else if(e===`1`)this.value=!0;else if(e===`0`)this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(c.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),n.bold(this.msg),a.delimiter(this.done),this.value?this.inactive:n.cyan().underline(this.inactive),n.gray(`/`),this.value?n.cyan().underline(this.active):this.active].join(` `),this.out.write(l.line+c.to(0)+this.outputText))}}})),Je=T(((e,t)=>{t.exports=class e{constructor({token:e,date:t,parts:n,locales:r}){this.token=e,this.date=t||new Date,this.parts=n||[this],this.locales=r||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((n,r)=>r>t&&n instanceof e)}setTo(e){}prev(){let t=[].concat(this.parts).reverse(),n=t.indexOf(this);return t.find((t,r)=>r>n&&t instanceof e)}toString(){return String(this.date)}}})),Ye=T(((e,t)=>{let n=Je();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?`pm`:`am`;return/\A/.test(this.token)?e.toUpperCase():e}}})),Xe=T(((e,t)=>{let n=Je(),r=e=>(e%=10,e===1?`st`:e===2?`nd`:e===3?`rd`:`th`);t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token===`DD`?String(e).padStart(2,`0`):this.token===`Do`?e+r(e):this.token===`d`?t+1:this.token===`ddd`?this.locales.weekdaysShort[t]:this.token===`dddd`?this.locales.weekdays[t]:e}}})),Ze=T(((e,t)=>{let n=Je();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,`0`):e}}})),Qe=T(((e,t)=>{let n=Je();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,`0`).substr(0,this.token.length)}}})),$e=T(((e,t)=>{let n=Je();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,`0`):e}}})),et=T(((e,t)=>{let n=Je();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,`0`):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}}})),tt=T(((e,t)=>{let n=Je();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,`0`):e}}})),nt=T(((e,t)=>{let n=Je();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,`0`);return this.token.length===2?e.substr(-2):e}}})),rt=T(((e,t)=>{t.exports={DatePart:Je(),Meridiem:Ye(),Day:Xe(),Hours:Ze(),Milliseconds:Qe(),Minutes:$e(),Month:et(),Seconds:tt(),Year:nt()}})),it=T(((e,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=F(),a=We(),o=L(),s=o.style,c=o.clear,l=o.figures,u=I(),d=u.erase,f=u.cursor,p=rt(),m=p.DatePart,h=p.Meridiem,g=p.Day,_=p.Hours,v=p.Milliseconds,y=p.Minutes,b=p.Month,x=p.Seconds,S=p.Year,C=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,ee={1:({token:e})=>e.replace(/\\(.)/g,`$1`),2:e=>new g(e),3:e=>new b(e),4:e=>new S(e),5:e=>new h(e),6:e=>new _(e),7:e=>new y(e),8:e=>new x(e),9:e=>new v(e)},w={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(`,`)};t.exports=class extends a{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed=``,this.locales=Object.assign(w,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||`Please Enter A Valid Value`,this.validator=e.validate||(()=>!0),this.mask=e.mask||`YYYY-MM-DD HH:mm:ss`,this.clear=c(``,this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=C.exec(e);){let e=t.shift(),n=t.findIndex(e=>e!=null);this.parts.push(n in ee?ee[n]({token:t[n]||e,date:this.date,parts:this.parts,locales:this.locales}):t[n]||e)}let n=this.parts.reduce((e,t)=>(typeof t==`string`&&typeof e[e.length-1]==`string`?e[e.length-1]+=t:e.push(t),e),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed=``,this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof m)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
51
|
-
`),this.close()}validate(){var e=this;return r(function*(){let t=yield e.validator(e.value);typeof t==`string`&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return r(function*(){if(yield e.validate(),e.error){e.color=`red`,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
|
|
52
|
-
`),e.close()})()}up(){this.typed=``,this.parts[this.cursor].up(),this.render()}down(){this.typed=``,this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(e=>e instanceof m)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(f.hide):this.out.write(c(this.outputText,this.out.columns)),super.render(),this.outputText=[s.symbol(this.done,this.aborted),i.bold(this.msg),s.delimiter(!1),this.parts.reduce((e,t,n)=>e.concat(n===this.cursor&&!this.done?i.cyan().underline(t.toString()):t),[]).join(``)].join(` `),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
53
|
-
`).reduce((e,t,n)=>e+`\n${n?` `:l.pointerSmall} ${i.red().italic(t)}`,``)),this.out.write(d.line+f.to(0)+this.outputText))}}})),at=T(((e,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=F(),a=We(),o=I(),s=o.cursor,c=o.erase,l=L(),u=l.style,d=l.figures,f=l.clear,p=l.lines,m=/[0-9]/,h=e=>e!==void 0,g=(e,t)=>{let n=10**t;return Math.round(e*n)/n};t.exports=class extends a{constructor(e={}){super(e),this.transform=u.render(e.style),this.msg=e.message,this.initial=h(e.initial)?e.initial:``,this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=h(e.min)?e.min:-1/0,this.max=h(e.max)?e.max:1/0,this.errorMsg=e.error||`Please Enter A Valid Value`,this.validator=e.validate||(()=>!0),this.color=`cyan`,this.value=``,this.typed=``,this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=i.gray(this.transform.render(`${this.initial}`)),this._value=``):(this.placeholder=!1,this.rendered=this.transform.render(`${g(e,this.round)}`),this._value=g(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e===`-`||e===`.`&&this.float||m.test(e)}reset(){this.typed=``,this.value=``,this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e===``?this.initial:e,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
54
|
-
`),this.close()}validate(){var e=this;return r(function*(){let t=yield e.validator(e.value);typeof t==`string`&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return r(function*(){if(yield e.validate(),e.error){e.color=`red`,e.fire(),e.render();return}let t=e.value;e.value=t===``?e.initial:t,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
|
|
55
|
-
`),e.close()})()}up(){if(this.typed=``,this.value===``&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color=`cyan`,this.fire(),this.render()}down(){if(this.typed=``,this.value===``&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color=`cyan`,this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||``,this.value!==``&&this.value<this.min&&(this.value=this.min),this.color=`cyan`,this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=``),this.typed+=e,this.lastHit=n,this.color=`cyan`,e===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(s.down(p(this.outputError,this.out.columns)-1)+f(this.outputError,this.out.columns)),this.out.write(f(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[u.symbol(this.done,this.aborted),i.bold(this.msg),u.delimiter(this.done),!this.done||!this.done&&!this.placeholder?i[this.color]().underline(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
56
|
-
`).reduce((e,t,n)=>e+`\n${n?` `:d.pointerSmall} ${i.red().italic(t)}`,``)),this.out.write(c.line+s.to(0)+this.outputText+s.save+this.outputError+s.restore))}}})),ot=T(((e,t)=>{let n=F(),r=I().cursor,i=We(),a=L(),o=a.clear,s=a.figures,c=a.style,l=a.wrap,u=a.entriesToDisplay;t.exports=class extends i{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||``,this.warn=e.warn||`- This option is disabled -`,this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=o(``,this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
57
|
-
`),this.close()}submit(){let e=this.value.filter(e=>e.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
58
|
-
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===` `)this.handleSpaceToggle();else if(e===`a`)this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
|
|
59
|
-
Instructions:
|
|
60
|
-
${s.arrowUp}/${s.arrowDown}: Highlight option\n ${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===void 0?` a: Toggle all
|
|
61
|
-
`:``)+` enter/return: Complete answer`:``}renderOption(e,t,r,i){let a=(t.selected?n.green(s.radioOn):s.radioOff)+` `+i+` `,o,c;return t.disabled?o=e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):(o=e===r?n.cyan().underline(t.title):t.title,e===r&&t.description&&(c=` - ${t.description}`,(a.length+o.length+c.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(c=`
|
|
62
|
-
`+l(t.description,{margin:a.length,width:this.out.columns})))),a+o+n.gray(c||``)}paginateOptions(e){if(e.length===0)return n.red(`No matches for this query.`);let t=u(this.cursor,e.length,this.optionsPerPage),r=t.startIndex,i=t.endIndex,a,o=[];for(let t=r;t<i;t++)a=t===r&&r>0?s.arrowUp:t===i-1&&i<e.length?s.arrowDown:` `,o.push(this.renderOption(this.cursor,e[t],t,a));return`
|
|
63
|
-
`+o.join(`
|
|
64
|
-
`)}renderOptions(e){return this.done?``:this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let e=[c.symbol(this.done,this.aborted),n.bold(this.msg),c.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=o(e,this.out.columns)}}})),st=T(((e,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=F(),a=We(),o=I(),s=o.erase,c=o.cursor,l=L(),u=l.style,d=l.clear,f=l.figures,p=l.wrap,m=l.entriesToDisplay,h=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),g=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),_=(e,t)=>{let n=e.findIndex(e=>e.value===t||e.title===t);return n>-1?n:void 0};t.exports=class extends a{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial==`number`?e.initial:_(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||`no matches found`},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input=``,this.limit=e.limit||10,this.cursor=0,this.transform=u.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=d(``,this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb==`number`?e=this.choices[this._fb]:typeof this._fb==`string`&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=h(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return r(function*(){let n=t.completing=t.suggest(t.input,t.choices),r=yield n;if(t.completing!==n)return;t.suggestions=r.map((e,t,n)=>({title:g(n,t),value:h(n,t),description:e.description})),t.completing=!1;let i=Math.max(r.length-1,0);t.moveSelect(Math.min(i,t.select)),e&&e()})()}reset(){this.input=``,this.complete(()=>{this.moveSelect(this.initial===void 0?0:this.initial),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
65
|
-
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
66
|
-
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
67
|
-
`),this.close()}_(e,t){let n=this.input.slice(0,this.cursor);this.input=`${n}${e}${this.input.slice(this.cursor)}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();this.input=`${this.input.slice(0,this.cursor-1)}${this.input.slice(this.cursor)}`,this.complete(this.render),--this.cursor,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.input=`${this.input.slice(0,this.cursor)}${this.input.slice(this.cursor+1)}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();--this.cursor,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor+=1,this.render()}renderOption(e,t,n,r){let a,o=n?f.arrowUp:r?f.arrowDown:` `,s=t?i.cyan().underline(e.title):e.title;return o=(t?i.cyan(f.pointer)+` `:` `)+o,e.description&&(a=` - ${e.description}`,(o.length+s.length+a.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(a=`
|
|
68
|
-
`+p(e.description,{margin:3,width:this.out.columns}))),o+` `+s+i.gray(a||``)}render(){if(this.closed)return;this.firstRender?this.out.write(c.hide):this.out.write(d(this.outputText,this.out.columns)),super.render();let e=m(this.select,this.choices.length,this.limit),t=e.startIndex,n=e.endIndex;if(this.outputText=[u.symbol(this.done,this.aborted,this.exited),i.bold(this.msg),u.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(` `),!this.done){let e=this.suggestions.slice(t,n).map((e,r)=>this.renderOption(e,this.select===r+t,r===0&&t>0,r+t===n-1&&n<this.choices.length)).join(`
|
|
69
|
-
`);this.outputText+=`
|
|
70
|
-
`+(e||i.gray(this.fallback.title))}this.out.write(s.line+c.to(0)+this.outputText)}}})),ct=T(((e,t)=>{let n=F(),r=I().cursor,i=ot(),a=L(),o=a.clear,s=a.style,c=a.figures;t.exports=class extends i{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue=``,this.clear=o(``,this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(e=>this.inputValue?!!(typeof e.title==`string`&&e.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof e.value==`string`&&e.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(t=>t===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}handleInputChange(e){this.inputValue+=e,this.updateFilteredOptions()}_(e,t){e===` `?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
|
|
71
|
-
Instructions:
|
|
72
|
-
${c.arrowUp}/${c.arrowDown}: Highlight option
|
|
73
|
-
${c.arrowLeft}/${c.arrowRight}/[space]: Toggle selection
|
|
74
|
-
[a,b,c]/delete: Filter choices
|
|
75
|
-
enter/return: Complete answer
|
|
76
|
-
`:``}renderCurrentInput(){return`
|
|
77
|
-
Filtered results for: ${this.inputValue?this.inputValue:n.gray(`Enter something to filter`)}\n`}renderOption(e,t,r){let i;return i=t.disabled?e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):e===r?n.cyan().underline(t.title):t.title,(t.selected?n.green(c.radioOn):c.radioOff)+` `+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let e=[s.symbol(this.done,this.aborted),n.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=o(e,this.out.columns)}}})),lt=T(((e,t)=>{let n=F(),r=We(),i=L(),a=i.style,o=i.clear,s=I(),c=s.erase,l=s.cursor;t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||`yes`,this.yesOption=e.yesOption||`(Y/n)`,this.noMsg=e.no||`no`,this.noOption=e.noOption||`(y/N)`,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
78
|
-
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
79
|
-
`),this.close()}_(e,t){return e.toLowerCase()===`y`?(this.value=!0,this.submit()):e.toLowerCase()===`n`?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),n.bold(this.msg),a.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:n.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(c.line+l.to(0)+this.outputText))}}})),ut=T(((e,t)=>{t.exports={TextPrompt:Ge(),SelectPrompt:Ke(),TogglePrompt:qe(),DatePrompt:it(),NumberPrompt:at(),MultiselectPrompt:ot(),AutocompletePrompt:st(),AutocompleteMultiselectPrompt:ct(),ConfirmPrompt:lt()}})),dt=T((e=>{let t=e,n=ut(),r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};let a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))})),ft=T(((e,t)=>{function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t];t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=o(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
80
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,c;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,c=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(s)throw c}}}}function o(e,t){if(e){if(typeof e==`string`)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}}function s(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function l(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){c(a,r,i,o,s,`next`,e)}function s(e){c(a,r,i,o,s,`throw`,e)}o(void 0)})}}let u=dt(),d=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],f=()=>{};function p(){return m.apply(this,arguments)}function m(){return m=l(function*(e=[],{onSubmit:t=f,onCancel:n=f}={}){let i={},o=p._override||{};e=[].concat(e);let s,c,m,g,_,v,y=function(){var e=l(function*(e,t,n=!1){if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?yield e.format(t,i):t});return function(t,n){return e.apply(this,arguments)}}();var b=a(e),x;try{for(b.s();!(x=b.n()).done;){c=x.value;var S=c;if(g=S.name,_=S.type,typeof _==`function`&&(_=yield _(s,r({},i),c),c.type=_),_){for(let e in c){if(d.includes(e))continue;let t=c[e];c[e]=typeof t==`function`?yield t(s,r({},i),v):t}if(v=c,typeof c.message!=`string`)throw Error(`prompt message is required`);var C=c;if(g=C.name,_=C.type,u[_]===void 0)throw Error(`prompt type (${_}) is not defined`);if(o[c.name]!==void 0&&(s=yield y(c,o[c.name]),s!==void 0)){i[g]=s;continue}try{s=p._injected?h(p._injected,c.initial):yield u[_](c),i[g]=s=yield y(c,s,!0),m=yield t(c,s,i)}catch{m=!(yield n(c,i))}if(m)return i}}}catch(e){b.e(e)}finally{b.f()}return i}),m.apply(this,arguments)}function h(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function g(e){p._injected=(p._injected||[]).concat(e)}function _(e){p._override=Object.assign({},e)}t.exports=Object.assign(p,{prompt:p,prompts:u,inject:g,override:_})})),pt=T(((e,t)=>{t.exports=(e,t)=>{if(!(e.meta&&e.name!==`escape`)){if(e.ctrl){if(e.name===`a`)return`first`;if(e.name===`c`||e.name===`d`)return`abort`;if(e.name===`e`)return`last`;if(e.name===`g`)return`reset`}if(t){if(e.name===`j`)return`down`;if(e.name===`k`)return`up`}return e.name===`return`||e.name===`enter`?`submit`:e.name===`backspace`?`delete`:e.name===`delete`?`deleteForward`:e.name===`abort`?`abort`:e.name===`escape`?`exit`:e.name===`tab`?`next`:e.name===`pagedown`?`nextPage`:e.name===`pageup`?`prevPage`:e.name===`home`?`home`:e.name===`end`?`end`:e.name===`up`?`up`:e.name===`down`?`down`:e.name===`right`?`right`:e.name===`left`?`left`:!1}}})),mt=T(((e,t)=>{t.exports=e=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))`].join(`|`),n=new RegExp(t,`g`);return typeof e==`string`?e.replace(n,``):e}})),ht=T(((e,t)=>{let n=mt(),{erase:r,cursor:i}=I(),a=e=>[...n(e)].length;t.exports=function(e,t){if(!t)return r.line+i.to(0);let n=0,o=e.split(/\r?\n/);for(let e of o)n+=1+Math.floor(Math.max(a(e)-1,0)/t);return r.lines(n)}})),gt=T(((e,t)=>{let n={arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,radioOn:`◉`,radioOff:`◯`,tick:`✔`,cross:`✖`,ellipsis:`…`,pointerSmall:`›`,line:`─`,pointer:`❯`},r={arrowUp:n.arrowUp,arrowDown:n.arrowDown,arrowLeft:n.arrowLeft,arrowRight:n.arrowRight,radioOn:`(*)`,radioOff:`( )`,tick:`√`,cross:`×`,ellipsis:`...`,pointerSmall:`»`,line:`─`,pointer:`>`};t.exports=process.platform===`win32`?r:n})),_t=T(((e,t)=>{let n=F(),r=gt(),i=Object.freeze({password:{scale:1,render:e=>`*`.repeat(e.length)},emoji:{scale:2,render:e=>`😃`.repeat(e.length)},invisible:{scale:0,render:e=>``},default:{scale:1,render:e=>`${e}`}}),a=e=>i[e]||i.default,o=Object.freeze({aborted:n.red(r.cross),done:n.green(r.tick),exited:n.yellow(r.cross),default:n.cyan(`?`)});t.exports={styles:i,render:a,symbols:o,symbol:(e,t,n)=>t?o.aborted:n?o.exited:e?o.done:o.default,delimiter:e=>n.gray(e?r.ellipsis:r.pointerSmall),item:(e,t)=>n.gray(e?t?r.pointerSmall:`+`:r.line)}})),vt=T(((e,t)=>{let n=mt();t.exports=function(e,t){let r=String(n(e)||``).split(/\r?\n/);return t?r.map(e=>Math.ceil(e.length/t)).reduce((e,t)=>e+t):r.length}})),yt=T(((e,t)=>{t.exports=(e,t={})=>{let n=Number.isSafeInteger(parseInt(t.margin))?Array(parseInt(t.margin)).fill(` `).join(``):t.margin||``,r=t.width;return(e||``).split(/\r?\n/g).map(e=>e.split(/\s+/g).reduce((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1<r?e[e.length-1]+=` ${t}`:e.push(`${n}${t}`),e),[n]).join(`
|
|
81
|
-
`)).join(`
|
|
82
|
-
`)}})),bt=T(((e,t)=>{t.exports=(e,t,n)=>{n||=t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let i=Math.min(r+n,t);return{startIndex:r,endIndex:i}}})),xt=T(((e,t)=>{t.exports={action:pt(),clear:ht(),style:_t(),strip:mt(),figures:gt(),lines:vt(),wrap:yt(),entriesToDisplay:bt()}})),St=T(((e,t)=>{let n=D(`readline`),{action:r}=xt(),i=D(`events`),{beep:a,cursor:o}=I(),s=F();t.exports=class extends i{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>void 0)).bind(this);let t=n.createInterface({input:this.in,escapeCodeTimeout:50});n.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let i=[`SelectPrompt`,`MultiselectPrompt`].indexOf(this.constructor.name)>-1,a=(e,t)=>{let n=r(t,i);n===!1?this._&&this._(e,t):typeof this[n]==`function`?this[n](t):this.bell()};this.close=()=>{this.out.write(o.show),this.in.removeListener(`keypress`,a),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?`abort`:this.exited?`exit`:`submit`,this.value),this.closed=!0},this.in.on(`keypress`,a)}fire(){this.emit(`state`,{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(a)}render(){this.onRender(s),this.firstRender&&=!1}}})),Ct=T(((e,t)=>{let n=F(),r=St(),{erase:i,cursor:a}=I(),{style:o,clear:s,lines:c,figures:l}=xt();t.exports=class extends r{constructor(e={}){super(e),this.transform=o.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||``,this.validator=e.validate||(()=>!0),this.value=``,this.errorMsg=e.error||`Please Enter A Valid Value`,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=s(``,this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value=``,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
83
|
-
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
84
|
-
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor+=e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor);this.value=`${n}${e}${this.value.slice(this.cursor)}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();this.value=`${this.value.slice(0,this.cursor-1)}${this.value.slice(this.cursor)}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.value=`${this.value.slice(0,this.cursor)}${this.value.slice(this.cursor+1)}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(a.down(c(this.outputError,this.out.columns)-1)+s(this.outputError,this.out.columns)),this.out.write(s(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(this.done),this.red?n.red(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
85
|
-
`).reduce((e,t,r)=>e+`\n${r?` `:l.pointerSmall} ${n.red().italic(t)}`,``)),this.out.write(i.line+a.to(0)+this.outputText+a.save+this.outputError+a.restore+a.move(this.cursorOffset,0)))}}})),wt=T(((e,t)=>{let n=F(),r=St(),{style:i,clear:a,figures:o,wrap:s,entriesToDisplay:c}=xt(),{cursor:l}=I();t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||`- Use arrow-keys. Return to submit.`,this.warn=e.warn||`- This option is disabled`,this.cursor=e.initial||0,this.choices=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=a(``,this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
86
|
-
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
87
|
-
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===` `)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(l.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=c(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(!1),this.done?this.selection.title:this.selection.disabled?n.yellow(this.warn):n.gray(this.hint)].join(` `),!this.done){this.outputText+=`
|
|
88
|
-
`;for(let r=e;r<t;r++){let i,a,c=``,l=this.choices[r];a=r===e&&e>0?o.arrowUp:r===t-1&&t<this.choices.length?o.arrowDown:` `,l.disabled?(i=this.cursor===r?n.gray().underline(l.title):n.strikethrough().gray(l.title),a=(this.cursor===r?n.bold().gray(o.pointer)+` `:` `)+a):(i=this.cursor===r?n.cyan().underline(l.title):l.title,a=(this.cursor===r?n.cyan(o.pointer)+` `:` `)+a,l.description&&this.cursor===r&&(c=` - ${l.description}`,(a.length+i.length+c.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(c=`
|
|
89
|
-
`+s(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${a} ${i}${n.gray(c)}\n`}}this.out.write(this.outputText)}}})),Tt=T(((e,t)=>{let n=F(),r=St(),{style:i,clear:a}=xt(),{cursor:o,erase:s}=I();t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||`on`,this.inactive=e.inactive||`off`,this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
90
|
-
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
91
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===` `)this.value=!this.value;else if(e===`1`)this.value=!0;else if(e===`0`)this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(o.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(this.done),this.value?this.inactive:n.cyan().underline(this.inactive),n.gray(`/`),this.value?n.cyan().underline(this.active):this.active].join(` `),this.out.write(s.line+o.to(0)+this.outputText))}}})),Et=T(((e,t)=>{t.exports=class e{constructor({token:e,date:t,parts:n,locales:r}){this.token=e,this.date=t||new Date,this.parts=n||[this],this.locales=r||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((n,r)=>r>t&&n instanceof e)}setTo(e){}prev(){let t=[].concat(this.parts).reverse(),n=t.indexOf(this);return t.find((t,r)=>r>n&&t instanceof e)}toString(){return String(this.date)}}})),Dt=T(((e,t)=>{let n=Et();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?`pm`:`am`;return/\A/.test(this.token)?e.toUpperCase():e}}})),Ot=T(((e,t)=>{let n=Et(),r=e=>(e%=10,e===1?`st`:e===2?`nd`:e===3?`rd`:`th`);t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token===`DD`?String(e).padStart(2,`0`):this.token===`Do`?e+r(e):this.token===`d`?t+1:this.token===`ddd`?this.locales.weekdaysShort[t]:this.token===`dddd`?this.locales.weekdays[t]:e}}})),kt=T(((e,t)=>{let n=Et();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,`0`):e}}})),At=T(((e,t)=>{let n=Et();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,`0`).substr(0,this.token.length)}}})),jt=T(((e,t)=>{let n=Et();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,`0`):e}}})),Mt=T(((e,t)=>{let n=Et();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,`0`):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}}})),Nt=T(((e,t)=>{let n=Et();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,`0`):e}}})),Pt=T(((e,t)=>{let n=Et();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,`0`);return this.token.length===2?e.substr(-2):e}}})),Ft=T(((e,t)=>{t.exports={DatePart:Et(),Meridiem:Dt(),Day:Ot(),Hours:kt(),Milliseconds:At(),Minutes:jt(),Month:Mt(),Seconds:Nt(),Year:Pt()}})),It=T(((e,t)=>{let n=F(),r=St(),{style:i,clear:a,figures:o}=xt(),{erase:s,cursor:c}=I(),{DatePart:l,Meridiem:u,Day:d,Hours:f,Milliseconds:p,Minutes:m,Month:h,Seconds:g,Year:_}=Ft(),v=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,y={1:({token:e})=>e.replace(/\\(.)/g,`$1`),2:e=>new d(e),3:e=>new h(e),4:e=>new _(e),5:e=>new u(e),6:e=>new f(e),7:e=>new m(e),8:e=>new g(e),9:e=>new p(e)},b={months:`January,February,March,April,May,June,July,August,September,October,November,December`.split(`,`),monthsShort:`Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec`.split(`,`),weekdays:`Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday`.split(`,`),weekdaysShort:`Sun,Mon,Tue,Wed,Thu,Fri,Sat`.split(`,`)};t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed=``,this.locales=Object.assign(b,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||`Please Enter A Valid Value`,this.validator=e.validate||(()=>!0),this.mask=e.mask||`YYYY-MM-DD HH:mm:ss`,this.clear=a(``,this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=v.exec(e);){let e=t.shift(),n=t.findIndex(e=>e!=null);this.parts.push(n in y?y[n]({token:t[n]||e,date:this.date,parts:this.parts,locales:this.locales}):t[n]||e)}let n=this.parts.reduce((e,t)=>(typeof t==`string`&&typeof e[e.length-1]==`string`?e[e.length-1]+=t:e.push(t),e),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed=``,this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof l)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
92
|
-
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color=`red`,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
93
|
-
`),this.close()}up(){this.typed=``,this.parts[this.cursor].up(),this.render()}down(){this.typed=``,this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(e=>e instanceof l)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(c.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(!1),this.parts.reduce((e,t,r)=>e.concat(r===this.cursor&&!this.done?n.cyan().underline(t.toString()):t),[]).join(``)].join(` `),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
94
|
-
`).reduce((e,t,r)=>e+`\n${r?` `:o.pointerSmall} ${n.red().italic(t)}`,``)),this.out.write(s.line+c.to(0)+this.outputText))}}})),Lt=T(((e,t)=>{let n=F(),r=St(),{cursor:i,erase:a}=I(),{style:o,figures:s,clear:c,lines:l}=xt(),u=/[0-9]/,d=e=>e!==void 0,f=(e,t)=>{let n=10**t;return Math.round(e*n)/n};t.exports=class extends r{constructor(e={}){super(e),this.transform=o.render(e.style),this.msg=e.message,this.initial=d(e.initial)?e.initial:``,this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=d(e.min)?e.min:-1/0,this.max=d(e.max)?e.max:1/0,this.errorMsg=e.error||`Please Enter A Valid Value`,this.validator=e.validate||(()=>!0),this.color=`cyan`,this.value=``,this.typed=``,this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(`${this.initial}`)),this._value=``):(this.placeholder=!1,this.rendered=this.transform.render(`${f(e,this.round)}`),this._value=f(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e===`-`||e===`.`&&this.float||u.test(e)}reset(){this.typed=``,this.value=``,this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e===``?this.initial:e,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
95
|
-
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color=`red`,this.fire(),this.render();return}let e=this.value;this.value=e===``?this.initial:e,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
96
|
-
`),this.close()}up(){if(this.typed=``,this.value===``&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color=`cyan`,this.fire(),this.render()}down(){if(this.typed=``,this.value===``&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color=`cyan`,this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||``,this.value!==``&&this.value<this.min&&(this.value=this.min),this.color=`cyan`,this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=``),this.typed+=e,this.lastHit=n,this.color=`cyan`,e===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(i.down(l(this.outputError,this.out.columns)-1)+c(this.outputError,this.out.columns)),this.out.write(c(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(this.done),!this.done||!this.done&&!this.placeholder?n[this.color]().underline(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
97
|
-
`).reduce((e,t,r)=>e+`\n${r?` `:s.pointerSmall} ${n.red().italic(t)}`,``)),this.out.write(a.line+i.to(0)+this.outputText+i.save+this.outputError+i.restore))}}})),Rt=T(((e,t)=>{let n=F(),{cursor:r}=I(),i=St(),{clear:a,figures:o,style:s,wrap:c,entriesToDisplay:l}=xt();t.exports=class extends i{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||``,this.warn=e.warn||`- This option is disabled -`,this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=a(``,this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
98
|
-
`),this.close()}submit(){let e=this.value.filter(e=>e.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
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(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===` `)this.handleSpaceToggle();else if(e===`a`)this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
|
|
100
|
-
Instructions:
|
|
101
|
-
${o.arrowUp}/${o.arrowDown}: Highlight option\n ${o.arrowLeft}/${o.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===void 0?` a: Toggle all
|
|
102
|
-
`:``)+` enter/return: Complete answer`:``}renderOption(e,t,r,i){let a=(t.selected?n.green(o.radioOn):o.radioOff)+` `+i+` `,s,l;return t.disabled?s=e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):(s=e===r?n.cyan().underline(t.title):t.title,e===r&&t.description&&(l=` - ${t.description}`,(a.length+s.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(l=`
|
|
103
|
-
`+c(t.description,{margin:a.length,width:this.out.columns})))),a+s+n.gray(l||``)}paginateOptions(e){if(e.length===0)return n.red(`No matches for this query.`);let{startIndex:t,endIndex:r}=l(this.cursor,e.length,this.optionsPerPage),i,a=[];for(let n=t;n<r;n++)i=n===t&&t>0?o.arrowUp:n===r-1&&r<e.length?o.arrowDown:` `,a.push(this.renderOption(this.cursor,e[n],n,i));return`
|
|
104
|
-
`+a.join(`
|
|
105
|
-
`)}renderOptions(e){return this.done?``:this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let e=[s.symbol(this.done,this.aborted),n.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=a(e,this.out.columns)}}})),zt=T(((e,t)=>{let n=F(),r=St(),{erase:i,cursor:a}=I(),{style:o,clear:s,figures:c,wrap:l,entriesToDisplay:u}=xt(),d=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),f=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),p=(e,t)=>{let n=e.findIndex(e=>e.value===t||e.title===t);return n>-1?n:void 0};t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial==`number`?e.initial:p(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||`no matches found`},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input=``,this.limit=e.limit||10,this.cursor=0,this.transform=o.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=s(``,this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb==`number`?e=this.choices[this._fb]:typeof this._fb==`string`&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=d(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),n=await t;if(this.completing!==t)return;this.suggestions=n.map((e,t,n)=>({title:f(n,t),value:d(n,t),description:e.description})),this.completing=!1;let r=Math.max(n.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}reset(){this.input=``,this.complete(()=>{this.moveSelect(this.initial===void 0?0:this.initial),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
106
|
-
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
107
|
-
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
108
|
-
`),this.close()}_(e,t){let n=this.input.slice(0,this.cursor);this.input=`${n}${e}${this.input.slice(this.cursor)}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();this.input=`${this.input.slice(0,this.cursor-1)}${this.input.slice(this.cursor)}`,this.complete(this.render),--this.cursor,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.input=`${this.input.slice(0,this.cursor)}${this.input.slice(this.cursor+1)}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();--this.cursor,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor+=1,this.render()}renderOption(e,t,r,i){let a,o=r?c.arrowUp:i?c.arrowDown:` `,s=t?n.cyan().underline(e.title):e.title;return o=(t?n.cyan(c.pointer)+` `:` `)+o,e.description&&(a=` - ${e.description}`,(o.length+s.length+a.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(a=`
|
|
109
|
-
`+l(e.description,{margin:3,width:this.out.columns}))),o+` `+s+n.gray(a||``)}render(){if(this.closed)return;this.firstRender?this.out.write(a.hide):this.out.write(s(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=u(this.select,this.choices.length,this.limit);if(this.outputText=[o.symbol(this.done,this.aborted,this.exited),n.bold(this.msg),o.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(` `),!this.done){let r=this.suggestions.slice(e,t).map((n,r)=>this.renderOption(n,this.select===r+e,r===0&&e>0,r+e===t-1&&t<this.choices.length)).join(`
|
|
110
|
-
`);this.outputText+=`
|
|
111
|
-
`+(r||n.gray(this.fallback.title))}this.out.write(i.line+a.to(0)+this.outputText)}}})),Bt=T(((e,t)=>{let n=F(),{cursor:r}=I(),i=Rt(),{clear:a,style:o,figures:s}=xt();t.exports=class extends i{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue=``,this.clear=a(``,this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(e=>this.inputValue?!!(typeof e.title==`string`&&e.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof e.value==`string`&&e.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(t=>t===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}handleInputChange(e){this.inputValue+=e,this.updateFilteredOptions()}_(e,t){e===` `?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
|
|
112
|
-
Instructions:
|
|
113
|
-
${s.arrowUp}/${s.arrowDown}: Highlight option
|
|
114
|
-
${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection
|
|
115
|
-
[a,b,c]/delete: Filter choices
|
|
116
|
-
enter/return: Complete answer
|
|
117
|
-
`:``}renderCurrentInput(){return`
|
|
118
|
-
Filtered results for: ${this.inputValue?this.inputValue:n.gray(`Enter something to filter`)}\n`}renderOption(e,t,r){let i;return i=t.disabled?e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):e===r?n.cyan().underline(t.title):t.title,(t.selected?n.green(s.radioOn):s.radioOff)+` `+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let e=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=a(e,this.out.columns)}}})),Vt=T(((e,t)=>{let n=F(),r=St(),{style:i,clear:a}=xt(),{erase:o,cursor:s}=I();t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||`yes`,this.yesOption=e.yesOption||`(Y/n)`,this.noMsg=e.no||`no`,this.noOption=e.noOption||`(y/N)`,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
119
|
-
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
120
|
-
`),this.close()}_(e,t){return e.toLowerCase()===`y`?(this.value=!0,this.submit()):e.toLowerCase()===`n`?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:n.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(o.line+s.to(0)+this.outputText))}}})),Ht=T(((e,t)=>{t.exports={TextPrompt:Ct(),SelectPrompt:wt(),TogglePrompt:Tt(),DatePrompt:It(),NumberPrompt:Lt(),MultiselectPrompt:Rt(),AutocompletePrompt:zt(),AutocompleteMultiselectPrompt:Bt(),ConfirmPrompt:Vt()}})),Ut=T((e=>{let t=e,n=Ht(),r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};let a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))})),Wt=T(((e,t)=>{let n=Ut(),r=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],i=()=>{};async function a(e=[],{onSubmit:t=i,onCancel:s=i}={}){let c={},l=a._override||{};e=[].concat(e);let u,d,f,p,m,h,g=async(e,t,n=!1)=>{if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?await e.format(t,c):t};for(d of e)if({name:p,type:m}=d,typeof m==`function`&&(m=await m(u,{...c},d),d.type=m),m){for(let e in d){if(r.includes(e))continue;let t=d[e];d[e]=typeof t==`function`?await t(u,{...c},h):t}if(h=d,typeof d.message!=`string`)throw Error(`prompt message is required`);if({name:p,type:m}=d,n[m]===void 0)throw Error(`prompt type (${m}) is not defined`);if(l[d.name]!==void 0&&(u=await g(d,l[d.name]),u!==void 0)){c[p]=u;continue}try{u=a._injected?o(a._injected,d.initial):await n[m](d),c[p]=u=await g(d,u,!0),f=await t(d,u,c)}catch{f=!await s(d,c)}if(f)return c}return c}function o(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function s(e){a._injected=(a._injected||[]).concat(e)}function c(e){a._override=Object.assign({},e)}t.exports=Object.assign(a,{prompt:a,prompts:n,inject:s,override:c})})),Gt=E(T(((e,t)=>{function n(e){e=(Array.isArray(e)?e:e.split(`.`)).map(Number);let t=0,n=process.versions.node.split(`.`).map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}t.exports=n(`8.6.0`)?ft():Wt()}))(),1);async function Kt(e=`my-ripple-app`){let t=await(0,Gt.default)({type:`text`,name:`projectName`,message:`What is your project named?`,initial:e,validate:e=>{let t=j(e);return t.valid||t.message}});return t.projectName||(console.log(A(`✖ Operation cancelled`)),process.exit(1)),t.projectName}async function qt(){let e=await(0,Gt.default)({type:`select`,name:`template`,message:`Which template would you like to use?`,choices:Ne(),initial:0});return e.template||(console.log(A(`✖ Operation cancelled`)),process.exit(1)),e.template}async function Jt(){let e=await(0,Gt.default)({type:`select`,name:`packageManager`,message:`Which package manager would you like to use?`,choices:[{title:`npm`,value:`npm`,description:`Use npm for dependency management`},{title:`yarn`,value:`yarn`,description:`Use Yarn for dependency management`},{title:`pnpm`,value:`pnpm`,description:`Use pnpm for dependency management`}],initial:0});return e.packageManager||(console.log(A(`✖ Operation cancelled`)),process.exit(1)),e.packageManager}async function Yt(){let e=await(0,Gt.default)({type:`confirm`,name:`gitInit`,message:`Initialize a new Git repository?`,initial:!0});return e.gitInit===void 0&&(console.log(A(`✖ Operation cancelled`)),process.exit(1)),e.gitInit}async function Xt(){let e=await(0,Gt.default)({type:`select`,name:`stylingFramework`,message:`Which styling framework would you like to integrate with Ripple?`,choices:[{title:`Vanilla CSS`,value:`vanilla`,description:`Use Vanilla CSS for styling your components`},{title:`Bootstrap`,value:`bootstrap`,description:`Use Bootstrap classes to style your components`},{title:`TailwindCSS`,value:`tailwind`,description:`Use TailwindCSS to style your components`}]});return e.stylingFramework===void 0&&(console.log(A(`✖ Operation cancelled`)),process.exit(1)),e.stylingFramework}const Zt=(e=0)=>t=>`\u001B[${t+e}m`,Qt=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,$t=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,R={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]}};Object.keys(R.modifier);const en=Object.keys(R.color),tn=Object.keys(R.bgColor);[...en,...tn];function nn(){let e=new Map;for(let[t,n]of Object.entries(R)){for(let[t,r]of Object.entries(n))R[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=R[t],e.set(r[0],r[1]);Object.defineProperty(R,t,{value:n,enumerable:!1})}return Object.defineProperty(R,`codes`,{value:e,enumerable:!1}),R.color.close=`\x1B[39m`,R.bgColor.close=`\x1B[49m`,R.color.ansi=Zt(),R.color.ansi256=Qt(),R.color.ansi16m=$t(),R.bgColor.ansi=Zt(10),R.bgColor.ansi256=Qt(10),R.bgColor.ansi16m=$t(10),Object.defineProperties(R,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>R.rgbToAnsi256(...R.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>R.ansi256ToAnsi(R.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>R.ansi256ToAnsi(R.hexToAnsi256(e)),enumerable:!1}}),R}var z=nn();function B(e,t=globalThis.Deno?globalThis.Deno.args:h.argv){let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}const{env:V}=h;let rn;B(`no-color`)||B(`no-colors`)||B(`color=false`)||B(`color=never`)?rn=0:(B(`color`)||B(`colors`)||B(`color=true`)||B(`color=always`))&&(rn=1);function an(){if(`FORCE_COLOR`in V)return V.FORCE_COLOR===`true`?1:V.FORCE_COLOR===`false`?0:V.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(V.FORCE_COLOR,10),3)}function on(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function sn(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=an();r!==void 0&&(rn=r);let i=n?rn:r;if(i===0)return 0;if(n){if(B(`color=16m`)||B(`color=full`)||B(`color=truecolor`))return 3;if(B(`color=256`))return 2}if(`TF_BUILD`in V&&`AGENT_NAME`in V)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(V.TERM===`dumb`)return a;if(h.platform===`win32`){let e=_.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in V)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in V)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in V)||V.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in V)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(V.TEAMCITY_VERSION)?1:0;if(V.COLORTERM===`truecolor`||V.TERM===`xterm-kitty`||V.TERM===`xterm-ghostty`||V.TERM===`wezterm`)return 3;if(`TERM_PROGRAM`in V){let e=Number.parseInt((V.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(V.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(V.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(V.TERM)||`COLORTERM`in V?1:a}function cn(e,t={}){return on(sn(e,{streamIsTTY:e&&e.isTTY,...t}))}var ln={stdout:cn({isTTY:y.isatty(1)}),stderr:cn({isTTY:y.isatty(2)})};function un(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.slice(a),o}function dn(e,t,n,r){let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.slice(i,o?r-1:r)+t+(o?`\r
|
|
121
|
-
`:`
|
|
122
|
-
`)+n,i=r+1,r=e.indexOf(`
|
|
123
|
-
`,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:fn,stderr:pn}=ln,mn=Symbol(`GENERATOR`),hn=Symbol(`STYLER`),gn=Symbol(`IS_EMPTY`),_n=[`ansi`,`ansi`,`ansi256`,`ansi16m`],vn=Object.create(null),yn=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=fn?fn.level:0;e.level=t.level===void 0?n:t.level},bn=e=>{let t=(...e)=>e.join(` `);return yn(t,e),Object.setPrototypeOf(t,xn.prototype),t};function xn(e){return bn(e)}Object.setPrototypeOf(xn.prototype,Function.prototype);for(let[e,t]of Object.entries(z))vn[e]={get(){let n=H(this,wn(t.open,t.close,this[hn]),this[gn]);return Object.defineProperty(this,e,{value:n}),n}};vn.visible={get(){let e=H(this,this[hn],!0);return Object.defineProperty(this,`visible`,{value:e}),e}};const Sn=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?z[n].ansi16m(...r):t===`ansi256`?z[n].ansi256(z.rgbToAnsi256(...r)):z[n].ansi(z.rgbToAnsi(...r)):e===`hex`?Sn(`rgb`,t,n,...z.hexToRgb(...r)):z[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){vn[e]={get(){let{level:t}=this;return function(...n){let r=wn(Sn(e,_n[t],`color`,...n),z.color.close,this[hn]);return H(this,r,this[gn])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);vn[t]={get(){let{level:t}=this;return function(...n){let r=wn(Sn(e,_n[t],`bgColor`,...n),z.bgColor.close,this[hn]);return H(this,r,this[gn])}}}}const Cn=Object.defineProperties(()=>{},{...vn,level:{enumerable:!0,get(){return this[mn].level},set(e){this[mn].level=e}}}),wn=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},H=(e,t,n)=>{let r=(...e)=>Tn(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,Cn),r[mn]=e,r[hn]=t,r[gn]=n,r},Tn=(e,t)=>{if(e.level<=0||!t)return e[gn]?``:t;let n=e[hn];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=un(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
|
|
124
|
-
`);return a!==-1&&(t=dn(t,i,r,a)),r+t+i};Object.defineProperties(xn.prototype,vn);const En=xn();xn({level:pn?pn.level:0});var Dn=En;const On=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!kn(i,a)&&r||Object.defineProperty(e,n,a)},kn=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},An=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},jn=(e,t)=>`/* Wrapped ${e}*/\n${t}`,Mn=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),Nn=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),Pn=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=jn.bind(null,r,t.toString());Object.defineProperty(i,`name`,Nn);let{writable:a,enumerable:o,configurable:s}=Mn;Object.defineProperty(e,`toString`,{value:i,writable:a,enumerable:o,configurable:s})};function Fn(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))On(e,t,r,n);return An(e,t),Pn(e,t,r),e}const In=new WeakMap,Ln=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected a function`);let n,r=0,i=e.displayName||e.name||`<anonymous>`,a=function(...o){if(In.set(a,++r),r===1)n=e.apply(this,o),e=void 0;else if(t.throw===!0)throw Error(`Function \`${i}\` can only be called once`);return n};return Fn(a,e),In.set(a,r),a};Ln.callCount=e=>{if(!In.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return In.get(e)};var Rn=Ln;const U=[];U.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&U.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&U.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const zn=e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,Bn=Symbol.for(`signal-exit emitter`),Vn=globalThis,Hn=Object.defineProperty.bind(Object);var Un=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Vn[Bn])return Vn[Bn];Hn(Vn,Bn,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},Wn=class{};const Gn=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var Kn=class extends Wn{onExit(){return()=>{}}load(){}unload(){}},qn=class extends Wn{#hupSig=Jn.platform===`win32`?`SIGINT`:`SIGHUP`;#emitter=new Un;#process;#originalProcessEmit;#originalProcessReallyExit;#sigListeners={};#loaded=!1;constructor(e){super(),this.#process=e,this.#sigListeners={};for(let t of U)this.#sigListeners[t]=()=>{let n=this.#process.listeners(t),{count:r}=this.#emitter,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#emitter.emit(`exit`,null,t),r=t===`SIGHUP`?this.#hupSig:t;n||e.kill(e.pid,r)}};this.#originalProcessReallyExit=e.reallyExit,this.#originalProcessEmit=e.emit}onExit(e,t){if(!zn(this.#process))return()=>{};this.#loaded===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#emitter.on(n,e),()=>{this.#emitter.removeListener(n,e),this.#emitter.listeners.exit.length===0&&this.#emitter.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#loaded){this.#loaded=!0,this.#emitter.count+=1;for(let e of U)try{let t=this.#sigListeners[e];t&&this.#process.on(e,t)}catch{}this.#process.emit=(e,...t)=>this.#processEmit(e,...t),this.#process.reallyExit=e=>this.#processReallyExit(e)}}unload(){this.#loaded&&(this.#loaded=!1,U.forEach(e=>{let t=this.#sigListeners[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#process.removeListener(e,t)}catch{}}),this.#process.emit=this.#originalProcessEmit,this.#process.reallyExit=this.#originalProcessReallyExit,--this.#emitter.count)}#processReallyExit(e){return zn(this.#process)?(this.#process.exitCode=e||0,this.#emitter.emit(`exit`,this.#process.exitCode,null),this.#originalProcessReallyExit.call(this.#process,this.#process.exitCode)):0}#processEmit(e,...t){let n=this.#originalProcessEmit;if(e===`exit`&&zn(this.#process)){typeof t[0]==`number`&&(this.#process.exitCode=t[0]);let r=n.call(this.#process,e,...t);return this.#emitter.emit(`exit`,this.#process.exitCode,null),r}else return n.call(this.#process,e,...t)}};const Jn=globalThis.process,{onExit:Yn,load:Xn,unload:Zn}=Gn(zn(Jn)?new qn(Jn):new Kn),Qn=h.stderr.isTTY?h.stderr:h.stdout.isTTY?h.stdout:void 0;var $n=Qn?Rn(()=>{Yn(()=>{Qn.write(`\x1B[?25h`)},{alwaysLast:!0})}):()=>{};let er=!1;const W={};W.show=(e=h.stderr)=>{e.isTTY&&(er=!1,e.write(`\x1B[?25h`))},W.hide=(e=h.stderr)=>{e.isTTY&&($n(),er=!0,e.write(`\x1B[?25l`))},W.toggle=(e,t)=>{e!==void 0&&(er=e),er?W.show(t):W.hide(t)};var tr=W,nr=T(((e,t)=>{t.exports={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:`⠁.⠁.⠉.⠙.⠚.⠒.⠂.⠂.⠒.⠲.⠴.⠤.⠄.⠄.⠤.⠠.⠠.⠤.⠦.⠖.⠒.⠐.⠐.⠒.⠓.⠋.⠉.⠈.⠈`.split(`.`)},dots9:{interval:80,frames:[`⢹`,`⢺`,`⢼`,`⣸`,`⣇`,`⡧`,`⡗`,`⡏`]},dots10:{interval:80,frames:[`⢄`,`⢂`,`⢁`,`⡁`,`⡈`,`⡐`,`⡠`]},dots11:{interval:100,frames:[`⠁`,`⠂`,`⠄`,`⡀`,`⢀`,`⠠`,`⠐`,`⠈`]},dots12:{interval:80,frames:`⢀⠀.⡀⠀.⠄⠀.⢂⠀.⡂⠀.⠅⠀.⢃⠀.⡃⠀.⠍⠀.⢋⠀.⡋⠀.⠍⠁.⢋⠁.⡋⠁.⠍⠉.⠋⠉.⠋⠉.⠉⠙.⠉⠙.⠉⠩.⠈⢙.⠈⡙.⢈⠩.⡀⢙.⠄⡙.⢂⠩.⡂⢘.⠅⡘.⢃⠨.⡃⢐.⠍⡐.⢋⠠.⡋⢀.⠍⡁.⢋⠁.⡋⠁.⠍⠉.⠋⠉.⠋⠉.⠉⠙.⠉⠙.⠉⠩.⠈⢙.⠈⡙.⠈⠩.⠀⢙.⠀⡙.⠀⠩.⠀⢘.⠀⡘.⠀⠨.⠀⢐.⠀⡐.⠀⠠.⠀⢀.⠀⡀`.split(`.`)},dots13:{interval:80,frames:[`⣼`,`⣹`,`⢻`,`⠿`,`⡟`,`⣏`,`⣧`,`⣶`]},dots8Bit:{interval:80,frames:`⠀.⠁.⠂.⠃.⠄.⠅.⠆.⠇.⡀.⡁.⡂.⡃.⡄.⡅.⡆.⡇.⠈.⠉.⠊.⠋.⠌.⠍.⠎.⠏.⡈.⡉.⡊.⡋.⡌.⡍.⡎.⡏.⠐.⠑.⠒.⠓.⠔.⠕.⠖.⠗.⡐.⡑.⡒.⡓.⡔.⡕.⡖.⡗.⠘.⠙.⠚.⠛.⠜.⠝.⠞.⠟.⡘.⡙.⡚.⡛.⡜.⡝.⡞.⡟.⠠.⠡.⠢.⠣.⠤.⠥.⠦.⠧.⡠.⡡.⡢.⡣.⡤.⡥.⡦.⡧.⠨.⠩.⠪.⠫.⠬.⠭.⠮.⠯.⡨.⡩.⡪.⡫.⡬.⡭.⡮.⡯.⠰.⠱.⠲.⠳.⠴.⠵.⠶.⠷.⡰.⡱.⡲.⡳.⡴.⡵.⡶.⡷.⠸.⠹.⠺.⠻.⠼.⠽.⠾.⠿.⡸.⡹.⡺.⡻.⡼.⡽.⡾.⡿.⢀.⢁.⢂.⢃.⢄.⢅.⢆.⢇.⣀.⣁.⣂.⣃.⣄.⣅.⣆.⣇.⢈.⢉.⢊.⢋.⢌.⢍.⢎.⢏.⣈.⣉.⣊.⣋.⣌.⣍.⣎.⣏.⢐.⢑.⢒.⢓.⢔.⢕.⢖.⢗.⣐.⣑.⣒.⣓.⣔.⣕.⣖.⣗.⢘.⢙.⢚.⢛.⢜.⢝.⢞.⢟.⣘.⣙.⣚.⣛.⣜.⣝.⣞.⣟.⢠.⢡.⢢.⢣.⢤.⢥.⢦.⢧.⣠.⣡.⣢.⣣.⣤.⣥.⣦.⣧.⢨.⢩.⢪.⢫.⢬.⢭.⢮.⢯.⣨.⣩.⣪.⣫.⣬.⣭.⣮.⣯.⢰.⢱.⢲.⢳.⢴.⢵.⢶.⢷.⣰.⣱.⣲.⣳.⣴.⣵.⣶.⣷.⢸.⢹.⢺.⢻.⢼.⢽.⢾.⢿.⣸.⣹.⣺.⣻.⣼.⣽.⣾.⣿`.split(`.`)},sand:{interval:80,frames:`⠁.⠂.⠄.⡀.⡈.⡐.⡠.⣀.⣁.⣂.⣄.⣌.⣔.⣤.⣥.⣦.⣮.⣶.⣷.⣿.⡿.⠿.⢟.⠟.⡛.⠛.⠫.⢋.⠋.⠍.⡉.⠉.⠑.⠡.⢁`.split(`.`)},line:{interval:130,frames:[`-`,`\\`,`|`,`/`]},line2:{interval:100,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:`█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁.██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁.███████▁▁▁▁▁▁▁▁▁▁▁▁▁.████████▁▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.██████████▁▁▁▁▁▁▁▁▁▁.███████████▁▁▁▁▁▁▁▁▁.█████████████▁▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁▁██████████████▁▁▁▁.▁▁▁██████████████▁▁▁.▁▁▁▁█████████████▁▁▁.▁▁▁▁██████████████▁▁.▁▁▁▁██████████████▁▁.▁▁▁▁▁██████████████▁.▁▁▁▁▁██████████████▁.▁▁▁▁▁██████████████▁.▁▁▁▁▁▁██████████████.▁▁▁▁▁▁██████████████.▁▁▁▁▁▁▁█████████████.▁▁▁▁▁▁▁█████████████.▁▁▁▁▁▁▁▁████████████.▁▁▁▁▁▁▁▁████████████.▁▁▁▁▁▁▁▁▁███████████.▁▁▁▁▁▁▁▁▁███████████.▁▁▁▁▁▁▁▁▁▁██████████.▁▁▁▁▁▁▁▁▁▁██████████.▁▁▁▁▁▁▁▁▁▁▁▁████████.▁▁▁▁▁▁▁▁▁▁▁▁▁███████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████.█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.██████▁▁▁▁▁▁▁▁▁▁▁▁▁█.████████▁▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.███████████▁▁▁▁▁▁▁▁▁.████████████▁▁▁▁▁▁▁▁.████████████▁▁▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁▁▁█████████████▁▁▁▁.▁▁▁▁▁████████████▁▁▁.▁▁▁▁▁████████████▁▁▁.▁▁▁▁▁▁███████████▁▁▁.▁▁▁▁▁▁▁▁█████████▁▁▁.▁▁▁▁▁▁▁▁█████████▁▁▁.▁▁▁▁▁▁▁▁▁█████████▁▁.▁▁▁▁▁▁▁▁▁█████████▁▁.▁▁▁▁▁▁▁▁▁▁█████████▁.▁▁▁▁▁▁▁▁▁▁▁████████▁.▁▁▁▁▁▁▁▁▁▁▁████████▁.▁▁▁▁▁▁▁▁▁▁▁▁███████▁.▁▁▁▁▁▁▁▁▁▁▁▁███████▁.▁▁▁▁▁▁▁▁▁▁▁▁▁███████.▁▁▁▁▁▁▁▁▁▁▁▁▁███████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁`.split(`.`)},moon:{interval:80,frames:[`🌑 `,`🌒 `,`🌓 `,`🌔 `,`🌕 `,`🌖 `,`🌗 `,`🌘 `]},runner:{interval:140,frames:[`🚶 `,`🏃 `]},pong:{interval:80,frames:`▐⠂ ▌.▐⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂▌.▐ ⠠▌.▐ ⡀▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐⠠ ▌`.split(`.`)},shark:{interval:120,frames:`▐|\\____________▌.▐_|\\___________▌.▐__|\\__________▌.▐___|\\_________▌.▐____|\\________▌.▐_____|\\_______▌.▐______|\\______▌.▐_______|\\_____▌.▐________|\\____▌.▐_________|\\___▌.▐__________|\\__▌.▐___________|\\_▌.▐____________|\\▌.▐____________/|▌.▐___________/|_▌.▐__________/|__▌.▐_________/|___▌.▐________/|____▌.▐_______/|_____▌.▐______/|______▌.▐_____/|_______▌.▐____/|________▌.▐___/|_________▌.▐__/|__________▌.▐_/|___________▌.▐/|____________▌`.split(`.`)},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:` ██████£££ .☺██████£££ .☺██████£££ .☺▓█████£££ .☺▓█████£££ .☺▒█████£££ .☺▒█████£££ .☺░█████£££ .☺░█████£££ .☺ █████£££ . ☺█████£££ . ☺█████£££ . ☺▓████£££ . ☺▓████£££ . ☺▒████£££ . ☺▒████£££ . ☺░████£££ . ☺░████£££ . ☺ ████£££ . ☺████£££ . ☺████£££ . ☺▓███£££ . ☺▓███£££ . ☺▒███£££ . ☺▒███£££ . ☺░███£££ . ☺░███£££ . ☺ ███£££ . ☺███£££ . ☺███£££ . ☺▓██£££ . ☺▓██£££ . ☺▒██£££ . ☺▒██£££ . ☺░██£££ . ☺░██£££ . ☺ ██£££ . ☺██£££ . ☺██£££ . ☺▓█£££ . ☺▓█£££ . ☺▒█£££ . ☺▒█£££ . ☺░█£££ . ☺░█£££ . ☺ █£££ . ☺█£££ . ☺█£££ . ☺▓£££ . ☺▓£££ . ☺▒£££ . ☺▒£££ . ☺░£££ . ☺░£££ . ☺ £££ . ☺£££ . ☺£££ . ☺▓££ . ☺▓££ . ☺▒££ . ☺▒££ . ☺░££ . ☺░££ . ☺ ££ . ☺££ . ☺££ . ☺▓£ . ☺▓£ . ☺▒£ . ☺▒£ . ☺░£ . ☺░£ . ☺ £ . ☺£ . ☺£ . ☺▓ . ☺▓ . ☺▒ . ☺▒ . ☺░ . ☺░ . ☺ . ☺ &. ☺ ☼&. ☺ ☼ &. ☺☼ &. ☺☼ & . ‼ & . ☺ & . ‼ & . ☺ & . ‼ & . ☺ & .‼ & . & . & . & ░ . & ▒ . & ▓ . & £ . & ░£ . & ▒£ . & ▓£ . & ££ . & ░££ . & ▒££ .& ▓££ .& £££ . ░£££ . ▒£££ . ▓£££ . █£££ . ░█£££ . ▒█£££ . ▓█£££ . ██£££ . ░██£££ . ▒██£££ . ▓██£££ . ███£££ . ░███£££ . ▒███£££ . ▓███£££ . ████£££ . ░████£££ . ▒████£££ . ▓████£££ . █████£££ . ░█████£££ . ▒█████£££ . ▓█████£££ . ██████£££ . ██████£££ `.split(`.`)}}})),G=T(((e,t)=>{let n=Object.assign({},nr()),r=Object.keys(n);Object.defineProperty(n,`random`,{get(){return n[r[Math.floor(Math.random()*r.length)]]}}),t.exports=n})),rr=E(G(),1);function ir(){return h.platform===`win32`?!!h.env.CI||!!h.env.WT_SESSION||!!h.env.TERMINUS_SUBLIME||h.env.ConEmuTask===`{cmd::Cmder}`||h.env.TERM_PROGRAM===`Terminus-Sublime`||h.env.TERM_PROGRAM===`vscode`||h.env.TERM===`xterm-256color`||h.env.TERM===`alacritty`||h.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:h.env.TERM!==`linux`}const ar={info:Dn.blue(`ℹ`),success:Dn.green(`✔`),warning:Dn.yellow(`⚠`),error:Dn.red(`✖`)},K={info:Dn.blue(`i`),success:Dn.green(`√`),warning:Dn.yellow(`‼`),error:Dn.red(`×`)};var or=ir()?ar:K;function sr({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const cr=sr();function lr(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(cr,``)}function q(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function ur(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function dr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function fr(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function pr(e,{ambiguousAsWide:t=!1}={}){return fr(e),ur(e)||dr(e)||t&&q(e)?2:1}var mr=E(T(((e,t)=>{t.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}))(),1);const hr=new Intl.Segmenter,gr=/^\p{Default_Ignorable_Code_Point}$/u;function _r(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=lr(e)),e.length===0)return 0;let i=0,a={ambiguousAsWide:!n};for(let{segment:t}of hr.segment(e)){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159)&&!(e>=8203&&e<=8207||e===65279)&&!(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071)&&!(e>=55296&&e<=57343)&&!(e>=65024&&e<=65039)&&!gr.test(t)){if((0,mr.default)().test(t)){i+=2;continue}i+=pr(e,a)}}return i}function vr({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!==`dumb`&&!(`CI`in process.env))}function yr(){let{env:e}=h,{TERM:t,TERM_PROGRAM:n}=e;return h.platform===`win32`?!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask===`{cmd::Cmder}`||n===`Terminus-Sublime`||n===`vscode`||t===`xterm-256color`||t===`alacritty`||t===`rxvt-unicode`||t===`rxvt-unicode-256color`||e.TERMINAL_EMULATOR===`JetBrains-JediTerm`:t!==`linux`}var br=new class{#activeCount=0;start(){this.#activeCount++,this.#activeCount===1&&this.#realStart()}stop(){if(this.#activeCount<=0)throw Error("`stop` called more times than `start`");this.#activeCount--,this.#activeCount===0&&this.#realStop()}#realStart(){h.platform===`win32`||!h.stdin.isTTY||(h.stdin.setRawMode(!0),h.stdin.on(`data`,this.#handleInput),h.stdin.resume())}#realStop(){h.stdin.isTTY&&(h.stdin.off(`data`,this.#handleInput),h.stdin.pause(),h.stdin.setRawMode(!1))}#handleInput(e){e[0]===3&&h.emit(`SIGINT`)}};G();var xr=class{#linesToClear=0;#isDiscardingStdin=!1;#lineCount=0;#frameIndex=-1;#lastSpinnerFrameTime=0;#options;#spinner;#stream;#id;#initialInterval;#isEnabled;#isSilent;#indent;#text;#prefixText;#suffixText;color;constructor(e){typeof e==`string`&&(e={text:e}),this.#options={color:`cyan`,stream:h.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#options.color,this.spinner=this.#options.spinner,this.#initialInterval=this.#options.interval,this.#stream=this.#options.stream,this.#isEnabled=typeof this.#options.isEnabled==`boolean`?this.#options.isEnabled:vr({stream:this.#stream}),this.#isSilent=typeof this.#options.isSilent==`boolean`?this.#options.isSilent:!1,this.text=this.#options.text,this.prefixText=this.#options.prefixText,this.suffixText=this.#options.suffixText,this.indent=this.#options.indent,h.env.NODE_ENV===`test`&&(this._stream=this.#stream,this._isEnabled=this.#isEnabled,Object.defineProperty(this,`_linesToClear`,{get(){return this.#linesToClear},set(e){this.#linesToClear=e}}),Object.defineProperty(this,`_frameIndex`,{get(){return this.#frameIndex}}),Object.defineProperty(this,`_lineCount`,{get(){return this.#lineCount}}))}get indent(){return this.#indent}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw Error("The `indent` option must be an integer from 0 and up");this.#indent=e,this.#updateLineCount()}get interval(){return this.#initialInterval??this.#spinner.interval??100}get spinner(){return this.#spinner}set spinner(e){if(this.#frameIndex=-1,this.#initialInterval=void 0,typeof e==`object`){if(e.frames===void 0)throw Error("The given spinner must have a `frames` property");this.#spinner=e}else if(!yr())this.#spinner=rr.default.line;else if(e===void 0)this.#spinner=rr.default.dots;else if(e!==`default`&&rr.default[e])this.#spinner=rr.default[e];else throw Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#text}set text(e=``){this.#text=e,this.#updateLineCount()}get prefixText(){return this.#prefixText}set prefixText(e=``){this.#prefixText=e,this.#updateLineCount()}get suffixText(){return this.#suffixText}set suffixText(e=``){this.#suffixText=e,this.#updateLineCount()}get isSpinning(){return this.#id!==void 0}#getFullPrefixText(e=this.#prefixText,t=` `){return typeof e==`string`&&e!==``?e+t:typeof e==`function`?e()+t:``}#getFullSuffixText(e=this.#suffixText,t=` `){return typeof e==`string`&&e!==``?t+e:typeof e==`function`?t+e():``}#updateLineCount(){let e=this.#stream.columns??80,t=this.#getFullPrefixText(this.#prefixText,`-`),n=this.#getFullSuffixText(this.#suffixText,`-`),r=` `.repeat(this.#indent)+t+`--`+this.#text+`--`+n;this.#lineCount=0;for(let t of lr(r).split(`
|
|
125
|
-
`))this.#lineCount+=Math.max(1,Math.ceil(_r(t,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#isEnabled&&!this.#isSilent}set isEnabled(e){if(typeof e!=`boolean`)throw TypeError("The `isEnabled` option must be a boolean");this.#isEnabled=e}get isSilent(){return this.#isSilent}set isSilent(e){if(typeof e!=`boolean`)throw TypeError("The `isSilent` option must be a boolean");this.#isSilent=e}frame(){let e=Date.now();(this.#frameIndex===-1||e-this.#lastSpinnerFrameTime>=this.interval)&&(this.#frameIndex=++this.#frameIndex%this.#spinner.frames.length,this.#lastSpinnerFrameTime=e);let{frames:t}=this.#spinner,n=t[this.#frameIndex];this.color&&(n=Dn[this.color](n));let r=typeof this.#prefixText==`string`&&this.#prefixText!==``?this.#prefixText+` `:``,i=typeof this.text==`string`?` `+this.text:``,a=typeof this.#suffixText==`string`&&this.#suffixText!==``?` `+this.#suffixText:``;return r+n+i+a}clear(){if(!this.#isEnabled||!this.#stream.isTTY)return this;this.#stream.cursorTo(0);for(let e=0;e<this.#linesToClear;e++)e>0&&this.#stream.moveCursor(0,-1),this.#stream.clearLine(1);return(this.#indent||this.lastIndent!==this.#indent)&&this.#stream.cursorTo(this.#indent),this.lastIndent=this.#indent,this.#linesToClear=0,this}render(){return this.#isSilent?this:(this.clear(),this.#stream.write(this.frame()),this.#linesToClear=this.#lineCount,this)}start(e){return e&&(this.text=e),this.#isSilent?this:this.#isEnabled?this.isSpinning?this:(this.#options.hideCursor&&tr.hide(this.#stream),this.#options.discardStdin&&h.stdin.isTTY&&(this.#isDiscardingStdin=!0,br.start()),this.render(),this.#id=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#stream.write(`- ${this.text}\n`),this)}stop(){return this.#isEnabled?(clearInterval(this.#id),this.#id=void 0,this.#frameIndex=0,this.clear(),this.#options.hideCursor&&tr.show(this.#stream),this.#options.discardStdin&&h.stdin.isTTY&&this.#isDiscardingStdin&&(br.stop(),this.#isDiscardingStdin=!1),this):this}succeed(e){return this.stopAndPersist({symbol:or.success,text:e})}fail(e){return this.stopAndPersist({symbol:or.error,text:e})}warn(e){return this.stopAndPersist({symbol:or.warning,text:e})}info(e){return this.stopAndPersist({symbol:or.info,text:e})}stopAndPersist(e={}){if(this.#isSilent)return this;let t=e.prefixText??this.#prefixText,n=this.#getFullPrefixText(t,` `),r=e.symbol??` `,i=e.text??this.text,a=typeof i==`string`?(r?` `:``)+i:``,o=e.suffixText??this.#suffixText,s=this.#getFullSuffixText(o,` `),c=n+r+a+s+`
|
|
126
|
-
`;return this.stop(),this.#stream.write(c),this}};function Sr(e){return new xr(e)}async function Cr({projectName:e,projectPath:n,template:r,packageManager:i=`npm`,gitInit:a=!1,stylingFramework:o=`vanilla`}){console.log(we(`Creating project: ${e}`)),console.log(we(`Template: ${r}`)),console.log(we(`Package manager: ${i}`)),console.log();let l,d=!1,f=Sr(`Preparing template...`).start();try{if(Fe()){if(l=Pe(r),!c(l))throw Error(`Local template "${r}" not found at ${l}`);f.succeed(`Local template located`)}else f.text=`Downloading template from GitHub...`,l=await P(r),d=!0,f.succeed(`Template downloaded`)}catch(e){throw f.fail(`Failed to prepare template`),e}let m=Sr(`Creating project directory...`).start();try{u(n,{recursive:!0}),m.succeed(`Project directory created`)}catch(e){throw m.fail(`Failed to create project directory`),d&&p(l,{recursive:!0,force:!0}),e}let h=Sr(`Copying template files...`).start();try{s(l,n,{recursive:!0,filter:e=>{let t=e.replace(l,``);return!t.includes(`node_modules`)&&!t.includes(`package-lock.json`)&&!t.includes(`yarn.lock`)&&!t.includes(`pnpm-lock.yaml`)}}),h.succeed(`Template files copied`)}catch(e){throw h.fail(`Failed to copy template files`),d&&p(l,{recursive:!0,force:!0}),e}let g=Sr(`Configuring package.json...`).start();try{wr(n,e,i,o),g.succeed(`Package.json configured`)}catch(e){throw g.fail(`Failed to configure package.json`),d&&p(l,{recursive:!0,force:!0}),e}let _=Sr(`Configuring styling framework...`).start();try{Tr(n,o),_.succeed(`Styling framework configured`)}catch(e){throw _.fail(`Failed to configure styling framework`),d&&p(l,{recursive:!0,force:!0}),e}if(a){let e=Sr(`Initializing Git repository...`).start();try{t(`git init`,{cwd:n,stdio:`ignore`}),e.succeed(`Git repository initialized`)}catch{e.warn(`Git initialization failed (optional)`)}}if(d)try{p(l,{recursive:!0,force:!0})}catch{}console.log(),console.log(Te(`✓ Project created successfully!`))}function wr(e,t,r,a){let o=i(e,`package.json`);if(!c(o))throw Error(`package.json not found in template`);let s=JSON.parse(d(o,`utf-8`));s.name=n(t),s.version===`0.0.0`&&(s.version=`1.0.0`),s.description=`A Ripple application created with create-ripple`,r!==`npm`&&(s.packageManager=Or(r)),a===`tailwind`?s.devDependencies={...s.devDependencies,tailwindcss:`^4.1.12`,"@tailwindcss/vite":`^4.1.12`}:a===`bootstrap`&&(s.dependencies={...s.dependencies,bootstrap:`^5.3.0`}),Er(s),Dr(s,r),m(o,JSON.stringify(s,null,2)+`
|
|
127
|
-
`)}function Tr(e,t){if(t===`tailwind`){m(i(e,`tailwind.config.ts`),`import type { Config } from 'tailwindcss';
|
|
128
|
-
export default {
|
|
129
|
-
content: [
|
|
130
|
-
"./index.html",
|
|
131
|
-
"./src/**/*.{ts,ripple}",
|
|
132
|
-
],
|
|
133
|
-
theme: {
|
|
134
|
-
extend: {},
|
|
135
|
-
},
|
|
136
|
-
plugins: []
|
|
137
|
-
} satisfies Config
|
|
138
|
-
`),m(i(e,`src`,`index.css`),`@import "tailwindcss";
|
|
139
|
-
@config "../tailwind.config.ts";`);let t=`import './index.css';
|
|
140
|
-
`+d(i(e,`src`,`index.ts`),`utf-8`);m(i(e,`src`,`index.ts`),t),c(i(e,`vite.config.js`))&&p(i(e,`vite.config.js`)),m(i(e,`vite.config.js`),`import { defineConfig } from 'vite';
|
|
141
|
-
import { ripple } from 'vite-plugin-ripple';
|
|
142
|
-
import tailwindcss from '@tailwindcss/vite';
|
|
143
|
-
|
|
144
|
-
export default defineConfig({
|
|
145
|
-
plugins: [ripple(), tailwindcss()],
|
|
146
|
-
server: {
|
|
147
|
-
port: 3000
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
`)}else if(t===`bootstrap`){let t=`import 'bootstrap/dist/css/bootstrap.min.css';
|
|
151
|
-
`+d(i(e,`src`,`index.ts`),`utf-8`);m(i(e,`src`,`index.ts`),t)}}function Er(e){let t={ripple:`^0.2.35`,"vite-plugin-ripple":`^0.2.29`,"prettier-plugin-ripple":`^0.2.29`};if(e.dependencies)for(let[n,r]of Object.entries(t))e.dependencies[n]&&(e.dependencies[n]=r);if(e.devDependencies)for(let[n,r]of Object.entries(t))e.devDependencies[n]&&(e.devDependencies[n]=r)}function Dr(e,t){e.scripts&&({npm:`npm run`,yarn:`yarn`,pnpm:`pnpm`}[t],e.scripts.format&&(e.scripts.format=`prettier --write .`),e.scripts[`format:check`]&&(e.scripts[`format:check`]=`prettier --check .`))}function Or(e){return{yarn:`yarn@4.0.0`,pnpm:`pnpm@9.0.0`}[e]||e}function kr(e,t){let n=[`.DS_Store`,`.git`,`.gitattributes`,`.gitignore`,`.gitlab-ci.yml`,`.hg`,`.hgcheck`,`.hgignore`,`.idea`,`.npmignore`,`.travis.yml`,`LICENSE`,`Thumbs.db`,`docs`,`mkdocs.yml`,`npm-debug.log`,`yarn-debug.log`,`yarn-error.log`,`yarnrc.yml`,`.yarn`],r=f(e).filter(e=>!n.includes(e)&&!/\.iml$/.test(e));if(r.length>0){console.log(`The directory ${Te(t)} contains files that could conflict:`),console.log();for(let t of r)try{l(i(e,t)).isDirectory()?console.log(` ${Ee(t)}/`):console.log(` ${t}`)}catch{console.log(` ${t}`)}return console.log(),console.log(`Either try using a new directory name, or remove the files listed above.`),console.log(),!1}return!0}async function Ar(e,t){if(console.log(),console.log(De(`🌊 Welcome to Create Ripple App!`)),console.log(we(`Let's create a new Ripple application`)),console.log(),!e)e=await Kt();else{let t=j(e);t.valid||(console.error(A(`✖ ${t.message}`)),process.exit(1))}let r=o(process.cwd(),e);c(r)&&!kr(r,n(r))&&process.exit(1);let i=t.template;i?N(i)||(console.error(A(`✖ Template "${i}" not found`)),console.error(`Available templates: ${Me().join(`, `)}`),process.exit(1)):i=await qt();let a=t.packageManager||`npm`;!t.packageManager&&!t.yes&&(a=await Jt());let s;s=t.git===!1?!1:t.yes?!0:await Yt();let l=`vanilla`;t.yes||(l=await Xt()),console.log(),console.log(`Creating Ripple app in ${Te(r)}...`),console.log();try{await Cr({projectName:e,projectPath:r,template:i,packageManager:a,typescript:!0,gitInit:s,stylingFramework:l}),jr(r,a),process.exit(0)}catch(e){console.error(A(`✖ Failed to create project:`)),console.error(e.message),process.exit(1)}}function jr(e,t){let n=Mr(t),r=Nr(t);console.log(),console.log(Te(`🎉 Success! Your Ripple app is ready to go.`)),console.log(),console.log(`Next steps:`),console.log(` ${we(`cd`)} ${a(process.cwd(),e)}`),console.log(` ${we(n)}`),console.log(` ${we(r)}`),console.log(),console.log(`Happy coding! 🌊`),console.log()}function Mr(e){return{npm:`npm install`,yarn:`yarn install`,pnpm:`pnpm install`}[e]||`npm install`}function Nr(e){return{npm:`npm run dev`,yarn:`yarn dev`,pnpm:`pnpm dev`}[e]||`npm run dev`}const Pr=r(g(import.meta.url)),Fr=JSON.parse(d(i(Pr,`../package.json`),`utf-8`)),Ir=new he;Ir.name(`create-ripple`).description(`Interactive CLI tool for creating Ripple applications`).version(Fr.version).helpOption(`-h, --help`,`Display help for command`),Ir.argument(`[project-name]`,`Name of the project to create`).option(`-t, --template <template>`,`Template to use (default: basic)`).option(`-p, --package-manager <pm>`,`Package manager to use (npm, yarn, pnpm)`,`npm`).option(`--no-git`,`Skip Git repository initialization`).option(`-y, --yes`,`Skip all prompts and use defaults`).action(async(e,t)=>{try{await Ar(e,t)}catch(e){console.error(A(`✖ Unexpected error:`)),console.error(e.message),process.exit(1)}}),process.on(`unhandledRejection`,e=>{console.error(A(`✖ Unhandled error:`)),console.error(e),process.exit(1)}),process.on(`SIGINT`,()=>{console.log(),console.log(A(`✖ Operation cancelled`)),process.exit(1)}),Ir.parse();export{};
|