pkgroll 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +221 -0
- package/dist/cli.js +33 -0
- package/package.json +113 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Hiroki Osame <hiroki.osame@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# pkgroll
|
|
2
|
+
|
|
3
|
+
Write your code in ESM/TypeScript and bundle it to get ESM, CommonJS, and type declaration outputs with a single command!
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
- **Zero config** Configuration automatically inferred from `package.json`
|
|
7
|
+
- **ESM/CJS Detection** Uses `.mjs`/`.cjs` extension or `package.json#type` to infer module type
|
|
8
|
+
- **Export & Import maps** Uses export and import maps to configure endpoints and aliases
|
|
9
|
+
- **TypeScript friendly** Transform TS and emit `.d.ts` files (Supports `.cts`/`.mts` too!)
|
|
10
|
+
- **Node.js ESM ⇄ CJS friendly** Preserves named exports from ESM to CJS
|
|
11
|
+
- **Fast** Transformations powered by [esbuild](https://esbuild.github.io/)
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
```sh
|
|
15
|
+
npm install --save-dev pkgroll
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick setup
|
|
19
|
+
1. Setup your project with source files in `src` and output in `dist` (configurable).
|
|
20
|
+
|
|
21
|
+
2. Specify output files in `package.json`:
|
|
22
|
+
|
|
23
|
+
```json5
|
|
24
|
+
{
|
|
25
|
+
"name": "my-package",
|
|
26
|
+
|
|
27
|
+
// Set "module" or "commonjs" (https://nodejs.org/api/packages.html#type)
|
|
28
|
+
// "type": "module",
|
|
29
|
+
|
|
30
|
+
// Define the output files
|
|
31
|
+
"main": "./dist/file.js",
|
|
32
|
+
"module": "./dist/file.mjs",
|
|
33
|
+
"types": "./dist/file.d.ts",
|
|
34
|
+
|
|
35
|
+
// Define output files for Node.js export maps (https://nodejs.org/api/packages.html#exports)
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"require": "./dist/file.js",
|
|
39
|
+
"import": "./dist/file.mjs",
|
|
40
|
+
"types": "./dist/file.d.ts"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
// bin files will be compiled to be executable with the Node.js hashbang
|
|
45
|
+
"bin": "./dist/cli.js",
|
|
46
|
+
|
|
47
|
+
// (Optional) Add a build script referencing `pkgroll`
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "pkgroll"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ...
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Paths that start with `./dist/` are automatically mapped to files in the `./src/` directory.
|
|
57
|
+
|
|
58
|
+
3. Package roll!
|
|
59
|
+
```sh
|
|
60
|
+
npm run build # or npx pkgroll
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Usage
|
|
64
|
+
|
|
65
|
+
### Entry-points
|
|
66
|
+
_Pkgroll_ parses package entry-points from `package.json` by reading properties `main`, `module`, `types`, and `exports`.
|
|
67
|
+
|
|
68
|
+
The paths in `./dist` are mapped to paths in `./src` (configurable with `--src` and `--dist` flags) to determine bundle entry-points.
|
|
69
|
+
|
|
70
|
+
### Output formats
|
|
71
|
+
_Pkgroll_ detects the format for each entry-point based on the file extension or the `package.json` property it's placed in, using the [same lookup logic as Node.js](https://nodejs.org/api/packages.html#determining-module-system).
|
|
72
|
+
|
|
73
|
+
| `package.json` property | Output format |
|
|
74
|
+
| - | - |
|
|
75
|
+
| `main` | Auto-detect |
|
|
76
|
+
| `module` | ESM<br><sub>Note: This [unofficial property](https://stackoverflow.com/a/42817320/911407) is not supported by Node.js and is mainly used by bundlers.</sub> |
|
|
77
|
+
| `types` | TypeScript declaration |
|
|
78
|
+
| `exports` | Auto-detect |
|
|
79
|
+
| `exports.require` | CommonJS |
|
|
80
|
+
| `exports.import` | Auto-detect |
|
|
81
|
+
| `exports.types` | TypeScript declaration |
|
|
82
|
+
| `bin` | Auto-detect<br>Also patched to be executable with the Node.js hashbang. |
|
|
83
|
+
|
|
84
|
+
_Auto-detect_ infers the type by extension or `package.json#type`:
|
|
85
|
+
|
|
86
|
+
| Extension | Output format |
|
|
87
|
+
| - | - |
|
|
88
|
+
| `.cjs` | [CommonJS](https://nodejs.org/api/packages.html#:~:text=Files%20ending%20with%20.cjs%20are%20always%20loaded%20as%20CommonJS%20regardless%20of%20the%20nearest%20parent%20package.json) |
|
|
89
|
+
| `.mjs` | [ECMAScript Modules](https://nodejs.org/api/modules.html#the-mjs-extension) |
|
|
90
|
+
| `.js` | Determined by `package.json#type`, defaulting to CommonJS |
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Dependency bundling & externalization
|
|
94
|
+
|
|
95
|
+
Packages to externalize are detected by reading dependency types in `package.json`. Only dependencies listed in `devDependencies` are bundled in.
|
|
96
|
+
|
|
97
|
+
When generating type declarations, this also applies to dependencies referenced in declaration files (`.d.ts` files) as well.
|
|
98
|
+
|
|
99
|
+
```json5
|
|
100
|
+
// package.json
|
|
101
|
+
{
|
|
102
|
+
// ...
|
|
103
|
+
|
|
104
|
+
"peerDependencies": {
|
|
105
|
+
// Externalized
|
|
106
|
+
},
|
|
107
|
+
"dependencies": {
|
|
108
|
+
// Externalized
|
|
109
|
+
},
|
|
110
|
+
"optionalDependencies": {
|
|
111
|
+
// Externalized
|
|
112
|
+
},
|
|
113
|
+
"devDependencies": {
|
|
114
|
+
// Bundled
|
|
115
|
+
},
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Aliases
|
|
120
|
+
Aliases are defined in the [import map](https://nodejs.org/api/packages.html#imports) defined in the `package.json` `imports` property.
|
|
121
|
+
|
|
122
|
+
For native Node.js import mapping, all entries must be prefixed with `#` to indicate an internal [subpath import](https://nodejs.org/api/packages.html#subpath-imports). _Pkgroll_ takes advantage of this behavior to define entries that are _not prefixed_ with `#` as an alias.
|
|
123
|
+
|
|
124
|
+
Native Node.js import mapping supports conditional imports (eg. resolving different paths for Node.js and browser), but _Pkgroll_ does not.
|
|
125
|
+
|
|
126
|
+
> ⚠️ Aliases are not supported in type declaration generation. If you need type declarations, do not use aliases.
|
|
127
|
+
|
|
128
|
+
```json5
|
|
129
|
+
{
|
|
130
|
+
// ...
|
|
131
|
+
|
|
132
|
+
"imports": {
|
|
133
|
+
// Mapping '~utils' to './src/utils'
|
|
134
|
+
"~utils": "./src/utils",
|
|
135
|
+
|
|
136
|
+
// Native Node.js import mapping (can't reference ./src)
|
|
137
|
+
"#internal-package": "./vendors/package/index.js",
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Target
|
|
143
|
+
|
|
144
|
+
_Pkgroll_ uses [esbuild](https://esbuild.github.io/) to handle TypeScript and JavaScript transformation and minification.
|
|
145
|
+
|
|
146
|
+
The target specifies the environments the output should support. Depending on the target, it will generate less code using newer syntax. Read more about it in the [esbuild docs](https://esbuild.github.io/api/#target).
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
By default, the target is set to the version of Node.js used. It can be overwritten with the `--target` flag:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
pkgroll --target es2020 --target node14.18.0
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
It will also automatically detect and include the `target` specified in `tsconfig.json#compilerOptions`.
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
#### Strip `node:` protocol
|
|
159
|
+
Node.js builtin modules can be prefixed with the [`node:` protocol](https://nodejs.org/api/esm.html#node-imports) for explicitness:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
import fs from 'node:fs/promises';
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
This is a new feature and may not work in older versions of Node.js. While you can opt out of using it, your dependencies may still be using it (example package using `node:`: [path-exists](https://github.com/sindresorhus/path-exists/blob/7c95f5c1f5f811c7f4dac78ab5b9e258491f03af/index.js#L1)).
|
|
166
|
+
|
|
167
|
+
Pass in a Node.js target that that doesn't support it to strip the `node:` protocol from imports:
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
pkgroll --target node12.19
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### ESM ⇄ CJS interoperability
|
|
174
|
+
|
|
175
|
+
Node.js ESM offers [interoperability with CommonJS](https://nodejs.org/api/esm.html#interoperability-with-commonjs) via [static analysis](https://github.com/nodejs/cjs-module-lexer). However, not all bundlers compile ESM to CJS syntax in a way that is statically analyzable.
|
|
176
|
+
|
|
177
|
+
Because _pkgroll_ uses Rollup, it's able to produce CJS modules that are minimal and interoperable with Node.js ESM.
|
|
178
|
+
|
|
179
|
+
This means you can technically output in CommonJS to get ESM and CommonJS support.
|
|
180
|
+
|
|
181
|
+
#### createRequire
|
|
182
|
+
Sometimes it's useful to use `require()` or `require.resolve()` in ESM. This can be seamlessly compiled to CommonJS. But when compiling to ESM, Node.js will error because `require` doesn't exist in the module scope.
|
|
183
|
+
|
|
184
|
+
When compiling to ESM, _Pkgroll_ detects `require()` usages and shims it with [`createRequire(import.meta.url)`](https://nodejs.org/api/module.html#modulecreaterequirefilename).
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
### Minification
|
|
188
|
+
Pass in the `--minify` flag to minify assets.
|
|
189
|
+
```sh
|
|
190
|
+
pkgroll --minify
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Watch mode
|
|
194
|
+
Run the bundler in watch mode during development:
|
|
195
|
+
```sh
|
|
196
|
+
pkgroll --watch
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## FAQ
|
|
200
|
+
|
|
201
|
+
### Why bundle with Rollup?
|
|
202
|
+
[Rollup](https://rollupjs.org/) has the best tree-shaking performance, outputs simpler code, and produces seamless CommonJS and ESM formats (minimal interop code). Notably, CJS outputs generated by Rollup supports named exports so it can be parsed by Node.js ESM. Transformations (TypeScript & minification) are handled by [esbuild](https://esbuild.github.io/) for speed.
|
|
203
|
+
|
|
204
|
+
### Why bundle Node.js packages?
|
|
205
|
+
|
|
206
|
+
- **ESM and CommonJS outputs**
|
|
207
|
+
|
|
208
|
+
As the Node.js ecosystem migrates to [ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c), there will be both ESM and CommonJS users. A bundler helps accommodate both distribution types.
|
|
209
|
+
|
|
210
|
+
- **Dependency bundling** yields smaller and faster installation.
|
|
211
|
+
|
|
212
|
+
Tree-shaking only pulls in used code from dependencies, preventing unused code and unnecessary files (eg. `README.md`) from getting downloaded.
|
|
213
|
+
|
|
214
|
+
Removing dependencies also eliminates dependency tree traversal, which is [one of the biggest bottlenecks](https://dev.to/atian25/in-depth-of-tnpm-rapid-mode-how-could-we-fast-10s-than-pnpm-3bpp#:~:text=The%20first%20optimization%20comes%20from%20%27dependencies%20graph%27%3A).
|
|
215
|
+
|
|
216
|
+
- **Type dependencies** must be declared in the `dependencies` hash in `package.json` for it to be resolved by the consumer.
|
|
217
|
+
|
|
218
|
+
This can be unintuitive because types are a development enhancement and also adds installation bloat. Bundling filters out unused types and allows type dependencies to be declared in `devDependencies`.
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
- **Minification** strips dead-code, comments, white-space, and shortens variable names.
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";var fs$1=require("fs"),require$$1=require("tty"),rollup=require("rollup"),path$1=require("path"),require$$2=require("module"),nodeResolve=require("@rollup/plugin-node-resolve"),commonjs=require("@rollup/plugin-commonjs"),json=require("@rollup/plugin-json"),alias=require("@rollup/plugin-alias"),replace=require("@rollup/plugin-replace"),inject=require("@rollup/plugin-inject"),pluginutils=require("@rollup/pluginutils"),esbuild=require("esbuild"),MagicString=require("magic-string");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var fs__default$1=_interopDefaultLegacy(fs$1),require$$1__default=_interopDefaultLegacy(require$$1),path__default$1=_interopDefaultLegacy(path$1),nodeResolve__default=_interopDefaultLegacy(nodeResolve),commonjs__default=_interopDefaultLegacy(commonjs),json__default=_interopDefaultLegacy(json),alias__default=_interopDefaultLegacy(alias),replace__default=_interopDefaultLegacy(replace),inject__default=_interopDefaultLegacy(inject),MagicString__default=_interopDefaultLegacy(MagicString);function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var m$1=Object.defineProperty,I$2=Object.getOwnPropertyDescriptor,D$1=Object.getOwnPropertyNames,K$2=Object.prototype.hasOwnProperty,L$2=e=>m$1(e,"__esModule",{value:!0}),M$1=(e,t)=>{for(var r in t)m$1(e,r,{get:t[r],enumerable:!0})},R$2=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of D$1(t))!K$2.call(e,a)&&(r||a!=="default")&&m$1(e,a,{get:()=>t[a],enumerable:!(n=I$2(t,a))||n.enumerable});return e},z$2=(e=>(t,r)=>e&&e.get(t)||(r=R$2(L$2({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0),X$2={};M$1(X$2,{default:()=>j$2});var P$2=/-(\w)/g,A$1=e=>e.replace(P$2,(t,r)=>r.toUpperCase()),$$1=/\B([A-Z])/g,B$1=e=>e.replace($$1,"-$1").toLowerCase(),{stringify:u}=JSON,{hasOwnProperty:U$2}=Object.prototype,F=(e,t)=>U$2.call(e,t),W$2=/^--?/,q$2=/[.:=]/,C=e=>{let t=e.replace(W$2,""),r,n=t.match(q$2);if(n!=null&&n.index){let a=n.index;r=t.slice(a+1),t=t.slice(0,a)}return{flagName:t,flagValue:r}},G$2=/[\s.:=]/,J$2=(e,t)=>{let r=`Invalid flag name ${u(t)}:`;if(t.length===0)throw new Error(`${r} flag name cannot be empty}`);if(t.length===1)throw new Error(`${r} single characters are reserved for aliases`);let n=t.match(G$2);if(n)throw new Error(`${r} flag name cannot contain the character ${u(n==null?void 0:n[0])}`);let a;if(P$2.test(t)?a=A$1(t):$$1.test(t)&&(a=B$1(t)),a&&F(e,a))throw new Error(`${r} collides with flag ${u(a)}`)};function E$1(e){let t=new Map;for(let r in e){if(!F(e,r))continue;J$2(e,r);let n=e[r];if(n&&typeof n=="object"){let{alias:a}=n;if(typeof a=="string"){if(a.length===0)throw new Error(`Invalid flag alias ${u(r)}: flag alias cannot be empty`);if(a.length>1)throw new Error(`Invalid flag alias ${u(r)}: flag aliases can only be a single-character`);if(t.has(a))throw new Error(`Flag collision: Alias "${a}" is already used`);t.set(a,{name:r,schema:n})}}}return t}var Z$2=e=>!e||typeof e=="function"?!1:Array.isArray(e)||Array.isArray(e.type),v$2=e=>{let t={};for(let r in e)F(e,r)&&(t[r]=Z$2(e[r])?[]:void 0);return t},h$2=(e,t)=>e===Number&&t===""?Number.NaN:e===Boolean?t!=="false":t,_$2=(e,t)=>{for(let r in e){if(!F(e,r))continue;let n=e[r];if(!n)continue;let a=t[r];if(!(a!==void 0&&!(Array.isArray(a)&&a.length===0))&&"default"in n){let o=n.default;typeof o=="function"&&(o=o()),t[r]=o}}},x$2=(e,t)=>{if(!t)throw new Error(`Missing type on flag "${e}"`);return typeof t=="function"?t:Array.isArray(t)?t[0]:x$2(e,t.type)},H$1=/^-[\da-z]+/i,Q$2=/^--[\w-]{2,}/,S$2="--";function j$2(e,t=process.argv.slice(2)){let r=E$1(e),n={flags:v$2(e),unknownFlags:{},_:Object.assign([],{[S$2]:[]})},a,o=(g,s,uu)=>{let Du=x$2(g,s);uu=h$2(Du,uu),uu!==void 0&&!Number.isNaN(uu)?Array.isArray(n.flags[g])?n.flags[g].push(Du(uu)):n.flags[g]=Du(uu):a=eu=>{Array.isArray(n.flags[g])?n.flags[g].push(Du(h$2(Du,eu||""))):n.flags[g]=Du(h$2(Du,eu||"")),a=void 0}},l=(g,s)=>{g in n.unknownFlags||(n.unknownFlags[g]=[]),s!==void 0?n.unknownFlags[g].push(s):a=(uu=!0)=>{n.unknownFlags[g].push(uu),a=void 0}};for(let g=0;g<t.length;g+=1){let s=t[g];if(s===S$2){let Du=t.slice(g+1);n._[S$2]=Du,n._.push(...Du);break}let uu=H$1.test(s);if(Q$2.test(s)||uu){a&&a();let Du=C(s),{flagValue:eu}=Du,{flagName:tu}=Du;if(uu){for(let nu=0;nu<tu.length;nu+=1){let lu=tu[nu],cu=r.get(lu),su=nu===tu.length-1;cu?o(cu.name,cu.schema,su?eu:!0):l(lu,su?eu:!0)}continue}let au=e[tu];if(!au){let nu=A$1(tu);au=e[nu],au&&(tu=nu)}if(!au){l(tu,eu);continue}o(tu,au,eu)}else a?a(s):n._.push(s)}return a&&a(),_$2(e,n.flags),n}var dist$3=z$2(X$2),CD=Object.create,p$1=Object.defineProperty,tD=Object.defineProperties,eD=Object.getOwnPropertyDescriptor,ED=Object.getOwnPropertyDescriptors,nD=Object.getOwnPropertyNames,I$1=Object.getOwnPropertySymbols,rD=Object.getPrototypeOf,L$1=Object.prototype.hasOwnProperty,iD=Object.prototype.propertyIsEnumerable,T$1=(e,t,r)=>t in e?p$1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var r in t||(t={}))L$1.call(t,r)&&T$1(e,r,t[r]);if(I$1)for(var r of I$1(t))iD.call(t,r)&&T$1(e,r,t[r]);return e},d=(e,t)=>tD(e,ED(t)),W$1=e=>p$1(e,"__esModule",{value:!0}),oD=(e,t)=>()=>(e&&(t=e(e=0)),t),BD=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),sD=(e,t)=>{for(var r in t)p$1(e,r,{get:t[r],enumerable:!0})},v$1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of nD(t))!L$1.call(e,a)&&(r||a!=="default")&&p$1(e,a,{get:()=>t[a],enumerable:!(n=eD(t,a))||n.enumerable});return e},aD=(e,t)=>v$1(W$1(p$1(e!=null?CD(rD(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),lD=(e=>(t,r)=>e&&e.get(t)||(r=v$1(W$1({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0),i=oD(()=>{}),j$1=BD((e,t)=>{i(),t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\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|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\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]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}}),RD={};sD(RD,{breakpoints:()=>FD,default:()=>uD}),i(),i(),i();var N$1=e=>{var t,r,n;let a=(t=process.stdout.columns)!=null?t:Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(a)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:a}:{columns:(r=e.columns)!=null?r:[],stdoutColumns:(n=e.stdoutColumns)!=null?n:a}};i(),i(),i(),i(),i();function x$1({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}function h$1(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(x$1(),"")}i();function w(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var k=aD(j$1(),1);function f$1(e){if(typeof e!="string"||e.length===0||(e=h$1(e),e.length===0))return 0;e=e.replace((0,k.default)()," ");let t=0;for(let r=0;r<e.length;r++){let n=e.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,t+=w(n)?2:1)}return t}var m=e=>Math.max(...e.split(`
|
|
3
|
+
`).map(f$1)),_$1=e=>{let t=[];for(let r of e){let{length:n}=r,a=n-t.length;for(let o=0;o<a;o+=1)t.push(0);for(let o=0;o<n;o+=1){let l=m(r[o]);l>t[o]&&(t[o]=l)}}return t};i();var z$1=/^\d+%$/,U$1={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},AD=(e,t)=>{var r;let n=[];for(let a=0;a<e.length;a+=1){let o=(r=t[a])!=null?r:"auto";if(typeof o=="number"||o==="auto"||o==="content-width"||typeof o=="string"&&z$1.test(o)){n.push(d(c({},U$1),{width:o,contentWidth:e[a]}));continue}if(o&&typeof o=="object"){let l=d(c(c({},U$1),o),{contentWidth:e[a]});l.horizontalPadding=l.paddingLeft+l.paddingRight,n.push(l);continue}throw new Error(`Invalid column width: ${JSON.stringify(o)}`)}return n};function fD(e,t){for(let r of e){let{width:n}=r;if(n==="content-width"&&(r.width=r.contentWidth),n==="auto"){let s=Math.min(20,r.contentWidth);r.width=s,r.autoOverflow=r.contentWidth-s}if(typeof n=="string"&&z$1.test(n)){let s=Number.parseFloat(n.slice(0,-1))/100;r.width=Math.floor(t*s)-(r.paddingLeft+r.paddingRight)}let{horizontalPadding:a}=r,o=1,l=o+a;if(l>=t){let s=l-t,uu=Math.ceil(r.paddingLeft/a*s),Du=s-uu;r.paddingLeft-=uu,r.paddingRight-=Du,r.horizontalPadding=r.paddingLeft+r.paddingRight}r.paddingLeftString=r.paddingLeft?" ".repeat(r.paddingLeft):"",r.paddingRightString=r.paddingRight?" ".repeat(r.paddingRight):"";let g=t-r.horizontalPadding;r.width=Math.max(Math.min(r.width,g),o)}}var G$1=()=>Object.assign([],{columns:0});function cD(e,t){let r=[G$1()],[n]=r;for(let a of e){let o=a.width+a.horizontalPadding;n.columns+o>t&&(n=G$1(),r.push(n)),n.push(a),n.columns+=o}for(let a of r){let o=a.reduce((tu,au)=>tu+au.width+au.horizontalPadding,0),l=t-o;if(l===0)continue;let g=a.filter(tu=>"autoOverflow"in tu),s=g.filter(tu=>tu.autoOverflow>0),uu=s.reduce((tu,au)=>tu+au.autoOverflow,0),Du=Math.min(uu,l);for(let tu of s){let au=Math.floor(tu.autoOverflow/uu*Du);tu.width+=au,l-=au}let eu=Math.floor(l/g.length);for(let tu=0;tu<g.length;tu+=1){let au=g[tu];tu===g.length-1?au.width+=l:au.width+=eu,l-=eu}}return r}function Z$1(e,t,r){let n=AD(r,t);return fD(n,e),cD(n,e)}i(),i(),i();var y=10,V$1=(e=0)=>t=>`\x1B[${t+e}m`,Y$1=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,K$1=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`;function gD(){let e=new Map,t={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],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]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[r,n]of Object.entries(t)){for(let[a,o]of Object.entries(n))t[a]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[a]=t[a],e.set(o[0],o[1]);Object.defineProperty(t,r,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",t.color.ansi=V$1(),t.color.ansi256=Y$1(),t.color.ansi16m=K$1(),t.bgColor.ansi=V$1(y),t.bgColor.ansi256=Y$1(y),t.bgColor.ansi16m=K$1(y),Object.defineProperties(t,{rgbToAnsi256:{value:(r,n,a)=>r===n&&n===a?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(a/255*5),enumerable:!1},hexToRgb:{value:r=>{let n=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(r.toString(16));if(!n)return[0,0,0];let{colorString:a}=n.groups;a.length===3&&(a=a.split("").map(l=>l+l).join(""));let o=Number.parseInt(a,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:r=>t.rgbToAnsi256(...t.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value:r=>{if(r<8)return 30+r;if(r<16)return 90+(r-8);let n,a,o;if(r>=232)n=((r-232)*10+8)/255,a=n,o=n;else{r-=16;let s=r%36;n=Math.floor(r/36)/5,a=Math.floor(s/6)/5,o=s%6/5}let l=Math.max(n,a,o)*2;if(l===0)return 30;let g=30+(Math.round(o)<<2|Math.round(a)<<1|Math.round(n));return l===2&&(g+=60),g},enumerable:!1},rgbToAnsi:{value:(r,n,a)=>t.ansi256ToAnsi(t.rgbToAnsi256(r,n,a)),enumerable:!1},hexToAnsi:{value:r=>t.ansi256ToAnsi(t.hexToAnsi256(r)),enumerable:!1}}),t}var pD=gD(),q$1=pD,b$1=new Set(["\x1B","\x9B"]),dD=39,R$1="\x07",H="[",hD="]",J$1="m",O$1=`${hD}8;;`,Q$1=e=>`${b$1.values().next().value}${H}${e}${J$1}`,X$1=e=>`${b$1.values().next().value}${O$1}${e}${R$1}`,mD=e=>e.split(" ").map(t=>f$1(t)),M=(e,t,r)=>{let n=[...t],a=!1,o=!1,l=f$1(h$1(e[e.length-1]));for(let[g,s]of n.entries()){let uu=f$1(s);if(l+uu<=r?e[e.length-1]+=s:(e.push(s),l=0),b$1.has(s)&&(a=!0,o=n.slice(g+1).join("").startsWith(O$1)),a){o?s===R$1&&(a=!1,o=!1):s===J$1&&(a=!1);continue}l+=uu,l===r&&g<n.length-1&&(e.push(""),l=0)}!l&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},bD=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(f$1(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},xD=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",a,o,l=mD(e),g=[""];for(let[uu,Du]of e.split(" ").entries()){r.trim!==!1&&(g[g.length-1]=g[g.length-1].trimStart());let eu=f$1(g[g.length-1]);if(uu!==0&&(eu>=t&&(r.wordWrap===!1||r.trim===!1)&&(g.push(""),eu=0),(eu>0||r.trim===!1)&&(g[g.length-1]+=" ",eu++)),r.hard&&l[uu]>t){let tu=t-eu,au=1+Math.floor((l[uu]-tu-1)/t);Math.floor((l[uu]-1)/t)<au&&g.push(""),M(g,Du,t);continue}if(eu+l[uu]>t&&eu>0&&l[uu]>0){if(r.wordWrap===!1&&eu<t){M(g,Du,t);continue}g.push("")}if(eu+l[uu]>t&&r.wordWrap===!1){M(g,Du,t);continue}g[g.length-1]+=Du}r.trim!==!1&&(g=g.map(uu=>bD(uu)));let s=[...g.join(`
|
|
4
|
+
`)];for(let[uu,Du]of s.entries()){if(n+=Du,b$1.has(Du)){let{groups:tu}=new RegExp(`(?:\\${H}(?<code>\\d+)m|\\${O$1}(?<uri>.*)${R$1})`).exec(s.slice(uu).join(""))||{groups:{}};if(tu.code!==void 0){let au=Number.parseFloat(tu.code);a=au===dD?void 0:au}else tu.uri!==void 0&&(o=tu.uri.length===0?void 0:tu.uri)}let eu=q$1.codes.get(Number(a));s[uu+1]===`
|
|
5
|
+
`?(o&&(n+=X$1("")),a&&eu&&(n+=Q$1(eu))):Du===`
|
|
6
|
+
`&&(a&&eu&&(n+=Q$1(a)),o&&(n+=X$1(o)))}return n};function S$1(e,t,r){return String(e).normalize().replace(/\r\n/g,`
|
|
7
|
+
`).split(`
|
|
8
|
+
`).map(n=>xD(n,t,r)).join(`
|
|
9
|
+
`)}var P$1=e=>Array.from({length:e}).fill("");function DD(e,t){let r=[],n=0;for(let a of e){let o=0,l=a.map(s=>{var uu;let Du=(uu=t[n])!=null?uu:"";n+=1,s.preprocess&&(Du=s.preprocess(Du)),m(Du)>s.width&&(Du=S$1(Du,s.width,{hard:!0}));let eu=Du.split(`
|
|
10
|
+
`);if(s.postprocess){let{postprocess:tu}=s;eu=eu.map((au,nu)=>tu.call(s,au,nu))}return s.paddingTop&&eu.unshift(...P$1(s.paddingTop)),s.paddingBottom&&eu.push(...P$1(s.paddingBottom)),eu.length>o&&(o=eu.length),d(c({},s),{lines:eu})}),g=[];for(let s=0;s<o;s+=1){let uu=l.map(Du=>{var eu;let tu=(eu=Du.lines[s])!=null?eu:"",au=Number.isFinite(Du.width)?" ".repeat(Du.width-f$1(tu)):"",nu=Du.paddingLeftString;return Du.align==="right"&&(nu+=au),nu+=tu,Du.align==="left"&&(nu+=au),nu+Du.paddingRightString}).join("");g.push(uu)}r.push(g.join(`
|
|
11
|
+
`))}return r.join(`
|
|
12
|
+
`)}function uD(e,t){if(!e||e.length===0)return"";let r=_$1(e),n=r.length;if(n===0)return"";let{stdoutColumns:a,columns:o}=N$1(t);if(o.length>n)throw new Error(`${o.length} columns defined, but only ${n} columns found`);let l=Z$1(a,o,r);return e.map(g=>DD(l,g)).join(`
|
|
13
|
+
`)}i();var wD=["<",">","=",">=","<="];function yD(e){if(!wD.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)}function FD(e){let t=Object.keys(e).map(r=>{let[n,a]=r.split(" ");yD(n);let o=Number.parseInt(a,10);if(Number.isNaN(o))throw new TypeError(`Invalid breakpoint value: ${a}`);let l=e[r];return{operator:n,breakpoint:o,value:l}}).sort((r,n)=>n.breakpoint-r.breakpoint);return r=>{var n;return(n=t.find(({operator:a,breakpoint:o})=>a==="="&&r===o||a===">"&&r>o||a==="<"&&r<o||a===">="&&r>=o||a==="<="&&r<=o))==null?void 0:n.value}}var dist$2=lD(RD),W=Object.create,h=Object.defineProperty,Z=Object.defineProperties,z=Object.getOwnPropertyDescriptor,G=Object.getOwnPropertyDescriptors,Q=Object.getOwnPropertyNames,D=Object.getOwnPropertySymbols,X=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,E=(e,t,r)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f=(e,t)=>{for(var r in t||(t={}))T.call(t,r)&&E(e,r,t[r]);if(D)for(var r of D(t))Y.call(t,r)&&E(e,r,t[r]);return e},b=(e,t)=>Z(e,G(t)),S=e=>h(e,"__esModule",{value:!0}),ee=(e,t)=>{for(var r in t)h(e,r,{get:t[r],enumerable:!0})},B=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Q(t))!T.call(e,a)&&(r||a!=="default")&&h(e,a,{get:()=>t[a],enumerable:!(n=z(t,a))||n.enumerable});return e},v=(e,t)=>B(S(h(e!=null?W(X(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),te=(e=>(t,r)=>e&&e.get(t)||(r=B(S({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0),ue={};ee(ue,{cli:()=>_,command:()=>J});var V=v(dist$3),R=e=>e.replace(/[-_ ](\w)/g,(t,r)=>r.toUpperCase()),I=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),ne={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:e=>e.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function j(e){let t=!1,r=Object.keys(e).sort((n,a)=>n.localeCompare(a)).map(n=>{let a=e[n],o="alias"in a;return o&&(t=!0),{name:n,flag:a,flagFormatted:`--${I(n)}`,aliasesEnabled:t,aliasFormatted:o?`-${a.alias}`:void 0}}).map(n=>(n.aliasesEnabled=t,[{type:"flagName",data:n},{type:"flagDescription",data:n}]));return{type:"table",data:{tableData:r,tableBreakpoints:ne}}}var K=e=>{var t;return!e||((t=e.version)!=null?t:e.help?e.help.version:void 0)},q=e=>{var t;let r="parent"in e&&((t=e.parent)==null?void 0:t.name);return(r?`${r} `:"")+e.name};function re(e){var t;let r=[];e.name&&r.push(q(e));let n=(t=K(e))!=null?t:"parent"in e&&K(e.parent);if(n&&r.push(`v${n}`),r.length!==0)return{id:"name",type:"text",data:`${r.join(" ")}
|
|
14
|
+
`}}function ae(e){let{help:t}=e;if(!(!t||!t.description))return{id:"description",type:"text",data:`${t.description}
|
|
15
|
+
`}}function se(e){var t;let r=e.help||{};if("usage"in r)return r.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(r.usage)?r.usage.join(`
|
|
16
|
+
`):r.usage}}:void 0;if(e.name){let n=[],a=[q(e)];if(e.flags&&Object.keys(e.flags).length>0&&a.push("[flags...]"),e.parameters&&e.parameters.length>0){let{parameters:o}=e,l=o.indexOf("--"),g=l>-1&&o.slice(l+1).some(s=>s.startsWith("<"));a.push(o.map(s=>s!=="--"?s:g?"--":"[--]").join(" "))}if(a.length>1&&n.push(a.join(" ")),"commands"in e&&((t=e.commands)==null?void 0:t.length)&&n.push(`${e.name} <command>`),n.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:n.join(`
|
|
17
|
+
`)}}}}function ie(e){var t;if(!("commands"in e)||!((t=e.commands)!=null&&t.length))return;let r=e.commands.map(n=>[n.options.name,n.options.help?n.options.help.description:""]);return{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:r,tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function oe(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:j(e.flags),indentBody:0}}}function me(e){let{help:t}=e;if(!t||!t.examples||t.examples.length===0)return;let{examples:r}=t;if(Array.isArray(r)&&(r=r.join(`
|
|
18
|
+
`)),r)return{id:"examples",type:"section",data:{title:"Examples:",body:r}}}function le(e){if(!("alias"in e)||!e.alias)return;let{alias:t}=e,r=Array.isArray(t)?t.join(", "):t;return{id:"aliases",type:"section",data:{title:"Aliases:",body:r}}}var A=e=>[re,ae,se,ie,oe,me,le].map(t=>t(e)).filter(t=>Boolean(t)),L=v(require$$1__default.default),P=v(dist$2),pe=L.default.WriteStream.prototype.hasColors(),x=class{text(e){return e}bold(e){return pe?`\x1B[1m${e}\x1B[22m`:e.toLocaleUpperCase()}indentText({text:e,spaces:t}){return e.replace(/^/gm," ".repeat(t))}heading(e){return this.bold(e)}section({title:e,body:t,indentBody:r=2}){return`${(e?`${this.heading(e)}
|
|
19
|
+
`:"")+(t?this.indentText({text:this.render(t),spaces:r}):"")}
|
|
20
|
+
`}table({tableData:e,tableOptions:t,tableBreakpoints:r}){return(0,P.default)(e.map(n=>n.map(a=>this.render(a))),r?(0,P.breakpoints)(r):t)}flagParameter(e){return e===Boolean?"":e===String?"<string>":e===Number?"<number>":Array.isArray(e)?this.flagParameter(e[0]):"<value>"}flagOperator(){return" "}flagName({flag:e,flagFormatted:t,aliasesEnabled:r,aliasFormatted:n}){let a="";if(n?a+=`${n}, `:r&&(a+=" "),a+=t,"placeholder"in e&&typeof e.placeholder=="string")a+=`${this.flagOperator()}${e.placeholder}`;else{let o=this.flagParameter("type"in e?e.type:e);o&&(a+=`${this.flagOperator()}${o}`)}return a}flagDefault(e){return JSON.stringify(e)}flagDescription({flag:e}){var t;let r="description"in e&&(t=e.description)!=null?t:"";if("default"in e){let{default:n}=e;typeof n=="function"&&(n=n()),n&&(r+=` (default: ${this.flagDefault(n)})`)}return r}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>this.render(t)).join(`
|
|
21
|
+
`);if("type"in e&&this[e.type]){let t=this[e.type];if(typeof t=="function")return t.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}},O=/^[\w.-]+$/,{stringify:p}=JSON,de=/[|\\{}()[\]^$+*?.]/;function $(e){let t=[],r,n;for(let a of e){if(n)throw new Error(`Invalid parameter: Spread parameter ${p(n)} must be last`);let o=a[0],l=a[a.length-1],g;if(o==="<"&&l===">"&&(g=!0,r))throw new Error(`Invalid parameter: Required parameter ${p(a)} cannot come after optional parameter ${p(r)}`);if(o==="["&&l==="]"&&(g=!1,r=a),g===void 0)throw new Error(`Invalid parameter: ${p(a)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let s=a.slice(1,-1),uu=s.slice(-3)==="...";uu&&(n=a,s=s.slice(0,-3));let Du=s.match(de);if(Du)throw new Error(`Invalid parameter: ${p(a)}. Invalid character found ${p(Du[0])}`);t.push({name:s,required:g,spread:uu})}return t}function N(e,t,r,n){for(let a=0;a<t.length;a+=1){let{name:o,required:l,spread:g}=t[a],s=R(o);if(s in e)throw new Error(`Invalid parameter: ${p(o)} is used more than once.`);let uu=g?r.slice(a):r[a];if(g&&(a=t.length),l&&(!uu||g&&uu.length===0))return console.error(`Error: Missing required parameter ${p(o)}
|
|
22
|
+
`),n(),process.exit(1);e[s]=uu}}function ce(e){return e===void 0||e!==!1}function U(e,t,r,n){let a=f({},t.flags),o=t.version;o&&(a.version={type:Boolean,description:"Show version"});let{help:l}=t,g=ce(l);g&&!("help"in a)&&(a.help={type:Boolean,alias:"h",description:"Show help"});let s=(0,V.default)(a,n),uu=()=>{console.log(t.version)};if(o&&s.flags.version===!0)return uu(),process.exit(0);let Du=new x,eu=g&&(l==null?void 0:l.render)?l.render:nu=>Du.render(nu),tu=nu=>{let lu=A(b(f(f({},t),nu?{help:nu}:{}),{flags:a}));console.log(eu(lu,Du))};if(g&&s.flags.help===!0)return tu(),process.exit(0);if(t.parameters){let{parameters:nu}=t,lu=s._,cu=nu.indexOf("--"),su=nu.slice(cu+1),ou=Object.create(null);if(cu>-1&&su.length>0){nu=nu.slice(0,cu);let ru=s._["--"];lu=lu.slice(0,-ru.length||void 0),N(ou,$(nu),lu,tu),N(ou,$(su),ru,tu)}else N(ou,$(nu),lu,tu);Object.assign(s._,ou)}let au=b(f({},s),{showVersion:uu,showHelp:tu});return typeof r=="function"&&r(au),f({command:e},au)}function fe(e,t){let r=new Map;for(let n of t){let a=[n.options.name],{alias:o}=n.options;o&&(Array.isArray(o)?a.push(...o):a.push(o));for(let l of a){if(r.has(l))throw new Error(`Duplicate command name found: ${p(l)}`);r.set(l,n)}}return r.get(e)}function _(e,t,r=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!O.test(e.name)))throw new Error(`Invalid script name: ${p(e.name)}`);let n=r[0];if(e.commands&&O.test(n)){let a=fe(n,e.commands);if(a)return U(a.options.name,b(f({},a.options),{parent:e}),a.callback,r.slice(1))}return U(void 0,e,t,r)}function J(e,t){if(!e)throw new Error("Command options are required");let{name:r}=e;if(e.name===void 0)throw new Error("Command name is required");if(!O.test(r))throw new Error(`Invalid command name ${JSON.stringify(r)}. Command names must be one word.`);return{options:e,callback:t}}var dist$1=te(ue);const fsExists=e=>fs__default$1.default.promises.access(e).then(()=>!0,()=>!1),readPackageJson=async e=>{const t=path__default$1.default.join(e,"package.json");if(!await fsExists(t))throw new Error(`package.json not found at: ${t}`);const n=await fs__default$1.default.promises.readFile(t,"utf8");try{return JSON.parse(n)}catch(a){throw new Error(`Cannot parse package.json: ${a.message}`)}},normalizePath$1=e=>/^[./]/.test(e)?e:`./${e}`;var __defProp$4=Object.defineProperty,__defProps$3=Object.defineProperties,__getOwnPropDescs$3=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$3=Object.getOwnPropertySymbols,__hasOwnProp$4=Object.prototype.hasOwnProperty,__propIsEnum$3=Object.prototype.propertyIsEnumerable,__defNormalProp$3=(e,t,r)=>t in e?__defProp$4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues$3=(e,t)=>{for(var r in t||(t={}))__hasOwnProp$4.call(t,r)&&__defNormalProp$3(e,r,t[r]);if(__getOwnPropSymbols$3)for(var r of __getOwnPropSymbols$3(t))__propIsEnum$3.call(t,r)&&__defNormalProp$3(e,r,t[r]);return e},__spreadProps$3=(e,t)=>__defProps$3(e,__getOwnPropDescs$3(t));const getFileType=e=>{if(e.endsWith(".mjs"))return"module";if(e.endsWith(".cjs"))return"commonjs"},isPath=e=>e.startsWith(".");function parseExportsMap(e,t,r="exports"){if(e){if(typeof e=="string")return isPath(e)?[{outputPath:e,type:getFileType(e)||t,from:r}]:[];if(Array.isArray(e))return e.filter(isPath).map((a,o)=>({outputPath:a,type:getFileType(a)||t,from:`${r}[${o}]`}));if(typeof e=="object")return Object.entries(e).flatMap(([n,a])=>{if(typeof a=="string"){const o={outputPath:a,from:`${r}.${n}`};if(n==="require")return __spreadProps$3(__spreadValues$3({},o),{type:"commonjs"});if(n==="import")return __spreadProps$3(__spreadValues$3({},o),{type:getFileType(a)||t});if(n==="types")return __spreadProps$3(__spreadValues$3({},o),{type:"types"});if(n==="node")return __spreadProps$3(__spreadValues$3({},o),{type:getFileType(a)||t,platform:"node"});if(n==="default")return __spreadProps$3(__spreadValues$3({},o),{type:getFileType(a)||t})}return parseExportsMap(a,t,`${r}.${n}`)})}return[]}function addExportPath(e,t){t.outputPath=normalizePath$1(t.outputPath);const{outputPath:r,type:n,platform:a}=t,o=e[r];if(o){if(o.type!==n)throw new Error(`Conflicting export types "${o.type}" & "${n}" found for ${r}`);if(o.platform!==a)throw new Error(`Conflicting export platforms "${o.platform}" & "${a}" found for ${r}`)}e[r]=t}const getExportEntries=e=>{var t,r,n,a;const o={},l=(t=e.type)!=null?t:"commonjs";if(e.main){const g=e.main;addExportPath(o,{outputPath:g,type:(r=getFileType(g))!=null?r:l,from:"main"})}if(e.module&&addExportPath(o,{outputPath:e.module,type:"module",from:"module"}),e.types&&addExportPath(o,{outputPath:e.types,type:"types",from:"types"}),e.bin){const{bin:g}=e;if(typeof g=="string")addExportPath(o,{outputPath:g,type:(n=getFileType(g))!=null?n:l,isExecutable:!0,from:"bin"});else for(const[s,uu]of Object.entries(g))addExportPath(o,{outputPath:uu,type:(a=getFileType(uu))!=null?a:l,isExecutable:!0,from:`bin.${s}`})}if(e.exports){const g=parseExportsMap(e.exports,l);for(const s of g)addExportPath(o,s)}return Object.values(o)},externalProperties=["peerDependencies","dependencies","optionalDependencies"],getExternalDependencies=e=>{const t=[];for(const r of externalProperties){const n=e[r];n&&t.push(...Object.keys(n))}return t},getAliases=({imports:e},t)=>{const r={};if(e)for(const n in e){if(n.startsWith("#"))continue;const a=e[n];typeof a=="string"&&(r[n]=path__default$1.default.join(t,a))}return r},{stringify}=JSON;async function tryExtensions(e,t){for(const r of t){const n=e+r;if(await fsExists(n))return n}}const sourceExtensions={".d.ts":[".d.ts",".ts"],".js":[".js",".ts",".tsx"],".mjs":[".mjs",".js",".mts",".ts"],".cjs":[".cjs",".js",".cts",".ts"]};async function getSourcePath(e,t,r){if(!e.outputPath.startsWith(r))throw new Error(`Export path ${stringify(e.outputPath)} from ${stringify(`package.json#${e.from}`)} is not in directory ${r}`);const n=path__default$1.default.join(t,e.outputPath.slice(r.length));for(const a of Object.keys(sourceExtensions))if(e.outputPath.endsWith(a)){const o=await tryExtensions(n.slice(0,-a.length),sourceExtensions[a]);if(o)return o}throw new Error(`Could not find mathing source file for export path ${stringify(e.outputPath)}`)}var require$2=require,__defProp$3=Object.defineProperty,__defProps$2=Object.defineProperties,__getOwnPropDescs$2=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$2=Object.getOwnPropertySymbols,__hasOwnProp$3=Object.prototype.hasOwnProperty,__propIsEnum$2=Object.prototype.propertyIsEnumerable,__defNormalProp$2=(e,t,r)=>t in e?__defProp$3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues$2=(e,t)=>{for(var r in t||(t={}))__hasOwnProp$3.call(t,r)&&__defNormalProp$2(e,r,t[r]);if(__getOwnPropSymbols$2)for(var r of __getOwnPropSymbols$2(t))__propIsEnum$2.call(t,r)&&__defNormalProp$2(e,r,t[r]);return e},__spreadProps$2=(e,t)=>__defProps$2(e,__getOwnPropDescs$2(t));const virtualModuleName="pkgroll:create-require",isEsmVariableName=`IS_ESM${Math.random().toString(36).slice(2)}`,createRequire=()=>__spreadProps$2(__spreadValues$2({},inject__default.default({require:virtualModuleName})),{name:"create-require",resolveId:e=>e===virtualModuleName?e:null,load(e){return e!==virtualModuleName?null:`
|
|
23
|
+
import { createRequire } from 'module';
|
|
24
|
+
|
|
25
|
+
export default (
|
|
26
|
+
${isEsmVariableName}
|
|
27
|
+
? createRequire(import.meta.url)
|
|
28
|
+
: require
|
|
29
|
+
);
|
|
30
|
+
`}}),isFormatEsm=e=>({name:"create-require-insert-format",renderChunk:replace__default.default({[isEsmVariableName]:e}).renderChunk});var path=path__default$1.default,fs=fs__default$1.default;function _interopDefaultLegacy$1(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var path__default=_interopDefaultLegacy$1(path),fs__default=_interopDefaultLegacy$1(fs);function slash(e){const t=/^\\\\\?\\/.test(e),r=/[^\u0000-\u0080]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}function findConfigFile(e,t){for(;;){const r=path__default.default.join(e,t);if(fs__default.default.existsSync(r))return slash(r);const n=path__default.default.dirname(e);if(n===e)return;e=n}}var require$1=commonjsRequire;function createScanner(e,t){t===void 0&&(t=!1);var r=e.length,n=0,a="",o=0,l=16,g=0,s=0,uu=0,Du=0,eu=0;function tu(ru,Cu){for(var pu=0,fu=0;pu<ru||!Cu;){var Fu=e.charCodeAt(n);if(Fu>=48&&Fu<=57)fu=fu*16+Fu-48;else if(Fu>=65&&Fu<=70)fu=fu*16+Fu-65+10;else if(Fu>=97&&Fu<=102)fu=fu*16+Fu-97+10;else break;n++,pu++}return pu<ru&&(fu=-1),fu}function au(ru){n=ru,a="",o=0,l=16,eu=0}function nu(){var ru=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&isDigit(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&isDigit(e.charCodeAt(n)))for(n++;n<e.length&&isDigit(e.charCodeAt(n));)n++;else return eu=3,e.substring(ru,n);var Cu=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&isDigit(e.charCodeAt(n))){for(n++;n<e.length&&isDigit(e.charCodeAt(n));)n++;Cu=n}else eu=3;return e.substring(ru,Cu)}function lu(){for(var ru="",Cu=n;;){if(n>=r){ru+=e.substring(Cu,n),eu=2;break}var pu=e.charCodeAt(n);if(pu===34){ru+=e.substring(Cu,n),n++;break}if(pu===92){if(ru+=e.substring(Cu,n),n++,n>=r){eu=2;break}var fu=e.charCodeAt(n++);switch(fu){case 34:ru+='"';break;case 92:ru+="\\";break;case 47:ru+="/";break;case 98:ru+="\b";break;case 102:ru+="\f";break;case 110:ru+=`
|
|
31
|
+
`;break;case 114:ru+="\r";break;case 116:ru+=" ";break;case 117:var Fu=tu(4,!0);Fu>=0?ru+=String.fromCharCode(Fu):eu=4;break;default:eu=5}Cu=n;continue}if(pu>=0&&pu<=31)if(isLineBreak(pu)){ru+=e.substring(Cu,n),eu=2;break}else eu=6;n++}return ru}function cu(){if(a="",eu=0,o=n,s=g,Du=uu,n>=r)return o=r,l=17;var ru=e.charCodeAt(n);if(isWhiteSpace(ru)){do n++,a+=String.fromCharCode(ru),ru=e.charCodeAt(n);while(isWhiteSpace(ru));return l=15}if(isLineBreak(ru))return n++,a+=String.fromCharCode(ru),ru===13&&e.charCodeAt(n)===10&&(n++,a+=`
|
|
32
|
+
`),g++,uu=n,l=14;switch(ru){case 123:return n++,l=1;case 125:return n++,l=2;case 91:return n++,l=3;case 93:return n++,l=4;case 58:return n++,l=6;case 44:return n++,l=5;case 34:return n++,a=lu(),l=10;case 47:var Cu=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<r&&!isLineBreak(e.charCodeAt(n));)n++;return a=e.substring(Cu,n),l=12}if(e.charCodeAt(n+1)===42){n+=2;for(var pu=r-1,fu=!1;n<pu;){var Fu=e.charCodeAt(n);if(Fu===42&&e.charCodeAt(n+1)===47){n+=2,fu=!0;break}n++,isLineBreak(Fu)&&(Fu===13&&e.charCodeAt(n)===10&&n++,g++,uu=n)}return fu||(n++,eu=1),a=e.substring(Cu,n),l=13}return a+=String.fromCharCode(ru),n++,l=16;case 45:if(a+=String.fromCharCode(ru),n++,n===r||!isDigit(e.charCodeAt(n)))return l=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return a+=nu(),l=11;default:for(;n<r&&su(ru);)n++,ru=e.charCodeAt(n);if(o!==n){switch(a=e.substring(o,n),a){case"true":return l=8;case"false":return l=9;case"null":return l=7}return l=16}return a+=String.fromCharCode(ru),n++,l=16}}function su(ru){if(isWhiteSpace(ru)||isLineBreak(ru))return!1;switch(ru){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function ou(){var ru;do ru=cu();while(ru>=12&&ru<=15);return ru}return{setPosition:au,getPosition:function(){return n},scan:t?ou:cu,getToken:function(){return l},getTokenValue:function(){return a},getTokenOffset:function(){return o},getTokenLength:function(){return n-o},getTokenStartLine:function(){return s},getTokenStartCharacter:function(){return o-Du},getTokenError:function(){return eu}}}function isWhiteSpace(e){return e===32||e===9||e===11||e===12||e===160||e===5760||e>=8192&&e<=8203||e===8239||e===8287||e===12288||e===65279}function isLineBreak(e){return e===10||e===13||e===8232||e===8233}function isDigit(e){return e>=48&&e<=57}var ParseOptions;(function(e){e.DEFAULT={allowTrailingComma:!1}})(ParseOptions||(ParseOptions={}));function parse$1(e,t,r){t===void 0&&(t=[]),r===void 0&&(r=ParseOptions.DEFAULT);var n=null,a=[],o=[];function l(s){Array.isArray(a)?a.push(s):n!==null&&(a[n]=s)}var g={onObjectBegin:function(){var s={};l(s),o.push(a),a=s,n=null},onObjectProperty:function(s){n=s},onObjectEnd:function(){a=o.pop()},onArrayBegin:function(){var s=[];l(s),o.push(a),a=s,n=null},onArrayEnd:function(){a=o.pop()},onLiteralValue:l,onError:function(s,uu,Du){t.push({error:s,offset:uu,length:Du})}};return visit(e,g,r),a[0]}function visit(e,t,r){r===void 0&&(r=ParseOptions.DEFAULT);var n=createScanner(e,!1);function a(iu){return iu?function(){return iu(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}function o(iu){return iu?function(Eu){return iu(Eu,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}var l=a(t.onObjectBegin),g=o(t.onObjectProperty),s=a(t.onObjectEnd),uu=a(t.onArrayBegin),Du=a(t.onArrayEnd),eu=o(t.onLiteralValue),tu=o(t.onSeparator),au=a(t.onComment),nu=o(t.onError),lu=r&&r.disallowComments,cu=r&&r.allowTrailingComma;function su(){for(;;){var iu=n.scan();switch(n.getTokenError()){case 4:ou(14);break;case 5:ou(15);break;case 3:ou(13);break;case 1:lu||ou(11);break;case 2:ou(12);break;case 6:ou(16);break}switch(iu){case 12:case 13:lu?ou(10):au();break;case 16:ou(1);break;case 15:case 14:break;default:return iu}}}function ou(iu,Eu,du){if(Eu===void 0&&(Eu=[]),du===void 0&&(du=[]),nu(iu),Eu.length+du.length>0)for(var gu=n.getToken();gu!==17;){if(Eu.indexOf(gu)!==-1){su();break}else if(du.indexOf(gu)!==-1)break;gu=su()}}function ru(iu){var Eu=n.getTokenValue();return iu?eu(Eu):g(Eu),su(),!0}function Cu(){switch(n.getToken()){case 11:var iu=n.getTokenValue(),Eu=Number(iu);isNaN(Eu)&&(ou(2),Eu=0),eu(Eu);break;case 7:eu(null);break;case 8:eu(!0);break;case 9:eu(!1);break;default:return!1}return su(),!0}function pu(){return n.getToken()!==10?(ou(3,[],[2,5]),!1):(ru(!1),n.getToken()===6?(tu(":"),su(),hu()||ou(4,[],[2,5])):ou(5,[],[2,5]),!0)}function fu(){l(),su();for(var iu=!1;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(iu||ou(4,[],[]),tu(","),su(),n.getToken()===2&&cu)break}else iu&&ou(6,[],[]);pu()||ou(4,[],[2,5]),iu=!0}return s(),n.getToken()!==2?ou(7,[2],[]):su(),!0}function Fu(){uu(),su();for(var iu=!1;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(iu||ou(4,[],[]),tu(","),su(),n.getToken()===4&&cu)break}else iu&&ou(6,[],[]);hu()||ou(4,[],[4,5]),iu=!0}return Du(),n.getToken()!==4?ou(8,[4],[]):su(),!0}function hu(){switch(n.getToken()){case 3:return Fu();case 1:return fu();case 10:return ru(!0);default:return Cu()}}return su(),n.getToken()===17?r.allowEmptyContent?!0:(ou(4,[],[]),!1):hu()?(n.getToken()!==17&&ou(9,[],[]),!0):(ou(4,[],[]),!1)}var parse=parse$1;const normalizePath=e=>slash(/^[./]/.test(e)?e:`./${e}`);var __defProp$2=Object.defineProperty,__defProps$1=Object.defineProperties,__getOwnPropDescs$1=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$1=Object.getOwnPropertySymbols,__hasOwnProp$2=Object.prototype.hasOwnProperty,__propIsEnum$1=Object.prototype.propertyIsEnumerable,__defNormalProp$1=(e,t,r)=>t in e?__defProp$2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues$1=(e,t)=>{for(var r in t||(t={}))__hasOwnProp$2.call(t,r)&&__defNormalProp$1(e,r,t[r]);if(__getOwnPropSymbols$1)for(var r of __getOwnPropSymbols$1(t))__propIsEnum$1.call(t,r)&&__defNormalProp$1(e,r,t[r]);return e},__spreadProps$1=(e,t)=>__defProps$1(e,__getOwnPropDescs$1(t));function readTsconfig(e){var o,l;const t=fs__default.default.realpathSync(e),r=path__default.default.dirname(t),n=fs__default.default.readFileSync(e,"utf8").trim();let a={};if(n&&(a=parse(n),!a||typeof a!="object"))throw new SyntaxError(`Failed to parse JSON: ${e}`);if(a.extends){let g=a.extends;try{g=require$1.resolve(g,{paths:[path__default.default.dirname(e)]})}catch(Du){if(Du.code==="MODULE_NOT_FOUND")try{g=require$1.resolve(path__default.default.join(g,"tsconfig.json"),{paths:[path__default.default.dirname(e)]})}catch{}}const s=readTsconfig(g);if(delete s.references,(o=s.compilerOptions)==null?void 0:o.baseUrl){const{compilerOptions:Du}=s;Du.baseUrl=path__default.default.relative(r,path__default.default.join(path__default.default.dirname(g),Du.baseUrl))}s.files&&(s.files=s.files.map(Du=>path__default.default.relative(r,path__default.default.join(path__default.default.dirname(g),Du)))),s.include&&(s.include=s.include.map(Du=>path__default.default.relative(r,path__default.default.join(path__default.default.dirname(g),Du)))),delete a.extends;const uu=__spreadProps$1(__spreadValues$1(__spreadValues$1({},s),a),{compilerOptions:__spreadValues$1(__spreadValues$1({},s.compilerOptions),a.compilerOptions)});s.watchOptions&&(uu.watchOptions=__spreadValues$1(__spreadValues$1({},s.watchOptions),a.watchOptions)),a=uu}if((l=a.compilerOptions)!=null&&l.baseUrl){const{compilerOptions:g}=a;g.baseUrl=normalizePath(g.baseUrl)}if(a.files&&(a.files=a.files.map(normalizePath)),a.include&&(a.include=a.include.map(slash)),a.watchOptions){const{watchOptions:g}=a;g.excludeDirectories&&(g.excludeDirectories=g.excludeDirectories.map(s=>slash(path__default.default.resolve(r,s))))}return a}function getTsconfig(e=process.cwd(),t="tsconfig.json"){const r=findConfigFile(e,t);if(!r)return null;const n=readTsconfig(r);return{path:r,config:n}}var dist=getTsconfig;const tsconfig=dist();var __defProp$1=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp$1=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp$1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp$1.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));function esbuildTransform(e){const t=pluginutils.createFilter(/\.([cm]?ts|[jt]sx)$/);return{name:"esbuild-transform",async transform(r,n){var a;if(!t(n))return null;const o=await esbuild.transform(r,__spreadProps(__spreadValues({},e),{loader:"default",sourcefile:n.replace(/\.[cm]ts/,".ts"),tsconfigRaw:(a=tsconfig)==null?void 0:a.config}));return{code:o.code,map:o.map||null}}}}function esbuildMinify(e){return{name:"esbuild-minify",async renderChunk(t){const r=await esbuild.transform(t,__spreadProps(__spreadValues({},e),{minify:!0}));return{code:r.code,map:r.map||null}}}}const compareSemver=(e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2],externalizeNodeBuiltins=({target:e})=>{const t=e.some(r=>{var n,a;if(r=r.trim(),!r.startsWith("node"))return;const o=r.slice(4).split(".").map(Number),l=[o[0],(n=o[1])!=null?n:0,(a=o[2])!=null?a:0];return!(compareSemver(l,[12,20,0])>=0&&compareSemver(l,[13,0,0])<0||compareSemver(l,[14,13,1])>=0)});return{name:"externalize-node-builtins",resolveId:r=>{const n=r.startsWith("node:");if(t&&n&&(r=r.slice(5)),require$$2.builtinModules.includes(r)||n)return{id:r,external:!0}}}},patchBinary=e=>({name:"patch-binary",renderChunk(t,r,n){if(!r.isEntry||!r.facadeModuleId)return;const a=n.entryFileNames,o=`./${path__default$1.default.join(n.dir,a(r))}`;if(e.includes(o)){const l=new MagicString__default.default(t);return l.prepend(`#!/usr/bin/env node
|
|
33
|
+
`),{code:l.toString(),map:n.sourcemap?l.generateMap({hires:!0}):void 0}}},async writeBundle(t,r){const n=t.entryFileNames,a=Object.values(r).map(async o=>{const l=o;if(l.isEntry&&l.facadeModuleId){const g=path__default$1.default.join(t.dir,n(l));await fs__default$1.default.promises.chmod(g,493)}});await Promise.all(a)}});function resolveTypescriptMjsCts(){const e=/\.(?:mjs|cjs)$/,t=/\.(?:mts|cts)$/;return{name:"resolve-typescript-mjs-cjs",resolveId(r,n,a){return e.test(r)&&n&&t.test(n)?this.resolve(r.replace(/js$/,"ts"),n,a):null}}}var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__copyProps=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of __getOwnPropNames(t))!__hasOwnProp.call(e,a)&&a!==r&&__defProp(e,a,{get:()=>t[a],enumerable:!(n=__getOwnPropDesc(t,a))||n.enumerable});return e},__toESM=(e,t,r)=>(r=e!=null?__create(__getProtoOf(e)):{},__copyProps(t||!e||!e.__esModule?__defProp(r,"default",{value:e,enumerable:!0}):r,e));const getConfig={async type(e){const t=await Promise.resolve().then(()=>__toESM(require$2("rollup-plugin-dts")));return{input:[],preserveEntrySignatures:"strict",plugins:[externalizeNodeBuiltins(e),resolveTypescriptMjsCts(),t.default({respectExternal:!0})],output:[],external:[]}},app(e,t,r){const n={target:e.target};return{input:[],preserveEntrySignatures:"strict",plugins:[externalizeNodeBuiltins(e),resolveTypescriptMjsCts(),alias__default.default({entries:t}),nodeResolve__default.default({extensions:[".mjs",".js",".ts",".jsx",".tsx",".json"],exportConditions:["node","import","require","default"]}),commonjs__default.default(),json__default.default(),esbuildTransform(n),createRequire(),...e.minify?[esbuildMinify(n)]:[],patchBinary(r)],output:[],external:[]}}};async function getRollupConfigs(e,t,r,n,a,o){const l=r.filter(({exportEntry:s})=>s.isExecutable).map(({exportEntry:s})=>s.outputPath),g=Object.create(null);for(const{input:s,exportEntry:uu}of r){if(uu.type==="types"){let nu=g.type;nu||(nu=await getConfig.type(n),nu.external=o,g.type=nu),nu.input.push(s);const lu=".d.ts";nu.output=[{dir:t,entryFileNames:cu=>cu.facadeModuleId.slice(e.length).replace(/\.\w+$/,lu),exports:"auto",format:"esm"}];continue}let Du=g.app;Du||(Du=getConfig.app(n,a,l),Du.external=o,g.app=Du),Du.input.push(s);const eu=Du.output,tu=path__default$1.default.extname(uu.outputPath),au=`${uu.type}-${tu}`;if(!eu[au]){const nu={dir:t,exports:"auto",format:uu.type,chunkFileNames:`[name]-[hash]${tu}`,plugins:[isFormatEsm(uu.type==="module")],entryFileNames:lu=>lu.facadeModuleId.slice(e.length).replace(/\.\w+$/,tu)};eu.push(nu),eu[au]=nu}}return g}let enabled=!0;const globalVar=typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{};let supportLevel=0;if(globalVar.process&&globalVar.process.env&&globalVar.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,TERM:r}=globalVar.process.env;t||e==="0"?enabled=!1:e==="1"?enabled=!0:r==="dumb"?enabled=!1:"CI"in globalVar.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(n=>n in globalVar.process.env)?enabled=!0:enabled=process.stdout.isTTY,enabled&&(supportLevel=r&&r.endsWith("-256color")?2:1)}let options={enabled,supportLevel};function kolorist(e,t,r=1){const n=`\x1B[${e}m`,a=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return l=>options.enabled&&options.supportLevel>=r?n+(""+l).replace(o,n)+a:""+l}const gray=kolorist(90,39),currentTime=()=>new Date().toLocaleTimeString(),log=(...e)=>console.log(`[${gray(currentTime())}]`,...e);var _a,_b;const argv=dist$1.cli({name:"pkgroll",flags:{src:{type:String,description:"Source directory",default:"./src"},dist:{type:String,description:"Distribution directory",default:"./dist"},minify:{type:Boolean,description:"Minify output",alias:"m",default:!1},target:{type:[String],default:[`node${process.versions.node}`],description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",alias:"t"},watch:{type:Boolean,description:"Watch mode",alias:"w",default:!1}},help:{description:"Minimalistic package bundler"}}),sourcePath=`${fs__default$1.default.realpathSync(argv.flags.src)}/`,distPath=normalizePath$1(argv.flags.dist),cwd=process.cwd(),tsconfigTarget=(_b=(_a=tsconfig)==null?void 0:_a.config.compilerOptions)==null?void 0:_b.target;tsconfigTarget&&argv.flags.target.push(tsconfigTarget),(async()=>{const e=await readPackageJson(cwd),t=getExportEntries(e);if(t.length===0)throw new Error("No export entries found in package.json");const r=await Promise.all(t.map(async l=>({input:await getSourcePath(l,sourcePath,distPath),exportEntry:l}))),n=getAliases(e,cwd),a=getExternalDependencies(e).filter(l=>!(l in n)).flatMap(l=>[l,new RegExp(`^${l}/`)]),o=await getRollupConfigs(sourcePath,distPath,r,argv.flags,n,a);argv.flags.watch?(log("Watch initialized"),Object.values(o).map(async l=>{rollup.watch(l).on("event",async s=>{s.code==="BUNDLE_START"&&log("Building",...Array.isArray(s.input)?s.input:[s.input]),s.code==="BUNDLE_END"&&(await Promise.all(l.output.map(uu=>s.result.write(uu))),log("Built",...Array.isArray(s.input)?s.input:[s.input])),s.code==="ERROR"&&log("Error:",s.error.message)})})):await Promise.all(Object.values(o).map(async l=>{const g=await rollup.rollup(l);return Promise.all(l.output.map(s=>g.write(s)))}))})().catch(e=>{console.error("Error:",e.message),process.exit(1)});
|
package/package.json
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pkgroll",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Zero-config rollup bundler",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"zero config",
|
|
7
|
+
"rollup",
|
|
8
|
+
"package.json",
|
|
9
|
+
"exports",
|
|
10
|
+
"esm",
|
|
11
|
+
"cjs",
|
|
12
|
+
"commonjs",
|
|
13
|
+
"typescript",
|
|
14
|
+
"declaration"
|
|
15
|
+
],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": "privatenumber/pkgroll",
|
|
18
|
+
"funding": "https://github.com/privatenumber/pkgroll?sponsor=1",
|
|
19
|
+
"author": {
|
|
20
|
+
"name": "Hiroki Osame",
|
|
21
|
+
"email": "hiroki.osame@gmail.com"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"bin": "dist/cli.js",
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "esno src/cli.ts --minify --target node12.19",
|
|
29
|
+
"pretest": "npm run build",
|
|
30
|
+
"test": "esno tests/index.ts",
|
|
31
|
+
"lint": "eslint --cache ."
|
|
32
|
+
},
|
|
33
|
+
"husky": {
|
|
34
|
+
"hooks": {
|
|
35
|
+
"pre-commit": "npm run build && lint-staged && npm test"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"lint-staged": {
|
|
39
|
+
"*.{js,ts}": [
|
|
40
|
+
"eslint",
|
|
41
|
+
"npm test"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"imports": {
|
|
45
|
+
"typescript": "./src/local-typescript-loader.ts"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"typescript": "~4.1 || ~4.2 || ~4.3 || ~4.4 || ~4.5"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {
|
|
51
|
+
"typescript": {
|
|
52
|
+
"optional": true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@rollup/plugin-alias": "^3.1.9",
|
|
57
|
+
"@rollup/plugin-commonjs": "^21.0.3",
|
|
58
|
+
"@rollup/plugin-inject": "^4.0.4",
|
|
59
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
60
|
+
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
61
|
+
"@rollup/plugin-replace": "^4.0.0",
|
|
62
|
+
"@rollup/pluginutils": "^4.2.0",
|
|
63
|
+
"esbuild": "^0.14.29",
|
|
64
|
+
"magic-string": "^0.26.1",
|
|
65
|
+
"rollup": "^2.70.1"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@pvtnbr/eslint-config": "^0.19.1",
|
|
69
|
+
"@types/node": "^17.0.23",
|
|
70
|
+
"@types/rimraf": "^3.0.2",
|
|
71
|
+
"cleye": "^1.1.0",
|
|
72
|
+
"eslint": "^8.12.0",
|
|
73
|
+
"esno": "^0.14.1",
|
|
74
|
+
"execa": "^6.1.0",
|
|
75
|
+
"get-node": "^12.1.0",
|
|
76
|
+
"get-tsconfig": "^3.0.0",
|
|
77
|
+
"husky": "^4.3.8",
|
|
78
|
+
"kolorist": "^1.5.1",
|
|
79
|
+
"lint-staged": "^12.3.7",
|
|
80
|
+
"manten": "^0.0.3",
|
|
81
|
+
"rimraf": "^3.0.2",
|
|
82
|
+
"rollup-plugin-dts": "^4.2.0",
|
|
83
|
+
"type-fest": "^2.12.1",
|
|
84
|
+
"typescript": "^4.6.3"
|
|
85
|
+
},
|
|
86
|
+
"eslintConfig": {
|
|
87
|
+
"extends": "@pvtnbr",
|
|
88
|
+
"ignorePatterns": [
|
|
89
|
+
"tests/fixture-package"
|
|
90
|
+
],
|
|
91
|
+
"rules": {
|
|
92
|
+
"@typescript-eslint/no-shadow": [
|
|
93
|
+
"error",
|
|
94
|
+
{
|
|
95
|
+
"allow": [
|
|
96
|
+
"describe",
|
|
97
|
+
"test"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"unicorn/prevent-abbreviations": [
|
|
102
|
+
"error",
|
|
103
|
+
{
|
|
104
|
+
"replacements": {
|
|
105
|
+
"pkg": false,
|
|
106
|
+
"src": false,
|
|
107
|
+
"dist": false
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|